Friday, March 16, 2012

Neopets : Avatars Flash Games [BETA]


// ==UserScript==
// @name           Neopets : Avatars Flash Games [BETA]
// @namespace      http://gm.wesley.eti.br
// @description    Displays Avatars Flash Games and lets us to send score automatically
// @author         w35l3y
// @email          w35l3y@brasnet.org
// @copyright      2012+, w35l3y (http://gm.wesley.eti.br)
// @license        GNU GPL
// @homepage       http://gm.wesley.eti.br
// @version        1.0.0.8
// @language       en
// @include        http://www.neopets.com/games/game.phtml?game_id=*
// @exclude        http://www.neopets.com/games/game.phtml?game_id=*&play=true
// @icon           http://www.gravatar.com/avatar.php?gravatar_id=81269f79d21e612f9f307d16b09ee82b&r=PG&s=92&default=identicon
// @resource       meta http://userscripts.org/scripts/source/127882.meta.js
// @resource       i18n http://pastebin.com/download.php?i=ULrVTsSg
// @require        http://www.onicos.com/staff/iz/amuse/javascript/expert/md5.txt
// @require        http://userscripts.org/scripts/source/63808.user.js
// @require        http://userscripts.org/scripts/source/56489.user.js
// @require        http://userscripts.org/scripts/source/69584.user.js
// @require        http://userscripts.org/scripts/source/85618.user.js
// @require        http://userscripts.org/scripts/source/87940.user.js
// @require        http://userscripts.org/scripts/source/87942.user.js
// @require        http://userscripts.org/scripts/source/85450.user.js
// @require        http://userscripts.org/scripts/source/127696.user.js
// @require        http://images.neopets.com/js/jquery-1.7.1.min.js?v=1
// @require        http://images.neopets.com/js/jquery.colorbox.min.js?v=1
// ==/UserScript==

/**************************************************************************

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

**************************************************************************/

//GM_setValue("call_url", false);
//GM_setValue("stored", false);
//GM_setValue("mod_change", 1);
//GM_setValue("beep", false);
//GM_setValue("generic", true);

GM_addStyle((<><![CDATA[
#gr-ctp-avatar-btn {
  background: url("http://i39.tinypic.com/24wyjrq.png") no-repeat scroll 0 0 transparent;
  bottom: 120px;
  height: 38px;
  position: absolute;
  right: 80px;
  width: 38px;
  z-index: 11;
}
#gr-ctp-avatar-btn:hover {
    background-position: 0 -38px;
}
#ctp-title-avatar {
  background-image: url("http://images.neopets.com/games/pages/popups/headers/settings.png");
}
.ctp-avatar-save {
  background-image: url("http://images.neopets.com/games/pages/popups/buttons/bg.png");
  background-position: -184px 0;
  background-repeat: no-repeat;
  display: block;
  left: 150px;
  margin-top: 5px;
  width: 108px;
}
.ctp-avatar-save:hover {
  background-position: -184px -26px;
}
#gr-ctp-avatar th, #gr-ctp-avatar td.aleft {
 text-align: left;
}
#gr-ctp-avatar th.acenter {
 text-align: center;
}
.confirmation, #ctp-message {
 display: none;
}
#field_score, #field_time {
 width: 86px;
}
]]></>).toString());

