Media Literacy: Difference between revisions

Jump to navigation Jump to search
1,501 bytes added ,  9 June 2018
Line 28: Line 28:
* 使用: 閱讀新聞時,點選這個書籤,即可標示「據透露」等文字
* 使用: 閱讀新聞時,點選這個書籤,即可標示「據透露」等文字


修改自 [http://dpatrickcaldwell.blogspot.com/2010/09/regular-expression-search-bookmarklet.html D. Patrick Caldwell on Software Engineering: Regular Expression Search Bookmarklet] 版本
<pre>
if(void 0===searches)var searches=0;!function(){var e,t,r=0;if(0!=(e="(據透露|據了解|據指出|消息來源指出|知情人士透露|消息人士指示|內情人士指出|內情人士表示|消息人士表示|消息人士指出|有人說|謠傳|疑似|好像|認為|公認)([^。]*?)(。)").length){try{t=new RegExp(e,"i")}catch(t){return void alert("Unable to create regular expression using text '"+e+"'.\n\n"+t)}var a="#"+(searches+8).toString(2).substr(-3).replace(/0/g,"3").replace(/1/g,"6"),o=a.replace(/3/g,"c").replace(/6/g,"f");if(searches%16/8>=1){var s=a;a=o,o=s}!function e(t,s){var l,c,n,d,i;if(c=0,3==t.nodeType)(l=t.data.search(s))>=0&&((n=document.createElement("ACRONYM")).title="Search "+(searches+1)+": "+s.toString(),n.style.backgroundColor=o,n.style.borderTop="1px solid "+a,n.style.borderBottom="1px solid "+a,n.style.fontWeight="bold",n.style.color=a,(d=t.splitText(l)).splitText(RegExp.lastMatch.length),i=d.cloneNode(!0),n.appendChild(i),d.parentNode.replaceChild(n,d),r++,c=1);else if(1==t.nodeType&&t.childNodes&&"SCRIPT"!=t.tagName.toUpperCase()&&"STYLE"!=t.tagName.toUpperCase)for(var p=0;p<t.childNodes.length;++p)p+=e(t.childNodes[p],s);return c}(document.body,t),window.status="Found "+r+" match"+(1==r?"":"es")+" for "+t+".",r>0&&searches++}}();
</pre>
Kej 版本
<pre>
<pre>
javascript: (function(){var b=document.getElementsByTagName("body");var t=b[0].innerHTML;var pattern = /(據透露|據了解|據指出|消息來源指出|知情人士透露|消息人士指示|有人說|謠傳|疑似|好像|認為|公認)([^。]*?)(。)/img;b[0].innerHTML=t.replace (pattern,"<span style=\"border:1px dashed #F7D800;background:#FBF7AA\">$1$2$3</span>");})();
javascript: (function(){var b=document.getElementsByTagName("body");var t=b[0].innerHTML;var pattern = /(據透露|據了解|據指出|消息來源指出|知情人士透露|消息人士指示|有人說|謠傳|疑似|好像|認為|公認)([^。]*?)(。)/img;b[0].innerHTML=t.replace (pattern,"<span style=\"border:1px dashed #F7D800;background:#FBF7AA\">$1$2$3</span>");})();

Navigation menu