I would like someone to help me how to grab all accurences of window.addEvent function inside a file.js file, to simplify suppose that the content of that file is inside a variable $string. Here is the content of file.js and i have commented what i want to grab which is :
window.addEvent('domready', function() {
SqueezeBox.initialize({});
SqueezeBox.assign($$('a.modal'), {
parse: 'rel'
});
});
Code: Select all
jQuery(document).ready(function($){
var $thecontrolBox = $("#o-control-box");
$("#o-control-box").css({left: parseInt(0 - $thecontrolBox.outerWidth())});
$("#o-control-handle").click(function() {
$thecontrolBox.animate({
left: parseInt($thecontrolBox.css("left"), 10) == 0 ? -$thecontrolBox.outerWidth() : 0
}, 1000, function(){});
});
});
jQuery(document).ready(function() {
jQuery('.hasTooltip').tooltip({});
});
jQuery(document).ready(function($) {
$("#otmenu-desk-wrapper94 ul.ot-dropdown").otmenu({
direction: 'ltr',
animation: {opacity:"show",height:"show"},
speed: 'normal'
});
});
// I want to grab this code from here
window.addEvent('domready', function() {
SqueezeBox.initialize({});
SqueezeBox.assign($$('a.modal'), {
parse: 'rel'
});
});
// to here
jQuery(document).ready(function($) {
$("ul.ot-sliding94").otslmenu({
speed: 'normal',
openedHandlerClass: 'icon-minus-sign',
closedHandlerClass: 'icon-plus-sign'
});
});
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
(function() {
window.___gcfg = {lang: 'en'}; // Define button default language here
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();