- Timestamp:
- 04/26/09 02:10:09 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/userscripts/hatena/hatena_haiku_hidden_invalid_entries.user.js
r32808 r32809 36 36 // * '[[username]]NGWORD' で,本文に『NGWORD』を含む id:username のエントリが非表示になります 37 37 var hidden_words = [ 38 '死にたい' // 本文に『死にたい』を含むエントリを非表示 39 ,'[[baduser]]うんこ!' // 本文に『うんこ!』を含む id:baduser のエントリを非表示 40 ,'[[baduser]].png' // 本文に『.png』を含む id:baduser のエントリを非表示 38 '死にたい' // 本文に『死にたい』を含むエントリを非表示 39 ,'[[baduser]].png' // 本文に『.png』を含む id:baduser のエントリを非表示 40 ,'[[baduser]].png|.jpg' // 本文に『.png or .jpg』を含む id:baduser のエントリを非表示 41 ,'[[baduser]]!.png' // 本文に『.png』を含まない id:baduser のエントリを非表示 42 ,'[[baduser]]!.png|.jpg' // 本文に『.png or .jpg』を含まない id:baduser のエントリを非表示 41 43 ] 42 44 … … 199 201 this.REGEX = { 200 202 album_pathname: new RegExp('^(?:/keyword/[^\/]*?mode=)?/?album$'), 201 ng_word : new RegExp('^(?:\\[\\[([a-zA-Z][a-zA-Z0-9_-]{1,30}[a-zA-Z0-9])\\]\\])?( .*)$')203 ng_word : new RegExp('^(?:\\[\\[([a-zA-Z][a-zA-Z0-9_-]{1,30}[a-zA-Z0-9])\\]\\])?(!)?(.*)$') 202 204 } 203 205 … … 292 294 return this.ng_words.some(function(word){ 293 295 if(word.id && word.id != entry.id) return false 294 if(entry.body.indexOf(word.word) == -1) return false 296 297 var res = word.words.some(function(w){ 298 return entry.body.indexOf(w) > -1 299 }) 300 if(word.not && res) return false 301 if(!word.not && !res) return false 295 302 296 303 return true … … 431 438 432 439 this.ng_words = this.ng_words.map(function(word){ 433 var array = word.match(this.REGEX.ng_word); array.shift() 434 return {id: array[0], word: array[1]} 440 word.match(this.REGEX.ng_word) 441 var not = (RegExp.$2 == '!') ? true : false 442 return {id: RegExp.$1, not: not, words: RegExp.$3.split('|')} 435 443 }.bind(this)) 436 444
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)