diff --git a/header.php b/header.php index e1067276..3dece216 100644 --- a/header.php +++ b/header.php @@ -77,22 +77,6 @@ - - - - - - diff --git a/inc/enqueue.php b/inc/enqueue.php index acfe1aed..a70a9519 100644 --- a/inc/enqueue.php +++ b/inc/enqueue.php @@ -17,10 +17,4 @@ function understrap_scripts() { wp_enqueue_script( 'understrap-carousel-script', get_template_directory_uri() . '/js/owl.carousel.min.js', array(), '20024', true );} } - if ( is_active_sidebar( 'off-canvas' ) ) { - wp_enqueue_style('understrap-off-canvas-style', get_template_directory_uri() . '/css/jasny-bootstrap.min.css', array(), '310', false); - wp_enqueue_script('understrap-off-canvas-script', get_template_directory_uri() . '/js/jasny-bootstrap.min.js', array(), '310', true); - -} - add_action( 'wp_enqueue_scripts', 'understrap_scripts' ); \ No newline at end of file diff --git a/inc/widgets.php b/inc/widgets.php index 0e78340e..6d35e6ac 100644 --- a/inc/widgets.php +++ b/inc/widgets.php @@ -19,7 +19,7 @@ function understrap_widgets_init() { 'before_title' => '', 'after_title' => '', ) ); - +/* register_sidebar( array( 'name' => __( 'Off Canvas', 'understrap' ), 'id' => 'off-canvas', @@ -28,6 +28,6 @@ function understrap_widgets_init() { 'after_widget' => '', 'before_title' => '', 'after_title' => '', - ) ); + ) );*/ } add_action( 'widgets_init', 'understrap_widgets_init' ); \ No newline at end of file diff --git a/js/jasny-bootstrap.js b/js/jasny-bootstrap.js deleted file mode 100644 index 29c5cf55..00000000 --- a/js/jasny-bootstrap.js +++ /dev/null @@ -1,369 +0,0 @@ -/* ======================================================================== - * Bootstrap: offcanvas.js v3.1.3 - * http://jasny.github.io/bootstrap/javascript/#offcanvas - * ======================================================================== - * Copyright 2013-2014 Arnold Daniels - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ======================================================================== */ - -+function ($) { "use strict"; - - // OFFCANVAS PUBLIC CLASS DEFINITION - // ================================= - - var OffCanvas = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, OffCanvas.DEFAULTS, options) - this.state = null - this.placement = null - - if (this.options.recalc) { - this.calcClone() - $(window).on('resize', $.proxy(this.recalc, this)) - } - - if (this.options.autohide) - $(document).on('click', $.proxy(this.autohide, this)) - - if (this.options.toggle) this.toggle() - - if (this.options.disablescrolling) { - this.options.disableScrolling = this.options.disablescrolling - delete this.options.disablescrolling - } - } - - OffCanvas.DEFAULTS = { - toggle: true, - placement: 'auto', - autohide: true, - recalc: true, - disableScrolling: true - } - - OffCanvas.prototype.offset = function () { - switch (this.placement) { - case 'left': - case 'right': return this.$element.outerWidth() - case 'top': - case 'bottom': return this.$element.outerHeight() - } - } - - OffCanvas.prototype.calcPlacement = function () { - if (this.options.placement !== 'auto') { - this.placement = this.options.placement - return - } - - if (!this.$element.hasClass('in')) { - this.$element.css('visiblity', 'hidden !important').addClass('in') - } - - var horizontal = $(window).width() / this.$element.width() - var vertical = $(window).height() / this.$element.height() - - var element = this.$element - function ab(a, b) { - if (element.css(b) === 'auto') return a - if (element.css(a) === 'auto') return b - - var size_a = parseInt(element.css(a), 10) - var size_b = parseInt(element.css(b), 10) - - return size_a > size_b ? b : a - } - - this.placement = horizontal >= vertical ? ab('left', 'right') : ab('top', 'bottom') - - if (this.$element.css('visibility') === 'hidden !important') { - this.$element.removeClass('in').css('visiblity', '') - } - } - - OffCanvas.prototype.opposite = function (placement) { - switch (placement) { - case 'top': return 'bottom' - case 'left': return 'right' - case 'bottom': return 'top' - case 'right': return 'left' - } - } - - OffCanvas.prototype.getCanvasElements = function() { - // Return a set containing the canvas plus all fixed elements - var canvas = this.options.canvas ? $(this.options.canvas) : this.$element - - var fixed_elements = canvas.find('*').filter(function() { - return $(this).css('position') === 'fixed' - }).not(this.options.exclude) - - return canvas.add(fixed_elements) - } - - OffCanvas.prototype.slide = function (elements, offset, callback) { - // Use jQuery animation if CSS transitions aren't supported - if (!$.support.transition) { - var anim = {} - anim[this.placement] = "+=" + offset - return elements.animate(anim, 350, callback) - } - - var placement = this.placement - var opposite = this.opposite(placement) - - elements.each(function() { - if ($(this).css(placement) !== 'auto') - $(this).css(placement, (parseInt($(this).css(placement), 10) || 0) + offset) - - if ($(this).css(opposite) !== 'auto') - $(this).css(opposite, (parseInt($(this).css(opposite), 10) || 0) - offset) - }) - - this.$element - .one($.support.transition.end, callback) - .emulateTransitionEnd(350) - } - - OffCanvas.prototype.disableScrolling = function() { - var bodyWidth = $('body').width() - var prop = 'padding-' + this.opposite(this.placement) - - if ($('body').data('offcanvas-style') === undefined) { - $('body').data('offcanvas-style', $('body').attr('style') || '') - } - - $('body').css('overflow', 'hidden') - - if ($('body').width() > bodyWidth) { - var padding = parseInt($('body').css(prop), 10) + $('body').width() - bodyWidth - - setTimeout(function() { - $('body').css(prop, padding) - }, 1) - } - } - - OffCanvas.prototype.show = function () { - if (this.state) return - - var startEvent = $.Event('show.bs.offcanvas') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - this.state = 'slide-in' - this.calcPlacement(); - - var elements = this.getCanvasElements() - var placement = this.placement - var opposite = this.opposite(placement) - var offset = this.offset() - - if (elements.index(this.$element) !== -1) { - $(this.$element).data('offcanvas-style', $(this.$element).attr('style') || '') - this.$element.css(placement, -1 * offset) - this.$element.css(placement); // Workaround: Need to get the CSS property for it to be applied before the next line of code - } - - elements.addClass('canvas-sliding').each(function() { - if ($(this).data('offcanvas-style') === undefined) $(this).data('offcanvas-style', $(this).attr('style') || '') - if ($(this).css('position') === 'static') $(this).css('position', 'relative') - if (($(this).css(placement) === 'auto' || $(this).css(placement) === '0px') && - ($(this).css(opposite) === 'auto' || $(this).css(opposite) === '0px')) { - $(this).css(placement, 0) - } - }) - - if (this.options.disableScrolling) this.disableScrolling() - - var complete = function () { - if (this.state != 'slide-in') return - - this.state = 'slid' - - elements.removeClass('canvas-sliding').addClass('canvas-slid') - this.$element.trigger('shown.bs.offcanvas') - } - - setTimeout($.proxy(function() { - this.$element.addClass('in') - this.slide(elements, offset, $.proxy(complete, this)) - }, this), 1) - } - - OffCanvas.prototype.hide = function (fast) { - if (this.state !== 'slid') return - - var startEvent = $.Event('hide.bs.offcanvas') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - this.state = 'slide-out' - - var elements = $('.canvas-slid') - var placement = this.placement - var offset = -1 * this.offset() - - var complete = function () { - if (this.state != 'slide-out') return - - this.state = null - this.placement = null - - this.$element.removeClass('in') - - elements.removeClass('canvas-sliding') - elements.add(this.$element).add('body').each(function() { - $(this).attr('style', $(this).data('offcanvas-style')).removeData('offcanvas-style') - }) - - this.$element.trigger('hidden.bs.offcanvas') - } - - elements.removeClass('canvas-slid').addClass('canvas-sliding') - - setTimeout($.proxy(function() { - this.slide(elements, offset, $.proxy(complete, this)) - }, this), 1) - } - - OffCanvas.prototype.toggle = function () { - if (this.state === 'slide-in' || this.state === 'slide-out') return - this[this.state === 'slid' ? 'hide' : 'show']() - } - - OffCanvas.prototype.calcClone = function() { - this.$calcClone = this.$element.clone() - .html('') - .addClass('offcanvas-clone').removeClass('in') - .appendTo($('body')) - } - - OffCanvas.prototype.recalc = function () { - if (this.$calcClone.css('display') === 'none' || (this.state !== 'slid' && this.state !== 'slide-in')) return - - this.state = null - this.placement = null - var elements = this.getCanvasElements() - - this.$element.removeClass('in') - - elements.removeClass('canvas-slid') - elements.add(this.$element).add('body').each(function() { - $(this).attr('style', $(this).data('offcanvas-style')).removeData('offcanvas-style') - }) - } - - OffCanvas.prototype.autohide = function (e) { - if ($(e.target).closest(this.$element).length === 0) this.hide() - } - - // OFFCANVAS PLUGIN DEFINITION - // ========================== - - var old = $.fn.offcanvas - - $.fn.offcanvas = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.offcanvas') - var options = $.extend({}, OffCanvas.DEFAULTS, $this.data(), typeof option === 'object' && option) - - if (!data) $this.data('bs.offcanvas', (data = new OffCanvas(this, options))) - if (typeof option === 'string') data[option]() - }) - } - - $.fn.offcanvas.Constructor = OffCanvas - - - // OFFCANVAS NO CONFLICT - // ==================== - - $.fn.offcanvas.noConflict = function () { - $.fn.offcanvas = old - return this - } - - - // OFFCANVAS DATA-API - // ================= - - $(document).on('click.bs.offcanvas.data-api', '[data-toggle=offcanvas]', function (e) { - var $this = $(this), href - var target = $this.attr('data-target') - || e.preventDefault() - || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 - var $canvas = $(target) - var data = $canvas.data('bs.offcanvas') - var option = data ? 'toggle' : $this.data() - - e.stopPropagation() - - if (data) data.toggle() - else $canvas.offcanvas(option) - }) - -}(window.jQuery); - -/* ======================================================================== - * Bootstrap: transition.js v3.1.3 - * http://getbootstrap.com/javascript/#transitions - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) - // ============================================================ - - function transitionEnd() { - var el = document.createElement('bootstrap') - - var transEndEventNames = { - WebkitTransition : 'webkitTransitionEnd', - MozTransition : 'transitionend', - OTransition : 'oTransitionEnd otransitionend', - transition : 'transitionend' - } - - for (var name in transEndEventNames) { - if (el.style[name] !== undefined) { - return { end: transEndEventNames[name] } - } - } - - return false // explicit for ie8 ( ._.) - } - - if ($.support.transition !== undefined) return // Prevent conflict with Twitter Bootstrap - - // http://blog.alexmaccaw.com/css-transitions - $.fn.emulateTransitionEnd = function (duration) { - var called = false, $el = this - $(this).one($.support.transition.end, function () { called = true }) - var callback = function () { if (!called) $($el).trigger($.support.transition.end) } - setTimeout(callback, duration) - return this - } - - $(function () { - $.support.transition = transitionEnd() - }) - -}(window.jQuery); diff --git a/js/jasny-bootstrap.min.js b/js/jasny-bootstrap.min.js deleted file mode 100644 index 198093ea..00000000 --- a/js/jasny-bootstrap.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Jasny Bootstrap v3.1.0 (http://jasny.github.com/bootstrap) - * Copyright 2011-2014 Arnold Daniels. - * Licensed under Apache-2.0 (https://github.com/jasny/bootstrap/blob/master/LICENSE) - */ - -+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.state=null,this.placement=null,this.options.recalc&&(this.calcClone(),a(window).on("resize",a.proxy(this.recalc,this))),this.options.autohide&&a(document).on("click",a.proxy(this.autohide,this)),this.options.toggle&&this.toggle(),this.options.disablescrolling&&(this.options.disableScrolling=this.options.disablescrolling,delete this.options.disablescrolling)};b.DEFAULTS={toggle:!0,placement:"auto",autohide:!0,recalc:!0,disableScrolling:!0},b.prototype.offset=function(){switch(this.placement){case"left":case"right":return this.$element.outerWidth();case"top":case"bottom":return this.$element.outerHeight()}},b.prototype.calcPlacement=function(){function e(a,b){if(d.css(b)==="auto")return a;if(d.css(a)==="auto")return b;var c=parseInt(d.css(a),10),e=parseInt(d.css(b),10);return c>e?b:a}if(this.options.placement!=="auto"){this.placement=this.options.placement;return}this.$element.hasClass("in")||this.$element.css("visiblity","hidden !important").addClass("in");var b=a(window).width()/this.$element.width(),c=a(window).height()/this.$element.height(),d=this.$element;this.placement=b>=c?e("left","right"):e("top","bottom"),this.$element.css("visibility")==="hidden !important"&&this.$element.removeClass("in").css("visiblity","")},b.prototype.opposite=function(a){switch(a){case"top":return"bottom";case"left":return"right";case"bottom":return"top";case"right":return"left"}},b.prototype.getCanvasElements=function(){var b=this.options.canvas?a(this.options.canvas):this.$element,c=b.find("*").filter(function(){return a(this).css("position")==="fixed"}).not(this.options.exclude);return b.add(c)},b.prototype.slide=function(b,c,d){if(!a.support.transition){var e={};return e[this.placement]="+="+c,b.animate(e,350,d)}var f=this.placement,g=this.opposite(f);b.each(function(){a(this).css(f)!=="auto"&&a(this).css(f,(parseInt(a(this).css(f),10)||0)+c),a(this).css(g)!=="auto"&&a(this).css(g,(parseInt(a(this).css(g),10)||0)-c)}),this.$element.one(a.support.transition.end,d).emulateTransitionEnd(350)},b.prototype.disableScrolling=function(){var b=a("body").width(),c="padding-"+this.opposite(this.placement);a("body").data("offcanvas-style")===undefined&&a("body").data("offcanvas-style",a("body").attr("style")||""),a("body").css("overflow","hidden");if(a("body").width()>b){var d=parseInt(a("body").css(c),10)+a("body").width()-b;setTimeout(function(){a("body").css(c,d)},1)}},b.prototype.show=function(){if(this.state)return;var b=a.Event("show.bs.offcanvas");this.$element.trigger(b);if(b.isDefaultPrevented())return;this.state="slide-in",this.calcPlacement();var c=this.getCanvasElements(),d=this.placement,e=this.opposite(d),f=this.offset();c.index(this.$element)!==-1&&(a(this.$element).data("offcanvas-style",a(this.$element).attr("style")||""),this.$element.css(d,-1*f),this.$element.css(d)),c.addClass("canvas-sliding").each(function(){a(this).data("offcanvas-style")===undefined&&a(this).data("offcanvas-style",a(this).attr("style")||""),a(this).css("position")==="static"&&a(this).css("position","relative"),(a(this).css(d)==="auto"||a(this).css(d)==="0px")&&(a(this).css(e)==="auto"||a(this).css(e)==="0px")&&a(this).css(d,0)}),this.options.disableScrolling&&this.disableScrolling();var g=function(){if(this.state!="slide-in")return;this.state="slid",c.removeClass("canvas-sliding").addClass("canvas-slid"),this.$element.trigger("shown.bs.offcanvas")};setTimeout(a.proxy(function(){this.$element.addClass("in"),this.slide(c,f,a.proxy(g,this))},this),1)},b.prototype.hide=function(b){if(this.state!=="slid")return;var c=a.Event("hide.bs.offcanvas");this.$element.trigger(c);if(c.isDefaultPrevented())return;this.state="slide-out";var d=a(".canvas-slid"),e=this.placement,f=-1*this.offset(),g=function(){if(this.state!="slide-out")return;this.state=null,this.placement=null,this.$element.removeClass("in"),d.removeClass("canvas-sliding"),d.add(this.$element).add("body").each(function(){a(this).attr("style",a(this).data("offcanvas-style")).removeData("offcanvas-style")}),this.$element.trigger("hidden.bs.offcanvas")};d.removeClass("canvas-slid").addClass("canvas-sliding"),setTimeout(a.proxy(function(){this.slide(d,f,a.proxy(g,this))},this),1)},b.prototype.toggle=function(){if(this.state==="slide-in"||this.state==="slide-out")return;this[this.state==="slid"?"hide":"show"]()},b.prototype.calcClone=function(){this.$calcClone=this.$element.clone().html("").addClass("offcanvas-clone").removeClass("in").appendTo(a("body"))},b.prototype.recalc=function(){if(this.$calcClone.css("display")==="none"||this.state!=="slid"&&this.state!=="slide-in")return;this.state=null,this.placement=null;var b=this.getCanvasElements();this.$element.removeClass("in"),b.removeClass("canvas-slid"),b.add(this.$element).add("body").each(function(){a(this).attr("style",a(this).data("offcanvas-style")).removeData("offcanvas-style")})},b.prototype.autohide=function(b){a(b.target).closest(this.$element).length===0&&this.hide()};var c=a.fn.offcanvas;a.fn.offcanvas=function(c){return this.each(function(){var d=a(this),e=d.data("bs.offcanvas"),f=a.extend({},b.DEFAULTS,d.data(),typeof c=="object"&&c);e||d.data("bs.offcanvas",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.offcanvas.Constructor=b,a.fn.offcanvas.noConflict=function(){return a.fn.offcanvas=c,this},a(document).on("click.bs.offcanvas.data-api","[data-toggle=offcanvas]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.offcanvas"),h=g?"toggle":c.data();b.stopPropagation(),g?g.toggle():f.offcanvas(h)})}(window.jQuery),+function(a){function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(a.style[c]!==undefined)return{end:b[c]};return!1}"use strict";if(a.support.transition!==undefined)return;a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(window.jQuery) \ No newline at end of file diff --git a/style.css b/style.css index 043ef903..0913f7e8 100644 --- a/style.css +++ b/style.css @@ -17,7 +17,6 @@ Resource Licenses: Font Awesome: http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) Bootstrap: http://getbootstrap.com | https://github.com/twbs/bootstrap/blob/master/LICENSE (Code licensed under MIT, documentation under CC BY 3.0.) Owl Carousel 2: http://www.owlcarousel.owlgraphic.com/ | https://github.com/smashingboxes/OwlCarousel2/blob/develop/LICENSE (Code licensed under MIT) -Portions of Jasnys Bootstrap "missing components": http://jasny.github.io/bootstrap/ (released under the Apache 2.0 license) and of course jQuery: https://jquery.org | (Code licensed under MIT)