
Kegunaan dan Fungsi Tool Parser ?
Tool Parser merupakan tool yang sering digunakan untuk merubah beberapa kode tertentu agar bisa digunkan dan befungsi semestinya.
Kode yang dirubah Seperti :
- & menjadi &
- < menjadi <
- > menjadi >
- " menjadi "
- ' menjadi '
Nah dibawah sudah disediakan tool dan source code nya, jadi kalian bisa gunakan dan terapkan di web kalian.
- Results
- Code
.parser #codes{font:13px 'Courier New',Monospace;width:100%;height:250px;margin:0 auto;display:block;background-color:#f6f8f9;padding:15px;border-radius:8px;border:1px solid #dee0e1;outline:none}
.parser ul#wrapin label{cursor:pointer}
.parser .button-group{margin:10px;text-align:center}
.parser button,button[disabled]:active{border:none;padding:5px 12px;color:#fff;cursor:pointer;font-size:13px;margin:0 10px;line-height:23px;border-radius:4px;transition:all 0.3s ease-in-out}
.parser button:active{background:#3f92e1}
.parser button[disabled],button[disabled]:active{background:#3f92e1}
.parser #opt1,#opt2,#opt3,#opt4,#opt5{display:inline-block;margin-right:10px;font-size:13px}
<div class="parser">
<textarea id="codes" placeholder="Paste kodenya di sini, kemudian klik 'Parse Kode'. Jika ingin parse kode baru, klik dulu 'Hapus Kode'" spellcheck="false" style="resize:none"></textarea>
<div class="button-group">
<button class="bg-grad" id="convert" onclick="cdConvert();this.disabled = true;">Parse Kode</button>
<button class="bg-grad" onclick="cdClear();">Hapus Kode</button>
</div>
<ul id="wrapin">
<li>
<input checked="true" id="opt1" type="checkbox">
<label for="opt1">Konversi <code>&</code> menjadi <code>&amp;</code></label>
</li>
<li>
<input checked="true" id="opt2" type="checkbox">
<label for="opt2">Konversi <code><</code> menjadi <code>&lt;</code></label>
</li>
<li>
<input checked="true" id="opt3" type="checkbox">
<label for="opt3">Konversi <code>></code> menjadi <code>&gt;</code></label>
</li>
<li>
<input id="opt4" type="checkbox">
<label for="opt4">Konversi <code>"</code> menjadi <code>&quot;</code></label>
</li>
<li>
<input id="opt5" type="checkbox">
<label for="opt5">Konversi <code>'</code> menjadi <code>&#039;</code></label>
</li>
</ul>
</div>
function cdClear() {
var wtarea = document.getElementById('codes');
wtarea.value = '';
wtarea.focus();
document.getElementById('convert').disabled = false;
}
function cdConvert() {
var ctarea = document.getElementById('codes'),
cv = ctarea.value,
opt1 = document.getElementById('opt1'),
opt2 = document.getElementById('opt2'),
opt3 = document.getElementById('opt3'),
opt4 = document.getElementById('opt4'),
opt5 = document.getElementById('opt5');
cv = cv.replace(/\t/g, " ");
if (opt1.checked) cv = cv.replace(/&/g, "&");
if (opt2.checked) cv = cv.replace(//g, ">");
if (opt4.checked) cv = cv.replace(/"/g, """);
if (opt5.checked) cv = cv.replace(/'/g, "'");
ctarea.value = cv;
ctarea.focus();
ctarea.select();
};
Komentar
Untuk Tutorial Pemasangan License bisa gunakan <i rel='Tutor1'>Tutor</i>
Untuk Cek Member bisa gunakan <i rel='CekMember'>Cek Member</i>
Untuk Menyisipkan Gambar bisa gunakan <i rel='img'>URL_IMAGE</i>
Untuk Menyisipkan Video/Iframe bisa gunakan <i rel='video'>URL_video</i>
Untuk Menyisipkan syntax highlighter bisa gunakan <i rel='kode'>Kode yang sudah di parse</i>