OGS Title Count

Displays number of games waiting for your move in page title on online-go.com

13.02.2015 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

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

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

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

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

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         OGS Title Count
// @description  Displays number of games waiting for your move in page title on online-go.com
// @author       TPReal
// @namespace    https://greasyfork.org/users/9113
// @version      0.1
// @match        *://online-go.com/*
// @grant        none
// ==/UserScript==

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

var updateTitle=function(){
  var value=angular.element("#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 inject=angular.element(document).injector().get;
var timeout=inject("$timeout");
var tick=function(){
  updateTitle();
  timeout(tick,1000);
};
tick();