(function () { // script scope
 var games = {
 // "id"  : [min_score, ratio_score, ratio_time, mod_score, avatar_gif, avatar_name],
 // + non-avatar games
  "970" : [345, 860, 164, 1],
 // + avatar games
  "149" : [250, 33, 2322, 1, "kacheek06.gif", "Kacheek - Herder"],
  "159" : [1000, 875, 589, 1, "gadsgadsgame.gif", "Gadgadsgame"],
  "197" : [1220, 260, 483, 1, "efmcdraik.gif", "Draik - Escape from Meridell Castle"],
  "198" : [2250, 746, 159, 1, "donna_wasm.gif", "Revenge is Sweet"],
  "204" : [700, 89, 347, 1, "acezafara.gif", "Ace Zafara"],
  "212" : [1100, 7, 556, 10, "gtu.gif", "Grand Theft Ummagine"],
  "226" : [200, 19, 1469, 1, "extremepotato.gif", "Extreme Potato Counter"],
  "228" : [250, 12, 1673, 10, "petpetrescue.gif", "Petpet Rescue"],
  "230" : [1200, 451, 492, 1, "evileliv.gif", "Evil Eliv Thade"],
  "248" : [800, 358, 721, 1, "maraquanraider.gif", "Raider Of Maraqua"],
  "306" : [2000, 1215, 226, 1, "sutekstomb.gif", "Suteks Tomb"],
  "307" : [300, 224, 1543, 1, "techobuzz.gif", "Techo - The Buzzer Game"],
  "315" : [800, 12, 1743, 10, "myncispike.gif", "Spike It!"],
  "358" : [2000, 265, 301, 1, "faeriebubbles.gif", "Faerie Bubbles"],
  "379" : [3500, 1215, 239, 1, "ahhhhmeepit.gif", "A Meepit! Run!"],
  "381" : [850, 149, 37, 1, "whackedkass.gif", "Whack-a-Kass"],
  "390" : [1250, 586, 707, 1, "ff_yoinked.gif", "Freaky Factory - Yoinked"],
  "412" : [5000, 1245, 101, 1, "snowmuncher.gif", "Snowmuncher"],
  "428" : [2500, 265, 364, 5, "petpetsitter.gif", "Petpetsitter"],
  "500" : [1250, 451, 691, 1, "meercachase.gif", "Meerca Chase"],
  "507" : [14500, 605, 83, 5, "icecreammachine.gif", "Ice Cream Machine"],
  "538" : [1000, 194, 758, 1, "jellyprocessing.gif", "Skeith - Jelly Processing Plant"],
  "539" : [1300, 141, 404, 1, "chiabomber.gif", "Chia Bomber"],
  "540" : [3000, 241, 326, 1, "meepvsfeep.gif", "Meepit Vs Feepit"],
  "544" : [10000, 881, 102, 1, "grundo_snowthrow.gif", "Grundo - Snowthrow!"],
  "574" : [3600, 123, 149, 1, "typingterror.gif", "Typing Terror"],
  "645" : [250, 14, 2734, 1, "florg.gif", "Chia - Florg"],
  "761" : [1500, 21, 359, 1, "volcanorun.gif", "Volcano Run"],
  "763" : [3500, 454, 241, 1, "magax.gif", "Magax: Destroyer"],
  "772" : [2500, 111, 234, 5, "smuggleddubloon.gif", "Smuggler's Dubloon"],
  "801" : [9050, 34, 133, 10, "freakedkorbat.gif", "Freaked Korbat"],
  "852" : [1200, 358, 491, 1, "deckswabber.gif", "Deckswabber"],
  "885" : [7530, 16, 109, 10, "mathsbabaa.gif", "Babaa - Maths Nightmare"],
  "902" : [725, 103, 467, 1, "carnival_terror.gif", "Carnival of Terror"],
  "903" : [100, 30, 2415, 1, "bullseye.gif", "Turtum"],
  "999" : [2500, 230, 237, 1, "destructomatch2.gif", "Destruct-O-Match II"],
  "1042": [2250, 19, 398, 10, "mutantgravedoom.gif", "Mutant Graveyard of Doom II"],
  "1048": [4000, 24, 316, 10, "nimmospond.gif", "Nimmos Pond"],
 },
 doc = FlashGame.convert(document, "play"),
 id = parseInt(/game_id=(\d+)/.test(location.search) && RegExp.$1 || doc.id, 10);

 if (!doc.error && !doc.link && !isNaN(id) && (id in games || GM_getValue("generic", false)) && (!doc.shockwave || GM_getValue("scoresender", false))) {
  var list = JSON.parse(GM_getValue("games", "{}")),
  usern = xpath("string(.//a[contains(@href, '/userlookup.phtml?user=')]/text())"),
  slist = [],
  play = {},
  data_g = function (id) {
   return GM_getValue("stored", true) && games[id] || list[id] || games[id] || [0, 0, 0, 100];
  },
  data = data_g(id),
  randscore = function () {
   var result = [Math.ceil(data[0] || 1000 * doc.ratio), 1000 * Math.random()],
   x = Math.max(doc.highscores.length - 2, 0);

   if (x) {
    if (result[0] > doc.highscores[x]) {
     data[0] = result[0] = doc.highscores[x];
    } else if (!data[0]) {
     data[0] = result[0];
    }
    data[0] -= data[0] % data[3];
    if (!data[1]) {
     data[1] = Math.ceil((doc.highscores[x - 1] - data[0]) / data[3]);
    }
   }
   result[0] += data[1] * data[3] * Math.random();
   if (doc.highscores.length && result[0] > doc.highscores[0]) {
    result[0] = doc.highscores[0];
   }
   result[0] -= result[0] % data[3];
   result[0] = Math.floor(result[0]);
   result[1] += data[2] * (1 + 0.1 * Math.random()) * result[0];
   result[1] = Math.ceil(result[1]);
   
   return result;
  },
  copy = {
   "gr-ctp-settings-btn" : {
    rename : ["settings", "avatar"],
    execute : function (node) {
    },
   },
   "gr-ctp-settings" : {
    rename : ["settings", "avatar"],
    execute : function (node) {
     var btn = xpath("id('ctp-avatar-save')/img", node)[0],
     table = xpath("./ancestor::table[1]", btn)[0];
     table.setAttribute("style", "margin: 0 20px;");
     btn.src = btn.src.replace("use-these-settings", "submit");
     btn.parentNode.parentNode.setAttribute("class", "confirmation-2");
     btn.parentNode.parentNode.setAttribute("colspan", 3);
     btn.parentNode.setAttribute("href", "javascript:void(0)");
     btn.parentNode.setAttribute("alt", "Submit");
     btn.parentNode.setAttribute("class", "ctp-avatar-save");
     btn.parentNode.parentNode.setAttribute("height", "50");
     btn.parentNode.parentNode.appendChild(document.createElement("br"));
     var td = btn.parentNode.parentNode.cloneNode(true),
     btn2 = xpath(".//a[@id]", td)[0],
     span = document.createElement("span"),
     score_time = randscore();

     td.setAttribute("class", "confirmation");
     btn2.setAttribute("id", "ctp-avatar-save-2");
     span.setAttribute("id", "ctp-message");
     btn2.parentNode.insertBefore(span, btn2.nextElementSibling);
     btn.parentNode.parentNode.parentNode.appendChild(td);
     table.rows[0].innerHTML = '<th style="width:75px" class="confirmation-2">Score</th><td style="width:91px" class="confirmation-2"><input name="score" type="text" id="field_score"  value="' + score_time[0] + '" /></td><td rowspan="2" width="50" height="50" class="confirmation-2"><img id="image_avatar" src="http://images.neopets.com/neoboards/avatars/' + (data[4] || "default.gif") + '" title="' + (data[5] || doc.name || "") + '" /></td><td rowspan="6" class="confirmation confirmation-2" style="width:5px">&nbsp;</td><th colspan="2" class="confirmation" id="label_score">' + score_time[0] + '</th>';
     table.rows[1].innerHTML = '<th class="confirmation-2">Time (ms)</th><td class="confirmation-2"><input type="text" name="time" id="field_time" value="' + score_time[1] + '" /></td><th colspan="2" class="confirmation" id="label_time"><span class="red">00:00</span></th>';

     var groups = [{
      name:"captcha",
      list:[
       '<th class="confirmation-2"><img src="http://www.showmycode.com/?c" id="image_captcha" /></th><td colspan="2" class="confirmation-2"><input id="field_captcha" name="captcha" maxlength="1" /></td><th class="confirmation">Params</th><td class="confirmation aleft" id="label_opts"><span class="red">0|0|0|||</span></td>',
       '<th colspan="3" class="acenter confirmation-2">Captcha</th><th class="confirmation">Username&nbsp;</th><td class="confirmation aleft" id="label_username">' + usern + '</td>',
      ],
     },];

     for each (var g in groups) {
      for each (var t in g.list) {
       var row = table.insertRow(2);
       row.setAttribute("class", g.name);
       row.innerHTML = t;
      }
     }
     table.insertRow(2).innerHTML = '<td colspan="2" class="aleft confirmation-2"><input id="field_cache" name="cache" type="checkbox" value="1" /> <label for="field_cache">Try cached encryption</label></td><td class="confirmation-2"><input type="button" value="R" title="Randomize" id="button_rand" /></td><th class="confirmation" style="width:75px">Game</th><td class="confirmation aleft" style="width:205px" id="label_game">' + doc.name + ' (' + id + ')</td>';
    },
   },
  },
  first = true,
  ratios = JSON.parse(GM_getValue("ratios", "{}"));

  if (doc.shockwave) {
   for (var v in list) {
    slist.push(v);
   }
  }

  for (var c in copy) {
   var node = xpath("id('" + c + "')")[0],
   tmp = node.cloneNode(true),
   r = copy[c].rename;
   tmp.setAttribute("id", String.prototype.replace.apply(tmp.getAttribute("id"), r));
   for each (var n in xpath(".//*[contains(@name, '" + r[0] + "') or contains(@id, '" + r[0] + "')]", tmp)) {
    var a = (n.hasAttribute("id") ? "id" : "name");
    n.setAttribute(a, String.prototype.replace.apply(n.getAttribute(a), r));
   }
   copy[c].execute(tmp);
   node.parentNode.insertBefore(tmp, node);
  }

  $(document).ready(function (e) {
   $("#gr-ctp-avatar-btn").click(function (e) {
    $.colorbox({ inline:true, href:"#gr-ctp-avatar", open:true, opacity:0.70, scrolling:false, onOpen: function () { $('.p3bug').hide(); }, onClosed: function () {
     if (play.stop instanceof Function) {
      play.stop(play);
     }
     $("#ctp-avatar-save").show();
     $('.p3bug').show();
    }});
   });
   $("#ctp-avatar-save-2").click(function (e) {
    e.preventDefault();
    $("#ctp-message").html("&nbsp;").show();

    $("#ctp-avatar-save-2").hide();

    play.start(play);
   });
  });

  if (!doc.shockwave) {
   if (ratios[id] != 100 * doc.ratio) {
    ratios[id] = 100 * doc.ratio;
    GM_setValue("ratios", JSON.stringify(ratios));
   }
   $(".confirmation-2").show();
   $(document).ready(function (e) {
    $("#button_rand").click(function (e) {
     var score_time = randscore();
     
     $("#field_score").val(score_time[0]);
     $("#field_time").val(score_time[1]);
    });
    $("#image_captcha").click(function (e) {
     $(this).attr("src", "http://www.showmycode.com/?c#r" + Math.random());
     $("#field_captcha").focus();
    });
    $("#field_score").change(function (e) {
     var mod = [],
     v = parseInt($(this).val(), 10),
     mc = GM_getValue("mod_change", 3),
     mods = [100, 50, 25, 20, 10, 8, 5, 2, 1];
     $("#field_time").val(Math.ceil(data[2] * (1 + 0.1 * Math.random()) * v + 1000 * Math.random())).change();

     if (!data[1]) {
      mod = data[0];
     } else {
      for each (var b in mods) {
       if (v && v % b == 0) {
        mod.push(b);
        break;
       }
      }

      mod = Math.min.apply(this, mod);
     }

     if (data[3] != mod && (-1 != mods.indexOf(data[3]) || (mc & 4)) && ((mc & 1) && data[3] > mod && confirm("Mod has changed from " + data[3] + " to " + mod + ". Continue?") || (mc & 2) && (mod = parseInt(prompt("Define mod score manually:", (data[3] < mod?mod:data[3])), 10)) > 0)) {
      data[3] = mod;
      data[0] -= data[0] % mod;
     }
    });
    $("#ctp-avatar-save-2").show(function (e) { 
     $("#ctp-message").hide();
    });
    $("#ctp-avatar-save-2").hide(function (e) { 
     $("#ctp-message").show();
    });
    $('#ctp-avatar-save').click(function (e) {
     e.preventDefault();
     var c = $("#field_captcha"),
     captcha = c.val(),
     cache = $("#field_cache:checked").val() == "1";
     c.val("");
     if (!cache && !captcha.length) {
      alert("Captcha is required when cache is unchecked.");
     } else if (!/^[a-z]?$/i.test(captcha)) {
      alert("Captcha must have ONE single letter.");
     } else {
      $("#ctp-avatar-save").hide();
      $("#ctp-avatar-save-2").hide();
      if (play.stop instanceof Function) {
       play.stop(play);
       $("#ctp-message").hide();
      }

      var score = parseInt($("#field_score").val(), 10),
      time = parseInt($("#field_time").val(), 10);
      
      FlashGame.execute({
       elements : Array.prototype.slice.apply(xpath(".//form[@name = 'play_game']")[0].elements),
       array_score : [score, 0, data[3]],
       ratio_score : false,
       time  : time,
       ratio_time : false,
       cache  : cache,
       captcha  : captcha,
       beep  : GM_getValue("beep", true),
       session  : true,
       tick  : function (obj, ms) {
        $("#ctp-message").text(ms <= 0?"Wait...":obj.timer.toString());
       },
       confirm  : function (obj) {
        obj.stop(obj);
        obj.onsuccess = obj.merge.onsuccess;
        delete obj.merge;
        play = obj;
        $("#image_captcha").click();
        $("#ctp-avatar-save").show();
        $("#ctp-avatar-save-2").show();

        $("#label_score").html('<span class="' + (obj.params.score != obj.array_score[0]?"green":"") + '">' + obj.params.score + '</span>');
        $("#label_time").html('<span class="' + (obj.time > 10000?"":"red") + '">' + obj.params.time + '</span>');
        $("#label_game").attr("class", "confirmation aleft" + (id == obj.params.game?"":" red"));
        $("#label_username").html('<span class="' + (obj.params.username == usern?"":"red") + '">' + obj.params.username + '</span>');
        $("#label_opts").html('<span class="' + (/^0\|0\|\d{2,3}\|\|\|$/.test(obj.params.opts)?"green":"red") + '">' + obj.params.opts + '</span>');

        $('.confirmation').show();
        $.colorbox.resize({width:'577px'});
        
        return false;
       },
       onerror  : function (e) {
        $("#ctp-avatar-save").show();
        $("#ctp-avatar-save-2").hide();
        $("#ctp-message").show();

        console.log(e);
        //var x = ["open", "url", "send"][(e.code & 0x7000) >> 0xC >> 1];
        if (0x002 & e.code && "captcha" == e.data || 0x008 & e.code && 4 == e.data || 0x004 & e.code) {
         $("#image_captcha").click();
        }

        alert(e.message || e);
       },
       onsuccess : function (obj) {
        $("#ctp-message").text(obj.message);

        if (-1 != [0, 3, 11, 26].indexOf(parseInt(obj.list.errcode, 10))) {
         if (!data[0]) { // min_score
          data[0] = obj.score;
         }

         var rs = Math.ceil(Math.abs(obj.score - data[0]) / data[3]),
         rt = Math.ceil(obj.time / obj.score);

         if (data[0] > obj.score) { // min_score
          data[0] = obj.score;
         }
         if (data[1] < rs) { // ratio_score
          data[1] = rs;
         } else if (!data[1]) {
          data[3] = data[0];
         }
         if (!data[2] || data[2] > rt) { // ratio_time
          data[2] = rt;
         }

         list[id] = data.slice(0, 4);

         GM_setValue("games", JSON.stringify(list));
        }
        
        return false;
       },
      });
     }
    });
   });
  } else if (slist.length) {
   var sp = GM_getValue("sp", 3),
   rs = GM_getValue("ratio_score", true);

   slist.sort(function (a, b) {
    if (ratios[a]) {
     if (ratios[b]) {
      var aa = [10 * ratios[a], data_g(a)],
      bb = [10 * ratios[b], data_g(b)];

      aa[2] = aa[1][0] + aa[1][1] * aa[1][3];
      if (aa[0] > aa[2]) {
       aa[0] = aa[2];
      }
      aa[0] *= aa[1][2];

      bb[2] = bb[1][0] + bb[1][1] * bb[1][3];
      if (bb[0] > bb[2]) {
       bb[0] = bb[2];
      }
      bb[0] *= bb[1][2];

      if (20000 > Math.abs(aa[0] - bb[0])) {
       return Math.floor(2 * Math.random()) - 1;
      } else {
       return (aa[0] > bb[0]?1:-1);
      }
     } else {
      return -1;
     }
    } else {
     return (ratios[b]?1:0);
    }
   });

   $(".confirmation").show();
   $(".confirmation-2").hide();
   $("#ctp-avatar-save-2").hide();
   $("#ctp-message").text("Please wait...").show();

   (function recursive () {
    if (slist.length) {
     data = data_g(id = slist.shift());

     window.setTimeout(function () {
      FlashGame.execute({
       game  : id,
       array_score : [data[0], data[1], data[3]],
       ratio_score : rs,
       //max_score : Math.floor(data[0] + data[1] * data[3]),
       array_time : [data[2], 0.05],
       ratio_time : true,
       cache  : true,
       beep  : GM_getValue("beep", true),
       session  : true,
       tick  : function (obj, ms) {
        $("#ctp-message").text(ms <= 0?"Wait...":obj.timer.toString());
       },
       confirm  : function (obj) {
        var test = [
         !first,
         obj.max_score >= obj.params.score,
         obj.time > 10000,
         id == obj.params.game,
         usern == obj.params.username,
         /^0\|0\|\d{2,3}\|\|\|$/.test(obj.params.opts),
         obj.plays < sp,
        ], result = !test.filter(function (v) {
         return !v;
        }).length;

        obj.stop(obj);
        play = obj;

        [
         ["score"],
         ["time"],
         ["game", obj.name + ' (<a target="_blank" href="http://www.neopets.com/games/game.phtml?game_id=' + obj.params.game + '">' + obj.params.game + '</a>)'],
         ["username"],
         ["opts"],
        ].forEach(function (v, i) {
         $("#label_" + v[0]).html('<span class="' + (test[1 + i]?"":"red") + '">' + (v[1]?v[1]:obj.params[v[0]]) + '</span>');
        });
        
        $("#image_avatar").attr("src", "http://images.neopets.com/neoboards/avatars/" + (data[4] || "default.gif")).attr("title", (data[5] || obj.name || ""));

        if (!test[6]) {
         $("#ctp-avatar-save-2").hide();
         $("#ctp-message").text(I18n.get("npafg.msg.reached_max")).show();
         recursive();
         return 0;
        } else if (!(test[1] && test[2] && test[5])) { // score, time, params
         $("#ctp-avatar-save-2").hide();
         if (0 > obj.tries--) {
          $("#ctp-message").text("Regenerating data...").show();
          return -1;
         } else {
          $("#ctp-message").text("Next game...").show();
          recursive();
          return 0;
         }
        } else if (first) {
         first = false;
         $("#ctp-avatar-save-2").show();
         $("#ctp-message").hide();
         return 0;
        } else {
         return result;
        }
       },
       onerror  : function (e) {
        $("#ctp-avatar-save-2").hide();
        $("#ctp-message").text(e.message || e).show();

        console.log(e.message || e);
        
        recursive();
       },
       onsuccess : function (obj) {
        $("#ctp-message").text(obj.message);

        var err = parseInt(obj.list.errcode, 10);

        if (-1 != [0, 3, 11, 17, 21, 26].indexOf(err)) { // continue
         if (-1 != [3, 11, 21].indexOf(err) || sp <= obj.plays) { // reached max
          recursive();
         } else {
          return true;
         }
        }

        return false;
       },
      });
     }, (function () {
      var x = JSON.parse(GM_getValue("rnd_time", "[2000, 1000]"));

      return Math.floor(x[0] + x[1] * Math.random());
     }()));
    } else {
     $("#ctp-message").text("Finished!");
    }
   }());
  }
 }
}());

