Changeset 38245
- Timestamp:
- 08/10/10 22:55:20 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/twittperator/twlist-tab.tw
r38240 r38245 65 65 -moz-border-radius: 4px; 66 66 } 67 TwlistText,.twlist-text,chrome://browser/content/browser.xul 67 TwlistText,.twlist-text,chrome://browser/content/browser.xul margin: 2px 1em; 68 68 TwlistTextLabel,.twlist-text>label,chrome://browser/content/browser.xul margin: 1px 2px 2px 2px !important; 69 69 TwlistMetaInfo,.twlist-metainfo,chrome://browser/content/browser.xul … … 81 81 target = timelineBox; 82 82 let isRT = ("retweeted_status" in msg); 83 let text = formatText(isRT ? msg.retweeted_status.text : msg.text); 83 let domContent = formatText(isRT ? msg.retweeted_status.text : msg.text); 84 XML.ignoreWhitespace = true; 84 85 let xml = isRT ? 85 86 <richlistitem value={msg.id} xmlns={XUL} class="twlist-item-content twlist-item-rt"> … … 88 89 <spacer flex="1"/> 89 90 </vbox> 90 <spacer width="2"/> 91 <vbox flex="1"> 91 <vbox flex="1" class="twlist-content"> 92 92 <hbox> 93 93 <label value={"\u21BB"} class="twlist-rt-mark"/> … … 99 99 </hbox> 100 100 </hbox> 101 {text}102 101 </vbox> 103 102 </richlistitem> : 104 <richlistitem value={msg.id} xmlns={XUL} class="twlist-item-content">103 <richlistitem value={msg.id} searchlabel={msg.user.screen_name+"#"+msg.id} xmlns={XUL} class="twlist-item-content"> 105 104 <vbox> 106 105 <image src={msg.user.profile_image_url} width="32" height="32"/> 107 106 <spacer flex="1"/> 108 107 </vbox> 109 <spacer width="2"/> 110 <vbox flex="1"> 108 <vbox flex="1" class="twlist-content"> 111 109 <hbox> 112 110 <label class="twlist-screenname">{msg.user.screen_name}</label> … … 116 114 </hbox> 117 115 </hbox> 118 {text}119 116 </vbox> 120 117 </richlistitem>; 121 118 let dom = xmlToDom(xml, XUL); 119 dom.querySelector(".twlist-content").appendChild(domContent); 122 120 target.insertBefore(dom, target.firstChild); 123 121 if (target.getRowCount() > 50) { … … 146 144 "boolean", true, { 147 145 setter: function (value) { 148 document.getElementById(ID_SPLITTER)149 .setAttribute("state", value ? "open" : "collapsed");146 let elm = document.getElementById(ID_SPLITTER); 147 elm.setAttribute("state", value ? "open" : "collapsed"); 150 148 return value; 151 149 }, … … 187 185 str = str.trim(); 188 186 let reg = /https?:\/\/[^\s]+|[#@]\w+/g; 189 let m, i = 0, buf = "", x = <description class="twlist-text" xmlns={XUL}/>; 187 XML.ignoreWhitespace = false; 188 let m, i = 0, buf = "", x = <xhtml:p class="twlist-text" xmlns:xhtml={XHTML}/>; 190 189 while((m=reg.exec(str))){ 191 buf = str.substring(i, m.index) .trim();190 buf = str.substring(i, m.index); 192 191 if (buf) 193 x.appendChild( <label>{buf}</label>);192 x.appendChild(buf); 194 193 let class = "twlist-link", href = ""; 195 194 switch (m[0].charAt(0)){ … … 206 205 href = m[0]; 207 206 } 208 x.appendChild(< labelclass={class} href={href}209 onclick={contextPath + ".onClick(event)"} >{m[0]}</label>);207 x.appendChild(<xhtml:a class={class} href={href} 208 onclick={contextPath + ".onClick(event)"} xmlns:xhtml={XHTML}>{m[0]}</xhtml:a>); 210 209 i=reg.lastIndex; 211 210 } 212 buf = str.substr(i) .trim();211 buf = str.substr(i); 213 212 if (buf) 214 x.appendChild( <label>{buf}</label>);215 return x ;213 x.appendChild(buf); 214 return xmlToDom(x, "http://www.w3.org/1999/xhtml"); 216 215 } 217 216 function onClick (evt) {
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)