OGS Utilities

Small improvements of online-go.com

اعتبارا من 14-02-2015. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         OGS Utilities
// @description  Small improvements of online-go.com
// @author       TPReal
// @namespace    https://greasyfork.org/users/9113
// @version      0.2.1
// @match        *://online-go.com/*
// @grant        none
// ==/UserScript==

var TITLE_MATCHER=/^(?:\[\d+\] )?(.*)$/;

var updateTitle=function(){
  var value=$("#turn-notification-indicator").text();
  var prefix="";
  if(value&&value!="0")
    prefix="["+value+"] ";
  var baseTitle=TITLE_MATCHER.exec(document.title)[1];
  document.title=prefix+baseTitle;
};

var isFullscreen=function(){
  return screen.width==window.outerWidth&&screen.height==window.outerHeight;
};

var fullscreenStyle=$("<style> \
  #game-main-container > #game-controls { \
    display:none; \
  } \
  </style>").appendTo(document.head)[0];

var updateFullscreenStyle=function(){
  fullscreenStyle.sheet.disabled=!isFullscreen();
};

var tick=function(){
  updateTitle();
  updateFullscreenStyle();
  setTimeout(tick,1000);
};
tick();