Changeset 26163 for lang/javascript/vimperator-plugins/trunk/notifier
- Timestamp:
- 12/09/08 10:54:43 (4 years ago)
- Location:
- lang/javascript/vimperator-plugins/trunk/notifier
- Files:
-
- 2 modified
-
observer_growl.js (modified) (3 diffs)
-
subject_hatelabo_bottle.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/notifier/observer_growl.js
r26152 r26163 24 24 var Growl = function() {//{{{ 25 25 this.initialize.apply(this, arguments); 26 } 26 }; 27 27 Growl.prototype = { 28 28 defaults: { … … 42 42 }, 43 43 44 } //}}}44 };//}}} 45 45 46 46 notifier.observer.register(notifier.Observer, { … … 52 52 $U.readDirectory(path, '^growl', function(f) { 53 53 try { 54 io.source(f.path, true) 54 io.source(f.path, true); 55 55 logger.log('load success: ' + f.leafName); 56 56 } catch (e) { -
lang/javascript/vimperator-plugins/trunk/notifier/subject_hatelabo_bottle.js
r26154 r26163 6 6 <description lang="ja">はてなボトルの変更通知。</description> 7 7 <author mail="suvene@zeromemory.info" homepage="http://zeromemory.sblo.jp/">suVene</author> 8 <version>0.1. 0</version>8 <version>0.1.1</version> 9 9 <minVersion>2.0pre</minVersion> 10 10 <maxVersion>2.0pre</maxVersion> 11 <detail><![CDATA[ 12 ]]></detail> 11 <detail/> 13 12 </VimperatorPlugin>; 14 13 //}}} … … 33 32 }, 34 33 parse: function(res) { 34 if (!res.isSuccess() || res.responseText == '') return; 35 35 36 var ret, dom; 36 var dom = res.getHTMLDocument('id("body")//div[contains(concat(" ", @class, " "), " entry ")]'); 37 if (!dom) return; 37 38 38 if (!res.isSuccess() || res.responseText == '') return ret; 39 40 dom = res.getHTMLDocument('id("body")//div[contains(concat(" ", @class, " "), " entry ")]'); 41 if (!dom) return ret; 42 43 ret = []; 44 for (let i = 0, len = dom.childNodes.length; i < len; i++) { 45 ret.push(dom.childNodes[i]); 46 } 47 39 var ret = []; 40 for (let i = 0, len = dom.childNodes.length; i < len; ret.push(dom.childNodes[i++])); 48 41 return ret; 49 42 }, 50 diff: function(cache, parsed) { 51 var ret = []; 52 parsed.forEach(function(element) { 53 if (!cache.some(function(c) { if (c.textContent == element.textContent) return true })) 54 ret.push(element); 55 }); 56 return ret; 57 }, 58 buildMessages: function(diff) { 59 var ret = []; 60 diff.forEach(function(d) { 61 ret.push( 62 new notifier.Message('Hatelab bottle', $U.xmlSerialize(d), { 63 growl: { 64 life: 7000 65 } 66 }) 67 ); 68 }); 69 return ret; 70 } 43 diff: function(cache, parsed) 44 parsed.filter(function(element) 45 !cache.some(function(c) c.textContent == element.textContent)), 46 buildMessages: function(diff) 47 diff.map(function(d) 48 new notifier.Message('Hatelab bottle', $U.xmlSerialize(d), { 49 growl: { life: 7000 } 50 })) 71 51 }); 72 52
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)