author | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2013-04-21 15:53:34 (UTC) |
---|---|---|
committer | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2013-04-21 15:53:34 (UTC) |
commit | 0608e045f6aa471916829468f48082ea07a453f4 (patch) (side-by-side diff) | |
tree | 57748b9a76e592ae35b165cd6a203e12493d4044 /frontend/gamma/js/JQTouch/extensions/jqt.themeswitcher.js | |
parent | 074e70457c90344b3c1cb236105638d692a0066b (diff) | |
download | clipperz-0608e045f6aa471916829468f48082ea07a453f4.zip clipperz-0608e045f6aa471916829468f48082ea07a453f4.tar.gz clipperz-0608e045f6aa471916829468f48082ea07a453f4.tar.bz2 |
Removed extra JS libraries no longer used for the mobile version
Diffstat (limited to 'frontend/gamma/js/JQTouch/extensions/jqt.themeswitcher.js') (more/less context) (show whitespace changes)
-rwxr-xr-x | frontend/gamma/js/JQTouch/extensions/jqt.themeswitcher.js | 123 |
1 files changed, 0 insertions, 123 deletions
diff --git a/frontend/gamma/js/JQTouch/extensions/jqt.themeswitcher.js b/frontend/gamma/js/JQTouch/extensions/jqt.themeswitcher.js deleted file mode 100755 index ef3a75d..0000000 --- a/frontend/gamma/js/JQTouch/extensions/jqt.themeswitcher.js +++ b/dev/null @@ -1,123 +0,0 @@ -/* - - _/ _/_/ _/_/_/_/_/ _/ - _/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/ - _/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/ - _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ - _/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/ - _/ - _/ - - Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/> - - (c) 2011 by jQTouch project members. - See LICENSE.txt for license. - -*/ - -(function($) { - if ($.jQTouch) { - - var scriptpath = $("script").last().attr("src").split('?')[0].split('/').slice(0, -1).join('/')+'/'; - - $.jQTouch.addExtension(function ThemeSwitcher(jQT) { - - var current, - link, - titles = {}, - defaults = { - themeStyleSelector: 'link[rel="stylesheet"][title]', - themeIncluded: [ - {title: 'jQTouch', href: scriptpath + '../themes/css/jqtouch.css'}, - {title: 'Apple', href: scriptpath + '../themes/css/apple.css'}, - {title: 'Vanilla', href: scriptpath + '../themes/css/vanilla.css'} - - ] - }, - options = $.extend({}, defaults, jQT.settings); - - function setStyleState(item, title) { - var $item = $(item); - - if ($item.attr('title') === title) { - item.disabled = false; // workaround for Firefox on Zepto - $item.removeAttr('disabled'); - } else { - item.disabled = true; // workaround for Firefox on Zepto - $item.attr('disabled', true); - } - } - - function initializeStyleState(item, title) { - // and, workaround for WebKit by initializing the 'disabled' attribute - if (!current) { - current = title; - } - setStyleState(item, current); - } - - // public - function switchStyle(title) { - current = title; - $(options.themeStyleSelector).each(function(i, item) { - setStyleState(item, title); - }); - } - - // collect title names, from <head> - $(options.themeStyleSelector).each(function(i, item) { - var $item = $(item); - var title = $item.attr('title'); - - titles[title] = true; - - initializeStyleState(item, title); - }); - - // add included theme - for (var i=0; i < options.themeIncluded.length; i++) { - var hash = options.themeIncluded[i]; - if (!(hash.title in titles)) { - link = $('<link title="' + hash.title + '" href="' + hash.href + '" rel="stylesheet">'); - $('head').append($(link)); - - titles[hash.title] = true; - - initializeStyleState(link, hash.title); - } - } - - if (options.themeSelectionSelector) { - // create UI items - for (var title in titles) { - var $item = $('<li><a href="#" data-title="' + title + '">' + title + '</a></li>'); - $(options.themeSelectionSelector).append($item); - } - - // bind to UI items - $(options.themeSelectionSelector).delegate('* > a', 'tap', function(e) { - e.preventDefault(); - e.stopPropagation(); - - var $a = $(this).closest('a'); - $a.removeClass('active'); - switchStyle($a.attr('data-title')); - - // poor-man simulation of radio button behaviour - $(options.themeSelectionSelector).find('a').removeClass('selected'); - $a.addClass('selected'); - }); - - // poor-man simulation of radio button behaviour - $(options.themeSelectionSelector).closest('#jqt > *').bind('pageAnimationEnd', function(e, data){ - if (data.direction === 'in') { - $(options.themeSelectionSelector).find('a[data-title="' + current + '"]').addClass('selected'); - } - }); - } - - return {switchStyle: switchStyle}; - - }); - } -})($); |