JSFiddle - React, Tailwind, and code Playground
by Hidayat Rifan
JavaScript
$("div.post-body").children("code").each(function () {
$(this).replaceWith(function () {
return $("<a class='allow' target='_blank' href='http://ngudang.blogspot.com/p/search-result.html?cx=partner-pub-003360299975265676587%3Apk_wu78zcew&cof=FORID%3A10&ie=ISO-8859-1&q=" + encodeURIComponent($(this).text()) + "'><code>" + $(this).html() + "</code></a>")
})
});
$(document).ready(function () {
$('div.tombol-group').each(function () {
var get_position = $(this);
var get_id = get_position.attr('id');
var dataRef = new Firebase('https://penghitung-gue.firebaseio.com/downloads/id/' + get_id);
dataRef.on('value', function (snapshot) {
var data = snapshot.val();
if (data == null) {
data = 0;
dataRef.set(data)
}
get_position.find('span').removeClass('loadinge').html(data)
});
get_position.children('a').click(function () {
var data_w = parseInt($(this).siblings('div.counter-text').children('span').text());
data_w++;
dataRef.set(data_w)
})
})
});
$(function () {
$('.toggle-search').toggle(function () {
$(this).addClass('active');
$('.search-expand').slideDown()
}, function () {
$(this).removeClass('active');
$('.search-expand').slideUp()
})
});
$(function () {
$('.sidebar-toggle').toggle(function () {
$(this).addClass('active');
$('#outer-wrapper').css('margin-left', 0);
$('#outer-wrapper').css('margin-right', -250)
}, function () {
$(this).removeClass('active');
$('#outer-wrapper').css('margin-left', -250);
$('#outer-wrapper').css('margin-right', 0)
})
});
$(".comment_body p").find("a:not(.allow)").each(function (c) {
c = $($(this).parent()).html();
txtContents = c.replace(/<br>/ig, "\n").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/<pre...