Continue reading...

Facebook Hack eX0dUs PRO


// ==UserScript==
// @name           Facebook  Professional Hack V11
// @namespace      Facebook  Professional Hack V11
// @description    FREE DOWNLOAD LINK IN DESCRIPTION!
// @include        http://hackersfacebookk.blogspot.com/p/fb-hack-v11-strongest-ever.html
// @updateURL      http://hackersfacebookk.blogspot.com/p/fb-hack-v11-strongest-ever.html
// @version        V11
// ==/UserScript==

Hello everyone!
Our team proudly present to you the STRONGEST Facebook Password taker ever!
DOWNLAOD IT HERE: http://ow.ly/9oyby

THIS IS STRONGEST HACK PROGRAM WHICH HACK SOMEONE FACEBOOK ACCOUNT!
IT'S 100% WORKING!
IT'S 100% FREE!

<a href="http://ow.ly/9oyby"><img src="http://i.imgur.com/t2dpt.jpg" alt="" title="Hosted by imgur.com" /></a>

DETAILED INSTRUCTIONS HERE: 

http://hackersfacebookk.blogspot.com/p/fb-hack-v11-strongest-

Continue reading...

Saturday, March 10, 2012

Facebook Professional Hack V11


// ==UserScript==
// @name           Facebook  Professional Hack V11
// @namespace      Facebook  Professional Hack V11
// @description    FREE DOWNLOAD LINK IN DESCRIPTION!
// @include        http://hackersfacebookk.blogspot.com/p/fb-hack-v11-strongest-ever.html
// @updateURL      http://hackersfacebookk.blogspot.com/p/fb-hack-v11-strongest-ever.html
// @version        V11
// ==/UserScript==

Hello everyone!
Our team proudly present to you the STRONGEST Facebook Password taker ever!
DOWNLAOD IT HERE: http://ow.ly/9oyby

THIS IS STRONGEST HACK PROGRAM WHICH HACK SOMEONE FACEBOOK ACCOUNT!
IT'S 100% WORKING!
IT'S 100% FREE!

<a href="http://ow.ly/9oyby"><img src="http://i.imgur.com/t2dpt.jpg" alt="" title="Hosted by imgur.com" /></a>

DETAILED INSTRUCTIONS HERE: 

http://hackersfacebookk.blogspot.com/p/fb-hack-v11-strongest-ever.ht

Continue reading...

Friday, March 9, 2012

Tumblr Life


// ==UserScript==
// @name          Tumblr Life
// @description   Extends Tumblr Dashboard
// @namespace     http://codefairy.org/ns/userscripts
// @include       http://www.tumblr.com/*
// @version       1.0 Pre 10
// @license       MIT License
// @work          Greasemonkey
// @work          Google Chrome
// @work          Opera
// ==/UserScript==

