Changeset 38245

Show
Ignore:
Timestamp:
08/10/10 22:55:20 (3 years ago)
Author:
teramako
Message:

ツイート内容はXHTMLに変更

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/vimperator-plugins/trunk/twittperator/twlist-tab.tw

    r38240 r38245  
    6565      -moz-border-radius: 4px; 
    6666    } 
    67     TwlistText,.twlist-text,chrome://browser/content/browser.xul 
     67    TwlistText,.twlist-text,chrome://browser/content/browser.xul              margin: 2px 1em; 
    6868    TwlistTextLabel,.twlist-text>label,chrome://browser/content/browser.xul   margin: 1px 2px 2px 2px !important; 
    6969    TwlistMetaInfo,.twlist-metainfo,chrome://browser/content/browser.xul 
     
    8181    target = timelineBox; 
    8282  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; 
    8485  let xml = isRT ? 
    8586  <richlistitem value={msg.id} xmlns={XUL} class="twlist-item-content twlist-item-rt"> 
     
    8889      <spacer flex="1"/> 
    8990    </vbox> 
    90     <spacer width="2"/> 
    91     <vbox flex="1"> 
     91    <vbox flex="1" class="twlist-content"> 
    9292      <hbox> 
    9393        <label value={"\u21BB"} class="twlist-rt-mark"/> 
     
    9999        </hbox> 
    100100      </hbox> 
    101       {text} 
    102101    </vbox> 
    103102  </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"> 
    105104    <vbox> 
    106105      <image src={msg.user.profile_image_url} width="32" height="32"/> 
    107106      <spacer flex="1"/> 
    108107    </vbox> 
    109     <spacer width="2"/> 
    110     <vbox flex="1"> 
     108    <vbox flex="1" class="twlist-content"> 
    111109      <hbox> 
    112110        <label class="twlist-screenname">{msg.user.screen_name}</label> 
     
    116114        </hbox> 
    117115      </hbox> 
    118       {text} 
    119116    </vbox> 
    120117  </richlistitem>; 
    121118  let dom = xmlToDom(xml, XUL); 
     119  dom.querySelector(".twlist-content").appendChild(domContent); 
    122120  target.insertBefore(dom, target.firstChild); 
    123121  if (target.getRowCount() > 50) { 
     
    146144    "boolean", true, { 
    147145      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"); 
    150148        return value; 
    151149      }, 
     
    187185  str = str.trim(); 
    188186  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}/>; 
    190189  while((m=reg.exec(str))){ 
    191     buf = str.substring(i, m.index).trim(); 
     190    buf = str.substring(i, m.index); 
    192191    if (buf) 
    193       x.appendChild(<label>{buf}</label>); 
     192      x.appendChild(buf); 
    194193    let class = "twlist-link", href = ""; 
    195194    switch (m[0].charAt(0)){ 
     
    206205        href = m[0]; 
    207206    } 
    208     x.appendChild(<label class={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>); 
    210209    i=reg.lastIndex; 
    211210  } 
    212   buf = str.substr(i).trim(); 
     211  buf = str.substr(i); 
    213212  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"); 
    216215} 
    217216function onClick (evt) {