Commit 119ccb41 authored by Ubbo Veentjer's avatar Ubbo Veentjer
Browse files

add non-uglyfied theme.js from liferay-theme. former included bootstrap js not needed anymore.

parent da4a980e
/*!
* Using parts of Bootstrap 2:
* Bootstrap.js by @fat & @mdo
* Copyright 2013 Twitter, Inc.
* http://www.apache.org/licenses/LICENSE-2.0.txt
*/
!function(t){"use strict";var e=function(e,i){this.$element=t(e),this.options=i,this.options.slide&&this.slide(this.options.slide),"hover"==this.options.pause&&this.$element.on("mouseenter",t.proxy(this.pause,this)).on("mouseleave",t.proxy(this.cycle,this))};e.prototype={cycle:function(e){return e||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},to:function(e){var i=this.$element.find(".active"),s=i.parent().children(),n=s.index(i),a=this;if(!(e>s.length-1||e<0))return this.sliding?this.$element.one("slid",function(){a.to(e)}):n==e?this.pause().cycle():this.slide(e>n?"next":"prev",t(s[e]))},pause:function(t){return t||(this.paused=!0),clearInterval(this.interval),this.interval=null,this},next:function(){if(!this.sliding)return this.slide("next")},prev:function(){if(!this.sliding)return this.slide("prev")},slide:function(e,i){var s=this.$element.find(".active"),n=i||s[e](),a=this.interval,r="next"==e?"left":"right",l="next"==e?"first":"last",o=this,h=t.Event("slide");if(this.sliding=!0,a&&this.pause(),n=n.length?n:this.$element.find(".item")[l](),!n.hasClass("active")){if(t.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(h),h.isDefaultPrevented())return;n.addClass(e),n[0].offsetWidth,s.addClass(r),n.addClass(r),this.$element.one(t.support.transition.end,function(){n.removeClass([e,r].join(" ")).addClass("active"),s.removeClass(["active",r].join(" ")),o.sliding=!1,setTimeout(function(){o.$element.trigger("slid")},0)})}else{if(this.$element.trigger(h),h.isDefaultPrevented())return;s.removeClass("active"),n.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return a&&this.cycle(),this}}},t.fn.carousel=function(i){return this.each(function(){var s=t(this),n=s.data("carousel"),a=t.extend({},t.fn.carousel.defaults,"object"==typeof i&&i);n||s.data("carousel",n=new e(this,a)),"number"==typeof i?n.to(i):"string"==typeof i||(i=a.slide)?n[i]():a.interval&&n.cycle()})},t.fn.carousel.defaults={interval:5e3,pause:"hover"},t.fn.carousel.Constructor=e,t(function(){t("body").on("click.carousel.data-api","[data-slide]",function(e){var i,s=t(this),n=t(s.attr("data-target")||(i=s.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"")),a=!n.data("modal")&&t.extend({},n.data(),s.data());n.carousel(a),e.preventDefault()})})}(window.jQuery);
!function(t){"use strict";function e(){var e=this,i=setTimeout(function(){e.$element.off(t.support.transition.end),s.call(e)},500);this.$element.one(t.support.transition.end,function(){clearTimeout(i),s.call(e)})}function s(t){this.$element.hide().trigger("hidden"),i.call(this)}function i(e){var s=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=t.support.transition&&s;this.$backdrop=t('<div class="modal-backdrop '+s+'" />').appendTo(document.body),"static"!=this.options.backdrop&&this.$backdrop.click(t.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),i?this.$backdrop.one(t.support.transition.end,e):e()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(t.support.transition.end,t.proxy(o,this)):o.call(this)):e&&e()}function o(){this.$backdrop.remove(),this.$backdrop=null}function n(){var e=this;this.isShown&&this.options.keyboard?t(document).on("keyup.dismiss.modal",function(t){27==t.which&&e.hide()}):this.isShown||t(document).off("keyup.dismiss.modal")}var a=function(e,s){this.options=s,this.$element=t(e).delegate('[data-dismiss="modal"]',"click.dismiss.modal",t.proxy(this.hide,this))};a.prototype={constructor:a,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var e=this,s=t.Event("show");this.$element.trigger(s),this.isShown||s.isDefaultPrevented()||(t("body").addClass("modal-open"),this.isShown=!0,n.call(this),i.call(this,function(){var s=t.support.transition&&e.$element.hasClass("fade");e.$element.parent().length||e.$element.appendTo(document.body),e.$element.show(),s&&e.$element[0].offsetWidth,e.$element.addClass("in"),s?e.$element.one(t.support.transition.end,function(){e.$element.trigger("shown")}):e.$element.trigger("shown")}))},hide:function(i){i&&i.preventDefault();i=t.Event("hide"),this.$element.trigger(i),this.isShown&&!i.isDefaultPrevented()&&(this.isShown=!1,t("body").removeClass("modal-open"),n.call(this),this.$element.removeClass("in"),t.support.transition&&this.$element.hasClass("fade")?e.call(this):s.call(this))}},t.fn.modal=function(e){return this.each(function(){var s=t(this),i=s.data("modal"),o=t.extend({},t.fn.modal.defaults,s.data(),"object"==typeof e&&e);i||s.data("modal",i=new a(this,o)),"string"==typeof e?i[e]():o.show&&i.show()})},t.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},t.fn.modal.Constructor=a,t(function(){t("body").on("click.modal.data-api",'[data-toggle="modal"]',function(e){var s,i=t(this),o=t(i.attr("data-target")||(s=i.attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")),n=o.data("modal")?"toggle":t.extend({},o.data(),i.data());e.preventDefault(),o.modal(n)})})}(window.jQuery);
!function(n){n(function(){"use strict";n.support.transition=function(){var n=function(){var n,i=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"};for(n in t)if(void 0!==i.style[n])return t[n]}();return n&&{end:n}}()})}(window.jQuery);
jQuery.fn.extend({renumberInputs:function(){return this.each(function(n){$(this).find(":input").each(function(){this.name=this.name.replace(/\[\d+\]/,"["+n+"]")})})}});
$.fx.speeds._default=300,$(function(){$(".tg.dropdown_menu a").attr("tabindex",-1),$(".tg.dropdown_toggle").click(function(){var t=$(this).siblings(".tg.dropdown_menu");return $(".tg.dropdown_menu").not(t).removeClass("-open"),t.toggleClass("-open").find("input:eq(0)").focus(),t.find("a").attr("tabindex",t.hasClass("-open")?"":-1),!1}),$(".tg.nav, .tg.topbox, .tg.dropdown_menu").click(function(t){t.stopPropagation()}),$(".tg.topbox_toggle-nav").click(function(){$(".tg.site").toggleClass("-reveal-off-canvas")}),$("body").click(function(){$(".tg.dropdown_menu").removeClass("-open").find("a").attr("tabindex",-1),$(".tg.site").removeClass("-reveal-off-canvas")}),document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")||$('img[src$="svg"]').attr("src",function(){return $(this).attr("src").replace(".svg",".png")});var t=$(".tgrep.sidebar");$(".tgrep.sidebar-toggle_button").click(function(){$(this).siblings().addBack().toggle(),$(this).hasClass("-show")?t.slideDown():t.slideUp({done:function(){t.css("display","")}})}),$(".tgrep.sidebar_expand").click(function(){$(this).hide().siblings(".tgrep.sidebar_list").children(":hidden").show()});var e=$(".tgrep.header_button").filter(".-expand-all, .-collapse-all");e.click(function(){e.toggle(),$(this).hasClass("-expand-all")?$(".tgrep.metadata_button.-show:visible").click():$(".tgrep.metadata_button.-hide:visible").click()}),$(".tgrep.metadata_button").click(function(){$(this).siblings(".tgrep.metadata_button").addBack().toggle(),$(this).siblings(".tgrep.metadata_toggle").slideToggle()}),$(".tgrep.advanced-search_button.-toggle").click(function(){$(this).toggleClass("-open"),$("#"+$(this).data("target")).slideToggle()}),$(".tgrep.advanced-search_button.-select").click(function(){checked=$(this).hasClass("-all"),$("#"+$(this).data("target")).find(":checkbox").prop("checked",checked)}),$(".tgrep.advanced-search_button.-item").click(function(){var t=$(this).closest(".tgrep.advanced-search_grow-group");$(this).hasClass("-add")?($template=$(this).closest(".tgrep.advanced-search_grow-item"),$clone=$template.clone(!0),$clone.find(":input").val(""),$clone.find("select").each(function(){$(this).val($(this).find("option:first").val())}),$clone.insertAfter($template)):$(this).closest(".tgrep.advanced-search_grow-item").remove();var e=t.find(".tgrep.advanced-search_grow-item");t.find(".tgrep.advanced-search_button.-item.-remove").prop("disabled",e.length<2)});var a=$('<i class="eye -trigger">');$(".tg.header_logo a").append(a),a.click(function(){var t=$('<i class="eye -left">'),e=$('<i class="eye -right">');return $(this).after(t,e).remove(),$(window).mousemove(function(a){t.css("transform","rotate("+(Math.atan((a.pageY-t.offset().top-12)/(a.pageX-t.offset().left-12))+(a.pageX<=t.offset().left+12?4.19:1.05))+"rad)"),e.css("transform","rotate("+(Math.atan((a.pageY-e.offset().top-12)/(a.pageX-e.offset().left-12))+(a.pageX<=e.offset().left+12?4.19:1.05))+"rad)")}),!1})});
\ No newline at end of file
// Set default animation duration to 300 ms
$.fx.speeds._default = 300
$( function() {
// Drowdown handlers
$('.tg.dropdown_menu a').attr('tabindex', -1)
$('.tg.dropdown_toggle').click( function() {
var $dropdown = $(this).siblings('.tg.dropdown_menu')
$('.tg.dropdown_menu').not($dropdown).removeClass('-open')
$dropdown.toggleClass('-open').find('input:eq(0)').focus()
$dropdown.find('a').attr('tabindex', ( $dropdown.hasClass('-open') ? '' : -1 ))
return false
})
$('.tg.nav, .tg.topbox, .tg.dropdown_menu').click( function(e) {
e.stopPropagation()
})
$('.tg.topbox_toggle-nav').click( function() {
$('.tg.site').toggleClass('-reveal-off-canvas')
})
$('body').click( function() {
$('.tg.dropdown_menu').removeClass('-open').find('a').attr('tabindex', -1)
$('.tg.site').removeClass('-reveal-off-canvas')
})
// SVG fallback for older browsers
if ( ! document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#Image', '1.1') ) {
$('img[src$="svg"]').attr('src', function() {
return $(this).attr('src').replace('.svg', '.png')
})
}
// TextGridRep handlers
// TODO: Move to another file
var $sidebar = $('.tgrep.sidebar')
$('.tgrep.sidebar-toggle_button').click( function() {
$(this).siblings().addBack().toggle()
if ( $(this).hasClass('-show') ) {
$sidebar.slideDown()
} else {
$sidebar.slideUp({
done: function() {
// Remove inline style to prevent sidebar from
// being hidden when viewport width increases
$sidebar.css('display', '')
}
})
}
})
$('.tgrep.sidebar_expand').click( function() {
$(this)
.hide()
.siblings('.tgrep.sidebar_list').children(':hidden').show()
})
var $toggleAllButtons = $('.tgrep.header_button').filter('.-expand-all, .-collapse-all')
$toggleAllButtons.click( function() {
$toggleAllButtons.toggle()
if ( $(this).hasClass('-expand-all') ) {
$('.tgrep.metadata_button.-show:visible').click()
} else {
$('.tgrep.metadata_button.-hide:visible').click()
}
})
$('.tgrep.metadata_button').click( function() {
$(this).siblings('.tgrep.metadata_button').addBack().toggle()
$(this).siblings('.tgrep.metadata_toggle').slideToggle()
})
$('.tgrep.advanced-search_button.-toggle').click( function() {
$(this).toggleClass('-open')
$( '#' + $(this).data('target') ).slideToggle()
})
$('.tgrep.advanced-search_button.-select').click( function() {
checked = $(this).hasClass('-all')
$( '#' + $(this).data('target') ).find(':checkbox').prop('checked', checked)
})
// Add or remove metadata search fields
$('.tgrep.advanced-search_button.-item').click( function() {
var $container = $(this).closest('.tgrep.advanced-search_grow-group')
if ( $(this).hasClass('-add') ) {
$template = $(this).closest('.tgrep.advanced-search_grow-item')
$clone = $template.clone(true)
$clone.find(':input').val('')
$clone.find('select').each( function() {
$(this).val( $(this).find('option:first').val() )
})
$clone.insertAfter($template)
} else {
$(this).closest('.tgrep.advanced-search_grow-item').remove()
}
var $items = $container.find('.tgrep.advanced-search_grow-item')
$container.find('.tgrep.advanced-search_button.-item.-remove').prop('disabled', ($items.length < 2))
})
// :)
var $eyeTrigger = $('<i class="eye -trigger">')
$('.tg.header_logo a').append($eyeTrigger)
$eyeTrigger.click( function() {
var $eyeLeft = $('<i class="eye -left">'),
$eyeRight = $('<i class="eye -right">')
$(this).after($eyeLeft, $eyeRight).remove()
$(window).mousemove( function(e) {
$eyeLeft.css('transform', 'rotate(' + ( Math.atan((e.pageY - $eyeLeft.offset().top - 12) / (e.pageX - $eyeLeft.offset().left - 12)) + (e.pageX <= $eyeLeft.offset().left + 12 ? 4.19 : 1.05) ) + 'rad)')
$eyeRight.css('transform', 'rotate(' + ( Math.atan((e.pageY - $eyeRight.offset().top - 12) / (e.pageX - $eyeRight.offset().left - 12)) + (e.pageX <= $eyeRight.offset().left + 12 ? 4.19 : 1.05) ) + 'rad)')
})
return false
})
})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment