Changeset 38625
- Timestamp:
- 10/27/10 23:26:23 (3 years ago)
- Files:
-
- 1 modified
-
lang/javascript/userscripts/ldrize.user.js (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/userscripts/ldrize.user.js
r36242 r38625 8 8 // ==/UserScript== 9 9 10 const SCRIPT_VERSION = "20 09.12.05"10 const SCRIPT_VERSION = "2010.10.27" 11 11 const SCRIPT_URL = "http://userscripts.org/scripts/show/11562" 12 12 … … 20 20 link : XPath 21 21 focus : XPath 22 stripe : true23 22 height : Number 24 23 disable : true … … 28 27 paragraph: '', 29 28 link: '', 30 stripe: true31 29 }, 32 30 */ … … 88 86 // CSS 89 87 // ------------------------------------------------------------------ 90 const CSS_STRIPE_ODD = false91 const CSS_STRIPE_EVEN = 'background-color:#eeeeff !important;'92 88 const CSS_HIGHLIGHT_LINK = false 93 89 const CSS_HIGHLIGHT_PINNED = 'outline: 2px solid #CC6060 !important;outline-offset: 1px !important;outline-radius: 3px !important;' … … 105 101 var LDRize = new Class(); 106 102 LDRize.prototype = { 107 GLOBAL_STRIPE: false, // enable stripe always108 103 scrollHeight: 10, 109 104 indicatorMargin: 15, … … 285 280 }else if(!this.paragraphes[xpath]){ 286 281 var p = new Paragraphes(xpath); 287 if(this.useStripe()) p.enableStripe();288 282 p.collect(); 289 283 this.paragraphes[xpath] = p; … … 355 349 initCSS: function(){ 356 350 var css = ''; 357 css += (CSS_STRIPE_ODD ?358 ".gm_ldrize_odd {"+ CSS_STRIPE_ODD +"}":"") +359 (CSS_STRIPE_EVEN ?360 ".gm_ldrize_even {"+ CSS_STRIPE_EVEN +"}":"");361 351 if(CSS_HIGHLIGHT_LINK) css += "\n.gm_ldrize_link {" + CSS_HIGHLIGHT_LINK + "}"; 362 352 if(CSS_HIGHLIGHT_PINNED) css += "\n.gm_ldrize_pinned {" + CSS_HIGHLIGHT_PINNED + "}"; … … 464 454 return DEFAULT_HEIGHT + ((typeof h != 'undefined') ? Number(h) : this.scrollHeight); 465 455 }, 466 useStripe: function(){return this.siteinfo_current['stripe'] || this.GLOBAL_STRIPE},467 456 useSmoothScroll: function(){return eval(GM_getValue('smooth', 'true'))}, 468 457 scrollTo: function(x, y){ … … 810 799 this.xpath = arguments[0]; 811 800 this.context = []; 812 this.stripe = false;813 801 this.current = { 814 802 paragraph: null, … … 844 832 }, 845 833 setContext: function(arg){this.context = arg; return this}, 846 enableStripe: function(){this.stripe = true; return this}, 847 848 attachClassForStripe: function(node){ 849 var odd = this.list.length % 2 == 1; 850 var _class = node.getAttribute('class'); 851 if(!_class || _class.indexOf("gm_ldrize_") == -1){ 852 node.setAttribute( 853 'class', 854 (_class || "") + " " + 855 (odd ? "gm_ldrize_odd": "gm_ldrize_even")); 856 } 857 }, 834 858 835 select: function(arg){this.selectNth(this.position(arg))}, 859 836 selectNth: function(n){ … … 1012 989 Siteinfo.prototype = { 1013 990 initialize: function(){ 1014 // ['name', 'domain', 'paragraph', 'link', 'view', ' stripe', 'height', 'focus', 'disable']991 // ['name', 'domain', 'paragraph', 'link', 'view', 'height', 'focus', 'disable'] 1015 992 Object.extend(this, arguments[0]); 1016 993 },
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)