FlightRising GUI Improvements Sandboxed Portion

Runs potentially unsafe code in a protective sandbox.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// Generated by CoffeeScript 1.9.3

/* UserScript options {{{1
// ==UserScript==
// @name         FlightRising GUI Improvements Sandboxed Portion
// @description  Runs potentially unsafe code in a protective sandbox.
// @namespace    ahto
// @version      1.1.2
// @include      http://*flightrising.com/*
// @require      https://greasyfork.org/scripts/10922-ahto-library/code/Ahto%20Library.js?version=75750
// @grant        GM_addStyle
// ==/UserScript==
 */
var addCheckboxListeners, updateCheckbox;

if (new RegExp('http://www1\.flightrising\.com/msgs$', 'i').test(document.location.href)) {
  GM_addStyle('#ajaxbody tr.highlight-tr.selected-tr {\n    background-color: #CAA;\n}\n\n#ajaxbody tr.selected-tr {\n    background-color: #CBB;\n}');
  updateCheckbox = function(targetCheckbox) {
    var tr;
    tr = targetCheckbox.parents('tr');
    if (targetCheckbox.prop('checked')) {
      return tr.addClass('selected-tr');
    } else {
      return tr.removeClass('selected-tr');
    }
  };
  addCheckboxListeners = function() {
    return findMatches('#ajaxbody tr input[type=checkbox]').click(function(event) {
      return updateCheckbox($(event.target));
    });
  };
  addCheckboxListeners();
  findMatches('input#set', 1, 1).click(function(event) {
    var i, j, len, ref, results;
    ref = findMatches('#ajaxbody tr input[type=checkbox]');
    results = [];
    for (j = 0, len = ref.length; j < len; j++) {
      i = ref[j];
      results.push(updateCheckbox($(i)));
    }
    return results;
  });
  findMatches('img#prev, img#next, button#delete-confirm-yes', 0, 3).click(function(event) {
    return setTimeout((function() {
      return addCheckboxListeners();
    }), 500);
  });
}