Advertisement
Ansolley

Plugin - Moveable BBlog Button

Jun 28th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.32 KB | None | 0 0
  1. /**
  2.  * Move BBLog Button:
  3.  *  - adds an option to move the BBLog button
  4.  *
  5.  * @author dapil
  6.  * @version 1.1
  7.  * @last-edit 5. 4. 2015 19:53
  8.  */
  9.  
  10. BBLog.handle("add.plugin", {
  11.     id : "dapil-move-bblog-button",
  12.     name : "Move BBLog Button",
  13.        
  14.     translations : {
  15.         "en" : {
  16.           "button.text" : "How much to move?"
  17.         }
  18.     },
  19.  
  20.     configFlags : [
  21.         ["button.text", 1, function(instance){instance.MoveBBLogButtonPopup(instance);}]
  22.     ],
  23.     init : function(instance){
  24.         instance.MoveBBLogButton(instance);
  25.     },  
  26.  
  27.     domchange : function(instance){
  28.         instance.MoveBBLogButton(instance);
  29.     },
  30.    
  31.     MoveBBLogButton : function(instance){
  32.         var pixels = +instance.storage("amountofpixels"); //unary plus (convert to int)
  33.         var ts_pixels = pixels + 160; // 160 = 170 [default top value] - 10px [default space above the bblog button]
  34.         $('#bblog-icon').css('top', pixels + 'px');
  35.         $('#bblog-teamspeak').css('top', ts_pixels + 'px');
  36.     },
  37.     MoveBBLogButtonPopup : function(instance){
  38.         var amountofpixels = prompt("Please enter the amount of pixels you want to move the button (without \"px\").");
  39.         if (amountofpixels!=null)
  40.         {
  41.           instance.storage("amountofpixels", amountofpixels);
  42.         }
  43.     },
  44. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement