vendor: 5,510 bytes, lines 1-10
1/** 2 * Lightbox v2.7.1 3 * by Lokesh Dhakar - http://lokeshdhakar.com/projects/lightbox2/ 4 * 5 * @license http://creativecommons.org/licenses/by/2.5/ 6 * - Free for use in both personal and commercial projects 7 * - Attribution requires leaving author name, author link, and the license info intact 8 */ 9 10(function(){var a=jQuery,b=function(){function a(){this.fadeDuration=500,this.fitImagesInViewport=!0,this.resizeDuration=700,this.positionFromTop=50,this.showImageNumberLabel=!0,this.alwaysShowNavOnTouchDevices=!1,this.wrapAround=!1}return a.prototype.albumLabel=function(a,b){return"Image "+a+" of "+b},a}(),c=function(){function b(a){this.options=a,this.album=[],this.currentImageIndex=void 0,this.init()}return b.prototype.init=function(){this.enable(),this.build()},b.prototype.enable=function(){var b=this;a("body").on("click","a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]",function(c){return b.start(a(c.currentTarget)),!1})},b.prototype.build=function(){var b=this;a("<div id='lightboxOverlay' class='lightboxOverlay'></div><div id='lightbox' class='lightbox'><div class='lb-outerContainer'><div class='lb-container'><img class='lb-image' src='' /><div class='lb-nav'><a class='lb-prev' href='' ></a><a class='lb-next' href='' ></a></div><div class='lb-loader'><a class='lb-cancel'></a></div></div></div><div class='lb-dataContainer'><div class='lb-data'><div class='lb-details'><span class='lb-caption'></span><span class='lb-number'></span></div><div class='lb-closeContainer'><a class='lb-close'></a></div></div></div></div>").appendTo(a("body")),this.$lightbox=a("#lightbox"),this.$overlay=a("#lightboxOverlay"),this.$outerContainer=this.$lightbox.find(".lb-outerContainer"),this.$container=this.$lightbox.find(".lb-container"),this.containerTopPadding=parseInt(this.$container.css("padding-top"),10),this.containerRightPadding=parseInt(this.$container.css("padding-right"),10),this.containerBottomPadding=parseInt(this.$container.css("padding-bottom"),10),this.containerLeftPadding=parseInt(this.$container.css("padding-left"),10),this.$overlay.hide().on("click",function(){return b.end(),!1}),this.$lightbox.hide().on("click",function(c){return"lightbox"===a(c.target).attr("id")&&b.end(),!1}),this.$outerContainer.on("click",function(c){return"lightbox"===a(c.target).attr("id")&&b.end(),!1}),this.$lightbox.find(".lb-prev").on("click",function(){return b.changeImage(0===b.currentImageIndex?b.album.length-1:b.currentImageIndex-1),!1}),this.$lightbox.find(".lb-next").on("click",function(){return b.changeImage(b.currentImageIndex===b.album.length-1?0:b.currentImageIndex+1),!1}),this.$lightbox.find(".lb-loader, .lb-close").on("click",function(){return b.end(),!1})},b.prototype.start=function(b){function c(a){d.album.push({link:a.attr("href"),title:a.attr("data-title")||a.attr("title")})}var d=this,e=a(window);e.on("resize",a.proxy(this.sizeOverlay,this)),a("select, object, embed").css({visibility:"hidden"}),this.sizeOverlay(),this.album=[];var f,g=0,h=b.attr("data-lightbox");if(h){f=a(b.prop("tagName")+'[data-lightbox="'+h+'"]');for(var i=0;i<f.length;i=++i)c(a(f[i])),f[i]===b[0]&&(g=i)}else if("lightbox"===b.attr("rel"))c(b);else{f=a(b.prop("tagName")+'[rel="'+b.attr("rel")+'"]');for(var j=0;j<f.length;j=++j)c(a(f[j])),f[j]===b[0]&&(g=j)}var k=e.scrollTop()+this.options.positionFromTop,l=e.scrollLeft();this.$lightbox.css({top:k+"px",left:l+"px"}).fadeIn(this.options.fadeDuration),this.changeImage(g)},b.prototype.changeImage=function(b){var c=this;this.disableKeyboardNav();var d=this.$lightbox.find(".lb-image");this.$overlay.fadeIn(this.options.fadeDuration),a(".lb-loader").fadeIn("slow"),this.$lightbox.find(".lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption").hide(),this.$outerContainer.addClass("animating");var e=new Image;e.onload=function(){var f,g,h,i,j,k,l;d.attr("src",c.album[b].link),f=a(e),d.width(e.width),d.height(e.height),c.options.fitImagesInViewport&&(l=a(window).width(),k=a(window).height(),j=l-c.containerLeftPadding-c.containerRightPadding-20,i=k-c.containerTopPadding-c.containerBottomPadding-120,(e.width>j||e.height>i)&&(e.width/j>e.height/i?(h=j,g=parseInt(e.height/(e.width/h),10),d.width(h),d.height(g)):(g=i,h=parseInt(e.width/(e.height/g),10),d.width(h),d.height(g)))),c.sizeContainer(d.width(),d.height())},e.src=this.album[b].link,this.currentImageIndex=b},b.prototype.sizeOverlay=function(){this.$overlay.width(a(window).width()).height(a(document).height())},b.prototype.sizeContainer=function(a,b){function c(){d.$lightbox.find(".lb-dataContainer").width(g),d.$lightbox.find(".lb-prevLink").height(h),d.$lightbox.find(".lb-nextLink").height(h),d.showImage()}var d=this,e=this.$outerContainer.outerWidth(),f=this.$outerContainer.outerHeight(),g=a+this.containerLeftPadding+this.containerRightPadding,h=b+this.containerTopPadding+this.containerBottomPadding;e!==g||f!==h?this.$outerContainer.animate({width:g,height:h},this.options.resizeDuration,"swing",function(){c()}):c()},b.prototype.showImage=function(){this.$lightbox.find(".lb-loader").hide(),this.$lightbox.find(".lb-image").fadeIn("slow"),this.updateNav(),this.updateDetails(),this.preloadNeighboringImages(),this.enableKeyboardNav()},b.prototype.updateNav=function(){var a=!1;try{document.createEvent("TouchEvent"),a=this.options.alwaysShowNavOnTouchDevices?!0:!1}catch(b){}this.$lightbox.find(".lb-nav").show(),this.album.length>1&&(this.options.wrapAround?(a&&this.$lightbox.find(".lb-prev, .lb-next").
10css("opacity","1"),this.$lightbox.find(".lb-prev, .lb-next").show()):(this.currentImageIndex>0&&(this.$lightbox.find(".lb-prev").show(),a&&this.$lightbox.find(".lb-prev").css("opacity","1")),this.currentImageIndex<this.album.length-1&&(this.$lightbox.find(".lb-next").show(),a&&this.$lightbox.find(".lb-next").css("opacity","1"))))},b.prototype.updateDetails=function(){var b=this;"undefined"!=typeof this.album[this.currentImageIndex].title&&""!==this.album[this.currentImageIndex].title&&this.$lightbox.find(".lb-caption").html(this.album[this.currentImageIndex].title).fadeIn("fast").find("a").on("click",function(){location.href=a(this).attr("href")}),this.album.length>1&&this.options.showImageNumberLabel?this.$lightbox.find(".lb-number").text(this.options.albumLabel(this.currentImageIndex+1,this.album.length)).fadeIn("fast"):this.$lightbox.find(".lb-number").hide(),this.$outerContainer.removeClass("animating"),this.$lightbox.find(".lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return b.sizeOverlay()})},b.prototype.preloadNeighboringImages=function(){if(this.album.length>this.currentImageIndex+1){var a=new Image;a.src=this.album[this.currentImageIndex+1].link}if(this.currentImageIndex>0){var b=new Image;b.src=this.album[this.currentImageIndex-1].link}},b.prototype.enableKeyboardNav=function(){a(document).on("keyup.keyboard",a.proxy(this.keyboardAction,this))},b.prototype.disableKeyboardNav=function(){a(document).off(".keyboard")},b.prototype.keyboardAction=function(a){var b=27,c=37,d=39,e=a.keyCode,f=String.fromCharCode(e).toLowerCase();e===b||f.match(/x|o|c/)?this.end():"p"===f||e===c?0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1):("n"===f||e===d)&&(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0))},b.prototype.end=function(){this.disableKeyboardNav(),a(window).off("resize",this.sizeOverlay),this.$lightbox.fadeOut(this.options.fadeDuration),this.$overlay.fadeOut(this.options.fadeDuration),a("select, object, embed").css({visibility:"visible"})},b}();a(function(){{var a=new b;new c(a)}})}).call(this); 11/*! 12Input File - Popover 13 14*/ 15 16 17$(document).on('click', '.close-button', function(){ 18 container = $(this).parent().parent().parent().parent(); 19 container.find('.image-preview').popover('hide'); 20 // Hover befor close the preview 21 container.find('.image-preview').hover( 22 function () { 23 $(this).popover('show'); 24 }, 25 function () { 26 $(this).popover('hide'); 27 } 28 ); 29}); 30 31(function($, window, document, undefined) { 32 'use strict'; 33 $('.upload-wrapper').each(function() { 34 var $input = $(this).find('input[type="file"]'), 35 $fileIndicator = $(this).find('input[type="text"]'), 36 $label = $(this).find('label'), 37 $mainthis = $(this); 38 var userLang = $('html').attr('lang'); 39 if(userLang == 'de'){ 40 var uploadStrings = new Object(); 41 uploadStrings["description"] = "Ausgewählte Datei wieder entfernen"; 42 uploadStrings["remove"] = "Datei entfernen"; 43 uploadStrings["multifiles"] = " Dateien ausgewählt"; 44 }else{ 45 var uploadStrings = new Object(); 46 uploadStrings["description"] = "Remove chosen file"; 47 uploadStrings["remove"] = "Remove file"; 48 uploadStrings["multifiles"] = " files chosen"; 49 } 50 $label.bind('keypress keyup', function(e) { 51 if(e.which === 32 || e.which === 13){ 52 e.preventDefault(); 53 $input.click(); 54 } 55 }); 56 $input.on('change', function(e) { 57 var fileName = ''; 58 var fileNames = '' 59 if (this.files && this.files.length > 1){ 60 console.log('Files: ' + this.files[0]); 61 for(var k=0, len = this.files.length; k < len; k++){ 62 fileNames = fileNames + this.files[k]['name'] + '\n'; 63 } 64 console.log(fileNames); 65 fileName = this.files.length + uploadStrings["multifiles"]; 66 } 67 else if (e.target.value) fileName = e.target.value.split('\\').pop(); 68 if (fileName) { 69 $fileIndicator.val(fileName); 70 if ($mainthis.find('.upload-remove').length == 0) { 71 $fileIndicator.after('<span class="form-control upload-remove" tabindex="0" role="button"></span>'); 72 } 73 $mainthis.parent().find('.file-list').remove();//Could already have been created 74 if (fileNames != '') { 75 $mainthis.after('<pre class="file-list" aria-hidden="true">' + fileNames + '</pre>'); 76 } 77 var $remover = $mainthis.find('.upload-remove'); 78 $remover.attr('aria-description',uploadStrings["description"]); 79 $remover.attr('title',uploadStrings["description"]);
vendor: 32,223 bytes, lines 80-911
80 $remover.bind('keypress keyup', function(e) { 81 if (e.which === 32 || e.which === 13) { 82 e.preventDefault(); 83 $remover.click(); 84 } 85 }); 86 $remover.on('click', function() { 87 $fileIndicator.val(''); 88 e.target.value = ''; 89 $mainthis.removeClass('file-waiting'); 90 $mainthis.find('.upload-remove').remove(); 91 $mainthis.parent().find('.file-list').remove(); 92 }); 93 } else { 94 $fileIndicator.val(''); 95 e.target.value = ''; 96 $mainthis.removeClass('file-waiting'); 97 $mainthis.find('.upload-remove').remove(); 98 $mainthis.parent().find('.file-list').remove(); 99 } 100 }); 101 }); 102 })(jQuery, window, document); 103 104 105// version 1.6.0 106// http://welcome.totheinter.net/columnizer-jquery-plugin/ 107// created by: Adam Wulf @adamwulf, [email protected] 108 109(function($){ 110 111 $.fn.columnize = function(options) { 112 this.cols =[]; 113 this.offset= 0; 114 this.before=[]; 115 this.lastOther=0; 116 this.prevMax =0; 117 this.debug=0; 118 this.setColumnStart =null; 119 this.elipsisText=''; 120 121 var defaults = { 122 // default width of columns 123 width: 400, 124 // optional # of columns instead of width 125 columns : false, 126 // true to build columns once regardless of window resize 127 // false to rebuild when content box changes bounds 128 buildOnce : false, 129 // an object with options if the text should overflow 130 // it's container if it can't fit within a specified height 131 overflow : false, 132 // this function is called after content is columnized 133 doneFunc : function(){}, 134 // if the content should be columnized into a 135 // container node other than it's own node 136 target : false, 137 // re-columnizing when images reload might make things 138 // run slow. so flip this to true if it's causing delays 139 ignoreImageLoading : true, 140 // should columns float left or right 141 columnFloat : "left", 142 // ensure the last column is never the tallest column 143 lastNeverTallest : false, 144 // (int) the minimum number of characters to jump when splitting 145 // text nodes. smaller numbers will result in higher accuracy 146 // column widths, but will take slightly longer 147 accuracy : false, 148 // don't automatically layout columns, only use manual columnbreak 149 manualBreaks : false, 150 // previx for all the CSS classes used by this plugin 151 // default to empty string for backwards compatibility 152 cssClassPrefix : "", 153 elipsisText:'...', 154 debug:0, 155 }; 156 options = $.extend(defaults, options); 157 158 if(typeof(options.width) == "string"){ 159 options.width = parseInt(options.width,10); 160 if(isNaN(options.width)){ 161 options.width = defaults.width; 162 } 163 } 164 if(typeof options.setColumnStart== 'function') { 165 this.setColumnStart=options.setColumnStart; 166 } 167 if(typeof options.elipsisText== 'string') { 168 this.elipsisText=options.elipsisText; 169 } 170 if(options.debug) { // assert is off by default 171 this.debug=options.debug; 172 } 173 174 /** 175 * appending a text node to a <table> will 176 * cause a jquery crash. 177 * so wrap all append() calls and revert to 178 * a simple appendChild() in case it fails 179 */ 180 function appendSafe($target, $elem){ 181 try{ 182 $target.append($elem); 183 }catch(e){ 184 $target[0].appendChild($elem[0]); 185 } 186 } 187 188 return this.each(function() { 189 var $inBox = options.target ? $(options.target) : $(this); 190 var maxHeight = $(this).height(); 191 var $cache = $('<div></div>'); // this is where we'll put the real content 192 var lastWidth = 0; 193 var columnizing = false; 194 var manualBreaks = options.manualBreaks; 195 var cssClassPrefix = defaults.cssClassPrefix; 196 if(typeof(options.cssClassPrefix) == "string"){ 197 cssClassPrefix = options.cssClassPrefix; 198 } 199 200 201 var adjustment = 0; 202 203 appendSafe($cache, $(this).contents().clone(true)); 204 205 // images loading after dom load 206 // can screw up the column heights, 207 // so recolumnize after images load 208 if(!options.ignoreImageLoading && !options.target){ 209 if(!$inBox.data("imageLoaded")){ 210 $inBox.data("imageLoaded", true); 211 if($(this).find("img").length > 0){ 212 // only bother if there are 213 // actually images... 214 var func = function($inBox,$cache){ return function(){ 215 if(!$inBox.data("firstImageLoaded")){ 216 $inBox.data("firstImageLoaded", "true"); 217 appendSafe($inBox.empty(), $cache.children().clone(true)); 218 $inBox.columnize(options); 219 } 220 }; 221 }($(this), $cache); 222 $(this).find("img").one("load", func); 223 $(this).find("img").one("abort", func); 224 return; 225 } 226 } 227 } 228 229 $inBox.empty(); 230 231 columnizeIt(); 232 233 if(!options.buildOnce){ 234 $(window).resize(function() { 235 if(!options.buildOnce){ 236 if($inBox.data("timeout")){ 237 clearTimeout($inBox.data("timeout")); 238 } 239 $inBox.data("timeout", setTimeout(columnizeIt, 200)); 240 } 241 }); 242 } 243 244 function prefixTheClassName(className, withDot){ 245 var dot = withDot ? "." : ""; 246 if(cssClassPrefix.length){ 247 return dot + cssClassPrefix + "-" + className; 248 } 249 return dot + className; 250 } 251 252 /** 253 * this fuction builds as much of a column as it can without 254 * splitting nodes in half. If the last node in the new column 255 * is a text node, then it will try to split that text node. otherwise 256 * it will leave the node in $pullOutHere and return with a height 257 * smaller than targetHeight. 258 * 259 * Returns a boolean on whether we did some splitting successfully at a text point 260 * (so we know we don't need to split a real element). return false if the caller should 261 * split a node if possible to end this column. 262 * 263 * @param putInHere, the jquery node to put elements into for the current column 264 * @param $pullOutHere, the jquery node to pull elements out of (uncolumnized html) 265 * @param $parentColumn, the jquery node for the currently column that's being added to 266 * @param targetHeight, the ideal height for the column, get as close as we can to this height 267 */ 268 function columnize($putInHere, $pullOutHere, $parentColumn, targetHeight){ 269 // 270 // add as many nodes to the column as we can, 271 // but stop once our height is too tall 272 while((manualBreaks || $parentColumn.height() < targetHeight) && 273 $pullOutHere[0].childNodes.length){ 274 var node = $pullOutHere[0].childNodes[0]; 275 // 276 // Because we're not cloning, jquery will actually move the element" 277 // http://welcome.totheinter.net/2009/03/19/the-undocumented-life-of-jquerys-append/ 278 if($(node).find(prefixTheClassName("columnbreak", true)).length){ 279 // 280 // our column is on a column break, so just end here 281 return; 282 } 283 if($(node).hasClass(prefixTheClassName("columnbreak"))){ 284 // 285 // our column is on a column break, so just end here 286 return; 287 } 288 appendSafe($putInHere, $(node)); 289 } 290 if($putInHere[0].childNodes.length === 0) return; 291 292 // now we're too tall, so undo the last one 293 var kids = $putInHere[0].childNodes; 294 var lastKid = kids[kids.length-1]; 295 $putInHere[0].removeChild(lastKid); 296 var $item = $(lastKid); 297 298 // now lets try to split that last node 299 // to fit as much of it as we can into this column 300 if($item[0].nodeType == 3){ 301 // it's a text node, split it up 302 var oText = $item[0].nodeValue; 303 var counter2 = options.width / 18; 304 if(options.accuracy) 305 counter2 = options.accuracy; 306 var columnText; 307 var latestTextNode = null; 308 while($parentColumn.height() < targetHeight && oText.length){ 309 // 310 // it's been brought up that this won't work for chinese 311 // or other languages that don't have the same use of whitespace 312 // as english. This will need to be updated in the future 313 // to better handle non-english languages. 314 // 315 // https://github.com/adamwulf/Columnizer-jQuery-Plugin/issues/124 316 var indexOfSpace = oText.indexOf(' ', counter2); 317 if (indexOfSpace != -1) { 318 columnText = oText.substring(0, indexOfSpace); 319 } else { 320 columnText = oText; 321 } 322 latestTextNode = document.createTextNode(columnText); 323 appendSafe($putInHere, $(latestTextNode)); 324 325 if(oText.length > counter2 && indexOfSpace != -1){ 326 oText = oText.substring(indexOfSpace); 327 }else{ 328 oText = ""; 329 } 330 } 331 if($parentColumn.height() >= targetHeight && latestTextNode !== null){ 332 // too tall :( 333 $putInHere[0].removeChild(latestTextNode); 334 oText = latestTextNode.nodeValue + oText; 335 } 336 if(oText.length){ 337 $item[0].nodeValue = oText; 338 }else{ 339 return false; // we ate the whole text node, move on to the next node 340 } 341 } 342 343 if($pullOutHere.contents().length){ 344 $pullOutHere.prepend($item); 345 }else{ 346 appendSafe($pullOutHere, $item); 347 } 348 349 return $item[0].nodeType == 3; 350 } 351 352 /** 353 * Split up an element, which is more complex than splitting text. We need to create 354 * two copies of the element with it's contents divided between each 355 */ 356 function split($putInHere, $pullOutHere, $parentColumn, targetHeight){ 357 if($putInHere.contents(":last").find(prefixTheClassName("columnbreak", true)).length){ 358 // 359 // our column is on a column break, so just end here 360 return; 361 } 362 if($putInHere.contents(":last").hasClass(prefixTheClassName("columnbreak"))){ 363 // 364 // our column is on a column break, so just end here 365 return; 366 } 367 if($pullOutHere.contents().length){ 368 var $cloneMe = $pullOutHere.contents(":first"); 369 // 370 // make sure we're splitting an element 371 if( typeof $cloneMe.get(0) == 'undefined' || $cloneMe.get(0).nodeType != 1 ) return; 372 373 // 374 // clone the node with all data and events 375 var $clone = $cloneMe.clone(true); 376 // 377 // need to support both .prop and .attr if .prop doesn't exist. 378 // this is for backwards compatibility with older versions of jquery. 379 if($cloneMe.hasClass(prefixTheClassName("columnbreak"))){ 380 // 381 // ok, we have a columnbreak, so add it into 382 // the column and exit 383 appendSafe($putInHere, $clone); 384 $cloneMe.remove(); 385 }else if (manualBreaks){ 386 // keep adding until we hit a manual break 387 appendSafe($putInHere, $clone); 388 $cloneMe.remove(); 389 }else if($clone.get(0).nodeType == 1 && !$clone.hasClass(prefixTheClassName("dontend"))){ 390 appendSafe($putInHere, $clone); 391 if($clone.is("img") && $parentColumn.height() < targetHeight + 20){ 392 // 393 // we can't split an img in half, so just add it 394 // to the column and remove it from the pullOutHere section 395 $cloneMe.remove(); 396 }else if($cloneMe.hasClass(prefixTheClassName("dontsplit")) && $parentColumn.height() < targetHeight + 20){ 397 // 398 // pretty close fit, and we're not allowed to split it, so just 399 // add it to the column, remove from pullOutHere, and be done 400 $cloneMe.remove(); 401 }else if($clone.is("img") || $cloneMe.hasClass(prefixTheClassName("dontsplit"))){ 402 // 403 // it's either an image that's too tall, or an unsplittable node 404 // that's too tall. leave it in the pullOutHere and we'll add it to the 405 // next column 406 $clone.remove(); 407 }else{ 408 // 409 // ok, we're allowed to split the node in half, so empty out 410 // the node in the column we're building, and start splitting 411 // it in half, leaving some of it in pullOutHere 412 $clone.empty(); 413 if(!columnize($clone, $cloneMe, $parentColumn, targetHeight)){ 414 // this node may still have non-text nodes to split 415 // add the split class and then recur 416 $cloneMe.addClass(prefixTheClassName("split")); 417 418 //if this node was ol element, the child should continue the number ordering 419 if($cloneMe.get(0).tagName == 'OL'){ 420 var startWith = $clone.get(0).childElementCount + $clone.get(0).start; 421 $cloneMe.attr('start',startWith+1); 422 } 423 424 if($cloneMe.children().length){ 425 split($clone, $cloneMe, $parentColumn, targetHeight); 426 } 427 }else{ 428 // this node only has text node children left, add the 429 // split class and move on. 430 $cloneMe.addClass(prefixTheClassName("split")); 431 } 432 if($clone.get(0).childNodes.length === 0){ 433 // it was split, but nothing is in it :( 434 $clone.remove(); 435 $cloneMe.removeClass(prefixTheClassName("split")); 436 } 437 } 438 } 439 } 440 } 441 442 443 function singleColumnizeIt() { 444 if ($inBox.data("columnized") && $inBox.children().length == 1) { 445 return; 446 } 447 $inBox.data("columnized", true); 448 $inBox.data("columnizing", true); 449 450 $inBox.empty(); 451 $inBox.append($("<div class='" 452 + prefixTheClassName("first") + " " 453 + prefixTheClassName("last") + " " 454 + prefixTheClassName("column") + " " 455 + "' style='width:100%; float: " + options.columnFloat + ";'></div>")); //" 456 $col = $inBox.children().eq($inBox.children().length-1); 457 $destroyable = $cache.clone(true); 458 if(options.overflow){ 459 targetHeight = options.overflow.height; 460 columnize($col, $destroyable, $col, targetHeight); 461 // make sure that the last item in the column isn't a "dontend" 462 if(!$destroyable.contents().find(":first-child").hasClass(prefixTheClassName("dontend"))){ 463 split($col, $destroyable, $col, targetHeight); 464 } 465 466 while($col.contents(":last").length && checkDontEndColumn($col.contents(":last").get(0))){ 467 var $lastKid = $col.contents(":last"); 468 $lastKid.remove(); 469 $destroyable.prepend($lastKid); 470 } 471 472 var html = ""; 473 var div = document.createElement('DIV'); 474 while($destroyable[0].childNodes.length > 0){ 475 var kid = $destroyable[0].childNodes[0]; 476 if(kid.attributes){ 477 for(var i=0;i<kid.attributes.length;i++){ 478 if(kid.attributes[i].nodeName.indexOf("jQuery") === 0){ 479 kid.removeAttribute(kid.attributes[i].nodeName); 480 } 481 } 482 } 483 div.innerHTML = ""; 484 div.appendChild($destroyable[0].childNodes[0]); 485 html += div.innerHTML; 486 } 487 var overflow = $(options.overflow.id)[0]; 488 overflow.innerHTML = html; 489 490 }else{ 491 appendSafe($col, $destroyable.contents()); 492 } 493 $inBox.data("columnizing", false); 494 495 if(options.overflow && options.overflow.doneFunc){ 496 options.overflow.doneFunc(); 497 } 498 options.doneFunc(); 499 } 500 501 /** 502 * returns true if the input dom node 503 * should not end a column. 504 * returns false otherwise 505 */ 506 function checkDontEndColumn(dom){ 507 if(dom.nodeType == 3){ 508 // text node. ensure that the text 509 // is not 100% whitespace 510 if(/^\s+$/.test(dom.nodeValue)){ 511 // 512 // ok, it's 100% whitespace, 513 // so we should return checkDontEndColumn 514 // of the inputs previousSibling 515 if(!dom.previousSibling) return false; 516 return checkDontEndColumn(dom.previousSibling); 517 } 518 return false; 519 } 520 if(dom.nodeType != 1) return false; 521 if($(dom).hasClass(prefixTheClassName("dontend"))) return true; 522 if(dom.childNodes.length === 0) return false; 523 return checkDontEndColumn(dom.childNodes[dom.childNodes.length-1]); 524 } 525 526 function columnizeIt() { 527 //reset adjustment var 528 adjustment = 0; 529 if(lastWidth == $inBox.width()) return; 530 lastWidth = $inBox.width(); 531 532 var numCols = Math.round($inBox.width() / options.width); 533 var optionWidth = options.width; 534 var optionHeight = options.height; 535 if(options.columns) numCols = options.columns; 536 if(manualBreaks){ 537 numCols = $cache.find(prefixTheClassName("columnbreak", true)).length + 1; 538 optionWidth = false; 539 } 540 541// if ($inBox.data("columnized") && numCols == $inBox.children().length) { 542// return; 543// } 544 if(numCols <= 1){ 545 return singleColumnizeIt(); 546 } 547 if($inBox.data("columnizing")) return; 548 $inBox.data("columnized", true); 549 $inBox.data("columnizing", true); 550 551 $inBox.empty(); 552 $inBox.append($("<div style='width:" + (Math.floor(100 / numCols))+ "%; float: " + options.columnFloat + ";'></div>")); //" 553 $col = $inBox.children(":last"); 554 appendSafe($col, $cache.clone()); 555 maxHeight = $col.height(); 556 $inBox.empty(); 557 558 var targetHeight = maxHeight / numCols; 559 var firstTime = true; 560 var maxLoops = 3; 561 var scrollHorizontally = false; 562 if(options.overflow){ 563 maxLoops = 1; 564 targetHeight = options.overflow.height; 565 }else if(optionHeight && optionWidth){ 566 maxLoops = 1; 567 targetHeight = optionHeight; 568 scrollHorizontally = true; 569 } 570 571 // 572 // We loop as we try and workout a good height to use. We know it initially as an average 573 // but if the last column is higher than the first ones (which can happen, depending on split 574 // points) we need to raise 'adjustment'. We try this over a few iterations until we're 'solid'. 575 // 576 // also, lets hard code the max loops to 20. that's /a lot/ of loops for columnizer, 577 // and should keep run aways in check. if somehow someone has content combined with 578 // options that would cause an infinite loop, then this'll definitely stop it. 579 for(var loopCount=0;loopCount<maxLoops && loopCount<20;loopCount++){ 580 $inBox.empty(); 581 var $destroyable, className, $col, $lastKid; 582 try{ 583 $destroyable = $cache.clone(true); 584 }catch(e){ 585 // jquery in ie6 can't clone with true 586 $destroyable = $cache.clone(); 587 } 588 $destroyable.css("visibility", "hidden"); 589 // create the columns 590 for (var i = 0; i < numCols; i++) { 591 /* create column */ 592 className = (i === 0) ? prefixTheClassName("first") : ""; 593 className += " " + prefixTheClassName("column"); 594 className = (i == numCols - 1) ? (prefixTheClassName("last") + " " + className) : className; 595 $inBox.append($("<div class='" + className + "' style='width:" + (Math.floor(100 / numCols))+ "%; float: " + options.columnFloat + ";'></div>")); //" 596 } 597 598 // fill all but the last column (unless overflowing) 599 i = 0; 600 while(i < numCols - (options.overflow ? 0 : 1) || scrollHorizontally && $destroyable.contents().length){ 601 if($inBox.children().length <= i){ 602 // we ran out of columns, make another 603 $inBox.append($("<div class='" + className + "' style='width:" + (Math.floor(100 / numCols))+ "%; float: " + options.columnFloat + ";'></div>")); //" 604 } 605 $col = $inBox.children().eq(i); 606 if(scrollHorizontally){ 607 $col.width(optionWidth + "px"); 608 } 609 columnize($col, $destroyable, $col, targetHeight); 610 // make sure that the last item in the column isn't a "dontend" 611 split($col, $destroyable, $col, targetHeight); 612 613 while($col.contents(":last").length && checkDontEndColumn($col.contents(":last").get(0))){ 614 $lastKid = $col.contents(":last"); 615 $lastKid.remove(); 616 $destroyable.prepend($lastKid); 617 } 618 i++; 619 620 // 621 // https://github.com/adamwulf/Columnizer-jQuery-Plugin/issues/47 622 // 623 // check for infinite loop. 624 // 625 // this could happen when a dontsplit or dontend item is taller than the column 626 // we're trying to build, and its never actually added to a column. 627 // 628 // this results in empty columns being added with the dontsplit item 629 // perpetually waiting to get put into a column. lets force the issue here 630 if($col.contents().length === 0 && $destroyable.contents().length){ 631 // 632 // ok, we're building zero content columns. this'll happen forever 633 // since nothing can ever get taken out of destroyable. 634 // 635 // to fix, lets put 1 item from destroyable into the empty column 636 // before we iterate 637 $col.append($destroyable.contents(":first")); 638 }else if(i == numCols - (options.overflow ? 0 : 1) && !options.overflow){ 639 // 640 // ok, we're about to exit the while loop because we're done with all 641 // columns except the last column. 642 // 643 // if $destroyable still has columnbreak nodes in it, then we need to keep 644 // looping and creating more columns. 645 if($destroyable.find(prefixTheClassName("columnbreak", true)).length){ 646 numCols ++; 647 } 648 } 649 } 650 if(options.overflow && !scrollHorizontally){ 651 var IE6 = false; 652 /*@cc_on 653 @if (@_jscript_version < 5.7) 654 IE6 = true; 655 @end 656 @*/ 657 var IE7 = (document.all) && (navigator.appVersion.indexOf("MSIE 7.") != -1); 658 if(IE6 || IE7){ 659 var html = ""; 660 var div = document.createElement('DIV'); 661 while($destroyable[0].childNodes.length > 0){ 662 var kid = $destroyable[0].childNodes[0]; 663 for(i=0;i<kid.attributes.length;i++){ 664 if(kid.attributes[i].nodeName.indexOf("jQuery") === 0){ 665 kid.removeAttribute(kid.attributes[i].nodeName); 666 } 667 } 668 div.innerHTML = ""; 669 div.appendChild($destroyable[0].childNodes[0]); 670 html += div.innerHTML; 671 } 672 var overflow = $(options.overflow.id)[0]; 673 overflow.innerHTML = html; 674 }else{ 675 $(options.overflow.id).empty().append($destroyable.contents().clone(true)); 676 } 677 }else if(!scrollHorizontally){ 678 // the last column in the series 679 $col = $inBox.children().eq($inBox.children().length-1); 680 $destroyable.contents().each( function() { 681 $col.append( $(this) ); 682 }); 683 var afterH = $col.height(); 684 var diff = afterH - targetHeight; 685 var totalH = 0; 686 var min = 10000000; 687 var max = 0; 688 var lastIsMax = false; 689 var numberOfColumnsThatDontEndInAColumnBreak = 0; 690 $inBox.children().each(function($inBox){ return function($item){ 691 var $col = $inBox.children().eq($item); 692 var endsInBreak = $col.children(":last").find(prefixTheClassName("columnbreak", true)).length; 693 if(!endsInBreak){ 694 var h = $col.height(); 695 lastIsMax = false; 696 totalH += h; 697 if(h > max) { 698 max = h; 699 lastIsMax = true; 700 } 701 if(h < min) min = h; 702 numberOfColumnsThatDontEndInAColumnBreak++; 703 } 704 }; 705 }($inBox)); 706 707 var avgH = totalH / numberOfColumnsThatDontEndInAColumnBreak; 708 if(totalH === 0){ 709 // 710 // all columns end in a column break, 711 // so we're done here 712 loopCount = maxLoops; 713 }else if(options.lastNeverTallest && lastIsMax){ 714 // the last column is the tallest 715 // so allow columns to be taller 716 // and retry 717 // 718 // hopefully this'll mean more content fits into 719 // earlier columns, so that the last column 720 // can be shorter than the rest 721 adjustment += 5; 722 723 targetHeight = targetHeight + 30; 724 if(loopCount == maxLoops-1) maxLoops++; 725 }else if(max - min > 30){ 726 // too much variation, try again 727 targetHeight = avgH + 30; 728 }else if(Math.abs(avgH-targetHeight) > 20){ 729 // too much variation, try again 730 targetHeight = avgH; 731 }else { 732 // solid, we're done 733 loopCount = maxLoops; 734 } 735 }else{ 736 // it's scrolling horizontally, fix the width/classes of the columns 737 $inBox.children().each(function(i){ 738 $col = $inBox.children().eq(i); 739 $col.width(optionWidth + "px"); 740 if(i === 0){ 741 $col.addClass(prefixTheClassName("first")); 742 }else if(i==$inBox.children().length-1){ 743 $col.addClass(prefixTheClassName("last")); 744 }else{ 745 $col.removeClass(prefixTheClassName("first")); 746 $col.removeClass(prefixTheClassName("last")); 747 } 748 }); 749 $inBox.width($inBox.children().length * optionWidth + "px"); 750 } 751 $inBox.append($("<br style='clear:both;'>")); 752 } 753 $inBox.find(prefixTheClassName("column", true)).find(":first" + prefixTheClassName("removeiffirst", true)).remove(); 754 $inBox.find(prefixTheClassName("column", true)).find(':last' + prefixTheClassName("removeiflast", true)).remove(); 755 $inBox.find(prefixTheClassName("split", true)).find(":first" + prefixTheClassName("removeiffirst", true)).remove(); 756 $inBox.find(prefixTheClassName("split", true)).find(':last' + prefixTheClassName("removeiflast", true)).remove(); 757 $inBox.data("columnizing", false); 758 759 if(options.overflow){ 760 options.overflow.doneFunc(); 761 } 762 options.doneFunc(); 763 } 764 }); 765 }; 766 767$.fn.renumberByJS=function($searchTag, $colno, $targetId, $targetClass ) { 768 this.setList = function($cols, $list, $tag1) { 769 var $parents = this.before.parents(); 770 var $rest; 771 772 $rest = $($cols[this.offset-1]).find('>*'); 773 774 if( ($rest.last())[0].tagName!=$tag1.toUpperCase()) { 775 if(this.debug) { 776 console.log("Last item in previous column, isn't a list..."); 777 } 778 return 0; 779 } 780 $rest = $rest.length; 781 var $tint = 1; 782 783 if(this.lastOther<=0) { 784 $tint = this.before.children().length+1; 785 } else { 786 $tint = $($parents[this.lastOther]).children().length+1; 787 } 788 // if the first LI in the current column is split, decrement, as we want the same number/key 789 if( $($cols[this.offset]).find($tag1+':first li.split').length ) { 790 var $whereElipsis=$($cols[this.offset-1]).find($tag1+':last li:last'); 791 if( this.elipsisText==='' || 792 $($cols[this.offset-1]).find($tag1+':last ~ div').length || 793 $($cols[this.offset-1]).find($tag1+':last ~ p').length ) { 794 ; 795 } else { 796 if($($whereElipsis).find('ul, ol, dl').length ==0 ) { 797 798 var $txt=$whereElipsis.last().text(); 799 // char counting, 'cus MSIE 8 is appearently stupid 800 var $len=$txt.length; 801 if($txt.substring($len-1)==';') { 802 if($txt.substring($len-4)!=this.elipsisText+';') { 803 $txt=$txt.substring(0, $len-1)+this.elipsisText+';'; 804 } 805 } else { 806 if($txt.substring($len-3)!=this.elipsisText) { 807 $txt+=this.elipsisText; 808 } 809 } 810 $whereElipsis.last().text($txt); 811 } 812 } 813 // an item in split between two columns. it only holds one key... 814 if($($cols[this.offset]).find($tag1+':first >li.split >'+$tag1).length==0) { 815 $tint--; 816 } 817 } 818 if($rest==1) { 819 // the last column only held one thing, so assume its wrapped to the column before that as well. 820 $tint += this.prevMax ; 821 } 822 if(this.nest>1) { 823 if(this.debug) { 824 console.log("Supposed to be a nested list...decr"); 825 } 826 $tint--; 827// some how, id previous list starts split, need secins decrement, 828// if "split" is now correct, reference this 829 var $tt = $($cols[this.offset -1]).find($tag1+':first li.split:first'); 830 if($tt.length>0) { 831 if(this.debug) { 832 console.log("Previous column started with a split item, so that count is one less than expected"); 833 } 834 $tint--; 835 } 836 837 838 $tt = $($cols[this.offset]).find($tag1+':first li:first').clone(); 839 $tt.children().remove(); 840 if( $.trim($tt.text()).length>0 ){ 841 if(this.debug) { 842 console.log("If that was a complete list in the previous column, don't decr."); 843 } 844 $tint++; 845 846 if($($cols[this.offset-1]).find(">"+$tag1+':last ').children().length==0 ) { 847 if(this.debug) { 848 console.log("unless that was empty, in which case revert"); 849 } 850 $tint--; 851 } 852 } 853 854 } else { 855 var $tt = $($cols[this.offset]).find($tag1+':first li:first '+$tag1+".split li.split"); 856 if($tt.length>0) { 857 if(this.debug) { 858 console.log("[Nested] Column started with a split item, so that count is one less than expected"); 859 } 860 $tint--; 861 } 862 863 } 864 865 if(this.debug) { 866 console.log("Setting the start value to "+$tint+" ("+this.prevMax +")"); 867 } 868 if($tint >0) { 869 // if the above computation leads to 0, or an empty list (more likely), don't set, leave as 1 870 if(typeof this.setColumnStart == 'function') { 871 this.setColumnStart($list, $tint); 872 } else { 873 $list.attr('start', $tint); 874 } 875 } 876 return 0; 877 } 878 879 if(typeof $targetId === 'undefined') { $targetId=false; } 880 if(typeof $targetClass === 'undefined') { $targetClass=false; } 881 if(! $targetId && !$targetClass ) { 882 throw "renumberByJS(): Bad param, must pass an id or a class"; 883 } 884 885 var $target =''; 886 this.prevMax =1; 887 888 if($targetClass) { 889 $target ="."+$targetClass; 890 } else { 891 $target ="#"+$targetId; 892 } 893 var $tag1 = $searchTag.toLowerCase(); 894 var $tag2 = $searchTag.toUpperCase(); 895 896 this.cols = $($target); 897 if(this.debug) { 898 console.log("There are "+this.cols.length+" items, looking for "+$tag1); 899 } 900 901 this.before = $(this.cols[0]).find($tag1+':last'); 902 this.prevMax = this.before.children().length; 903 904// start at 1, as must compare to previous... 905 for(this.offset=1; this.offset<this.cols.length; this.offset++) { 906 if(this.debug) { 907 console.log("iterating "+this.offset+"...[of "+this.cols.length+"]"); 908 } 909// if the first column again, nothing to the left of you, do nothing... 910 if(this.offset % $colno==0) { 911 if(this.debug) {
912 console.log("First column (in theory..)"); 913 } 914 915 this.prevMax = 1; 916 continue; 917 } 918 919 this.before = $(this.cols[this.offset-1]).find($tag1+':last'); 920// if there are no occurences of the searchTag, do nothing 921 if(this.before.length) { 922 if(this.debug) { 923 console.log("Have some "+$searchTag+" elements in the previous column"); 924 } 925 926 var $list = $(this.cols[this.offset]).find($tag1+':first'); 927 var $first = $(this.cols[this.offset]).find('*:first'); 928 if($first[0] !== $list[0]) { 929// don't renumber anything, its not a rollover list 930 continue; 931 } 932 933 var $parents = this.before.parents(); 934 this.lastOther = 0; 935 var $found = false; 936 for(; this.lastOther<$parents.length; this.lastOther++) { 937 if($parents[this.lastOther].tagName != $tag2 && $parents[this.lastOther].tagName != "LI") { 938 $found = true; 939 this.lastOther--; 940 break; 941 } 942 } 943 944 this.nest =1; 945 if($(this.cols[this.offset]).find(">"+$tag1+':first li '+$tag1+":first").length) { 946 this.nest = 2; 947 } 948 this.setList(this.cols, $list, $tag1); 949 this.lastOther--; 950 $list = $(this.cols[this.offset]).find($tag1+':first li '+$tag1+":first"); 951 if($list.length) { 952// I hope the two columns have same nesting, or its busted 953 954 this.before= $(this.cols[this.offset-1]).find(">"+$tag1+':last li '+$tag1+":last"); 955 this.prevMax= 0; 956 this.nest =1; 957 this.setList(this.cols, $list, $tag1); 958 } 959 var $reset = $(this.cols[this.offset-1]).find(">"+$tag1+':last'); 960 this.prevMax = $reset.children().length; 961 } 962 } 963 return 0; 964}; 965 966})(jQuery); 967if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 968 var msViewportStyle = document.createElement('style') 969 msViewportStyle.appendChild( 970 document.createTextNode( 971 '@-ms-viewport{width:auto!important}' 972 ) 973 ) 974 document.querySelector('head').appendChild(msViewportStyle) 975} 976; 977/* 978 * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz (1.6) 979 * 980 * http://www.heise.de/extras/socialshareprivacy/ 981 * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html 982 * 983 * Copyright (c) 2011-2014 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, 984 * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de 985 * 986 * is released under the MIT License http://www.opensource.org/licenses/mit-license.php 987 * 988 * Spread the word, link to us if you can. 989 */ 990 991(function ($) { 992 993 "use strict"; 994 995 // 996 // helper functions 997 // 998 999 // abbreviate at last blank before length and add "\u2026" (horizontal ellipsis) 1000 function abbreviateText(text, length) { 1001 var abbreviated = decodeURIComponent(text); 1002 if (abbreviated.length <= length) { 1003 return text; 1004 } 1005 1006 var lastWhitespaceIndex = abbreviated.substring(0, length - 1).lastIndexOf(' '); 1007 abbreviated = encodeURIComponent(abbreviated.substring(0, lastWhitespaceIndex)) + "\u2026"; 1008 1009 return abbreviated; 1010 } 1011 1012 // returns content of <meta name="" content=""> tags or '' if empty/non existant 1013 function getMeta(name) { 1014 var metaContent = $('meta[name="' + name + '"]').attr('content'); 1015 return metaContent || ''; 1016 } 1017 1018 // create tweet text from content of <meta name="DC.title"> and <meta name="DC.creator"> 1019 // fallback to content of <title> tag 1020 function getTweetText() { 1021 var title = getMeta('DC.title'); 1022 var creator = getMeta('DC.creator'); 1023 1024 if (title.length > 0 && creator.length > 0) { 1025 title += ' - ' + creator; 1026 } else { 1027 title = $('title').text(); 1028 } 1029 1030 return encodeURIComponent(title); 1031 } 1032 1033 // build URI from rel="canonical" or document.location 1034 function getURI() { 1035 var uri = document.location.href; 1036 var canonical = $("link[rel=canonical]").attr("href"); 1037 1038 if (canonical && canonical.length > 0) { 1039 if (canonical.indexOf("http") < 0) { 1040 canonical = document.location.protocol + "//" + document.location.host + canonical; 1041 } 1042 uri = canonical; 1043 } 1044 1045 return uri; 1046 } 1047 1048 function cookieSet(name, value, days, path, domain) { 1049 var expires = new Date(); 1050 expires.setTime(expires.getTime() + (days * 24 * 60 * 60 * 1000)); 1051 document.cookie = name + '=' + value + '; expires=' + expires.toUTCString() + '; path=' + path + '; domain=' + domain; 1052 } 1053 function cookieDel(name, value, path, domain) { 1054 var expires = new Date(); 1055 expires.setTime(expires.getTime() - 100); 1056 document.cookie = name + '=' + value + '; expires=' + expires.toUTCString() + '; path=' + path + '; domain=' + domain; 1057 } 1058 1059 // extend jquery with our plugin function 1060 $.fn.socialSharePrivacy = function (settings) { 1061 var defaults = { 1062 'services' : { 1063 'facebook' : { 1064 'status' : 'on', 1065 'dummy_img' : '/fileadmin/templates/Startseite/socialshareprivacy/images/dummy_facebook.png', 1066 'perma_option' : 'on', 1067 'referrer_track' : '', 1068 'action' : 'recommend', 1069 'layout' : 'button_count', 1070 'sharer' : { 1071 'status' : 'off', 1072 'dummy_img' : '/fileadmin/templates/Startseite/socialshareprivacy/images/dummy_facebook_share_de.png',
1073 'img' : '/fileadmin/templates/Startseite/socialshareprivacy/images/dummy_facebook_share_active_de.png' 1074 } 1075 }, 1076 'twitter' : { 1077 'status' : 'on', 1078 'dummy_img' : '/fileadmin/templates/Startseite/socialshareprivacy/images/dummy_twitter.png', 1079 'perma_option' : 'on', 1080 'referrer_track' : '', 1081 'tweet_text' : getTweetText, 1082 'count' : 'horizontal' 1083 }, 1084 'gplus' : { 1085 'status' : 'on', 1086 'dummy_img' : '/fileadmin/templates/Startseite/socialshareprivacy/images/dummy_gplus.png', 1087 'perma_option' : 'on', 1088 'referrer_track' : '', 1089 'size' : 'medium' 1090 } 1091 }, 1092 'info_link' : '', 1093 'cookie_path' : '/', 1094 'cookie_domain' : document.location.host, 1095 'cookie_expires' : '365', 1096 'css_path' : '/fileadmin/templates/Startseite/socialshareprivacy/socialshareprivacy.css', 1097 'uri' : getURI, 1098 'language' : 'de', 1099 'lang_path' : '/fileadmin/templates/Startseite/socialshareprivacy/lang/', 1100 'skin' : 'light', 1101 'alignment' : 'horizontal', 1102 'switch_alignment' : 'left', 1103 'perma_orientation' : 'down' 1104 }; 1105 1106 // Standardwerte des Plug-Ins mit den vom User angegebenen Optionen ueberschreiben 1107 var options = $.extend(true, defaults, settings); 1108 1109 var facebook_on = (options.services.facebook.status === 'on'); 1110 var facebook_sharer_on = (options.services.facebook.sharer.status === 'on'); 1111 var twitter_on = (options.services.twitter.status === 'on'); 1112 var gplus_on = (options.services.gplus.status === 'on'); 1113 1114 // check if at least one service is "on" 1115 if (!facebook_on && !twitter_on && !gplus_on) { 1116 return; 1117 } 1118 1119 // insert stylesheet into document and prepend target element 1120 if (options.css_path.length > 0 && $(window).data('socialshareprivacy_css') != '1') { 1121 // IE fix (noetig fuer IE < 9 - wird hier aber fuer alle IE gemacht) 1122 if (document.createStyleSheet) { 1123 document.createStyleSheet(options.css_path); 1124 } 1125 else { 1126 $('head').append('<link rel="stylesheet" type="text/css" href="' + options.css_path + '" />'); 1127 } 1128 1129 $(window).data('socialshareprivacy_css','1'); 1130 } 1131 1132 var language; 1133 1134 function loadLangFile() { 1135 var d = $.Deferred(); 1136 1137 $.getJSON(options.lang_path + options.language+'.lang', function(data) { 1138 language = data; 1139 d.resolve(); 1140 }).fail(function(s){ 1141 if(typeof console !== "undefined") { 1142 console.log('Error ' + s.status + ' while loading the language file ('+options.lang_path+options.language+'.lang)'); 1143 } 1144 d.reject(); 1145 }); 1146 1147 return d.promise(); 1148 } 1149 1150 return this.each(function () { 1151 var iteration = this; 1152 1153 $.when( 1154 loadLangFile()) 1155 .then( function() { 1156 $(iteration).prepend('<ul class="social_share_privacy_area clearfix"></ul>'); 1157 var context = $('.social_share_privacy_area', iteration); 1158 1159 // Class for dark skinning 1160 if(options.skin == 'dark') { 1161 $(context).addClass('skin-dark'); 1162 } 1163 1164 // Class for alignment 1165 if(options.alignment == 'vertical') { 1166 $(context).addClass('vertical'); 1167 1168 if(options.switch_alignment == 'right' && 1169 ((facebook_on && options.services.facebook.layout == 'box_count') || (!facebook_on)) && 1170 ((twitter_on && options.services.twitter.count == 'vertical') || (!twitter_on)) && 1171 ((gplus_on && options.services.gplus.size == 'tall') || (!gplus_on))) { 1172 $(context).addClass('switch_right'); 1173 } 1174 } 1175 1176 // canonical uri that will be shared 1177 var uri = options.uri; 1178 if (typeof uri === 'function') { 1179 uri = uri(context); 1180 } 1181 1182 // 1183 // Facebook 1184 // 1185 if (facebook_on) { 1186 var fb_dummy_btn; 1187 var fb_code; 1188 1189 var fb_height = options.services.facebook.layout == 'box_count' ? '61' : '21'; 1190 var fb_width = options.services.facebook.layout == 'box_count' ? '90' : '130'; 1191 1192 var fb_enc_uri = encodeURIComponent(uri + options.services.facebook.referrer_track); 1193 1194 if (facebook_sharer_on) { 1195 fb_dummy_btn = '<img src="' + options.services.facebook.sharer.dummy_img + '" alt="Facebook "Share"-Dummy" class="fb_like_privacy_dummy" />'; 1196 fb_code = '<a href="#" onclick="window.open(\'https://www.facebook.com/sharer/sharer.php?u=' + fb_enc_uri + '\', \'facebook-share-dialog\', \'width=626,height=436\'); return false;"><img src="'+options.services.facebook.sharer.img+'" alt="" /></a>'; 1197 } 1198 else { 1199 fb_dummy_btn = '<img src="' + options.services.facebook.dummy_img + '" alt="Facebook "Like"-Dummy" class="fb_like_privacy_dummy" />'; 1200 fb_code = '<iframe src="//www.facebook.com/plugins/like.php?locale=' + language.services.facebook.language + '&href=' + fb_enc_uri + '&width=' + fb_width + '&layout=' + options.services.facebook.layout + '&action=' + options.services.facebook.action + '&show_faces=false&share=false&height=' + fb_height + '&colorscheme=' + options.skin + '" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:' + fb_width + 'px; height:' + fb_height + 'px;" allowTransparency="true"></iframe>'; 1201 } 1202 context.append('<li class="facebook help_info clearfix"><span class="info">' + language.services.facebook.txt_info + '</span><a href="#" class="switch off">' + language.services.facebook.txt_fb_off + '</a><div class="fb_like dummy_btn">' + fb_dummy_btn + '</div></li>'); 1203 1204 var $container_fb = $('li.facebook', context); 1205 $(context).on('click', 'li.facebook div.fb_like img.fb_like_privacy_dummy,li.facebook .switch', function (e) { 1206 e.preventDefault(); 1207 if ($container_fb.find('.switch').hasClass('off')) { 1208 $container_fb.addClass('info_off'); 1209 $container_fb.find('.switch').addClass('on').removeClass('off').html(language.services.facebook.txt_fb_on); 1210 $container_fb.find('img.fb_like_privacy_dummy').replaceWith(fb_code); 1211 } 1212 else { 1213 $container_fb.removeClass('info_off'); 1214 $container_fb.find('.switch').addClass('off').removeClass('on').html(language.services.facebook.txt_fb_off); 1215 $container_fb.find('.fb_like').html(fb_dummy_btn); 1216 } 1217 }); 1218 } 1219 1220 // 1221 // Twitter 1222 // 1223 if (twitter_on) { 1224 var text = options.services.twitter.tweet_text; 1225 if (typeof text === 'function') { 1226 text = text(); 1227 } 1228 // 120 is the max character count left after twitters automatic url shortening with t.co 1229 text = abbreviateText(text, '120'); 1230 1231 var tw_height = options.services.twitter.count == 'horizontal' ? '25' : '62'; 1232 var tw_width = options.services.twitter.count == 'horizontal' ? '130' : '83'; 1233 1234 var twitter_enc_uri = encodeURIComponent(uri + options.services.twitter.referrer_track); 1235 var twitter_count_url = encodeURIComponent(uri); 1236 var twitter_code = '<iframe allowtransparency="true" frameborder="0" scrolling="no" src="//platform.twitter.com/widgets/tweet_button.html?url=' + twitter_enc_uri + '&counturl=' + twitter_count_url + '&
1236text=' + text + '&count=' + options.services.twitter.count + '&lang=' + language.services.twitter.language + '&dnt=true" style="width:' + tw_width + 'px; height:' + tw_height + 'px;"></iframe>'; 1237 var twitter_dummy_btn = '<img src="' + options.services.twitter.dummy_img + '" alt=""Tweet this"-Dummy" class="tweet_this_dummy" />'; 1238 1239 context.append('<li class="twitter help_info clearfix"><span class="info">' + language.services.twitter.txt_info + '</span><a href="#" class="switch off">' + language.services.twitter.txt_twitter_off + '</a><div class="tweet dummy_btn">' + twitter_dummy_btn + '</div></li>'); 1240 1241 var $container_tw = $('li.twitter', context); 1242 1243 $(context).on('click', 'li.twitter div.tweet img,li.twitter .switch', function (e) { 1244 e.preventDefault(); 1245 if ($container_tw.find('.switch').hasClass('off')) { 1246 $container_tw.addClass('info_off'); 1247 $container_tw.find('.switch').addClass('on').removeClass('off').html(language.services.twitter.txt_twitter_on); 1248 $container_tw.find('img.tweet_this_dummy').replaceWith(twitter_code); 1249 } 1250 else { 1251 $container_tw.removeClass('info_off'); 1252 $container_tw.find('.switch').addClass('off').removeClass('on').html(language.services.twitter.txt_twitter_off); 1253 $container_tw.find('.tweet').html(twitter_dummy_btn); 1254 } 1255 }); 1256 } 1257 1258 // 1259 // Google+ 1260 // 1261 if (gplus_on) { 1262 // fuer G+ wird die URL nicht encoded, da das zu einem Fehler fuehrt 1263 var gplus_uri = uri + options.services.gplus.referrer_track; 1264 1265 // we use the Google+ "asynchronous" code, standard code is flaky if inserted into dom after load 1266 var gplus_code = '<div class="g-plusone" data-size="' + options.services.gplus.size + '" data-href="' + gplus_uri + '"></div><script type="text/javascript">window.___gcfg = {lang: "' + language.services.gplus.language + '"}; (function() { var po = document.createElement("script"); po.type = "text/javascript"; po.async = true; po.src = "https://apis.google.com/js/platform.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s); })(); </script>'; 1267 var gplus_dummy_btn = '<img src="' + options.services.gplus.dummy_img + '" alt=""Google+1"-Dummy" class="gplus_one_dummy" />'; 1268 1269 context.append('<li class="gplus help_info clearfix"><span class="info">' + language.services.gplus.txt_info + '</span><a href="#" class="switch off">' + language.services.gplus.txt_gplus_off + '</a><div class="gplusone dummy_btn">' + gplus_dummy_btn + '</div></li>'); 1270 1271 var $container_gplus = $('li.gplus', context); 1272 1273 $(context).on('click', 'li.gplus div.gplusone img,li.gplus .switch', function (e) { 1274 e.preventDefault(); 1275 if ($container_gplus.find('.switch').hasClass('off')) { 1276 $container_gplus.addClass('info_off'); 1277 $container_gplus.find('.switch').addClass('on').removeClass('off').html(language.services.gplus.txt_gplus_on); 1278 $container_gplus.find('img.gplus_one_dummy').replaceWith(gplus_code); 1279 } 1280 else { 1281 $container_gplus.removeClass('info_off'); 1282 $container_gplus.find('.switch').addClass('off').removeClass('on').html(language.services.gplus.txt_gplus_off); 1283 $container_gplus.find('.gplusone').html(gplus_dummy_btn); 1284 } 1285 }); 1286 } 1287 1288 //
1289 // Der Info/Settings-Bereich wird eingebunden 1290 // 1291 context.append('<li class="settings_info ' + options.perma_orientation + '"><div class="settings_info_menu off perma_option_off"><span class="help_info icon"><span class="info">' + language.txt_help + '</span></span></div></li>'); 1292 1293 // Info-Overlays mit leichter Verzoegerung einblenden 1294 $(context).on('mouseenter', '.help_info:not(.info_off)', function () { 1295 var $info_wrapper = $(this); 1296 var timeout_id = window.setTimeout(function () { $($info_wrapper).addClass('display'); }, 500); 1297 $(this).data('timeout_id', timeout_id); 1298 }); 1299 $(context).on('mouseleave', '.help_info', function () { 1300 var timeout_id = $(this).data('timeout_id'); 1301 window.clearTimeout(timeout_id); 1302 if ($(this).hasClass('display')) { 1303 $(this).removeClass('display'); 1304 } 1305 }); 1306 1307 var facebook_perma = (options.services.facebook.perma_option === 'on'); 1308 var twitter_perma = (options.services.twitter.perma_option === 'on'); 1309 var gplus_perma = (options.services.gplus.perma_option === 'on'); 1310 1311 // Menue zum dauerhaften Einblenden der aktiven Dienste via Cookie einbinden 1312 if ((facebook_on && facebook_perma) || (twitter_on && twitter_perma) || (gplus_on && gplus_perma)) { 1313 1314 // Cookies abrufen 1315 var cookie_list = document.cookie.split(';'); 1316 var cookies = '{'; 1317 var i = 0; 1318 for (; i < cookie_list.length; i += 1) { 1319 var foo = cookie_list[i].split('='); 1320 // Spaces and Quotes getting removed 1321 foo[0] = $.trim(foo[0].replace(/"/g, '')); 1322 foo[1] = $.trim(foo[1].replace(/"/g, '')); 1323 cookies += '"' + foo[0] + '":"' + foo[1] + '"'; 1324 if (i < cookie_list.length - 1) { 1325 cookies += ','; 1326 } 1327 } 1328 cookies += '}'; 1329 cookies = jQuery.parseJSON(cookies); 1330 1331 // Container definieren 1332 var $container_settings_info = $('li.settings_info', context); 1333 1334 // Klasse entfernen, die das i-Icon alleine formatiert, da Perma-Optionen eingeblendet werden 1335 $container_settings_info.find('.settings_info_menu').removeClass('perma_option_off'); 1336 1337 // Perma-Optionen-Icon (.settings) und Formular (noch versteckt) einbinden 1338 $container_settings_info.find('.settings_info_menu').append('<a href="#" class="settings">' + language.settings + '</a><form><fieldset><legend>' + language.settings_perma + '</legend></fieldset></form>'); 1339 1340 1341 var random = 'r' + Math.floor(Math.random()*101); 1342 1343 // Die Dienste mit <input> und <label>, sowie checked-Status laut Cookie, schreiben 1344 var checked = ' checked="checked"'; 1345 if (facebook_on && facebook_perma) { 1346 var perma_status_facebook = cookies.socialSharePrivacy_facebook === 'perma_on' ? checked : ''; 1347 $container_settings_info.find('form fieldset').append( 1348 '<input type="checkbox" name="perma_status_facebook" id="' + random + '_perma_status_facebook"' + perma_status_facebook + ' /><label for="'+random+'_perma_status_facebook">' + language.services.facebook.perma_display_name + '</label>' 1349 ); 1350 } 1351 1352 if (twitter_on && twitter_perma) { 1353 var perma_status_twitter = cookies.socialSharePrivacy_twitter === 'perma_on' ? checked : ''; 1354 $container_settings_info.find('form fieldset').append( 1355 '<input type="checkbox" name="perma_status_twitter" id="' + random + '_perma_status_twitter"' + perma_status_twitter + ' /><label for="'+random+'_perma_status_twitter">' + language.services.twitter.perma_display_name + '</label>' 1356 ); 1357 } 1358 1359 if (gplus_on && gplus_perma) { 1360 var perma_status_gplus = cookies.socialSharePrivacy_gplus === 'perma_on' ? checked : ''; 1361 $container_settings_info.find('form fieldset').append( 1362 '<input type="checkbox" name="perma_status_gplus" id="'+random+'_perma_status_gplus"' + perma_status_gplus + ' /><label for="'+random+'_perma_status_gplus">' + language.services.gplus.perma_display_name + '</label>' 1363 ); 1364 } 1365 1366 // Settings-Menue per Tastatur erreichbar machen, die Mouseevents werden getriggert 1367 $(context).on('click', 'li.settings_info .settings', function (e) { 1368 e.preventDefault(); 1369 if($(this).data('keyb') == 'on') { 1370 $('li.settings_info', context).trigger('mouseleave'); 1371 $(this).data('keyb','off'); 1372 } 1373 else { 1374 $('li.settings_info .settings', context).trigger('mouseenter'); 1375 $(this).data('keyb','on'); 1376 } 1377 }); 1378 1379 // Einstellungs-Menue bei mouseover ein-/ausblenden 1380 $(context).on('mouseenter', 'li.settings_info .settings', function () { 1381 var timeout_id = window.setTimeout(function () { $container_settings_info.find('.settings_info_menu').removeClass('off').addClass('on'); }, 500); 1382 $(this).data('timeout_id', timeout_id); 1383 }); 1384 $(context).on('mouseleave', 'li.settings_info', function () { 1385 var timeout_id = $(this).data('timeout_id'); 1386 window.clearTimeout(timeout_id); 1387 $container_settings_info.find('.settings_info_menu').removeClass('on').addClass('off'); 1388 }); 1389 1390 // Klick-Interaktion auf <input> um Dienste dauerhaft ein- oder auszuschalten (Cookie wird gesetzt oder geloescht) 1391 $(context).on('click', 'li.settings_info fieldset input', function (event) { 1392 var click = event.target.id; 1393 var service = click.substr(click.lastIndexOf('_') + 1, click.length); 1394 var cookie_name = 'socialSharePrivacy_' + service; 1395 1396 if ($('#' + event.target.id + ':checked').length) { 1397 cookieSet(cookie_name, 'perma_on', options.cookie_expires, options.cookie_path, options.cookie_domain); 1398 $('form fieldset label[for=' + click + ']', context).addClass('checked'); 1399 } 1400 else { 1401 cookieDel(cookie_name, 'perma_on', options.cookie_path, options.cookie_domain); 1402 $('form fieldset label[for=' + click + ']', context).removeClass('checked'); 1403 } 1404 }); 1405
1406 // Dienste automatisch einbinden, wenn entsprechendes Cookie vorhanden ist 1407 if (facebook_on && facebook_perma && cookies.socialSharePrivacy_facebook === 'perma_on') { 1408 $('li.facebook .switch', context).click(); 1409 } 1410 if (twitter_on && twitter_perma && cookies.socialSharePrivacy_twitter === 'perma_on') { 1411 $('li.twitter .switch', context).click(); 1412 } 1413 if (gplus_on && gplus_perma && cookies.socialSharePrivacy_gplus === 'perma_on') { 1414 $('li.gplus .switch', context).click(); 1415 } 1416 } 1417 }); // .then() 1418 }); // this.each(function () 1419 }; // $.fn.socialSharePrivacy = function (settings) { 1420}(jQuery)); 1421/** 1422* jquery.matchHeight.js v0.5.2 1423* http://brm.io/jquery-match-height/ 1424* License: MIT 1425*/ 1426 1427 1428(function($) { 1429 1430 $.fn.matchHeight = function(byRow) { 1431 1432 // handle matchHeight('remove') 1433 if (byRow === 'remove') { 1434 var that = this; 1435 1436 // remove fixed height from all selected elements 1437 this.css('height', ''); 1438 1439 // remove selected elements from all groups 1440 $.each($.fn.matchHeight._groups, function(key, group) { 1441 group.elements = group.elements.not(that); 1442 }); 1443 1444 // TODO: cleanup empty groups 1445 1446 return this; 1447 } 1448 1449 if (this.length <= 1) 1450 return this; 1451 1452 // byRow default to true 1453 byRow = (typeof byRow !== 'undefined') ? byRow : true; 1454 1455 // keep track of this group so we can re-apply later on load and resize events 1456 $.fn.matchHeight._groups.push({ 1457 elements: this, 1458 byRow: byRow 1459 }); 1460 1461 // match each element's height to the tallest element in the selection 1462 $.fn.matchHeight._apply(this, byRow); 1463 1464 return this; 1465 }; 1466 1467 $.fn.matchHeight._apply = function(elements, byRow) { 1468 var $elements = $(elements), 1469 rows = [$elements]; 1470 1471 // get rows if using byRow, otherwise assume one row 1472 if (byRow) { 1473 1474 // must first force an arbitrary equal height so floating elements break evenly 1475 $elements.css({ 1476 'display': 'block', 1477 'padding-top': '0', 1478 'padding-bottom': '0', 1479 'border-top-width': '0', 1480 'border-bottom-width': '0', 1481 'height': '100px' 1482 }); 1483 1484 // get the array of rows (based on element top position) 1485 rows = _rows($elements); 1486 1487 // revert the temporary forced style 1488 $elements.css({ 1489 'display': '', 1490 'padding-top': '', 1491 'padding-bottom': '', 1492 'border-top-width': '', 1493 'border-bottom-width': '', 1494 'height': '' 1495 }); 1496 } 1497 1498 $.each(rows, function(key, row) { 1499 var $row = $(row), 1500 maxHeight = 0; 1501 1502 // iterate the row and find the max height 1503 $row.each(function(){ 1504 var $that = $(this); 1505 1506 // ensure we get the correct actual height (and not a previously set height value) 1507 $that.css({ 'display': 'block', 'height': '' }); 1508 1509 // find the max height (including padding, but not margin) 1510 if ($that.outerHeight(false) > maxHeight) 1511 maxHeight = $that.outerHeight(false); 1512 1513 // revert display block 1514 $that.css({ 'display': '' }); 1515 }); 1516 1517 // iterate the row and apply the height to all elements 1518 $row.each(function(){ 1519 var $that = $(this), 1520 verticalPadding = 0; 1521 1522 // handle padding and border correctly (required when not using border-box) 1523 if ($that.css('box-sizing') !== 'border-box') { 1524 verticalPadding += _parse($that.css('border-top-width')) + _parse($that.css('border-bottom-width')); 1525 verticalPadding += _parse($that.css('padding-top')) + _parse($that.css('padding-bottom')); 1526 } 1527 1528 // set the height (accounting for padding and border) 1529 $that.css('height', maxHeight - verticalPadding); 1530 }); 1531 }); 1532 1533 return this; 1534 }; 1535 1536 /* 1537 * _applyDataApi will apply matchHeight to all elements with a data-match-height attribute 1538 */ 1539 1540 $.fn.matchHeight._applyDataApi = function() { 1541 var groups = {}; 1542 1543 // generate groups by their groupId set by elements using data-match-height 1544 $('[data-match-height], [data-mh]').each(function() { 1545 var $this = $(this), 1546 groupId = $this.attr('data-match-height'); 1547 if (groupId in groups) { 1548 groups[groupId] = groups[groupId].add($this); 1549 } else { 1550 groups[groupId] = $this; 1551 } 1552 }); 1553 1554 // apply matchHeight to each group 1555 $.each(groups, function() { 1556 this.matchHeight(true); 1557 }); 1558 }; 1559 1560 /* 1561 * _update function will re-apply matchHeight to all groups with the correct options 1562 */ 1563 1564 $.fn.matchHeight._groups = []; 1565 $.fn.matchHeight._throttle = 80; 1566 1567 var previousResizeWidth = -1, 1568 updateTimeout = -1; 1569 1570 $.fn.matchHeight._update = function(event) { 1571 // prevent update if fired from a resize event 1572 // where the viewport width hasn't actually changed 1573 // fixes an event looping bug in IE8 1574 if (event && event.type === 'resize') { 1575 var windowWidth = $(window).width(); 1576 if (windowWidth === previousResizeWidth) 1577 return; 1578 previousResizeWidth = windowWidth; 1579 } 1580 1581 // throttle updates 1582 if (updateTimeout === -1) { 1583 updateTimeout = setTimeout(function() { 1584 1585 $.each($.fn.matchHeight._groups, function() { 1586 $.fn.matchHeight._apply(this.elements, this.byRow); 1587 }); 1588 1589 updateTimeout = -1; 1590 1591 }, $.fn.matchHeight._throttle); 1592 } 1593 }; 1594 1595 /* 1596 * bind events 1597 */ 1598 1599 // apply on DOM ready event 1600 $($.fn.matchHeight._applyDataApi);
1601 1602 // update heights on load and resize events 1603 $(window).bind('load resize orientationchange', $.fn.matchHeight._update); 1604 1605 /* 1606 * rows utility function 1607 * returns array of jQuery selections representing each row 1608 * (as displayed after float wrapping applied by browser) 1609 */ 1610 1611 var _rows = function(elements) { 1612 var tolerance = 1, 1613 $elements = $(elements), 1614 lastTop = null, 1615 rows = []; 1616 1617 // group elements by their top position 1618 $elements.each(function(){ 1619 var $that = $(this), 1620 top = $that.offset().top - _parse($that.css('margin-top')), 1621 lastRow = rows.length > 0 ? rows[rows.length - 1] : null; 1622 1623 if (lastRow === null) { 1624 // first item on the row, so just push it 1625 rows.push($that); 1626 } else { 1627 // if the row top is the same, add to the row group 1628 if (Math.floor(Math.abs(lastTop - top)) <= tolerance) { 1629 rows[rows.length - 1] = lastRow.add($that); 1630 } else { 1631 // otherwise start a new row group 1632 rows.push($that); 1633 } 1634 } 1635 1636 // keep track of the last row top 1637 lastTop = top; 1638 }); 1639 1640 return rows; 1641 }; 1642 1643 var _parse = function(value) { 1644 // parse value and convert NaN to 0 1645 return parseFloat(value) || 0; 1646 }; 1647 1648})(jQuery); 1649// functions for jumbotron slider and content slider 1650 1651$(function() { 1652 function nextSliderMobile(slider) { 1653 var current = $(slider).find(".slider-open"); 1654 current.removeClass("slider-open"); 1655 var divs = current.parent().children(".jumbotron-mobile-inner"); 1656 var next = divs.eq((divs.index(current) + 1) % divs.length); 1657 next.addClass("slider-open"); 1658 current.closest(".jumbotron-mobile").css("background-image","url("+current.closest(".jumbotron-mobile").find('div[data-open="#'+next.attr('id')+'"]').attr("data-bg")+")"); 1659 } 1660 1661 function nextSlider(slider) { 1662 var current = $(slider).find(".slider-open"); 1663 current.removeClass("slider-open"); 1664 var divs = current.parent().children(); 1665 var next = divs.eq((divs.index(current) + 1) % divs.length); 1666 next.addClass("slider-open"); 1667 current.closest(".jumbotron-slider-container").css("background-image","url("+next.attr("data-bg")+")"); 1668 } 1669 1670 function nextContentSlider(slider) { 1671 var current = $(slider).find(".content-slider-open"); 1672 current.removeClass("content-slider-open"); 1673 var divs = current.parent().children(); 1674 var next = divs.eq((divs.index(current) + 1) % divs.length); 1675 next.addClass("content-slider-open"); 1676 } 1677 var mobile, content, xxl; 1678 $('.jumbotron-mobile').each(function() { 1679 var timeout = $(this).attr("data-interval"); 1680 if (!timeout) 1681 timeout = 5000; 1682 var id = $(this); 1683 mobile = setInterval( function() { nextSliderMobile(id); }, timeout ); 1684 }); 1685 1686 $("div[data-slider='true']").each(function() { 1687 var timeout = $(this).attr("data-interval"); 1688 if (!timeout) 1689 timeout = 5000; 1690 var id = $(this); 1691 xxl = setInterval( function() { nextSlider(id); }, timeout ); 1692 }); 1693 1694 $("div[data-content-slider='true']").each(function() { 1695 var timeout = $(this).attr("data-interval"); 1696 if (!timeout) 1697 timeout = 5000; 1698 var id = $(this); 1699 content = setInterval( function() { nextContentSlider(id); }, timeout ); 1700 }); 1701 1702 1703 $("div[data-slider='true'] > *").click(function(event) { 1704 event.preventDefault(); 1705 $(this).parent(".jumbotron-slider").children(".slider-open").removeClass("slider-open"); 1706 $(this).addClass("slider-open"); 1707 $(this).closest(".jumbotron-slider-container").css("background-image","url("+$(this).attr("data-bg")+")"); 1708 if (window.getSelection().removeAllRanges) { 1709 window.getSelection().removeAllRanges(); 1710 } 1711 clearInterval(xxl); 1712 }).find('a').on('click', function (e) { 1713 e.stopPropagation(); 1714 });
1715 1716 $("div[data-content-slider='true'] > *").click(function(event) { 1717 event.preventDefault(); 1718 $(this).parent(".content-slider").children(".content-slider-open").removeClass("content-slider-open"); 1719 $(this).addClass("content-slider-open"); 1720 if (window.getSelection().removeAllRanges) { 1721 window.getSelection().removeAllRanges(); 1722 } 1723 clearInterval(content); 1724 }).find('a').on('click', function (e) { 1725 e.stopPropagation(); 1726 }); 1727 1728 $('.slider-open').each(function() { 1729 if ($(this).attr("data-bg")) 1730 $(this).closest(".jumbotron-slider-container").css("background-image","url("+$(this).attr("data-bg")+")"); 1731 else 1732 $(this).closest(".jumbotron-mobile").css("background-image","url("+$('div[data-open="#'+$(this).attr('id')+'"]').attr('data-bg')+")"); 1733 }); 1734 1735 1736 $('div[data-mobile-slider="true"]').click(function(event) { 1737 event.preventDefault(); 1738 $(this).closest(".jumbotron-mobile").find(".slider-open").removeClass("slider-open"); 1739 $($(this).attr('data-open')).addClass("slider-open"); 1740 $(this).closest(".jumbotron-mobile").css("background-image","url("+$(this).attr("data-bg")+")"); 1741 clearInterval(mobile) 1742 }); 1743}); 1744// handle top menu click events 1745$(function() { 1746 $("a[data-top-show='true']").click(function(event) { 1747 event.preventDefault(); 1748 1749 var open = $(this).hasClass("open"); 1750 var delayTime = 0; 1751 $("a.open[data-top-show='true']").each(function() { 1752 $(this).toggleClass("open"); 1753 var parent_element = $(this).parent(); 1754 $("#top-row").next().css("margin-top", "0"); 1755 $(".mobile-header").css("margin-top", "0" ); 1756 $("#"+$(this).attr("data-top-id")).slideToggle(400, function() { 1757 parent_element.toggleClass("open"); 1758 }); 1759 delayTime = 500; 1760 }); 1761 1762 $(".navbar-collapse.collapse.in").collapse('hide'); 1763 1764 if (!open) { 1765 var content = $("#"+$(this).attr("data-top-id")); 1766 $(this).toggleClass("open"); 1767 $(this).parent().toggleClass("open"); 1768 content.toggle(); 1769 var h = content.outerHeight(); 1770 content.toggle(); 1771 //$("#top-row").next().css("margin-top", h + 'px' ); 1772 $(".mobile-header").css("margin-top", h + 'px' ); 1773 1774 content.delay(delayTime).slideToggle(function() { 1775 $(this).children().find(" :input:first").focus(); 1776 $(this).children().find("a:first").focus(); 1777 }); 1778 1779 } 1780 }); 1781}); 1782/*! 1783 1784Holder - 2.3.2 - client side image placeholders 1785(c) 2012-2014 Ivan Malopinsky / http://imsky.co 1786 1787Provided under the MIT License. 1788Commercial use requires attribution. 1789 1790*/ 1791 1792var Holder = Holder || {}; 1793(function (app, win) { 1794var system_config = { 1795 use_svg: false, 1796 use_canvas: false, 1797 use_fallback: false 1798}; 1799var instance_config = {}; 1800var preempted = false; 1801canvas = document.createElement('canvas'); 1802var dpr = 1, bsr = 1; 1803var resizable_images = []; 1804 1805if (!canvas.getContext) { 1806 system_config.use_fallback = true; 1807} else { 1808 if (canvas.toDataURL("image/png") 1809 .indexOf("data:image/png") < 0) { 1810 //Android doesn't support data URI 1811 system_config.use_fallback = true; 1812 } else { 1813 var ctx = canvas.getContext("2d"); 1814 } 1815} 1816 1817if(!!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect){ 1818 system_config.use_svg = true; 1819 system_config.use_canvas = false; 1820} 1821 1822if(!system_config.use_fallback){ 1823 dpr = window.devicePixelRatio || 1, 1824 bsr = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1; 1825} 1826 1827var ratio = dpr / bsr; 1828 1829var settings = { 1830 domain: "holder.js", 1831 images: "img", 1832 bgnodes: ".holderjs", 1833 themes: { 1834 "gray": { 1835 background: "#eee", 1836 foreground: "#aaa", 1837 size: 12 1838 }, 1839 "social": { 1840 background: "#3a5a97", 1841 foreground: "#fff", 1842 size: 12 1843 }, 1844 "industrial": { 1845 background: "#434A52", 1846 foreground: "#C2F200", 1847 size: 12 1848 }, 1849 "sky": { 1850 background: "#0D8FDB", 1851 foreground: "#fff", 1852 size: 12 1853 }, 1854 "vine": { 1855 background: "#39DBAC", 1856 foreground: "#1E292C", 1857 size: 12 1858 }, 1859 "lava": { 1860 background: "#F8591A", 1861 foreground: "#1C2846", 1862 size: 12 1863 } 1864 }, 1865 stylesheet: "" 1866};
1867app.flags = { 1868 dimensions: { 1869 regex: /^(\d+)x(\d+)$/, 1870 output: function (val) { 1871 var exec = this.regex.exec(val); 1872 return { 1873 width: +exec[1], 1874 height: +exec[2] 1875 } 1876 } 1877 }, 1878 fluid: { 1879 regex: /^([0-9%]+)x([0-9%]+)$/, 1880 output: function (val) { 1881 var exec = this.regex.exec(val); 1882 return { 1883 width: exec[1], 1884 height: exec[2] 1885 } 1886 } 1887 }, 1888 colors: { 1889 regex: /#([0-9a-f]{3,})\:#([0-9a-f]{3,})/i, 1890 output: function (val) { 1891 var exec = this.regex.exec(val); 1892 return { 1893 size: settings.themes.gray.size, 1894 foreground: "#" + exec[2], 1895 background: "#" + exec[1] 1896 } 1897 } 1898 }, 1899 text: { 1900 regex: /text\:(.*)/, 1901 output: function (val) { 1902 return this.regex.exec(val)[1]; 1903 } 1904 }, 1905 font: { 1906 regex: /font\:(.*)/, 1907 output: function (val) { 1908 return this.regex.exec(val)[1]; 1909 } 1910 }, 1911 auto: { 1912 regex: /^auto$/ 1913 }, 1914 textmode: { 1915 regex: /textmode\:(.*)/, 1916 output: function(val){ 1917 return this.regex.exec(val)[1]; 1918 } 1919 } 1920} 1921 1922function text_size(width, height, template) { 1923 height = parseInt(height, 10); 1924 width = parseInt(width, 10); 1925 var bigSide = Math.max(height, width) 1926 var smallSide = Math.min(height, width) 1927 var scale = 1 / 12; 1928 var newHeight = Math.min(smallSide * 0.75, 0.75 * bigSide * scale); 1929 return { 1930 height: Math.round(Math.max(template.size, newHeight)) 1931 } 1932} 1933 1934var svg_el = (function(){ 1935 //Prevent IE <9 from initializing SVG renderer 1936 if(!window.XMLSerializer) return; 1937 var serializer = new XMLSerializer(); 1938 var svg_ns = "http://www.w3.org/2000/svg" 1939 var svg = document.createElementNS(svg_ns, "svg"); 1940 //IE throws an exception if this is set and Chrome requires it to be set 1941 if(svg.webkitMatchesSelector){ 1942 svg.setAttribute("xmlns", "http://www.w3.org/2000/svg") 1943 } 1944 var bg_el = document.createElementNS(svg_ns, "rect") 1945 var text_el = document.createElementNS(svg_ns, "text") 1946 var textnode_el = document.createTextNode(null) 1947 text_el.setAttribute("text-anchor", "middle") 1948 text_el.appendChild(textnode_el) 1949 svg.appendChild(bg_el) 1950 svg.appendChild(text_el) 1951 1952 return function(props){ 1953 svg.setAttribute("width",props.width); 1954 svg.setAttribute("height", props.height); 1955 bg_el.setAttribute("width", props.width); 1956 bg_el.setAttribute("height", props.height); 1957 bg_el.setAttribute("fill", props.template.background); 1958 text_el.setAttribute("x", props.width/2) 1959 text_el.setAttribute("y", props.height/2) 1960 textnode_el.nodeValue=props.text 1961 text_el.setAttribute("style", css_properties({ 1962 "fill": props.template.foreground, 1963 "font-weight": "bold", 1964 "font-size": props.text_height+"px", 1965 "font-family":props.font, 1966 "dominant-baseline":"central" 1967 })) 1968 return serializer.serializeToString(svg) 1969 } 1970})() 1971 1972function css_properties(props){ 1973 var ret = []; 1974 for(p in props){ 1975 if(props.hasOwnProperty(p)){ 1976 ret.push(p+":"+props[p]) 1977 } 1978 } 1979 return ret.join(";") 1980} 1981 1982function draw_canvas(args) { 1983 var ctx = args.ctx, 1984 dimensions = args.dimensions, 1985 template = args.template, 1986 ratio = args.ratio, 1987 holder = args.holder, 1988 literal = holder.textmode == "literal", 1989 exact = holder.textmode == "exact"; 1990 1991 var ts = text_size(dimensions.width, dimensions.height, template); 1992 var text_height = ts.height; 1993 var width = dimensions.width * ratio, 1994 height = dimensions.height * ratio; 1995 var font = template.font ? template.font : "Arial,Helvetica,sans-serif"; 1996 canvas.width = width; 1997 canvas.height = height; 1998 ctx.textAlign = "center"; 1999 ctx.textBaseline = "middle"; 2000 ctx.fillStyle = template.background; 2001 ctx.fillRect(0, 0, width, height); 2002 ctx.fillStyle = template.foreground; 2003 ctx.font = "bold " + text_height + "px " + font; 2004 var text = template.text ? template.text : (Math.floor(dimensions.width) + "x" + Math.floor(dimensions.height)); 2005 if (literal) { 2006 var dimensions = holder.dimensions; 2007 text = dimensions.width + "x" + dimensions.height; 2008 } 2009 else if(exact && holder.exact_dimensions){ 2010 var dimensions = holder.exact_dimensions; 2011 text = (Math.floor(dimensions.width) + "x" + Math.floor(dimensions.height)); 2012 } 2013 var text_width = ctx.measureText(text).width; 2014 if (text_width / width >= 0.75) { 2015 text_height = Math.floor(text_height * 0.75 * (width / text_width)); 2016 } 2017 //Resetting font size if necessary 2018 ctx.font = "bold " + (text_height * ratio) + "px " + font;
2019 ctx.fillText(text, (width / 2), (height / 2), width); 2020 return canvas.toDataURL("image/png"); 2021} 2022 2023function draw_svg(args){ 2024 var dimensions = args.dimensions, 2025 template = args.template, 2026 holder = args.holder, 2027 literal = holder.textmode == "literal", 2028 exact = holder.textmode == "exact"; 2029 2030 var ts = text_size(dimensions.width, dimensions.height, template); 2031 var text_height = ts.height; 2032 var width = dimensions.width, 2033 height = dimensions.height; 2034 2035 var font = template.font ? template.font : "Arial,Helvetica,sans-serif"; 2036 var text = template.text ? template.text : (Math.floor(dimensions.width) + "x" + Math.floor(dimensions.height)); 2037 2038 if (literal) { 2039 var dimensions = holder.dimensions; 2040 text = dimensions.width + "x" + dimensions.height; 2041 } 2042 else if(exact && holder.exact_dimensions){ 2043 var dimensions = holder.exact_dimensions; 2044 text = (Math.floor(dimensions.width) + "x" + Math.floor(dimensions.height)); 2045 } 2046 var string = svg_el({ 2047 text: text, 2048 width:width, 2049 height:height, 2050 text_height:text_height, 2051 font:font, 2052 template:template 2053 }) 2054 return "data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(string))); 2055} 2056 2057function draw(args) { 2058 if(instance_config.use_canvas && !instance_config.use_svg){ 2059 return draw_canvas(args); 2060 } 2061 else{ 2062 return draw_svg(args); 2063 } 2064} 2065 2066function render(mode, el, holder, src) { 2067 var dimensions = holder.dimensions, 2068 theme = holder.theme, 2069 text = holder.text ? decodeURIComponent(holder.text) : holder.text; 2070 var dimensions_caption = dimensions.width + "x" + dimensions.height; 2071 theme = (text ? extend(theme, { 2072 text: text 2073 }) : theme); 2074 theme = (holder.font ? extend(theme, { 2075 font: holder.font 2076 }) : theme); 2077 el.setAttribute("data-src", src); 2078 holder.theme = theme; 2079 el.holder_data = holder; 2080 2081 if (mode == "image") { 2082 el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption); 2083 if (instance_config.use_fallback || !holder.auto) { 2084 el.style.width = dimensions.width + "px"; 2085 el.style.height = dimensions.height + "px"; 2086 } 2087 if (instance_config.use_fallback) { 2088 el.style.backgroundColor = theme.background; 2089 } else { 2090 el.setAttribute("src", draw({ctx: ctx, dimensions: dimensions, template: theme, ratio:ratio, holder: holder})); 2091 2092 if(holder.textmode && holder.textmode == "exact"){ 2093 resizable_images.push(el); 2094 resizable_update(el); 2095 } 2096 2097 } 2098 } else if (mode == "background") { 2099 if (!instance_config.use_fallback) { 2100 el.style.backgroundImage = "url(" + draw({ctx:ctx, dimensions: dimensions, template: theme, ratio: ratio, holder: holder}) + ")"; 2101 el.style.backgroundSize = dimensions.width + "px " + dimensions.height + "px"; 2102 } 2103 } else if (mode == "fluid") { 2104 el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption); 2105 if (dimensions.height.slice(-1) == "%") { 2106 el.style.height = dimensions.height 2107 } else if(holder.auto == null || !holder.auto){ 2108 el.style.height = dimensions.height + "px" 2109 } 2110 if (dimensions.width.slice(-1) == "%") { 2111 el.style.width = dimensions.width 2112 } else if(holder.auto == null || !holder.auto){ 2113 el.style.width = dimensions.width + "px" 2114 } 2115 if (el.style.display == "inline" || el.style.display === "" || el.style.display == "none") { 2116 el.style.display = "block"; 2117 } 2118 2119 set_initial_dimensions(el) 2120 2121 if (instance_config.use_fallback) { 2122 el.style.backgroundColor = theme.background; 2123 } else { 2124 resizable_images.push(el); 2125 resizable_update(el); 2126 } 2127 } 2128} 2129 2130function dimension_check(el, callback) { 2131 var dimensions = { 2132 height: el.clientHeight, 2133 width: el.clientWidth 2134 }; 2135 if (!dimensions.height && !dimensions.width) { 2136 el.setAttribute("data-holder-invisible", true) 2137 callback.call(this, el) 2138 } 2139 else{ 2140 el.removeAttribute("data-holder-invisible") 2141 return dimensions; 2142 } 2143} 2144 2145function set_initial_dimensions(el){ 2146 if(el.holder_data){ 2147 var dimensions = dimension_check(el, app.invisible_error_fn(
2147set_initial_dimensions)) 2148 if(dimensions){ 2149 var holder = el.holder_data; 2150 holder.initial_dimensions = dimensions; 2151 holder.fluid_data = { 2152 fluid_height: holder.dimensions.height.slice(-1) == "%", 2153 fluid_width: holder.dimensions.width.slice(-1) == "%", 2154 mode: null 2155 } 2156 if(holder.fluid_data.fluid_width && !holder.fluid_data.fluid_height){ 2157 holder.fluid_data.mode = "width" 2158 holder.fluid_data.ratio = holder.initial_dimensions.width / parseFloat(holder.dimensions.height) 2159 } 2160 else if(!holder.fluid_data.fluid_width && holder.fluid_data.fluid_height){ 2161 holder.fluid_data.mode = "height"; 2162 holder.fluid_data.ratio = parseFloat(holder.dimensions.width) / holder.initial_dimensions.height 2163 } 2164 } 2165 } 2166} 2167 2168function resizable_update(element) { 2169 var images; 2170 if (element.nodeType == null) { 2171 images = resizable_images; 2172 } else { 2173 images = [element] 2174 } 2175 for (var i in images) { 2176 if (!images.hasOwnProperty(i)) { 2177 continue; 2178 } 2179 var el = images[i] 2180 if (el.holder_data) { 2181 var holder = el.holder_data; 2182 var dimensions = dimension_check(el, app.invisible_error_fn( resizable_update)) 2183 if(dimensions){ 2184 if(holder.fluid){ 2185 if(holder.auto){ 2186 switch(holder.fluid_data.mode){ 2187 case "width": 2188 dimensions.height = dimensions.width / holder.fluid_data.ratio; 2189 break; 2190 case "height": 2191 dimensions.width = dimensions.height * holder.fluid_data.ratio; 2192 break; 2193 } 2194 } 2195 el.setAttribute("src", draw({ 2196 ctx: ctx, 2197 dimensions: dimensions, 2198 template: holder.theme, 2199 ratio: ratio, 2200 holder: holder 2201 })) 2202 } 2203 if(holder.textmode && holder.textmode == "exact"){ 2204 holder.exact_dimensions = dimensions; 2205 el.setAttribute("src", draw({ 2206 ctx: ctx, 2207 dimensions: holder.dimensions, 2208 template: holder.theme, 2209 ratio: ratio, 2210 holder: holder 2211 })) 2212 } 2213 } 2214 } 2215 } 2216} 2217 2218function parse_flags(flags, options) { 2219 var ret = { 2220 theme: extend(settings.themes.gray, {}) 2221 }; 2222 var render = false; 2223 for (var fl = flags.length, j = 0; j < fl; j++) { 2224 var flag = flags[j]; 2225 if (app.flags.dimensions.match(flag)) { 2226 render = true; 2227 ret.dimensions = app.flags.dimensions.output(flag); 2228 } else if (app.flags.fluid.match(flag)) { 2229 render = true; 2230 ret.dimensions = app.flags.fluid.output(flag); 2231 ret.fluid = true; 2232 } else if (app.flags.textmode.match(flag)) { 2233 ret.textmode = app.flags.textmode.output(flag) 2234 } else if (app.flags.colors.match(flag)) { 2235 ret.theme = app.flags.colors.output(flag); 2236 } else if (options.themes[flag]) { 2237 //If a theme is specified, it will override custom colors 2238 if(options.themes.hasOwnProperty(flag)){ 2239 ret.theme = extend(options.themes[flag], {}); 2240 } 2241 } else if (app.flags.font.match(flag)) { 2242 ret.font = app.flags.font.output(flag); 2243 } else if (app.flags.auto.match(flag)) { 2244 ret.auto = true; 2245 } else if (app.flags.text.match(flag)) { 2246 ret.text = app.flags.text.output(flag); 2247 } 2248 } 2249 return render ? ret : false; 2250} 2251 2252for (var flag in app.flags) { 2253 if (!app.flags.hasOwnProperty(flag)) continue; 2254 app.flags[flag].match = function (val) { 2255 return val.match(this.regex) 2256 } 2257} 2258 2259app.invisible_error_fn = function(fn){ 2260 return function(el){ 2261 if(el.hasAttribute("data-holder-invisible")){ 2262 throw new Error("Holder: invisible placeholder") 2263 } 2264 } 2265} 2266 2267app.add_theme = function (name, theme) { 2268 name != null && theme != null && (settings.themes[name] = theme); 2269 return app; 2270}; 2271 2272app.add_image = function (src, el) { 2273 var node = selector(el); 2274 if (node.length) { 2275 for (var i = 0, l = node.length; i < l; i++) { 2276 var img = document.createElement("img") 2277 img.setAttribute("data-src", src); 2278 node[i].appendChild(img); 2279 } 2280 } 2281 return app; 2282}; 2283 2284app.run = function (o) { 2285 2286 instance_config = extend({}, system_config) 2287 preempted = true; 2288 2289 var options = extend(settings, o), 2290 images = [], 2291 imageNodes = [], 2292 bgnodes = []; 2293 2294 if(options.use_canvas != null && options.use_canvas){ 2295 instance_config.use_canvas = true; 2296 instance_config.use_svg = false; 2297 } 2298 2299 if (typeof (options.images) == "string") { 2300 imageNodes = selector(options.images); 2301 } else if (window.NodeList && options.images instanceof window.NodeList) { 2302 imageNodes = options.images; 2303 } else if (window.Node && options.images instanceof window.Node) { 2304 imageNodes = [options.images]; 2305 } else if(window.HTMLCollection && options.images instanceof window.HTMLCollection){ 2306 imageNodes = options.images 2307 } 2308 2309 if (typeof (options.bgnodes) == "string") { 2310 bgnodes = selector(options.bgnodes); 2311 } else if (window.NodeList && options.elements instanceof window.NodeList) { 2312 bgnodes = options.bgnodes; 2313 } else if (window.Node && options.bgnodes instanceof window.Node) { 2314 bgnodes = [options.bgnodes]; 2315 } 2316 for (i = 0, l = imageNodes.length; i < l; i++) images.push(imageNodes[i]); 2317 2318 var holdercss = document.getElementById("holderjs-style"); 2319 if (!holdercss) { 2320 holdercss = document.createElement("style"); 2321 holdercss.setAttribute("id", "holderjs-style"); 2322 holdercss.type = "text/css"; 2323 document.getElementsByTagName("head")[0].appendChild(holdercss);
2324 } 2325 2326 if (!options.nocss) { 2327 if (holdercss.styleSheet) { 2328 holdercss.styleSheet.cssText += options.stylesheet; 2329 } else { 2330 if(options.stylesheet.length){ 2331 holdercss.appendChild(document.createTextNode(options.stylesheet)); 2332 } 2333 } 2334 } 2335 2336 var cssregex = new RegExp(options.domain + "\/(.*?)\"?\\)"); 2337 for (var l = bgnodes.length, i = 0; i < l; i++) { 2338 var src = window.getComputedStyle(bgnodes[i], null) 2339 .getPropertyValue("background-image"); 2340 var flags = src.match(cssregex); 2341 var bgsrc = bgnodes[i].getAttribute("data-background-src"); 2342 if (flags) { 2343 var holder = parse_flags(flags[1].split("/"), options); 2344 if (holder) { 2345 render("background", bgnodes[i], holder, src); 2346 } 2347 } else if (bgsrc != null) { 2348 var holder = parse_flags(bgsrc.substr(bgsrc.lastIndexOf(options.domain) + options.domain.length + 1) 2349 .split("/"), options); 2350 if (holder) { 2351 render("background", bgnodes[i], holder, src); 2352 } 2353 } 2354 } 2355 for (l = images.length, i = 0; i < l; i++) { 2356 var attr_data_src, attr_src; 2357 attr_src = attr_data_src = src = null; 2358 try { 2359 attr_src = images[i].getAttribute("src"); 2360 attr_datasrc = images[i].getAttribute("data-src"); 2361 } catch (e) {} 2362 if (attr_datasrc == null && !! attr_src && attr_src.indexOf(options.domain) >= 0) { 2363 src = attr_src; 2364 } else if ( !! attr_datasrc && attr_datasrc.indexOf(options.domain) >= 0) { 2365 src = attr_datasrc; 2366 } 2367 if (src) { 2368 var holder = parse_flags(src.substr(src.lastIndexOf(options.domain) + options.domain.length + 1).split("/"), options); 2369 if (holder) { 2370 if (holder.fluid) { 2371 render("fluid", images[i], holder, src) 2372 } else { 2373 render("image", images[i], holder, src); 2374 } 2375 } 2376 } 2377 } 2378 return app; 2379}; 2380 2381contentLoaded(win, function () { 2382 if (window.addEventListener) { 2383 window.addEventListener("resize", resizable_update, false); 2384 window.addEventListener("orientationchange", resizable_update, false); 2385 } else { 2386 window.attachEvent("onresize", resizable_update) 2387 } 2388 preempted || app.run({}); 2389 2390 if (typeof window.Turbolinks === "object") { 2391 document.addEventListener("page:change", function() { app.run({}) }) 2392 } 2393}); 2394if (typeof define === "function" && define.amd) { 2395 define([], function () { 2396 return app; 2397 }); 2398} 2399 2400//github.com/davidchambers/Base64.js 2401(function(){function t(t){this.message=t}var e="undefined"!=typeof exports?exports:this,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.prototype=Error(),t.prototype.name="InvalidCharacterError",e.btoa||(e.btoa=function(e){for(var o,n,a=0,i=r,c="";e.charAt(0|a)||(i="=",a%1);c+=i.charAt(63&o>>8-8*(a%1))){if(n=e.charCodeAt(a+=.75),n>255)throw new t("'btoa' failed");o=o<<8|n}return c}),e.atob||(e.atob=function(e){if(e=e.replace(/=+$/,""),1==e.length%4)throw new t("'atob' failed");for(var o,n,a=0,i=0,c="";n=e.charAt(i++);~n&&(o=a%4?64*o+n:n,a++%4)?c+=String.fromCharCode(255&o>>(6&-2*a)):0)n=r.indexOf(n);return c})})(); 2402 2403//getElementsByClassName polyfill 2404document.getElementsByClassName||(document.getElementsByClassName=function(e){var t=document,n,r,i,s=[];if(t.querySelectorAll)return t.querySelectorAll("."+e);if(t.evaluate){r=".//*[contains(concat(' ', @class, ' '), ' "+e+" ')]",n=t.evaluate(r,t,null,0,null);while(i=n.iterateNext())s.push(i)}else{n=t.getElementsByTagName("*"),r=new RegExp("(^|\\s)"+e+"(\\s|$)");for(i=0;i<n.length;i++)r.test(n[i].className)&&s.push(n[i])}return s}) 2405 2406//getComputedStyle polyfill 2407window.getComputedStyle||(window.getComputedStyle=function(e){return this.el=e,this.getPropertyValue=function(t){var n=/(\-([a-z]){1})/g;return t=="float"&&(t="styleFloat"),n.test(t)&&(t=t.replace(n,function(){return arguments[2].toUpperCase()})),e.currentStyle[t]?e.currentStyle[t]:null},this}) 2408 2409//http://javascript.nwbox.com/ContentLoaded by Diego Perini with modifications 2410function contentLoaded(n,t){var l="complete",s="readystatechange",u=!1,h=u,c=!0,i=n.document,a=i.documentElement,e=i.addEventListener?"addEventListener":"attachEvent",v=i.addEventListener?"removeEventListener":"detachEvent",f=i.addEventListener?"":"on",r=function(e){(e.type!=s||i.readyState==l)&&((e.type=="load"?n:i)[v](f+e.type,r,u),!h&&(h=!0)&&t.call(n,null))},o=function(){try{a.doScroll("left")}catch(n){setTimeout(o,50);return}r("poll")};if(i.readyState==l)t.call(n,"lazy");else{if(i.createEventObject&&a.doScroll){try{c=!n.frameElement}catch(y){}c&&o()}i[e](f+"DOMContentLoaded",r,u),i[e](f+s,r,u),n[e](f+"load",r,u)}} 2411 2412//https://gist.github.com/991057 by Jed Schmidt with modifications
2413function selector(a,b){var a=a.match(/^(\W)?(.*)/),b=b||document,c=b["getElement"+(a[1]?"#"==a[1]?"ById":"sByClassName":"sByTagName")],d=c.call(b,a[2]),e=[];return null!==d&&(e=d.length||0===d.length?d:[d]),e} 2414 2415//shallow object property extend 2416function extend(a,b){ 2417 var c={}; 2418 for(var i in a){ 2419 if(a.hasOwnProperty(i)){ 2420 c[i]=a[i]; 2421 } 2422 } 2423 for(var i in b){ 2424 if(b.hasOwnProperty(i)){ 2425 c[i]=b[i]; 2426 } 2427 } 2428 return c 2429} 2430 2431//hasOwnProperty polyfill 2432if (!Object.prototype.hasOwnProperty) 2433 /*jshint -W001, -W103 */ 2434 Object.prototype.hasOwnProperty = function(prop) { 2435 var proto = this.__proto__ || this.constructor.prototype; 2436 return (prop in this) && (!(prop in proto) || proto[prop] !== this[prop]); 2437 } 2438 /*jshint +W001, +W103 */ 2439 2440})(Holder, window); 2441// 2442 2443 2444 2445 2446 2447$.fn.doValign = function() { 2448 $(this).css("margin-top",($(this).closest(".row").height() - $(this).height())/2 + 'px' ); 2449 return this; 2450}; 2451 2452 2453$.fn.doCategoryAlign = function() { 2454 $(this).css("margin-top",($(this).closest(".category").height() - $(this).height())/2 + 'px' ); 2455 $(this).css("width",($(this).parent().width() - $(this).prev().width()-5) + 'px' ); 2456 2457 $(this).css("margin-left",'4px' ); 2458 return this; 2459}; 2460 2461 2462function alignContent() { 2463 $(".v-align").each(function() { 2464 $( this ).doValign(); 2465 }); 2466 $(".category-align").each(function() { 2467 $( this ).doCategoryAlign(); 2468 }); 2469} 2470 2471// update gallery to show next/prev images 2472function updateGallery(currentElement) { 2473 $(currentElement).removeAttr('style'); 2474 2475 var slider = $(currentElement).parent().parent().parent().parent(); 2476 if (slider.attr("id") == "carousel-header-slider") { 2477 var step = $(currentElement).index(); 2478 $('#carousel-header-captions .carousel-caption:not(#caption-'+step+')').fadeOut('slow', function() { 2479 $('#caption-'+step).fadeIn(); 2480 }); 2481 var height = slider.find(".active").height(); 2482 if (slider.width() > 737) { 2483 slider.css("height", height+"px"); 2484 slider.find('.carousel-caption').css("height", height+"px"); 2485 slider.find('.carousel-caption').css("top","0"); 2486 } else { // it is a mobile device 2487 slider.css("height", height+"px"); 2488 slider.find('.carousel-caption').css("height","80px"); 2489 slider.find('.carousel-caption').css("top", height+"px"); 2490 } 2491 } 2492 2493 var images = $(currentElement).closest(".carousel-inner").children(); 2494 slider.find('span.picture-index-current').text(images.index($(currentElement))+1); 2495 slider.find(".picture-index-count").text(images.length); 2496 2497} 2498 2499// get current device class 2500function findBootstrapEnvironment() { 2501 var envs = ['xs', 'sm', 'md', 'lg']; 2502 2503 $el = $('<div>'); 2504 $el.appendTo($('body')); 2505 2506 for (var i = envs.length - 1; i >= 0; i--) { 2507 var env = envs[i]; 2508 2509 $el.addClass('hidden-'+env); 2510 if ($el.is(':hidden')) { 2511 $el.remove(); 2512 return env 2513 } 2514 }; 2515} 2516 2517$(window).resize(function () { 2518 alignContent(); 2519}); 2520 2521$( window ).load(function() { 2522 alignContent(); 2523 $('.carousel').each (function() { 2524 updateGallery($(this).find(".active").first()); 2525 }); 2526 2527 if (findBootstrapEnvironment() === "xs" && $('.mobile-header')[0]) { 2528 $('body').css('padding-top', $('.mobile-header').height()+88); 2529 } 2530}); 2531 2532 2533// handle srcolling events 2534var lastPosition = 0; 2535$( window ).scroll(function() { 2536 var position = $(window).scrollTop(); 2537 var trigger = 1; 2538 var animate = false; 2539 if (position > trigger && lastPosition <= trigger) 2540 animate = true; 2541 2542 if (position <= trigger && lastPosition > trigger) 2543 animate = true; 2544 2545 if (position > trigger && animate) { 2546 $(".hide-on-scroll").each( function() { 2547 if ($(this).hasClass("visible-on-scroll-sm") && findBootstrapEnvironment() === "sm") 2548 return; 2549 $(this).css( "display", "none" ).fadeOut( "slow" ); 2550 }); 2551 } 2552 2553 if (position <= trigger && animate) { 2554 $(".hide-on-scroll").fadeIn( "slow" ); 2555 } 2556 2557 lastPosition = position; 2558}); 2559 2560$( document ).ready(function() {
2561 alignContent(); 2562 2563 $('.two-col-text').columnize({width:400}); 2564 2565 $('.equal-height').matchHeight(); 2566 2567 $('.panel-heading a[data-toggle="collapse"]').on('click', function () { 2568 $($(this).attr('data-parent')).find(".active").removeClass('active'); 2569 if (!$(this).closest('.panel-heading').next().hasClass('in')) { 2570 $(this).closest('.panel-heading').addClass('active'); 2571 if ($(this).attr('data-save')=="on") { 2572 $.cookie('panel-' + $(this).attr('data-parent'), 'on'); 2573 } 2574 } else { 2575 if ($(this).attr('data-save')=="on") { 2576 $.cookie('panel-' + $(this).attr('data-parent'), 'off'); 2577 } 2578 } 2579 }); 2580 2581 $('a[data-toggle="tab"]').on('click', function () { 2582 $(this).closest('.nav-tabs-content').next().find('.tab-arrow').css("margin-left",($(this).closest('li').position().left-27)+"px"); 2583 }); 2584 2585 $('.carousel').on('slide.bs.carousel', function (event) { 2586 updateGallery(event.relatedTarget); 2587 }); 2588 2589 // popovers for forms 2590 $(".description-indicator").popover({container: "body", trigger:'click hover', placement: 'right auto', template: '<div class="popover description-popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' }); 2591 $(".error-indicator").popover({container: "body", trigger:'click hover', placement: 'right auto', template: '<div class="popover error-popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' }); 2592 2593 $('.dropdown-menu-news-filter').on({ 2594 "click":function(e){ 2595 e.stopPropagation(); 2596 } 2597 }); 2598 2599 // toggle icons for menus 2600 $('.navbar-toggle').on('click', function () { 2601 $("a.open[data-top-show='true']").each(function() { 2602 $(this).toggleClass("open"); 2603 2604 var parent_element = $(this).parent(); 2605 $("#top-row").next().css("margin-top", "0"); 2606 $(".mobile-header").css("margin-top", "0" ); 2607 $("#"+$(this).attr("data-top-id")).slideToggle(400, function() { 2608 parent_element.toggleClass("open"); 2609 2610 }); 2611 }); 2612 el = $($(this).attr("data-target")); 2613 el.toggleClass("fade-right"); 2614 $(".fade-right").animate({left:0, opacity:"show"}, 800); 2615 el.find('li.dropdown-mobile.act').addClass("open"); 2616 2617 if (el.hasClass("fade-right")) { 2618 $(document).scrollTop(0); 2619 }else{ 2620 $('#button-open-menu').show(); 2621 el.animate({left:500, opacity:"hide"}, 800); 2622 } 2623 return false; 2624 }); 2625 2626 // hide menu when focus left 2627 $(".navbar-uni-mobile ul li").last().on("focusout", function() { 2628 $("#menu-container-mobile").toggleClass("fade-right"); 2629 $("#menu-container-mobile").animate({left:500, opacity:"hide"}, 800); 2630 }); 2631 2632 $('#show-search-button').on('click', function () { 2633 if ($(this).hasClass("open")) { 2634 $('#show-search-button-text').hide(); 2635 $('#hide-search-button-text').show(); 2636 } else { 2637 $('#show-search-button-text').show(); 2638 $('#hide-search-button-text').hide(); 2639 } 2640 }); 2641 2642 $('#top-row').on('touchmove', function(e) { 2643 e.preventDefault(); 2644 }); 2645 2646 $('.dropdown-mobile > .dropdown-menu').on('touchmove', function(e) { 2647 e.stopPropagation(); 2648 2649 }); 2650 2651 $('.quicklinks-panel > .panel-body').on('touchmove', function(e) { 2652 e.stopPropagation(); 2653 }); 2654 2655 2656 $('.dropdown-mobile').on('shown.bs.dropdown', function () { 2657 $(this).find('.icon-navi-close').first().toggleClass("icon-navi-close icon-navi-open"); 2658 $(this).find('.toggle-icon').first().attr("aria-expanded","true").attr("aria-label", "Menü schlieÃen"); 2659 $(this).find('.sr-only').text($('#hide-navigation-button-text').text()); 2660 }); 2661 $('.dropdown-mobile').on('hidden.bs.dropdown', function () { 2662 $(this).find('.icon-navi-open').first().toggleClass("icon-navi-close icon-navi-open"); 2663 $(this).find('.toggle-icon').first().removeAttr("aria-expanded").attr("aria-label", "Menü öffnen"); 2664 $(this).find('.sr-only').text($('#show-navigation-button-text').text()); 2665 });
2666 2667 $('.navbar-uni').on('show.bs.dropdown', function() { 2668 $("a.open[data-top-show='true']").each(function() { 2669 $(this).toggleClass("open"); 2670 2671 var parent_element = $(this).parent(); 2672 $("#top-row").next().css("margin-top", "0"); 2673 $("#"+$(this).attr("data-top-id")).slideToggle(400, function() { 2674 parent_element.toggleClass("open"); 2675 2676 }); 2677 }); 2678 }); 2679 2680 $('.panel-uni-quicklinks').on('hidden.bs.collapse', function () { 2681 $(this).find('.icon-navi-open').toggleClass("icon-navi-close icon-navi-open"); 2682 $(this).find('.sr-only').text($('#show-navigation-button-text').text()); 2683 }); 2684 2685 $('.panel-uni-quicklinks').on('shown.bs.collapse', function () { 2686 $(this).find('.icon-navi-close').toggleClass("icon-navi-close icon-navi-open"); 2687 $(this).find('.sr-only').text($('#hide-navigation-button-text').text()); 2688 }); 2689 2690 $(".panel-uni").on("shown.bs.collapse", function () { 2691 var selected = $(this), 2692 viewportHeight = $(window).height(), 2693 documentScrollTop = $(document).scrollTop(), 2694 minTop = documentScrollTop, 2695 maxTop = documentScrollTop + viewportHeight; 2696 2697 if (selected.offset().top < minTop || selected.offset().top > maxTop) { 2698 $('html, body').animate({scrollTop: selected.offset().top-40}, 100); 2699 } 2700 }); 2701 //jQuery Tablesorter Plugin: 2702 $(".tablesorter").tablesorter(); 2703 2704 2705 // Fix Android Stock Browser Bugs 2706 var nua = navigator.userAgent 2707 var isAndroid = (nua.indexOf('Mozilla/5.0') > -1 && nua.indexOf('Android ') > -1 && nua.indexOf('AppleWebKit') > -1 && nua.indexOf('Chrome') === -1) 2708 if (isAndroid) { 2709 $('select.form-control').removeClass('form-control').css('width', '100%') 2710 } 2711 2712 // Powermail outocomplete: 2713 $('fieldset').each( function () { 2714 if( $(this).hasClass('pm-input-email') ) { 2715 $(this).find('input').attr('autocomplete', 'email'); 2716 } 2717 if( $(this).hasClass('pm-input-name') ) { 2718 $(this).find('input').attr('autocomplete', 'name'); 2719 } 2720 }); 2721}); 2722
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.