mirror of
https://github.com/Hopiu/ep_page_view.git
synced 2026-03-16 20:20:24 +00:00
allow url parameter
This commit is contained in:
parent
1226f5255e
commit
8cdbec2e65
2 changed files with 23 additions and 0 deletions
1
.ep_initialized
Normal file
1
.ep_initialized
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
done
|
||||||
|
|
@ -24,9 +24,31 @@ if (!isMobile) {
|
||||||
pv.disable();
|
pv.disable();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
/* from URL param */
|
||||||
|
var urlContainspageviewTrue = (getParam("pageview") == "true"); // if the url param is set
|
||||||
|
if(urlContainspageviewTrue){
|
||||||
|
$('#options-pageview').attr('checked','checked');
|
||||||
|
pv.enable();
|
||||||
|
}else if (getParam("pageview") == "false"){
|
||||||
|
$('#options-pageview').attr('checked',false);
|
||||||
|
pv.disable();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
exports.postAceInit = postAceInit;
|
exports.postAceInit = postAceInit;
|
||||||
} else {
|
} else {
|
||||||
$('input#options-pageview').hide();
|
$('input#options-pageview').hide();
|
||||||
$('label[for=options-pageview]').hide();
|
$('label[for=options-pageview]').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getParam(sname){
|
||||||
|
var params = location.search.substr(location.search.indexOf("?")+1);
|
||||||
|
var sval = "";
|
||||||
|
params = params.split("&");
|
||||||
|
// split param and value into individual pieces
|
||||||
|
for (var i=0; i<params.length; i++)
|
||||||
|
{
|
||||||
|
temp = params[i].split("=");
|
||||||
|
if ( [temp[0]] == sname ) { sval = temp[1]; }
|
||||||
|
}
|
||||||
|
return sval;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue