';
iframe.width = '100%';
iframe.height = $(window).height() - $('nav').height();
iframe.scrolling = 'auto';
iframe.style = 'width:100%; height:926px';
iframe.src = service.url;
iframe.contentWindow.document.open();
iframe.contentWindow.document.write(html);
iframe.contentWindow.document.close();
}
});
});
},
common: function(){
var tabs = $('.cd-tabs');
tabs.each(function(){
var tab = $(this),
tabItems = tab.find('ul.cd-tabs-navigation'),
tabContentWrapper = tab.children('ul.cd-tabs-content'),
tabNavigation = tab.find('nav');
tabItems.on('click', 'a', function(event){
event.preventDefault();
var selectedItem = $(this);
if(!selectedItem.hasClass('selected')) {
var selectedTab = selectedItem.data('content'),
selectedContent = tabContentWrapper.find('li[data-content="'+selectedTab+'"]'),
slectedContentHeight = selectedContent.innerHeight();
selectedItem.dblclick(function() {
selectedContent.children('iframe').attr('src', selectedContent.children('iframe').attr('src'));
});
tabItems.find('a.selected').removeClass('selected');
selectedItem.addClass('selected');
selectedContent.addClass('selected').siblings('li').removeClass('selected');
//animate tabContentWrapper height when content changes
tabContentWrapper.animate({
'height': slectedContentHeight
}, 200);
}
});
//hide the .cd-tabs::after element when tabbed navigation has scrolled to the end (mobile version)
checkScrolling(tabNavigation);
tabNavigation.on('scroll', function(){
checkScrolling($(this));
});
});
$(window).on('resize', function(){
tabs.each(function(){
var tab = $(this);
checkScrolling(tab.find('nav'));
tab.find('.cd-tabs-content').css('height', 'auto');
});
resizeIframe(); // Resize iframes when window is resized.
});
function checkScrolling(tabs){
var totalTabWidth = parseInt(tabs.children('.cd-tabs-navigation').width()),
tabsViewport = parseInt(tabs.width());
if( tabs.scrollLeft() >= totalTabWidth - tabsViewport) {
tabs.parent('.cd-tabs').addClass('is-ended');
} else {
tabs.parent('.cd-tabs').removeClass('is-ended');
}
}
}
}
};
var UTIL = {
exec: function(controller, action) {
var ns = MANAGETHIS;
action = (action === undefined) ? "init" : action;
if (controller !== "" && ns[controller] && typeof ns[controller][action] === "function") {
ns[controller][action]();
}
},
init: function() {
var body = document.body,
controller = body.getAttribute("data-controller"),
action = body.getAttribute("data-action");
UTIL.exec("common");
UTIL.exec(controller);
UTIL.exec(controller, action);
}
};
if (navigator.userAgent.indexOf('PhantomJS') === -1) {
$(document).ready(UTIL.init);
}
================================================
FILE: package.json
================================================
{
"name": "sickrage",
"version": "4.0.72",
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/SickRage/SickRage.git"
},
"bugs": {
"url": "https://github.com/SickRage/SickRage/issues"
},
"homepage": "https://github.com/SickRage/SickRage#readme",
"scripts": {
"test": "grunt travis",
"security": "snyk test"
},
"devDependencies": {
"chai": "^3.4.1",
"grunt": "^0.4.5",
"grunt-bower-concat": "^0.6.0",
"grunt-bower-task": "^0.4.0",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "^0.7.0",
"grunt-contrib-copy": "^0.8.2",
"grunt-contrib-cssmin": "^0.14.0",
"grunt-contrib-jshint": "^0.11.3",
"grunt-contrib-sass": "^0.9.2",
"grunt-contrib-uglify": "^0.11.0",
"grunt-mocha": "^0.4.15",
"grunt-sass": "^1.1.0",
"load-grunt-tasks": "^3.4.0",
"mocha": "^2.3.4",
"snyk": "^1.6.1"
}
}