GoogleMonkeyR (update by Roxz)

Google - Multiple columns of results, Remove "Sponsored Links", Number results, Auto-load more results, Remove web search dialogues, Open external links in a new tab, self updating and all configurable from a simple user dialogue.

  1. // ==UserScript==
  2. // @author mungushume
  3. // @version 1.7.3.12
  4. // @name GoogleMonkeyR (update by Roxz)
  5. // @namespace http://www.monkeyr.com
  6. // @description Google - Multiple columns of results, Remove "Sponsored Links", Number results, Auto-load more results, Remove web search dialogues, Open external links in a new tab, self updating and all configurable from a simple user dialogue.
  7. // @include http*://www.google.*.*/webhp?*
  8. // @include http*://www.google.*.*/search?*
  9. // @include http*://www.google.*.*/ig?*
  10. // @include http*://www.google.*.*/
  11. // @include http*://www.google.*.*/#*
  12. // @include http*://www.google.*/webhp?*
  13. // @include http*://www.google.*/search?*
  14. // @include http*://www.google.*/ig?*
  15. // @include http*://www.google.*/
  16. // @include http*://www.google.*/#*
  17. // @include https://encrypted.google.*/webhp?*
  18. // @include https://encrypted.google.*/search?*
  19. // @include https://encrypted.google.*/ig?*
  20. // @include https://encrypted.google.*/
  21. // @include https://encrypted.google.*/#*
  22. // @grant GM_registerMenuCommand
  23. // @grant GM_addStyle
  24. // @grant GM_setValue
  25. // @grant GM_getValue
  26. // @grant GM_xmlhttpRequest
  27. // @uso:script 9310
  28. // @scriptsource http://userscripts.org/scripts/show/9310
  29. // @scriptsource http://google.monkeyr.com/script/1.7.0/googlemonkeyr.user.js
  30. /* StartHistor
  31.  
  32. 3 Aug 2018
  33. Bugfix to fix some countries not being available and black videos
  34.  
  35. 2 Aug 2018
  36. Bugfix to include more domains. This version of the addon fixes the issues with the video things
  37.  
  38. v.1.7.3.1 - 23 Jul 2015 - by Kilvoctu
  39. - Bug fix: Autoload results should now display more results.
  40.  
  41. v.1.7.3 - 23 Jul 2015 - by Kilvoctu
  42. - Bug fix: Showing search results after Google changes
  43. - Change: Column width scales with window width
  44. - Known issues: Autoload results doesn't display more results.
  45. v.1.7.2 - 31 Aug 2014 - by Boltex
  46. - Bug fix: Google Changes in wdith in some divs
  47. - Feature: Remove next page link and loading image.
  48. *note* - If the results of the your search will go beyond the screen,
  49. you must find and change resolution. Find 1240px and change to your value.
  50.  
  51. v.1.7.1 - 26 Mar 2014 - by Boltex
  52. - Bug fix: Calculator results (single result) pages now work properly
  53.  
  54. v1.7.0 - 01 Nov 2013
  55. - Bug fix: Google changes in some tlds fix for display issues
  56.  
  57. v1.6.9 - 15 Aug 2013 beta
  58. - Bug fix: Google changes in some tlds (all at some point in the near future)
  59. made the results not fill the screen width. One little css tweak to fix!
  60.  
  61. v1.6.8 - 14 May 2013 beta
  62. - Bug fix: Calculator results (single result) pages now work properly
  63. - Feature: Results numbered in news searches (if enabled).
  64. - Feature: Added a next page link to the loading image when auto load is
  65. enabled. This allows you to carry on with your search even if the auto load
  66. fails. Suggested by Isuzu.
  67. - Bug fix: When changing search method (browser toolbar to google search box)
  68. results from the original search could leak through.
  69.  
  70. v1.6.7 - 29 Apr 2013 beta
  71. - Feature: Right hand panel is now handled as a flyout tab.
  72. - Bug fix: Changes to the result processing trigger. Hopefully it will
  73. catch more iterations
  74. - Feature: Loads more logging options (internal use for now)
  75. - Bug fix: On failure to process results properly (no results displayed)
  76. a result request run state won't occur i.e. No flood of requests to
  77. google, resulting in a capcha being displayed.
  78.  
  79. v1.6.6 - 26 Apr 2013
  80. - Checkout the changes from v1.6.4 unless you've been upgrading manually!
  81. - Bug fix: "Sponsored Links" ad removal on rhs
  82. - Bug fix: white-space:nowrap causing divs to overlap
  83. - Feature: back to top link now uses CSS transitions
  84.  
  85. v1.6.5 - 26 Apr 2013
  86. - Bug fix: Showing of favicons for https results and results with port
  87. numbers
  88. - Bug fix: A fix for google chrome's DOM event limitations
  89. - Bug fix: A fix for chrome's horrible way of dealing with the lack of
  90. GM_getValue and GM_setValue functions. What were they thinking?!
  91.  
  92. v1.6.4 - 25 Apr 2013
  93. - Bug fix: Showing results after google changes approx 24 Apr 2013
  94. Fixed trackless links
  95. Fixed favicons and GooglePreview
  96. Fixed "Sponsored Links" ad removal
  97. - Feature: Addition of back to top link when autoload results is selected and
  98. scrolled down the page a way
  99.  
  100. v1.6.3 - 21 Mar 2013
  101. - Bug fix: Only remove the left results margin if more than one column of
  102. results is selected.
  103. - Bug fix: Searches Related to only moved to the top if autoload more results
  104. is selected.
  105.  
  106. v1.6.2 - 18 Jan 2013
  107. - Bug fix: Missing GoogleMonkeyR options on /webhp? pages
  108. - Bug fix: Result positioning on all pages
  109. - Bug fix: Currency conversions were being hidden. Thanks cip
  110. - Bug fix: Searches related to moved to top
  111. - Bug fix: "Don't display the Google web search dialogues" corrected position
  112. of preferences link
  113. - Bug fix: loading animation not displaying on google instant further
  114. searches. Thanks smk
  115. - Bug fix: Sublink tracking bug. Cheers smk!
  116. - Bug fix: Rollover of images in general results now shows an enlarged version
  117. of the image. Thanks r600
  118. - Feature: Removal of remove "Search Tools" as its now obsolete
  119. - Feature: Addition of remove "Right Panel" setting
  120.  
  121. v1.6.1 - 14 Jan 2013
  122. - Bug fix: Missing Fav icons on first results
  123. - Bug fix: Missing preview images on first results
  124. - Bug fix: Missing open in new tab/window on first results
  125.  
  126. v1.6.0 - 17 Dec 2012
  127. - Bug fix: Page width with autoload more results enabled
  128. - Bug fix: Inline numbered results
  129. - Bug fix: No results on image searches
  130. - Bug fix: Settings link enabled eveywhere (hopefully)
  131. - Bug fix: GM_functions being overwritten. thanks derjanb
  132.  
  133. v1.5.4.5 beta - 13 Dec 2011 - USE THIS ONLY IF YOU HAVE THE NEW GOOGLE TOOLBAR!
  134. - Feature: Now works with google instant. Modded the google instant code to
  135. work with Chrome.
  136.  
  137. v1.5.4.4 beta - 13 Dec 2011 - USE THIS ONLY IF YOU HAVE THE NEW GOOGLE TOOLBAR!
  138. - Feature: Now works with google instant. Almost fried my head doing it and the
  139. code isn't pretty but it seems quite stable. Your feedback is welcomed!
  140.  
  141. v1.5.4.3 beta - 10 Dec 2011 - USE THIS ONLY IF YOU HAVE THE NEW GOOGLE TOOLBAR!
  142. - Security: Using favicons or imagepreview on a secure (https) google search
  143. page would expose those urls to the unencrypted version of google therefore
  144. breaking the security of the page. This occured due to an oversite on my part
  145. and i sincerely apologise. Special thanks to semur5 for idenitfying the issue!
  146.  
  147. v1.5.4.2 beta - 9 Dec 2011 - USE THIS ONLY IF YOU HAVE THE NEW GOOGLE TOOLBAR!
  148. - Feature: Sublink tracking now respects your choice in the preferences.
  149. Trackless links are also added when Disable Google Tracking is disabled. Thanks
  150. @smk for your input!
  151.  
  152. v1.5.4.1 beta - 8 Dec 2011
  153. - Feature: When "Don't display the Google web search dialogues" is checked with
  154. the new Google toolbar, elements are moved around to maximise your screen real
  155. estate. USE THIS ONLY IF YOU HAVE THE NEW GOOGLE TOOLBAR!
  156.  
  157. v1.5.4 - 6 Dec 2011
  158. - Bug fix: GoogleMonkeyR preferences link moved after googles update to the
  159. menu bar. Thanks for the info on how to get it digideth!
  160.  
  161. Since this Google update i'm unsure what to do about removal of search boxes
  162. etc. I could start moving elements around on the page but through experience
  163. i'm sure this will end up breaking the script more often. Not good!
  164. beta versions (with elements moved around for new toolbar ONLY) can be found
  165. here http://google.monkeyr.com/ff/history.php
  166.  
  167. v1.5.3 - 21 Nov 2011
  168. - Bug fix: Addition of https includes. Thank you @J-Mac!
  169. - Bug fix: Multiple columns of results were sometimes spilling out of the width
  170. of the browser (giving horizontal scrollbars). Now Fixed!
  171.  
  172. v1.5.2 - 5 Oct 2011
  173. - Bug fix: Repaired top margin on image results. Thanks to trup for the screen
  174. shot, version info and link to a problem page! Easy to track down bugs when
  175. this sort of info is provided ;)
  176.  
  177. v1.5.1 - 5 Oct 2011
  178. - Bug fix: Repaired Cached and Similar links when Disable Google tracking my
  179. search results is checked.
  180. - Bug fix: Altered the position of the Advanced Search link when Don't display
  181. the Google web search dialogues is checked (works better on smaller screens).
  182. - Bug fix: Corrected the positioning of elements at the top of the page on
  183. image searches.
  184. - Bug fix: Shopping searches now show the your location / sort by top tool bar.
  185. - Bug fix: Video search now shows thumbnails for auto loaded content.
  186.  
  187. v1.5 - 25 Sep 2011
  188. - Bug fix: result container width has been limited in a recent update. Now
  189. fixed. Thanx @ck0743 and @Phil699 for your patience
  190. - Bug fix: Various other fixes after the most recent google updates. 4 hours
  191. coding in all just to get it back to how it was! Deep joy ;)
  192.  
  193. v1.4.7 - 21 Jul 2011
  194. - Bug fix: First results we partially hidden when "Don't display the Google
  195. web search dialogues" was selected
  196. - Bug fix: Update banner was hidden below the top black bar
  197. - Bug fix: Removed duplicate did you mean, again! Thanks andi-03!
  198. - Feature: Now using Google favicons as suggested by None Nosome. Cheers!
  199.  
  200. v1.4.6 - 9 Jul 2011
  201. - Bug fix: Missing thumbnail images on subsequent pages of results when auto
  202. load is enabled.
  203. - Bug fix: Trackless links fixed. Thanks @eatmorglue!
  204.  
  205. v1.4.5 - 27 Apr 2011
  206. - Bug fix: Rejiggle after Google altered some bits on there Australian home
  207. page. Thanks @daveo76 for reporting this!
  208.  
  209. v1.4.4 - 20 Feb 2011
  210. - Bug fix: Missing thumbnail images on subsequent pages of results when auto
  211. load is enabled
  212.  
  213. v1.4.3 - 18 Feb 2011
  214. - Bug fix: Changed the browser (GreaseMonkey) detection method to a more
  215. generic function. This should stop problems with FF beta v11+.
  216. Thanks to Babbalucio and Qudeid for identifying the line the error seen in
  217. FFb11 was occuring.
  218. - Layout: Hopefully corrected the removal of duplicate "Did you mean?",
  219. "Showing results for..." and "More results for..." without removing potential
  220. "No results found for...". One day i'll get it right!)
  221. - Layout: Corrected positioning of result stats/search dialogue with instant
  222. search on or off.
  223. - Bug fix: Updated https @includes for the encrypted subdomain as noted
  224. by SeeFood. Thanks!
  225.  
  226. v1.4.2.1 - 17 Feb 2011
  227. - Layout: Moved settings link under the options (gear) icon
  228.  
  229. v1.4.2 - 17 Feb 2011
  230. - Bug fix: Now works with the new top toolbar
  231.  
  232. v1.4.1 - 24 Dec 2010
  233. - Bug fix: Allowed port numbers in the page preview code as per RobinRosengren's
  234. suggestion. Cheers.
  235.  
  236. v1.4 beta - 17 Dec 2010
  237. - Rebuild: Now one script for all browsers (including chrome!) with no
  238. dependencies on any other scripts (opera)
  239. - Bug fix: Corrected the positioning of result numbering
  240. - Bug fix: Removed duplicate did you mean
  241. - Feature: Now you can remove googles Site Preview feature
  242.  
  243. v1.3.8.1 beta - 26 May 2010
  244. - Feature: Changed/updated @includes to allow for https searching as requested
  245. by auscompgeek
  246.  
  247. v1.3.8 - 24 May 2010
  248. - Layout: Position adjustment of loading image and txt for auto load
  249. - Bug fix: Second "Showing results for" prompt is now removed when Google
  250. thinks you have misspelled your search term.
  251. - Bug fix: First "Did you mean" prompt is now removed when Google thinks you
  252. have misspelled your search term.
  253.  
  254. v1.3.7 beta - 10 May 2010
  255. - Bug fix: Certain links in the search tools panel caused a reload of results
  256. but removed the first chunk of them when auto load was turned on.
  257. - Bug fix: Display of end of results notification when auto load is enabled.
  258. - Bug fix: Trackless links were sometimes appearing to early in the results
  259. when translate this page links occur.
  260. - Bug fix: "Show more results from" links now open inline as expected.
  261. - Feature: Update of result stats with auto load enabled.
  262.  
  263. v1.3.6 - 09 May 2010
  264. - Bug fix: Duplicate entries when "Auto load more results" is selected. Looks
  265. like i introduced a bug back in v1.3.0 (Oct 09) during a code clean up. I'd
  266. managed to double quote two regex values that may have resulted in duplicates
  267. appearing when your default "Number of Results" returned by Google was anything
  268. other than 10.
  269. - Bug fix: "More search tools" link removed the first X amount of results from
  270. your search results. Where X is the "Number of results" per page set in your
  271. Google preferences. This has now been resolved.
  272. - Thank you gauravbaadshah! Your (continued) well presented bug reports are
  273. helping to make GoogleMonkeyR as good as it should be!
  274.  
  275. v1.3.5 - 08 May 2010
  276. - Feature: Added the ability to show/remove the "Search Tools" (left panel)
  277. that has appeared in the latest Google update.
  278. - Bug fix: Selectors updated for trackless links. Should now pick up more
  279. results and create the assosiated trackless links.
  280. - Bug fix: Repositioning of key elements when preferences remove "Related
  281. Searches", "Sponsored Links" or "Search Tools".
  282.  
  283. v1.3.4 - 07 May 2010
  284. - Bug fix: Recent Google changes have been addressed in this update. I hope to
  285. have another update shortly that will address some display issues when auto-load
  286. is used and you approach the bottom of the page.
  287.  
  288. v1.3.3 - Unreleased
  289. - Bug fix: All "Did you mean?" prompts were removed when Google thought you had
  290. misspelled your search term. This is now corrected.
  291. Thanks to MasterMind33 for the heads up! Appreciated!
  292. - Bug fix: Trackless links added when Cached/Simlar links don't exist
  293.  
  294. v1.3.2 - 02 Dec 2009
  295. - Bug fix: When you follow links with the .../#hl=... type of format the script
  296. fails to trigger. I've now added the include http://www.google.tld/#*
  297. Big thanks to Hiromacu for finding the bug!
  298.  
  299. v1.3.1 - 10 Oct 2009
  300. - Bug fix: Possible infinite loop bug with /webhp? pages.
  301.  
  302. v1.3.0 - 09 Oct 2009
  303. - Bug fix: When searching using the "on page" search dialogs, the script was
  304. not triggering properly. The fix implemented is only a band-aid and when google
  305. implement more changes, it will fail. I am working on the issue when i get time
  306. - Feature: Added an extra option in preferences to remove the "Related
  307. Search" links that sometimes appear at the top of your search results.
  308. - Feature: Added an extra option in the preferences to select the flow
  309. direction of your results when you use multiple columns. Either left to right
  310. or top to bottom newspaper style. If you use "Auto-load" the newspaper style
  311. is automatically paginated to try and keep some clarity in your results.
  312. - Bug fix: Added the include for "/ig?*" urls (iGoogle)
  313. - Cleanup: Reduced the amount of code for the creation and styling of elements
  314. using the function document.buildElement
  315. - Feature: Now works on "/webhp?*" search urls
  316. Thanks to gauravbaadshah for pointing this out!
  317. - Bug fix: Removed Googles results width limiting
  318.  
  319. v1.2.0 - 02 Jun 2009
  320. - Bug fix: The display of favicons for https links has been removed to stop
  321. invalid certificate warnings whilst searching.
  322. - Bug fix: Error removed when the main link of a result can't be found.
  323. - Feature: Site description text of each search result, when one column of
  324. results is selected, is increased to 95% of the containing cell width as this
  325. seems to be more readable. Two or more columns of results is unchanged as i
  326. found the data appeared to be more cluttered.
  327. As requested by The_Steph.
  328. - Bug fix(ish): Google personalised search (Promote, Remove) functionality
  329. will now work on the initially loaded page of results. All further results
  330. loaded dynamically using the "Auto load" option will NOT!
  331. - Bug fix: "End of search results" wasn't showing up when you'd reached the
  332. end of the results. Now fixed.
  333. - Bug fix: Removal of duplicate "Did you mean:" links at the top of search
  334. results when you've misspelled your search term(s).
  335.  
  336. v1.1.1.2 - 22 Nov 2008
  337. - Bug fix: Another fix for the latest Google changes. Hopefully across the
  338. board this time.
  339.  
  340. v1.1.1.1 - 21 Nov 2008
  341. - Bug fix: Quick (ish) fix for the latest Google changes. Sorry on my hols!)
  342.  
  343. v1.1.1.0 - 03 Nov 2008
  344. - Feature: Addition of favicons next to the main link. Configurable via a
  345. checkbox in the preferences.
  346. As requested by Pierre75007.
  347.  
  348. v1.1.0.0 - 03 Nov 2008
  349. - Feature: Addition of GooglePreview images in your search results. Open up the
  350. GoogleMonkeyR preferences to turn this feature on.
  351. As requested by Nasir Jones.
  352. - Bug fix: Open in new target now overpowers any settings specified in your
  353. Google preferences.
  354.  
  355. v1.0.9.1 - 30 Oct 2008
  356. - Bug fix: Ooops. I messed up the z-index of the preferences screen in the last
  357. version. It was appearing behind the blocker. All fixed in this update.
  358.  
  359. v1.0.9 - 30 Oct 2008
  360. - Feature: Moved the related searches and blog entries etc. to the top of the
  361. results.
  362. - Cleanup: Commented out a GM_log entry i left in in the last update.
  363. - Bug fix: Version comparison now compares numbers rather than strings. Ooops.
  364. - Bug fix: Base numbering of 2nd, 3rd, 4th... pages of results restored (when
  365. auto load more results is turned off).
  366.  
  367. v1.0.8.9 - 23 Oct 2008
  368. - Bug fix: Auto load more results is back up and running. Google has removed
  369. the id attribute from the Next link at the bottom of their results page. Had
  370. to find it a different way.
  371. - Cleanup: encodeURI of the history information. (to maybe help with the crash)
  372. - Cleanup: Removal of an extra preferences bind that seems to have crept in
  373. at the end of the script (to maybe help with the crash)
  374.  
  375. v1.0.8.8 - 14 Oct 2008
  376. - Bug fix: Results table and column widths should now be more stable. Less
  377. re-sizing as links are clicked and/or more results auto-load.
  378. - Bug fix: Refined the stylesheet code that gives the results the background
  379. hue. This was to stop other elements getting the same hue.
  380. - Bug fix: Added trackless link to each result regardless of whether your
  381. logged into a Google account or not.
  382. - Bug fix: With the google search dialogs removed sometimes a message reading
  383. "Personalized based on your web history." overlays the GoogleMonkeyR link.
  384. This has now been adjusted to sit below the links.
  385. - Cleanup: XPath functions added to the document object.
  386.  
  387. v1.0.8.7 - 05 Oct 2008
  388. - Cleanup: Change of the update url to point at the script meta file
  389. "http://userscripts.org/scripts/source/9310.meta.js"
  390. this will reduce the bandwidth to/from userscripts.org and speed up checks
  391. - Cleanup: Change of several method names to aid readability
  392. - Cleanup: "Update bar" code re-written more cleanly
  393.  
  394. v1.0.8.6 - 01 Oct 2008
  395. - Cleanup: Change of includes to use "Magic top-level domains" instead of *'s
  396. see http://wiki.greasespot.net/Magic_TLD for more info
  397. - Cleanup: Change of update script to pick up history text more cleanly
  398.  
  399. v1.0.8.5 bug fix - 25 Sep 2008
  400. - Bug fix: History update fix 2
  401.  
  402. v1.0.8.4 bug fix - 25 Sep 2008
  403. - Bug fix: History update fix
  404.  
  405. v1.0.8.3 bug fix - 23 Sep 2008
  406. - Bug fix: Final fix with the auto update script
  407.  
  408. v1.0.8.2 bug fix - 23 Sep 2008
  409. - Bug fix: Another small bug fix with the auto update script
  410.  
  411. v1.0.8.1 bug fix - 23 Sep 2008
  412. - Bug fix: Small bug fix with the auto update script
  413.  
  414. v1.0.8 - 23 Sep 2008
  415. - Feature: The update feature of the script has been completely re-written
  416. to notify the user when there are future updates. This update mechanism
  417. will also work if (and when) Google decide to change their DOM again! The
  418. basis for this update method comes from the "UserScript Update Notification"
  419. script from Seifer. This code has been heavily modified and expanded for
  420. the GoogleMonkeyR script.
  421.  
  422. v1.0.7 bug fix - 17 Sep 2008
  423. - Bug fix: Roll up pack of bug fixes. Should be ok for now!
  424.  
  425. v1.0.6.3 beta bug fix - 21 Aug 2008
  426. - Bug fix: Some localisations of Google changed again on the 19th Aug. The DOM structure has again
  427. been modified. Oh when will they stop messing with it?
  428.  
  429. v1.0.6.2 beta bug fix - 13 Aug 2008
  430. - Bug fix: Some localisations of Google changed again on the 12th Aug. The DOM structure has again
  431. been modified. More changes to follow? I hope not!
  432. This is a beta update to fix these problems but may have its own bugs!!!
  433. - Feature: Added ability to change the background hue or the border color of the search results
  434.  
  435. v1.0.6.1 beta bug fix - 01 Aug 2008
  436. - Bug fix: Some localisations of Google changed on the 31st July.
  437. The DOM structure was quite heavily modified and somehow they messed up the
  438. scroll to bottom of page detection.
  439. This is a beta update to fix these problems but may have its own bugs!!!
  440. - Bug fix: Autoload would flood requests to Google for the next page of results.
  441. Now only one request is sent until a response is received
  442. - Bug fix: Background hue now defaults to transparent rather than white.
  443. Thanks to Lil Junior for the suggestion!
  444.  
  445. v1.0.6 - 19 Apr 2008
  446. - Bug fix: Corrected the display of the preferences screen in Firefox 3
  447. - Bug fix: Corrected the removal of web search dialogs (after an update on google)
  448. - Bug fix: Natural numbering of 2nd, 3rd, 4th... pages of results.
  449. Thanks to theMoJo for the natural numbering sample code!
  450.  
  451. v1.0.5 - 24 Oct 2007
  452. - Bug fix: Natural indentation of multiple results from the same site restored
  453. - Bug fix: Google news entries within results no longer breaks the layout and numbering
  454. - Feature: Added ability to change (or remove) the background hue of the search results
  455. NB* Color picker code borrowed, then heavily modified, from Flooble.com
  456.  
  457. v1.0.4 - 25 May 2007
  458. - Bug fix: Removed the visually anoying bug where when you clicked on a "long" link it resized the whole
  459. cell container before taking you to your link. Grrrr.
  460.  
  461. v1.0.3 - 20 May 2007
  462. - Bug fix: "Open results in a new target" would only work for the initially loaded results, not subsequent
  463. additions by the auto loader
  464. - Bug fix: Limit the column width to always fit on screen without scroll. As requested by Edward Rapley
  465. NB* This fix only works when your being reasonable! If you want 4 columns of results on an 800x600
  466. screen you'll have trouble. Works best with the "Sponsored Links" removed
  467. - Feature: Added an entry to the Greasemonkey user script commands to allow opening of the GoogleMonkeyR
  468. preferences. This is just in case Google decide to alter their site in a way that removes the
  469. GoogleMonkeyR link from the top of the page.
  470. - Feature: Ability to disable Google tracking your search results
  471. NB* Every time you click a link in your search results, the click gets reported back to Google for
  472. their statisticians to ponder over. If you are signed in to a Google account this click will
  473. be recorded in your search history. This allows you to remove this reporting to Google.
  474. - Feature: When the Disable Google tracking option is not active, an extra "Trackless" link is added
  475. in the "Cached", "Similar pages" links of each of the search results, so you can decide whether
  476. to be tracked at the time!
  477.  
  478. v1.0.2 - 18 May 2007
  479. - Now uses userscripts.org as the download location for future updates
  480.  
  481. v1.0.1 - 16 May 2007
  482. - clean up of the code to use more of the this keyword rather than working round the issue by using the
  483. document as a patsy
  484.  
  485. EndHistory */
  486. // ==/UserScript==
  487.  
  488.  
  489.  
  490. /**
  491. * Processing of the current page.
  492. **/
  493. (function(){
  494. var UIL =
  495. {
  496. scriptName : "GoogleMonkeyR",
  497. scriptVersion : "v.1.7.3.1",
  498. scriptId : "9310",
  499. watching : false,
  500.  
  501. init : function()
  502. {
  503. var pageType = this.determineCurrentPageType();
  504. //monkeyr.log(pageType);
  505. if(pageType !== null)
  506. {
  507. this.processPage(pageType);
  508. }
  509. else
  510. {
  511. var self = arguments.callee;
  512. setTimeout(self.bind(this),100);
  513. }
  514. },
  515.  
  516. determineCurrentPageType : function()
  517. {
  518. var pageType = null;
  519. var loc = window.location.href.toLowerCase();
  520. if (loc.indexOf("/ig?") != -1)
  521. {
  522. pageType = "igoogle";
  523. }
  524. else if (loc.indexOf("tbm=isch") != -1)
  525. {
  526. pageType = "image";
  527. }
  528. else if (loc.indexOf("tbm=shop") != -1)
  529. {
  530. pageType = "shopping";
  531. }
  532. else if (loc.indexOf("/webhp?") != -1)
  533. {
  534. this.instant = true;
  535. pageType = "search";
  536. }
  537. else if ((loc.indexOf("/search?") != -1))
  538. {
  539. this.instant = false;
  540. pageType = "search";
  541. }
  542. else if ((loc.indexOf(window.location.protocol + '//' + window.location.hostname + '/#') != -1))
  543. {
  544. this.instant = true;
  545. pageType = "search";
  546. }
  547. else if (window.location.href==(window.location.protocol + '//' + window.location.hostname + '/'))
  548. {
  549. this.instant = true;
  550. pageType = "search";
  551. }
  552. return pageType;
  553. },
  554.  
  555. processPage : function(pageType)
  556. {
  557. if (pageType !== null)
  558. {
  559. var pageProcessor = pageType + "PageProcessor";
  560. if (typeof(this[pageProcessor]) == "function")
  561. {
  562. this.hideSearch = UIL.Config.getHideSearch();
  563. this.numResults = UIL.Config.getNumResults();
  564. this.numColumns = UIL.Config.getNumCol();
  565. this.newspaper = UIL.Config.getResultFlow() != "l2r";
  566. this.noSitePreview = UIL.Config.getNoSitePreview();
  567. this.autoLoad = UIL.Config.getAutoLoad();
  568. this.favIcon = UIL.Config.getFavIcon();
  569. this.externalLinksResults = UIL.Config.getExtLinkSearch();
  570. this.searchLinkTracking = UIL.Config.getSearchLinkTracking();
  571. this.searchesRelatedTo = UIL.Config.getSearchesRelatedTo();
  572. this.imagePreview = UIL.Config.getImagePreview();
  573. this.remSponsor = UIL.Config.getRemSponsor();
  574. this.remRightPanel = UIL.Config.getRemRightPanel();
  575. this.resHue = UIL.Config.getResHue();
  576. this.bGBorder = UIL.Config.getBGBorder();
  577. this.backToTopLinkInsert = true;
  578. this.backToTopLinkShow = true;
  579. // this.scrollHeight = 0;
  580. // this.winInnerHeight = 0;
  581. this.initialise = true;
  582.  
  583. this[pageProcessor]();
  584. }
  585. }
  586. },
  587.  
  588. igooglePageProcessor : function()
  589. {
  590. if(this.hideSearch)
  591. {
  592. var searchEle = document.getElementById("gsea");
  593. if(searchEle)
  594. {
  595. searchEle.style.display="none";
  596. }
  597. }
  598. this.externalLinks(document, UIL.Config.getExtLinkiGoogle());
  599. },
  600.  
  601. searchPageProcessor : function()
  602. {
  603. var watch, that=this
  604. if(this.watching)
  605. {
  606. watch = document.querySelector(this.watching);
  607. watch.addEventListener("DOMNodeInserted", function(e){
  608. monkeyr.log('inserted', e.target);
  609. that.whackTest('inserted', e);
  610. }, false);
  611. watch.addEventListener("DOMSubtreeModified", function(e){
  612. monkeyr.log('subtree', e.target, e.attrName, e.newValue, e.prevValue, e)
  613. that.whackTest('subtree', e);
  614. }, false);
  615. watch.addEventListener("DOMAttrModified", function(e){
  616. monkeyr.log('attribute', e.target, e.attrName, e.newValue, e.prevValue, e);
  617. that.whackTest('attribute', e);
  618. }, false);
  619. watch.addEventListener("DOMNodeRemoved", function(e){
  620. monkeyr.log('removed', e.target);
  621. that.whackTest('removed', e);
  622. }, false);
  623. // var observer = new MutationObserver(function(mutations) {
  624. // mutations.forEach(function(e) {
  625. // if(e.type!='childList'){
  626. // if(e.target.getAttribute(e.attributeName) != e.oldValue){
  627. // monkeyr.log('mutation', e.type, e.target, e.attributeName, e.target.getAttribute(e.attributeName), e.oldValue);
  628. // }
  629. // }
  630. // else{
  631. // monkeyr.log('mutation', e.type, e.target, e.addedNodes, e.removedNodes);
  632. // }
  633. // that.whackTest('mutation', e);
  634. // });
  635. // });
  636. // observer.observe(watch, {
  637. // attributes: true,
  638. // childList: true,
  639. // characterData: true,
  640. // subtree: true,
  641. // attributeOldValue: true
  642. // });
  643. return;
  644. }
  645. else
  646. {
  647. watch = document.querySelector('#main');
  648. watch.addEventListener("DOMNodeInserted", this.DOMNodeInsertedWatcher.bind(this), false);
  649. watch.addEventListener("DOMNodeRemoved", this.DOMNodeRemovedWatcher.bind(this), false);
  650. watch.addEventListener("DOMSubtreeModified", this.DOMSubtreeModifiedWatcher.bind(this), false);
  651. watch.addEventListener("DOMAttrModified", this.DOMAttrModifiedWatcher.bind(this), false);
  652.  
  653. // if(typeof MutationObserver === 'function')
  654. // {
  655. // // Only firefox and chrome currently support MutationObserver
  656. // var observer = new MutationObserver(function(mutations) {
  657. // mutations.forEach(that.MutationObserver.bind(that))
  658. // });
  659. // observer.observe(watch, {
  660. // attributes: true,
  661. // childList: false,
  662. // characterData: true,
  663. // subtree: true,
  664. // attributeOldValue: true
  665. // });
  666. // }
  667. // else
  668. // {
  669. // // 4 opera
  670. // watch.addEventListener("DOMSubtreeModified", this.DOMSubtreeModifiedWatcher.bind(this), false);
  671. // watch.addEventListener("DOMAttrModified", this.DOMAttrModifiedWatcher.bind(this), false);
  672. // }
  673. }
  674.  
  675. if(!this.instant)
  676. {
  677. this.registerControls();
  678. this.whackDom();
  679. }
  680.  
  681. var style = ''
  682. //style += (" #cnt #center_col {width:auto !important; max-width:100% !important;} #cnt #foot, .mw {margin-left:0 !important; width:auto !important; max-width:100% !important;}#rhs {left:auto; !important}#botstuff .sp_cnt,#botstuff .ssp, #ires{display:none} .s{max-width:98%!important;} .vshid{display:inline} #res h3.r {white-space:normal}");
  683. style += ("#cnt.singleton #center_col, #cnt.singleton #foot, .mw {width:auto !important; max-width:100% !important;} #rhs {left:auto !important; position:absolute}#botstuff .sp_cnt,#botstuff .ssp, #ires{display:none} .s{max-width:98%!important;} .vshid{display:inline} .ab_dropdown ul{list-style:none} #GTR *{white-space:normal!important} #GTR{border-spacing:5px} #rcnt .col:nth-of-type(3){width:100%!important} #rcnt .col:nth-of-type(4){float: none; right: 0px; top: -140px; width:100% !important}");
  684. style += ("div#scrollTop a {background:url("+UIL.RES.TOP_PNG+") transparent;border-radius: 10px 10px 10px 10px;bottom: 30px;height: 40px;position: fixed;right: 30px;width: 40px;z-index: 10000;}div#scrollTop a{-webkit-transition: opacity 1.0s ease;-moz-transition: opacity 1.0s ease;-o-transition: opacity 1.0s ease;0} div#scrollTop a.mh_show{opacity: 0.2} div#scrollTop a.mh_hide{opacity: 0}div#scrollTop a:hover{-webkit-transition: opacity .5s ease;-moz-transition: opacity .5s ease;-o-transition: opacity .5s ease;opacity: 0.5;}");
  685. style += ("div.col {width: 100% !important;}");
  686.  
  687. if(this.numColumns>1)
  688. {
  689. style += ("#cnt.singleton #center_col, #cnt.singleton #foot, .mw {margin-left:0 !important;}");
  690. }
  691.  
  692. if(this.autoLoad)
  693. {
  694. style += ("#loadingimg {width:180px;height:34px;background-image:url(" + UIL.RES.LOADING_GIF + ");background-repeat:no-repeat;margin:2em auto auto auto;padding:10px;display:none;} #loadingimg p{font-size:130%;font-weight:bold;padding-left:40px;margin:0;float:left} #loadingimg a{text-align: left; float: left;margin: 2px 10px;}");
  695. }
  696.  
  697. if(this.hideSearch)
  698. {
  699. // style += ("#rcnt{margin-top:1em} #sfcnt,#sftr,#searchform{display:none!important;}#cnt{padding:0}#cnt .mw:first-child{position:absolute;top:4.5em;right:0}#rshdr .sfcc{position:absolute;top:2em;right:0}");
  700. style += ("#ab_ctls,#ab_name,#resultStats{top:0} #gb,#gb.gbes,#gb.gbesi,#gb.gbem,#gb.gbemi{height:0!important}#gbx1,#gbx2{height:0!important}#gbq2[class='gbt'] #gbqfw{display:none;}#main{margin-top:44px!important}#gbu{margin-right:232px!important}");
  701. //document.getElementById('gbq').addEventListener("DOMAttrModified", this.resizeWatcher, false);
  702. //this.resizeWatcher(true);
  703. }
  704.  
  705. if(this.remSponsor)
  706. {
  707. style += ("#tvcap, #tads, #topstuff table.ts, #bottomads{display:none;}");
  708. }
  709.  
  710. // if(this.noSitePreview)
  711. // {
  712. // style += (".vspib {display:none}");
  713. // }
  714.  
  715. if(this.searchesRelatedTo)
  716. {
  717. style += ("#botstuff #brs{display:none;} #topstuff .tqref{display:none;}");
  718. }
  719.  
  720. // if(this.remRightPanel)
  721. // {
  722. // style += ("#rhs {display:none}");
  723. // }
  724.  
  725. if(this.numResults)
  726. {
  727. style += ("#res h3.r {display:inline}");
  728. }
  729.  
  730. var hue = this.resHue;
  731. if(hue.length==0)
  732. {
  733. hue = "transparent";
  734. }
  735.  
  736. var BGBorder;
  737. if(this.bGBorder=='background')
  738. {
  739. BGBorder = "background-color:";
  740. }
  741. else
  742. {
  743. BGBorder = "border: 1pt solid ";
  744. }
  745.  
  746. var imagePreview = "";
  747. if(this.imagePreview)
  748. {
  749. imagePreview = "min-height:102px;";
  750. }
  751.  
  752. // style += ("#side_tab a {color:#444;background-color:"+hue+";border: meduim none;box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.2);font-weight: bold;padding: 3px 14px;margin-top: 50px;text-decoration: none;border-radius: 6px 6px 0 0;transform: rotate(-90deg);-webkit-transform: rotate(-90deg);-moz-transform: rotate(-90deg);filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);position: absolute;}#side_tab{float: right;height: 100px;position: absolute;right: -50px;width: 100px;z-index:-10000000}#rhs_block{float:right;}");
  753. // style += (".side_out{-webkit-transform: translate(100%,0);-moz-transform: translate(100%,0);-o-transform: translate(100%,0);transition: all 2s ease-in-out;}#side_tab a:hover + .side_out{-webkit-transform: translate(-200%,0);-moz-transform: translate(-200%,0);-o-transform: translate(-100%,0);transition: all 2s ease-in-out;}");
  754.  
  755. style += ("#GTR li.g, #GTR div.g { margin-top: 0.15em !important; margin-right: 0.25em !important; margin-bottom: 0.15em !important; margin-left: 0.25em; -moz-border-radius: 10px; border-radius: 10px; " + BGBorder + " "+ hue +" ! important; padding: 0.5em ! important; } li.g {list-style:none outside none;"+imagePreview+"};");
  756.  
  757. if(!this.watching)this.addStyle("@namespace url(http://www.w3.org/1999/xhtml); "+style);
  758.  
  759. if((rhs = document.getElementById('rhs'))){
  760. this.rightPanelAdjuster(rhs);
  761. }
  762.  
  763. // setInterval(this.watchTimer.bind(this),500);
  764. // //monkeyr.log('google.timers.load.t.prt')
  765. // monkeyr.log(window);
  766. },
  767.  
  768. imagePageProcessor : function()
  769. {
  770. this.registerControls();
  771. var style = '';
  772. style += ("div#scrollTop a {background:url("+UIL.RES.TOP_PNG+") transparent;border-radius: 10px 10px 10px 10px;bottom: 30px;height: 40px;position: fixed;right: 30px;width: 40px;z-index: 10000;}div#scrollTop a{-webkit-transition: opacity 1.0s ease;-moz-transition: opacity 1.0s ease;-o-transition: opacity 1.0s ease;0} div#scrollTop a.mh_show{opacity: 0.2} div#scrollTop a.mh_hide{opacity: 0}div#scrollTop a:hover{-webkit-transition: opacity .5s ease;-moz-transition: opacity .5s ease;-o-transition: opacity .5s ease;opacity: 0.5;}");
  773. this.showBackToTopLink(true);
  774. // style += ("#cnt #center_col, #cnt #foot, .mw {width:auto !important; max-width:100% !important;} #rhs {left:auto; !important}#botstuff .sp_cnt,#botstuff .ssp, #ires{display:none} .s{max-width:98%!important;} .vshid{display:inline} #res h3.r {white-space:normal}");
  775. if(this.hideSearch)
  776. {
  777. // style += ("#rcnt{margin-top:1em} #sfcnt,#sftr,#searchform{display:none!important;}#cnt{padding:0}#cnt .mw:first-child{position:absolute;top:4.5em;right:0}#rshdr .sfcc{position:absolute;top:2em;right:0}");
  778. style += ("#ab_ctls,#ab_name,#resultStats{top:0} #gb,#gb.gbes,#gb.gbesi,#gb.gbem,#gb.gbemi{height:0!important}#gbx1,#gbx2{height:0!important}#gbq2[class='gbt'] #gbqfw{display:none;}#main{margin-top:0!important}");
  779. // document.getElementById('gbq').addEventListener("DOMAttrModified", this.resizeWatcher, false);
  780. //this.resizeWatcher(true);
  781. }
  782.  
  783. if(this.remSponsor)
  784. {
  785. style += ("#center_col, #foot {margin-right: 0 !important;} #rhs, #tads, #topstuff table.ts, #bottomads{display:none;}");
  786. }
  787.  
  788. if(this.searchesRelatedTo)
  789. {
  790. style += ("#botstuff #brs{display:none;} #topstuff .tqref{display:none;}");
  791. }
  792.  
  793. this.addStyle("@namespace url(http://www.w3.org/1999/xhtml); "+style);
  794. },
  795.  
  796. whackTest : function(from, e)
  797. {
  798. // if(from=='subtree' && e.target.id=='nyc' && e.target.className=='rhstc5'){
  799. // monkeyr.logA('whackTest TRIGGER')
  800. // return true;
  801. // }
  802. if(from=='inserted' && e.target.id=='navcnt'){
  803. monkeyr.logA('whackTest DOM TRIGGER');
  804. return 'dom';
  805. }
  806. // else if(from=='mutation' && e.target.id=='xfoot' && e.attributeName=='style' && e.target.style.visibility==''){
  807. // monkeyr.logA('whackTest img TRIGGER');
  808. // // return 'img';
  809. // }
  810. // else if(from=='attribute' && e.target.id=='pnnext' && e.attrName=='href'){
  811. // monkeyr.logA('whackTest lnk TRIGGER', this);
  812. // this.getAutoLoadParams();
  813. // }
  814. return false;
  815. },
  816.  
  817. DOMNodeInsertedWatcher : function(e)
  818. {
  819. monkeyr.logE('inserted', e.target)
  820. if(e.target.id == 'ab_ctls' || e.target.id == 'hdtb')
  821. {
  822. this.registerControls();
  823. }
  824. else if(e.target.id == 'rhs'){
  825. this.rightPanelAdjuster(e.target);
  826. }
  827. if(this.whackTest('inserted', e)=='dom') this.whackDom();
  828. // if(this.whackTest('inserted', e)=='img') this.whackImages(document);
  829. },
  830.  
  831. MutationObserver : function(e)
  832. {
  833. if(e.type!='childList'){
  834. if(e.target.getAttribute(e.attributeName) != e.oldValue){
  835. monkeyr.logE('mutation', e.type, e.target, e.attributeName, e.target.getAttribute(e.attributeName), e.oldValue);
  836. }
  837. }
  838. else{
  839. monkeyr.logE('mutation', e.type, e.target, e.addedNodes, e.removedNodes);
  840. }
  841. if(this.whackTest('mutation', e)=='dom') this.whackDom();
  842. // if(this.whackTest('mutation', e)=='img') this.whackImages(document);
  843. },
  844.  
  845. DOMSubtreeModifiedWatcher : function(e)
  846. {
  847. monkeyr.logE('subtree', e.target, e.attrName, e.newValue, e.prevValue, e)
  848. // monkeyr.logE('subtree', e.target, e.attributeName, e.target.getAttribute(e.attributeName), e.oldValue)
  849. // if(this.whackTest('subtree', e)) this.whackDom();
  850. if(this.whackTest('subtree', e)=='dom') this.whackDom();
  851. // if(this.whackTest('subtree', e)=='img') this.whackImages(document);
  852. },
  853.  
  854. DOMAttrModifiedWatcher : function(e)
  855. {
  856. monkeyr.logE('attribute', e.target, e.attrName, e.newValue, e.prevValue, e)
  857. // monkeyr.logE('subtree', e.target, e.attributeName, e.target.getAttribute(e.attributeName), e.oldValue)
  858. // if(this.whackTest('subtree', e)) this.whackDom();
  859. if(this.whackTest('attribute', e)=='dom') this.whackDom();
  860. // if(this.whackTest('attribute', e)=='img') this.whackImages(document);
  861. },
  862.  
  863. DOMNodeRemovedWatcher : function(e)
  864. {
  865. monkeyr.logE('removed', e.target)
  866. if(e.target.id == 'GTR')
  867. {
  868. monkeyr.log('GTR REMOVED')
  869. this.initialise = true;
  870. clearTimeout(this.watchForScrollTimer);
  871. }
  872. },
  873.  
  874.  
  875. whackDom : function()
  876. {
  877. if(!document.getElementById('GTR')){
  878. clearTimeout(this.whackDomTimeOut);
  879. this.whackDomTimeOut = setTimeout(function()
  880. {
  881. var ires = document.getElementById('ires');
  882. if(ires){
  883. monkeyr.log('!!!!! Whacking DOM !!!!!')
  884. var extrares = document.getElementById('extrares');
  885. var res = document.getElementById('res');
  886. monkeyr.log(extrares, res , this.autoLoad)
  887. if(extrares && res && this.autoLoad){
  888. res.parentNode.insertBefore(extrares, res);
  889. }
  890. if(this.hideSearch)
  891. {
  892. // this.resizeWatcher(true);
  893. }
  894. if(!this.buildResultTable()){
  895. return;
  896. }
  897. if(this.autoLoad)
  898. {
  899. if(this.getAutoLoadParams() && this.insertLoadingImage())
  900. {
  901. //monkeyr.log('watchForScroll');
  902. this.watchForScroll.bind(this)();
  903. }
  904. }
  905.  
  906. this.processResults(document.getElementById('center_col'))
  907. ires.parentNode.removeChild(ires);
  908. this.initialise = false;
  909. }
  910. }.bind(this),0);
  911. }
  912. },
  913.  
  914. resizeWatcher : function(e)
  915. {
  916. //monkeyr.log(e.target.id)
  917. if(e===true || (e.target && e.target.id == 'gbq'))
  918. {
  919. setTimeout(function(){
  920. //monkeyr.log('here')
  921. //left side
  922. var glogo = document.getElementById('gbq1');
  923. var ab_name = document.getElementById('ab_name');
  924. var ab_ctls = document.getElementById('ab_ctls');
  925. var resultStats = document.getElementById('resultStats');
  926. var gbu = document.getElementById('gbu');
  927. var appbar = document.getElementById('appbar');
  928.  
  929. var glogoPos = findPos(glogo);
  930. //monkeyr.log(glogoPos)
  931. lft = glogoPos[0] + glogo.offsetWidth + 20;
  932. ab_name.style.marginLeft = lft+'px'
  933. resultStats.style.marginLeft = (lft+ab_name.offsetWidth+50)+'px'
  934.  
  935. //right side
  936. //monkeyr.log(getStyle(gbu, 'margin-right'))
  937. ab_ctls.style.right = (gbu.offsetWidth + getStyle(gbu, 'margin-right') + 10 )+'px';
  938.  
  939. //heights
  940. //monkeyr.log(gbu.offsetHeight)
  941. ab_ctls.style.marginTop = getStyle(gbu, 'padding-top')+'px'
  942. ab_name.style.marginTop = (getStyle(gbu, 'padding-top')+3)+'px'
  943. resultStats.style.marginTop = (getStyle(gbu, 'padding-top')+10)+'px'
  944. appbar.style.height = (gbu.offsetHeight)+'px'
  945.  
  946. }, 0);
  947.  
  948. }
  949. },
  950.  
  951. rightPanelAdjuster : function(el)
  952. {
  953. if(el && (center_col = document.getElementById('center_col')) && (foot = document.getElementById('foot'))){
  954. monkeyr.log('----rhs stuff----', el, this.remSponsor, this.remRightPanel);
  955. if(this.remSponsor && (mbEnd = document.getElementById('mbEnd'))){
  956. monkeyr.log('rem mbEnd', mbEnd);
  957. mbEnd.parentNode.removeChild(mbEnd);
  958. }
  959. if(this.remSponsor && (rhsvw = el.querySelector('div#rhs_block > div.rhsvw'))){
  960. monkeyr.log('rem .rhsvw');
  961. rhsvw.parentNode.removeChild(rhsvw);
  962. }
  963. if(el.offsetHeight > 50){
  964.  
  965. monkeyr.log('el.offsetWidth:',el.offsetWidth,'el.offsetHeight',el.offsetHeight)
  966. var div = document.buildElement('div', {id:'slideout_tab'}, 'more info'),
  967. width = el.offsetWidth,
  968. height = el.offsetHeight,
  969. css = "#slideout_tab{color:#444;border:meduim none;background-color: #fff;box-shadow:0 -1px 3px rgba(0,0,0,0.2);font-weight:bold;padding:3px 14px;margin:50px 0 0 -22px;text-decoration:none;width:65px;border-radius:6px 6px 0 0;transform:rotate(-90deg);-webkit-transform:rotate(-90deg);}.slideout{border-radius:5px 0 0 5px;right:0;padding:12px 0;position:absolute;text-align:center;top:140px;transition:all .5s ease-in-out;-webkit-transition:all .5s ease-in-out;width:35px;overflow:hidden;min-width:0!important;height:105px;}.slideout_inner{background-color:#fff;padding:0;position:absolute;text-align:left;top:0;width:0;margin-left:35px;width:"+width+"px!important;}.slideout:hover,.start_out{width:"+(width+35)+"px!important;height:"+height+"px!important;}.start_in{transition:all 0s ease;-webkit-transition:all 0s ease;}";
  970.  
  971. var style = document.getElementById('side_tab_style');
  972. if(!style){
  973. style = document.buildElement('style', {type:'text/css', id:'side_tab_style'});
  974. if (style.styleSheet){
  975. style.styleSheet.cssText = css;
  976. } else {
  977. style.appendChild(document.createTextNode(css));
  978. }
  979. el.appendChild(style);
  980. }
  981. if(this.remRightPanel){
  982. setTimeout(function(){el.className = el.className.replace(' start_in','');},500)
  983. el.className = el.className + ' start_in';
  984. }
  985. else{
  986. setTimeout(function(){el.className = el.className.replace(' start_out','');},2000)
  987. el.className = el.className + ' start_out';
  988. }
  989. el.className = el.className + ' slideout';
  990. var t = el.firstChild;
  991. el.insertBefore(div, el.firstChild);
  992. t.className = t.className + " slideout_inner";
  993.  
  994. center_col.style.marginRight = '0px';
  995. foot.style.marginRight = '0px';
  996.  
  997. // center_col.style.marginRight = el.offsetWidth + 'px';
  998. // foot.style.marginRight = el.offsetWidth + 'px';
  999. }
  1000. else{
  1001. center_col.style.marginRight = '0px';
  1002. foot.style.marginRight = '0px';
  1003. }
  1004. }
  1005. },
  1006.  
  1007. insertEndText : function()
  1008. {
  1009. //monkeyr.log('insertEndText');
  1010. var elem = document.buildElement('table',{id:"endtext" ,width: "100%", cellspacing: "2", cellpadding: "0", border: "0", "class": "t bt",
  1011. style:"font-weight:bold;text-decoration:blink"}, " End of the search results");
  1012. var res = document.getElementById("res");
  1013. res.parentNode.insertBefore(elem, res.nextSibling);
  1014. return elem;
  1015. },
  1016.  
  1017. reqMoreRes : function()
  1018. {
  1019. if (this.requested == this.startNumber)
  1020. {
  1021. return;
  1022. }
  1023. else
  1024. {
  1025. this.requested = this.startNumber;
  1026. this.loadingImage.style.display = "block";
  1027. var query = this.query.replace(/start=\d*/,"start=" + this.startNumber);
  1028. this.nextLink.href = query;
  1029. monkeyr.log('reqMoreRes '+ query);
  1030. // monkeyr.log('reqMoreRes', this.startNumber, query);
  1031. this.UI.getURL(query, this.processResults.bind(this));
  1032. }
  1033. },
  1034.  
  1035. remainingScroll : function()
  1036. {
  1037. var ret = (document.body.scrollHeight - window.pageYOffset - window.innerHeight);
  1038. return ret;
  1039. },
  1040.  
  1041. watchForScroll : function()
  1042. {
  1043. var self = arguments.callee;
  1044. // if (this.remainingScroll() < 300 && !this.requestingMoreResults && Math.abs(this.scrollHeight - document.body.scrollHeight)>5 && !this.initialise && document.getElementById('GTR')) {
  1045. if (this.remainingScroll() < 300 && !this.requestingMoreResults && !this.initialise && document.getElementById('GTR')) {
  1046. //monkeyr.log('watchForScroll', this.scrollHeight, document.body.scrollHeight, this.winInnerHeight, window.innerHeight, window.pageYOffset)
  1047. // monkeyr.log('watchForScroll '+this.remainingScroll());
  1048. this.requestingMoreResults=true;
  1049. this.reqMoreRes();
  1050. this.scrollHeight = document.body.scrollHeight;
  1051. this.winInnerHeight = window.innerHeight;
  1052. }
  1053. else if(this.backToTopLinkInsert == window.pageYOffset > window.innerHeight*.5){
  1054. this.insertBackToTopLink(this.backToTopLinkInsert);
  1055. }
  1056. else if(this.backToTopLinkShow == window.pageYOffset > window.innerHeight*.75){
  1057. this.showBackToTopLink(this.backToTopLinkShow);
  1058. }
  1059. this.watchForScrollTimer = setTimeout(self.bind(this),100);
  1060. },
  1061.  
  1062. insertLoadingImage : function()
  1063. {
  1064. monkeyr.log('insertLoadingImage');
  1065. var nextLink = document.getElementByXPath("//table[@id='nav']//td[last()]/a");
  1066. var navbar = document.getElementByXPath("//table[@id='nav']//td/ancestor::table");
  1067. var loadingimg = document.getElementById('loadingimg');
  1068. if(navbar)
  1069. {
  1070. navbar.style.display = "none";
  1071. if(!loadingimg)
  1072. {
  1073. var div = document.buildElement('div', {id:''});
  1074. var p = document.buildElement('p', {}, "");
  1075. var a = document.buildElement('a',{href:nextLink.href}, '');
  1076. div.appendChild(p);
  1077. div.appendChild(a);
  1078. this.nextLink = a;
  1079. navbar.parentNode.insertBefore(div, navbar)
  1080. this.loadingImage = div;
  1081. }
  1082. }
  1083. if(!this.endText)
  1084. {
  1085. this.endText = this.insertEndText();
  1086. }
  1087. this.endText.style.display = nextLink && (nextLink.href.indexOf('start=')!=-1) ? 'none' : 'block';
  1088. //monkeyr.log('insertLoadingImage '+nextLink);
  1089. //this.loadingImage.style.display = 'block'
  1090. return nextLink
  1091. },
  1092.  
  1093. insertBackToTopLink : function(insert)
  1094. {
  1095. var a = document.querySelector('#scrollTop a');
  1096. if(insert && !a){
  1097. var div = document.buildElement('div', {id:'scrollTop'});
  1098. a = document.buildElement('a', {href:'#top', 'class':'mh_hide'},'', 'click', function(e){
  1099. e.preventDefault();
  1100. e.stopPropagation();
  1101. document.querySelector("body").scrollIntoView();
  1102. });
  1103. div.appendChild(a);
  1104. document.body.appendChild(div);
  1105. }
  1106. a.style.display = ((insert) ? "inline" : "none");
  1107. this.backToTopLinkInsert = !insert;
  1108. return a;
  1109. },
  1110.  
  1111. showBackToTopLink : function(show)
  1112. {
  1113. var a = document.querySelector('#scrollTop a');
  1114. if(!a){
  1115. a = this.insertBackToTopLink(true);
  1116. }
  1117. this.backToTopLinkShow = !show
  1118. a.className = ((show) ? "mh_show" : "mh_hide");
  1119. },
  1120.  
  1121. getAutoLoadParams : function()
  1122. {
  1123. // monkeyr.log('getAutoLoadParams');
  1124. var nextLink = document.getElementByXPath("//table[@id='nav']//td[last()]/a[contains(@href,'start')]");
  1125. if(nextLink)
  1126. {
  1127. var href = nextLink.href;
  1128. this.startNumber = this._matchNum(href, /start=(\d+)/, 10);
  1129. this.itemsQuantity = this._matchNum(href, /num=(\d+)/, 10);
  1130. monkeyr.log('getAutoLoadParams', this.startNumber, this.itemsQuantity);
  1131. this.query = href;
  1132. this.resultStats = document.getElementById('resultStats');
  1133. return true;
  1134. }
  1135. else
  1136. {
  1137. monkeyr.log('no more results');
  1138. return false;
  1139. }
  1140. },
  1141.  
  1142. buildResultTable : function()
  1143. {
  1144. monkeyr.log('buildResultTable')
  1145. var tab = document.getElementById('GTR');
  1146. if(tab)
  1147. {
  1148. //monkeyr.log('del tab')
  1149. tab.parentNode.removeChild(tab);
  1150. }
  1151.  
  1152. var table = document.buildElement('table', {id:'GTR'});
  1153. // var table = document.buildElement('table', {id:'GTR',cellspacing:'5%',cellpadding:'0'});
  1154. this.resultsTable = table;
  1155. var div = document.getElementByXPath("//div/div[@class='g']/parent::div | //div[@id='res']/div | //div[@id='res']/span[@id='search']");
  1156. if(div)
  1157. {
  1158. // monkeyr.log('init this')
  1159. var start = window.location.search.match(/start=(\d+)/);
  1160. this.startBase = (start && start[1].retNum()) || 0;
  1161. this.lastI = 0;
  1162. this.startNumber = 0;
  1163. this.curRow = 0;
  1164. this.nextRow = 0;
  1165. this.requested = 0;
  1166. this.requestingMoreResults=false;
  1167. this.scrollHeight = 0;
  1168. // this.winInnerHeight = 0;
  1169.  
  1170. document.getElementById('ires').parentNode.appendChild(table);
  1171. var list = document.getElementsByXPath("//div[@id='ires']//li[contains(@class,'g')] | //div[@id='ires']//li/div[@class='g'] | //div[@id='ires']//div[@class='g']");
  1172. //var list = document.getElementsByXPath("//div[@id='ires']//li[contains(@class,'g')] | //div[@id='ires']//li/div[@class='g']");
  1173. var length = list.length;
  1174. if((ires = document.getElementById('ires')) && (cnt = document.getElementById('cnt'))){
  1175. ires.style.display = ((length==1) ? 'block' : 'none');
  1176. cnt.className = ((length==1) ? cnt.className.replace(' singleton','') : cnt.className + ' singleton');
  1177. if(length==1) return false;
  1178. }
  1179. for (var i = 0; i < list.length; i++)
  1180. {
  1181. this.resultsToTable(list, i, length, true);
  1182. }
  1183. this.nextRow = this.curRow;
  1184. this.paginationBoundry();
  1185. this.lastI = i;
  1186. return true;
  1187. }
  1188. },
  1189.  
  1190. paginationBoundry : function()
  1191. {
  1192. if(this.newspaper && this.autoLoad)
  1193. {
  1194. var row = this.nextRow++;
  1195. this.resultsTable.insertRow(row);
  1196. var cell = this.resultsTable.rows[row].insertCell(0);
  1197. cell.setAttribute("valign", "top");
  1198. cell.setAttribute("width", "100%");
  1199. cell.setAttribute("colspan", this.numColumns);
  1200. var hr = document.createElement('hr');
  1201. cell.appendChild(hr);
  1202. }
  1203. },
  1204.  
  1205. resultsToTable : function(list, i, resLength, initial)
  1206. {
  1207. var link = list[i], div;
  1208. // monkeyr.log(link)
  1209. if(this.numResults && (div = document.getElementByXPath("./h3[1] | ./div[1]/h3[1] | .//td[@class='tsw']/h3[1]", link)))
  1210. {
  1211. var str = document.buildElement('strong', null, (i + this.lastI + this.startBase + 1)+' ' );
  1212. div.parentNode.insertBefore(str, div);
  1213. }
  1214. // if(this.noSitePreview){
  1215. // var divs = document.getElementsByXPath(".//div[contains(@class,'vsc')]", link)
  1216. // for (var j = 0; j < divs.length; j++)
  1217. // {
  1218. // divs[j].setAttribute('class', divs[j].getAttribute('class').replace('vsc',''));
  1219. // }
  1220. // }
  1221. var col=0, row=0;
  1222. if(this.newspaper)
  1223. {
  1224. var rowsPfetch = Math.ceil(resLength / this.numColumns);
  1225. col = Math.floor(i / rowsPfetch);
  1226. row = Math.floor(i - (col * rowsPfetch) + this.nextRow );
  1227. this.curRow = ((this.curRow <= row) && (row+1)) || this.curRow;
  1228. }
  1229. else
  1230. {
  1231. col = (i + this.lastI) % this.numColumns;
  1232. row = Math.floor((i + this.lastI) / this.numColumns);
  1233. }
  1234. if(col==0)
  1235. {
  1236. this.resultsTable.insertRow(row);
  1237. }
  1238. // var a = document.getElementByXPath(".//h3[contains(@class,'r')]/a[contains(@class, 'l')]", link);
  1239. var a = document.getElementByXPath(".//h3[contains(@class,'r')]/a", link);
  1240. if(a)
  1241. {
  1242. // monkeyr.log(a.href)
  1243. if(this.externalLinksResults)
  1244. {
  1245. a.target = "_blank";
  1246. }
  1247. else
  1248. {
  1249. a.target = "_self";
  1250. }
  1251.  
  1252. if(this.searchLinkTracking)
  1253. {
  1254. a.removeAttribute("onmousedown");
  1255. }
  1256.  
  1257. if(this.favIcon)
  1258. {
  1259. var base = a.href.match(/http[s]?:\/\/([\w\.\-]+)[:\/]/);
  1260. if(base){
  1261. var fav = document.buildElement('img', {width:'16',height:'16',style:'margin-bottom:-3px;', src:window.location.protocol+'//www.google.com/s2/favicons?domain=' + encodeURIComponent(base[1])});
  1262. a.parentNode.insertBefore(fav, a);
  1263. a.parentNode.insertBefore(document.createTextNode(' '), a);
  1264. }
  1265. }
  1266.  
  1267. if(this.imagePreview)
  1268. {
  1269. // monkeyr.log(this.imagePreview)
  1270. var a2 = a.cloneNode(false);
  1271. a2.removeAttribute('class');
  1272. var sl = a.href.match(/:\/\/www.(\w)|:\/\/(\w)/);
  1273. var bs = a.href.match(/(http:\/\/[\w\.\-:]+)\/|(ftp:\/\/[\w\.\-:]+)\/|(https:\/\/[\w\.\-:]+)\//);
  1274. sl = sl[1] || sl[2];
  1275. bs = bs[1] || bs[2] || bs[3];
  1276. var img = document.buildElement('img', {align:'left',src:window.location.protocol+"//"+ sl +".searchpreview.de/preview?s="+ bs +"&ra=1",
  1277. style:'border:1px solid #BBB;margin:2px 4px 5px 0px;width:111px;height:82px;'});
  1278. a2.appendChild(img);
  1279. a.parentNode.parentNode.insertBefore(a2, a.parentNode);
  1280. }
  1281. // var ele = document.getElementByXPath(".//div[@class='s']//span[@class='vshid']", link);
  1282. // var ele = document.getElementByXPath(".//div[@class='s']//div[@class='action-menu ab_ctl']", link);
  1283. var ele = document.getElementByXPath(".//div[@class='f kv']/cite/parent::div", link);
  1284.  
  1285. if(!this.searchLinkTracking && ele)
  1286. {
  1287. var notrack = document.buildElement('a',
  1288. {href:a.href,'class':'fl',title:'Visit the link without Google tracking you'},'Trackless');
  1289. if(this.externalLinksResults)
  1290. {
  1291. notrack.target = "_blank";
  1292. }
  1293. else
  1294. {
  1295. notrack.target = "_self";
  1296. }
  1297. // ele.appendChild(document.createTextNode(" "), ele.nextSibling);
  1298. ele.appendChild(notrack, ele.nextSibling);
  1299. }
  1300. }
  1301. var sublinks = link.querySelectorAll('tr.mslg > a, span a.l');
  1302. for(var m=0;m<sublinks.length;m++){
  1303. var sublink=sublinks[m];
  1304. if(this.searchLinkTracking)
  1305. {
  1306. sublink.removeAttribute("onmousedown");
  1307. if(this.externalLinksResults)
  1308. {
  1309. sublink.target = "_blank";
  1310. }
  1311. else
  1312. {
  1313. sublink.target = "_self";
  1314. }
  1315. }
  1316. else
  1317. {
  1318. var notrack = document.buildElement('a',
  1319. {href:sublink.href,'style':'font-size:x-small',title:'Visit the link without Google tracking you'},'Trackless');
  1320. if(this.externalLinksResults)
  1321. {
  1322. notrack.target = "_blank";
  1323. }
  1324. else
  1325. {
  1326. notrack.target = "_self";
  1327. }
  1328. sublink.parentNode.appendChild(document.createTextNode(" - "), sublink.parentNode.nextSibling);
  1329. sublink.parentNode.appendChild(notrack, sublink.parentNode.nextSibling);
  1330. }
  1331.  
  1332. }
  1333. var cell = this.resultsTable.rows[row].insertCell(col);
  1334. cell.setAttribute("valign", "top");
  1335. if(!initial)cell.setAttribute("class", "dyna");
  1336. var cellWidth = Math.floor(100 / this.numColumns) + "%";
  1337. cell.setAttribute("width", cellWidth);
  1338. //cell.setAttribute("id", i);
  1339. cell.appendChild(link);
  1340. },
  1341.  
  1342. processResults : function(responseText)
  1343. {
  1344. // monkeyr.log('processResults')
  1345. var i, img;
  1346. //this.loadingImage.style.display = "none";
  1347. var nextResult = document.buildElement('div', null, responseText);
  1348.  
  1349. // var imgs = document.getElementsByXPath(".//img[contains(@class,@id)]");
  1350. // for (i = 0; (img = imgs[i++]);)
  1351. // {
  1352. // img.removeAttribute('id')
  1353. // }
  1354.  
  1355. var stats = document.getElementByXPath(".//div[@id='resultStats']", nextResult);
  1356. if(this.resultStats && stats)
  1357. {
  1358. this.resultStats.innerHTML = stats.innerHTML;
  1359. }
  1360.  
  1361. //var list = document.getElementsByXPath(".//div[@id='res']/div//li[starts-with(@class,'g')]/ | .//div[@id='res']/div//li/div[@class='g']", nextResult);
  1362. var list = document.getElementsByXPath(".//div[@id='ires']/ol/div[starts-with(@class,'srg')]/li | //div[@id='ires']//div[@class='g'] | //div[@id='ires']//li[contains(@class,'g')]", nextResult);
  1363. var length = list.length;
  1364. if((ires = document.getElementById('ires')) && (cnt = document.getElementById('cnt'))){
  1365. ires.style.display = ((length==1) ? 'block' : 'none');
  1366. cnt.className = ((length==1) ? cnt.className.replace(' g','') : cnt.className + ' g');
  1367. if(length==1) return false;
  1368. }
  1369.  
  1370. for (i = 0; i < list.length; i++)
  1371. {
  1372. this.resultsToTable(list, i, length, false);
  1373. }
  1374. this.nextRow = this.curRow;
  1375. this.paginationBoundry();
  1376. this.lastI += i;
  1377. var isNextExist = document.getElementByXPath(".//table[@id='nav']//td[last()]/a[@href]", nextResult);
  1378. if (isNextExist)
  1379. {
  1380. this.startNumber += this.itemsQuantity;
  1381. }
  1382. else
  1383. {
  1384. // this.endText.style.display = 'block';
  1385. }
  1386. this.requestingMoreResults=false;
  1387. // monkeyr.log('process results whackImages')
  1388. this.whackImages(nextResult);
  1389. },
  1390.  
  1391. whackImages : function(whackie){
  1392. clearTimeout(this.whackImagesTimeOut);
  1393. this.whackImagesTimeOut = setTimeout(function()
  1394. {
  1395. if(this.requestingMoreResults) return;
  1396. monkeyr.log('!!!!! Whacking Img !!!!!')
  1397. // fix for thumnail display from google image search on 2nd or greater autoloaded pages
  1398. var xfoot = document.getElementByXPath(".//div[@id='xfoot']", whackie);
  1399. var scrxpath = (xfoot) ? ".//div[@id='xfoot']/script" : "./script"; //results returned in Opera have no xfoot div. Weird!)
  1400. var imgscrs = document.getElementsByXPath(scrxpath, whackie);
  1401. // monkeyr.log(scrxpath +', '+imgscrs.length)
  1402. if (imgscrs && imgscrs.length>1)
  1403. {
  1404. for (i = 0; i<(imgscrs.length-1); i++)
  1405. {
  1406. var scr = imgscrs[i] && imgscrs[i].innerHTML;
  1407. if(scr.indexOf('data:image/')!=-1)
  1408. {
  1409. // monkeyr.log(scr);
  1410. eval(scr);
  1411. }
  1412. }
  1413. }
  1414. // monkeyr.log(whackie.nodeName)
  1415. // fix for thumnail zoom from google image search on 2nd or greater autoloaded pages
  1416. var xjsi = whackie.querySelector('#xjsi script');
  1417. if(xjsi){
  1418. // monkeyr.log(xjsi.innerHTML);
  1419. // commented out as it seems to fix the zoom on autoloaded results but breaks the "more" link
  1420. // this.exec(xjsi.innerHTML);
  1421. }
  1422. // fix for auto load thumnails being overwritten
  1423. var imgs = document.querySelectorAll('td.dyna div.th img[id]');
  1424. for(var m=0;m<imgs.length;m++){
  1425. // monkeyr.log('removeid', imgs[m].id);
  1426. imgs[m].removeAttribute('id');
  1427. }
  1428. // Fix for image mouseover error
  1429. var imgs = document.querySelectorAll('img.rg_hi:not([id])');
  1430. for(var m=0;m<imgs.length;m++){
  1431. // monkeyr.log('mouseover',imgs[m]);
  1432. imgs[m].id='rg_hi';
  1433. }
  1434. }.bind(this),0);
  1435. },
  1436.  
  1437. exec : function(fn) {
  1438. var script = document.buildElement('script', {'type':'application/javascript'});
  1439. script.textContent = '(function(){' + fn + '})();';
  1440. document.body.appendChild(script); // run the script
  1441. document.body.removeChild(script); // clean up
  1442. },
  1443.  
  1444. externalLinks : function(scope, blank)
  1445. {
  1446. var thisdomain = window.location.host;
  1447. var links = scope.getElementsByTagName('a');
  1448. for (var i = 0; i < links.length; i++) {
  1449. var a = links[i];
  1450. if (a.href && a.host && a.host != thisdomain) {
  1451. a.target = (blank ? "_blank" : "_self");
  1452. }
  1453. }
  1454. },
  1455.  
  1456. registerControls : function()
  1457. {
  1458. monkeyr.log('registerControls');
  1459. var controls = document.getElementByXPath("//div[@id='ab_options']/ul/li[3]");
  1460. var webhpcontrols = document.getElementByXPath("//div[@class='gbmc']/ol/li[3]");
  1461. var liclass = (controls) ? 'ab_dropdownitem' : 'gbe gbmtc';
  1462. var linkclass = (controls) ? 'ab_dropdownlnk' : 'gbmt';
  1463. controls = controls || webhpcontrols;
  1464. var link = document.getElementById('GoogleMonkeyRLink');
  1465. if (controls && !link)
  1466. {
  1467. monkeyr.log('registerControls Registered');
  1468. var parent = controls.parentNode;
  1469. var li = document.buildElement('li',{'class':liclass});
  1470. link = document.buildElement('a',{href:'#',id:'GoogleMonkeyRLink','class':linkclass},'GoogleMonkeyR settings','click',UIL.UI.preferencesShow.bind(UIL.UI));
  1471. li.appendChild(link);
  1472. parent.insertBefore(li, controls);
  1473. }
  1474. if(typeof GM_registerMenuCommand !== "undefined"){
  1475. GM_registerMenuCommand("GoogleMonkeyR Preferences", UIL.UI.preferencesShow.bind(UIL.UI));
  1476. }
  1477. },
  1478.  
  1479. addStyle : function(css)
  1480. {
  1481. if (typeof GM_addStyle != "undefined") {
  1482. GM_addStyle(css);
  1483. } else {
  1484. var heads = document.getElementsByTagName("head");
  1485. if (heads.length > 0) {
  1486. var node = document.createElement("style");
  1487. node.type = "text/css";
  1488. node.innerHTML = css;
  1489. heads[0].appendChild(node);
  1490. }
  1491. }
  1492. },
  1493.  
  1494. _matchNum : function (subject, test, def)
  1495. {
  1496. var out = subject.match(test);
  1497. return (out ? +(out[1]) : (def || 0));
  1498. }
  1499.  
  1500. };
  1501.  
  1502. /**
  1503. * Configuration.
  1504. **/
  1505. UIL.Config =
  1506. {
  1507. getBGBorder : function()
  1508. {
  1509. return this._getBooleanConfig("BGBorder", "background");
  1510. },
  1511.  
  1512. setBGBorder : function(BGBorder)
  1513. {
  1514. GM_setValue("BGBorder", BGBorder);
  1515. },
  1516.  
  1517. getResHue : function()
  1518. {
  1519. return this._getBooleanConfig("resHue", "#FAFAE6");
  1520. },
  1521.  
  1522. setResHue : function(resHue)
  1523. {
  1524. resHue = resHue.toUpperCase();
  1525. if(!resHue.match(/^#[0-9A-F]{6}$/))
  1526. {
  1527. resHue = "";
  1528. }
  1529. GM_setValue("resHue", resHue);
  1530. },
  1531.  
  1532. getNumCol : function()
  1533. {
  1534. return this._getBooleanConfig("numCol", 1);
  1535. },
  1536.  
  1537. setNumCol : function(numCol)
  1538. {
  1539. GM_setValue("numCol", numCol);
  1540. },
  1541.  
  1542. getRemSponsor : function()
  1543. {
  1544. return this._getBooleanConfig("remSponsor", false);
  1545. },
  1546.  
  1547. setRemSponsor : function(remSponsor)
  1548. {
  1549. GM_setValue("remSponsor", remSponsor);
  1550. },
  1551.  
  1552. getRemRightPanel : function()
  1553. {
  1554. return this._getBooleanConfig("remRightPanel", false);
  1555. },
  1556.  
  1557. setRemRightPanel : function(remRightPanel)
  1558. {
  1559. GM_setValue("remRightPanel", remRightPanel);
  1560. },
  1561.  
  1562. getNumResults : function()
  1563. {
  1564. return this._getBooleanConfig("numResults", false);
  1565. },
  1566.  
  1567. setNumResults : function(numResults)
  1568. {
  1569. GM_setValue("numResults", numResults);
  1570. },
  1571.  
  1572. getAutoLoad : function()
  1573. {
  1574. return this._getBooleanConfig("autoLoad", false);
  1575. },
  1576.  
  1577. setAutoLoad : function(autoLoad)
  1578. {
  1579. GM_setValue("autoLoad", autoLoad);
  1580. },
  1581.  
  1582.  
  1583. getHideSearch : function()
  1584. {
  1585. return this._getBooleanConfig("hideSearch", false);
  1586. },
  1587.  
  1588. setHideSearch : function(hideSearch)
  1589. {
  1590. GM_setValue("hideSearch", hideSearch);
  1591. },
  1592.  
  1593. getExtLinkSearch : function()
  1594. {
  1595. return this._getBooleanConfig("extLinkSearch", false);
  1596. },
  1597.  
  1598. setExtLinkSearch : function(extLinkSearch)
  1599. {
  1600. GM_setValue("extLinkSearch", extLinkSearch);
  1601. },
  1602.  
  1603. getExtLinkiGoogle : function()
  1604. {
  1605. return this._getBooleanConfig("extLinkiGoogle", false);
  1606. },
  1607.  
  1608. setExtLinkiGoogle : function(extLinkiGoogle)
  1609. {
  1610. GM_setValue("extLinkiGoogle", extLinkiGoogle);
  1611. },
  1612.  
  1613. getSearchLinkTracking : function()
  1614. {
  1615. return this._getBooleanConfig("searchLinkTracking", false);
  1616. },
  1617.  
  1618. setSearchLinkTracking : function(searchLinkTracking)
  1619. {
  1620. GM_setValue("searchLinkTracking", searchLinkTracking);
  1621. },
  1622.  
  1623. getImagePreview : function()
  1624. {
  1625. return this._getBooleanConfig("imagePreview", false);
  1626. },
  1627.  
  1628. setImagePreview : function(imagePreview)
  1629. {
  1630. GM_setValue("imagePreview", imagePreview);
  1631. },
  1632.  
  1633. getFavIcon : function()
  1634. {
  1635. return this._getBooleanConfig("favIcon", false);
  1636. },
  1637.  
  1638. setFavIcon : function(favIcon)
  1639. {
  1640. GM_setValue("favIcon", favIcon);
  1641. },
  1642.  
  1643. getSearchesRelatedTo : function()
  1644. {
  1645. return this._getBooleanConfig("hideSearchesRelatedTo", false);
  1646. },
  1647.  
  1648. setSearchesRelatedTo : function(hideSearchesRelatedTo)
  1649. {
  1650. GM_setValue("hideSearchesRelatedTo", hideSearchesRelatedTo);
  1651. },
  1652.  
  1653. getResultFlow : function()
  1654. {
  1655. return this._getBooleanConfig("resultFlow", "l2r");
  1656. },
  1657.  
  1658. setResultFlow : function(resultFlow)
  1659. {
  1660. GM_setValue("resultFlow", resultFlow);
  1661. },
  1662.  
  1663. getNoSitePreview : function()
  1664. {
  1665. return this._getBooleanConfig("noSitePreview", false);
  1666. },
  1667.  
  1668. setNoSitePreview : function(noSitePreview)
  1669. {
  1670. GM_setValue("noSitePreview", noSitePreview);
  1671. },
  1672.  
  1673. _getBooleanConfig : function(configName, defaultValue)
  1674. {
  1675. var config = GM_getValue(configName);
  1676. if (config === undefined)
  1677. {
  1678. GM_setValue(configName, defaultValue);
  1679. config = defaultValue;
  1680. }
  1681. return config;
  1682. }
  1683. };
  1684.  
  1685. /**
  1686. * Preferences User Interface (UI).
  1687. **/
  1688. UIL.UI =
  1689. {
  1690. preferencesShow : function(e)
  1691. {
  1692. if (e)
  1693. {
  1694. e.preventDefault();
  1695. e.stopPropagation();
  1696. }
  1697.  
  1698. this._loadBlocker();
  1699. var prefs = document.buildElement('div',
  1700. {id:'uil_preferences',name:'uil_preferences',
  1701. style:'position:fixed;top:5%;left:0px;right:0px;border:none;height:100%;width:100%;overflow:hidden;z-index:10001;'}
  1702. ,this.Base64.decode(UIL.RES.PREFS_HTML));
  1703. document.body.appendChild(prefs);
  1704. this.preferencesDocumentLoadHandler();
  1705. this.prefs = prefs;
  1706. },
  1707.  
  1708. _loadBlocker : function()
  1709. {
  1710. if (this.blocker==null)
  1711. {
  1712. var blocker = document.buildElement('div',
  1713. {id:'uil_blocker',
  1714. style:'position:fixed;top:0px;left:0px;right:0px;bottom:0px;background-color:#000;opacity:0.5;z-index:10000;'});
  1715.  
  1716. this.blocker = blocker;
  1717. document.body.appendChild(blocker);
  1718. }
  1719. },
  1720.  
  1721. updateScript : function(e)
  1722. {
  1723. if (e)
  1724. {
  1725. e.preventDefault();
  1726. e.stopPropagation();
  1727. }
  1728.  
  1729. this._loadBlocker();
  1730.  
  1731. try{
  1732. window.location.replace("http://userscripts.org/scripts/source/"+ UIL.scriptId +".user.js");
  1733. }
  1734. catch(e)
  1735. {}
  1736. if(this.prefs)document.body.removeChild(this.prefs);
  1737. if(this.history)document.body.removeChild(this.history);
  1738. GM_setValue('skipVersion', 0);
  1739. setTimeout(this.refreshShow.bind(this),4000);
  1740.  
  1741. },
  1742.  
  1743. refreshShow : function()
  1744. {
  1745. var refresh = document.buildElement('iframe',
  1746. {style:'position:fixed;top:20%;left:0px;right:0px;border:none;height:100%;width:100%;overflow:hidden;z-index:10001;',
  1747. src:UIL.RES.REFRESH_HTML},'','load',this.refreshDocumentLoadHandler.bind(this));
  1748.  
  1749. this.refresh = refresh;
  1750. document.body.appendChild(refresh);
  1751. },
  1752.  
  1753. refreshDocumentLoadHandler : function()
  1754. {
  1755. this.refresh.contentDocument.getElementById("scriptName").innerHTML=UIL.scriptName;
  1756. },
  1757.  
  1758. hide : function()
  1759. {
  1760. if(this.history) document.body.removeChild(this.history);
  1761. if(this.prefs)document.body.removeChild(this.prefs);
  1762. if(this.blocker)document.body.removeChild(this.blocker);
  1763. this.history = null;
  1764. this.prefs = null;
  1765. this.blocker = null;
  1766. },
  1767.  
  1768. preferencesDocumentLoadHandler : function()
  1769. {
  1770. var form = document.getElementById("preferences");
  1771.  
  1772. // Set up form state
  1773. form.elements.namedItem("numcol" + UIL.Config.getNumCol()).checked = true;
  1774. form.elements.namedItem("remsponsor").checked = UIL.Config.getRemSponsor();
  1775. form.elements.namedItem("numresults").checked = UIL.Config.getNumResults();
  1776. form.elements.namedItem("remrightpanel").checked = UIL.Config.getRemRightPanel();
  1777. form.elements.namedItem("autoload").checked = UIL.Config.getAutoLoad();
  1778. form.elements.namedItem("hidesearch").checked = UIL.Config.getHideSearch();
  1779. form.elements.namedItem("noSitePreview").checked = UIL.Config.getNoSitePreview();
  1780. form.elements.namedItem("extlinksearch").checked = UIL.Config.getExtLinkSearch();
  1781. form.elements.namedItem("extlinkigoogle").checked = UIL.Config.getExtLinkiGoogle();
  1782. form.elements.namedItem("searchlinktracking").checked = UIL.Config.getSearchLinkTracking();
  1783. form.elements.namedItem("ResHuefield").value = UIL.Config.getResHue();
  1784. form.elements.namedItem("imagepreview").checked = UIL.Config.getImagePreview();
  1785. form.elements.namedItem("favicon").checked = UIL.Config.getFavIcon();
  1786. form.elements.namedItem("remsearchesrelatedto").checked = UIL.Config.getSearchesRelatedTo();
  1787. //this.prefs.contentDocument.getElementById("ResHue").style.color = UIL.Config.getResHue();
  1788. document.getElementById("ResHue").style.background = UIL.Config.getResHue();
  1789. document.getElementById("BGBorderlink").innerHTML = UIL.Config.getBGBorder();
  1790. document.getElementById("flowimg").className = UIL.Config.getResultFlow();
  1791.  
  1792. // Set up event handlers
  1793. form.elements.namedItem("close_button").addEventListener("click", this.hide.bind(this), false);
  1794. form.elements.namedItem("save_button").addEventListener("click", this.preferencesSaveConfigurationHandler.bind(this), false);
  1795. document.getElementById("ResHue").addEventListener("click", UIL.RES.colorPicker.pickColor.bind(UIL.RES.colorPicker), false);
  1796. document.getElementById("flowimg").addEventListener("click", UIL.RES.flowtog, false);
  1797. document.getElementById("BGBorderlink").addEventListener("click", UIL.RES.bgBordertog, false);
  1798. document.getElementById("ResHuefield").addEventListener("change", UIL.RES.colorPicker.relateColor('ResHue'), false);
  1799.  
  1800. document.getElementById("version").innerHTML=UIL.scriptVersion;
  1801. if(BrowserDetect.csQuery){
  1802. this.getURL("http://userscripts.org/scripts/source/"+UIL.scriptId+".meta.js", this.updateTestOnPreferences.bind(this));
  1803. }
  1804. else{
  1805. this.updateLink(false);
  1806. }
  1807. },
  1808.  
  1809. getURL : function(address, cb)
  1810. {
  1811. GM_xmlhttpRequest({
  1812. method :"GET",
  1813. url :address,//+"?"+Math.random(),
  1814. onload :function(xhr) {cb(xhr.responseText);}
  1815. });
  1816. },
  1817.  
  1818. updateCheckRequest : function()
  1819. {
  1820. if(!BrowserDetect.csQuery) return;
  1821. var lastCheck = GM_getValue('lastCheck', 0);
  1822. if (this._currentTime() > (lastCheck + 86400)) //24 hours after last check
  1823. {
  1824. GM_setValue('delayUpdate', false);
  1825. this.getURL("http://userscripts.org/scripts/source/"+UIL.scriptId+".meta.js", this.updateTestOnPage.bind(this));
  1826. }
  1827. else
  1828. {
  1829. this.onSiteVersion = GM_getValue('onSiteVersion', 0);
  1830. var delayUpdate = GM_getValue('delayUpdate', false);
  1831. var skipVersion = GM_getValue('skipVersion', 0);
  1832. if ( this.versionCompare(UIL.scriptVersion, this.onSiteVersion) )
  1833. {
  1834. if ( this.versionCompare(skipVersion, this.onSiteVersion) && !delayUpdate )
  1835. {
  1836. this.updateMessageShow();
  1837. }
  1838. }
  1839. }
  1840. },
  1841.  
  1842. updateTestOnPage : function(text)
  1843. {
  1844. var skipVersion = GM_getValue('skipVersion', 0);
  1845.  
  1846. var onSiteVersion = text.match(/\/\/\s*@version\s*(\d.*)/);
  1847. this.onSiteVersion = (onSiteVersion===null) ? 0 : onSiteVersion[1];
  1848. GM_setValue('onSiteVersion', this.onSiteVersion);
  1849.  
  1850. var updateHistory = text.substring(text.search(/\/\*.*StartHistory/im));
  1851. updateHistory = updateHistory.substring(0, updateHistory.search(/EndHistory.*\*\//im))
  1852. GM_setValue('onSiteVersionHistory', encodeURI(updateHistory));
  1853.  
  1854. if ( this.versionCompare(UIL.scriptVersion, this.onSiteVersion) )
  1855. {
  1856. if ( this.versionCompare(skipVersion, this.onSiteVersion) )
  1857. {
  1858. this.updateMessageShow();
  1859. }
  1860. }
  1861. GM_setValue('lastCheck', this._currentTime());
  1862. },
  1863.  
  1864. updateLink : function(update){
  1865. var link = document.getElementById("check_update");
  1866. link.setAttribute("target", "_top");
  1867.  
  1868. if ( update )
  1869. {
  1870. link.addEventListener("click", this.historyShow.bind(this), false);
  1871. link.setAttribute("title", " see what's new with GoogleMonkeyR... ");
  1872. link.style.textDecoration = "blink";
  1873. link.innerHTML = "v"+this.onSiteVersion+" available";
  1874. }
  1875. else
  1876. {
  1877. if(BrowserDetect.csQuery)
  1878. {
  1879. link.setAttribute("href", "#");
  1880. link.setAttribute("title", " the history of GoogleMonkeyR ");
  1881. link.innerHTML = "history";
  1882. link.addEventListener("click", this.historyShow.bind(this), false);
  1883. }
  1884. else
  1885. {
  1886. link.setAttribute("href", "http://userscripts.org/scripts/show/"+UIL.scriptId);
  1887. link.setAttribute("title", " check for the latest script version on the homepage ");
  1888. link.innerHTML = "script homepage";
  1889. }
  1890. link.parentNode.appendChild(document.createTextNode(" - "));
  1891.  
  1892. var link2 = document.buildElement('a',{href:"http://"+ location.hostname +"/preferences",
  1893. target:'_parent',title:' your Google preferences '},'prefs');
  1894.  
  1895. link.parentNode.appendChild(link2);
  1896. link.parentNode.appendChild(document.createTextNode(" - "));
  1897.  
  1898. var link3 = document.buildElement('a',{href:"https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mungushume@hotmail.com&item_name=GreaseMonkey%20programming/beer%20fund&no_shipping=0&no_note=1&tax=0&currency_code=GBP&lc=GB&bn=PP-DonationsBF&charset=UTF-8",
  1899. target:'_parent',title:' donate to the GoogleMonkeyR programming/beer fund '},'donate');
  1900.  
  1901. link.parentNode.appendChild(link3);
  1902. }
  1903. },
  1904.  
  1905. updateTestOnPreferences: function(text)
  1906. {
  1907. var onSiteVersion = text.match(/\/\/\s*@version\s*(\d.*)/);
  1908. this.onSiteVersion = (onSiteVersion===null) ? 0 : onSiteVersion[1];
  1909. GM_setValue('onSiteVersion', this.onSiteVersion);
  1910.  
  1911. var updateHistory = text.substring(text.search(/\/\*/));
  1912. updateHistory = updateHistory.substring(0, updateHistory.search(/\*\//))
  1913. GM_setValue('onSiteVersionHistory', encodeURI(updateHistory));
  1914.  
  1915. this.updateLink(this.versionCompare(UIL.scriptVersion, this.onSiteVersion));
  1916.  
  1917. GM_setValue('lastCheck', this._currentTime());
  1918. },
  1919.  
  1920. versionCompare : function(ver1, ver2)
  1921. {
  1922. var maxVersionPartTest = 5;
  1923. var ver1Arr = (ver1+('.0'.repeat(maxVersionPartTest))).split(".",maxVersionPartTest);
  1924. var ver2Arr = (ver2+('.0'.repeat(maxVersionPartTest))).split(".",maxVersionPartTest);
  1925.  
  1926. //alert(ver1Arr.join(',') + ' - ' +ver2Arr.join(','));
  1927.  
  1928. for(var i=0; i<maxVersionPartTest; i++)
  1929. {
  1930. //alert(ver1Arr[i].retNum() +' '+ ver2Arr[i].retNum());
  1931. if( ver1Arr[i].retNum() < ver2Arr[i].retNum() )
  1932. {
  1933. break;
  1934. }
  1935. else if( ver1Arr[i].retNum() > ver2Arr[i].retNum() )
  1936. {
  1937. i = maxVersionPartTest
  1938. break;
  1939. }
  1940. }
  1941. return (i<maxVersionPartTest);
  1942. },
  1943.  
  1944. updateMessageShow : function()
  1945. {
  1946. UIL.addStyle("@namespace url(http://www.w3.org/1999/xhtml); .gbh{display: none !important;} #gm_update_alert {margin: 10px; background-color: #E5ECF9; text-align: center; -moz-border-radius: 5px; position: relative; z-index: 2000; border: 1px solid; } #gm_update_alert a:visited {color: #0000CC !important} #gm_update_alert p {padding: 5px}");
  1947. var div = document.buildElement("div",{id:'gm_update_alert'});
  1948. var p = document.createElement("p");
  1949. var sn = document.buildElement("strong",{},UIL.scriptName+"&nbsp;");
  1950. var sep = document.buildElement("span",{},"&nbsp;&nbsp;-&nbsp;&nbsp;");
  1951. p.appendChild(sn);
  1952. p.appendChild(document.createTextNode(" update available v"+this.onSiteVersion+" (current v"+UIL.scriptVersion+")"));
  1953. p.appendChild(sep.cloneNode(true));
  1954. p.appendChild(document.buildElement('a',{href:'#'},"Ignore for 24 hours",'click',UIL.UI.updateDelay.bind(UIL.UI)));
  1955. p.appendChild(sep.cloneNode(true));
  1956. p.appendChild(document.buildElement('a',{href:'#'},"Wait for next version",'click',UIL.UI.updateSkip.bind(UIL.UI)));
  1957. p.appendChild(sep.cloneNode(true));
  1958. var a = document.buildElement("a", {target:"_blank", href:"http://userscripts.org/scripts/show/"+UIL.scriptId}, "Script homepage");
  1959. p.appendChild(a);
  1960. p.appendChild(sep.cloneNode(true));
  1961. p.appendChild(document.buildElement('a',{href:'#'},"What's new",'click',UIL.UI.historyShow.bind(UIL.UI)));
  1962. p.appendChild(sep.cloneNode(true));
  1963. p.appendChild(document.buildElement('a',{href:'#'},"Update",'click',UIL.UI.updateScript.bind(UIL.UI)));
  1964. div.appendChild(p);
  1965. document.body.insertBefore(div, document.body.firstChild);
  1966. this.updateMessage = div
  1967. },
  1968.  
  1969. updateMessageHide : function()
  1970. {
  1971. if(this.updateMessage)document.body.removeChild(this.updateMessage);
  1972. this.updateMessage = null;
  1973. },
  1974.  
  1975. updateDelay : function(e)
  1976. {
  1977. if (e)
  1978. {
  1979. e.preventDefault();
  1980. e.stopPropagation();
  1981. }
  1982. GM_setValue('delayUpdate', true);
  1983. alert("You will not be reminded about this update again for 24 hours.");
  1984. this.updateMessageHide();
  1985. },
  1986.  
  1987. updateSkip : function(e)
  1988. {
  1989. if (e)
  1990. {
  1991. e.preventDefault();
  1992. e.stopPropagation();
  1993. }
  1994. GM_setValue('skipVersion', this.onSiteVersion);
  1995. alert("You will not be reminded again until the next new version is released.");
  1996. this.updateMessageHide();
  1997. },
  1998.  
  1999. _currentTime : function()
  2000. {
  2001. var d = new Date();
  2002. return Math.round(d.getTime() / 1000); // Unix time in seconds
  2003. },
  2004.  
  2005. historyShow : function(e)
  2006. {
  2007. if (e)
  2008. {
  2009. e.preventDefault();
  2010. e.stopPropagation();
  2011. }
  2012.  
  2013. this._loadBlocker();
  2014. if(this.prefs)document.body.removeChild(this.prefs);
  2015. this.prefs = null;
  2016.  
  2017. var history = document.buildElement("iframe", {src:UIL.RES.HISTORY_HTML,
  2018. style:"position:fixed;top:5%;left:0px;right:0px;border:none;height:100%;width:100%;overflow:hidden;z-index:10001"},
  2019. null, "load", this.historyDocumentLoadHandler.bind(this));
  2020. this.history = history;
  2021.  
  2022. document.body.appendChild(history);
  2023. },
  2024.  
  2025. historyDocumentLoadHandler : function()
  2026. {
  2027. this.history.contentDocument.getElementById("version").innerHTML=UIL.scriptVersion;
  2028. this.history.contentDocument.getElementById("scriptName").innerHTML=UIL.scriptName;
  2029.  
  2030. var form = this.history.contentDocument.forms.namedItem("history");
  2031.  
  2032. // Set up form state
  2033. form.elements.namedItem("history_text").innerHTML = decodeURI(GM_getValue('onSiteVersionHistory', ''));
  2034.  
  2035. // Set up event handlers
  2036. form.elements.namedItem("install_button").addEventListener("click", this.updateScript.bind(this), false);
  2037. form.elements.namedItem("close_button").addEventListener("click", this.hide.bind(this), false);
  2038.  
  2039. },
  2040.  
  2041. preferencesSaveConfigurationHandler : function()
  2042. {
  2043. var form = document.getElementById("preferences");
  2044. for(var i = 1; i <= 4; i++)
  2045. {
  2046. if(form.elements.namedItem("numcol" + i).checked)
  2047. {
  2048. UIL.Config.setNumCol(i);
  2049. break;
  2050. }
  2051. }
  2052. UIL.Config.setRemSponsor(form.elements.namedItem("remsponsor").checked);
  2053. UIL.Config.setNumResults(form.elements.namedItem("numresults").checked);
  2054. UIL.Config.setRemRightPanel(form.elements.namedItem("remrightpanel").checked);
  2055. UIL.Config.setAutoLoad(form.elements.namedItem("autoload").checked);
  2056. UIL.Config.setHideSearch(form.elements.namedItem("hidesearch").checked);
  2057. UIL.Config.setNoSitePreview(form.elements.namedItem("noSitePreview").checked);
  2058. UIL.Config.setExtLinkSearch(form.elements.namedItem("extlinksearch").checked);
  2059. UIL.Config.setExtLinkiGoogle(form.elements.namedItem("extlinkigoogle").checked);
  2060. UIL.Config.setSearchLinkTracking(form.elements.namedItem("searchlinktracking").checked);
  2061. UIL.Config.setResHue(form.elements.namedItem("ResHuefield").value);
  2062. UIL.Config.setBGBorder(document.getElementById("BGBorderlink").innerHTML);
  2063. UIL.Config.setImagePreview(form.elements.namedItem("imagepreview").checked);
  2064. UIL.Config.setFavIcon(form.elements.namedItem("favicon").checked);
  2065. UIL.Config.setSearchesRelatedTo(form.elements.namedItem("remsearchesrelatedto").checked);
  2066. UIL.Config.setResultFlow(document.getElementById("flowimg").className);
  2067. this.hide();
  2068. window.location.reload(true);
  2069. },
  2070. /**
  2071. *
  2072. * Base64 encode / decode
  2073. * http://www.webtoolkit.info/
  2074. *
  2075. **/
  2076. Base64 : {
  2077.  
  2078. // private property
  2079. _keyStr :
  2080. "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  2081.  
  2082. // public method for encoding
  2083. encode : function (input, isBinaryData) {
  2084. var output = [];
  2085. var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
  2086. var i = 0;
  2087.  
  2088. input = isBinaryData ? String.fromCharCode.apply(null, input) :
  2089. this._utf8_encode(input);
  2090.  
  2091. var len = input.length;
  2092. while (i < len) {
  2093. chr1 = input.charCodeAt(i++);
  2094. chr2 = input.charCodeAt(i++);
  2095. chr3 = input.charCodeAt(i++);
  2096. enc1 = chr1 >> 2;
  2097. enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
  2098. enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
  2099. enc4 = chr3 & 63;
  2100. if (isNaN(chr2)) {
  2101. enc3 = enc4 = 64;
  2102. } else if (isNaN(chr3)) {
  2103. enc4 = 64;
  2104. }
  2105. output.push(
  2106. this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
  2107. this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4));
  2108. }
  2109.  
  2110. return output.join("");
  2111. },
  2112.  
  2113. // public method for decoding
  2114. decode : function (input) {
  2115. if(!input)
  2116. return "";
  2117. var output = [];
  2118. var chr1, chr2, chr3;
  2119. var enc1, enc2, enc3, enc4;
  2120. var i = 0;
  2121.  
  2122. input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
  2123.  
  2124. var len = input.length;
  2125. while (i < len) {
  2126. enc1 = this._keyStr.indexOf(input.charAt(i++));
  2127. enc2 = this._keyStr.indexOf(input.charAt(i++));
  2128. enc3 = this._keyStr.indexOf(input.charAt(i++));
  2129. enc4 = this._keyStr.indexOf(input.charAt(i++));
  2130. chr1 = (enc1 << 2) | (enc2 >> 4);
  2131. chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
  2132. chr3 = ((enc3 & 3) << 6) | enc4;
  2133. output.push( String.fromCharCode(chr1));
  2134. if (enc3 != 64) {
  2135. output.push(String.fromCharCode(chr2));
  2136. }
  2137. if (enc4 != 64) {
  2138. output.push( String.fromCharCode(chr3));
  2139. }
  2140. }
  2141.  
  2142. return this._utf8_decode(output.join(""));
  2143. },
  2144.  
  2145. // private method for UTF-8 encoding
  2146. _utf8_encode : function (string) {
  2147. string = string.replace(/\r\n/g,"\n");
  2148. var utftext = [];
  2149. var len = string.length;
  2150.  
  2151. for (var n = 0; n < len; n++) {
  2152.  
  2153. var c = string.charCodeAt(n);
  2154.  
  2155. if (c < 128) {
  2156. utftext.push( String.fromCharCode(c));
  2157. }
  2158. else if((c > 127) & (c < 2048)) {
  2159. utftext.push(String.fromCharCode((c >> 6) | 192),
  2160. String.fromCharCode((c & 63) | 128));
  2161. }
  2162. else {
  2163. utftext.push( String.fromCharCode((c >> 12) | 224),
  2164. String.fromCharCode(((c >> 6) & 63) | 128),
  2165. String.fromCharCode((c & 63) | 128));
  2166. }
  2167.  
  2168. }
  2169.  
  2170. return utftext.join("");
  2171. },
  2172.  
  2173. // private method for UTF-8 decoding
  2174. _utf8_decode : function (utftext) {
  2175. var string = [];
  2176. var i = 0;
  2177. var c = c1 = c2 = 0;
  2178. var len = utftext.length;
  2179.  
  2180. while ( i < len ) {
  2181.  
  2182. c = utftext.charCodeAt(i);
  2183.  
  2184. if (c < 128) {
  2185. string.push(String.fromCharCode(c));
  2186. i++;
  2187. }
  2188. else if((c > 191) & (c < 224)) {
  2189. c2 = utftext.charCodeAt(i+1);
  2190. string.push(String.fromCharCode(((c & 31) << 6) | (c2 & 63)));
  2191. i += 2;
  2192. }
  2193. else {
  2194. c2 = utftext.charCodeAt(i+1);
  2195. c3 = utftext.charCodeAt(i+2);
  2196. string.push( String.fromCharCode(((c & 15) << 12) |
  2197. ((c2 & 63) << 6) | (c3 & 63)));
  2198. i += 3;
  2199. }
  2200.  
  2201. }
  2202.  
  2203. return string.join("");
  2204. }
  2205. }
  2206.  
  2207. };
  2208.  
  2209. /**
  2210. * Resource section (RES).
  2211. **/
  2212. UIL.RES =
  2213. {
  2214. PREFS_HTML : "PHN0eWxlIHR5cGU9InRleHQvY3NzIj4NCi5ib2R5IHsNCgltYXJnaW46MDsNCglwYWRkaW5nOjA7DQoJZm9udC1zaXplOjEycHg7DQoJZm9udC1mYW1pbHk6Ikx1Y2lkYSBHcmFuZGUiLCAiQml0c3RyZWFtIFZlcmEgU2FucyIsIFZlcmRhbmEsIEFyaWFsLCBzYW5zLXNlcmlmOw0KCWNvbG9yOiMzMzM7DQoJd2lkdGg6IDU1MHB4Ow0KCW1hcmdpbjogMCBhdXRvOw0KfQ0KI2NvbG9ycGlja2VyIHsNCglwb3NpdGlvbjogYWJzb2x1dGU7DQoJYm9yZGVyOiAjMDAwMDAwIDFweCBzb2xpZDsNCgliYWNrZ3JvdW5kOiAjRkZGRkZGOw0KCWRpc3BsYXk6IG5vbmU7DQoJei1pbmRleDogMTAwMDI7DQp9DQoubW9kdWxlIHsNCglib3JkZXI6IDFweCBzb2xpZCAjY2NjOw0KCW1hcmdpbi1ib3R0b206IDV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RuIiB0eXBl"+
  2252. "PSJidXR0b24iPg0KICAgICAgICA8L3RkPg0KICAgICAgICA8dGQgYWxpZ249ImNlbnRlciIgdmFsaWduPSJtaWRkbGUiIHdpZHRo"+
  2253. "PSI4NSI%2BPGlucHV0IHZhbHVlPSJDbG9zZSIgbmFtZT0iY2xvc2VfYnV0dG9uIiBpZD0iY2xvc2VfYnV0dG9uIiBjbGFzcz0iYn"+
  2254. "RuIiB0eXBlPSJidXR0b24iPg0KICAgICAgICA8L3RkPg0KICAgICAgPC90cj4NCiAgICA8L3Rib2R5PjwvdGFibGU%2BDQogIDwv"+
  2255. "ZGl2Pg0KPC9mb3JtPg0KPC9ib2R5PjwvaHRtbD4%3D",
  2256.  
  2257. REFRESH_HTML : "data:text/html;base64,PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEvL0VOIiAiaHR0cDovL3"+
  2258. "d3dy53My5vcmcvVFIvaHRtbDQvc3RyaWN0LmR0ZCI%2BDQo8aHRtbD48aGVhZD48dGl0bGU%2BR29vZ2xlTW9ua2V5UiBVcGRhdG"+
  2259. "U8L3RpdGxlPg0KPG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9VVRGLT"+
  2260. "giPg0KPG1ldGEgbmFtZT0iQXV0aG9yIiBjb250ZW50PSJtdW5ndXNodW1lIj4NCjxtZXRhIG5hbWU9IkNvcHlyaWdodCIgY29udG"+
  2261. "VudD0iwqkgMjAwNywgTW9ua2V5Ui5jb20iPg0KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4NCmJvZHkgeyBtYXJnaW46MDsgcGFkZG"+
  2262. "luZzowOyBmb250LXNpemU6MTJweDsgZm9udC1mYW1pbHk6Ikx1Y2lkYSBHcmFuZGUiLCJCaXRzdHJlYW0gVmVyYSBTYW5zIixWZX"+
  2263. "JkYW5hLEFyaWFsLHNhbnMtc2VyaWY7I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AN7BfYJvEOczm2ubBNFsTud7NdygDPsFOysSfQxH2c"+
  2334. "5NhPwtYM36IDt1PWzZcBvsdBycw1cQenJTlOw6dZMpMHMVbPgB8K9NfiXbvSNtNlqyB8DyO2l7FKAWdzdFM4wnIfp3c5Yqe6HOuv"+
  2335. "gE86Nv8CPmLpHCVmKXIstOluxVg9t1s38QWfcQmrmK6gDi7iG47jwraK6%2F32gzfwaACN8jQe1neSGvB%2FAmx1qRsKYFZQaGer"+
  2336. "uDVWATgW7dNMm24mdGOp3IsX8TWKOtzDfGpfFuargqrLTA2YGmCWMF%2BW4WdU%2FSR%2FQ%2FweACo1SBSU%2Bf00AAAAAElFTk"+
  2337. "SuQmCC",
  2338.  
  2339. LOADING_GIF : "data:image/gif;base64,R0lGODlhIgAiAPQAADk5OVJSUlpaWmtra3t7e4SEhIyMjJSUlJycnKWlpa2trbW1tb29vcbGxs7Ozt"+
  2340. "bW1t7e3ufn5%2B%2Fv7%2Ff39%2F%2F%2F%2FwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAgFAAAAIf8LTkVU"+
  2341. "U0NBUEUyLjADAQAAACwAAAAAIgAiAAAFhiAljmRJLYmprqx4AG1cBgb5yjjVCDacxxKBYnT7lQoI0mBA9BlHEOToIYC4nE9RNCUa"+
  2342. "1CjFLLTAdQQmYKyYshUJkodAVhFBQwkpB2OtSygYEVMFVnwjDSh0hSwSDX6EiioOj5CUJRIPEJiamJATERESn6CflaWmp6ipqqus"+
  2343. "ra6vsLGys6ohACH5BAgFAAAALAAAAAAiACIAhCEhISkpKVpaWmNjY2tra3Nzc4SEhIyMjJSUlKWlpa2trbW1tb29vcbGxs7OztbW"+
  2344. "1t7e3ufn5%2B%2Fv7%2Ff39%2F%2F%2F%2FwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWTICWOZElJiqmuZkMqAi"+
  2345. "urUPHG4wNEM2ukIsWAJAj0SBPSwzASjiQA15HyUC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ufn5%2B%2Fv7%2Ff39%2F%2F%2F%2Fw"+
  2395. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWM4CWOZGmeaKqurDCw8PkAVWyPgHGrRD06gF3qMKCMKgCEEHUgGEWFwBKFKIoggMj0VJ"+
  2396. "2IArqpwktKDCQXiGLLSCQivkuCYNmSGu4FOm03QdoJZH0mFQ5ag4gnEg4ODYyODQ%2BDFhKVlpaJmTAWFHGJFJaefRMSEROidqQR"+
  2397. "dZoXEqytsbKztLW2t7i5tCEAOw%3D%3D",
  2398.  
  2399. // Color Picker Script from Flooble.com
  2400. // For more information, visit
  2401. // http://www.flooble.com/scripts/colorpicker.php
  2402. // Copyright 2003 Animus Pactum Consulting inc.
  2403.  
  2404. // You may use and distribute this code freely, as long as
  2405. // you keep this copyright notice and the link to flooble.com
  2406. // if you chose to remove them, you must link to the page
  2407. // listed above from every web page where you use the color
  2408. // picker code.
  2409. //---------------------------------------------------------
  2410. colorPicker : {
  2411. perline : 5,
  2412. divSet : false,
  2413. curId : null,
  2414. colorLevels : Array('A', 'B', 'C', 'D', 'E', 'F'),
  2415. colorArray : Array(),
  2416.  
  2417. addColor : function(r, g, b) {
  2418. this.colorArray[this.colorArray.length] = '#' + this.colorLevels[r] + this.colorLevels[r] + this.colorLevels[g] + this.colorLevels[g] + this.colorLevels[b] + this.colorLevels[b];
  2419. },
  2420.  
  2421. setColor : function(color) {
  2422. var that = this;
  2423. return function(){
  2424. var link = document.getElementById(that.curId);
  2425. var field = document.getElementById(that.curId + 'field');
  2426. var picker = document.getElementById('colorpicker');
  2427. field.value = color;
  2428. if (color == '') {
  2429. link.style.background = 'none';
  2430. link.style.color = 'none';
  2431. color = 'none';
  2432. } else {
  2433. link.style.background = color;
  2434. link.style.color = color;
  2435. }
  2436. picker.style.display = 'none';
  2437. eval(document.getElementById(that.curId + 'field').title);
  2438. }.bind(this)
  2439. },
  2440.  
  2441. setDiv : function(id) {
  2442. if (!document.createElement) { return; }
  2443. this.genColors();
  2444.  
  2445. var div = document.buildElement('div',{id:'colorpicker'});
  2446. var spn = document.buildElement('span',{style:"font-family:Verdana; font-size:11px;"});
  2447. var a = document.buildElement('a',{href:"javascript:;"},'No color','click',this.setColor(''));
  2448. spn.appendChild(a);
  2449. spn.appendChild(this.getColorTable());
  2450. div.appendChild(spn);
  2451. document.body.appendChild(div);
  2452. this.divSet = true;
  2453. },
  2454.  
  2455. pickColor : function(id) {
  2456. id = 'ResHue';
  2457. if (!this.divSet) { this.setDiv(id); }
  2458. var picker = document.getElementById('colorpicker');
  2459. if (id == this.curId && picker.style.display == 'block') {
  2460. picker.style.display = 'none';
  2461. return;
  2462. }
  2463. this.curId = id;
  2464. var thelink = document.getElementById(id);
  2465. picker.style.top = (this.getAbsoluteOffsetTop(thelink) + 20) + "px";
  2466. picker.style.left = this.getAbsoluteOffsetLeft(thelink) + "px";
  2467. picker.style.display = 'block';
  2468. },
  2469.  
  2470. genColors : function () {
  2471. for (a = 0; a < this.colorLevels.length-1; a++)
  2472. this.addColor(a,a,5);
  2473.  
  2474. for (a = 0; a < this.colorLevels.length-1; a++)
  2475. this.addColor(a,5,a);
  2476.  
  2477. for (a = 0; a < this.colorLevels.length-1; a++)
  2478. this.addColor(5,a,a);
  2479.  
  2480. for (a = 0; a < this.colorLevels.length-1; a++)
  2481. this.addColor(5,5,a);
  2482.  
  2483. for (a = 0; a < this.colorLevels.length-1; a++)
  2484. this.addColor(a,5,5);
  2485.  
  2486. for (a = 0; a < this.colorLevels.length-1; a++)
  2487. this.addColor(5,a,5);
  2488.  
  2489. this.colorArray[this.colorArray.length] = "#E5ECF9";
  2490. this.colorArray[this.colorArray.length] = "#FAFAE6";
  2491.  
  2492. return this.colorArray;
  2493. },
  2494. getColorTable : function () {
  2495. var colors = this.colorArray;
  2496. var tab = document.buildElement('table',{border:"0", cellspacing:"1", cellpadding:"1"});
  2497.  
  2498. for (var i = 0; i < colors.length; i++) {
  2499. if (i % this.perline == 0) { var tr = document.buildElement('tr'); tab.appendChild(tr) }
  2500. var td = document.buildElement('td',{bgcolor:colors[i]});
  2501. var a = document.buildElement('a',{style:"outline: 1px solid #000000; color:"+colors[i]+"; background: ' + colors[i] + ';font-size: 11px;", title:colors[i],href:"javascript:;"},"&nbsp;&nbsp;&nbsp;&nbsp;",'click',this.setColor(colors[i]));
  2502. td.appendChild(a);
  2503. tr.appendChild(td)
  2504. }
  2505. return tab;
  2506. },
  2507. getColorTable2 : function () {
  2508. var colors = this.colorArray;
  2509. var tableCode = '';
  2510. tableCode += '<table border="0" cellspacing="1" cellpadding="1">';
  2511. for (i = 0; i < colors.length; i++) {
  2512. if (i % this.perline == 0) { tableCode += '<tr>'; }
  2513. tableCode += '<td bgcolor="#000000"><a style="outline: 1px solid #000000; color: '
  2514. + colors[i] + '; background: ' + colors[i] + ';font-size: 11px;" title="'
  2515. + colors[i] + '" href="javascript:setColor(\'' + colors[i] + '\');">&nbsp;&nbsp;&nbsp;&nbsp;</a></td>';
  2516. if (i % this.perline == this.perline - 1) { tableCode += '</tr>'; }
  2517. }
  2518. if (i % this.perline != 0) { tableCode += '</tr>'; }
  2519. tableCode += '</table>';
  2520. return tableCode;
  2521. },
  2522. relateColor : function (id) {
  2523.  
  2524. return function(e){
  2525.  
  2526. var color = (e.srcElement.value)
  2527. var link = document.getElementById(id);
  2528. if (color == '') {
  2529. link.style.background = 'none';
  2530. link.style.color = 'none';
  2531. color = 'none';
  2532. } else {
  2533. link.style.background = color;
  2534. link.style.color = color;
  2535. }
  2536. eval(document.getElementById(id + 'field').title);
  2537. }.bind(this)
  2538. },
  2539. getAbsoluteOffsetTop : function (obj) {
  2540. var top = obj.offsetTop;
  2541. var parent = obj.offsetParent;
  2542. while (parent != document.body && parent!==null) {
  2543. top += parent.offsetTop;
  2544. parent = parent.offsetParent;
  2545. }
  2546. return top;
  2547. },
  2548.  
  2549. getAbsoluteOffsetLeft : function (obj) {
  2550. var left = obj.offsetLeft;
  2551. var parent = obj.offsetParent;
  2552. while (parent != document.body && parent!==null) {
  2553. left += parent.offsetLeft;
  2554. parent = parent.offsetParent;
  2555. }
  2556. return left;
  2557. }
  2558. },
  2559. bgBordertog : function () {
  2560. var e = document.getElementById('BGBorderlink');
  2561. e.innerHTML = (e.innerHTML=='background') ? 'border' : 'background';
  2562. },
  2563. flowtog : function () {
  2564. var e = document.getElementById('flowimg');
  2565. e.className = (e.className=='l2r') ? 't2b' : 'l2r';
  2566. }
  2567.  
  2568. };
  2569.  
  2570. /* Prototypes and additional document functions */
  2571. document.getElementByXPath = function(XPath, contextNode)
  2572. {
  2573. var a = this.evaluate(XPath, (contextNode || this), null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  2574. return (a.snapshotLength ? a.snapshotItem(0) : null);
  2575. };
  2576.  
  2577. document.getElementsByXPath = function(XPath, contextNode)
  2578. {
  2579. var ret=[], i=0;
  2580. var a = this.evaluate(XPath, (contextNode || this), null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  2581. while(a.snapshotItem(i))
  2582. {
  2583. ret.push(a.snapshotItem(i++));
  2584. }
  2585. return ret;
  2586. };
  2587.  
  2588. document.buildElement = function(type, atArr, inner, action, listen)
  2589. {
  2590. var e = document.createElement(type);
  2591. for (var at in atArr)
  2592. {
  2593. if (atArr.hasOwnProperty(at))
  2594. {
  2595. e.setAttribute(at, atArr[at]);
  2596. }
  2597. }
  2598. if(action && listen)
  2599. {
  2600. e.addEventListener(action, listen, false);
  2601. }
  2602. if(inner)
  2603. {
  2604. e.innerHTML = inner;
  2605. }
  2606. return e;
  2607. };
  2608.  
  2609. Function.prototype.bind = function(object)
  2610. {
  2611. var __method = this;
  2612. return function()
  2613. {
  2614. __method.apply(object, arguments);
  2615. }
  2616. };
  2617.  
  2618. String.prototype.repeat = function(l)
  2619. {
  2620. return new Array(l+1).join(this);
  2621. };
  2622.  
  2623. String.prototype.retNum = function()
  2624. {
  2625. return (isNaN(this) ? 0 : (+this));
  2626. };
  2627.  
  2628. if (typeof GM_getValue === "undefined" || GM_getValue("a", "b") === undefined) {
  2629. if(typeof window.localStorage == "object") {
  2630. GM_setValue = function ( key, value ) {
  2631. window.localStorage.setItem( key, value );
  2632. }
  2633. }
  2634. else{
  2635. function getRecoverableString(oVar,notFirst) {
  2636. var oType = typeof(oVar);
  2637. if( ( oType == 'null' ) || ( oType == 'object' && !oVar ) ) {
  2638. //most browsers say that the typeof for null is 'object', but unlike a real
  2639. //object, it will not have any overall value
  2640. return 'null';
  2641. }
  2642. if( oType == 'undefined' ) { return 'window.uDfXZ0_d'; }
  2643. if( oType == 'object' ) {
  2644. //Safari throws errors when comparing non-objects with window/document/etc
  2645. if( oVar == window ) { return 'window'; }
  2646. if( oVar == document ) { return 'document'; }
  2647. if( oVar == document.body ) { return 'document.body'; }
  2648. if( oVar == document.documentElement ) { return 'document.documentElement'; }
  2649. }
  2650. if( oVar.nodeType && ( oVar.childNodes || oVar.ownerElement ) ) { return '{error:\'DOM node\'}'; }
  2651. if( !notFirst ) {
  2652. Object.prototype.toRecoverableString = function (oBn) {
  2653. if( this.tempLockIgnoreMe ) { return '{\'LoopBack\'}'; }
  2654. this.tempLockIgnoreMe = true;
  2655. var retVal = '{', sepChar = '', j;
  2656. for( var i in this ) {
  2657. if( i == 'toRecoverableString' || i == 'tempLockIgnoreMe' || i == 'prototype' || i == 'constructor' ) { continue; }
  2658. if( oBn && ( i == 'index' || i == 'input' || i == 'length' || i == 'toRecoverableObString' ) ) { continue; }
  2659. j = this[i];
  2660. if( !i.match(basicObPropNameValStr) ) {
  2661. //for some reason, you cannot use unescape when defining peoperty names inline
  2662. for( var x = 0; x < cleanStrFromAr.length; x++ ) {
  2663. i = i.replace(cleanStrFromAr[x],cleanStrToAr[x]);
  2664. }
  2665. i = '\''+i+'\'';
  2666. } else if( window.ActiveXObject && navigator.userAgent.indexOf('Mac') + 1 && !navigator.__ice_version && window.ScriptEngine && ScriptEngine() == 'JScript' && i.match(/^\d+$/) ) {
  2667. //IE mac does not allow numerical property names to be used unless they are quoted
  2668. i = '\''+i+'\'';
  2669. }
  2670. retVal += sepChar+i+':'+getRecoverableString(j,true);
  2671. sepChar = ',';
  2672. }
  2673. retVal += '}';
  2674. this.tempLockIgnoreMe = false;
  2675. return retVal;
  2676. };
  2677. Array.prototype.toRecoverableObString = Object.prototype.toRecoverableString;
  2678. Array.prototype.toRecoverableString = function () {
  2679. if( this.tempLock ) { return '[\'LoopBack\']'; }
  2680. if( !this.length ) {
  2681. var oCountProp = 0;
  2682. for( var i in this ) { if( i != 'toRecoverableString' && i != 'toRecoverableObString' && i != 'tempLockIgnoreMe' && i != 'prototype' && i != 'constructor' && i != 'index' && i != 'input' && i != 'length' ) { oCountProp++; } }
  2683. if( oCountProp ) { return this.toRecoverableObString(true); }
  2684. }
  2685. this.tempLock = true;
  2686. var retVal = '[';
  2687. for( var i = 0; i < this.length; i++ ) {
  2688. retVal += (i?',':'')+getRecoverableString(this[i],true);
  2689. }
  2690. retVal += ']';
  2691. delete this.tempLock;
  2692. return retVal;
  2693. };
  2694. Boolean.prototype.toRecoverableString = function () {
  2695. return ''+this+'';
  2696. };
  2697. Date.prototype.toRecoverableString = function () {
  2698. return 'new Date('+this.getTime()+')';
  2699. };
  2700. Function.prototype.toRecoverableString = function () {
  2701. return this.toString().replace(/^\s+|\s+$/g,'').replace(/^function\s*\w*\([^\)]*\)\s*\{\s*\[native\s+code\]\s*\}$/i,'function () {[\'native code\'];}');
  2702. };
  2703. Number.prototype.toRecoverableString = function () {
  2704. if( isNaN(this) ) { return 'Number.NaN'; }
  2705. if( this == Number.POSITIVE_INFINITY ) { return 'Number.POSITIVE_INFINITY'; }
  2706. if( this == Number.NEGATIVE_INFINITY ) { return 'Number.NEGATIVE_INFINITY'; }
  2707. return ''+this+'';
  2708. };
  2709. RegExp.prototype.toRecoverableString = function () {
  2710. return '\/'+this.source+'\/'+(this.global?'g':'')+(this.ignoreCase?'i':'');
  2711. };
  2712. String.prototype.toRecoverableString = function () {
  2713. var oTmp = escape(this);
  2714. if( oTmp == this ) { return '\''+this+'\''; }
  2715. return 'unescape(\''+oTmp+'\')';
  2716. };
  2717. }
  2718. if( !oVar.toRecoverableString ) { return '{error:\'internal object\'}'; }
  2719. var oTmp = oVar.toRecoverableString();
  2720. if( !notFirst ) {
  2721. //prevent it from changing for...in loops that the page may be using
  2722. delete Object.prototype.toRecoverableString;
  2723. delete Array.prototype.toRecoverableObString;
  2724. delete Array.prototype.toRecoverableString;
  2725. delete Boolean.prototype.toRecoverableString;
  2726. delete Date.prototype.toRecoverableString;
  2727. delete Function.prototype.toRecoverableString;
  2728. delete Number.prototype.toRecoverableString;
  2729. delete RegExp.prototype.toRecoverableString;
  2730. delete String.prototype.toRecoverableString;
  2731. }
  2732. return oTmp;
  2733. }
  2734.  
  2735. GM_setValue = function ( cookieName, cookieValue, lifeTime ) {
  2736. if( !cookieName ) { return; }
  2737. if( lifeTime == "delete" ) { lifeTime = -10; } else { lifeTime = 31536000; }
  2738. document.cookie = escape( cookieName ) + "=" + escape( getRecoverableString( cookieValue ) ) +
  2739. ";expires=" + ( new Date( ( new Date() ).getTime() + ( 1000 * lifeTime ) ) ).toGMTString() + ";path=/";
  2740. }
  2741. }
  2742. }
  2743. if (typeof GM_getValue === "undefined" || GM_getValue("a", "b") === undefined){
  2744. if(typeof window.localStorage == "object") {
  2745. GM_getValue = function ( key, defaultValue ) {
  2746. var value = window.localStorage.getItem(key);
  2747. if( value == null ) value = defaultValue;
  2748. else if(value=='true') value = true;
  2749. else if(value=='false') value = false;
  2750. return value;
  2751. }
  2752. }
  2753. else{
  2754. GM_getValue = function ( cookieName, oDefault ) {
  2755. var cookieJar = document.cookie.split( "; " );
  2756. for( var x = 0; x < cookieJar.length; x++ ) {
  2757. var oneCookie = cookieJar[x].split( "=" );
  2758. if( oneCookie[0] == escape( cookieName ) ) {
  2759. try {
  2760. eval('var footm = '+unescape( oneCookie[1] ));
  2761. } catch(e) { return oDefault; }
  2762. return footm;
  2763. }
  2764. }
  2765. return oDefault;
  2766. }
  2767. }
  2768. }
  2769. if (typeof GM_xmlhttpRequest === "undefined") {
  2770. GM_xmlhttpRequest = function (details) {
  2771. var xmlhttp = new XMLHttpRequest();
  2772. xmlhttp.onreadystatechange = function() {
  2773. var responseState = {
  2774. responseXML:(xmlhttp.readyState==4 ? xmlhttp.responseXML : ''),
  2775. responseText:(xmlhttp.readyState==4 ? xmlhttp.responseText : ''),
  2776. readyState:xmlhttp.readyState,
  2777. responseHeaders:(xmlhttp.readyState==4 ? xmlhttp.getAllResponseHeaders() : ''),
  2778. status:(xmlhttp.readyState==4 ? xmlhttp.status : 0),
  2779. statusText:(xmlhttp.readyState==4 ? xmlhttp.statusText : '')
  2780. }
  2781. if (details["onreadystatechange"]) {
  2782. details["onreadystatechange"](responseState);
  2783. }
  2784. if (xmlhttp.readyState==4) {
  2785. if (details["onload"] && xmlhttp.status>=200 && xmlhttp.status<300) {
  2786. details["onload"](responseState);
  2787. }
  2788. if (details["onerror"] && (xmlhttp.status<200 || xmlhttp.status>=300)) {
  2789. details["onerror"](responseState);
  2790. }
  2791. }
  2792. }
  2793. try {
  2794. //cannot do cross domain
  2795. xmlhttp.open(details.method, details.url);
  2796. // alert(details.method +':'+ details.url)
  2797. } catch(e) {
  2798. if( details["onerror"] ) {
  2799. //simulate a real error
  2800. details["onerror"]({responseXML:'',responseText:'',readyState:4,responseHeaders:'',status:403,statusText:'Forbidden'});
  2801. }
  2802. return;
  2803. }
  2804. if (details.headers) {
  2805. for (var prop in details.headers) {
  2806. xmlhttp.setRequestHeader(prop, details.headers[prop]);
  2807. }
  2808. }
  2809. xmlhttp.send((typeof(details.data)!='undefined')?details.data:null);
  2810. }
  2811. }
  2812.  
  2813. // Browser detect
  2814. // http://www.quirksmode.org/js/detect.html
  2815. // A useful but often overrated JavaScript function is the browser detect.
  2816. // Sometimes you want to give specific instructions or load a new page in case the viewer uses, for instance, Safari.
  2817. var BrowserDetect = {
  2818. init: function () {
  2819. this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
  2820. this.version = this.searchVersion(navigator.userAgent)
  2821. || this.searchVersion(navigator.appVersion)
  2822. || "an unknown version";
  2823. this.OS = this.searchString(this.dataOS) || "an unknown OS";
  2824. this.csQuery = this.searchCSQuery(this.dataBrowser) || false;
  2825. return (this.browser != "An unknown browser");
  2826. },
  2827. searchString: function (data) {
  2828. for (var i=0;i<data.length;i++) {
  2829. var dataString = data[i].string;
  2830. var dataProp = data[i].prop;
  2831. this.versionSearchString = data[i].versionSearch || data[i].identity;
  2832. if (dataString) {
  2833. if (dataString.indexOf(data[i].subString) != -1)
  2834. return data[i].identity;
  2835. }
  2836. else if (dataProp)
  2837. return data[i].identity;
  2838. }
  2839. },
  2840. searchCSQuery: function (data) {
  2841. for (var i=0;i<data.length;i++) {
  2842. var dataString = data[i].string;
  2843. var dataProp = data[i].prop;
  2844. this.versionSearchString = data[i].versionSearch || data[i].identity;
  2845. if (dataString) {
  2846. if (dataString.indexOf(data[i].subString) != -1)
  2847. return data[i].csQuery;
  2848. }
  2849. else if (dataProp)
  2850. return data[i].csQuery;
  2851. }
  2852. },
  2853. searchVersion: function (dataString) {
  2854. var index = dataString.indexOf(this.versionSearchString);
  2855. if (index == -1) return;
  2856. return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
  2857. },
  2858. dataBrowser: [
  2859. {
  2860. string: navigator.userAgent,
  2861. subString: "Chrome",
  2862. identity: "Chrome",
  2863. csQuery: false
  2864. },
  2865. { string: navigator.userAgent,
  2866. subString: "OmniWeb",
  2867. versionSearch: "OmniWeb/",
  2868. identity: "OmniWeb",
  2869. csQuery: false
  2870. },
  2871. {
  2872. string: navigator.vendor,
  2873. subString: "Apple",
  2874. identity: "Safari",
  2875. versionSearch: "Version",
  2876. csQuery: false
  2877. },
  2878. {
  2879. prop: window.opera,
  2880. identity: "Opera",
  2881. csQuery: false
  2882. },
  2883. {
  2884. string: navigator.vendor,
  2885. subString: "iCab",
  2886. identity: "iCab",
  2887. csQuery: false
  2888. },
  2889. {
  2890. string: navigator.vendor,
  2891. subString: "KDE",
  2892. identity: "Konqueror",
  2893. csQuery: false
  2894. },
  2895. {
  2896. string: navigator.userAgent,
  2897. subString: "Firefox",
  2898. identity: "Firefox",
  2899. csQuery: true
  2900. },
  2901. {
  2902. string: navigator.vendor,
  2903. subString: "Camino",
  2904. identity: "Camino",
  2905. csQuery: false
  2906. },
  2907. { // for newer Netscapes (6+)
  2908. string: navigator.userAgent,
  2909. subString: "Netscape",
  2910. identity: "Netscape",
  2911. csQuery: false
  2912. },
  2913. {
  2914. string: navigator.userAgent,
  2915. subString: "MSIE",
  2916. identity: "Explorer",
  2917. versionSearch: "MSIE",
  2918. csQuery: false
  2919. },
  2920. {
  2921. string: navigator.userAgent,
  2922. subString: "Gecko",
  2923. identity: "Mozilla",
  2924. versionSearch: "rv",
  2925. csQuery: false
  2926. },
  2927. { // for older Netscapes (4-)
  2928. string: navigator.userAgent,
  2929. subString: "Mozilla",
  2930. identity: "Netscape",
  2931. versionSearch: "Mozilla",
  2932. csQuery: false
  2933. }
  2934. ],
  2935. dataOS : [
  2936. {
  2937. string: navigator.platform,
  2938. subString: "Win",
  2939. identity: "Windows"
  2940. },
  2941. {
  2942. string: navigator.platform,
  2943. subString: "Mac",
  2944. identity: "Mac"
  2945. },
  2946. {
  2947. string: navigator.userAgent,
  2948. subString: "iPhone",
  2949. identity: "iPhone/iPod"
  2950. },
  2951. {
  2952. string: navigator.platform,
  2953. subString: "Linux",
  2954. identity: "Linux"
  2955. }
  2956. ]
  2957.  
  2958. };
  2959. function findPos(obj) {
  2960. var curleft = curtop = 0;
  2961. if (obj.offsetParent) {
  2962. do {
  2963. curleft += obj.offsetLeft;
  2964. curtop += obj.offsetTop;
  2965. } while ((obj = obj.offsetParent));
  2966. }
  2967. return [curleft,curtop];
  2968. }
  2969. function getStyle(el,styleProp)
  2970. {
  2971. if (el.currentStyle)
  2972. var y = el.currentStyle[styleProp];
  2973. else if (window.getComputedStyle)
  2974. var y = document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);
  2975. if((match = y.match(/^(\d+)px$/))) y = +match[1];
  2976. return y;
  2977. }
  2978. var monkeyr = {
  2979. toLog : false,
  2980. toLogE : false,
  2981. log : function(){
  2982. if(!this.toLog) return;
  2983. this._log.apply(this, arguments);
  2984. },
  2985. logE : function(){
  2986. if(!this.toLogE) return;
  2987. this._log.apply(this, arguments);
  2988. },
  2989. logA : function(){
  2990. if(!this.toLog && !this.toLogE) return;
  2991. this._log.apply(this, arguments);
  2992. },
  2993. _log : function(){
  2994. if(window.console){
  2995. if (arguments.length == 1) {
  2996. console.log( arguments[0] );
  2997. }
  2998. else{
  2999. console.log( Array.prototype.slice.call(arguments) );
  3000. }
  3001. }
  3002. }
  3003. }
  3004. // monkeyr.toLog = true;
  3005. // monkeyr.toLogE = true;
  3006. // UIL.watching = '#main';
  3007. /* Run the browser detect script */
  3008. BrowserDetect.init();
  3009. /* Run the update check */
  3010. UIL.UI.updateCheckRequest();
  3011. /* Run the script */
  3012. UIL.init();
  3013. })();