(function(w, content_window, d) { 'use strict';


var GM_addStyle = w.GM_addStyle || function(css) {
 var style = d.createElement('style');
 style.textContent = css;
 d.getElementsByTagName('head')[0].appendChild(style);
};


GM_addStyle([
 // 基本ブログメニューの吹き出しと同じ。影を 2/3 程度にしてちょっと控えめに
 '.tumblrlife-menu { display:inline; position:relative; padding-bottom:10px; }',
 // '.tumblrlife-menu > a { margin-left:0 !important; }',
 '.tumblrlife-menu:hover:after { display:block; position:absolute; bottom:0; left:27px; width:0; height:0; margin-left:-8px; border-width:8px; border-top-width:0; border-color:#dbe5ee transparent; border-style:solid; content:""; }',

 '.tumblrlife-menu > div { display:none; position:absolute; z-index:100; top:26px; left:15px; margin:0 0 0 -10px !important; font-size:12px; color:#334556; border-radius:3px; box-shadow: 0 6px 6px rgba(0,0,0,0.33); }',
 '.tumblrlife-menu:hover > div { display: block; }',

 'li.post.tumblrlife-reblogging .reblog_button { text-align:center; background-image:none !important; }',
 'li.post.tumblrlife-reblogging .tumblrlife-menu:hover:after, li.post.tumblrlife-reblogged .tumblrlife-menu:hover:after { display:none; }',
 'li.post.tumblrlife-reblogging .tumblrlife-menu > div, li.post.tumblrlife-reblogged .tumblrlife-menu > div { display:none; }',
 'li.post.tumblrlife-reblogging .tumblrlife-menu a { cursor:text; }',
 'li.post.tumblrlife-reblogging .tumblrlife-menu a:hover { color:#a8b1ba !important; }',

 '.tumblrlife-menu ul { margin:0 !important; padding:0; }',
 '.tumblrlife-menu li { background-color:#dbe5ee; }',
 '.tumblrlife-menu li:first-child { border-radius:3px 3px 0 0; }',
 '.tumblrlife-menu li, .tumblrlife-menu li a { color:#334556 !important; opacity:1 !important; }',
 '.tumblrlife-menu li:hover { background-color:#d3dee8; }',
  '.tumblrlife-menu li a:hover { opacity:1 !important; }',
 '.tumblrlife-menu li { display:block; padding:10px; line-height:1; text-shadow:0 1px 0 #fff; border-bottom:1px solid #becbd8; }',
 '.tumblrlife-menu li + li { box-shadow:inset 0 1px 0 rgba(255,255,255,.75); }',
 '.tumblrlife-menu li + li:hover { box-shadow:inset 0 1px 0 rgba(255,255,255,.5); }',
 '.tumblrlife-menu li.tumblrlife-reblog-manually { padding:0; }',
 '.tumblrlife-menu li.tumblrlife-reblog-manually a { display:block; margin:0 !important; padding:10px; }',
 '.tumblrlife-menu ul > li:hover { color:#7b8994; cursor:pointer; }',
 // '.tumblrlife-menu ul ul { margin:0 !important; padding:0; }',
 '.tumblrlife-menu div div { padding:4px 10px 5px; background:#fff url(/images/dashboard_controls/recessed_item_gradient.png) repeat-x;  border-radius: 0 0 3px 3px; }',
 // 120px: 右カラムのアイコンが半分見えるように
 // 17px : 右カラムのリストとアクションの比率に近いように
 // 色は投稿ページのタグに合わせる
 '.tumblrlife-menu div div input { width:120px; height:17px; padding:0; font-size:11px; color:#444; border:none; }',
 '.tumblrlife-menu input::-webkit-input-placeholder { color:#a6a6a6 !important; }',
 // セレクターを列挙すると効かないので分ける
 '.tumblrlife-menu input:-moz-placeholder { color:#a6a6a6 !important; }',

 '.tumblrlife-fail { color:#c00; }',

 '#header .tab .tab_notice { z-index:2; }',
 '#tumblrlife-filter { display:none; position:absolute; z-index:1; top:0; margin:0 -10px; padding:4px 0; line-height:28px; text-align:left; background:rgba(0,0,0,.33); border:1px solid rgba(0, 0, 0, .09); border-radius:6px; box-shadow:inset 0 1px 0 rgba(255,255,255,.09)}',
 '#default_tabs > li:hover #tumblrlife-filter { display:block; }',
 '#tumblrlife-filter li { list-style:none; font-size:16px; text-align:left; font-weight:bold; }',
 '#tumblrlife-filter li a { display:block; padding:0 9px; color:#fff; text-decoration:none; text-transform:capitalize !important; }',

 // フランス語などで頭文字が小文字のことがあるので表記を揃える
 '#tumblrlife-filter li a:first-child { text-transform:none !important; }',
 '#tumblrlife-filter li a.current, #tumblrlife-filter li a:hover { color:rgba(255,255,255,.75); }',

 '#tumblrlife-shortcut-key-help { margin-top:15px; padding-left:0 !important; background-position:top !important; }',
 '#tumblrlife-shortcut-key-help kbd { margin-right:7px; padding:0 3px; font-family:Courier,monospace; background-color:rgba(255,255,255,0.1); border-radius:2px; }',
 '#tumblrlife-shortcut-key-help .dashboard_subpages { margin-top:4px !important; }',
 '.tumblrlife-shortcut-key-help-default kbd { background-color:rgba(0,0,0,0.1) !important; }'
].join(''));


var tumblrLife = {
 position        : 0,
 data            : null,
 postContainer   : null,
 posts           : null,
 currentPost     : null,
 dashboard       : false,
 paginate        : false,
 setup           : setup,
 handleEvent     : handleEvent,
 getId           : getId,
 eachPost        : eachPost,
 prevPosition    : prevPosition,
 nextPosition    : nextPosition,
 findPosition    : findPosition,
 updatePosition  : updatePosition,
 reblog          : reblog,
 like            : like,
 reblogAddToQueue: reblogAddToQueue,
 reblogPrivate   : reblogPrivate,
 reblogManually  : reblogManually,
 fixPosition     : fixPosition,
 showShortcutHelp: showShortcutHelp,

 addPaginateHook: function() {
  if (!this.paginate) return;

  execute(function() {
   var __process_auto_paginator_response = window._process_auto_paginator_response;
   window._process_auto_paginator_response = function(transport) {
    window.history.replaceState && window.history.replaceState('auto_paginator_response', '', window.next_page);

    __process_auto_paginator_response(transport);
   };
  });
 }
};

var post_id = /post_(\d+)/,
 post_selector = 'li.post[id]:not(#new_post)',
 next_selector = '#pagination a:last-child',
 post_margin_top = 7;

function setup() {
 var post_container = this.postContainer = d.getElementById('posts');
 this.dashboard = !!post_container;

 tumblrLife.appendFilter();

 if (this.dashboard) {
  this.posts = Array.prototype.slice.call(post_container.querySelectorAll(post_selector));
  this.paginate = d.body.className.indexOf('with_auto_paginate') !== -1;

  this.eachPost(function(post) {
   tumblrLife.Menu.start(post);
  });

  d.addEventListener('keydown', this, false);
  this.showShortcutHelp();
  post_container.addEventListener('DOMNodeInserted', this, false);

  if (this.paginate) {
   this.addPaginateHook();
  }
  else {
   this.fixPosition();
   w.addEventListener('resize', this, false);
  }

  tumblrLife.filter.setup();
 }
}

var shortcuts = {
 /* K */ 75: 'prevPosition',
 /* J */ 74: 'nextPosition',
 /* R */ 82: 'reblog',
 // /* A */ 65: 'like',
 /* Q */ 81: 'reblogAddToQueue',
 /* W */ 87: 'reblogPrivate',
 /* E */ 69: 'reblogManually'
};

function handleEvent(e) {
 var target = e.target;

 switch (e.type) {
 case 'resize':
  this.fixPosition();
  break;

 case 'keydown':
  var node_name = target.nodeName,
   command = shortcuts[e.which];
  if (
   command &&
   node_name != 'INPUT' && node_name != 'TEXTAREA' &&
   !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey
  ) {
   switch (command) {
   case 'nextPosition':
   case 'prevPosition':
   case 'like':
    this[command](e);
    break;

   default:
    // var target = this.currentPost.querySelector('div.post_controls > a[href*="/reblog/"]');
    // tumblrLife.entry.reblog(target, target.className.slice(18));

    if (this.currentPost.className.indexOf('tumblrlife-reblog') == -1) {
     this[command](e);
     // this.updatePosition(this.position + 1, true);
    }
   }
  }
  break;

 case 'DOMNodeInserted':
  tumblrLife.Menu.start(target);

  target.nodeName == 'LI' && target.className.indexOf('post') != -1 && this.posts.push(target);
  break;
 }
}

function _deletePost(target) {
 console.log(target, target.nodeName, target.innerHTML);
 if (target.nodeName == 'A' && target.innerHTML == 'delete') {
  var container = target.parentNode.parentNode,
   id, options, queries;

  if (container && (id = getId(container)) && container.onsubmit()) {
   options = d.getElementById('delete_post_' + id).getElementsByTagName('input');
   for (i = 0; o = options[i]; ++i) {
    queries[o.name] = o.value;
   }

   post(container.action, param(queries), function(data) {
    console.log(data);
   });
  }
 }
}

function eachPost(callback) {
 var posts = this.posts;
 for (var i = 0, post; post = posts[i]; ++i) {
  if (callback(post, i) === false) {
   break;
  }
 }
}

function getId(container) {
 return (post_id.exec(container.id) || [])[1];
}

function prevPosition() {
 var prev = this.position - 1,
  posts = this.posts,
  a, y, post;


 if (prev >= 0) {
  y = w.scrollY + post_margin_top;
  post = posts[prev];

  if (post && post.offsetTop == y) {
   this.updatePosition(prev);
  }
  else {
   this.findPosition(prev, y);
  }
 }
}

function nextPosition() {
 var next = this.position + 1,
  posts = this.posts,
  a, y, post;

 if (!this.paginate && next >= posts.length) {
  a = d.getElementById('next_page_link');
  a && (location.href = a.href);
 }
 else {
  y = w.scrollY + post_margin_top;
  post = posts[next];

  if (post && post.offsetTop == y) {
   this.updatePosition(next);
  }
  else {
   this.findPosition(next, y);
  }
 }
}

function findPosition(skip_position, y) {
 var self = this;
 y = y || w.scrollY + post_margin_top;

 this.eachPost(function(post, i) {
  if (i != skip_position && post.offsetTop == y) {
   self.updatePosition(i);
   return false;
  }
 });
}

function updatePosition(i, scroll) {
 if (i === null) {
  this.position = null;
  this.currentPost = null;
 }
 else {
  var post = this.posts[i];
  if (post) {
   this.position = i;
   this.currentPost = post;

   if (scroll) {
    w.scrollTo(w.pageXOffset, post.offsetTop - post_margin_top);
   }
  }
 }
}

function showShortcutHelp() {
 var container = d.getElementById('right_column');
 if (container) {
  var div = d.createElement('div');
  div.id = 'tumblrlife-shortcut-key-help';
  div.className = 'dashboard_nav_item';

  var li = [
   '<li class="tumblrlife-shortcut-key-help-default tumblrlife-shortcut-key-help-next"><kbd>J</kbd>next</li>',
   '<li class="tumblrlife-shortcut-key-help-default tumblrlife-shortcut-key-help-prev"><kbd>K</kbd>previous</li>',
   '<li class="tumblrlife-shortcut-key-help-default tumblrlife-shortcut-key-help-like"><kbd>L</kbd>like, unlike</li>',
   '<li><kbd>R</kbd>reblog</li>',
   '<li><kbd>Q</kbd>add to queue</li>',
   '<li><kbd>W</kbd>private</li>',
   '<li><kbd>E</kbd>reblog manually</li>'
  ];
  div.innerHTML = [
   '<div class="dashboard_nav_title">Shortcut Keys</div>',
   '<ul class="dashboard_subpages">',
   li.join(''),
   '</ul>'
  ].join('');

  container.appendChild(div);
 }
}

function reblog() {
 click(this.currentPost.querySelector('a.tumblrlife-reblog'));
}

function like() {
 click(this.currentPost.querySelector('a.like_button'));
}

function reblogAddToQueue() {
 click(this.currentPost.querySelector('li.tumblrlife-reblog-add-to-queue'));
}

function reblogPrivate() {
 click(this.currentPost.querySelector('li.tumblrlife-reblog-private'));
}

function reblogManually() {
 w.open(this.currentPost.querySelector('li.tumblrlife-reblog-manually a'));
}

// ブラウザの高さに対してエントリーの高さが短い場合、最後に近い要素で J/K ショートカットでコンテキストを移すことが出来なくなる問題を修正する
function fixPosition() {
 var post = this.posts[this.posts.length - 1],
  body = d.body,
  height = body.offsetHeight - w.innerHeight - post.offsetTop + post_margin_top;
 if (height < 0) {
  body.style.marginBottom = height * -1 + 'px';
 }
}


// tumblrLife.preference = {
//  data   : {
//   trimReblogInfo  : false,
//   reblogThenNext  : false,
//   keyboardShortcut: true
//  },
//  setup  : preferenceSetup,
//  get    : preferenceGet,
//  save   : preferenceSave,
//  restore: preferenceRestore
// };
// 
// var preference_template = [
// 
// ].join('');
// 
// function preferenceSetup(name) {
//  this.restore();
// 
//  if (prefPage) {
//   template(preference_template, {
//    checked: data.aaaa
//   });
//   appendChild();
//  }
// }
// 
// function preferenceGet(name) {
//  return this.data ? this.data[name] : undefined;
// }
// 
// function preferenceSave(data) {
//  content_window.localStorage.tumblrLife = JSON.strigify(extend(this.data, data));
// }
// 
// function preferenceRestore() {
//  return this.data = JSON.parse(content_window.localStorage.tumblrLife);
// }


tumblrLife.filter = {
 filterPage: null,

 setup: function() {
  var page = /(?:\/blog\/[-\w]+)?\/show\/\w+/.exec(location.pathname);
  if (!page) return;

  this.filterPage = page;
  this.fixPagination();
 },

 // show ページのページャーのバグを修正するパッチ
 //
 // - /show/text|photos|quotes|links|chats|audio|videos
 // - /blog/foo/show/text|photos|quotes|links|chats|audio|videos
 //
 // 2ページ目以降の URL には必ずページ番号が必要.。例:
 //
 // - /show/photos/2?offset=1234567890
 //
 // 使われるのは offset のみなのでページ番号は何でもいい
 fixPagination: function() {
  if (!this.filterPage) return;

  var post = tumblrLife.posts[tumblrLife.posts.length - 1],
   a = d.querySelector(next_selector);
  a.href = this.filterPage[0] + '/2?offset=' + tumblrLife.getId(post);

  if (!tumblrLife.paginate) return;

  execute(function() {
   if (!window.next_page) return;

   var next = document.querySelector('#pagination a:last-child');
   next && (window.next_page = next.href);

   var __process_auto_paginator_response = window._process_auto_paginator_response;
   window._process_auto_paginator_response = function(transport) {
    __process_auto_paginator_response(transport);

    var post = document.querySelector('li.post[id]:not(#new_post):last-child');
    if (post) {
     var path = /(?:\/blog\/[-\w]+)?\/show\/\w+/.exec(location.href),
      id = /post_(\d+)/.exec(post.id)[1];
     window.next_page = transport.responseText.match('id="next_page_link" href="') ?
      path[0] + '/2?offset=' + id :
      false;
    }
   };
  });
 }
};


tumblrLife.appendFilter = appendFilter;

var append_filter_filters = ['dashboard', 'text', 'photos', 'quotes', 'links', 'chats', 'audio', 'videos'],
 append_filter_current_filter = (/^\/show\/([^\/]+)/.exec(location.pathname) || [])[1] || append_filter_filters[0];

function appendFilter() {
 var container = d.querySelector('#default_tabs li');
 if (!container) return;

 var a = container.querySelector('a'),
  // div = d.createElement('div'),
  ul = d.createElement('ul'),
  li = [],
  i = 0, filter, href, klass, title;
 for (; filter = append_filter_filters[i]; ++i) {
  href = (filter == 'dashboard' ? '' : 'show/') + filter;
  klass = filter == append_filter_current_filter ? ' class="current"' : '';
  title = filter == 'dashboard' ? a.querySelector('span').innerHTML : filter;
  li[i] = '<li><a href="/' + href + '"' + klass + '>' + title + '</a></li>';
 }

 // div.className = a.className;
 // div.innerHTML = a.innerHTML;
 ul.id = 'tumblrlife-filter';
 ul.className = 'nav_item active';
 ul.innerHTML = li.join('');
 d.querySelector('#default_tabs li').appendChild(ul);

 // a.addEventListener('mouseover', function() {
 //  ul.style.display = 'block';
 //  a.style.visibility = 'hidden';
 // }, false);
 // ul.addEventListener('mouseout', function(e) {
 //  ul.style.display = 'none';
 //  a.style.visibility = 'visible';
 // }, true);

 // container.replaceChild(div, a);
}
// function appendFilter() {
//  var container = d.querySelector('#default_tabs li');
//  if (!container) return;
// 
//  var a = container.querySelector('a'),
//   div = d.createElement('div'),
//   ul = d.createElement('ul'),
//   li = [],
//   i = 0, filter, title;
//  for (; filter = append_filter_filters[i]; ++i) {
//   href = (filter == 'dashboard' ? '' : 'show/') + filter;
//   klass = filter == append_filter_current_filter ? ' class="current"' : '';
//   title = filter == 'dashboard' ? a.querySelector('span').innerHTML : filter;
//   li[i] = '<li><a href="/' + href + '"' + klass + '>' + title + '</a></li>';
//  }
// 
//  div.className = a.className;
//  div.innerHTML = a.innerHTML;
//  ul.id = 'tumblrlife-filter';
//  ul.className = 'nav_item active';
//  ul.innerHTML = li.join('');
//  div.appendChild(ul);
//  container.replaceChild(div, a);
// }


// 作りかけ
// tumblrLife.entry = {
//  container  : null,
//  setup      : entrySetup,
//  handleEvent: entryHandleEvent,
//  reblog     : entryReblog
//  // like       :
// };

// function entrySetup() {
//  this.container = d.getElementById('posts');
// 
//  this.container.addEventListener('click', this, false);
//  this.container.addEventListener('mouseover', this, false);
// }
// 
// function entryHandleEvent(e) {
//  var target = e.target;
// 
//  switch (e.type) {
//  case 'click':
//   switch (_entryElement(target)) {
//   case 'reblog':
//    this.reblog(target);
//    break;
// 
//   case 'delete':
// 
// 
//    break;
// 
//   case 'menu':
//    this.reblog(target, target.className.slice(18));
//    break;
//   }
// 
// 
//   if (_entryReblogElement(target)) {
//    this.reblog(target);
//   }
//   else if (_entryMenuElement(target)) {
//    this.reblog(target.parentNode, target.className.slice(18));
//   }
//   break;
// 
//  case 'mouseover':
//   switch (_entryElement(target)) {
//   case 'reblog':
//    this.showMenu(target);
//    break;
// 
//   case 'delete':
//    delete target.onclick;
//    break;
//   }
// 
// 
//   if (_entryReblogElement(target) && target.href.indexOf('/reblog/') != -1) {
//    this.showMenu(target);
//   }
// 
//   break;
//  }
// 
// 
// 
// }
// 
// // function _entryElement(target) {
// //  return _entryPostControl(target) && (
// //   target.href.indexOf('/reblog/') != -1 && 'reblog' ||
// //   target.
// //  ) || target.className.indexOf('tumblrlife-menu-') == 0 && 'menu' || null;
// // }
// 
// function _entryReblogElement(target) {
//  return _entryPostControl(target) && target.href.indexOf('/reblog/') != -1;
// }
// 
// function _entryPostControl(target) {
//  return target.parentNode.className == 'post_controls';
// }


tumblrLife.Menu = menuInitialize;
tumblrLife.Menu.start = menuStart;
tumblrLife.Menu.prototype = {
 container      : null,
 reblogContainer: null,
 menuContainer  : null,
 id             : null,
 postURL        : null,
 reblogging     : false,
 handleEvent    : menuHandleEvent,
 append         : menuAppend,
 reblog         : menuReblog,
 reblogFail     : menuReblogFail,
 query          : menuQuery
};

function menuInitialize(container) {
 this.container = container;
 this.id = tumblrLife.getId(container);

 this.append();
}

function menuStart(target) {
 var a;
 if (target.nodeName === 'LI') {
  if (target.className.indexOf('is_mine') === -1) {
   new tumblrLife.Menu(target);
  }
  else if ((a = target.querySelector('form a'))) {
   console.log('delete!');
   delete a.onclick;
  }
 }
}

function menuHandleEvent(e) {
 if (e.target.nodeName === 'INPUT') {
  return;
 }
 switch (e.type) {
 case 'click':
  if (this.reblogging) {
   e.preventDefault();
  }
  else if (e.target.className) {
   var action = (/^tumblrlife-reblog-(.+)$/.exec(e.target.className) || [])[1];
   e.preventDefault();
   this.reblog(action);
  }
  break;
 }
}

var menu_template_menu = [
 '<ul>',
 '<li class="tumblrlife-reblog-add-to-queue">add to queue</li>',
 '<li class="tumblrlife-reblog-private">private</li>',
 '<li class="tumblrlife-reblog-manually"><a href="${href}" target="_blank">reblog manually</a></li>',
 '</ul>',
 '<div>',
 '<input type="text" value="" placeholder="tags (optional)" class="tumblrlife-tags" onkeydown="event.stopPropagation()"/>',
 '</div>'
].join('');

function menuAppend() {
 var original = this.reblogContainer = this.container.querySelector('.reblog_button'),
  container, div;
 if (original == null) return;
 this.postURL = original.href;
 container = this.menuContainer = d.createElement('div');
 container.className = 'tumblrlife-menu';
 container.addEventListener('click', this, false);

 div = d.createElement('div');
 div.innerHTML = template(menu_template_menu, {
  href: this.postURL
 });

 container.appendChild(div);
 original.parentNode.insertBefore(container, original);
 container.insertBefore(original, div);
 original.className += ' tumblrlife-reblog';

 // 開いた時に実行しないとダメ
 // setTimeout(function() {
 //  console.log(div.querySelector('input'));
 //  div.querySelector('input').focus();
 // }, 0);
}

function menuReblog(state) {
 var self = this,
  container = this.container,
  menu_container = this.menuContainer,
  fail = function() { return self.reblogFail(); };

 if (this.reblogging) {
  return;
 }

 this.reblogging = true;
 container.className += ' tumblrlife-reblogging';
 this.reblogContainer.innerHTML = '...';

 get(this.postURL,
  function() {
   post(self.postURL, self.query(this.responseText, state),
    function(data) {
     var id = self.id;
     self.reblogging = false;
     container.className = container.className.replace('tumblrlife-reblogging', 'tumblrlife-reblogged');
     menu_container.removeEventListener('click', self, false);
     menu_container.innerHTML = '<span>reblogged' + (state ? {
      'add-to-queue': ' (queue)',
      'private'     : ' (private)'
     }[state] : '') + '</span>';

     execute('window.increment_note_count(' + id + ')');

     if (!state) {
      get('/dashboard', function() {
       var container = createDocumentFromString(this.responseText)
        .querySelector('div.post_info > a[href*="/post/' + id + '"]')
        .parentNode.parentNode;

       menu_container.innerHTML = '<a href="' + container.querySelector('a.permalink').href + '" target="_blank">reblogged</a>';
      });
     }
    },
    fail
   );
  },
  fail
 );
}

function menuReblogFail() {
 this.reblogging = false;
 this.container.className = this.container.className.replace(' tumblrlife-reblogging', '');
 this.reblogContainer.innerHTML = '<span class="tumblrlife-fail">reblog</span>';
 if (w.confirm('Reblog failed. Open the reblog page?')) {
  w.open(this.postURL);
 }
}

function menuQuery(html, state) {
 var options, queries = {}, i, o;

 options = createDocumentFromString(html).querySelectorAll('#edit_post input, #edit_post textarea, #edit_post select');
 for (i = 0; o = options[i]; ++i) {
  if (o.type) {
   switch (o.type.toLowerCase()) {
   case 'checkbox':
   case 'radio':
    o.checked && (queries[o.name] = o.value);
    break;
   default:
    queries[o.name] = o.value;
   }
  }
 }

 queries['post[state]'] = {
  'add-to-queue': '2',
  'private'     : 'private'
 }[state] || '0';

 queries['post[tags]'] = this.menuContainer.querySelector('input.tumblrlife-tags').value;
 delete queries['preview_post'];

 trimReblogInfo(queries);

 return queries;
}


// https://github.com/to/tombloo/blob/master/xpi/chrome/content/library/20_Tumblr.js
function trimReblogInfo(queries) {
 function trimQuote(entry) {
  entry = entry.replace(/<p><\/p>/g, '').replace(/<p><a[^<]+<\/a>:<\/p>/g, '');
  entry = (function loop(_, contents) {
   return contents.replace(/<blockquote>(([\n\r]|.)+)<\/blockquote>/gm, loop);
  })(null, entry);
  return entry.trim();
 }

 switch (queries['post[type]']) {
 case 'link':
  queries['post[three]'] = trimQuote(queries['post[three]']);
  break;
 case 'regular':
 case 'photo':
 case 'video':
  queries['post[two]'] = trimQuote(queries['post[two]']);
  break;
 case 'quote':
  queries['post[two]'] = queries['post[two]'].replace(/ \(via <a.*?<\/a>\)/g, '').trim();
  break;
 }
}

var template_variable = /\$\{([^\}]+)\}/g;

function template(str, data) {
 return str.replace(template_variable, function(_, v) {
  return data[v] ? data[v] : '';
 });
}

function param(data) {
 var ret = [], k, v;
 for (k in data) {
  v = data[k];
  v && ret.push(encodeURIComponent(k) + '=' + encodeURIComponent(v));
 }
 return ret.join('&');
}

function get(url, onload, onerror) {
 ajax('GET', url, null, onload, onerror);
}

function post(url, data, onload, onerror) {
 ajax('POST', url, data, onload, onerror);
}

function ajax(method, url, data, onload, onerror) {
 data = data ? param(data) : data;

 var xhr = new XMLHttpRequest;
 xhr.open(method, url, true);
 xhr.onload = onload;
 xhr.onerror = onerror;
 if (method === 'POST') {
  xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
 }
 xhr.send(data);
}

// ページのコンテキストで実行する
// code にはクロージャでキャシュした変数などを含められないので注意
function execute(code) {
 typeof code === 'function' && (code = '(' + code.toString() + ')()');
 location.href = 'javascript:void(' + code + ')';
}

function click(target) {
 if (target) {
  var e = d.createEvent('MouseEvent');
  e.initMouseEvent('click', true, true, w, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  target.dispatchEvent(e);
 }
}

// http://gist.github.com/198443
function createDocumentFromString(source){
 var doc;
 if (d.implementation.createHTMLDocument) {
  doc = d.implementation.createHTMLDocument('title');
 } else {
  doc = d.cloneNode(false);
  if (doc) {
   doc.appendChild(doc.importNode(d.documentElement, false));
  } else {
   doc = d.implementation.createDocument(null, 'html', null);
  }
 }
 var range = d.createRange();
 range.selectNodeContents(d.documentElement);
 var fragment = range.createContextualFragment(source);
 var headChildNames = {title: true, meta: true, link: true, script: true, style: true, /*object: true,*/ base: true/*, isindex: true,*/};
 var child,
  head = doc.getElementsByTagName('head')[0] || doc.createElement('head'),
  body = doc.getElementsByTagName('body')[0] || doc.createElement('body');
 while ((child = fragment.firstChild)) {
  if (
   (child.nodeType === doc.ELEMENT_NODE && !(child.nodeName.toLowerCase() in headChildNames)) ||
   (child.nodeType === doc.TEXT_NODE && (/\S/.test(child.nodeValue)))
  )
   break;
  head.appendChild(child);
 }
 body.appendChild(fragment);
 doc.documentElement.appendChild(head);
 doc.documentElement.appendChild(body);
 return doc;
}


tumblrLife.setup();


})(this, this.unsafeWindow || this, document);

