GoogleMonkeyR

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.

目前为 2015-06-03 提交的版本,查看 最新版本

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