1Drupal.locale = { 'pluralFormula': function ($n) { return Number(($n>1)); }, 'strings': {"":{"Unspecified error":"\u767c\u751f\u4e0d\u660e\u932f\u8aa4","Thursday":"\u661f\u671f\u56db","Friday":"\u661f\u671f\u4e94","Fri":"\u9031\u4e94","Translate Text":"\u7ffb\u8b6f\u6587\u5b57","An HTTP error @status occured.":"\u767c\u751f\u4e00\u500b HTTP \u932f\u8aa4 @status \u3002","Disabled":"\u5df2\u95dc\u9589","Enabled":"\u5df2\u555f\u7528","Edit":"\u7de8\u8f2f","Search":"\u641c\u5c0b","none":"\u7121","Sunday":"\u661f\u671f\u65e5","Monday":"\u661f\u671f\u4e00","Tuesday":"\u661f\u671f\u4e8c","Wednesday":"\u661f\u671f\u4e09","Saturday":"\u661f\u671f\u516d","Upload":"\u4e0a\u8f09","This field is required.":"\u6b64\u6b04\u4f4d\u662f\u5fc5\u9700\u7684\u3002","Mon":"\u9031\u4e00","Tue":"\u4e8c","Wed":"\u4e09","Thu":"\u56db","Sat":"\u9031\u516d","Sun":"\u9031\u66f0","May":"\u4e94\u6708","Other":"\u5176\u5b83","Allowed HTML tags":"\u53ef\u4f7f\u7528\u7684 HTML \u6a19\u7c64","Select all rows in this table":"\u9078\u53d6\u8868\u683c\u4e2d\u7684\u6240\u6709\u5217","Deselect all rows in this table":"\u53d6\u6d88\u9078\u53d6\u8868\u683c\u4e2d\u7684\u6240\u6709\u5217","Jan":"1 \u6708","Feb":"2 \u6708","Mar":"3 \u6708","Apr":"4 \u6708","Jun":"6 \u6708","Jul":"7 \u6708","Aug":"8 \u6708","Sep":"9\u6708","Oct":"10 \u6708","Nov":"11 \u6708","Dec":"12 \u6708","Not published":"\u672a\u767c\u8868","Please wait...":"\u8acb\u7a0d\u7b49...","A comma-separated list of terms describing this content. Example: funny, bungee jumping, \u0022Company, Inc.\u0022.":"\u4ee5\u9017\u865f\u5206\u9694\u7684\u6b21\u5206\u985e\uff0c\u7528\u4f86\u63cf\u8ff0\u6b64\u5167\u5bb9 (\u4f8b\u5982: \u6709\u8da3,\u8cc7\u8a0a, \u0022Company, Inc.\u0022)\u3002","Only files with the following extensions are allowed: %files-allowed.":"\u50c5\u5141\u8a31\u4e0b\u5217\u526f\u6a94\u540d\uff1a%files-allowed\u3002","Join summary":"\u5c07\u6458\u8981\u6574\u5408\u5230\u5168\u6587\u88e1 (\u986f\u793a\u5168\u6587)","Split summary at cursor":"\u5c07\u6ed1\u9f20\u6307\u6a19\u4e4b\u524d\u7684\u5167\u5bb9\u8a2d\u5b9a\u70ba\u6587\u7ae0\u6458\u8981","Drag to re-order":"\u6293\u53d6\u9805\u76ee\u9032\u884c\u91cd\u65b0\u6392\u5217","Changes made in this table will not be saved until the form is submitted.":"\u5728\u9001\u51fa\u9019\u500b\u8868\u55ae\u4e4b\u524d\uff0c\u9019\u500b\u8868\u683c\u4e2d\u7684\u8b8a\u66f4\u4e0d\u6703\u88ab\u5132\u5b58\u3002","The changes to these blocks will not be saved until the \u003Cem\u003ESave blocks\u003C\/em\u003E button is clicked.":"\u9019\u4e9b\u5340\u584a\u7684\u8b8a\u66f4\u4e0d\u6703\u88ab\u5132\u5b58\u8d77\u4f86\uff0c\u9664\u975e\u60a8\u6309\u4e0b\u003Cem\u003E\u5132\u5b58\u5340\u584a\u003C\/em\u003E \u7684\u6309\u9215\u3002","Next":"\u4e0b\u4e00\u9801","Add":"\u65b0\u589e","The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.":"\u9078\u64c7\u7684\u6a94\u6848%filename\u7121\u6cd5\u4e0a\u8f09\u3002\u53ea\u6709\u4ee5\u4e0b\u985e\u578b\u7684\u6a94\u6848\u88ab\u5141\u8a31\uff1a%extensions\u3002","Hide":"\u96b1\u85cf","Show":"\u986f\u793a","Close":"\u95dc\u9589","Alias: @alias":"\u5225\u540d\uff1a@alias","No alias":"\u6c92\u6709\u8def\u5f91\u5225\u540d","all":"\u5168\u90e8\u986f\u793a","An AJAX HTTP error occurred.":"\u767c\u751f\u4e00\u500b AJAX HTTP \u932f\u8aa4\u3002","HTTP Result Code: !status":"HTTP \u7d50\u679c\u78bc\uff1a!status","An AJAX HTTP request terminated abnormally.":"\u6709\u500b\u4e0d\u6b63\u5e38\u7d50\u675f\u7684 AJAX HTTP \u8cc7\u6e90\u8acb\u6c42","Debugging information follows.":"\u9644\u4e0a\u5075\u932f\u8cc7\u8a0a\u3002","Path: !uri":"\u8def\u5f91\uff1a!uri","StatusText: !statusText":"\u72c0\u614b\u6587\u5b57\uff1a!statusText","ResponseText: !responseText":"\u56de\u61c9\u6587\u5b57\uff1a!responseText","ReadyState: !readyState":"ReadyState: !readyState","CustomMessage: !customMessage":"\u81ea\u8a02\u8a0a\u606f\uff1a!customMessage","(active tab)":"(\u4f5c\u7528\u4e2d\u9801\u7c64)","OK":"\u78ba\u5b9a","Hide summary":"\u96b1\u85cf\u6458\u8981","Edit summary":"\u7de8\u8f2f\u6458\u8981","Autocomplete popup":"\u81ea\u52d5\u5b8c\u6210\u5feb\u986f","Searching for matches...":"\u6b63\u5728\u67e5\u627e\u5339\u914d\u9805...","Re-order rows by numerical weight instead of dragging.":"\u900f\u904e\u6578\u5b57\u6b0a\u91cd\u65b9\u5f0f\u4f86\u9032\u884c\u91cd\u65b0\u6392\u5e8f\u3002","Show row weights":"\u986f\u793a\u5217\u6b04\u6b0a\u91cd","Hide row weights":"\u96b1\u85cf\u5217\u6b04\u6b0a\u91cd","The response failed verification so will not be processed.":"\u9a57\u8b49\u5931\u6557\uff0c\u4e2d\u6b62\u7a0b\u5e8f\u3002","Not in menu":"\u4e0d\u5b58\u5728\u9
1078\u55ae\u4e2d","Not in book":"\u4e0d\u5b58\u5728\u624b\u518a\u4e2d","New book":"\u5efa\u7acb\u65b0\u624b\u518a","New revision":"\u5efa\u7acb\u4fee\u8a02\u7248\u672c","No revision":"\u6c92\u6709\u4fee\u8a02\u7248\u672c","By @name on @date":"\u7531 @name \u65bc @date \u767c\u8868","By @name":"\u4f9d\u540d\u7a31","Not restricted":"\u672a\u53d7\u9650\u5236","Restricted to certain pages":"\u53d7\u9650\u65bc\u7279\u5b9a\u9801\u9762","Not customizable":"\u7121\u6cd5\u81ea\u8a02","The block cannot be placed in this region.":"\u7121\u6cd5\u628a\u5340\u584a\u653e\u5230\u9019\u500b\u5340\u57df\u3002","This permission is inherited from the authenticated user role.":"\u6b64\u6b0a\u9650\u7e7c\u627f\u81ea\u8a3b\u518a\u4f7f\u7528\u8005\u89d2\u8272\u3002","Requires a title":"\u9700\u8981\u586b\u5beb\u6a19\u984c","Don\u0027t display post information":"\u4e0d\u8981\u986f\u793a\u6587\u7ae0\u7684\u5f35\u8cbc\u8cc7\u8a0a","Done":"\u5b8c\u6210","Prev":"\u4e0a\u4e00\u9801","January":"\u4e00\u6708","February":"\u4e8c\u6708","March":"\u4e09\u6708","April":"\u56db\u6708","June":"\u516d\u6708","July":"\u4e03\u6708","August":"\u516b\u6708","September":"\u4e5d\u6708","October":"\u5341\u6708","November":"\u5341\u4e00\u6708","December":"\u5341\u4e8c\u6708","Today":"\u4eca\u5929","Su":"\u65e5","Mo":"\u4e00","Tu":"\u4e8c","We":"\u4e09","Th":"\u56db","Fr":"\u4e94","Sa":"\u516d","mm\/dd\/yy":"yy\/mm\/dd"}} };; 2(function ($) { 3 Drupal.behaviors.ienomore = { 4 attach: function (context, settings) { 5 // refs http://www.sharesoft.in/jquery-browser-msie-alternative-fixed/ 6 var regex = /msie (\d{1,2})/; 7 var userAgent = navigator.userAgent.toLowerCase(); 8 if(userAgent.indexOf('msie') > 0 && regex.test(userAgent)){ 9 var version = parseInt(regex.exec(userAgent)[1]); 10 if(version <= 8) { 11 $ienomore = document.getElementById('ienomore'); 12 document.body.insertBefore($ienomore,document.body.firstChild); 13 $ienomore.style.display = "block"; 14 15 $('.ienomore-img-container').each(function(){ 16 var $this = $(this); 17 var src = $this.data('src'); 18 var alt = $this.data('alt'); 19 $(this).append($('<img src="'+src+'" alt="'+alt+'" />')); 20 }) 21 } 22 } 23 24 } 25 }; 26}(jQuery)); 27; 28/*! Magnific Popup - v1.1.0 - 2016-02-20 29* http://dimsemenov.com/plugins/magnific-popup/ 30* Copyright (c) 2016 Dmitry Semenov; */ 31;(function (factory) { 32if (typeof define === 'function' && define.amd) { 33 // AMD. Register as an anonymous module. 34 define(['jquery'], factory); 35 } else if (typeof exports === 'object') { 36 // Node/CommonJS 37 factory(require('jquery')); 38 } else { 39 // Browser globals 40 factory(window.jQuery || window.Zepto); 41 } 42 }(function($) { 43 44/*>>core*/ 45/** 46 * 47 * Magnific Popup Core JS file 48 * 49 */ 50 51 52/** 53 * Private static constants 54 */ 55var CLOSE_EVENT = 'Close', 56 BEFORE_CLOSE_EVENT = 'BeforeClose', 57 AFTER_CLOSE_EVENT = 'AfterClose', 58 BEFORE_APPEND_EVENT = 'BeforeAppend', 59 MARKUP_PARSE_EVENT = 'MarkupParse', 60 OPEN_EVENT = 'Open', 61 CHANGE_EVENT = 'Change', 62 NS = 'mfp', 63 EVENT_NS = '.' + NS, 64 READY_CLASS = 'mfp-ready', 65 REMOVING_CLASS = 'mfp-removing', 66 PREVENT_CLOSE_CLASS = 'mfp-prevent-close'; 67 68 69/** 70 * Private vars 71 */ 72/*jshint -W079 */ 73var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this' 74 MagnificPopup = function(){}, 75 _isJQ = !!(window.jQuery), 76 _prevStatus, 77 _window = $(window), 78 _document, 79 _prevContentType, 80 _wrapClasses, 81 _currPopupType; 82 83 84/** 85 * Private functions 86 */ 87var _mfpOn = function(name, f) { 88 mfp.ev.on(NS + name + EVENT_NS, f); 89 }, 90 _getEl = function(className, appendTo, html, raw) { 91 var el = document.createElement('div'); 92 el.className = 'mfp-'+className; 93 if(html) { 94 el.innerHTML = html; 95 } 96 if(!raw) { 97 el = $(el); 98 if(appendTo) { 99 el.appendTo(appendTo); 100 } 101 } else if(appendTo) { 102 appendTo.appendChild(el); 103 } 104 return el; 105 }, 106 _mfpTrigger = function(e, data) { 107 mfp.ev.triggerHandler(NS + e, data); 108 109 if(mfp.st.callbacks) { 110 // converts "mfpEventName" to "eventName" callback and triggers it if it's present 111 e = e.charAt(0).toLowerCase() + e.slice(1); 112 if(mfp.st.callbacks[e]) { 113 mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]); 114 } 115 } 116 }, 117 _getCloseBtn = function(type) { 118 if(type !== _currPopupType || !mfp.currTemplate.closeBtn) { 119 mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) ); 120 _currPopupType = type; 121 } 122 return mfp.currTemplate.closeBtn; 123 }, 124 // Initialize Magnific Popup only when called at least once 125 _checkInstance = function() { 126 if(!$.magnificPopup.instance) { 127 /*jshint -W020 */ 128 mfp = new MagnificPopup(); 129 mfp.init(); 130 $.magnificPopup.instance = mfp; 131 } 132 }, 133 // CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr 134 supportsTransitions = function() { 135 var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist 136 v = ['ms','O','Moz','Webkit']; // 'v' for vendor 137 138 if( s['transition'] !== undefined ) { 139 return true; 140 } 141 142 while( v.length ) { 143 if( v.pop() + 'Transition' in s ) { 144 return true; 145 } 146 } 147 148 return false;
vendor: 24,193 bytes, lines 149-1251
149 }; 150 151 152 153/** 154 * Public functions 155 */ 156MagnificPopup.prototype = { 157 158 constructor: MagnificPopup, 159 160 /** 161 * Initializes Magnific Popup plugin. 162 * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed 163 */ 164 init: function() { 165 var appVersion = navigator.appVersion; 166 mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener; 167 mfp.isAndroid = (/android/gi).test(appVersion); 168 mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion); 169 mfp.supportsTransition = supportsTransitions(); 170 171 // We disable fixed positioned lightbox on devices that don't handle it nicely. 172 // If you know a better way of detecting this - let me know. 173 mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) ); 174 _document = $(document); 175 176 mfp.popupsCache = {}; 177 }, 178 179 /** 180 * Opens popup 181 * @param data [description] 182 */ 183 open: function(data) { 184 185 var i; 186 187 if(data.isObj === false) { 188 // convert jQuery collection to array to avoid conflicts later 189 mfp.items = data.items.toArray(); 190 191 mfp.index = 0; 192 var items = data.items, 193 item; 194 for(i = 0; i < items.length; i++) { 195 item = items[i]; 196 if(item.parsed) { 197 item = item.el[0]; 198 } 199 if(item === data.el[0]) { 200 mfp.index = i; 201 break; 202 } 203 } 204 } else { 205 mfp.items = $.isArray(data.items) ? data.items : [data.items]; 206 mfp.index = data.index || 0; 207 } 208 209 // if popup is already opened - we just update the content 210 if(mfp.isOpen) { 211 mfp.updateItemHTML(); 212 return; 213 } 214 215 mfp.types = []; 216 _wrapClasses = ''; 217 if(data.mainEl && data.mainEl.length) { 218 mfp.ev = data.mainEl.eq(0); 219 } else { 220 mfp.ev = _document; 221 } 222 223 if(data.key) { 224 if(!mfp.popupsCache[data.key]) { 225 mfp.popupsCache[data.key] = {}; 226 } 227 mfp.currTemplate = mfp.popupsCache[data.key]; 228 } else { 229 mfp.currTemplate = {}; 230 } 231 232 233 234 mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data ); 235 mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos; 236 237 if(mfp.st.modal) { 238 mfp.st.closeOnContentClick = false; 239 mfp.st.closeOnBgClick = false; 240 mfp.st.showCloseBtn = false; 241 mfp.st.enableEscapeKey = false; 242 } 243 244 245 // Building markup 246 // main containers are created only once 247 if(!mfp.bgOverlay) { 248 249 // Dark overlay 250 mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() { 251 mfp.close(); 252 }); 253 254 mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) { 255 if(mfp._checkIfClose(e.target)) { 256 mfp.close(); 257 } 258 }); 259 260 mfp.container = _getEl('container', mfp.wrap); 261 } 262 263 mfp.contentContainer = _getEl('content'); 264 if(mfp.st.preloader) { 265 mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading); 266 } 267 268 269 // Initializing modules 270 var modules = $.magnificPopup.modules; 271 for(i = 0; i < modules.length; i++) { 272 var n = modules[i]; 273 n = n.charAt(0).toUpperCase() + n.slice(1); 274 mfp['init'+n].call(mfp); 275 } 276 _mfpTrigger('BeforeOpen'); 277 278 279 if(mfp.st.showCloseBtn) { 280 // Close button 281 if(!mfp.st.closeBtnInside) { 282 mfp.wrap.append( _getCloseBtn() ); 283 } else { 284 _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) { 285 values.close_replaceWith = _getCloseBtn(item.type); 286 }); 287 _wrapClasses += ' mfp-close-btn-in'; 288 } 289 } 290 291 if(mfp.st.alignTop) { 292 _wrapClasses += ' mfp-align-top'; 293 } 294 295 296 297 if(mfp.fixedContentPos) { 298 mfp.wrap.css({ 299 overflow: mfp.st.overflowY, 300 overflowX: 'hidden', 301 overflowY: mfp.st.overflowY 302 }); 303 } else { 304 mfp.wrap.css({ 305 top: _window.scrollTop(), 306 position: 'absolute' 307 }); 308 } 309 if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) { 310 mfp.bgOverlay.css({ 311 height: _document.height(), 312 position: 'absolute' 313 }); 314 } 315 316 317 318 if(mfp.st.enableEscapeKey) { 319 // Close on ESC key 320 _document.on('keyup' + EVENT_NS, function(e) { 321 if(e.keyCode === 27) { 322 mfp.close(); 323 } 324 }); 325 } 326 327 _window.on('resize' + EVENT_NS, function() { 328 mfp.updateSize(); 329 }); 330 331 332 if(!mfp.st.closeOnContentClick) { 333 _wrapClasses += ' mfp-auto-cursor'; 334 } 335 336 if(_wrapClasses) 337 mfp.wrap.addClass(_wrapClasses); 338 339 340 // this triggers recalculation of layout, so we get it once to not to trigger twice 341 var windowHeight = mfp.wH = _window.height(); 342 343 344 var windowStyles = {}; 345 346 if( mfp.fixedContentPos ) { 347 if(mfp._hasScrollBar(windowHeight)){ 348 var s = mfp._getScrollbarSize(); 349 if(s) { 350 windowStyles.marginRight = s; 351 } 352 } 353 } 354 355 if(mfp.fixedContentPos) { 356 if(!mfp.isIE7) { 357 windowStyles.overflow = 'hidden'; 358 } else { 359 // ie7 double-scroll bug 360 $('body, html').css('overflow', 'hidden'); 361 } 362 } 363 364 365 366 var classesToadd = mfp.st.mainClass; 367 if(mfp.isIE7) { 368 classesToadd += ' mfp-ie7'; 369 } 370 if(classesToadd) { 371 mfp._addClassToMFP( classesToadd ); 372 } 373 374 // add content 375 mfp.updateItemHTML(); 376 377 _mfpTrigger('BuildControls'); 378 379 // remove scrollbar, add margin e.t.c 380 $('html').css(windowStyles); 381 382 // add everything to DOM 383 mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) ); 384 385 // Save last focused element 386 mfp._lastFocusedEl = document.activeElement; 387 388 // Wait for next cycle to allow CSS transition 389 setTimeout(function() { 390 391 if(mfp.content) { 392 mfp._addClassToMFP(READY_CLASS); 393 mfp._setFocus(); 394 } else { 395 // if content is not defined (not loaded e.t.c) we add class only for BG 396 mfp.bgOverlay.addClass(READY_CLASS); 397 } 398 399 // Trap the focus in popup 400 _document.on('focusin' + EVENT_NS, mfp._onFocusIn); 401 402 }, 16); 403 404 mfp.isOpen = true; 405 mfp.updateSize(windowHeight); 406 _mfpTrigger(OPEN_EVENT); 407 408 return data; 409 }, 410 411 /** 412 * Closes the popup 413 */ 414 close: function() { 415 if(!mfp.isOpen) return; 416 _mfpTrigger(BEFORE_CLOSE_EVENT); 417 418 mfp.isOpen = false; 419 // for CSS3 animation 420 if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) { 421 mfp._addClassToMFP(REMOVING_CLASS); 422 setTimeout(function() { 423 mfp._close(); 424 }, mfp.st.removalDelay); 425 } else { 426 mfp._close(); 427 } 428 }, 429 430 /** 431 * Helper for close() function 432 */ 433 _close: function() { 434 _mfpTrigger(CLOSE_EVENT); 435 436 var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' '; 437 438 mfp.bgOverlay.detach(); 439 mfp.wrap.detach(); 440 mfp.container.empty(); 441 442 if(mfp.st.mainClass) { 443 classesToRemove += mfp.st.mainClass + ' '; 444 } 445 446 mfp._removeClassFromMFP(classesToRemove); 447 448 if(mfp.fixedContentPos) { 449 var windowStyles = {marginRight: ''}; 450 if(mfp.isIE7) { 451 $('body, html').css('overflow', ''); 452 } else { 453 windowStyles.overflow = ''; 454 } 455 $('html').css(windowStyles); 456 } 457 458 _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS); 459 mfp.ev.off(EVENT_NS); 460 461 // clean up DOM elements that aren't removed 462 mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style'); 463 mfp.bgOverlay.attr('class', 'mfp-bg'); 464 mfp.container.attr('class', 'mfp-container'); 465 466 // remove close button from target element 467 if(mfp.st.showCloseBtn && 468 (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) { 469 if(mfp.currTemplate.closeBtn) 470 mfp.currTemplate.closeBtn.detach(); 471 } 472 473 474 if(mfp.st.autoFocusLast && mfp._lastFocusedEl) { 475 $(mfp._lastFocusedEl).focus(); // put tab focus back 476 } 477 mfp.currItem = null; 478 mfp.content = null; 479 mfp.currTemplate = null; 480 mfp.prevHeight = 0; 481 482 _mfpTrigger(AFTER_CLOSE_EVENT); 483 }, 484 485 updateSize: function(winHeight) { 486 487 if(mfp.isIOS) { 488 // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2 489 var zoomLevel = document.documentElement.clientWidth / window.innerWidth; 490 var height = window.innerHeight * zoomLevel; 491 mfp.wrap.css('height', height); 492 mfp.wH = height; 493 } else { 494 mfp.wH = winHeight || _window.height(); 495 } 496 // Fixes #84: popup incorrectly positioned with position:relative on body 497 if(!mfp.fixedContentPos) { 498 mfp.wrap.css('height', mfp.wH); 499 } 500 501 _mfpTrigger('Resize'); 502 503 }, 504 505 /** 506 * Set content of popup based on current index 507 */ 508 updateItemHTML: function() { 509 var item = mfp.items[mfp.index]; 510 511 // Detach and perform modifications 512 mfp.contentContainer.detach(); 513 514 if(mfp.content) 515 mfp.content.detach(); 516 517 if(!item.parsed) { 518 item = mfp.parseEl( mfp.index ); 519 } 520 521 var type = item.type; 522 523 _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]); 524 // BeforeChange event works like so: 525 // _mfpOn('BeforeChange', function(e, prevType, newType) { }); 526 527 mfp.currItem = item; 528 529 if(!mfp.currTemplate[type]) { 530 var markup = mfp.st[type] ? mfp.st[type].markup : false; 531 532 // allows to modify markup 533 _mfpTrigger('FirstMarkupParse', markup); 534 535 if(markup) { 536 mfp.currTemplate[type] = $(markup); 537 } else { 538 // if there is no markup found we just define that template is parsed 539 mfp.currTemplate[type] = true; 540 } 541 } 542 543 if(_prevContentType && _prevContentType !== item.type) { 544 mfp.container.removeClass('mfp-'+_prevContentType+'-holder'); 545 } 546 547 var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]); 548 mfp.appendContent(newContent, type); 549 550 item.preloaded = true; 551 552 _mfpTrigger(CHANGE_EVENT, item); 553 _prevContentType = item.type; 554 555 // Append container back after its content changed 556 mfp.container.prepend(mfp.contentContainer); 557 558 _mfpTrigger('AfterChange'); 559 }, 560 561 562 /** 563 * Set HTML content of popup 564 */ 565 appendContent: function(newContent, type) { 566 mfp.content = newContent; 567 568 if(newContent) { 569 if(mfp.st.showCloseBtn && mfp.st.closeBtnInside && 570 mfp.currTemplate[type] === true) { 571 // if there is no markup, we just append close button element inside 572 if(!mfp.content.find('.mfp-close').length) { 573 mfp.content.append(_getCloseBtn()); 574 } 575 } else { 576 mfp.content = newContent; 577 } 578 } else { 579 mfp.content = ''; 580 } 581 582 _mfpTrigger(BEFORE_APPEND_EVENT); 583 mfp.container.addClass('mfp-'+type+'-holder'); 584 585 mfp.contentContainer.append(mfp.content); 586 }, 587 588 589 /** 590 * Creates Magnific Popup data object based on given data 591 * @param {int} index Index of item to parse 592 */ 593 parseEl: function(index) { 594 var item = mfp.items[index], 595 type; 596 597 if(item.tagName) { 598 item = { el: $(item) }; 599 } else { 600 type = item.type; 601 item = { data: item, src: item.src }; 602 } 603 604 if(item.el) { 605 var types = mfp.types; 606 607 // check for 'mfp-TYPE' class 608 for(var i = 0; i < types.length; i++) { 609 if( item.el.hasClass('mfp-'+types[i]) ) { 610 type = types[i]; 611 break; 612 } 613 } 614 615 item.src = item.el.attr('data-mfp-src'); 616 if(!item.src) { 617 item.src = item.el.attr('href'); 618 } 619 } 620 621 item.type = type || mfp.st.type || 'inline'; 622 item.index = index; 623 item.parsed = true; 624 mfp.items[index] = item; 625 _mfpTrigger('ElementParse', item); 626 627 return mfp.items[index]; 628 }, 629 630 631 /** 632 * Initializes single popup or a group of popups 633 */ 634 addGroup: function(el, options) { 635 var eHandler = function(e) { 636 e.mfpEl = this; 637 mfp._openClick(e, el, options); 638 }; 639 640 if(!options) { 641 options = {}; 642 } 643 644 var eName = 'click.magnificPopup'; 645 options.mainEl = el; 646 647 if(options.items) { 648 options.isObj = true; 649 el.off(eName).on(eName, eHandler); 650 } else { 651 options.isObj = false; 652 if(options.delegate) { 653 el.off(eName).on(eName, options.delegate , eHandler); 654 } else { 655 options.items = el; 656 el.off(eName).on(eName, eHandler); 657 } 658 } 659 }, 660 _openClick: function(e, el, options) { 661 var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick; 662 663 664 if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) { 665 return; 666 } 667 668 var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn; 669 670 if(disableOn) { 671 if($.isFunction(disableOn)) { 672 if( !disableOn.call(mfp) ) { 673 return true; 674 } 675 } else { // else it's number 676 if( _window.width() < disableOn ) { 677 return true; 678 } 679 } 680 } 681 682 if(e.type) { 683 e.preventDefault(); 684 685 // This will prevent popup from closing if element is inside and popup is already opened 686 if(mfp.isOpen) { 687 e.stopPropagation(); 688 } 689 } 690 691 options.el = $(e.mfpEl); 692 if(options.delegate) { 693 options.items = el.find(options.delegate); 694 } 695 mfp.open(options); 696 }, 697 698 699 /** 700 * Updates text on preloader 701 */ 702 updateStatus: function(status, text) { 703 704 if(mfp.preloader) { 705 if(_prevStatus !== status) { 706 mfp.container.removeClass('mfp-s-'+_prevStatus); 707 } 708 709 if(!text && status === 'loading') { 710 text = mfp.st.tLoading; 711 } 712 713 var data = { 714 status: status, 715 text: text 716 }; 717 // allows to modify status 718 _mfpTrigger('UpdateStatus', data); 719 720 status = data.status; 721 text = data.text; 722 723 mfp.preloader.html(text); 724 725 mfp.preloader.find('a').on('click', function(e) { 726 e.stopImmediatePropagation(); 727 }); 728 729 mfp.container.addClass('mfp-s-'+status); 730 _prevStatus = status; 731 } 732 }, 733 734 735 /* 736 "Private" helpers that aren't private at all 737 */ 738 // Check to close popup or not 739 // "target" is an element that was clicked 740 _checkIfClose: function(target) { 741 742 if($(target).hasClass(PREVENT_CLOSE_CLASS)) { 743 return; 744 } 745 746 var closeOnContent = mfp.st.closeOnContentClick; 747 var closeOnBg = mfp.st.closeOnBgClick; 748 749 if(closeOnContent && closeOnBg) { 750 return true; 751 } else { 752 753 // We close the popup if click is on close button or on preloader. Or if there is no content. 754 if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) { 755 return true; 756 } 757 758 // if click is outside the content 759 if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) { 760 if(closeOnBg) { 761 // last check, if the clicked element is in DOM, (in case it's removed onclick) 762 if( $.contains(document, target) ) { 763 return true; 764 } 765 } 766 } else if(closeOnContent) { 767 return true; 768 } 769 770 } 771 return false; 772 }, 773 _addClassToMFP: function(cName) { 774 mfp.bgOverlay.addClass(cName); 775 mfp.wrap.addClass(cName); 776 }, 777 _removeClassFromMFP: function(cName) { 778 this.bgOverlay.removeClass(cName); 779 mfp.wrap.removeClass(cName); 780 }, 781 _hasScrollBar: function(winHeight) { 782 return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) ); 783 }, 784 _setFocus: function() { 785 (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus(); 786 }, 787 _onFocusIn: function(e) { 788 if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) { 789 mfp._setFocus(); 790 return false; 791 } 792 }, 793 _parseMarkup: function(template, values, item) { 794 var arr; 795 if(item.data) { 796 values = $.extend(item.data, values); 797 } 798 _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] ); 799 800 $.each(values, function(key, value) { 801 if(value === undefined || value === false) { 802 return true; 803 } 804 arr = key.split('_'); 805 if(arr.length > 1) { 806 var el = template.find(EVENT_NS + '-'+arr[0]); 807 808 if(el.length > 0) { 809 var attr = arr[1]; 810 if(attr === 'replaceWith') { 811 if(el[0] !== value[0]) { 812 el.replaceWith(value); 813 } 814 } else if(attr === 'img') { 815 if(el.is('img')) { 816 el.attr('src', value); 817 } else { 818 el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) ); 819 } 820 } else { 821 el.attr(arr[1], value); 822 } 823 } 824 825 } else { 826 template.find(EVENT_NS + '-'+key).html(value); 827 } 828 }); 829 }, 830 831 _getScrollbarSize: function() { 832 // thx David 833 if(mfp.scrollbarSize === undefined) { 834 var scrollDiv = document.createElement("div"); 835 scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;'; 836 document.body.appendChild(scrollDiv); 837 mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth; 838 document.body.removeChild(scrollDiv); 839 } 840 return mfp.scrollbarSize; 841 } 842 843}; /* MagnificPopup core prototype end */ 844 845 846 847 848/** 849 * Public static functions 850 */ 851$.magnificPopup = { 852 instance: null, 853 proto: MagnificPopup.prototype, 854 modules: [], 855 856 open: function(options, index) { 857 _checkInstance(); 858 859 if(!options) { 860 options = {}; 861 } else { 862 options = $.extend(true, {}, options); 863 } 864 865 options.isObj = true; 866 options.index = index || 0; 867 return this.instance.open(options); 868 }, 869 870 close: function() { 871 return $.magnificPopup.instance && $.magnificPopup.instance.close(); 872 }, 873 874 registerModule: function(name, module) { 875 if(module.options) { 876 $.magnificPopup.defaults[name] = module.options; 877 } 878 $.extend(this.proto, module.proto); 879 this.modules.push(name); 880 }, 881 882 defaults: { 883 884 // Info about options is in docs: 885 // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options 886 887 disableOn: 0, 888 889 key: null, 890 891 midClick: false, 892 893 mainClass: '', 894 895 preloader: true, 896 897 focus: '', // CSS selector of input to focus after popup is opened 898 899 closeOnContentClick: false, 900 901 closeOnBgClick: true, 902 903 closeBtnInside: true, 904 905 showCloseBtn: true, 906 907 enableEscapeKey: true, 908 909 modal: false, 910 911 alignTop: false, 912 913 removalDelay: 0, 914 915 prependTo: null, 916 917 fixedContentPos: 'auto', 918 919 fixedBgPos: 'auto', 920 921 overflowY: 'auto', 922 923 closeMarkup: '<button title="%title%" type="button" class="mfp-close">×</button>', 924 925 tClose: 'Close (Esc)', 926 927 tLoading: 'Loading...', 928 929 autoFocusLast: true 930 931 } 932}; 933 934 935 936$.fn.magnificPopup = function(options) { 937 _checkInstance(); 938 939 var jqEl = $(this); 940 941 // We call some API method of first param is a string 942 if (typeof options === "string" ) { 943 944 if(options === 'open') { 945 var items, 946 itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup, 947 index = parseInt(arguments[1], 10) || 0; 948 949 if(itemOpts.items) { 950 items = itemOpts.items[index]; 951 } else { 952 items = jqEl; 953 if(itemOpts.delegate) { 954 items = items.find(itemOpts.delegate); 955 } 956 items = items.eq( index ); 957 } 958 mfp._openClick({mfpEl:items}, jqEl, itemOpts); 959 } else { 960 if(mfp.isOpen) 961 mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1)); 962 } 963 964 } else { 965 // clone options obj 966 options = $.extend(true, {}, options); 967 968 /* 969 * As Zepto doesn't support .data() method for objects 970 * and it works only in normal browsers 971 * we assign "options" object directly to the DOM element. FTW! 972 */ 973 if(_isJQ) { 974 jqEl.data('magnificPopup', options); 975 } else { 976 jqEl[0].magnificPopup = options; 977 } 978 979 mfp.addGroup(jqEl, options); 980 981 } 982 return jqEl; 983}; 984 985/*>>core*/ 986 987/*>>inline*/ 988 989var INLINE_NS = 'inline', 990 _hiddenClass, 991 _inlinePlaceholder, 992 _lastInlineElement, 993 _putInlineElementsBack = function() { 994 if(_lastInlineElement) { 995 _inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach(); 996 _lastInlineElement = null; 997 } 998 }; 999 1000$.magnificPopup.registerModule(INLINE_NS, { 1001 options: { 1002 hiddenClass: 'hide', // will be appended with `mfp-` prefix 1003 markup: '', 1004 tNotFound: 'Content not found' 1005 }, 1006 proto: { 1007 1008 initInline: function() { 1009 mfp.types.push(INLINE_NS); 1010 1011 _mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() { 1012 _putInlineElementsBack(); 1013 }); 1014 }, 1015 1016 getInline: function(item, template) { 1017 1018 _putInlineElementsBack(); 1019 1020 if(item.src) { 1021 var inlineSt = mfp.st.inline, 1022 el = $(item.src); 1023 1024 if(el.length) { 1025 1026 // If target element has parent - we replace it with placeholder and put it back after popup is closed 1027 var parent = el[0].parentNode; 1028 if(parent && parent.tagName) { 1029 if(!_inlinePlaceholder) { 1030 _hiddenClass = inlineSt.hiddenClass; 1031 _inlinePlaceholder = _getEl(_hiddenClass); 1032 _hiddenClass = 'mfp-'+_hiddenClass; 1033 } 1034 // replace target inline element with placeholder 1035 _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass); 1036 } 1037 1038 mfp.updateStatus('ready'); 1039 } else { 1040 mfp.updateStatus('error', inlineSt.tNotFound); 1041 el = $('<div>'); 1042 } 1043 1044 item.inlineElement = el; 1045 return el; 1046 } 1047 1048 mfp.updateStatus('ready'); 1049 mfp._parseMarkup(template, {}, item); 1050 return template; 1051 } 1052 } 1053}); 1054 1055/*>>inline*/ 1056 1057/*>>ajax*/ 1058var AJAX_NS = 'ajax', 1059 _ajaxCur, 1060 _removeAjaxCursor = function() { 1061 if(_ajaxCur) { 1062 $(document.body).removeClass(_ajaxCur); 1063 } 1064 }, 1065 _destroyAjaxRequest = function() { 1066 _removeAjaxCursor(); 1067 if(mfp.req) { 1068 mfp.req.abort(); 1069 } 1070 }; 1071 1072$.magnificPopup.registerModule(AJAX_NS, { 1073 1074 options: { 1075 settings: null, 1076 cursor: 'mfp-ajax-cur', 1077 tError: '<a href="%url%">The content</a> could not be loaded.' 1078 }, 1079 1080 proto: { 1081 initAjax: function() { 1082 mfp.types.push(AJAX_NS); 1083 _ajaxCur = mfp.st.ajax.cursor; 1084 1085 _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest); 1086 _mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest); 1087 }, 1088 getAjax: function(item) { 1089 1090 if(_ajaxCur) { 1091 $(document.body).addClass(_ajaxCur); 1092 } 1093 1094 mfp.updateStatus('loading'); 1095 1096 var opts = $.extend({ 1097 url: item.src, 1098 success: function(data, textStatus, jqXHR) { 1099 var temp = { 1100 data:data, 1101 xhr:jqXHR 1102 }; 1103 1104 _mfpTrigger('ParseAjax', temp); 1105 1106 mfp.appendContent( $(temp.data), AJAX_NS ); 1107 1108 item.finished = true; 1109 1110 _removeAjaxCursor(); 1111 1112 mfp._setFocus(); 1113 1114 setTimeout(function() { 1115 mfp.wrap.addClass(READY_CLASS); 1116 }, 16); 1117 1118 mfp.updateStatus('ready'); 1119 1120 _mfpTrigger('AjaxContentAdded'); 1121 }, 1122 error: function() { 1123 _removeAjaxCursor(); 1124 item.finished = item.loadError = true; 1125 mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src)); 1126 } 1127 }, mfp.st.ajax.settings); 1128 1129 mfp.req = $.ajax(opts); 1130 1131 return ''; 1132 } 1133 } 1134}); 1135 1136/*>>ajax*/ 1137 1138/*>>image*/ 1139var _imgInterval, 1140 _getTitle = function(item) { 1141 if(item.data && item.data.title !== undefined) 1142 return item.data.title; 1143 1144 var src = mfp.st.image.titleSrc; 1145 1146 if(src) { 1147 if($.isFunction(src)) { 1148 return src.call(mfp, item); 1149 } else if(item.el) { 1150 return item.el.attr(src) || ''; 1151 } 1152 } 1153 return ''; 1154 }; 1155 1156$.magnificPopup.registerModule('image', { 1157 1158 options: { 1159 markup: '<div class="mfp-figure">'+ 1160 '<div class="mfp-close"></div>'+ 1161 '<figure>'+ 1162 '<div class="mfp-img"></div>'+ 1163 '<figcaption>'+ 1164 '<div class="mfp-bottom-bar">'+ 1165 '<div class="mfp-title"></div>'+ 1166 '<div class="mfp-counter"></div>'+ 1167 '</div>'+ 1168 '</figcaption>'+ 1169 '</figure>'+ 1170 '</div>', 1171 cursor: 'mfp-zoom-out-cur', 1172 titleSrc: 'title', 1173 verticalFit: true, 1174 tError: '<a href="%url%">The image</a> could not be loaded.' 1175 }, 1176 1177 proto: { 1178 initImage: function() { 1179 var imgSt = mfp.st.image, 1180 ns = '.image'; 1181 1182 mfp.types.push('image'); 1183 1184 _mfpOn(OPEN_EVENT+ns, function() { 1185 if(mfp.currItem.type === 'image' && imgSt.cursor) { 1186 $(document.body).addClass(imgSt.cursor); 1187 } 1188 }); 1189 1190 _mfpOn(CLOSE_EVENT+ns, function() { 1191 if(imgSt.cursor) { 1192 $(document.body).removeClass(imgSt.cursor); 1193 } 1194 _window.off('resize' + EVENT_NS); 1195 }); 1196 1197 _mfpOn('Resize'+ns, mfp.resizeImage); 1198 if(mfp.isLowIE) { 1199 _mfpOn('AfterChange', mfp.resizeImage); 1200 } 1201 }, 1202 resizeImage: function() { 1203 var item = mfp.currItem; 1204 if(!item || !item.img) return; 1205 1206 if(mfp.st.image.verticalFit) { 1207 var decr = 0; 1208 // fix box-sizing in ie7/8 1209 if(mfp.isLowIE) { 1210 decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10); 1211 } 1212 item.img.css('max-height', mfp.wH-decr); 1213 } 1214 }, 1215 _onImageHasSize: function(item) { 1216 if(item.img) { 1217 1218 item.hasSize = true; 1219 1220 if(_imgInterval) { 1221 clearInterval(_imgInterval); 1222 } 1223 1224 item.isCheckingImgSize = false; 1225 1226 _mfpTrigger('ImageHasSize', item); 1227 1228 if(item.imgHidden) { 1229 if(mfp.content) 1230 mfp.content.removeClass('mfp-loading'); 1231 1232 item.imgHidden = false; 1233 } 1234 1235 } 1236 }, 1237 1238 /** 1239 * Function that loops until the image has size to display elements that rely on it asap 1240 */ 1241 findImageSize: function(item) { 1242 1243 var counter = 0, 1244 img = item.img[0], 1245 mfpSetInterval = function(delay) { 1246 1247 if(_imgInterval) { 1248 clearInterval(_imgInterval); 1249 } 1250 // decelerating interval that checks for size of an image 1251 _imgInterval = setInterval(function() {
1252 if(img.naturalWidth > 0) { 1253 mfp._onImageHasSize(item); 1254 return; 1255 } 1256 1257 if(counter > 200) { 1258 clearInterval(_imgInterval); 1259 } 1260 1261 counter++; 1262 if(counter === 3) { 1263 mfpSetInterval(10); 1264 } else if(counter === 40) { 1265 mfpSetInterval(50); 1266 } else if(counter === 100) { 1267 mfpSetInterval(500); 1268 } 1269 }, delay); 1270 }; 1271 1272 mfpSetInterval(1); 1273 }, 1274 1275 getImage: function(item, template) { 1276 1277 var guard = 0, 1278 1279 // image load complete handler 1280 onLoadComplete = function() { 1281 if(item) { 1282 if (item.img[0].complete) { 1283 item.img.off('.mfploader'); 1284 1285 if(item === mfp.currItem){ 1286 mfp._onImageHasSize(item); 1287 1288 mfp.updateStatus('ready'); 1289 } 1290 1291 item.hasSize = true; 1292 item.loaded = true; 1293 1294 _mfpTrigger('ImageLoadComplete'); 1295 1296 } 1297 else { 1298 // if image complete check fails 200 times (20 sec), we assume that there was an error. 1299 guard++; 1300 if(guard < 200) { 1301 setTimeout(onLoadComplete,100); 1302 } else { 1303 onLoadError(); 1304 } 1305 } 1306 } 1307 }, 1308 1309 // image error handler 1310 onLoadError = function() { 1311 if(item) { 1312 item.img.off('.mfploader'); 1313 if(item === mfp.currItem){ 1314 mfp._onImageHasSize(item); 1315 mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); 1316 } 1317 1318 item.hasSize = true; 1319 item.loaded = true; 1320 item.loadError = true; 1321 } 1322 }, 1323 imgSt = mfp.st.image; 1324 1325 1326 var el = template.find('.mfp-img'); 1327 if(el.length) { 1328 var img = document.createElement('img'); 1329 img.className = 'mfp-img'; 1330 if(item.el && item.el.find('img').length) { 1331 img.alt = item.el.find('img').attr('alt'); 1332 } 1333 item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError); 1334 img.src = item.src; 1335 1336 // without clone() "error" event is not firing when IMG is replaced by new IMG
vendor: 8,584 bytes, lines 1337-1720
1337 // TODO: find a way to avoid such cloning 1338 if(el.is('img')) { 1339 item.img = item.img.clone(); 1340 } 1341 1342 img = item.img[0]; 1343 if(img.naturalWidth > 0) { 1344 item.hasSize = true; 1345 } else if(!img.width) { 1346 item.hasSize = false; 1347 } 1348 } 1349 1350 mfp._parseMarkup(template, { 1351 title: _getTitle(item), 1352 img_replaceWith: item.img 1353 }, item); 1354 1355 mfp.resizeImage(); 1356 1357 if(item.hasSize) { 1358 if(_imgInterval) clearInterval(_imgInterval); 1359 1360 if(item.loadError) { 1361 template.addClass('mfp-loading'); 1362 mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); 1363 } else { 1364 template.removeClass('mfp-loading'); 1365 mfp.updateStatus('ready'); 1366 } 1367 return template; 1368 } 1369 1370 mfp.updateStatus('loading'); 1371 item.loading = true; 1372 1373 if(!item.hasSize) { 1374 item.imgHidden = true; 1375 template.addClass('mfp-loading'); 1376 mfp.findImageSize(item); 1377 } 1378 1379 return template; 1380 } 1381 } 1382}); 1383 1384/*>>image*/ 1385 1386/*>>zoom*/ 1387var hasMozTransform, 1388 getHasMozTransform = function() { 1389 if(hasMozTransform === undefined) { 1390 hasMozTransform = document.createElement('p').style.MozTransform !== undefined; 1391 } 1392 return hasMozTransform; 1393 }; 1394 1395$.magnificPopup.registerModule('zoom', { 1396 1397 options: { 1398 enabled: false, 1399 easing: 'ease-in-out', 1400 duration: 300, 1401 opener: function(element) { 1402 return element.is('img') ? element : element.find('img'); 1403 } 1404 }, 1405 1406 proto: { 1407 1408 initZoom: function() { 1409 var zoomSt = mfp.st.zoom, 1410 ns = '.zoom', 1411 image; 1412 1413 if(!zoomSt.enabled || !mfp.supportsTransition) { 1414 return; 1415 } 1416 1417 var duration = zoomSt.duration, 1418 getElToAnimate = function(image) { 1419 var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'), 1420 transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing, 1421 cssObj = { 1422 position: 'fixed', 1423 zIndex: 9999, 1424 left: 0, 1425 top: 0, 1426 '-webkit-backface-visibility': 'hidden' 1427 }, 1428 t = 'transition'; 1429 1430 cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition; 1431 1432 newImg.css(cssObj); 1433 return newImg; 1434 }, 1435 showMainContent = function() { 1436 mfp.content.css('visibility', 'visible'); 1437 }, 1438 openTimeout, 1439 animatedImg; 1440 1441 _mfpOn('BuildControls'+ns, function() { 1442 if(mfp._allowZoom()) { 1443 1444 clearTimeout(openTimeout); 1445 mfp.content.css('visibility', 'hidden'); 1446 1447 // Basically, all code below does is clones existing image, puts in on top of the current one and animated it 1448 1449 image = mfp._getItemToZoom(); 1450 1451 if(!image) { 1452 showMainContent(); 1453 return; 1454 } 1455 1456 animatedImg = getElToAnimate(image); 1457 1458 animatedImg.css( mfp._getOffset() ); 1459 1460 mfp.wrap.append(animatedImg); 1461 1462 openTimeout = setTimeout(function() { 1463 animatedImg.css( mfp._getOffset( true ) ); 1464 openTimeout = setTimeout(function() { 1465 1466 showMainContent(); 1467 1468 setTimeout(function() { 1469 animatedImg.remove(); 1470 image = animatedImg = null; 1471 _mfpTrigger('ZoomAnimationEnded'); 1472 }, 16); // avoid blink when switching images 1473 1474 }, duration); // this timeout equals animation duration 1475 1476 }, 16); // by adding this timeout we avoid short glitch at the beginning of animation 1477 1478 1479 // Lots of timeouts... 1480 } 1481 }); 1482 _mfpOn(BEFORE_CLOSE_EVENT+ns, function() { 1483 if(mfp._allowZoom()) { 1484 1485 clearTimeout(openTimeout); 1486 1487 mfp.st.removalDelay = duration; 1488 1489 if(!image) { 1490 image = mfp._getItemToZoom(); 1491 if(!image) { 1492 return; 1493 } 1494 animatedImg = getElToAnimate(image); 1495 } 1496 1497 animatedImg.css( mfp._getOffset(true) ); 1498 mfp.wrap.append(animatedImg); 1499 mfp.content.css('visibility', 'hidden'); 1500 1501 setTimeout(function() { 1502 animatedImg.css( mfp._getOffset() ); 1503 }, 16); 1504 } 1505 1506 }); 1507 1508 _mfpOn(CLOSE_EVENT+ns, function() { 1509 if(mfp._allowZoom()) { 1510 showMainContent(); 1511 if(animatedImg) { 1512 animatedImg.remove(); 1513 } 1514 image = null; 1515 } 1516 }); 1517 }, 1518 1519 _allowZoom: function() { 1520 return mfp.currItem.type === 'image'; 1521 }, 1522 1523 _getItemToZoom: function() { 1524 if(mfp.currItem.hasSize) { 1525 return mfp.currItem.img; 1526 } else { 1527 return false; 1528 } 1529 }, 1530 1531 // Get element postion relative to viewport 1532 _getOffset: function(isLarge) { 1533 var el; 1534 if(isLarge) { 1535 el = mfp.currItem.img; 1536 } else { 1537 el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem); 1538 } 1539 1540 var offset = el.offset(); 1541 var paddingTop = parseInt(el.css('padding-top'),10); 1542 var paddingBottom = parseInt(el.css('padding-bottom'),10); 1543 offset.top -= ( $(window).scrollTop() - paddingTop ); 1544 1545 1546 /* 1547 1548 Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa. 1549 1550 */ 1551 var obj = { 1552 width: el.width(), 1553 // fix Zepto height+padding issue 1554 height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop 1555 }; 1556 1557 // I hate to do this, but there is no another option 1558 if( getHasMozTransform() ) { 1559 obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)'; 1560 } else { 1561 obj.left = offset.left; 1562 obj.top = offset.top; 1563 } 1564 return obj; 1565 } 1566 1567 } 1568}); 1569 1570 1571 1572/*>>zoom*/ 1573 1574/*>>iframe*/ 1575 1576var IFRAME_NS = 'iframe', 1577 _emptyPage = '//about:blank', 1578 1579 _fixIframeBugs = function(isShowing) { 1580 if(mfp.currTemplate[IFRAME_NS]) { 1581 var el = mfp.currTemplate[IFRAME_NS].find('iframe'); 1582 if(el.length) { 1583 // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug 1584 if(!isShowing) { 1585 el[0].src = _emptyPage; 1586 } 1587 1588 // IE8 black screen bug fix 1589 if(mfp.isIE8) { 1590 el.css('display', isShowing ? 'block' : 'none'); 1591 } 1592 } 1593 } 1594 }; 1595 1596$.magnificPopup.registerModule(IFRAME_NS, { 1597 1598 options: { 1599 markup: '<div class="mfp-iframe-scaler">'+ 1600 '<div class="mfp-close"></div>'+ 1601 '<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+ 1602 '</div>', 1603 1604 srcAction: 'iframe_src', 1605 1606 // we don't care and support only one default type of URL by default 1607 patterns: { 1608 youtube: { 1609 index: 'youtube.com', 1610 id: 'v=', 1611 src: '//www.youtube.com/embed/%id%?autoplay=1' 1612 }, 1613 vimeo: { 1614 index: 'vimeo.com/', 1615 id: '/', 1616 src: '//player.vimeo.com/video/%id%?autoplay=1' 1617 }, 1618 gmaps: { 1619 index: '//maps.google.', 1620 src: '%id%&output=embed' 1621 } 1622 } 1623 }, 1624 1625 proto: { 1626 initIframe: function() { 1627 mfp.types.push(IFRAME_NS); 1628 1629 _mfpOn('BeforeChange', function(e, prevType, newType) { 1630 if(prevType !== newType) { 1631 if(prevType === IFRAME_NS) { 1632 _fixIframeBugs(); // iframe if removed 1633 } else if(newType === IFRAME_NS) { 1634 _fixIframeBugs(true); // iframe is showing 1635 } 1636 }// else { 1637 // iframe source is switched, don't do anything 1638 //} 1639 }); 1640 1641 _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() { 1642 _fixIframeBugs(); 1643 }); 1644 }, 1645 1646 getIframe: function(item, template) { 1647 var embedSrc = item.src; 1648 var iframeSt = mfp.st.iframe; 1649 1650 $.each(iframeSt.patterns, function() { 1651 if(embedSrc.indexOf( this.index ) > -1) { 1652 if(this.id) { 1653 if(typeof this.id === 'string') { 1654 embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length); 1655 } else { 1656 embedSrc = this.id.call( this, embedSrc ); 1657 } 1658 } 1659 embedSrc = this.src.replace('%id%', embedSrc ); 1660 return false; // break; 1661 } 1662 }); 1663 1664 var dataObj = {}; 1665 if(iframeSt.srcAction) { 1666 dataObj[iframeSt.srcAction] = embedSrc; 1667 } 1668 mfp._parseMarkup(template, dataObj, item); 1669 1670 mfp.updateStatus('ready'); 1671 1672 return template; 1673 } 1674 } 1675}); 1676 1677 1678 1679/*>>iframe*/ 1680 1681/*>>gallery*/ 1682/** 1683 * Get looped index depending on number of slides 1684 */ 1685var _getLoopedId = function(index) { 1686 var numSlides = mfp.items.length; 1687 if(index > numSlides - 1) { 1688 return index - numSlides; 1689 } else if(index < 0) { 1690 return numSlides + index; 1691 } 1692 return index; 1693 }, 1694 _replaceCurrTotal = function(text, curr, total) { 1695 return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total); 1696 }; 1697 1698$.magnificPopup.registerModule('gallery', { 1699 1700 options: { 1701 enabled: false, 1702 arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', 1703 preload: [0,2], 1704 navigateByImgClick: true, 1705 arrows: true, 1706 1707 tPrev: 'Previous (Left arrow key)', 1708 tNext: 'Next (Right arrow key)', 1709 tCounter: '%curr% of %total%' 1710 }, 1711 1712 proto: { 1713 initGallery: function() { 1714 1715 var gSt = mfp.st.gallery, 1716 ns = '.mfp-gallery'; 1717 1718 mfp.direction = true; // true - next, false - prev 1719 1720 if(!gSt || !gSt.enabled ) return false;
1721 1722 _wrapClasses += ' mfp-gallery'; 1723 1724 _mfpOn(OPEN_EVENT+ns, function() { 1725 1726 if(gSt.navigateByImgClick) { 1727 mfp.wrap.on('click'+ns, '.mfp-img', function() { 1728 if(mfp.items.length > 1) { 1729 mfp.next(); 1730 return false; 1731 } 1732 }); 1733 } 1734 1735 _document.on('keydown'+ns, function(e) { 1736 if (e.keyCode === 37) { 1737 mfp.prev(); 1738 } else if (e.keyCode === 39) { 1739 mfp.next(); 1740 } 1741 }); 1742 }); 1743 1744 _mfpOn('UpdateStatus'+ns, function(e, data) { 1745 if(data.text) { 1746 data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length); 1747 } 1748 }); 1749 1750 _mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) { 1751 var l = mfp.items.length; 1752 values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : ''; 1753 }); 1754 1755 _mfpOn('BuildControls' + ns, function() { 1756 if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) { 1757 var markup = gSt.arrowMarkup, 1758 arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS), 1759 arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS); 1760 1761 arrowLeft.click(function() { 1762 mfp.prev(); 1763 }); 1764 arrowRight.click(function() { 1765 mfp.next(); 1766 }); 1767 1768 mfp.container.append(arrowLeft.add(arrowRight)); 1769 } 1770 }); 1771 1772 _mfpOn(CHANGE_EVENT+ns, function() { 1773 if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout); 1774 1775 mfp._preloadTimeout = setTimeout(function() { 1776 mfp.preloadNearbyImages(); 1777 mfp._preloadTimeout = null; 1778 }, 16); 1779 }); 1780 1781 1782 _mfpOn(CLOSE_EVENT+ns, function() { 1783 _document.off(ns); 1784 mfp.wrap.off('click'+ns); 1785 mfp.arrowRight = mfp.arrowLeft = null; 1786 }); 1787 1788 }, 1789 next: function() { 1790 mfp.direction = true; 1791 mfp.index = _getLoopedId(mfp.index + 1); 1792 mfp.updateItemHTML(); 1793 }, 1794 prev: function() { 1795 mfp.direction = false; 1796 mfp.index = _getLoopedId(mfp.index - 1); 1797 mfp.updateItemHTML(); 1798 }, 1799 goTo: function(newIndex) { 1800 mfp.direction = (newIndex >= mfp.index); 1801 mfp.index = newIndex; 1802 mfp.updateItemHTML(); 1803 }, 1804 preloadNearbyImages: function() { 1805 var p = mfp.st.gallery.preload, 1806 preloadBefore = Math.min(p[0], mfp.items.length), 1807 preloadAfter = Math.min(p[1], mfp.items.length), 1808 i; 1809 1810 for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) { 1811 mfp._preloadItem(mfp.index+i); 1812 } 1813 for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) { 1814 mfp._preloadItem(mfp.index-i); 1815 } 1816 }, 1817 _preloadItem: function(index) { 1818 index = _getLoopedId(index); 1819 1820 if(mfp.items[index].preloaded) { 1821 return; 1822 } 1823 1824 var item = mfp.items[index]; 1825 if(!item.parsed) { 1826 item = mfp.parseEl( index ); 1827 } 1828 1829 _mfpTrigger('LazyLoad', item); 1830 1831 if(item.type === 'image') { 1832 item.img = $('<img class="mfp-img" />').on('load.mfploader', function() { 1833 item.hasSize = true; 1834 }).on('error.mfploader', function() { 1835 item.hasSize = true; 1836 item.loadError = true; 1837 _mfpTrigger('LazyLoadError', item); 1838 }).attr('src', item.src); 1839 } 1840 1841 1842 item.preloaded = true; 1843 } 1844 } 1845}); 1846 1847/*>>gallery*/ 1848 1849/*>>retina*/ 1850 1851var RETINA_NS = 'retina'; 1852 1853$.magnificPopup.registerModule(RETINA_NS, { 1854 options: { 1855 replaceSrc: function(item) { 1856 return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; }); 1857 }, 1858 ratio: 1 // Function or number. Set to 1 to disable. 1859 }, 1860 proto: { 1861 initRetina: function() { 1862 if(window.devicePixelRatio > 1) { 1863 1864 var st = mfp.st.retina, 1865 ratio = st.ratio; 1866 1867 ratio = !isNaN(ratio) ? ratio : ratio(); 1868 1869 if(ratio > 1) { 1870 _mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) { 1871 item.img.css({ 1872 'max-width': item.img[0].naturalWidth / ratio, 1873 'width': '100%' 1874 }); 1875 }); 1876 _mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) { 1877 item.src = st.replaceSrc(item, ratio); 1878 }); 1879 } 1880 } 1881 1882 } 1883 } 1884}); 1885 1886/*>>retina*/ 1887 _checkInstance(); }));; 1888(function($) { 1889 "use strict"; 1890 // Get viewport 1891 var viewport; 1892 var getViewport = function() { 1893 viewport = { 1894 width : $(window).width(), 1895 height : $(window).height() 1896 }; 1897 } 1898 getViewport(); 1899 1900 var rwdEvent = function(vw) { 1901 /* 1902 $('.contact-popup').magnificPopup({ 1903 type: 'iframe', 1904 disableOn: function() { 1905 if(vw < 768) { 1906 return false;
1907 } 1908 return true; 1909 } 1910 }); 1911 */ 1912 } 1913 1914 $(document).ready(function() { 1915 console.log("magnific popup !"); 1916 var $body = $("body"); 1917 1918 // $('.img-lightbox').magnificPopup({type:'image'}); 1919 var $imagePopup = $('img.image-popup'); 1920 if ($imagePopup.length) { 1921 $imagePopup.each(function() { 1922 if (!$(this).is('[data-mfp-src]')) { 1923 var src = $(this).attr("src"); 1924 $(this).attr('data-mfp-src', src); 1925 console.log("y"); 1926 } 1927 }); 1928 } 1929 $('.image-popup').magnificPopup({ 1930 type: 'image', 1931 gallery:{ 1932 enabled:true 1933 } 1934 }); 1935 1936 $('.js-mfp-iframe').magnificPopup({ 1937 type: 'iframe', 1938 callbacks: { 1939 open: function() { 1940 $body.addClass("mfp-is-active"); 1941 }, 1942 close: function() { 1943 $body.removeClass("mfp-is-active"); 1944 }, 1945 } 1946 }); 1947 1948 $('.js-mfp-iframe-light').magnificPopup({ 1949 type: 'iframe', 1950 mainClass: 'mfp-light-mode', 1951 preloader: true, 1952 callbacks: { 1953 open: function() { 1954 $body.addClass("mfp-is-active"); 1955 }, 1956 close: function() { 1957 $body.removeClass("mfp-is-active"); 1958 }, 1959 } 1960 }); 1961 1962 $('.js-mfp-inline').magnificPopup({ 1963 type:'inline', 1964 midClick: true, // Allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source in href. 1965 callbacks: { 1966 open: function() { 1967 $body.addClass("mfp-is-active"); 1968 }, 1969 close: function() { 1970 $body.removeClass("mfp-is-active"); 1971 }, 1972 } 1973 }); 1974 1975 $('.js-mfp-ajax').magnificPopup({ 1976 type: 'ajax', 1977 callbacks: { 1978 open: function() { 1979 $body.addClass("mfp-is-active"); 1980 }, 1981 close: function() { 1982 $body.removeClass("mfp-is-active"); 1983 }, 1984 } 1985 }); 1986 1987 rwdEvent(viewport.width); 1988 }); 1989 1990 // Window resize 1991 var resizeTimer; 1992 var windowResize = function() { 1993 getViewport(); 1994 rwdEvent(viewport.width); 1995 }; 1996 1997 $(window).resize(function() { 1998 clearTimeout(resizeTimer); 1999 resizeTimer = setTimeout(windowResize, 250); 2000 }); 2001})(jQuery);; 2002(function ($) { 2003 2004Drupal.googleanalytics = {}; 2005 2006$(document).ready(function() { 2007 2008 // Attach mousedown, keyup, touchstart events to document only and catch 2009 // clicks on all elements. 2010 $(document.body).bind("mousedown keyup touchstart", function(event) { 2011 2012 // Catch the closest surrounding link of a clicked element. 2013 $(event.target).closest("a,area").each(function() { 2014 2015 // Is the clicked URL internal? 2016 if (Drupal.googleanalytics.isInternal(this.href)) { 2017 // Skip 'click' tracking, if custom tracking events are bound. 2018 if ($(this).is('.colorbox') && (Drupal.settings.googleanalytics.trackColorbox)) { 2019 // Do nothing here. The custom event will handle all tracking. 2020 //console.info("Click on .colorbox item has been detected."); 2021 } 2022 // Is download tracking activated and the file extension configured for download tracking? 2023 else if (Drupal.settings.googleanalytics.trackDownload && Drupal.googleanalytics.isDownload(this.href)) { 2024 // Download link clicked. 2025 gtag('event', Drupal.googleanalytics.getDownloadExtension(this.href).toUpperCase(), { 2026 event_category: 'Downloads', 2027 event_label: Drupal.googleanalytics.getPageUrl(this.href), 2028 transport_type: 'beacon' 2029 }); 2030 } 2031 else if (Drupal.googleanalytics.isInternalSpecial(this.href)) { 2032 // Keep the internal URL for Google Analytics website overlay intact. 2033 // @todo: May require tracking ID 2034 var target = this; 2035 $.each(Drupal.settings.googleanalytics.account, function () { 2036 gtag('config', this, { 2037 page_path: Drupal.googleanalytics.getPageUrl(target.href), 2038 transport_type: 'beacon' 2039 }); 2040 }); 2041 } 2042 } 2043 else { 2044 if (Drupal.settings.googleanalytics.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) { 2045 // Mailto link clicked. 2046 gtag('event', 'Click', { 2047 event_category: 'Mails', 2048 event_label: this.href.substring(7), 2049 transport_type: 'beacon' 2050 }); 2051 } 2052 else if (Drupal.settings.googleanalytics.trackOutbound && this.href.match(/^\w+:\/\//i)) { 2053 if (Drupal.settings.googleanalytics.trackDomainMode !== 2 || (Drupal.settings.googleanalytics.trackDomainMode === 2 && !Drupal.googleanalytics.isCrossDomain(this.hostname, Drupal.settings.googleanalytics.trackCrossDomains))) { 2054 // External link clicked / No top-level cross domain clicked. 2055 gtag('event', 'Click', { 2056 event_category: 'Outbound links', 2057 event_label: this.href, 2058 transport_type: 'beacon' 2059 }); 2060 } 2061 } 2062 } 2063 }); 2064 }); 2065 2066 // Track hash changes as unique pageviews, if this option has been enabled. 2067 if (Drupal.settings.googleanalytics.trackUrlFragments) { 2068 window.onhashchange = function() { 2069 $.each(Drupal.settings.googleanalytics.account, function () { 2070 gtag('config', this, { 2071 page_path: location.pathname + location.search + location.hash 2072 }); 2073 }); 2074 }; 2075 } 2076 2077 // Colorbox: This event triggers when the transition has completed and the 2078 // newly loaded content has been revealed. 2079 if (Drupal.settings.googleanalytics.trackColorbox) { 2080 $(document).bind("cbox_complete", function () {
2081 var href = $.colorbox.element().attr("href"); 2082 if (href) { 2083 $.each(Drupal.settings.googleanalytics.account, function () { 2084 gtag('config', this, { 2085 page_path: Drupal.googleanalytics.getPageUrl(href) 2086 }); 2087 }); 2088 } 2089 }); 2090 } 2091 2092}); 2093 2094/** 2095 * Check whether the hostname is part of the cross domains or not. 2096 * 2097 * @param string hostname 2098 * The hostname of the clicked URL. 2099 * @param array crossDomains 2100 * All cross domain hostnames as JS array. 2101 * 2102 * @return boolean 2103 */ 2104Drupal.googleanalytics.isCrossDomain = function (hostname, crossDomains) { 2105 /** 2106 * jQuery < 1.6.3 bug: $.inArray crushes IE6 and Chrome if second argument is 2107 * `null` or `undefined`, https://bugs.jquery.com/ticket/10076, 2108 * https://github.com/jquery/jquery/commit/a839af034db2bd934e4d4fa6758a3fed8de74174 2109 * 2110 * @todo: Remove/Refactor in D8 2111 */ 2112 if (!crossDomains) { 2113 return false; 2114 } 2115 else { 2116 return $.inArray(hostname, crossDomains) > -1 ? true : false; 2117 } 2118}; 2119 2120/** 2121 * Check whether this is a download URL or not. 2122 * 2123 * @param string url 2124 * The web url to check. 2125 * 2126 * @return boolean 2127 */ 2128Drupal.googleanalytics.isDownload = function (url) { 2129 var isDownload = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i"); 2130 return isDownload.test(url); 2131}; 2132 2133/** 2134 * Check whether this is an absolute internal URL or not. 2135 * 2136 * @param string url 2137 * The web url to check. 2138 * 2139 * @return boolean 2140 */ 2141Drupal.googleanalytics.isInternal = function (url) { 2142 var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i"); 2143 return isInternal.test(url); 2144}; 2145 2146/** 2147 * Check whether this is a special URL or not. 2148 * 2149 * URL types: 2150 * - gotwo.module /go/* links. 2151 * 2152 * @param string url 2153 * The web url to check. 2154 * 2155 * @return boolean 2156 */ 2157Drupal.googleanalytics.isInternalSpecial = function (url) { 2158 var isInternalSpecial = new RegExp("(\/go\/.*)$", "i"); 2159 return isInternalSpecial.test(url); 2160}; 2161 2162/** 2163 * Extract the relative internal URL from an absolute internal URL. 2164 * 2165 * Examples: 2166 * - https://mydomain.com/node/1 -> /node/1 2167 * - https://example.com/foo/bar -> https://example.com/foo/bar 2168 * 2169 * @param string url 2170 * The web url to check. 2171 * 2172 * @return string 2173 * Internal website URL 2174 */ 2175Drupal.googleanalytics.getPageUrl = function (url) { 2176 var extractInternalUrl = new RegExp("^(https?):\/\/" + window.location.host, "i"); 2177 return url.replace(extractInternalUrl, ''); 2178}; 2179 2180/** 2181 * Extract the download file extension from the URL. 2182 * 2183 * @param string url 2184 * The web url to check. 2185 * 2186 * @return string 2187 * The file extension of the passed url. e.g. "zip", "txt" 2188 */ 2189Drupal.googleanalytics.getDownloadExtension = function (url) { 2190 var extractDownloadextension = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i"); 2191 var extension = extractDownloadextension.exec(url); 2192 return (extension === null) ? '' : extension[1]; 2193}; 2194 2195})(jQuery); 2196;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.