Changeset 38625

Show
Ignore:
Timestamp:
10/27/10 23:26:23 (3 years ago)
Author:
snj14
Message:

stripe関連のコード削除。userstyleでnth-child使えば良いよねってことで。

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/userscripts/ldrize.user.js

    r36242 r38625  
    88// ==/UserScript== 
    99 
    10 const SCRIPT_VERSION = "2009.12.05" 
     10const SCRIPT_VERSION = "2010.10.27" 
    1111const SCRIPT_URL     = "http://userscripts.org/scripts/show/11562" 
    1212 
     
    2020     link      : XPath 
    2121     focus     : XPath 
    22      stripe    : true 
    2322     height    : Number 
    2423     disable   : true 
     
    2827        paragraph: '', 
    2928        link:      '', 
    30         stripe:    true 
    3129    }, 
    3230*/ 
     
    8886// CSS 
    8987// ------------------------------------------------------------------ 
    90 const CSS_STRIPE_ODD       = false 
    91 const CSS_STRIPE_EVEN      = 'background-color:#eeeeff !important;' 
    9288const CSS_HIGHLIGHT_LINK   = false 
    9389const CSS_HIGHLIGHT_PINNED = 'outline: 2px solid #CC6060 !important;outline-offset: 1px !important;outline-radius: 3px !important;' 
     
    105101var LDRize = new Class(); 
    106102LDRize.prototype = { 
    107   GLOBAL_STRIPE: false, // enable stripe always 
    108103  scrollHeight: 10, 
    109104  indicatorMargin: 15, 
     
    285280          }else if(!this.paragraphes[xpath]){ 
    286281                  var p = new Paragraphes(xpath); 
    287                   if(this.useStripe()) p.enableStripe(); 
    288282                  p.collect(); 
    289283                  this.paragraphes[xpath] = p; 
     
    355349  initCSS: function(){ 
    356350          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 +"}":""); 
    361351          if(CSS_HIGHLIGHT_LINK) css += "\n.gm_ldrize_link {" + CSS_HIGHLIGHT_LINK + "}"; 
    362352          if(CSS_HIGHLIGHT_PINNED) css += "\n.gm_ldrize_pinned {" + CSS_HIGHLIGHT_PINNED + "}"; 
     
    464454          return DEFAULT_HEIGHT + ((typeof h != 'undefined') ? Number(h) : this.scrollHeight); 
    465455  }, 
    466   useStripe: function(){return this.siteinfo_current['stripe'] || this.GLOBAL_STRIPE}, 
    467456  useSmoothScroll: function(){return eval(GM_getValue('smooth', 'true'))}, 
    468457  scrollTo: function(x, y){ 
     
    810799          this.xpath = arguments[0]; 
    811800          this.context = []; 
    812           this.stripe = false; 
    813801          this.current = { 
    814802                paragraph: null, 
     
    844832  }, 
    845833  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 
    858835  select: function(arg){this.selectNth(this.position(arg))}, 
    859836  selectNth: function(n){ 
     
    1012989Siteinfo.prototype = { 
    1013990  initialize: function(){ 
    1014           // ['name', 'domain', 'paragraph', 'link', 'view', 'stripe', 'height', 'focus', 'disable'] 
     991          // ['name', 'domain', 'paragraph', 'link', 'view', 'height', 'focus', 'disable'] 
    1015992          Object.extend(this, arguments[0]); 
    1016993  },