Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cmt [2013/05/08 14:43]
awf
cmt [2015/01/28 23:16] (current)
awf
Line 1: Line 1:
 Notes on CMT Notes on CMT
 +
 +Niceify reviews:
 +
 +<​code>​
 +var jq = document.createElement('​script'​);​
 +jq.src = "​https://​ajax.googleapis.com/​ajax/​libs/​jquery/​1/​jquery.min.js";​
 +document.getElementsByTagName('​head'​)[0].appendChild(jq);​
 +// ... give time for script to load, then type.
 +
 +
 +var rows = $("#​ctl00_cph_pnlReviews>​div>​table>​tbody>​tr"​)
 +
 +var elt = '';​ for(i=1; i < rows.length;​ ++i) { elt += '<​p/><​b style="​font-size:​ small;">'​ + rows[i].children[0].innerHTML + '</​b><​p>'​ + rows[i].children[1].innerHTML + '</​p>'​ }
 +
 +$(elt).insertBefore($("#​ctl00_cph_pnlReviews"​))
 +</​code>​
 +
  
 Link to translate URLs to links. ​ Navigate to a page with URLs in it, then execute this in your browser'​s debug console. Link to translate URLs to links. ​ Navigate to a page with URLs in it, then execute this in your browser'​s debug console.
Line 11: Line 28:
       text = n[i].nextSibling;​       text = n[i].nextSibling;​
       url = text.wholeText.replace(/​\s+/,''​);​       url = text.wholeText.replace(/​\s+/,''​);​
-      ​nn = document.createElement('​div'​);​ +      ​n[i].innerHTML = '<​b>​URL</​b>​ (<'​+'​a target="​_blank"​ href="'​ + url + '">​link<'​+'/​a>​):';​
-      nn.innerHTML = '<​b>​URL</​b>​ (<'​+'​a target="​_blank"​ href="'​ + url + '">​link<'​+'/​a>​):'​+
-      n[i].replaceNode(nn);+
     }     }
   }   }
 } }
 replace_urls()</​code>​ replace_urls()</​code>​
 +And this one zaps the links too
 +<​code>​
 +  n = document.getElementsByTagName('​b'​);​
 +  for(i = 0; i < n.length; ++i) {
 +    if (n[i].innerText.match('​URL:'​)) {
 +      text = n[i].nextSibling;​
 +      url = text.wholeText.replace(/​\s+/,''​);​
 +      n[i].innerHTML = 'URL (<'​+'​a target="​_blank"​ href="'​ + url + '">​link<'​+'/​a>​):';​
 +      n[i].nextSibling.replaceNode(document.createElement('​div'​));​
 +    }
 +  }
 +</​code>​
 <​html>​ <​html>​
 <​script>​ <​script>​