Berhubung masih hari raya idul fitri saya selaku admin blog ini mengucapkan minal aidin walfaizin mohon maaf lahir dan batin :).

Postingan awal lebaran saya buat yang agak simpel bahkan sangat simpel yaitu Auto Block Pada Tag Code biasanya setiap kode diselubungi oleh tag pre namun untuk setiap kode pendek biasanya cukup ditandai dengan <code>...script...</code>.


Pemasangan Auto Block Tag Code pada blog:
Masuk ke edit template kemudian tambahkan CSS dan letakkan diatas kode ]]></b:skin>

CSS
Css disini meliputi: font, background, border dll dan dapat divariasi sesuka hati
code {
  font:normal 12px/14px Monaco,Monospace;
  background:rgba(255,255,255,.4);;
  border:1px solid #eee;
  padding:1px;
  cursor:default;
  border-radius:2px;
  -moz-border-radius:2px;
  -webkit-border-radius:2px;
}

Javascript
Letakkan script dibawah ini diatas kode </head>
<script type='text/javascript'>
$(function() {
    $('code').click(function() {
        var refNode = $(this)[0];
        if($.browser.msie) {
            var range = document.body.createTextRange();
            range.moveToElementText(refNode);
            range.select();
        } else if($.browser.mozilla || $.browser.opera) {
            var selection = window.getSelection();
            var range = document.createRange();
            range.selectNodeContents(refNode);
            selection.removeAllRanges();
            selection.addRange(range);
        } else if($.browser.safari) {
            var selection = window.getSelection();
            selection.setBaseAndExtent(refNode, 0, refNode, 1);
        }
    });
});
</script>
Kemudian Simpan.

Penerapan pada posting
Tambahkan pada setiap kode pendek yang akan di block dengan script <code>...isi...</code>

Tutorial ini hanya untuk newbe semata jika ada mastah yang kurang berkenan mohon maaf, karena saya disini masih belajar :D

Sumber refrensi: Taufik Nurrahman

Labels: ,

19 Komentar:

Blogger Beben Koben said on August 21, 2012 at 2:11 PM 

muridnya master Taufiq nih...xixixixi

Blogger Muhammad Irham said on August 21, 2012 at 6:29 PM 

@Beben Koben hehe ya gan, maklum masih nubi

Blogger Muhammad Khoirul Umam said on August 23, 2012 at 12:14 AM 

Mangstab jg nih. . .

OpenID sip-online said on August 23, 2012 at 6:43 PM 

Kunjungan perdana... :)Mantap2 postingannya...

Anonymous sakit tenggorokan said on February 25, 2013 at 3:32 PM 

terimakasih banyak, ini yang saya cari

Anonymous pasca stroke said on February 25, 2013 at 3:35 PM 

langsung saja ijin TKP

Anonymous cara jadi agen said on February 25, 2013 at 3:37 PM 

selamat sore n salam kenal

Anonymous cara mengobati sinusitis said on February 25, 2013 at 3:39 PM 

salam kenal, ane newbe

Anonymous jelly gamat said on February 25, 2013 at 3:41 PM 

nice to post

Anonymous ace maxs said on February 25, 2013 at 3:44 PM 

langsung mau ke tkp saja ni sob

Anonymous murah said on February 25, 2013 at 3:45 PM 

nice to blog

Anonymous jantung bengkak said on February 25, 2013 at 3:47 PM 

selamat istirahat

Anonymous kanker paru paru said on February 25, 2013 at 3:48 PM 

solusi bila terkena kanker paru paru

Anonymous jus said on February 25, 2013 at 3:49 PM 

khasiat dari jus multikhasiat

Anonymous Cirebon-Cyber4rt said on July 4, 2013 at 12:41 PM 

manteeb gan :D

Anonymous KOLOM BERITA said on August 3, 2013 at 6:00 AM 

Ijin nyimak deh

Anonymous Web Developers Delhi said on January 5, 2015 at 3:57 PM 

This is the precise weblog for anybody who needs to seek out out about this topic. You notice so much its almost arduous to argue with you. You positively put a brand new spin on a subject that's been written about for years. Nice stuff, simply nice!

Blogger Dhiya L said on June 1, 2016 at 4:37 PM 

Wow amazing i saw the article with execution models you had posted. It was such informative. Really its a wonderful article. Thank you for sharing and please keep update like this type of article because i want to learn more relevant to this topic.

Java Training in Chennai

Blogger Rekhila said on July 29, 2016 at 6:39 PM 

This is really a very good article. Thanks for taking the time to discuss with us, I feel happy about learning this topic. keep sharing your information regularly for my future reference.
Branding Services in Chennai

Post a Comment

© 2012 - Koderator | Desain Oleh kimzigr| Classic Themplate Html5 & Css3 | Mesin Blogger