WM User Console Object

This is the user console object which is created under the WM version 4.x script

Script này sẽ không được không được cài đặt trực tiếp. Nó là một thư viện cho các script khác để bao gồm các chỉ thị meta // @require https://update.greatest.deepsurf.us/scripts/6907/28423/WM%20User%20Console%20Object.js

  1. // ==UserScript==
  2. // @name WM User Console Object
  3. // @namespace MerricksdadWMUserConsoleObject
  4. // @description This is the user console object which is created under the WM version 4.x script
  5. // @license http://creativecommons.org/licenses/by-nc-nd/3.0/us/
  6. // @version 4.0.0.4
  7. // @copyright Charlie Ewing except where noted
  8. // ==/UserScript==
  9.  
  10. //this script requires some functions in the WM Common Library
  11. //this script needs access to a pre-defined JSON object
  12.  
  13.  
  14. (function(){
  15.  
  16. //***************************************************************************************************************************************
  17. //***** Visual Console Object
  18. //***************************************************************************************************************************************
  19. WM.console = {
  20. initialized: false,
  21. sidekickNode: null, //remember the sidekicks list
  22. feedNode: null, //remember where to put the feed data
  23. loading: true, //set to false after sidekicks have time to load
  24. priorityNode: null,
  25. priorityBuild: null,
  26. dynamicBuild: null,
  27. //new content
  28. tabContainer:null, //outer tab control
  29. configButton:null, //userConfig.open control
  30. collectTabControl:null, //app filter tab control
  31. dynamicIcons: function(){
  32. //define a crapload of icons
  33. var icons={
  34. //128x128 pixel icons
  35. row0:["refresh","world","check",null,"moveUpLevelLeft","moveUpLevelRight","moveDownLevelLeft","moveDownLevelRight","filter","plus","minus","multiply","import","reset","object","array"],
  36. row1:["expandDown","expandUp","expandLeft","expandRight","moveTopLeft","moveBottomLeft",null,"allSidekicks","location","sortAsc","sortDesc","tools","treeExpand","treeCollapse","exportGrab","grab"],
  37. row2:["playDown","playUp","playLeft","playRight","like","unlike","uncheckAll","checkAll","layoutSmall","layoutDetail","layoutList","sidekick","refreshProcess","cancelProcess","importData","heartbeat"],
  38. row3:["arrowDown","arrowUp","arrowRight","arrowLeft","rssUpRight","rssUpLeft","rssDownRight","rssDownLeft","pin","pinned","redPhone","shuffle",null,"birth","comment"],
  39. row4:["plugin","identify","add","remove","openInNewWindow","restoreDown","stop","pause","trash","action","logo",null,"moveOutLevel","moveInLevel","removeGlobal","toGlobal"],
  40. row5:["clone","hatch","tag","noImage","accordionExpandH","accordionCollapseH","accordionExpandV","accordionCollapseV","gotoLibrary","addFilter","removeFilter","maximize","addFeed","addGlobal","fromGlobal","checkGlobal"],
  41. //32px icons
  42. row6:["firefox","chrome",null,"tabs"],
  43. //16px icons
  44. row7:["treeCollapseS","treeExpandS","layoutSmallColor","layoutDetailColor","layoutListColor",null,null,null,null,null,null,"noImageSmall"],
  45. };
  46. var ret=".resourceIcon {display:block; background-image:url('"+WM.resources.iconsURL+"') !important;}\n";
  47. //create css statements
  48. //for rows 0-5,6,7
  49. var sizes=[8,16,24,32,48,64];
  50. for (var si=0,len=sizes.length;si<len;si++){
  51. var s=sizes[si];
  52. for (var r=0;r<=6;r++){
  53. for (var i=0;i<20;i++){
  54. var iconName=icons["row"+r][i];
  55. if (iconName!=null) {
  56. ret+="."+iconName+s+" {background-position:"+(-i*s)+"px "+(-r*s)+"px; width:"+s+"px; height:"+s+"px; background-size:"+(1024/(64/s))+"px;}\n";
  57. }
  58. }
  59. }
  60. r=6;
  61. for (var i=0;i<20;i++){
  62. var iconName=icons["row"+r][i];
  63. if (iconName!=null) {
  64. //6 rows of icons 2 times this size
  65. var yOffset=(6*s*2);
  66. ret+="."+iconName+s+" {background-position:"+(-(i*s))+"px "+(-yOffset)+"px; width:"+s+"px; height:"+s+"px; background-size:"+(1024/(64/(s*2)))+"px;}\n";
  67. }
  68. }
  69. r=7;
  70. for (var i=0;i<20;i++){
  71. var iconName=icons["row"+r][i];
  72. if (iconName!=null) {
  73. //6 rows of icons 4 times this size
  74. //plus 1 row of icons twice this size
  75. var yOffset=(6*s*4) + (1*s*2);
  76. ret+="."+iconName+s+" {background-position:"+(-(i*s))+"px "+(-yOffset)+"px; width:"+s+"px; height:"+s+"px; background-size:"+(1024/(64/(s*4)))+"px;}\n";
  77. }
  78. }
  79. }
  80.  
  81. return ret;
  82. },
  83. globalStyle:function(){try{
  84. return ""+
  85. //icon sheets
  86. WM.console.dynamicIcons()+
  87. "html {height:100%; width:100%;}\n"+
  88. "body {margin:0 !important; font-family:tahoma,arial; font-size:small;}\n"+
  89. "a:hover {text-decoration: none !important;}\n"+
  90.  
  91. "#content4 {display:none !important; }\n"+
  92.  
  93. "#wmContent {background-color:#DDDDEE; position:relative; z-index:900;}\n"+
  94.  
  95. ".post.classic {position:relative; min-height:90px; border-bottom:1px solid #CCCCDD; padding-bottom:10px; padding-top:10px; clear:both;}\n"+
  96. ".post.classic .actor {margin-top:5px; margin-bottom:10px; font-weight:700; color:#3B5998; display:inline;}\n"+
  97. ".post.classic .picture {padding-top:5px; padding-right:10px; float:left;}\n"+
  98. ".post.classic .picture img {width:90px; height:90px; background-color:white; border:1px solid; border-radius:5px;}\n"+
  99. ".post.classic .body {vertical-align:top;}\n"+
  100. ".post.classic .title {margin-top:5px; font-weight:700; color:#3B5998;display:block;}\n"+
  101. ".post.classic .caption {display:block; }\n"+
  102. ".post.classic .description {padding-top:5px; display:block;}\n"+
  103. ".post.classic .postDate {}\n"+
  104. ".post.classic .appName {position:relative; left:10px;}\n"+
  105. ".post.classic .linkText {color:#899ADB; float:right; padding-right:32px;}\n"+
  106. ".post.classic.noimage {min-height:1px;}\n"+
  107. ".post.short {float:left; position:relative;}\n"+
  108. ".post.short .floater {overflow:hidden; display:block; background-color: white; border:0px solid; border-radius:5px; position:absolute; z-index:3; padding:0; width:0px;}\n"+
  109. ".post.short:hover .floater {-moz-transition-property: width,height,padding,border;-moz-transition-delay:1s; width:240px; padding:5px 10px;border:1px solid;}\n"+
  110. ".post.short .actor {display:block;}\n"+
  111. ".post.short .picture {position:relative;}\n"+
  112. ".post.short .picture img {position:relative; width:100%; height:100%; background-color:white;}\n"+
  113. ".post.short .postDate {display:block;}\n"+
  114. ".post.short .appName {display:block;}\n"+
  115. ".post.short .linkText {display:block;}\n"+
  116. ".post.short .progress {opacity:0.25; background-color:#00FF00;}\n"+
  117.  
  118. ".post.short.working .picture img {opacity:0.25;}\n"+
  119. ".post.short.excluded .picture img {opacity:0.25;}\n"+
  120. ".post.short.timeout .picture img {opacity:0.25;}\n"+
  121. ".post.short.paused .picture img {opacity:0.25;}\n"+
  122. ".post.short.nodef .picture img {opacity:0.25;}\n"+
  123. ".post.short.accepted .picture img {opacity:0.25;}\n"+
  124. ".post.short.failed .picture img {opacity:0.25;}\n"+
  125. ".post.short.colored .picture img {opacity:0.25;}\n"+
  126. ".post.short.scam .picture img {opacity:0.25;}\n"+
  127. ".post.short.pinned .picture img {opacity:0.25;}\n"+
  128.  
  129. ".post.dev {position:relative; min-height:90px; border-bottom:1px solid #CCCCDD; padding-bottom:20px; padding-top:10px; clear:both;}\n"+
  130. ".post.dev>div:first-child {display: inline-block; margin-right: 16px; border: none;}\n"+
  131.  
  132. ".wm.content > div > .toolBox {display:inline;}\n"+
  133. ".wm.content > div > .toolBox > div {display:inline;}\n"+
  134. ".post .toolBox {display:block; vertical-align:top; position:relative !important;}\n"+
  135. ".post .toolBox > div {display:block; float:right;}\n"+
  136. "div.excluded {background-color:gray !important;}\n"+
  137. "div.working {background-color:yellow !important;}\n"+
  138. "div.timeout {background-color:orange !important;}\n"+
  139. "div.paused {background-color:silver !important;}\n"+
  140. "div.pinned {background-color:silver !important;}\n"+
  141. "div.nodef {background-color:deepskyblue !important;}\n"+
  142. "div.failed {background-color:red !important;}\n"+
  143. "div.accepted {background-color:limegreen !important;}\n"+
  144. "div.scam {background-color:purple !important;}\n"+
  145. ".pausedHover {display:none; position:absolute; right:50%; top:50%;}\n"+
  146. ".pausedHover>img {margin-left:-32px; margin-top:-32px;}\n"+
  147. ".pausedHover>img:hover {background-color:rgba(0,255,0,0.5); border-radius:20%;}\n"+
  148. ".post.paused.short>.floater>.pausedHover>img {background-color:rgba(0,255,0,0.5); border-radius:20%;}\n"+
  149. ".post.paused>.pausedHover, .post.paused>.floater>.pausedHover {display:block;}\n"+
  150. ".underline {border-bottom:1px solid #CCCCDD;}\n"+
  151.  
  152. ".toolTip {display:none; border:1px solid #767676; border-radius:3px; background-color:white; color:black; position:absolute; font-size:8pt; padding:5px; line-height: 12px; z-index:9999;}\n"+
  153. "*:hover > .toolTip {display:block;}\n"+
  154. ".menuNode {width:0px; height:0px; position:absolute; background:none; border:none;top:-5px;}\n"+
  155. ".toolTip.menuNode > ul {position:absolute; background-color: white; border: 1px solid; border-radius: 5px 5px 5px 5px; padding: 2px; min-width:100px;}\n"+
  156. ".toolTip.menuNode > ul > li {position:relative; line-height:1.28; }\n"+
  157. ".toolTip.right.menuNode {right:5px; }\n"+
  158. ".toolTip.left.menuNode {left:-5px; }\n"+
  159. ".toolTip.right.menuNode > ul {left:0px;}\n"+
  160. ".toolTip.right.menuNode > ul > li {text-align:left;}\n"+
  161. ".toolTip.left.menuNode > ul {right:0px;}\n"+
  162. ".toolTip.left.menuNode > ul > li {text-align:right;}\n"+
  163.  
  164. //little button div
  165. ".littleButton {background-color:threedshadow; border-radius:5px; margin:1px; display:inline-block; vertical-align:middle;}\n"+
  166. ".littleButton:hover {background-color:highlight !important;}\n"+
  167. ".littleButton>img {position:relative; display:block; margin:2px;}\n"+
  168. ".littleButton.oddOrange {background-color:#FF9968;}\n"+
  169. ".littleButton.oddBlack {background-color:#82976E;}\n"+
  170. ".littleButton.oddBlue {background-color:#51D1EA;}\n"+
  171. ".littleButton.oddGreen {background-color:#B7E54F;}\n"+
  172. ".menuEntry, .menuList > li {position:relative; border-radius:3px; border:1px solid white; padding:3px; min-width:100px;}\n"+
  173. ".menuEntry:hover, .menuList > li:hover {border-color:#CCCCDD; background-color:#E0E8F6; }\n"+
  174.  
  175. ".accFailBlock {color: white !important;font-size: small !important;left: 16px;line-height: 12px;margin-bottom: -12px;padding: 0 !important;position: relative;top: -32px;}\n"+
  176. ".accFailBlock .fail {background-color: #C3463A; border-radius: 2px 2px 2px 2px; box-shadow: 1px 1px 1px rgba(0, 39, 121, 0.77); padding: 1px 2px;}\n"+
  177. ".accFailBlock .accept {background-color: #46B754; border-radius: 2px 2px 2px 2px; box-shadow: 1px 1px 1px rgba(0, 39, 121, 0.77); padding: 1px 2px;}\n"+
  178.  
  179. //rules manager
  180. "#wmPriorityBuilder {margin:5px; position: relative; background-color:white; min-height:95%;}\n"+
  181. "#wmPriorityBuilder .validator > :before {content:'and: '}\n"+
  182. "#wmPriorityBuilder .validator:first-child > :before {content:'where: '}\n"+
  183. "#wmPriorityBuilder .action > :before {content:'and: '}\n"+
  184. "#wmPriorityBuilder .action:first-child > :before {content:'do: '}\n"+
  185. //collection feed node
  186. "#wmFeedNode {margin:5px; position: relative; background-color:white;}\n"+
  187.  
  188. //sidekick manager
  189. "#wmSidekickList {margin:5px; position: relative; background-color:white; min-height:95%;}\n"+
  190. //feeds manager
  191. "#wmFeedsList {margin:5px; position: relative; background-color:white; min-height:95%;}\n"+
  192.  
  193. //dynamic grabber
  194. "#wmDynamicBuilder {margin:5px; position: relative; background-color:white; min-height:95%;}\n"+
  195. //friend tracker
  196. "#wmFriendTracker {margin:5px; position: relative; background-color:white; min-height:95%;}\n"+
  197.  
  198. ".expanded {display:block;}\n"+
  199. ".collapsed {display:none;}\n"+
  200. "label {font-weight:bold; margin-right:5px;}\n"+
  201.  
  202. ".unsaved {background-color:lightyellow !important;}\n"+
  203.  
  204. ".whiteover:hover {background-color:#FFFFFF !important;}\n"+
  205. ".blueover:hover {background-color:#E0E8F6 !important;}\n"+
  206.  
  207. ".red {background-color:#C3463A !important; border: 2px solid #982B2F !important; text-shadow: -1px -1px 1px #982B2F, 1px 1px 1px #982B2F, 1px -1px 1px #982B2F, -1px 1px 1px #982B2F; text-transform: none !important; font-color:white !important;}\n"+
  208. ".red:hover {background-color:#EA1515 !important;}\n"+
  209.  
  210. ".green {background-color:#46B754 !important; border: 2px solid #256E46 !important; text-shadow: -1px -1px 1px #256E46, 1px 1px 1px #256E46, 1px -1px 1px #256E46, -1px 1px 1px #256E46; text-transform: none !important; font-color:white !important;}\n"+
  211. ".green:hover {background-color:#A6E11D !important;}\n"+
  212.  
  213. ".blue {background-color:#51C2FB !important; border: 2px solid #057499 !important; text-shadow: -1px -1px 1px #057499, 1px 1px 1px #057499, 1px -1px 1px #057499, -1px 1px 1px #057499; text-transform: none !important; font-color:white !important;}\n"+
  214. ".blue:hover {background-color:#C2DEFF !important;}\n"+
  215.  
  216. ".gray {background-color:#999999 !important; border: 2px solid #666666 !important; text-shadow: -1px -1px 1px #666666, 1px 1px 1px #666666, 1px -1px 1px #666666, -1px 1px 1px #666666; text-transform: none !important; font-color:white !important;}\n"+
  217. ".gray:hover {background-color:#C3C3C3 !important;}\n"+
  218.  
  219. ".odd {background-image: -moz-linear-gradient(center top , orange, red); box-shadow: 1px 1px 1px black; -moz-transform: rotate(15deg);}\n"+
  220. ".odd:hover {-moz-transform: none;}\n"+
  221.  
  222. ".post.mosquito {width:16px; height:16px;}\n"+
  223. ".post.tiny {width:24px; height:24px;}\n"+
  224. ".post.small {width:32px; height:32px;}\n"+
  225. ".post.medium {width:48px; height:48px;}\n"+
  226. ".post.large {width:64px; height:64px;}\n"+
  227. ".post.xlarge {width:96px; height:96px;}\n"+
  228.  
  229. ".floater.mosquito {left:8px;top:8px;}\n"+
  230. ".floater.tiny {left:12px;top:12px;}\n"+
  231. ".floater.small {left:16px;top:16px;}\n"+
  232. ".floater.medium {left:24px;top:24px;}\n"+
  233. ".floater.large {left:32px;top:32px;}\n"+
  234. ".floater.xlarge {left:48px;top:48px;}\n"+
  235.  
  236. ".post.mosquito.working .picture img {width:24px; height:24px;left:-4px;top:-4px;}\n"+
  237. ".post.tiny.working .picture img {width:32px; height:32px;left:-4px;top:-4px;}\n"+
  238. ".post.small.working .picture img {width:48px; height:48px;left:-8px;top:-8px;}\n"+
  239. ".post.medium.working .picture img {width:64px; height:64px;left:-8px;top:-8px;}\n"+
  240. ".post.large.working .picture img {width:96px; height:96px;left:-16px;top:-16px;}\n"+
  241. ".post.xlarge.working .picture img {width:128px; height:128px;left:-16px;top:-16px;}\n"+
  242.  
  243. //"div.pinned {border-radius: 6px; background-color: black !important;}\n"+
  244. //".post.short.pinned .picture img {border-radius: 5px; height:80% !important; width:80% !important; margin-left:10%; margin-top:10%;}\n"+
  245.  
  246. "#wmContent>.jsfTabControl>.tabs {top:10%; width:100px; position:relative;}\n"+
  247. "#wmContent>.jsfTabControl>.pages {border-radius:5px;}\n"+
  248. "#wmContent>.jsfTabControl>.tabs>.jsfTab {text-align:center;}\n"+
  249. ".jsfTabControl>.tabs {font-family:impact; font-size:large; color:inactivecaptiontext;}\n"+
  250. "input,select,label,textarea {font-family:tahoma,arial; font-size:small; vertical-align:baseline !important;}\n"+
  251. ".jsfComboBox {line-height:normal;}\n"+
  252. "button {font-family:tahoma,arial; font-size:small; vertical-align:top !important;}\n"+
  253. "input[type=\"checkbox\"] {font-family:tahoma,arial; font-size:small; vertical-align:middle !important;}\n"+
  254.  
  255. ".nomargin {margin:0 !important;}\n"+
  256. ".hidden {display:none !important;}\n"+
  257. ".block {display:block !important;}\n"+
  258. ".alignTop {vertical-align:top !important;}\n"+
  259. ".fit {width:100% !important;}\n"+
  260. ".indent {margin-left:16px;}\n"+
  261. "img.crisp {image-rendering: -moz-crisp-edges;}\n"+
  262. ".listItem {position:relative; clear:both;}\n"+
  263. ".listItem.disabled {opacity:0.5 !important; background-color:#eeeeee;}\n"+
  264. ".listItem .toolBox {position: absolute; right: 0px; top: 0;}\n"+
  265. ".listItem select {border:0px; padding:0px; margin: 0px; margin-left:6px; margin-right:6px; background-color:#eeeeee; vertical-align:middle;}\n"+
  266. ".listItem input {border:0px; padding:0px; margin: 0px; margin-left:6px; margin-right:6px; background-color:#eeeeee; vertical-align:middle;}\n"+
  267. ".listItem textarea {background-color:#eeeeee; border:0px;}\n"+
  268.  
  269. ".header {background-color: window; font-family:impact; font-size:2em; color:inactivecaptiontext; border-radius:5px 5px 0 0; padding-left:6px;}\n"+
  270. ".headerCaption {background-color: window; color: inactivecaptiontext; font-family: arial; font-size: small; padding-bottom: 6px; padding-left: 16px; padding-right: 16px; padding-top: 6px; border-radius:0 0 5px 5px;}\n"+
  271. ".headerCaption+.toolBox, .header+.toolBox {border-bottom:1px solid activeborder; margin-bottom: 5px; margin-top: 5px; padding-bottom: 5px;}\n"+
  272. ".line {border-top:1px solid #c0c0c0; line-height:2em;}\n"+
  273. ".subsection {margin-left:28px;}\n"+
  274. ".optioncontainer {max-height:12em; overflow-y:auto; background-color:rgb(238, 238, 238);}\n"+
  275. ".optioncontainer>.line {line-height:normal;}\n"+
  276. ".singleCol .post.classic {}\n"+
  277. ".twoCol .post.classic {display: inline-block; width: 50%; vertical-align: top;}\n"+
  278. ".twoCol .post.classic > .body {padding-right:28px;}\n"+
  279. ".threeCol .post.classic {display: inline-block; width: 33%; vertical-align: top;}\n"+
  280. ".threeCol .post.classic > .body {padding-right:28px;}\n"+
  281. ".fourCol .post.classic {display: inline-block; width: 25%; vertical-align: top;}\n"+
  282. ".fourCol .post.classic > .body {padding-right:28px;}\n"+
  283.  
  284. ".w400 {width:400px;}\n"+
  285. ".foundWM {background-color:green;}\n"+
  286.  
  287.  
  288. ""
  289. }catch(e){log("WM.console.globalStyle: "+e);}},
  290.  
  291. init: function(params){try{
  292. debug.print("WM.console.init:");
  293. var validateFBElements=["globalContainer","content"];
  294. params=params||{};
  295.  
  296. //if console does not already exist
  297. if (!WM.console.tabContainer) {
  298. try{
  299. var gs = WM.console.globalStyle();
  300. addGlobalStyle(gs,"styleConsole4");
  301. }catch(e){log("WM.console.init.addGlobalStyle: "+e);};
  302.  
  303. /*//attach to facebook page
  304. var baseNode=$("globalContainer");
  305. if (baseNode) baseNode=baseNode.parentNode;
  306. //or attach to page body
  307. else baseNode=($("body")||document.body);
  308. */
  309. var intendedPositionNode = document.body.childNodes[0];
  310. //debug.print(intendedPositionNode);
  311.  
  312. //sort fields shared by post sorting and grouping
  313. var sortFields = [
  314. {value:"age",title:"Time elasped since created (ms)."},
  315. {value:"alreadyProcessed",title:"History contains a status code for this post."},
  316. {value:"appID"},
  317. {value:"appName",title:"App name as it appears on FB."},
  318. {value:"date",title:"The datetime the post was created, in unix format. Does not contain millisecond data."},
  319. {value:"fromID",title:"The FB id of the person who created this post."},
  320. {value:"fromName",title:"The display name of the person who created this post."},
  321. {value:"fromNameLastFirst",title:"As fromName but displayed as LastName, FirstName"},
  322. {value:"id",title:"The post object id as it is connected with FB."},
  323. {value:"idText",title:"Either the whichText of the post, or the statusText of a post already processed."},
  324. {value:"isAccepted"},
  325. {value:"isFailed"},
  326. {value:"isTimeout"},
  327. {value:"isExcluded"},
  328. {value:"isCollect",title:"A flag for if this post is to be collected."},
  329. {value:"isForMe"},
  330. {value:"isLiked"},
  331. {value:"isMyPost"},
  332. {value:"isPaused"},
  333. {value:"isPinned"},
  334. {value:"isScam"},
  335. {value:"isStale"},
  336. {value:"isUndefined"},
  337. {value:"isWishlist"},
  338. {value:"isW2W",title:"If this post is a Wall-to-wall post or just a general feed post."},
  339. {value:"msg",title:"The comment attached to the post body by the post creator."},
  340. {value:"postedDay",title:"The year/month/day portion of the creation time for this post."},
  341. {value:"postedHour",title:"The year/month/day/hour portion of the creation time for this post."},
  342. {value:"priority",title:"Priority 0 being the first post you would want processed, and Priority 50 being default."},
  343. {value:"status",title:"The status code returned by the sidekick associated with this post."},
  344. {value:"which",title:"The sidekick-defined bonus type id for this kind of post."},
  345. {value:"whichText",title:"The text associated with this bonus type id."},
  346. {value:null,name:"(none)"},
  347. ];
  348.  
  349. //create our content window
  350. var newNodeBody;
  351. document.body.insertBefore(newNodeBody=createElement("div",{id:"wmContent"},[
  352. //toolbox
  353. (WM.console.tabContainer=new jsForms.tabControl({
  354. dock:"fillAndShare",
  355. sizeOffset:{height:-3,width:0},
  356. alignment:"left",
  357. tabs:[
  358. { //collect tab
  359. text:"Collect",
  360. image:null,
  361. onSelect:function(){WM.console.collectTabControl.redraw();},
  362. content:[
  363. createElement("div",{className:"header",textContent:"Collect"}),
  364. createElement("div",{className:"headerCaption",textContent:"View friends' posts and manage all your collection needs."}),
  365. createElement("div",{className:"toolBox medium"},[
  366. createElement("span",{className:"littleButton oddBlue",title:"Fetch Visible Posts Now",onclick:function(){WM.fetch({newer:true,bypassPause:true});} },[createElement("img",{className:"resourceIcon rssUpRight24"})]),
  367. //createElement("span",{className:"littleButton",title:"Fetch Older Posts Now",onclick:function(){WM.fetch({older:true,bypassPause:true});} },[createElement("img",{className:"resourceIcon rssDownLeft24"})]),
  368. WM.console.pauseFetchButton=createElement("span",{className:"littleButton oddOrange",title:"Pause Automatic Fetching",onclick:function(){WM.pauseFetching();} },[createElement("img",{className:"resourceIcon expandDown24"})]),
  369. WM.console.pauseCollectButton=createElement("span",{className:"littleButton oddOrange",title:"Pause Automatic Collection",onclick:function(){WM.pauseCollecting();} },[createElement("img",{className:"resourceIcon stop24"})]),
  370. createElement("span",{className:"littleButton",name:"0",title:"Classic View",onclick:WM.setDisplay},[createElement("img",{className:"resourceIcon layoutListColor24"})]),
  371. createElement("span",{className:"littleButton",name:"1",title:"Short View",onclick:WM.setDisplay},[createElement("img",{className:"resourceIcon layoutSmallColor24"})]),
  372. createElement("span",{className:"littleButton",name:"2",title:"Developer View",onclick:WM.setDisplay},[createElement("img",{className:"resourceIcon layoutDetailColor24"})]),
  373. createElement("span",{className:"littleButton",title:"Reset Counters",onclick:function(){WM.resetCounters();}},[createElement("img",{className:"resourceIcon refresh24"})]),
  374. createElement("span",{className:"littleButton oddOrange",title:"Clean Now",onclick:function(){WM.cleanPosts();}},[createElement("img",{className:"resourceIcon trash24"})]),
  375. createElement("span",{className:"littleButton",title:"ReID All",onclick:function(){WM.reIDAll();}},[createElement("img",{className:"resourceIcon identify24"})]),
  376. createElement("label",{className:"indent",textContent:"Sort By: "}),
  377. createElement("select",{id:"wmSortBy",className:"", title:"Sort By:", onchange:function(){WM.sortPosts({by:this.value});WM.redrawPosts({postRedraw:false,reorder:true});} },(function(){
  378. var ret=[];
  379. for (var i=0;i<sortFields.length;i++) ret.push(createElement("option",{value:sortFields[i].value,title:sortFields[i].title||"",textContent:sortFields[i].name||sortFields[i].value}));
  380. return ret;
  381. })()),
  382. createElement("span",{className:"littleButton oddGreen",title:"Sort Ascending",onclick:function(){WM.sortPosts({direction:"asc"});WM.redrawPosts({reorder:true, postRedraw:false});}},[createElement("img",{className:"resourceIcon sortAsc24"})]),
  383. createElement("span",{className:"littleButton oddOrange",title:"Sort Descending",onclick:function(){WM.sortPosts({direction:"desc"});WM.redrawPosts({reorder:true, postRedraw:false});}},[createElement("img",{className:"resourceIcon sortDesc24"})]),
  384. createElement("label",{className:"indent",textContent:"Group By: "}),
  385. createElement("select",{id:"wmGroupBy",className:"", title:"Group By:", onchange:function(){WM.constructGroups({by:this.value});WM.redrawPosts({postRedraw:false,reorder:true});} },(function(){
  386. var ret=[];
  387. for (var i=0;i<sortFields.length;i++) ret.push(createElement("option",{value:sortFields[i].value,title:sortFields[i].title||"",textContent:sortFields[i].name||sortFields[i].value}));
  388. return ret;
  389. })()),
  390. createElement("span",{className:"littleButton oddGreen",title:"Group Ascending",onclick:function(){WM.sortGroups({direction:"asc"});WM.redrawPosts({reorder:true, postRedraw:false});}},[createElement("img",{className:"resourceIcon sortAsc24"})]),
  391. createElement("span",{className:"littleButton oddOrange",title:"Group Descending",onclick:function(){WM.sortGroups({direction:"desc"});WM.redrawPosts({reorder:true, postRedraw:false});}},[createElement("img",{className:"resourceIcon sortDesc24"})]),
  392.  
  393. createElement("label",{className:"indent",textContent:"Columns: ",title:"Classic Mode Only"}),
  394. createElement("select",{title:"Cols:", onchange:function(){WM.setDisplayCols({cols:this.value});} },[
  395. createElement("option",{value:1,textContent:"One",selected:WM.quickOpts.displayCols==1}),
  396. createElement("option",{value:2,textContent:"Two",selected:WM.quickOpts.displayCols==2}),
  397. createElement("option",{value:3,textContent:"Three",selected:WM.quickOpts.displayCols==3}),
  398. createElement("option",{value:4,textContent:"Four",selected:WM.quickOpts.displayCols==4})
  399. ]),
  400. createElement("span",{className:"littleButton oddBlue",title:"Autolike Queue"},[
  401. createElement("img",{className:"resourceIcon like24"}),
  402. createElement("div",{className:"accFailBlock"},[
  403. WM.console.likeQueueCounterNode=createElement("span",{className:"accept",textContent:"0"})
  404. ])
  405. ]),
  406. ]),
  407. //app filter tabs
  408. (WM.console.collectTabControl=new jsForms.tabControl({
  409. dock:"fillAndShare",
  410. subStyle:"coolBar",
  411. shareSinglePage:true,
  412. preventAutoSelectTab:true,
  413. tabs:[
  414. {
  415. //default show all tab
  416. text:"Show ALL",
  417. image:"",
  418. imageClass:"resourceIcon allSidekicks32",
  419. appFilter:"All",
  420. onSelect:WM.setAppFilter,
  421. selected:(WM.quickOpts.filterApp=="All"),
  422. content:null, //because page is shared
  423. }
  424. ],
  425. sharedContent:[
  426. //bonus display node
  427. WM.console.feedNode=createElement("div",{id:"wmFeedNode",style:"position: relative;"}),
  428. ],
  429. })).node,
  430. ],
  431. },
  432. { //sidekicks tab
  433. text:"Manage Sidekicks",
  434. image:null,
  435. content:[
  436. createElement("div",{className:"header",textContent:"Manage Sidekicks"}),
  437. createElement("div",{className:"headerCaption",textContent:"Control some of the features of sidekicks."}),
  438. WM.console.sidekickNode=createElement("div",{id:"wmSidekickList",className:"scrollY"}),
  439. ],
  440. },
  441. { //feeds tab
  442. text:"Manage Feeds",
  443. image:null,
  444. content:[
  445. createElement("div",{className:"header",textContent:"Manage Feeds"}),
  446. createElement("div",{className:"headerCaption",textContent:"Add direct links to friends or other public profiles, and fetch posts from those feeds faster."}),
  447. createElement("div",{className:"toolBox medium columnRight"},[
  448. createElement("div",{},[
  449. createElement("div",{className:"littleButton oddGreen",title:"Add Feed",onclick:WM.feedManager.newFeed},[createElement("img",{className:"resourceIcon plus24"})]),
  450. ])
  451. ]),
  452. WM.console.feedManagerNode=createElement("div",{id:"wmFeedsList",className:"scrollY"}),
  453. ],
  454. },
  455. { //rules tab
  456. text:"Manage Rules",
  457. image:null,
  458. content:[
  459. createElement("div",{className:"header",textContent:"Manage Rules"}),
  460. createElement("div",{className:"headerCaption",textContent:"Create rules like macros to control exactly how posts are handled."}),
  461. createElement("div",{className:"toolBox medium columnRight"},[
  462. createElement("div",{},[
  463. createElement("div",{className:"littleButton oddGreen",title:"Add Rule",onclick:WM.rulesManager.newRule},[createElement("img",{className:"resourceIcon plus24"})]),
  464. createElement("div",{className:"littleButton oddBlue",title:"Reset All Limits",onclick:WM.rulesManager.resetAllLimits},[createElement("img",{className:"resourceIcon reset24"})]),
  465. createElement("div",{className:"littleButton oddBlue",title:"Convert Dynamics",onclick:WM.rulesManager.convertDynamics},[createElement("img",{className:"resourceIcon exportGrab24"})]),
  466. createElement("div",{className:"littleButton oddBlue",title:"Import Rule",onclick:WM.rulesManager.importRule},[createElement("img",{className:"resourceIcon importData24"})]),
  467. createElement("div",{className:"littleButton oddBlue",title:"Export All Rules",onclick:WM.rulesManager.showData},[createElement("img",{className:"resourceIcon object24"})]),
  468. WM.rulesManager.toggleHBNode=createElement("div",{className:"littleButton "+(WM.quickOpts.heartbeatDisabled?"oddOrange":"oddGreen"),title:"Toggle Heartbeat",onclick:WM.rulesManager.toggleHeartbeat},[createElement("img",{className:"resourceIcon heartbeat24"})]),
  469. ])
  470. ]),
  471. WM.console.priorityBuild=createElement("div",{id:"wmPriorityBuilder",className:"scrollY"}),
  472. ],
  473. },
  474. { //dynamics tab
  475. text:"Dynamic Grabber",
  476. image:null,
  477. content:[
  478. createElement("div",{className:"header",textContent:"Dynamic Grabber"}),
  479. createElement("div",{className:"headerCaption",textContent:"Create tests to capture posts sidekicks might not."}),
  480. createElement("div",{className:"toolBox medium columnRight"},[
  481. createElement("div",{},[
  482. createElement("div",{className:"littleButton oddGreen",title:"Add Test",onclick:WM.grabber.newTest},[createElement("img",{className:"resourceIcon plus24"})]),
  483. createElement("div",{className:"littleButton oddBlue",title:"Import Test",onclick:WM.grabber.importTest},[createElement("img",{className:"resourceIcon importData24"})]),
  484. ])
  485. ]),
  486. WM.console.dynamicBuild=createElement("div",{id:"wmDynamicBuilder",className:"scrollY"}),
  487. ],
  488. },
  489. { //friends tab
  490. text:"Friend Tracker",
  491. image:null,
  492. content:[
  493. createElement("div",{className:"header",textContent:"Friend Tracker"}),
  494. createElement("div",{className:"headerCaption",textContent:"Track player friends and your interactions with them."}),
  495. createElement("div",{className:"toolBox medium columnRight"},[
  496. createElement("span",{className:"littleButton oddOrange",title:"Clean Now",onclick:function(){WM.friendTracker.clearAll();}},[
  497. createElement("img",{className:"resourceIcon trash24"})
  498. ]),
  499. createElement("label",{className:"indent",textContent:"Sort By: "}),
  500. createElement("select",{title:"Sort By:", onchange:function(){WM.friendTracker.sort({sortBy:this.value});} },[
  501. createElement("option",{value:"acceptCount",textContent:"acceptCount",title:"How many posts WM remembers as collected successfully from this user."}),
  502. createElement("option",{value:"failCount",textContent:"failCount",title:"How many posts WM remembers as failed from this user."}),
  503. createElement("option",{value:"id",textContent:"id",title:"The facebook id of the user."}),
  504. createElement("option",{value:"lastKnownPostDate",textContent:"lastKnownPostDate",title:"The date of the last known post WM received for this user."}),
  505. createElement("option",{value:"name",textContent:"name",title:"The name of the user, with last name first."}),
  506. createElement("option",{value:"postCount",textContent:"postCount",title:"How many posts WM remembers receiving related to this user."}),
  507. createElement("option",{value:"totalCount",textContent:"totalCount",title:"How many posts WM remembers failed OR accepted from this user."})
  508. ]),
  509. createElement("span",{className:"littleButton oddGreen",title:"Sort Ascending",onclick:function(){WM.friendTracker.sort({sortOrder:"asc"});}},[createElement("img",{className:"resourceIcon sortAsc24"})]),
  510. createElement("span",{className:"littleButton oddOrange",title:"Sort Descending",onclick:function(){WM.friendTracker.sort({sortOrder:"desc"});}},[createElement("img",{className:"resourceIcon sortDesc24"})]),
  511. ]),
  512. WM.console.friendBuild=createElement("div",{id:"wmFriendTracker",className:"scrollY"}),
  513. ],
  514. },
  515. { //options tab
  516. text:"Options",
  517. image:null,
  518. content:[
  519. createElement("div",{className:"header",textContent:"Options"}),
  520. createElement("div",{className:"headerCaption",textContent:"Manage script and sidekick configuration, or link to updates."}),
  521. //config menu button
  522. createElement("div",{},[
  523. createElement("label",{textContent:"Open the options menu: "}),
  524. WM.console.configButton=createElement("button",{
  525. className:"jsfHidden",
  526. textContent:"WM Options",
  527. onclick:function(){
  528. //open options menu
  529. WM.config.open();
  530. },
  531. }),
  532. ]),
  533. //update script button
  534. createElement("div",{},[
  535. createElement("label",{textContent:"Update Script (Current Version: "+WM.version+") :"}),
  536. createElement("button",{
  537. className:"",
  538. textContent:"Update Script",
  539. onclick:function(){
  540. //open update url in new window/tab
  541. window.open(WM.scriptUpdateURL,"_blank");
  542. },
  543. }),
  544. ]),
  545. ],
  546. },
  547. ]
  548. })).node
  549. ]), intendedPositionNode);
  550. //debug.print(newNodeBody);
  551.  
  552. //destroy facebook content on page
  553. //if ($("content")) $("content").style.display="none !important";
  554. //init sort order
  555. $("wmSortBy").value=WM.quickOpts.sortBy;
  556.  
  557. //init group order
  558. $("wmGroupBy").value=WM.quickOpts.groupBy;
  559.  
  560. //init display mode
  561. with (WM.console.feedNode){
  562. className = className.toggleWordB(["1","3"].inArray(WM.quickOpts.displayMode),"short");
  563. }
  564. WM.setDisplayCols({cols:WM.quickOpts.displayCols});
  565. }
  566. WM.console.initialized = true;
  567.  
  568. //give sidekicks time to dock
  569. if (params["callback"]||null) {
  570. var fx = params["callback"];
  571. delete params["callback"];
  572. doAction(fx);
  573. }
  574. }catch(e){log("WM.console.init: "+e);}},
  575. }; //end WM.console
  576.  
  577. })();