function parseINIString(data){
var regex = {
section: /^\s*\[\s*([^\]]*)\s*\]\s*$/,
param: /^\s*([^=]+?)\s*=\s*(.*?)\s*$/,
comment: /^\s*;.*$/
};
var value = {};
var lines = data.split(/[\r\n]+/);
var section = null;
lines.forEach(function(line){
if(regex.comment.test(line)){
return;
}else if(regex.param.test(line)){
var match = line.match(regex.param);
if(section){
value[section][match[1]] = match[2];
}else{
value[match[1]] = match[2];
}
}else if(regex.section.test(line)){
var match = line.match(regex.section);
value[match[1]] = {};
section = match[1];
}else if(line.length == 0 && section){
section = null;
};
});
return value;
}
<input type="radio" name="item" checked={ checked } id="radio" />
jQuery(document).ready(function($) {
$('body').on('click', '.bars', function (e) {
e.preventDefault();
if ( $(this).hasClass('on') ) {
pauseAudio();
} else {
playAudio();
}
$('.bars').toggleClass('off');
$('.bars').toggleClass('on');
});
});
var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;
function jsddm_open() {
jsddm_canceltimer();
jsddm_close();
ddmenuitem = $(this).children('.i-sub-menu').stop(true, true).slideDown(300);
//.css('visibility', 'visible');
}
function jsddm_close() {
if (ddmenuitem) ddmenuitem.stop(true, true).slideUp(300);
//.css('visibility', 'hidden');
}
function jsddm_timer() {
closetimer = window.setTimeout(jsddm_close, timeout);
}
function jsddm_canceltimer() {
if (closetimer) {
window.clearTimeout(closetimer);
closetimer = null;
}
}
function autoplay() {
var active = $('.slider .nav span.on'),
index = parseInt(active.attr('rel')),
maxIndex = $('.slider .nav span').length - 1,
nextIndex = index+1;
if ( nextIndex > maxIndex ) nextIndex = 0;
$('.slider .nav span[rel="'+nextIndex+'"]').click();
}
/(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/ig
@([\p{Cyrillic}\p{Latin}\d\.-]{1,64})?\.(?:\x{0440}\x{0444}|ru|su|arpa|info|aero|name|[a-z]{3})@/igu