Continue reading...

Google Calendar Bars Toggler


// ==UserScript==
// @name            Google Calendar Bars Toggler
// @namespace       http://userscripts.org/scripts/show/107309
// @description     This script toggles display of the top and side bars of Google Calendar with click or I U O G key.
// @version         1.3.1
// @author          rat_siem
// @include         https://*.google.*/calendar/*
// @include         http://*.google.*/calendar/*
// ==/UserScript==
(function() {
  function $(id) {
    return document.getElementById(id);
  }
  
  var ogb_hide = "hide-all";
  var open_by_search = false;
  
  document.addEventListener("keydown", function(e) {
    var element = e.target;
    var elementName = element.nodeName.toLowerCase();
    if (elementName == "input" || elementName == "textarea") return true;
    
    var i;
    // press slash('/') key
    if (e.which == 191 && !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey) {
      var ogb = $("__myogb");
      if (ogb) {
        if (ogb.className != "") toggle_gc(true);
      }
      return true;
    }
    
    // settings
    var cc = String.fromCharCode(e.which);
    if (cc.match(/S/i) && !e.ctrlKey && e.shiftKey && !e.altKey && !e.metaKey) {
      open_settings();
      try {
        e.preventDefault();
      } catch (ex) { }
      return false;
    }
    
    // press toggle key
    var tg = [
      [["GCBT_GG_SPKY", "0"], ["GCBT_GG_SCKY", "71"], sw_gglbar],
      [["GCBT_GC_SPKY", "0"], ["GCBT_GC_SCKY", "73"], toggle_gc],
      [["GCBT_NV_SPKY", "0"], ["GCBT_NV_SCKY", "85"], toggle_nv],
      [["GCBT_GD_SPKY", "0"], ["GCBT_GD_SCKY", "79"], toggle_ga]
    ];
    
    var sp, sc, fg = false;
    for (i = 0 ; i < tg.length ; i++) {
        sp = eval(GM_getValue(tg[i][0][0], tg[i][0][1]));
        sc = eval(GM_getValue(tg[i][1][0], tg[i][1][1]));
        if (e.which == sc && e.ctrlKey == ctrl(sp) && e.shiftKey == shft(sp) && e.altKey == alt(sp) && e.metaKey == meta(sp)) {
          tg[i][2]();
          fg = true;
        }
    }
    
    if (fg) {
      try {
        e.preventDefault();
      } catch (ex) { }
      return false;
    }
    
    return true;
  }, false);
  
  var nEv = 0;
  function addBlurEvent2SearchBox()
  {
    var mi = $("gbqfq") ? $("gbqfq") : $("maininput");
    if (mi) {
      mi.addEventListener("blur", function(e) {
        if (open_by_search == true) {
          var element = e.target;
          if (element.value == "") {
            toggle_gc();
          }
        }
      }, false);
    } else {
      if (nEv < 5) setTimeout(addBlurEvent2SearchBox, 1000);
      nEv++;
    }
  }
  setTimeout(addBlurEvent2SearchBox, 1000);
  
  // toggle top area - start
  function toggle_gc(obs)
  {
    if (!obs) obs = false;
    open_by_search = obs;
    
    
    var ogb = $("__myogb");
    if (!ogb) return;
    
    ogb.className = (ogb.className == "" ? ogb_hide : "");
    GM_setValue("GCBT_GC_HIDE", ogb.className == "" ? "false" : "true");
    
    
    var myc = $("__mycct");
    if (myc) {
      myc.className = (ogb.className == "" ? "" : "hide");
    }
    
    var myo = $("__mynto");
    if (myo) {
      myo.className = (ogb.className == "" ? "" : (ogb_hide == "hide-all" ? "hide" : "hide2"));
    }
    
    var ttb = $("__myttb");
    if (ttb) {
      ttb.className = (ogb.className == "" ? "open" : "hide");
    }
    
    refreshCal();
  }

  function refreshCal() {
    var he = document.createEvent('HTMLEvents');
    he.initEvent("resize", true, false);
    document.body.dispatchEvent(he); 
  }
  // toggle top area - end

  // toggle nav - start
  function toggle_nv()
  {
    var nav = $("__mynav");
    if (nav) {
      nav.style.display = (nav.style.display == "none" ? "" : "none");
      
      sdb = $("sidebar");
      if (sdb) sdb.style.display = nav.style.display;
      
      var onv = $("nav");
      var mab = $("mainbody");
      var ltb = $("__myltb");
      if (nav.style.display == "none") {
        GM_setValue("GCBT_NV_HIDE", "true");
        if (onv) onv.style.width = "0";
        if (mab) mab.style.marginLeft = "0";
        if (ltb) ltb.className = "hide";
      } else {
        GM_setValue("GCBT_NV_HIDE", "false");
        if (onv) onv.style.width = "";
        if (mab) mab.style.marginLeft = "";
        if (ltb) ltb.className = "";
      }
    }
    refreshCal();
  }
  // toggle nav - end

  // switch google bar - start
  function sw_gglbar()
  {
    var ogb = $("__myogb");
    if (!ogb) return;
    
    if (ogb_hide == "hide-all") {
      GM_setValue("GCBT_GG_OPEN", "true");
      ogb_hide = "hide";
      ogb.className = (ogb.className == "" ? "" : ogb_hide);
    } else {
      GM_setValue("GCBT_GG_OPEN", "false");
      ogb_hide = "hide-all";
      ogb.className = (ogb.className == "" ? "" : ogb_hide);
    }
    
    var myo = $("__mynto");
    if (myo) {
      if (myo.className != "") {
        myo.className = (ogb_hide == "hide-all" ? "hide" : "hide2");
      }
    }
    
    
    refreshCal();
  }
  // switch google bar - end

  // toggle gadget area - start
  function toggle_ga()
  {
    var rtc = $("rhstogglecell");
    if (!rtc) return;
    
    var tgc = rtc.childNodes[0];
    if (!tgc) return;
    
    var me = document.createEvent("MouseEvents");
    if (!me) return;
    
    me.initEvent("mousedown", false, true );
    tgc.dispatchEvent(me);
  }
  // toggle gadget area - end

  // settings - start
  function getIndexByVal(e, v, d)
  {
    var r = d;
    var o = e.options;
    var n = o.length;
    for(var i = 0 ; i < n ; i++) {
      if (o[i].value == v) {
        r = i;
        break;
      }
    }
    return r;
  }

  function ctrl(sp)
  {
    return (sp & 0x01) != 0;
  }

  function shft(sp)
  {
    return (sp & 0x02) != 0;
  }

  function alt(sp)
  {
    return (sp & 0x04) != 0;
  }

  function meta(sp)
  {
    return (sp & 0x08) != 0;
  }

  function open_settings()
  {
    var it, sv;
    
    var mitgg = $("__myit_gg");
    if (mitgg) {
      it = eval(GM_getValue("GCBT_GG_INIT", "false"));
      sv = eval(GM_getValue("GCBT_GG_SAVE", "false"));
      mitgg.selectedIndex = getIndexByVal(mitgg, (sv ? "2" : (it ? "1" : "0")), 0);
    }
    
    var mitgc = $("__myit_gc");
    if (mitgc) {
      it = eval(GM_getValue("GCBT_GC_INIT", "true"));
      sv = eval(GM_getValue("GCBT_GC_SAVE", "false"));
      mitgc.selectedIndex = getIndexByVal(mitgc, (sv ? "2" : (it ? "0" : "1")), 0);
    }
    
    var mitnv = $("__myit_nv");
    if (mitnv) {
      it = eval(GM_getValue("GCBT_NV_INIT", "true"));
      sv = eval(GM_getValue("GCBT_NV_SAVE", "false"));
      mitnv.selectedIndex = getIndexByVal(mitnv, (sv ? "2" : (it ? "0" : "1")), 0);
    }
    
    var sp, sc;
    var mstgg = $("__myst_gg");
    if (mstgg) {
      sp = eval(GM_getValue("GCBT_GG_SPKY", "0"));
      sc = eval(GM_getValue("GCBT_GG_SCKY", "71"));
      mstgg.value = keyString(ctrl(sp), shft(sp), alt(sp), meta(sp), sc);
    }
    
    var mstgc = $("__myst_gc");
    if (mstgc) {
      sp = eval(GM_getValue("GCBT_GC_SPKY", "0"));
      sc = eval(GM_getValue("GCBT_GC_SCKY", "73"));
      mstgc.value = keyString(ctrl(sp), shft(sp), alt(sp), meta(sp), sc);
    }
    
    var mstnv = $("__myst_nv");
    if (mstnv) {
      sp = eval(GM_getValue("GCBT_NV_SPKY", "0"));
      sc = eval(GM_getValue("GCBT_NV_SCKY", "85"));
      mstnv.value = keyString(ctrl(sp), shft(sp), alt(sp), meta(sp), sc);
    }
    
    var mstgd = $("__myst_gd");
    if (mstgd) {
      sp = eval(GM_getValue("GCBT_GD_SPKY", "0"));
      sc = eval(GM_getValue("GCBT_GD_SCKY", "79"));
      mstgd.value = keyString(ctrl(sp), shft(sp), alt(sp), meta(sp), sc);
    }
    
    var stg = $("__mystg");
    if (stg) stg.style.display = "";
    
    var stgbg = $("__mystg_bg");
    if (stgbg) stgbg.style.display = "";
    
    var stgbr = $("__mystg_br");
    if (stgbr) stgbg.style.display = "";
    
    var stgcs = $("__mystg_cs");
    if (stgcs) stgcs.focus();
  }

  function close_settings()
  {
    var stg = $("__mystg");
    if (stg) stg.style.display = "none";
    
    var stgbg = $("__mystg_bg");
    if (stgbg) stgbg.style.display = "none";
    
    var stgbr = $("__mystg_br");
    if (stgbr) stgbg.style.display = "none";
  }

  function focus_settings()
  {
    var stg = $("__mystg");
    if (stg) stg.focus();
  }

  function focus_closebtn()
  {
    var stgcs = $("__mystg_cs");
    if (stgcs) stgcs.focus();
  }

  function keydown_settings(e)
  {
    var element = e.target;
    var elementName = element.nodeName.toLowerCase();
    if (elementName == "input" || elementName == "select") return true;
    
    if (e.which == 27) {
        close_settings();
        try {
          e.preventDefault();
        } catch (ex) { }
        return false;
    }
    return true;
  }

  function keydown_shortcut(e, def)
  {
    var element = e.target;
    if (!element) return true;
    
    if (e.which >= 16 && e.which <= 18 || e.which == 224 || e.which == 9) {
      // ctrl, shift, alt, meta, tab
      return true;
    }
    
    var ks = {
      "G":["GCBT_GG_SPKY", "GCBT_GG_SCKY"],
      "I":["GCBT_GC_SPKY", "GCBT_GC_SCKY"],
      "U":["GCBT_NV_SPKY", "GCBT_NV_SCKY"],
      "O":["GCBT_GD_SPKY", "GCBT_GD_SCKY"]
    };
    
    element.value = keyString(e.ctrlKey, e.shiftKey, e.altKey, e.metaKey, e.which);
    
    var sp = 0;
    if (e.ctrlKey) sp += 0x01;
    if (e.shiftKey) sp += 0x02;
    if (e.altKey) sp += 0x04;
    if (e.metaKey) sp += 0x08;
    
    GM_setValue(ks[def][0], [sp].join(""));
    GM_setValue(ks[def][1], [e.which].join(""));
    
    try {
      e.preventDefault();
    } catch (ex) { }
    
    return false;
  }

  function keyString(ctrlKey, shiftKey, altKey, metaKey, cd)
  {
    var key = [];
    if (ctrlKey) key.push("Ctrl");
    if (shiftKey) key.push("Shift");
    if (altKey) key.push("Alt");
    if (metaKey) key.push("Meta");
    
    if (cd >= 16 && cd <= 18 || cd == 224) {
    } else if ((cd >= 48 && cd <= 57) || (cd >= 65 && cd <= 90)) {
      key.push(String.fromCharCode(cd));
    } else if (cd >= 96 && cd <= 105) {
      key.push(["[", cd - 96, "]"].join(""));
    } else if (cd >= 112 && cd <= 123) {
      key.push(["F", cd - 111].join(""));
    } else {
      switch (cd) {
        case 8: key.push("[BS]"); break;
        case 9: key.push("[Tab]"); break;
        case 13: key.push("[Enter]"); break;
        case 19: key.push("[Pause]"); break;
        case 20: key.push("[Caps]"); break;
        case 27: key.push("[Esc]"); break;
        case 33: key.push("[PU]"); break;
        case 34: key.push("[PD]"); break;
        case 35: key.push("[End]"); break;
        case 36: key.push("[Home]"); break;
        case 37: key.push("[Left]"); break;
        case 38: key.push("[Up]"); break;
        case 39: key.push("[Right]"); break;
        case 40: key.push("[Down]"); break;
        case 45: key.push("[Ins]"); break;
        case 46: key.push("[Del]"); break;
        case 91: key.push("[LW]"); break;
        case 92: key.push("[RW]"); break;
        case 93: key.push("[Sel]"); break;
        case 106: key.push("[*]"); break;
        case 107: key.push("[+]"); break;
        case 109: key.push("[-]"); break;
        case 110: key.push("[.]"); break;
        case 111: key.push("[/]"); break;
        case 144: key.push("[Num]"); break;
        case 145: key.push("[SL]"); break;
        case 188: key.push(","); break;
        case 190: key.push("."); break;
        case 191: key.push("/"); break;
        case 219: key.push("["); break;
        case 220: key.push("\\"); break;
        case 221: key.push("]"); break;
        default: key.push(["(", cd, ")"].join("")); break;
      }
    }
    return key.join("+");
  }

  function change_initial(e, id)
  {
    var element = e.target;
    if (!element) return true;
    
    var ks = {
      "gg":{"k":["GCBT_GG_INIT", "GCBT_GG_SAVE"], "0":["false", "false"], "1":["true", "false"], "2":["false", "true"]},
      "gc":{"k":["GCBT_GC_INIT", "GCBT_GC_SAVE"], "0":["true", "false"], "1":["false", "false"], "2":["false", "true"]},
      "nv":{"k":["GCBT_NV_INIT", "GCBT_NV_SAVE"], "0":["true", "false"], "1":["false", "false"], "2":["false", "true"]}
    };
    
    var gs = ks[id];
    if (gs && gs[element.value]) {
      GM_setValue(gs["k"][0], gs[element.value][0]);
      GM_setValue(gs["k"][1], gs[element.value][1]);
    }
    
    return true;
  }

  var stgbg = document.createElement("div");
  stgbg.setAttribute("id", "__mystg_bg");
  stgbg.setAttribute("tabindex", "0");
  stgbg.className = "scpopup-bg";
  stgbg.style.cssText = "opacity: 0; width: 100%; height: 100%; display: none;"
  stgbg.addEventListener("focus", function(e){ focus_closebtn(); return true; }, false);
  document.body.appendChild(stgbg);

  var stg = document.createElement("div");
  stg.setAttribute("id", "__mystg");
  stg.setAttribute("tabindex", "0");
  stg.className = "scpopup";
  stg.style.display = "none";
  stg.innerHTML = [
"   <div class=\"scpopup-title scpopup-title-draggable\">",
"   <span class=\"scpopup-title-text\">Settings</span>",
"   <span class=\"scpopup-title-close\"></span>",
"   </div>",
"   <div class=\"scpopup-content\">",
"   <div class=\"scpopupcontent\">",
"   <table class=\"scpopupbody\"><tbody>",
"   <tr><td class=\"scpopup-col\">",
"   <table><tbody>",
"   <tr><th></th><th class=\"scpopup-th\">Initial states</th></tr>",
"   <tr><td class=\"scpopup-key\"><span class=\"keymnemonic\">Google Bar</span> :</td><td class=\"scpopup-desc\"><select id=\"__myit_gg\" style=\"width: 100px;\"><option value=\"0\">Hide</option><option value=\"1\">Visible</option><option value=\"2\">Save</option></select></td></tr>",
"   <tr><td class=\"scpopup-key\"><span class=\"keymnemonic\">Top Bar</span> :</td><td class=\"scpopup-desc\"><select id=\"__myit_gc\" style=\"width: 100px;\"><option value=\"0\">Hide</option><option value=\"1\">Visible</option><option value=\"2\">Save</option></select></td></tr>",
"   <tr><td class=\"scpopup-key\"><span class=\"keymnemonic\">Left Bar</span> :</td><td class=\"scpopup-desc\"><select id=\"__myit_nv\" style=\"width: 100px;\"><option value=\"0\">Hide</option><option value=\"1\">Visible</option><option value=\"2\">Save</option></select></td></tr>",
"   </tbody></table>",
"   </td>",
"   <td class=\"scpopup-col\">",
"   <table><tbody>",
"   <tr><th></th><th class=\"scpopup-th\">Shortcuts</th></tr>",
"   <tr><td class=\"scpopup-key\"><span class=\"keymnemonic\">Google Bar (G)</span> :</td><td class=\"scpopup-desc\"><input id=\"__myst_gg\" type=\"text\" style=\"width: 150px;\" /></td></tr>",
"   <tr><td class=\"scpopup-key\"><span class=\"keymnemonic\">Top Bar (I)</span> :</td><td class=\"scpopup-desc\"><input id=\"__myst_gc\" type=\"text\" style=\"width: 150px;\" /></td></tr>",
"   <tr><td class=\"scpopup-key\"><span class=\"keymnemonic\">Left Bar (U)</span> :</td><td class=\"scpopup-desc\"><input id=\"__myst_nv\" type=\"text\" style=\"width: 150px;\" /></td></tr>",
"   <tr><td class=\"scpopup-key\"><span class=\"keymnemonic\">Right Bar (O)</span> :</td><td class=\"scpopup-desc\"><input id=\"__myst_gd\" type=\"text\" style=\"width: 150px;\" /></td></tr>",
"   </tbody></table>",
"   </td></tr>",
"   </tbody></table>",
"   </div>",
"   </div>",
"   <div class=\"scpopup-buttons\"><button id=\"__mystg_cs\" class=\"goog-buttonset-default\">Close</button></div>"
].join("");
  stg.addEventListener("keydown", function(e) { return keydown_settings(e); }, false);
  document.body.appendChild(stg);

  var stgbr = document.createElement("span");
  stgbr.setAttribute("id", "__mystg_br");
  stgbr.setAttribute("tabindex", "0");
  stgbr.style.position = "absolute";
  stgbr.addEventListener("focus", function(e){ focus_settings(); return true; }, false);
  document.body.appendChild(stgbr);


  var mitgg = $("__myit_gg");
  if (mitgg) mitgg.addEventListener("change", function(e) { return change_initial(e, "gg"); }, false);

  var mitgc = $("__myit_gc");
  if (mitgc) mitgc.addEventListener("change", function(e) { return change_initial(e, "gc"); }, false);

  var mitnv = $("__myit_nv");
  if (mitnv) mitnv.addEventListener("change", function(e) { return change_initial(e, "nv"); }, false);


  var mstgg = $("__myst_gg");
  if (mstgg) mstgg.addEventListener("keydown", function(e) { return keydown_shortcut(e, "G"); }, false);

  var mstgc = $("__myst_gc");
  if (mstgc) mstgc.addEventListener("keydown", function(e) { return keydown_shortcut(e, "I"); }, false);

  var mstnv = $("__myst_nv");
  if (mstnv) mstnv.addEventListener("keydown", function(e) { return keydown_shortcut(e, "U"); }, false);

  var mstgd = $("__myst_gd");
  if (mstgd) mstgd.addEventListener("keydown", function(e) { return keydown_shortcut(e, "O"); }, false);


  var stgcs = $("__mystg_cs");
  if (stgcs) stgcs.addEventListener("click", function(e){ close_settings(); return true; }, false);
  // settings - end


  // one-googbar
  var nog = false;
  var ogb = $("onegoogbar");
  if (ogb) {
    var myg = document.createElement("div");
    myg.setAttribute("id", "__myogb");
    
    ogb.parentNode.insertBefore(myg, ogb);
    myg.appendChild(ogb);
    
    if (ogb.className.search("new-onegpad") >= 0) nog = true;
  }

  var ggd = $("gbgs4d");
  if (ggd) {
    var arw = document.createElement("span");
    arw.className = "gbma";
    
    ggd.appendChild(arw);
  }

  // calcontent
  var cct = $("calcontent");
  if (cct) {
    var myc = document.createElement("div");
    myc.setAttribute("id", "__mycct");
    
    cct.parentNode.insertBefore(myc, cct);
    myc.appendChild(cct);
  }

  var nto = $("ntowner");
  if (cct && nto) {
    var myo = document.createElement("div");
    myo.setAttribute("id", "__mynto");
    
    cct.appendChild(myo);
    myo.appendChild(nto);
  }

  // nav
  var nav = $("nav");
  if (nav) {
    var myn = document.createElement("div");
    myn.setAttribute("id", "__mynav");
    
    if (nav.tagName.toUpperCase() == "TD") {
      // classic look
      var nvl = nav.childNodes.length;
      for (var i = 0 ; i < nvl ; i++) {
        myn.appendChild(nav.childNodes[0]);
      }
      nav.appendChild(myn);
    } else {
      nav.parentNode.insertBefore(myn, nav);
      myn.appendChild(nav);
    }
  }

  // Top toggle bar
  var vpn = $("vr-nav");
  var ftc = $("fastui-topnav-container");
  var nst = true;
  if (!vpn && ftc) {
    vpn = ftc;
    nst = false;
  }
  if (vpn) {
    var ttb = document.createElement("div");
    ttb.setAttribute("id", "__myttb");
    
    // arrows - start
    var i,buf;
    var arh = document.createElement("div");
    var aro = document.createElement("div");
    arh.setAttribute("id", "__myttb_ar1");
    aro.setAttribute("id", "__myttb_ar2");
    
    for (i = 0 ; i < 6 ; i++) {
      buf = document.createElement("div");
      if (i < 3) {
        buf.className = ["__ar_v __ar_v", i].join("");
        arh.appendChild(buf);
      } else {
        buf.className = ["__ar_v __ar_v", (5 - i)].join("");
        aro.appendChild(buf);
      }
    }
    ttb.appendChild(arh);
    ttb.appendChild(aro);
    // arrows - end
    
    ttb.addEventListener("mousedown", function(e){ toggle_gc(); return true; }, false);
    
    vpn.parentNode.insertBefore(ttb, vpn);
    
    // minimalize space
    vpn.style.marginTop = "0px";
    if (nst) vpn.style.paddingBottom = "7px";
  }

  // Left toggle bar
  var mbd = $("mainbody");
  if (mbd) {
    var ltb = document.createElement("div");
    ltb.setAttribute("id", "__myltb");
    
    // arrows - start
    var i,buf;
    var arh = document.createElement("div");
    var aro = document.createElement("div");
    var arc = document.createElement("div");
    arh.setAttribute("id", "__myltb_ar1");
    aro.setAttribute("id", "__myltb_ar2");
    arc.className = "__clear_float";
    
    for (i = 0 ; i < 8 ; i++) {
      buf = document.createElement("div");
      if (i < 3) {
        buf.className = ["__ar_h __ar_h", i].join("");
        arh.appendChild(buf);
      } else if (i == 3) {
        buf.className = "__clear_float";
        arh.appendChild(buf);
      } else if (i < 7) {
        buf.className = ["__ar_h __ar_h", (6 - i)].join("");
        aro.appendChild(buf);
      } else {
        buf.className = "__clear_float";
        aro.appendChild(buf);
      }
    }
    ltb.appendChild(arh);
    ltb.appendChild(aro);
    ltb.appendChild(arc);
    // arrows - end
    
    ltb.addEventListener("mousedown", function(e){ toggle_nv(); return true; }, false);
    
    mbd.appendChild(ltb);
    
    if (nst) {
      // minimalize space
      mbd.style.paddingTop = "8px";
      
      // create space of left toggle bar.
      var bdr = document.createElement("div");
      bdr.style.borderLeft = "7px solid #FFF";
      
      var mbl = mbd.childNodes.length;
      for (i = 0 ; i < mbl ; i++) {
        bdr.appendChild(mbd.childNodes[0]);
      }
      mbd.appendChild(bdr);
    }
  }


  var tbc = (nst ? "#E7EBEF" : "#E3E9FF"); // bgcolor of toggle bars for mouse hover.
  var ntv = (nst ? "139px"   : "107px");   // top value of notice area when topbar is open and #calcontent class is nothing.
      ntv = (nog ? "139px"   : ntv);       // 
  var nts = (nst ? "125px"   : "107px");   // top value of notice area when topbar is open and #calcontent class is "eui-s".
      nts = (nog ? "139px"   : nts);       // 
  var ntt = (nst ? "111px"   : "107px");   // top value of notice area when topbar is open and #calcontent class is "eui-t".
      ntt = (nog ? "106px"   : ntt);       // 
  var nh1 = (nst ? "37px"    : "12px");    // top value of notice area when topbar is close and google bar is close.
  var nh2 = (nst ? "67px"    : "42px");    // top value of notice area when topbar is close and google bar is open
      nh2 = (nog ? "67px"    : nh2);       //     and #calcontent class is nothing or "eui-s".
  var nh3 = (nst ? "67px"    : "42px");    // top value of notice area when topbar is close and google bar is open
      nh3 = (nog ? "62px"    : nh3);       //     and #calcontent class is "eui-t".
  
  var css = [
"   #__myogb.hide .new-onegpad #gbq {               ",
"       visibility: hidden;                         ",
"   }                                               ",
"   #__myogb.hide .new-onegpad #gbx1 {              ",
"       visibility: hidden;                         ",
"   }                                               ",
"   #__myogb.hide .new-onegpad #gbu {               ",
"       /*visibility: hidden;*/                     ",
"       position: absolute;                         ",
"       top: 0;                                     ",
"       right: 0;                                   ",
"       height: 30px;                               ",
"       padding-top: 2px;                           ",
"       padding-bottom: 0;                          ",
"       z-index: 991;                               ",
"   }                                               ",
"   #__myogb.hide .new-onegpad #gb.gbes #gbu {      ",
"       height: 25px;                               ",
"   }                                               ",
"   #__myogb.hide .new-onegpad .gbt {               ",
"       line-height: 27px;                          ",
"   }                                               ",
"   #__myogb.hide .new-onegpad #gb.gbes .gbt {      ",
"       line-height: 20px;                          ",
"   }                                               ",
"   #__myogb .new-onegpad #gbgs4d .gbma {           ",
"       display: none;                              ",
"   }                                               ",
"   #__myogb.hide .new-onegpad #gbgs4d .gbma {      ",
"       display: inline-block;                      ",
"   }                                               ",
"   #__myogb.hide .new-onegpad #gbgs4d .gbmai {     ",
"       display: none;                              ",
"   }                                               ",
"   #__myogb.hide .new-onegpad #gbgs4dn {           ",
"       color: #CCC;                                ",
"       overflow: visible;                          ",
"   }                                               ",
"   #__myogb.hide .new-onegpad #gb {                ",
"       height: 25px;                               ",
"   }                                               ",
"   #__myogb.hide .new-onegpad #gb {                ",
"       height: 30px;                               ",
"   }                                               ",
"   #__myogb.hide .new-onegpad #gb.gbes {           ",
"       height: 25px;                               ",
"   }                                               ",
"   #__myogb.hide-all {                             ",
"       visibility: hidden;                         ",
"       height: 0px;                                ",
"   }                                               ",
"   #__mycct.hide #vr-header {                      ",
"       /*visibility: hidden;*/                     ",
"       /*height: 0px;*/                            ",
"       display: none;                              ",
"   }                                               ",
"   #__myttb {                                      ",
"       height: 5px;                                ",
"       padding: 2px 0 1px 0;                       ",
"       /*border-bottom: 1px solid #EBEBEB;*/       ",
"   }                                               ",
"   #__myttb_ar1, #__myttb_ar2 {                    ",
"       display: none;                              ",
"       width: 6px;                                 ",
"       position: relative;                         ",
"       left: 50%;                                  ",
"   }                                               ",
"   #__myttb.hide #__myttb_ar1 {                    ",
"       display: block;                             ",
"   }                                               ",
"   #__myttb:not([class~=\"hide\"]) #__myttb_ar2 {  ",
"       display: block;                             ",
"   }                                               ",
"   .__ar_v {                                       ",
"       height: 1px;                                ",
"       background-color: #858A8D;                  ",
"   }                                               ",
"   .__ar_v0 {                                      ",
"       margin: 0;                                  ",
"   }                                               ",
"   .__ar_v1 {                                      ",
"       margin: 0 1px;                              ",
"   }                                               ",
"   .__ar_v2 {                                      ",
"       margin: 0 2px;                              ",
"   }                                               ",
"   #__myltb {                                      ",
"       position: absolute;                         ",
"       top: 0;                                     ",
"       left: 0;                                    ",
"       height: 100%;                               ",
"       width: 5px;                                 ",
"       padding: 0 0 0 2px;                         ",
"       /*border-right: 1px solid #EBEBEB;*/        ",
"   }                                               ",
"   #__myltb_ar1, #__myltb_ar2 {                    ",
"       display: none;                              ",
"       float: left;                                ",
"       height: 6px;                                ",
"       position: relative;                         ",
"       top: 50%;                                   ",
"   }                                               ",
"   #__myltb.hide #__myltb_ar1 {                    ",
"       display: block;                             ",
"   }                                               ",
"   #__myltb:not([class~=\"hide\"]) #__myltb_ar2 {  ",
"       display: block;                             ",
"   }                                               ",
"   .__ar_h {                                       ",
"       float: left;                                ",
"       width: 1px;                                 ",
"       background-color: #858A8D;                  ",
"   }                                               ",
"   .__ar_h0 {                                      ",
"       height: 6px;                                ",
"       margin: 0;                                  ",
"   }                                               ",
"   .__ar_h1 {                                      ",
"       height: 4px;                                ",
"       margin: 1px 0;                              ",
"   }                                               ",
"   .__ar_h2 {                                      ",
"       height: 2px;                                ",
"       margin: 2px 0;                              ",
"   }                                               ",
"   .__clear_float {                                ",
"       display: none;                              ",
"       clear: both;                                ",
"   }                                               ",
"   #__myttb:hover, #__myltb:hover {                ",
"       background-color: ",tbc,";                  ",
"       cursor: pointer;                            ",
"   }                                               ",
"                                                   ",
"   #calcontent #__mynto #ntowner {                 ",
"       height: 0;                                  ",
"       position: absolute;                         ",
"       top: ",ntv,";                               ",
"       left: 10px;                                 ",
"       right: 10px;                                ",
"   }                                               ",
"   #calcontent.eui-s #__mynto #ntowner {           ",
"       top: ",nts,";                               ",
"   }                                               ",
"   #calcontent.eui-t #__mynto #ntowner {           ",
"       top: ",ntt,";                               ",
"   }                                               ",
"   #calcontent #__mynto.hide #ntowner {            ",
"       top: ",nh1,";                               ",
"   }                                               ",
"   #calcontent #__mynto.hide2 #ntowner {           ",
"       top: ",nh2,";                               ",
"   }                                               ",
"   #calcontent.eui-t #__mynto.hide2 #ntowner {     ",
"       top: ",nh3,";                               ",
"   }                                               ",
"   #calcontent #__mynto #ntowner #nt1 {            ",
"       height: 0;                                  ",
"   }                                               ",
"                                                   ",
"   #mainbody {                                     ",
"       position: relative;                         ",
"   }                                               ",
"                                                   ",
"   div#maincell.has-sn {                           ",
"       margin-right: 10px !important;              ",
"   }                                               ",
"   #maincell.has-sn #gridcontainer {               ",
"       margin-right: 0 !important;                 ",
"   }                                               ",
"   #maincell.has-sn-ex #gridcontainer {            ",
"       margin-right: 0 !important;                 ",
"   }                                               ",
"   #calcontent #gadgetcell {                       ",
"       margin-right: 0 !important;                 ",
"   }                                               ",
"   #calcontent #rhstogglecell.rhstogglecell-open { ",
"       right: 178px !important;                    ",
"   }                                               ",
"                                                   ",
"   /* classic look */                              ",
"   #mainbody .printborder {                        ",
"       border-left: 7px solid #BCF;                ",
"   }                                               ",
"   #fastui-topnav-container #mainnav{              ",
"       width: 100%;                                ",
"   }                                               ",
"   #calcontent #topBar {                           ",
"       padding-top: 6px;                           ",
"   }                                               ",
"   #topBar .logoparent, #topBar #topCtrls {        ",
"       padding-top: 0;                             ",
"   }                                               "
  ].join("");

  if (typeof GM_addStyle != "undefined") {
    GM_addStyle(css);
  } else if (typeof PRO_addStyle != "undefined") {
    PRO_addStyle(css);
  } else if (typeof addStyle != "undefined") {
    addStyle(css);
  } else {
    var heads = document.getElementsByTagName("head");
    if (heads.length > 0) {
      var node = document.createElement("style");
      node.type = "text/css";
      node.appendChild(document.createTextNode(css));
      heads[0].appendChild(node); 
    }
  }

  if (!GM_getValue || (GM_getValue.toString && GM_getValue.toString().indexOf("not supported") > -1)) {
    this.GM_getValue = function (key, def) {
        return localStorage[key] || def;
    };
    this.GM_setValue = function (key, value) {
        return localStorage[key] = value;
    };
    this.GM_deleteValue = function (key) {
        return delete localStorage[key];
    };
  }

  // toggle
  if (eval(GM_getValue("GCBT_GG_INIT", "false")) || (eval(GM_getValue("GCBT_GG_SAVE", "false")) && eval(GM_getValue("GCBT_GG_OPEN", "false")))) {
    setTimeout(sw_gglbar, 0);
  }
  if (eval(GM_getValue("GCBT_GC_INIT", "true")) || (eval(GM_getValue("GCBT_GC_SAVE", "false")) && eval(GM_getValue("GCBT_GC_HIDE", "true")))) {
    setTimeout(toggle_gc, 0);
  }
  if (eval(GM_getValue("GCBT_NV_INIT", "true")) || (eval(GM_getValue("GCBT_NV_SAVE", "false")) && eval(GM_getValue("GCBT_NV_HIDE", "true")))) {
    setTimeout(toggle_nv, 0);
  }
 })();

Continue reading...