/*! dom-outliner - v0.1.3 - 2015-06-19 * https://github.com/vitorhsb/dom-outliner * Copyright (c) 2015 Vitor Barbosa; Licensed MIT */ !function(a){function b(){f(),h(),e()}function c(){r(),g(),i()}function d(a){var b=document.createElement("style");b.type="text/css",document.getElementsByTagName("head")[0].appendChild(b),b.styleSheet?b.styleSheet.cssText=a:b.innerHTML=a}function e(){var a="."+B+" {outline: "+A.outlineWidth+"px "+A.outlineStyle+" "+A.outlineColor+";}."+D+" {display: none;background: "+A.outlineColor+";color: #fff;font: bold 12px/12px Helvetica, Arial, sans-serif;padding: 5px;margin: 0;position: absolute;z-index: 1000001;}."+C+" {outline: "+A.outlineWidth+"px "+A.outlineStyle+" "+A.outlineSelectedColor+";}."+E+" {background: "+A.outlineSelectedColor+";z-index: 2000002;}."+F+" {opacity: "+A.glassOpacity+" !important;-moz-opacity: "+A.glassOpacity+" !important;filter: alpha(opacity="+A.glassOpacity+') !important;-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=('+A.glassOpacity+'*100))" !important;background: '+A.glassColor+";position: absolute;top: 0;left: 0;z-index: 2000001;min-height: 0 !important;min-width: 0 !important;}."+G+' {background: rgba(0, 0, 0, 0);opacity: 1.0 !important;-moz-opacity: 1 !important;filter: alpha(opacity=1) !important;-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=(1*100))" !important;}#'+B+"-glass-message {height: 100%;width: 100%;background: rgba(255, 255, 0, 0.4);cursor: pointer;}#"+B+"-glass-message > div {position: relative;top: 50%;transform: translateY(-50%);text-align: center;margin: 0 auto;}";d(a)}function f(){I={label:a("
").addClass(D).appendTo(K.getBody())}}function g(){a.each(I,function(a,b){b.remove()}),I={}}function h(){H={center:a('').appendTo(K.getBody()),top:a('').appendTo(K.getBody()),right:a('').appendTo(K.getBody()),bottom:a('').appendTo(K.getBody()),left:a('').appendTo(K.getBody())}}function i(){a.each(H,function(a,b){b.off("click."+B).remove()}),H={}}function j(b){var c=K.getDocument(),d=c.height(),e=c.width();if(J=b,b.each(function(){a(this).addClass(C)}),A.showGlasses)try{var f=b.offset(),g=b.outerHeight(),h=b.outerWidth();H.center.css({top:f.top-A.outlineWidth,left:f.left-A.outlineWidth,height:g+2*A.outlineWidth,width:h+2*A.outlineWidth}).show(),H.top.css({top:0,left:0,height:f.top-A.outlineWidth,width:e}).show(),H.right.css({top:f.top-A.outlineWidth,left:f.left+h+A.outlineWidth,height:g+2*A.outlineWidth,width:e-f.left-h-A.outlineWidth}).show(),H.bottom.css({top:f.top+g+A.outlineWidth,left:0,height:d-f.top-g-A.outlineWidth,width:e}).show(),H.left.css({top:f.top-A.outlineWidth,left:0,height:g+2*A.outlineWidth,width:f.left-A.outlineWidth}).show()}catch(i){}finally{}A.showLabel&&I.label.addClass(E)}function k(a){a.removeClass(C).removeClass(B).off("."+B),a.trigger("deselect.outliner"),I.label.removeClass(E).hide(),r()}function l(b,c,d){j(b),b.trigger("select.outliner",c),a.isFunction(A.onSelection)&&A.onSelection(b.get(0),c,d)}function m(){a.each(H,function(a,b){b.hide()}),J&&(k(a(J)),y&&a.isFunction(A.onCancel)&&A.onCancel(J),J=null)}function n(b){var c=!1;if(y&&!z)return A.filter&&(c=!0,a.each(A.filter,function(a,d){c=c&&!b.is(d)})),c||!A.exclude.length&&!a.outliner.options.exclude.length||a.each(A.exclude.concat(a.outliner.options.exclude),function(a,d){return c=c||b.is(d),c?!1:!0}),!c&&J&&b.filter(":outliner").length&&(c=!0),c||!A.excludeClosest.length&&!a.outliner.options.excludeClosest.length||a.each(A.excludeClosest.concat(a.outliner.options.excludeClosest),function(a,d){return c=c||b.closest(d).length,c?!1:!0}),c}function o(b){var c=b.get(0),d=c.tagName.toLowerCase(),e=c.className;return e=e.replace(C,""),e=e.replace(B,""),d+=c.id?"#"+c.id:"",e&&(d+=("."+a.trim(e).replace(/ /g,".")).replace(/\.\.+/g,".")),d+" ("+Math.round(b.width())+"x"+Math.round(b.height())+")"}function p(b,c){var d="",e=b.offset();a("."+B).removeClass(B),b.toggleClass(B),b.hasClass(B)?(b.trigger("mouseover.outliner",c),a.isFunction(A.onMouseOver)&&A.onMouseOver(b.get(0),c)):(b.trigger("mouseout.outliner",c),a.isFunction(A.onMouseOut)&&A.onMouseOut(b.get(0),c)),A.showLabel&&(d=o(b),I.label.html(d).show().css({top:Math.max(0,e.top-A.outlineWidth-I.label.outerHeight()),left:Math.max(0,e.left-A.outlineWidth)}),b.hasClass(B)||I.label.hide())}function q(b,c){var d=a("#"+B+"-glass-center");b.hasClass(B)&&d.is(":visible")&&(d.html('