InstaSynchP Bibby

Bibby specific changes

当前为 2015-02-21 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        InstaSynchP Bibby
// @namespace   InstaSynchP
// @description Bibby specific changes

// @version     1.0.2
// @author      Zod-
// @source      https://github.com/Zod-/InstaSynchP-Bibby
// @license     MIT

// @include     *://instasync.com/r/*
// @include     *://*.instasync.com/r/*
// @grant       none
// @run-at      document-start

// @require     https://greasyfork.org/scripts/5647-instasynchp-library/code/InstaSynchP%20Library.js?version=37716
// ==/UserScript==

function Bibby(version) {
  "use strict";
  this.version = version;
  this.name = 'InstaSynchP Bibby';
  this.settings = [{
    'label': 'Wallcounter limit notifications',
    'id': 'wallcounter-hide',
    'type': 'checkbox',
    'default': false,
    'section': ['Bibby']
  }];
}

Bibby.prototype.wallcounterNotification = function (video) {
  var wallcounter = window.plugins.wallcounter,
    message, counter;
  if (isUdef(wallcounter)) {
    //wallcounter not installed
    return;
  }
  counter = wallcounter.counter[video.addedby.toLowerCase()];
  if (isUdef(counter) || counter.duration < 60 * 60) {
    //nothing to report
    return;
  }
  message = 'Wallcounter {0}[{1} - {2}]'.format(
    counter.origName,
    window.utils.secondsToTime(counter.duration),
    counter.count);
  addErrorMessage(message);
};

Bibby.prototype.postConnect = function () {
  "use strict";
  var th = this;
  if(window.room.roomName.toLowerCase() !== 'bibby'){
    return;
  }
  //add events after we connected so it doesn't spam the chat
  events.on(th, 'AddVideo', th.wallcounterNotification);
};


Bibby.prototype.resetVariables = function () {
  "use strict";
  var th = this;
  events.unbind('AddVideo', th.wallcounterNotification);
};

window.plugins = window.plugins || {};
window.plugins.bibby = new Bibby('1.0.2');