Advertisement
Awn_pastebin

画像をぼかす

Apr 24th, 2015
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //////////////////////////////////////////////////////////////////////
  2. //              ,,                                              
  3. //      db     *MM                                              
  4. //     ;MM:     MM                                              
  5. //    ,V^MM.    MM,dMMb.   ,pW"Wq.`7M'    ,A    `MF'`7MMpMMMb.  
  6. //   ,M  `MM    MM    `Mb 6W'   `Wb VA   ,VAA   ,V    MM    MM  
  7. //   AbmmmqMA   MM     M8 8M     M8  VA ,V  VA ,V     MM    MM  
  8. //  A'     VML  MM.   ,M9 YA.   ,A9   VVV    VVV      MM    MM  
  9. //.AMA.   .AMMA.P^YbmdP'   `Ybmd9'     W      W     .JMML  JMML.
  10. //////////////////////////////////////////////////////////////////////
  11.  
  12. //--------------------
  13. //content_scripts.js
  14. //--------------------
  15.  
  16.  
  17.  
  18. //=====================================//
  19. // DOM読み込み時に実行する関数群
  20.  
  21. //初期化
  22. init_storage();
  23.  
  24.  
  25. //Abown初回起動時以降実行される
  26. chrome.storage.local.get(
  27.     [
  28.     "kote_hard",
  29.     "kote_soft",
  30.     "gazo_hard",
  31.     "gazo_soft",
  32.     "ng_hard",
  33.     "th_hard",
  34.     "tw_hard",
  35.     "h_a_list",
  36.     "s_a_list",
  37.     "ng_word_list",
  38.     "ng_th_list",
  39.     "ng_tw_list"
  40.     ],function(items){
  41.  
  42.     //==================
  43.     // http://*.open2ch.net/*配下で実行
  44.  
  45.  
  46.         //変数退避
  47.         hard_abone_list = items.h_a_list;
  48.         soft_abone_list = items.s_a_list;
  49.         ng_word_listt = items.ng_word_list;
  50.         ng_th_listt = items.ng_th_list;
  51.         ng_tw_listt = items.ng_tw_list;
  52.  
  53.  
  54.         //ハードあぼーんのみ実行
  55.         if(items.kote_hard - items.kote_soft == 1){
  56.             if( hard_abone_list != [] ){
  57.                 console.log("exec hardAboner");
  58.                 hardAboner();
  59.             }
  60.         }
  61.  
  62.         //ソフトあぼーんのみ実行
  63.         if(items.kote_soft - items.kote_hard == 1){
  64.             if( soft_abone_list != [] ){
  65.                 console.log("exec softAboner");
  66.                 softAboner();
  67.             }
  68.         }
  69.  
  70.         //ハードあぼーんもソフトあぼーんも実行
  71.         if(items.kote_hard * items.kote_soft == 1){
  72.             if( hard_abone_list != [] ){
  73.                 console.log("exec hardAboner");
  74.                 hardAboner();
  75.             }
  76.  
  77.             if( soft_abone_list != [] ){
  78.                 console.log("exec softAboner");
  79.                 softAboner();
  80.             }
  81.  
  82.         }
  83.  
  84.         //画像のハードあぼーんを実行
  85.         if( items.gazo_hard == 1){
  86.             console.log("exec hardGazoAboner");
  87.             hardGazoAboner();
  88.         }
  89.  
  90.         //画像のソフトあぼーんを実行
  91.         if( items.gazo_soft == 1){
  92.             console.log("exec softGazoAboner");
  93.             softGazoAboner();              
  94.         }
  95.  
  96.         //NGワードのハードあぼーんを実行
  97.         if( items.ng_hard == 1){
  98.             if( ng_word_listt != [] ){
  99.                 console.log("exec hardNgAboner");
  100.                 hardNgAboner();                
  101.             }
  102.         }
  103.  
  104.         //NGスレタイのハードあぼーんを実行
  105.         if( items.th_hard == 1){
  106.             if( ng_th_listt != [] ){
  107.                 console.log("exec hardThAboner");
  108.                 hardThAboner();
  109.             }
  110.         }
  111.  
  112.         //NGTWIDのハードあぼーんを実行
  113.         if( items.tw_hard == 1){
  114.             if( ng_tw_listt != [] ){
  115.                 console.log("exec hardTwAboner");
  116.                 hardTwAboner();
  117.             }
  118.         }
  119.     }
  120. );
  121.  
  122.  
  123. //
  124. //
  125. //
  126. //=====================================//
  127.  
  128.  
  129. //=====================================//
  130. //
  131. // chrome.storage.localが書き換わった時に発火する関数(ページのリロードをするだけ)
  132. //
  133.  
  134. chrome.storage.onChanged.addListener(function(changes, namespace) {
  135.         location.reload(true);
  136.     }
  137. );
  138.  
  139. //
  140. //
  141. //=====================================//
  142.  
  143.  
  144.  
  145. //=====================================//
  146. //
  147. // 各種あぼーん関数
  148. //
  149.  
  150.  
  151. //関数:hardAboner
  152. //指定したコテの書き込みを非表示にする。
  153. function hardAboner(){
  154.     $.each(hard_abone_list,function(){
  155.         if( this != "" ){
  156.             var $temph = $("dl dt font:contains("+this+"),dl dt a:contains("+this+"):not('.id')");
  157.             $temph.html("<b>こてあぼーん</b>");
  158.             $temph.parent().next().css("visibility","hidden");
  159.             $temph.parent().next().children().css("visibility","hidden");
  160.         }
  161.     })
  162. };
  163.  
  164. //関数:softAboner
  165. //指定したコテの名前を「名無しさん@おーぷん」にする。
  166. function softAboner(){
  167.     $.each(soft_abone_list,function(){
  168.         if( this != "" ){
  169.             var $temps = $("dl dt font:contains("+this+"),dl dt a:contains("+this+"):not('.id')");
  170.             $temps.html("<b>名無しさん@おーぷん</b>");
  171.         }
  172.     })
  173. };
  174.  
  175. //関数:hardGazoAboner
  176. //画像を非表示にする
  177. function hardGazoAboner(){
  178.     var $hga = $(".thread img[src!='http://open2ch.net/image/twitter/twicon.png'] + .thread img[src!='http://open.open2ch.net/image/icon/bubble_dark.png']");
  179.     $hga.css("visibility","hidden");
  180.  
  181.     var $hpi = $(".mesg .pic");
  182.     $hpi.css("visibility","hidden");
  183.     $hpi.parent().parent().css("visibility","hidden");
  184.  
  185.     var $hpl = $("img.pic.lazy");
  186.     $hpl.css("visibility","hidden");
  187.     $hpl.parent().parent().css("visibility","hidden");
  188. };
  189.  
  190. //関数:softGazoAboner
  191. //画像を薄くする
  192. function softGazoAboner(){
  193.     var $sga = $(".thread img");
  194. //  $sga.css("opacity","0.3");
  195.     var $filterval = 'blur(3px)';//ぼかしフィルタblurのパラメータ。数字を大きくすればさらにぼかすことができる。
  196.     $sga.css('-webkit-filter',$filterval);
  197.  
  198.     var $spi = $(".mesg .pic");
  199.     $spi.css('-webkit-filter',$filterval);
  200.  
  201.     var $spl = $("img.pic.lazy");
  202.     $spl.css('-webkit-filter',$filterval);
  203.     $spl.parent().parent().css('-webkit-filter',$filterval);
  204.  
  205. };
  206.  
  207. //関数:hardNgAboner
  208. //NGワードを含むスレを非表示にする
  209. function hardNgAboner(){
  210.     $.each(ng_word_listt,function(){
  211.         if( this != "" ){
  212.             $(".thread dl dd:contains('"+this+"')").css("visibility","hidden");
  213.         }
  214.     });
  215. };
  216.  
  217. //関数:hardTwAboner
  218. //NGTWIDを含むスレを非表示にする
  219. function hardTwAboner(){
  220.     $.each(ng_tw_listt,function(){
  221.         if( this != ""){
  222.             $hta = $("dl dt a:contains('ID:tw"+this+"')");
  223.             $hta.html("ついったーあぼーん");
  224.             $hta.parent().parent().next().css("visibility","hidden");
  225.             $hta.parent().parent().next().children().css("visibility","hidden");
  226.             $hta.parent().prev().html("<b>ついったーあぼーん</b>");
  227.         }
  228.     });
  229. };
  230.  
  231.  
  232. //関数:hardThAboner
  233. //NGスレタイを非表示にする
  234. function hardThAboner(){
  235.     //subback.htmlの時
  236.     if( (location.href).indexOf("subback.html") > 0 ) {
  237.         $.each(ng_th_listt,function(){
  238.             if( this != "" ){
  239.                 //NGワードを含むスレタイを除外
  240.                 $("a:contains('"+this+"')").empty();               
  241.             }
  242.         });
  243.     };
  244. };
  245.  
  246.  
  247.  
  248. //
  249. //
  250. //=====================================//
  251.  
  252.  
  253.  
  254. //=====================================//
  255. //
  256. // 隠し機能
  257. //
  258.  
  259. // スレ一覧の操作を実行する
  260. if( (location.href).indexOf("subback.html") > 0 ){
  261.     kakusi1();
  262. }
  263.  
  264. //
  265. //
  266. //
  267. //=====================================//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement