1/* 2 * Pop that popup up on the page. 3 */ 4(function ($, Drupal, window, document, undefined) { 5 Drupal.behaviors.blockPopPopup = { 6 "attach": function(context, settings) { 7 var $popup = $('#block-ln-blockpop-popup', context); 8 if (!!settings.blockpop) { 9 var dbStamp = settings.blockpop.timestamp; 10 if ($popup.length && this.shouldShowPopup(dbStamp, settings.blockpop.cookieExpiration, settings.blockpop.startDateUtc, settings.blockpop.endDateUtc)) { 11 Drupal.behaviors.blockPopPopup.initAndTriggerPopup($popup, settings); 12 } 13 } 14 }, 15 initAndTriggerPopup: function($popup, settings) { 16 $popup.show(); 17 $wrapper = $('#zone-user-wrapper'); 18 $wrapper.append('<div class="blockpop-popup-close-button"></div>'); 19 $wrapper.on('click', '.blockpop-popup-close-button', function() { 20 Drupal.behaviors.blockPopPopup.closePopup($popup) 21 }); 22 $popup.find('.content a').click(function(event) { 23 $('#block-ln-blockpop-popup .content a').trigger('blockpop:click', [event]); 24 if (!!window._gaq || !!window.ga) { 25 var $this = $(this); 26 var gaEventCategory = settings.blockpop.gaEventCategory ? settings.blockpop.gaEventCategory : null; 27 var gaEventAction = settings.blockpop.gaEventAction ? settings.blockpop.gaEventAction : null; 28 var href = $this.attr('href'); 29 if (!!href) { 30 if ($this.data('gaEventCategory') && $this.data('gaEventAction')) { 31 gaEventCategory = $this.data('gaEventCategory'); 32 gaEventAction = $this.data('gaEventAction'); 33 } 34 // Classic Analytics ga.js 35 if (!!window._gaq && gaEventCategory && gaEventAction) { 36 event.preventDefault(); 37 _gaq.push(['_set', 'hitCallback', function() { 38 document.location = href; 39 }]); 40 _gaq.push(['_trackEvent', gaEventCategory, gaEventAction]); 41 return false; 42 } 43 // Universal Analytics analytics.js 44 if (!!window.ga && gaEventCategory && gaEventAction) { 45 event.preventDefault(); 46 ga('send', 'event', gaEventCategory, gaEventAction, { 47 "useBeacon": true, 48 "hitCallback": function(){ 49 document.location = href; 50 } 51 }); 52 return false; 53 } 54 } 55 } 56 }); 57 58 var expirationHours = parseInt(settings.blockpop.cookieExpirationHours); 59 var now = new Date(); 60 var expirationDate = new Date(now.getTime() + (expirationHours * 60 * 60 * 1000)); 61 var dbStamp = settings.blockpop.timestamp; 62 $.cookie('blockpop_popup_last_shown', dbStamp, { 63 expires: expirationDate 64 }); 65 }, 66 closePopup: function($popup) { 67 $popup.hide(); 68 $('div').remove('.blockpop-popup-close-button'); 69 }, 70 shouldShowPopup: function(dbStamp, cookieExpiration, startDateUtc, endDateUtc) { 71 var lastShown = $.cookie('blockpop_popup_last_shown'); 72 var show = true; 73 var now = new Date().getTime(); 74 now = Math.round(now / 1000); 75 var start = new Date(); 76 start.setTime(startDateUtc * 1000); 77 if (startDateUtc != null && now < startDateUtc) { 78 show = false; 79 } 80 if (endDateUtc != null && now > endDateUtc ) { 81 show = false; 82 } 83 if (lastShown == dbStamp && cookieExpiration != 'always') { 84 show = false; 85 } 86 return show; 87 } 88 }; 89})(jQuery, Drupal, this, this.document); 90; 91 92(function($) { 93 94/** 95 * Drupal FieldGroup object. 96 */ 97Drupal.FieldGroup = Drupal.FieldGroup || {}; 98Drupal.FieldGroup.Effects = Drupal.FieldGroup.Effects || {}; 99Drupal.FieldGroup.groupWithfocus = null; 100 101Drupal.FieldGroup.setGroupWithfocus = function(element) { 102 element.css({display: 'block'}); 103 Drupal.FieldGroup.groupWithfocus = element; 104} 105 106/** 107 * Implements Drupal.FieldGroup.processHook(). 108 */ 109Drupal.FieldGroup.Effects.processFieldset = { 110 execute: function (context, settings, type) { 111 if (type == 'form') { 112 // Add required fields mark to any fieldsets containing required fields
113 $('fieldset.fieldset', context).once('fieldgroup-effects', function(i) { 114 if ($(this).is('.required-fields') && $(this).find('.form-required').length > 0) { 115 $('legend span.fieldset-legend', $(this)).eq(0).append(' ').append($('.form-required').eq(0).clone()); 116 } 117 if ($('.error', $(this)).length) { 118 $('legend span.fieldset-legend', $(this)).eq(0).addClass('error'); 119 Drupal.FieldGroup.setGroupWithfocus($(this)); 120 } 121 }); 122 } 123 } 124} 125 126/** 127 * Implements Drupal.FieldGroup.processHook(). 128 */ 129Drupal.FieldGroup.Effects.processAccordion = { 130 execute: function (context, settings, type) { 131 $('div.field-group-accordion-wrapper', context).once('fieldgroup-effects', function () { 132 var wrapper = $(this); 133 134 // Get the index to set active. 135 var active_index = false; 136 wrapper.find('.accordion-item').each(function(i) { 137 if ($(this).hasClass('field-group-accordion-active')) { 138 active_index = i; 139 } 140 }); 141 142 wrapper.accordion({ 143 heightStyle: "content", // jQuery UI >= v1.9 144 autoHeight: false, // jQuery UI < v1.9 145 active: active_index, 146 collapsible: true, 147 changestart: function(event, ui) { 148 if ($(this).hasClass('effect-none')) { 149 ui.options.animated = false; 150 } 151 else { 152 ui.options.animated = 'slide'; 153 } 154 } 155 }); 156 157 if (type == 'form') { 158 159 var $firstErrorItem = false; 160 161 // Add required fields mark to any element containing required fields 162 wrapper.find('div.field-group-accordion-item').each(function(i) { 163 164 if ($(this).is('.required-fields') && $(this).find('.form-required').length > 0) { 165 $('h3.ui-accordion-header a').eq(i).append(' ').append($('.form-required').eq(0).clone()); 166 } 167 if ($('.error', $(this)).length) { 168 // Save first error item, for focussing it. 169 if (!$firstErrorItem) { 170 $firstErrorItem = $(this).parent().accordion("option", "active", i); 171 } 172 $('h3.ui-accordion-header').eq(i).addClass('error'); 173 } 174 }); 175 176 // Save first error item, for focussing it. 177 if (!$firstErrorItem) { 178 $('.ui-accordion-content-active', $firstErrorItem).css({height: 'auto', width: 'auto', display: 'block'}); 179 } 180 181 } 182 }); 183 } 184} 185 186/** 187 * Implements Drupal.FieldGroup.processHook(). 188 */ 189Drupal.FieldGroup.Effects.processHtabs = { 190 execute: function (context, settings, type) { 191 if (type == 'form') { 192 // Add required fields mark to any element containing required fields 193 $('fieldset.horizontal-tabs-pane', context).once('fieldgroup-effects', function(i) { 194 if ($(this).is('.required-fields') && $(this).find('.form-required').length > 0) { 195 $(this).data('horizontalTab').link.find('strong:first').after($('.form-required').eq(0).clone()).after(' '); 196 } 197 if ($('.error', $(this)).length) { 198 $(this).data('horizontalTab').link.parent().addClass('error'); 199 Drupal.FieldGroup.setGroupWithfocus($(this)); 200 $(this).data('horizontalTab').focus(); 201 } 202 }); 203 } 204 } 205} 206 207/** 208 * Implements Drupal.FieldGroup.processHook(). 209 */ 210Drupal.FieldGroup.Effects.processTabs = { 211 execute: function (context, settings, type) { 212 if (type == 'form') { 213 214 var errorFocussed = false; 215 216 // Add required fields mark to any fieldsets containing required fields 217 $('fieldset.vertical-tabs-pane', context).once('fieldgroup-effects', function(i) { 218 if ($(this).is('.required-fields') && $(this).find('.form-required').length > 0) { 219 $(this).data('verticalTab').link.find('strong:first').after($('.form-required').eq(0).clone()).after(' '); 220 } 221 if ($('.error', $(this)).length) { 222 $(this).data('verticalTab').link.parent().addClass('error'); 223 // Focus the first tab with error. 224 if (!errorFocussed) { 225 Drupal.FieldGroup.setGroupWithfocus($(this)); 226 $(this).data('verticalTab').focus(); 227 errorFocussed = true; 228 } 229 } 230 }); 231 } 232 } 233} 234 235/** 236 * Implements Drupal.FieldGroup.processHook(). 237 * 238 * TODO clean this up meaning check if this is really 239 * necessary. 240 */ 241Drupal.FieldGroup.Effects.processDiv = { 242 execute: function (context, settings, type) { 243 244 $('div.collapsible', context).once('fieldgroup-effects', function() { 245 var $wrapper = $(this); 246 247 // Turn the legend into a clickable link, but retain span.field-group-format-toggler 248 // for CSS positioning. 249 250 var $toggler = $('span.field-group-format-toggler:first', $wrapper); 251 var $link = $('<a class="field-group-format-title" href="#"></a>'); 252 $link.prepend($toggler.contents()); 253 254 // Add required field markers if needed 255 if ($(this).is('.required-fields') && $(this).find('.form-required').length > 0) { 256 $link.append(' ').append($('.form-required').eq(0).clone()); 257 } 258 259 $link.appendTo($toggler); 260 261 // .wrapInner() does not retain bound events. 262 $link.click(function () { 263 var wrapper = $wrapper.get(0); 264 // Don't animate multiple times. 265 if (!wrapper.animating) { 266 wrapper.animating = true; 267 var speed = $wrapper.hasClass('speed-fast') ? 300 : 1000; 268 if ($wrapper.hasClass('effect-none') && $wrapper.hasClass('speed-none')) { 269 $('> .field-group-format-wrapper', wrapper).toggle(); 270 wrapper.animating = false;
271 } 272 else if ($wrapper.hasClass('effect-blind')) { 273 $('> .field-group-format-wrapper', wrapper).toggle('blind', {}, speed); 274 wrapper.animating = false; 275 } 276 else { 277 $('> .field-group-format-wrapper', wrapper).toggle(speed, function() { 278 wrapper.animating = false; 279 }); 280 } 281 } 282 $wrapper.toggleClass('collapsed'); 283 return false; 284 }); 285 286 }); 287 } 288}; 289 290/** 291 * Behaviors. 292 */ 293Drupal.behaviors.fieldGroup = { 294 attach: function (context, settings) { 295 settings.field_group = settings.field_group || Drupal.settings.field_group; 296 if (settings.field_group == undefined) { 297 return; 298 } 299 300 // Execute all of them. 301 $.each(Drupal.FieldGroup.Effects, function (func) { 302 // We check for a wrapper function in Drupal.field_group as 303 // alternative for dynamic string function calls. 304 var type = func.toLowerCase().replace("process", ""); 305 if (settings.field_group[type] != undefined && $.isFunction(this.execute)) { 306 this.execute(context, settings, settings.field_group[type]); 307 } 308 }); 309 310 // Fixes css for fieldgroups under vertical tabs. 311 $('.fieldset-wrapper .fieldset > legend').css({display: 'block'}); 312 $('.vertical-tabs fieldset.fieldset').addClass('default-fallback'); 313 314 // Add a new ID to each fieldset. 315 $('.group-wrapper .horizontal-tabs-panes > fieldset', context).once('group-wrapper-panes-processed', function() { 316 // Tats bad, but we have to keep the actual id to prevent layouts to break. 317 var fieldgroupID = 'field_group-' + $(this).attr('id'); 318 $(this).attr('id', fieldgroupID); 319 }); 320 // Set the hash in url to remember last userselection. 321 $('.group-wrapper ul li').once('group-wrapper-ul-processed', function() { 322 var fieldGroupNavigationListIndex = $(this).index(); 323 $(this).children('a').click(function() { 324 var fieldset = $('.group-wrapper fieldset').get(fieldGroupNavigationListIndex); 325 // Grab the first id, holding the wanted hashurl. 326 var hashUrl = $(fieldset).attr('id').replace(/^field_group-/, '').split(' ')[0]; 327 window.location.hash = hashUrl; 328 }); 329 }); 330 331 } 332}; 333 334})(jQuery); 335; 336(function ($) { 337 338/** 339 * A progressbar object. Initialized with the given id. Must be inserted into 340 * the DOM afterwards through progressBar.element. 341 * 342 * method is the function which will perform the HTTP request to get the 343 * progress bar state. Either "GET" or "POST". 344 * 345 * e.g. pb = new progressBar('myProgressBar'); 346 * some_element.appendChild(pb.element); 347 */ 348Drupal.progressBar = function (id, updateCallback, method, errorCallback) { 349 var pb = this; 350 this.id = id; 351 this.method = method || 'GET'; 352 this.updateCallback = updateCallback; 353 this.errorCallback = errorCallback; 354 355 // The WAI-ARIA setting aria-live="polite" will announce changes after users 356 // have completed their current activity and not interrupt the screen reader. 357 this.element = $('<div class="progress" aria-live="polite"></div>').attr('id', id); 358 this.element.html('<div class="bar"><div class="filled"></div></div>' + 359 '<div class="percentage"></div>' + 360 '<div class="message"> </div>'); 361}; 362 363/** 364 * Set the percentage and status message for the progressbar. 365 */ 366Drupal.progressBar.prototype.setProgress = function (percentage, message) { 367 if (percentage >= 0 && percentage <= 100) { 368 $('div.filled', this.element).css('width', percentage + '%'); 369 $('div.percentage', this.element).html(percentage + '%'); 370 } 371 $('div.message', this.element).html(message); 372 if (this.updateCallback) { 373 this.updateCallback(percentage, message, this); 374 } 375}; 376 377/** 378 * Start monitoring progress via Ajax. 379 */ 380Drupal.progressBar.prototype.startMonitoring = function (uri, delay) { 381 this.delay = delay; 382 this.uri = uri; 383 this.sendPing(); 384}; 385 386/** 387 * Stop monitoring progress via Ajax. 388 */ 389Drupal.progressBar.prototype.stopMonitoring = function () { 390 clearTimeout(this.timer); 391 // This allows monitoring to be stopped from within the callback. 392 this.uri = null; 393}; 394 395/** 396 * Request progress data from server. 397 */ 398Drupal.progressBar.prototype.sendPing = function () { 399 if (this.timer) { 400 clearTimeout(this.timer); 401 } 402 if (this.uri) { 403 var pb = this; 404 // When doing a post request, you need non-null data. Otherwise a 405 // HTTP 411 or HTTP 406 (with Apache mod_security) error may result. 406 $.ajax({ 407 type: this.method, 408 url: this.uri, 409 data: '', 410 dataType: 'json', 411 success: function (progress) { 412 // Display errors. 413 if (progress.status == 0) { 414 pb.displayError(progress.data); 415 return; 416 } 417 // Update display. 418 pb.setProgress(progress.percentage, progress.message); 419 // Schedule next timer.
420 pb.timer = setTimeout(function () { pb.sendPing(); }, pb.delay); 421 }, 422 error: function (xmlhttp) { 423 pb.displayError(Drupal.ajaxError(xmlhttp, pb.uri)); 424 } 425 }); 426 } 427}; 428 429/** 430 * Display errors on the page. 431 */ 432Drupal.progressBar.prototype.displayError = function (string) { 433 var error = $('<div class="messages error"></div>').html(string); 434 $(this.element).before(error).hide(); 435 436 if (this.errorCallback) { 437 this.errorCallback(this); 438 } 439}; 440 441})(jQuery); 442; 443/* 444 * @file 445 * Integration with the colorbox library/module 446 */ 447 448(function ($) { 449 Drupal.ajax.prototype.commands.colorboxNodeReload = function (ajax, response) { 450 location.reload(); 451 }; 452 453 Drupal.ajax.prototype.commands.colorboxNodeRedirect = function (ajax, response) { 454 window.location.replace(response.data); 455 }; 456 457 Drupal.behaviors.colorboxNode = { 458 // Lets find our class name and change our URL to 459 // our defined menu path to open in a colorbox modal. 460 attach: function (context, settings) { 461 // Make sure colorbox exists. 462 if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') { 463 return; 464 } 465 466 // Mobile detection extracted from the colorbox module. 467 // If the mobile setting is turned on, it will turn off the colorbox modal for mobile devices. 468 if (settings.colorbox.mobiledetect && window.matchMedia) { 469 // Disable Colorbox for small screens. 470 var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")"); 471 if (mq.matches) { 472 return; 473 } 474 } 475 476 $('.colorbox-node', context).once('init-colorbox-node-processed', function () { 477 $(this).colorboxNode({'launch': false}); 478 }); 479 480 // When using contextual links and clicking from within the colorbox 481 // we need to close down colorbox when opening the built in overlay. 482 $('ul.contextual-links a', context).once('colorboxNodeContextual').click(function () { 483 $.colorbox.close(); 484 }); 485 } 486 }; 487 488 $.fn.colorboxNodeLaunch = function (settings) { 489 var $this = $(this).clone(); 490 491 // Clear out the rel to prevent any confusion if not using the gallery class. 492 if(!$this.hasClass('colorbox-node-gallery')) { 493 $this.attr('rel', ''); 494 } 495 496 if (!hrefIsSafe(settings.href)) { 497 return; 498 } 499 // Lets extract our width and height giving priority to the data attributes. 500 var innerWidth = $this.data('inner-width'); 501 var innerHeight = $this.data('inner-height'); 502 if (typeof innerWidth != 'undefined' && typeof innerHeight != 'undefined') { 503 var params = $.urlDataParams(innerWidth, innerHeight); 504 } else { 505 var params = $.urlParams(settings.href); 506 } 507 508 // If we did not find a width or height, lets use the default. 509 if (params.innerHeight == undefined) { 510 params.innerHeight = settings.height; 511 } 512 if (params.innerWidth == undefined) { 513 params.innerWidth = settings.width; 514 } 515 516 params.html = '<div id="colorboxNodeLoading"></div>'; 517 params.onComplete = function () { 518 $this.colorboxNodeGroup(); 519 }; 520 params.open = true; 521 522 // Launch our colorbox with the provided settings 523 $this.colorbox($.extend({}, Drupal.settings.colorbox, params)); 524 }; 525 526 // Bind our colorbox node functionality to an anchor 527 $.fn.colorboxNode = function (options) { 528 var $this = this; 529 options = options || {}; 530 531 var settings = { 532 'launch': true, 533 'width': Drupal.settings.colorbox_node.width, 534 'height': Drupal.settings.colorbox_node.height 535 }; 536 537 $.extend(settings, options); 538 539 settings.href = $this.attr('data-href'); 540 if (typeof settings.href == 'undefined' || settings.href == false) { 541 settings.href = $this.attr('href'); 542 } 543 settings.href = Drupal.checkPlain(settings.href).replaceAll('&', '&'); 544 545 // Create an element so we can parse our a URL no matter if its internal or external. 546 var parse = document.createElement('a'); 547 parse.href = settings.href; 548 549 if(!settings.href) { 550 alert(Drupal.t('No url found on element')); 551 } 552 553 // Lets add our colorbox link after the base path if necessary. 554 var base_path = Drupal.settings.basePath; 555 var path_prefix = Drupal.settings.pathPrefix; 556 var pathname = parse.pathname; 557 558 // Lets check to see if the pathname has a forward slash. 559 // This problem happens in IE7/IE8 560 if (pathname.charAt(0) != '/') { 561 pathname = '/' + parse.pathname; 562 } 563 564 // If clean URL's are not turned on, lets check for that. 565 var cleanURLs = $.getParameterByName('q', settings.href); 566 if (base_path != '/') { 567 if (cleanURLs != '') { 568 settings.link = pathname.replace(base_path, base_path + parse.search.replace('?q=', '?q=/' + path_prefix + 'colorbox/')); 569 } else { 570 settings.link = pathname.replace(base_path, base_path + path_prefix + 'colorbox/') + parse.search; 571 } 572 } else { 573 if (cleanURLs != '') { 574 settings.link = base_path + parse.search.replace('?q=', '?q=/' + path_prefix + 'colorbox/'); 575 } else { 576 settings.link = base_path + path_prefix + 'colorbox' + pathname + parse.search; 577 } 578 } 579 580 // Bind Ajax behaviors to the element 581 var element_settings = {}; 582 element_settings.async = true; 583 584 // This removes any loading/progress bar on the clicked link 585 // and displays the colorbox loading screen instead. 586 element_settings.progress = { 'type': 'none' }; 587 // For anchor tags, these will go to the target of the anch
587or rather 588 // than the usual location. 589 if (settings.link) { 590 element_settings.url = settings.link; 591 element_settings.event = 'click'; 592 } 593 594 // Log our click handler to our ajax object 595 var base = Drupal.checkPlain($(this).attr('id')); 596 Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings); 597 598 // Default to auto click for manual call to this function. 599 if (settings.launch) { 600 Drupal.ajax[base].eventResponse(this, 'click'); 601 $(this).colorboxNodeLaunch(settings); 602 } 603 else { 604 $(this).click(function () { 605 $(this).colorboxNodeLaunch(settings); 606 }); 607 } 608 }; 609 610 // Allow for grouping on links to showcase a gallery with left/right arrows. 611 // This function will find the next index of each link on the page by the rel 612 // and manually force a click on the link to call that AJAX and update the 613 // modal window. 614 $.fn.colorboxNodeGroup = function () { 615 // Lets do setup our gallery type of functions. 616 var $this = $(this); 617 var rel = Drupal.checkPlain($this.attr('rel')); 618 if (rel && $this.hasClass('colorbox-node-gallery')) { 619 if ($('a.colorbox-node-gallery[rel="' + rel + '"]:not(#colorbox a[rel="' + rel + '"])').length > 1) { 620 $related = $('a.colorbox-node-gallery[rel="' + rel + '"]:not(#colorbox a[rel="' + rel + '"])'); 621 622 // filter $related array by href, to have mutliple colorbox links to the same target 623 // appear as one item in the gallery only 624 var $related_unique = []; 625 $related.each(function () { 626 $.findHref($related_unique, this.href); 627 if (!$.findHref($related_unique, this.href).length) { 628 $related_unique.push(this); 629 } 630 }); 631 // we have to get the actual used element from the filtered list in order to get it's relative index 632 var current = $.findHref($related_unique, $this.get(0).href); 633 $related = $($related_unique); 634 var idx = $related.index($(current)); 635 var tot = $related.length; 636 637 // Show our gallery buttons 638 $('#cboxPrevious, #cboxNext').show(); 639 $.colorbox.next = function () { 640 index = get_index(1); 641 $related[index].click(); 642 }; 643 $.colorbox.prev = function () { 644 index = get_index(-1); 645 $related[index].click(); 646 }; 647 648 // Setup our current HTML 649 $('#cboxCurrent').html(Drupal.settings.colorbox.current.replace('{current}', idx + 1).replace('{total}', tot)).show(); 650 $('#cboxNext').html(Drupal.settings.colorbox.next).show(); 651 $('#cboxPrevious').html(Drupal.settings.colorbox.previous).show(); 652 653 var prefix = 'colorbox'; 654 // Remove Bindings and re-add 655 // @TODO: There must be a better way? If we don't remove it causes a memory to be exhausted. 656 $(document).unbind('keydown.' + prefix); 657 658 // Add Key Bindings 659 $(document).bind('keydown.' + prefix, function (e) { 660 var key = e.keyCode; 661 if ($related[1] && !e.altKey) { 662 if (key === 37) { 663 e.preventDefault(); 664 $.colorbox.prev(); 665 } else if (key === 39) { 666 e.preventDefault(); 667 $.colorbox.next(); 668 } 669 } 670 }); 671 } 672 673 function get_index(increment) { 674 var max = $related.length; 675 var newIndex = (idx + increment) % max; 676 return (newIndex < 0) ? max + newIndex : newIndex; 677 } 678 679 } 680 }; 681 682 // Find a colorbox link by href in an array 683 $.findHref = function (items, href) { 684 return $.grep(items, function (n, i) { 685 return n.href == href; 686 }); 687 }; 688 689 // Utility function to parse out our width/height from our url params
690 $.urlParams = function (url) { 691 var p = {}, 692 e, 693 a = /\+/g, // Regex for replacing addition symbol with a space 694 r = /([^&=]+)=?([^&]*)/g, 695 d = function (s) { 696 return decodeURIComponent(s.replace(a, ' ')); 697 }, 698 q = url.split('?'); 699 while (e = r.exec(q[1])) { 700 e[1] = d(e[1]); 701 e[2] = d(e[2]); 702 switch (e[2].toLowerCase()) { 703 case 'true': 704 case 'yes': 705 e[2] = true; 706 break; 707 708 case 'false': 709 case 'no': 710 e[2] = false; 711 break; 712 } 713 if (e[1] == 'width') { 714 e[1] = 'innerWidth'; 715 } 716 if (e[1] == 'height') { 717 e[1] = 'innerHeight'; 718 } 719 p[e[1]] = e[2]; 720 } 721 return p; 722 }; 723 724 // Utility function to return our data attributes for width/height 725 $.urlDataParams = function (innerWidth, innerHeight) { 726 return {'innerWidth':innerWidth,'innerHeight':innerHeight}; 727 }; 728 729 $.getParameterByName = function (name, href) { 730 name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); 731 var regexString = "[\\?&]" + name + "=([^&#]*)"; 732 var regex = new RegExp(regexString); 733 var found = regex.exec(href); 734 if (found == null) { 735 return ""; 736 } 737 else { 738 return decodeURIComponent(found[1].replace(/\+/g, " ")); 739 } 740 }; 741 742 /** 743 * Returns true if the passed-in href string is safe for colorbox_load. 744 * 745 * @param href 746 * The href string to be tested. 747 * 748 * @return 749 * Boolean true if the href is safe. 750 */ 751 function hrefIsSafe(href) { 752 var normalizedUrl = Drupal.absoluteUrl(href); 753 754 // Only local, non-file-system URLs are allowed. 755 if (!Drupal.urlIsLocal(normalizedUrl)) { 756 return false; 757 } 758 759 // Reject uploaded files from the public or private file system. 760 if (normalizedUrl.indexOf(Drupal.settings.colorbox.file_public_path) !== -1 || 761 normalizedUrl.match(/\/system\/files\//) || 762 normalizedUrl.match(/[?|&]q=system\/files\//)) { 763 return false; 764 } 765 766 // All checks passed. 767 return true; 768 } 769})(jQuery); 770;
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.