minify icon indicating copy to clipboard operation
minify copied to clipboard

@licence in comment breaks js minification

Open dosercz opened this issue 6 years ago • 0 comments

If there is somewhere in a comment @license string it breaks minification of js code before this comment. Code between first comment and comment with @license is not minified because it treated as comment in comment regexp: '/\n?\/\*(!|.*?@license|.*?@preserve).*?\*\/\n?/s, e.g.

ns('W3W.Util');W3W.Util={escape:function(html){return $('<div>').text(html).html()},/**
     * Check for touch support using:
     * 1. The existence of the (mostly) default touchstart event
     * 2. MaxTouchPoints property (IE11 Windows Phone)
     * 3. msMaxTouchPoints property (IE10 Windows Phone)
     *
     * @returns {boolean}
     */
    hasTouch: function () {
        return ('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0);
    },
};
/* ==========================================================
 * bootstrap-affix.js v2.3.1
 * http://twitter.github.com/bootstrap/javascript.html#affix
 * ==========================================================
 * Copyright 2012 Twitter, Inc.
 *
 * 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"; // jshint ;_;


 /* AFFIX CLASS DEFINITION
  * ====================== */

  var Affix = function (element, options) {
    this.options = $.extend({}, $.fn.affix.defaults, options)
    this.$window = $(window)
      .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
      .on('click.affix.data-api',  $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
    this.$element = $(element)
    this.checkPosition()
  }

  Affix.prototype.checkPosition = function () {
    if (!this.$element.is(':visible')) return

    var scrollHeight = $(document).height()
      , scrollTop = this.$window.scrollTop()
      , position = this.$element.offset()
      , offset = this.options.offset
      , offsetBottom = offset.bottom
      , offsetTop = offset.top
      , reset = 'affix affix-top affix-bottom'
      , affix

    if (typeof offset != 'object') offsetBottom = offsetTop = offset
    if (typeof offsetTop == 'function') offsetTop = offset.top()
    if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()

    affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
      false    : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
      'bottom' : offsetTop != null && scrollTop <= offsetTop ?
      'top'    : false

    if (this.affixed === affix) return

    this.affixed = affix
    this.unpin = affix == 'bottom' ? position.top - scrollTop : null

    this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
  }


 /* AFFIX PLUGIN DEFINITION
  * ======================= */

  var old = $.fn.affix

  $.fn.affix = function (option) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('affix')
        , options = typeof option == 'object' && option
      if (!data) $this.data('affix', (data = new Affix(this, options)))
      if (typeof option == 'string') data[option]()
    })
  }

  $.fn.affix.Constructor = Affix

  $.fn.affix.defaults = {
    offset: 0
  }


 /* AFFIX NO CONFLICT
  * ================= */

  $.fn.affix.noConflict = function () {
    $.fn.affix = old
    return this
  }


 /* AFFIX DATA-API
  * ============== */

  $(window).on('load', function () {
    $('[data-spy="affix"]').each(function () {
      var $spy = $(this)
        , data = $spy.data()

      data.offset = data.offset || {}

      data.offsetBottom && (data.offset.bottom = data.offsetBottom)
      data.offsetTop && (data.offset.top = data.offsetTop)

      $spy.affix(data)
    })
  })


}(window.jQuery);
;
// js/vendor/jquery.fastClick.js
/**
 * jQuery.fastClick.js
 *
 * Work around the 300ms delay for the click event in some mobile browsers.
 *
 * Code based on <http://code.google.com/mobile/articles/fast_buttons.html>
 *
 * @usage
 * $('button').fastClick(function() {alert('clicked!');});
 *
 * @license MIT
 * @author Dave Hulbert (dave1010)
 * @version 1.0.0 2013-01-17
 */
(function($){$.fn.fastClick=function(handler){return $(this).each(function(){$.FastButton($(this)[0],handler)})};$.FastButton=function(element,handler){var startX,startY;var reset=function(){$(element).unbind('touchend');$("body").unbind('touchmove.fastClick')};var onClick=function(event){event.stopPropagation();reset();handler.call(this,event);if(event.type==='touchend'){$.clickbuster.preventGhostClick(startX,startY)}};var onTouchMove=function(event){if(Math.abs(event.originalEvent.touches[0].clientX-startX)>10||Math.abs(event.originalEvent.touches[0].clientY-startY)>10){reset()}};var onTouchStart=function(event){event.stopPropagation();$(element).bind('touchend',onClick);$("body").bind('touchmove.fastClick',onTouchMove);startX=event.originalEvent.touches[0].clientX;startY=event.originalEvent.touches[0].clientY};$(element).bind({touchstart:onTouchStart,click:onClick})};$.clickbuster={coordinates:[],preventGhostClick:function(x,y){$.clickbuster.coordinates.push(x,y);window.setTimeout($.clickbuster.pop,2500)},pop:function(){$.clickbuster.coordinates.splice(0,2)},onClick:function(event){var x,y,i;for(i=0;i<$.clickbuster.coordinates.length;i+=2){x=$.clickbuster.coordinates[i];y=$.clickbuster.coordinates[i+1];if(Math.abs(event.clientX-x)<25&&Math.abs(event.clientY-y)<25){event.stopPropagation();event.preventDefault()}}}};$(function(){if(document.addEventListener){document.addEventListener('click',$.clickbuster.onClick,!0)}else if(document.attachEvent){document.attachEvent('onclick',$.clickbuster.onClick)}})}(jQuery));

dosercz avatar Sep 18 '19 18:09 dosercz