├── Demos ├── ajax-content.html ├── assets │ ├── css │ │ ├── demo.css │ │ └── reset.css │ ├── images │ │ ├── big │ │ │ ├── pic-1.jpg │ │ │ ├── pic-2.jpg │ │ │ ├── pic-3.jpg │ │ │ └── pic-4.jpg │ │ ├── demo.png │ │ ├── example-1.jpg │ │ ├── example-2.jpg │ │ ├── example-3.jpg │ │ ├── example-4.jpg │ │ ├── example-5.jpg │ │ ├── example-6.jpg │ │ ├── example-7.jpg │ │ ├── example-8.jpg │ │ ├── lightbox.jpg │ │ ├── pic-1.jpg │ │ ├── pic-2.jpg │ │ ├── pic-3.jpg │ │ ├── pic-4.jpg │ │ ├── simpleModalBigWhite.png │ │ └── simpleModalSmallWhite.png │ └── javascript │ │ ├── demo.js │ │ ├── mootools-core-1.3.1.js │ │ └── mootools-more-1.3.1.1.js └── index.html ├── README.md ├── Source ├── assets │ ├── css │ │ └── simplemodal.css │ ├── images │ │ └── loader.gif │ └── less │ │ └── simplemodal.less └── simple-modal.js ├── bower.json ├── logotipo.png └── package.yml /Demos/ajax-content.html: -------------------------------------------------------------------------------- 1 | 2 | 29 |

30 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 31 |

32 |
33 | 34 |
35 | 36 |
37 | 38 |
-------------------------------------------------------------------------------- /Demos/assets/css/demo.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Mootools Simple Modal 3 | * Version 1.0 4 | * Copyright (c) 2011 Marco Dell'Anna - http://www.plasm.it 5 | */ 6 | body{ 7 | font-family: 'Helvetica', Arial, serif; 8 | font-size: 12px; 9 | padding-bottom:20px; 10 | } 11 | a{ 12 | color:#666; 13 | text-decoration:none; 14 | } 15 | h2{ 16 | font-size: 26px; 17 | margin-left: 10px; 18 | margin-top: 30px; 19 | text-shadow: 0px 0px 1px rgba(150, 150, 150, 1); 20 | } 21 | /* Header */ 22 | .header { 23 | position: relative; 24 | background: #dce0ed; 25 | display: block; 26 | height: 220px; 27 | text-align: center; 28 | } 29 | .header .window { 30 | position: relative; 31 | display: block; 32 | width: 125px; 33 | height: 131px; 34 | padding:32px 0 0; 35 | margin:0 auto; 36 | background: transparent url("../images/simpleModalSmallWhite.png") no-repeat center center; 37 | } 38 | /*Wrapper*/ 39 | .wrapper{ 40 | display:block; 41 | width:960px; 42 | margin:0 auto; 43 | } 44 | .simple-modal-title{ 45 | position: relative; 46 | display: block; 47 | width: 200px; 48 | height: 35px; 49 | padding:4px 0 0; 50 | margin:0 auto; 51 | background: transparent url("../images/demo.png") no-repeat center center; 52 | } 53 | 54 | /* Examples */ 55 | .example-item { 56 | position: relative; 57 | background: #FFFFFF; 58 | float:left; 59 | margin:20px 10px 0 10px; 60 | width: 218px; 61 | height: 198px; 62 | border: 1px solid #d9cfd8; 63 | text-align: center; 64 | cursor: pointer; 65 | } 66 | .example-item img { 67 | margin: 11px; 68 | border: 1px solid #dce0ed; 69 | width: 196px; 70 | height: 147px; 71 | line-height: 147px; 72 | cursor: pointer; 73 | } 74 | .example-item a, 75 | .example-item a:link, 76 | .example-item a:visited, 77 | .example-item a:active { 78 | width: 218px; 79 | bottom: 10px; 80 | font-family: 'Helvetica', Arial, serif; 81 | font-size: 15px; 82 | text-transform: uppercase; 83 | text-decoration: none; 84 | text-align: center; 85 | color: #8188a0; 86 | } 87 | .example-item a:hover { 88 | color: #444; 89 | } 90 | 91 | p.credits{ 92 | display:block; 93 | padding:20px 0 10px 0; 94 | text-align:center; 95 | font-size:11px; 96 | color:#AAA; 97 | } 98 | .clear{ 99 | clear:both; 100 | } 101 | .align-left{ 102 | text-align:left !important; 103 | } 104 | .align-right{ 105 | text-align:right !important; 106 | } -------------------------------------------------------------------------------- /Demos/assets/css/reset.css: -------------------------------------------------------------------------------- 1 | /* http://meyerweb.com/eric/tools/css/reset/ 2 | v2.0 | 20110126 3 | License: none (public domain) 4 | */ 5 | 6 | html, body, div, span, applet, object, iframe, 7 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 8 | a, abbr, acronym, address, big, cite, code, 9 | del, dfn, em, img, ins, kbd, q, s, samp, 10 | small, strike, strong, sub, sup, tt, var, 11 | b, u, i, center, 12 | dl, dt, dd, ol, ul, li, 13 | fieldset, form, label, legend, 14 | table, caption, tbody, tfoot, thead, tr, th, td, 15 | article, aside, canvas, details, embed, 16 | figure, figcaption, footer, header, hgroup, 17 | menu, nav, output, ruby, section, summary, 18 | time, mark, audio, video { 19 | margin: 0; 20 | padding: 0; 21 | border: 0; 22 | font-size: 100%; 23 | font: inherit; 24 | vertical-align: baseline; 25 | } 26 | /* HTML5 display-role reset for older browsers */ 27 | article, aside, details, figcaption, figure, 28 | footer, header, hgroup, menu, nav, section { 29 | display: block; 30 | } 31 | body { 32 | line-height: 1; 33 | } 34 | ol, ul { 35 | list-style: none; 36 | } 37 | blockquote, q { 38 | quotes: none; 39 | } 40 | blockquote:before, blockquote:after, 41 | q:before, q:after { 42 | content: ''; 43 | content: none; 44 | } 45 | table { 46 | border-collapse: collapse; 47 | border-spacing: 0; 48 | } 49 | 50 | strong{ 51 | font-weight:bolder; 52 | } -------------------------------------------------------------------------------- /Demos/assets/images/big/pic-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/big/pic-1.jpg -------------------------------------------------------------------------------- /Demos/assets/images/big/pic-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/big/pic-2.jpg -------------------------------------------------------------------------------- /Demos/assets/images/big/pic-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/big/pic-3.jpg -------------------------------------------------------------------------------- /Demos/assets/images/big/pic-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/big/pic-4.jpg -------------------------------------------------------------------------------- /Demos/assets/images/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/demo.png -------------------------------------------------------------------------------- /Demos/assets/images/example-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/example-1.jpg -------------------------------------------------------------------------------- /Demos/assets/images/example-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/example-2.jpg -------------------------------------------------------------------------------- /Demos/assets/images/example-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/example-3.jpg -------------------------------------------------------------------------------- /Demos/assets/images/example-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/example-4.jpg -------------------------------------------------------------------------------- /Demos/assets/images/example-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/example-5.jpg -------------------------------------------------------------------------------- /Demos/assets/images/example-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/example-6.jpg -------------------------------------------------------------------------------- /Demos/assets/images/example-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/example-7.jpg -------------------------------------------------------------------------------- /Demos/assets/images/example-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/example-8.jpg -------------------------------------------------------------------------------- /Demos/assets/images/lightbox.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/lightbox.jpg -------------------------------------------------------------------------------- /Demos/assets/images/pic-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/pic-1.jpg -------------------------------------------------------------------------------- /Demos/assets/images/pic-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/pic-2.jpg -------------------------------------------------------------------------------- /Demos/assets/images/pic-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/pic-3.jpg -------------------------------------------------------------------------------- /Demos/assets/images/pic-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/pic-4.jpg -------------------------------------------------------------------------------- /Demos/assets/images/simpleModalBigWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/simpleModalBigWhite.png -------------------------------------------------------------------------------- /Demos/assets/images/simpleModalSmallWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Demos/assets/images/simpleModalSmallWhite.png -------------------------------------------------------------------------------- /Demos/assets/javascript/demo.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Mootools Simple Modal 3 | * Version 1.0 4 | * Copyright (c) 2011 Marco Dell'Anna - http://www.plasm.it 5 | */ 6 | window.addEvent("domready", function(e){ 7 | /* Alert */ 8 | $("alert").addEvent("click", function(e){ 9 | e.stop(); 10 | var SM = new SimpleModal({"btn_ok":"Alert button"}); 11 | SM.show({ 12 | "title":"Alert Modal Title", 13 | "contents":"Lorem ipsum dolor sit amet..." 14 | }); 15 | }) 16 | 17 | /* Confirm */ 18 | $("confirm").addEvent("click", function(e){ 19 | e.stop(); 20 | var SM = new SimpleModal({"btn_ok":"Confirm button"}); 21 | SM.show({ 22 | "model":"confirm", 23 | "callback": function(){ 24 | alert("Action confirm!"); 25 | }, 26 | "title":"Confirm Modal Title", 27 | "contents":"Lorem ipsum dolor sit amet..." 28 | }); 29 | }) 30 | 31 | /* Modal */ 32 | $("modal").addEvent("click", function(e){ 33 | e.stop(); 34 | var SM = new SimpleModal({"btn_ok":"Confirm button"}); 35 | // Aggiunge Bottone Conferma 36 | SM.addButton("Confirm", "btn primary", function(){ 37 | alert("Action confirm modal"); 38 | this.hide(); 39 | }); 40 | // Aggiunge Bottone annulla 41 | SM.addButton("Cancel", "btn"); 42 | SM.show({ 43 | "model":"modal", 44 | "title":"Modal Window Title", 45 | "contents":"

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

" 46 | }); 47 | }) 48 | 49 | /* Modal Ajax */ 50 | $("modal-ajax").addEvent("click", function(e){ 51 | e.stop(); 52 | var SM = new SimpleModal({"btn_ok":"Confirm button", "width":600}); 53 | // Aggiunge Bottone Conferma 54 | SM.addButton("Confirm", "btn primary", function(){ 55 | // Check 56 | if( $("confirm-text").get("value") != "DELETE" ){ 57 | $("confirm-delete-error").setStyle("display", "block"); 58 | }else{ 59 | // Your code ... 60 | this.hide(); 61 | } 62 | }); 63 | // Aggiunge Bottone annulla 64 | SM.addButton("Cancel", "btn"); 65 | SM.show({ 66 | "model":"modal-ajax", 67 | "title":"Are you sure you want to delete this?", 68 | "param":{ 69 | "url":"ajax-content.html", 70 | "onRequestComplete": function(){ } 71 | } 72 | }); 73 | }) 74 | 75 | /* Modal Image */ 76 | $("modal-image").addEvent("click", function(e){ 77 | e.stop(); 78 | var SM = new SimpleModal({ 79 | "onAppend":function(){ 80 | $("simple-modal").fade("hide").fade("in") 81 | } 82 | }); 83 | SM.show({ 84 | "model":"modal-ajax", 85 | "title":"Modal Lightbox", 86 | "param":{ 87 | "url":"assets/images/lightbox.jpg", 88 | "onRequestComplete": function(){ } 89 | } 90 | }); 91 | }) 92 | 93 | /* NO Header */ 94 | $("alert-noheader").addEvent("click", function(e){ 95 | e.stop(); 96 | var SM = new SimpleModal({"hideHeader":true, "closeButton":false, "btn_ok":"Close window", "width":600}); 97 | SM.show({ 98 | "model":"alert", 99 | "contents":"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 100 | }); 101 | }) 102 | 103 | /* NO Footer */ 104 | $("modal-nofooter").addEvent("click", function(e){ 105 | e.stop(); 106 | var SM = new SimpleModal({"hideFooter":true, "width":710}); 107 | SM.show({ 108 | "title":"Vimeo video", 109 | "model":"modal", 110 | "contents":'' 111 | }); 112 | }) 113 | 114 | $("example-eheh").addEvent("click", function(e){ 115 | e.stop(); 116 | var SM = new SimpleModal( 117 | { 118 | "btn_ok":"Confirm button", 119 | "overlayClick":false, 120 | "width":300, 121 | "onAppend":function(){ 122 | $("simple-modal").fade("hide"); 123 | setTimeout((function(){ $("simple-modal").fade("show")}), 200 ); 124 | var tw = new Fx.Tween($("simple-modal"),{ 125 | duration: 1600, 126 | transition: 'bounce:out', 127 | link: 'cancel', 128 | property: 'top' 129 | }).start(-400, 150) 130 | 131 | var item = $("simple-modal").getElement(".simple-modal-footer a"); 132 | item.removeClass("primary").setStyles({"background":"#824571","color": "#FFF" }); 133 | item.getParent().addClass("align-left"); 134 | item.addEvent("mouseenter", function(){ 135 | var parent = this.getParent(); 136 | if( parent.hasClass("align-left") ){ 137 | parent.removeClass("align-left").addClass("align-right"); 138 | }else{ 139 | parent.removeClass("align-right").addClass("align-left"); 140 | } 141 | }) 142 | } 143 | }); 144 | // Aggiunge Bottone Conferma 145 | SM.addButton("Click ME please!", "btn primary", function(){}); 146 | SM.show({ 147 | "model":"modal", 148 | "title":"Eh eh eh", 149 | "contents":"

Try clicking on the button \"Click ME please!\"

" 150 | }); 151 | }); 152 | }); -------------------------------------------------------------------------------- /Demos/assets/javascript/mootools-core-1.3.1.js: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | MooTools: the javascript framework 4 | 5 | web build: 6 | - http://mootools.net/core/7c56cfef9dddcf170a5d68e3fb61cfd7 7 | 8 | packager build: 9 | - packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady Core/Swiff 10 | 11 | copyrights: 12 | - [MooTools](http://mootools.net) 13 | 14 | licenses: 15 | - [MIT License](http://mootools.net/license.txt) 16 | ... 17 | */ 18 | (function(){this.MooTools={version:"1.3.1",build:"af48c8d589f43f32212f9bb8ff68a127e6a3ba6c"};var e=this.typeOf=function(i){if(i==null){return"null";}if(i.$family){return i.$family(); 19 | }if(i.nodeName){if(i.nodeType==1){return"element";}if(i.nodeType==3){return(/\S/).test(i.nodeValue)?"textnode":"whitespace";}}else{if(typeof i.length=="number"){if(i.callee){return"arguments"; 20 | }if("item" in i){return"collection";}}}return typeof i;};var u=this.instanceOf=function(w,i){if(w==null){return false;}var v=w.$constructor||w.constructor; 21 | while(v){if(v===i){return true;}v=v.parent;}return w instanceof i;};var f=this.Function;var r=true;for(var q in {toString:1}){r=null;}if(r){r=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"]; 22 | }f.prototype.overloadSetter=function(v){var i=this;return function(x,w){if(x==null){return this;}if(v||typeof x!="string"){for(var y in x){i.call(this,y,x[y]); 23 | }if(r){for(var z=r.length;z--;){y=r[z];if(x.hasOwnProperty(y)){i.call(this,y,x[y]);}}}}else{i.call(this,x,w);}return this;};};f.prototype.overloadGetter=function(v){var i=this; 24 | return function(x){var y,w;if(v||typeof x!="string"){y=x;}else{if(arguments.length>1){y=arguments;}}if(y){w={};for(var z=0;z-1:this.indexOf(a)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim(); 70 | },camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase()); 71 | });},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1"); 72 | },toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/); 73 | return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null;},substitute:function(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1); 74 | }return(a[c]!=null)?a[c]:"";});}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0).toFixed(a<0?-a:0); 75 | return Math.round(this*a)/a;},times:function(b,c){for(var a=0;a1)?Array.slice(arguments,1):null;return function(){if(!b&&!arguments.length){return a.call(c);}if(b&&arguments.length){return a.apply(c,b.concat(Array.from(arguments))); 80 | }return a.apply(c,b||arguments);};},pass:function(b,c){var a=this;if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},delay:function(b,c,a){return setTimeout(this.pass((a==null?[]:a),c),b); 81 | },periodical:function(c,b,a){return setInterval(this.pass((a==null?[]:a),b),c);}});delete Function.prototype.bind;Function.implement({create:function(b){var a=this; 82 | b=b||{};return function(d){var c=b.arguments;c=(c!=null)?Array.from(c):Array.slice(arguments,(b.event)?1:0);if(b.event){c=[d||window.event].extend(c);}var e=function(){return a.apply(b.bind||null,c); 83 | };if(b.delay){return setTimeout(e,b.delay);}if(b.periodical){return setInterval(e,b.periodical);}if(b.attempt){return Function.attempt(e);}return e();}; 84 | },bind:function(c,b){var a=this;if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},bindWithEvent:function(c,b){var a=this; 85 | if(b!=null){b=Array.from(b);}return function(d){return a.apply(c,(b==null)?arguments:[d].concat(b));};},run:function(a,b){return this.apply(b,Array.from(a)); 86 | }});var $try=Function.attempt;(function(){var a=Object.prototype.hasOwnProperty;Object.extend({subset:function(d,g){var f={};for(var e=0,b=g.length;e]*>([\s\S]*?)<\/script>/gi,function(s,t){e+=t+"\n"; 109 | return"";});if(q===true){p.exec(e);}else{if(typeOf(q)=="function"){q(e,r);}}return r;});p.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event}); 110 | this.Window=this.$constructor=new Type("Window",function(){});this.$family=Function.from("window").hide();Window.mirror(function(e,q){j[e]=q;});this.Document=l.$constructor=new Type("Document",function(){}); 111 | l.$family=Function.from("document").hide();Document.mirror(function(e,q){l[e]=q;});l.html=l.documentElement;l.head=l.getElementsByTagName("head")[0];if(l.execCommand){try{l.execCommand("BackgroundImageCache",false,true); 112 | }catch(h){}}if(this.attachEvent&&!this.addEventListener){var d=function(){this.detachEvent("onunload",d);l.head=l.html=l.window=null;};this.attachEvent("onunload",d); 113 | }var n=Array.from;try{n(l.html.childNodes);}catch(h){Array.from=function(q){if(typeof q!="string"&&Type.isEnumerable(q)&&typeOf(q)!="array"){var e=q.length,r=new Array(e); 114 | while(e--){r[e]=q[e];}return r;}return n(q);};var m=Array.prototype,o=m.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(e){var q=m[e]; 115 | Array[e]=function(r){return q.apply(Array.from(r),o.call(arguments,1));};});}if(p.Platform.ios){p.Platform.ipod=true;}p.Engine={};var f=function(q,e){p.Engine.name=q; 116 | p.Engine[q+e]=true;p.Engine.version=e;};if(p.ie){p.Engine.trident=true;switch(p.version){case 6:f("trident",4);break;case 7:f("trident",5);break;case 8:f("trident",6); 117 | }}if(p.firefox){p.Engine.gecko=true;if(p.version>=3){f("gecko",19);}else{f("gecko",18);}}if(p.safari||p.chrome){p.Engine.webkit=true;switch(p.version){case 2:f("webkit",419); 118 | break;case 3:f("webkit",420);break;case 4:f("webkit",525);}}if(p.opera){p.Engine.presto=true;if(p.version>=9.6){f("presto",960);}else{if(p.version>=9.5){f("presto",950); 119 | }else{f("presto",925);}}}if(p.name=="unknown"){switch((a.match(/(?:webkit|khtml|gecko)/)||[])[0]){case"webkit":case"khtml":p.Engine.webkit=true;break;case"gecko":p.Engine.gecko=true; 120 | }}this.$exec=p.exec;}).call(this);var Event=new Type("Event",function(a,i){if(!i){i=window;}var o=i.document;a=a||i.event;if(a.$extended){return a;}this.$extended=true; 121 | var n=a.type,k=a.target||a.srcElement,m={},c={},q=null,h,l,b,p;while(k&&k.nodeType==3){k=k.parentNode;}if(n.indexOf("key")!=-1){b=a.which||a.keyCode;p=Object.keyOf(Event.Keys,b); 122 | if(n=="keydown"){var d=b-111;if(d>0&&d<13){p="f"+d;}}if(!p){p=String.fromCharCode(b).toLowerCase();}}else{if((/click|mouse|menu/i).test(n)){o=(!o.compatMode||o.compatMode=="CSS1Compat")?o.html:o.body; 123 | m={x:(a.pageX!=null)?a.pageX:a.clientX+o.scrollLeft,y:(a.pageY!=null)?a.pageY:a.clientY+o.scrollTop};c={x:(a.pageX!=null)?a.pageX-i.pageXOffset:a.clientX,y:(a.pageY!=null)?a.pageY-i.pageYOffset:a.clientY}; 124 | if((/DOMMouseScroll|mousewheel/).test(n)){l=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3;}h=(a.which==3)||(a.button==2);if((/over|out/).test(n)){q=a.relatedTarget||a[(n=="mouseover"?"from":"to")+"Element"]; 125 | var j=function(){while(q&&q.nodeType==3){q=q.parentNode;}return true;};var g=(Browser.firefox2)?j.attempt():j();q=(g)?q:null;}}else{if((/gesture|touch/i).test(n)){this.rotation=a.rotation; 126 | this.scale=a.scale;this.targetTouches=a.targetTouches;this.changedTouches=a.changedTouches;var f=this.touches=a.touches;if(f&&f[0]){var e=f[0];m={x:e.pageX,y:e.pageY}; 127 | c={x:e.clientX,y:e.clientY};}}}}return Object.append(this,{event:a,type:n,page:m,client:c,rightClick:h,wheel:l,relatedTarget:document.id(q),target:document.id(k),code:b,key:p,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey}); 128 | });Event.Keys={enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46};Event.Keys=new Hash(Event.Keys);Event.implement({stop:function(){return this.stopPropagation().preventDefault(); 129 | },stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault(); 130 | }else{this.event.returnValue=false;}return this;}});(function(){var a=this.Class=new Type("Class",function(h){if(instanceOf(h,Function)){h={initialize:h}; 131 | }var g=function(){e(this);if(g.$prototyping){return this;}this.$caller=null;var i=(this.initialize)?this.initialize.apply(this,arguments):this;this.$caller=this.caller=null; 132 | return i;}.extend(this).implement(h);g.$constructor=a;g.prototype.$constructor=g;g.prototype.parent=c;return g;});var c=function(){if(!this.$caller){throw new Error('The method "parent" cannot be called.'); 133 | }var g=this.$caller.$name,h=this.$caller.$owner.parent,i=(h)?h.prototype[g]:null;if(!i){throw new Error('The method "'+g+'" has no parent.');}return i.apply(this,arguments); 134 | };var e=function(g){for(var h in g){var j=g[h];switch(typeOf(j)){case"object":var i=function(){};i.prototype=j;g[h]=e(new i);break;case"array":g[h]=j.clone(); 135 | break;}}return g;};var b=function(g,h,j){if(j.$origin){j=j.$origin;}var i=function(){if(j.$protected&&this.$caller==null){throw new Error('The method "'+h+'" cannot be called.'); 136 | }var l=this.caller,m=this.$caller;this.caller=m;this.$caller=i;var k=j.apply(this,arguments);this.$caller=m;this.caller=l;return k;}.extend({$owner:g,$origin:j,$name:h}); 137 | return i;};var f=function(h,i,g){if(a.Mutators.hasOwnProperty(h)){i=a.Mutators[h].call(this,i);if(i==null){return this;}}if(typeOf(i)=="function"){if(i.$hidden){return this; 138 | }this.prototype[h]=(g)?i:b(this,h,i);}else{Object.merge(this.prototype,h,i);}return this;};var d=function(g){g.$prototyping=true;var h=new g;delete g.$prototyping; 139 | return h;};a.implement("implement",f.overloadSetter());a.Mutators={Extends:function(g){this.parent=g;this.prototype=d(g);},Implements:function(g){Array.from(g).each(function(j){var h=new j; 140 | for(var i in h){f.call(this,i,h[i],true);}},this);}};}).call(this);(function(){this.Chain=new Class({$chain:[],chain:function(){this.$chain.append(Array.flatten(arguments)); 141 | return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;},clearChain:function(){this.$chain.empty(); 142 | return this;}});var a=function(b){return b.replace(/^on([A-Z])/,function(c,d){return d.toLowerCase();});};this.Events=new Class({$events:{},addEvent:function(d,c,b){d=a(d); 143 | if(c==$empty){return this;}this.$events[d]=(this.$events[d]||[]).include(c);if(b){c.internal=true;}return this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]); 144 | }return this;},fireEvent:function(e,c,b){e=a(e);var d=this.$events[e];if(!d){return this;}c=Array.from(c);d.each(function(f){if(b){f.delay(b,this,c);}else{f.apply(this,c); 145 | }},this);return this;},removeEvent:function(e,d){e=a(e);var c=this.$events[e];if(c&&!d.internal){var b=c.indexOf(d);if(b!=-1){delete c[b];}}return this; 146 | },removeEvents:function(d){var e;if(typeOf(d)=="object"){for(e in d){this.removeEvent(e,d[e]);}return this;}if(d){d=a(d);}for(e in this.$events){if(d&&d!=e){continue; 147 | }var c=this.$events[e];for(var b=c.length;b--;){if(b in c){this.removeEvent(e,c[b]);}}}return this;}});this.Options=new Class({setOptions:function(){var b=this.options=Object.merge.apply(null,[{},this.options].append(arguments)); 148 | if(this.addEvent){for(var c in b){if(typeOf(b[c])!="function"||!(/^on[A-Z]/).test(c)){continue;}this.addEvent(c,b[c]);delete b[c];}}return this;}});}).call(this); 149 | (function(){var k,n,l,g,a={},c={},m=/\\/g;var e=function(q,p){if(q==null){return null;}if(q.Slick===true){return q;}q=(""+q).replace(/^\s+|\s+$/g,"");g=!!p; 150 | var o=(g)?c:a;if(o[q]){return o[q];}k={Slick:true,expressions:[],raw:q,reverse:function(){return e(this.raw,true);}};n=-1;while(q!=(q=q.replace(j,b))){}k.length=k.expressions.length; 151 | return o[k.raw]=(g)?h(k):k;};var i=function(o){if(o==="!"){return" ";}else{if(o===" "){return"!";}else{if((/^!/).test(o)){return o.replace(/^!/,"");}else{return"!"+o; 152 | }}}};var h=function(u){var r=u.expressions;for(var p=0;p+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(//,"["+f(">+~`!@$%^&={}\\;/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(//g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")); 155 | function b(x,s,D,z,r,C,q,B,A,y,u,F,G,v,p,w){if(s||n===-1){k.expressions[++n]=[];l=-1;if(s){return"";}}if(D||z||l===-1){D=D||" ";var t=k.expressions[n]; 156 | if(g&&t[l]){t[l].reverseCombinator=i(D);}t[++l]={combinator:D,tag:"*"};}var o=k.expressions[n][l];if(r){o.tag=r.replace(m,"");}else{if(C){o.id=C.replace(m,""); 157 | }else{if(q){q=q.replace(m,"");if(!o.classList){o.classList=[];}if(!o.classes){o.classes=[];}o.classList.push(q);o.classes.push({value:q,regexp:new RegExp("(^|\\s)"+f(q)+"(\\s|$)")}); 158 | }else{if(G){w=w||p;w=w?w.replace(m,""):null;if(!o.pseudos){o.pseudos=[];}o.pseudos.push({key:G.replace(m,""),value:w,type:F.length==1?"class":"element"}); 159 | }else{if(B){B=B.replace(m,"");u=(u||"").replace(m,"");var E,H;switch(A){case"^=":H=new RegExp("^"+f(u));break;case"$=":H=new RegExp(f(u)+"$");break;case"~=":H=new RegExp("(^|\\s)"+f(u)+"(\\s|$)"); 160 | break;case"|=":H=new RegExp("^"+f(u)+"(-|$)");break;case"=":E=function(I){return u==I;};break;case"*=":E=function(I){return I&&I.indexOf(u)>-1;};break; 161 | case"!=":E=function(I){return u!=I;};break;default:E=function(I){return !!I;};}if(u==""&&(/^[*$^]=$/).test(A)){E=function(){return false;};}if(!E){E=function(I){return I&&H.test(I); 162 | };}if(!o.attributes){o.attributes=[];}o.attributes.push({key:B,operator:A,value:u,test:E});}}}}}return"";}var d=(this.Slick||{});d.parse=function(o){return e(o); 163 | };d.escapeRegExp=f;if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this);(function(){var j={},l={},b=Object.prototype.toString; 164 | j.isNativeCode=function(c){return(/\{\s*\[native code\]\s*\}/).test(""+c);};j.isXML=function(c){return(!!c.xmlVersion)||(!!c.xml)||(b.call(c)=="[object XMLDocument]")||(c.nodeType==9&&c.documentElement.nodeName!="HTML"); 165 | };j.setDocument=function(w){var t=w.nodeType;if(t==9){}else{if(t){w=w.ownerDocument;}else{if(w.navigator){w=w.document;}else{return;}}}if(this.document===w){return; 166 | }this.document=w;var y=w.documentElement,u=this.getUIDXML(y),o=l[u],A;if(o){for(A in o){this[A]=o[A];}return;}o=l[u]={};o.root=y;o.isXMLDocument=this.isXML(w); 167 | o.brokenStarGEBTN=o.starSelectsClosedQSA=o.idGetsName=o.brokenMixedCaseQSA=o.brokenGEBCN=o.brokenCheckedQSA=o.brokenEmptyAttributeQSA=o.isHTMLDocument=o.nativeMatchesSelector=false; 168 | var m,n,x,q,r;var s,c="slick_uniqueid";var z=w.createElement("div");var p=w.body||w.getElementsByTagName("body")[0]||y;p.appendChild(z);try{z.innerHTML=''; 169 | o.isHTMLDocument=!!w.getElementById(c);}catch(v){}if(o.isHTMLDocument){z.style.display="none";z.appendChild(w.createComment(""));n=(z.getElementsByTagName("*").length>1); 170 | try{z.innerHTML="foo";s=z.getElementsByTagName("*");m=(s&&!!s.length&&s[0].nodeName.charAt(0)=="/");}catch(v){}o.brokenStarGEBTN=n||m;try{z.innerHTML=''; 171 | o.idGetsName=w.getElementById(c)===z.firstChild;}catch(v){}if(z.getElementsByClassName){try{z.innerHTML='';z.getElementsByClassName("b").length; 172 | z.firstChild.className="b";q=(z.getElementsByClassName("b").length!=2);}catch(v){}try{z.innerHTML='';x=(z.getElementsByClassName("a").length!=2); 173 | }catch(v){}o.brokenGEBCN=q||x;}if(z.querySelectorAll){try{z.innerHTML="foo";s=z.querySelectorAll("*");o.starSelectsClosedQSA=(s&&!!s.length&&s[0].nodeName.charAt(0)=="/"); 174 | }catch(v){}try{z.innerHTML='';o.brokenMixedCaseQSA=!z.querySelectorAll(".MiX").length;}catch(v){}try{z.innerHTML=''; 175 | o.brokenCheckedQSA=(z.querySelectorAll(":checked").length==0);}catch(v){}try{z.innerHTML='';o.brokenEmptyAttributeQSA=(z.querySelectorAll('[class*=""]').length!=0); 176 | }catch(v){}}try{z.innerHTML='
';r=(z.firstChild.getAttribute("action")!="s");}catch(v){}o.nativeMatchesSelector=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector; 177 | if(o.nativeMatchesSelector){try{o.nativeMatchesSelector.call(y,":slick");o.nativeMatchesSelector=null;}catch(v){}}}try{y.slick_expando=1;delete y.slick_expando; 178 | o.getUID=this.getUIDHTML;}catch(v){o.getUID=this.getUIDXML;}p.removeChild(z);z=s=p=null;o.getAttribute=(o.isHTMLDocument&&r)?function(D,B){var E=this.attributeGetters[B]; 179 | if(E){return E.call(D);}var C=D.getAttributeNode(B);return(C)?C.nodeValue:null;}:function(C,B){var D=this.attributeGetters[B];return(D)?D.call(C):C.getAttribute(B); 180 | };o.hasAttribute=(y&&this.isNativeCode(y.hasAttribute))?function(C,B){return C.hasAttribute(B);}:function(C,B){C=C.getAttributeNode(B);return !!(C&&(C.specified||C.nodeValue)); 181 | };o.contains=(y&&this.isNativeCode(y.contains))?function(B,C){return B.contains(C);}:(y&&y.compareDocumentPosition)?function(B,C){return B===C||!!(B.compareDocumentPosition(C)&16); 182 | }:function(B,C){if(C){do{if(C===B){return true;}}while((C=C.parentNode));}return false;};o.documentSorter=(y.compareDocumentPosition)?function(C,B){if(!C.compareDocumentPosition||!B.compareDocumentPosition){return 0; 183 | }return C.compareDocumentPosition(B)&4?-1:C===B?0:1;}:("sourceIndex" in y)?function(C,B){if(!C.sourceIndex||!B.sourceIndex){return 0;}return C.sourceIndex-B.sourceIndex; 184 | }:(w.createRange)?function(E,C){if(!E.ownerDocument||!C.ownerDocument){return 0;}var D=E.ownerDocument.createRange(),B=C.ownerDocument.createRange();D.setStart(E,0); 185 | D.setEnd(E,0);B.setStart(C,0);B.setEnd(C,0);return D.compareBoundaryPoints(Range.START_TO_END,B);}:null;y=null;for(A in o){this[A]=o[A];}};var e=/^([#.]?)((?:[\w-]+|\*))$/,g=/\[.+[*$^]=(?:""|'')?\]/,f={}; 186 | j.search=function(q,D,O,v){var B=this.found=(v)?null:(O||[]);if(!q){return B;}else{if(q.navigator){q=q.document;}else{if(!q.nodeType){return B;}}}var z,N,s=this.uniques={},y=!!(O&&O.length),c=(q.nodeType==9); 187 | if(this.document!==(c?q:q.ownerDocument)){this.setDocument(q);}if(y){for(N=B.length;N--;){s[this.getUID(B[N])]=true;}}if(typeof D=="string"){var C=D.match(e); 188 | simpleSelectors:if(C){var K=C[1],V=C[2],I,G;if(!K){if(V=="*"&&this.brokenStarGEBTN){break simpleSelectors;}G=q.getElementsByTagName(V);if(v){return G[0]||null; 189 | }for(N=0;I=G[N++];){if(!(y&&s[this.getUID(I)])){B.push(I);}}}else{if(K=="#"){if(!this.isHTMLDocument||!c){break simpleSelectors;}I=q.getElementById(V); 190 | if(!I){return B;}if(this.idGetsName&&I.getAttributeNode("id").nodeValue!=V){break simpleSelectors;}if(v){return I||null;}if(!(y&&s[this.getUID(I)])){B.push(I); 191 | }}else{if(K=="."){if(!this.isHTMLDocument||((!q.getElementsByClassName||this.brokenGEBCN)&&q.querySelectorAll)){break simpleSelectors;}if(q.getElementsByClassName&&!this.brokenGEBCN){G=q.getElementsByClassName(V); 192 | if(v){return G[0]||null;}for(N=0;I=G[N++];){if(!(y&&s[this.getUID(I)])){B.push(I);}}}else{var u=new RegExp("(^|\\s)"+d.escapeRegExp(V)+"(\\s|$)");G=q.getElementsByTagName("*"); 193 | for(N=0;I=G[N++];){className=I.className;if(!(className&&u.test(className))){continue;}if(v){return I;}if(!(y&&s[this.getUID(I)])){B.push(I);}}}}}}if(y){this.sort(B); 194 | }return(v)?null:B;}querySelector:if(q.querySelectorAll){if(!this.isHTMLDocument||this.brokenMixedCaseQSA||f[D]||(this.brokenCheckedQSA&&D.indexOf(":checked")>-1)||(this.brokenEmptyAttributeQSA&&g.test(D))||d.disableQSA){break querySelector; 195 | }var A=D;if(!c){var M=q.getAttribute("id"),p="slickid__";q.setAttribute("id",p);A="#"+p+" "+A;}try{if(v){return q.querySelector(A)||null;}else{G=q.querySelectorAll(A); 196 | }}catch(P){f[D]=1;break querySelector;}finally{if(!c){if(M){q.setAttribute("id",M);}else{q.removeAttribute("id");}}}if(this.starSelectsClosedQSA){for(N=0; 197 | I=G[N++];){if(I.nodeName>"@"&&!(y&&s[this.getUID(I)])){B.push(I);}}}else{for(N=0;I=G[N++];){if(!(y&&s[this.getUID(I)])){B.push(I);}}}if(y){this.sort(B); 198 | }return B;}z=this.Slick.parse(D);if(!z.length){return B;}}else{if(D==null){return B;}else{if(D.Slick){z=D;}else{if(this.contains(q.documentElement||q,D)){(B)?B.push(D):B=D; 199 | return B;}else{return B;}}}}this.posNTH={};this.posNTHLast={};this.posNTHType={};this.posNTHTypeLast={};this.push=(!y&&(v||(z.length==1&&z.expressions[0].length==1)))?this.pushArray:this.pushUID; 200 | if(B==null){B=[];}var L,H,F;var J,U,E,T,Q,x,t;var w,r,o,R,S=z.expressions;search:for(N=0;(r=S[N]);N++){for(L=0;(o=r[L]);L++){J="combinator:"+o.combinator; 201 | if(!this[J]){continue search;}U=(this.isXMLDocument)?o.tag:o.tag.toUpperCase();E=o.id;T=o.classList;Q=o.classes;x=o.attributes;t=o.pseudos;R=(L===(r.length-1)); 202 | this.bitUniques={};if(R){this.uniques=s;this.found=B;}else{this.uniques={};this.found=[];}if(L===0){this[J](q,U,E,Q,x,t,T);if(v&&R&&B.length){break search; 203 | }}else{if(v&&R){for(H=0,F=w.length;H1)){this.sort(B);}return(v)?(B[0]||null):B;};j.uidx=1;j.uidk="slick-uniqueid";j.getUIDXML=function(m){var c=m.getAttribute(this.uidk); 205 | if(!c){c=this.uidx++;m.setAttribute(this.uidk,c);}return c;};j.getUIDHTML=function(c){return c.uniqueNumber||(c.uniqueNumber=this.uidx++);};j.sort=function(c){if(!this.documentSorter){return c; 206 | }c.sort(this.documentSorter);return c;};j.cacheNTH={};j.matchNTH=/^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/;j.parseNTHArgument=function(p){var n=p.match(this.matchNTH); 207 | if(!n){return false;}var o=n[2]||false;var m=n[1]||1;if(m=="-"){m=-1;}var c=+n[3]||0;n=(o=="n")?{a:m,b:c}:(o=="odd")?{a:2,b:1}:(o=="even")?{a:2,b:0}:{a:0,b:m}; 208 | return(this.cacheNTH[p]=n);};j.createNTHPseudo=function(o,m,c,n){return function(r,p){var t=this.getUID(r);if(!this[c][t]){var z=r.parentNode;if(!z){return false; 209 | }var q=z[o],s=1;if(n){var y=r.nodeName;do{if(q.nodeName!=y){continue;}this[c][this.getUID(q)]=s++;}while((q=q[m]));}else{do{if(q.nodeType!=1){continue; 210 | }this[c][this.getUID(q)]=s++;}while((q=q[m]));}}p=p||"n";var u=this.cacheNTH[p]||this.parseNTHArgument(p);if(!u){return false;}var x=u.a,w=u.b,v=this[c][t]; 211 | if(x==0){return w==v;}if(x>0){if(v":function(o,c,q,n,m,p){if((o=o.firstChild)){do{if(o.nodeType==1){this.push(o,c,q,n,m,p); 226 | }}while((o=o.nextSibling));}},"+":function(o,c,q,n,m,p){while((o=o.nextSibling)){if(o.nodeType==1){this.push(o,c,q,n,m,p);break;}}},"^":function(o,c,q,n,m,p){o=o.firstChild; 227 | if(o){if(o.nodeType==1){this.push(o,c,q,n,m,p);}else{this["combinator:+"](o,c,q,n,m,p);}}},"~":function(p,c,r,o,m,q){while((p=p.nextSibling)){if(p.nodeType!=1){continue; 228 | }var n=this.getUID(p);if(this.bitUniques[n]){break;}this.bitUniques[n]=true;this.push(p,c,r,o,m,q);}},"++":function(o,c,q,n,m,p){this["combinator:+"](o,c,q,n,m,p); 229 | this["combinator:!+"](o,c,q,n,m,p);},"~~":function(o,c,q,n,m,p){this["combinator:~"](o,c,q,n,m,p);this["combinator:!~"](o,c,q,n,m,p);},"!":function(o,c,q,n,m,p){while((o=o.parentNode)){if(o!==this.document){this.push(o,c,q,n,m,p); 230 | }}},"!>":function(o,c,q,n,m,p){o=o.parentNode;if(o!==this.document){this.push(o,c,q,n,m,p);}},"!+":function(o,c,q,n,m,p){while((o=o.previousSibling)){if(o.nodeType==1){this.push(o,c,q,n,m,p); 231 | break;}}},"!^":function(o,c,q,n,m,p){o=o.lastChild;if(o){if(o.nodeType==1){this.push(o,c,q,n,m,p);}else{this["combinator:!+"](o,c,q,n,m,p);}}},"!~":function(p,c,r,o,m,q){while((p=p.previousSibling)){if(p.nodeType!=1){continue; 232 | }var n=this.getUID(p);if(this.bitUniques[n]){break;}this.bitUniques[n]=true;this.push(p,c,r,o,m,q);}}};for(var h in i){j["combinator:"+h]=i[h];}var k={empty:function(c){var m=c.firstChild; 233 | return !(m&&m.nodeType==1)&&!(c.innerText||c.textContent||"").length;},not:function(c,m){return !this.matchNode(c,m);},contains:function(c,m){return(c.innerText||c.textContent||"").indexOf(m)>-1; 234 | },"first-child":function(c){while((c=c.previousSibling)){if(c.nodeType==1){return false;}}return true;},"last-child":function(c){while((c=c.nextSibling)){if(c.nodeType==1){return false; 235 | }}return true;},"only-child":function(n){var m=n;while((m=m.previousSibling)){if(m.nodeType==1){return false;}}var c=n;while((c=c.nextSibling)){if(c.nodeType==1){return false; 236 | }}return true;},"nth-child":j.createNTHPseudo("firstChild","nextSibling","posNTH"),"nth-last-child":j.createNTHPseudo("lastChild","previousSibling","posNTHLast"),"nth-of-type":j.createNTHPseudo("firstChild","nextSibling","posNTHType",true),"nth-last-of-type":j.createNTHPseudo("lastChild","previousSibling","posNTHTypeLast",true),index:function(m,c){return this["pseudo:nth-child"](m,""+c+1); 237 | },even:function(c){return this["pseudo:nth-child"](c,"2n");},odd:function(c){return this["pseudo:nth-child"](c,"2n+1");},"first-of-type":function(c){var m=c.nodeName; 238 | while((c=c.previousSibling)){if(c.nodeName==m){return false;}}return true;},"last-of-type":function(c){var m=c.nodeName;while((c=c.nextSibling)){if(c.nodeName==m){return false; 239 | }}return true;},"only-of-type":function(n){var m=n,o=n.nodeName;while((m=m.previousSibling)){if(m.nodeName==o){return false;}}var c=n;while((c=c.nextSibling)){if(c.nodeName==o){return false; 240 | }}return true;},enabled:function(c){return !c.disabled;},disabled:function(c){return c.disabled;},checked:function(c){return c.checked||c.selected;},focus:function(c){return this.isHTMLDocument&&this.document.activeElement===c&&(c.href||c.type||this.hasAttribute(c,"tabindex")); 241 | },root:function(c){return(c===this.root);},selected:function(c){return c.selected;}};for(var a in k){j["pseudo:"+a]=k[a];}j.attributeGetters={"class":function(){return this.getAttribute("class")||this.className; 242 | },"for":function(){return("htmlFor" in this)?this.htmlFor:this.getAttribute("for");},href:function(){return("href" in this)?this.getAttribute("href",2):this.getAttribute("href"); 243 | },style:function(){return(this.style)?this.style.cssText:this.getAttribute("style");},tabindex:function(){var c=this.getAttributeNode("tabindex");return(c&&c.specified)?c.nodeValue:null; 244 | },type:function(){return this.getAttribute("type");}};var d=j.Slick=(this.Slick||{});d.version="1.1.5";d.search=function(m,n,c){return j.search(m,n,c); 245 | };d.find=function(c,m){return j.search(c,m,null,true);};d.contains=function(c,m){j.setDocument(c);return j.contains(c,m);};d.getAttribute=function(m,c){return j.getAttribute(m,c); 246 | };d.match=function(m,c){if(!(m&&c)){return false;}if(!c||c===m){return true;}j.setDocument(m);return j.matchNode(m,c);};d.defineAttributeGetter=function(c,m){j.attributeGetters[c]=m; 247 | return this;};d.lookupAttributeGetter=function(c){return j.attributeGetters[c];};d.definePseudo=function(c,m){j["pseudo:"+c]=function(o,n){return m.call(o,n); 248 | };return this;};d.lookupPseudo=function(c){var m=j["pseudo:"+c];if(m){return function(n){return m.call(this,n);};}return null;};d.override=function(m,c){j.override(m,c); 249 | return this;};d.isXML=j.isXML;d.uidOf=function(c){return j.getUIDHTML(c);};if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this); 250 | var Element=function(b,g){var h=Element.Constructors[b];if(h){return h(g);}if(typeof b!="string"){return document.id(b).set(g);}if(!g){g={};}if(!(/^[\w-]+$/).test(b)){var e=Slick.parse(b).expressions[0][0]; 251 | b=(e.tag=="*")?"div":e.tag;if(e.id&&g.id==null){g.id=e.id;}var d=e.attributes;if(d){for(var f=0,c=d.length;f=this.length){delete this[e--];}return this;}.protect());}Elements.implement(Array.prototype);Array.mirror(Elements);var f;try{var a=document.createElement(""); 267 | f=(a.name=="x");}catch(c){}var d=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,""");};Document.implement({newElement:function(e,h){if(h&&h.checked!=null){h.defaultChecked=h.checked; 268 | }if(f&&h){e="<"+e;if(h.name){e+=' name="'+d(h.name)+'"';}if(h.type){e+=' type="'+d(h.type)+'"';}e+=">";delete h.name;delete h.type;}return this.id(this.createElement(e)).set(h); 269 | }});})();Document.implement({newTextNode:function(a){return this.createTextNode(a);},getDocument:function(){return this;},getWindow:function(){return this.window; 270 | },id:(function(){var a={string:function(d,c,b){d=Slick.find(b,"#"+d.replace(/(\W)/g,"\\$1"));return(d)?a.element(d,c):null;},element:function(b,c){$uid(b); 271 | if(!c&&!b.$family&&!(/^(?:object|embed)$/i).test(b.tagName)){Object.append(b,Element.Prototype);}return b;},object:function(c,d,b){if(c.toElement){return a.element(c.toElement(b),d); 272 | }return null;}};a.textnode=a.whitespace=a.window=a.document=function(b){return b;};return function(c,e,d){if(c&&c.$family&&c.uid){return c;}var b=typeOf(c); 273 | return(a[b])?a[b](c,e,d||document):null;};})()});if(window.$==null){Window.implement("$",function(a,b){return document.id(a,b,this.document);});}Window.implement({getDocument:function(){return this.document; 274 | },getWindow:function(){return this;}});[Document,Element].invoke("implement",{getElements:function(a){return Slick.search(this,a,new Elements);},getElement:function(a){return document.id(Slick.find(this,a)); 275 | }});(function(b,d,a){this.Selectors={};var e=this.Selectors.Pseudo=new Hash();var c=function(){for(var f in e){if(e.hasOwnProperty(f)){Slick.definePseudo(f,e[f]); 276 | delete e[f];}}};Slick.search=function(g,h,f){c();return b.call(this,g,h,f);};Slick.find=function(f,g){c();return d.call(this,f,g);};Slick.match=function(g,f){c(); 277 | return a.call(this,g,f);};})(Slick.search,Slick.find,Slick.match);if(window.$$==null){Window.implement("$$",function(a){var f=new Elements;if(arguments.length==1&&typeof a=="string"){return Slick.search(this.document,a,f); 278 | }var c=Array.flatten(arguments);for(var d=0,b=c.length;d1){s=p=document.createDocumentFragment(); 298 | }for(var r=0;r"))[0]);},getLast:function(p){return document.id(Slick.search(this,b(p,">")).getLast()); 303 | },getParent:function(p){return document.id(Slick.find(this,b(p,"!")));},getParents:function(p){return Slick.search(this,b(p,"!"),new Elements);},getSiblings:function(p){return Slick.search(this,b(p,"~~"),new Elements); 304 | },getChildren:function(p){return Slick.search(this,b(p,">"),new Elements);},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument; 305 | },getElementById:function(p){return document.id(Slick.find(this,"#"+(""+p).replace(/(\W)/g,"\\$1")));},getSelected:function(){this.selectedIndex;return new Elements(Array.from(this.options).filter(function(p){return p.selected; 306 | }));},toQueryString:function(){var p=[];this.getElements("input, select, textarea").each(function(r){var q=r.type;if(!r.name||r.disabled||q=="submit"||q=="reset"||q=="file"||q=="image"){return; 307 | }var s=(r.get("tag")=="select")?r.getSelected().map(function(t){return document.id(t).get("value");}):((q=="radio"||q=="checkbox")&&!r.checked)?null:r.get("value"); 308 | Array.from(s).each(function(t){if(typeof t!="undefined"){p.push(encodeURIComponent(r.name)+"="+encodeURIComponent(t));}});});return p.join("&");},destroy:function(){var p=j(this).getElementsByTagName("*"); 309 | Array.each(p,j);Element.dispose(this);return null;},empty:function(){Array.from(this.childNodes).each(Element.dispose);return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this; 310 | },match:function(p){return !p||Slick.match(this,p);}});var a=function(t,s,q){if(!q){t.setAttributeNode(document.createAttribute("id"));}if(t.clearAttributes){t.clearAttributes(); 311 | t.mergeAttributes(s);t.removeAttribute("uid");if(t.options){var u=t.options,p=s.options;for(var r=u.length;r--;){u[r].selected=p[r].selected;}}}var v=n[s.tagName.toLowerCase()]; 312 | if(v&&s[v]){t[v]=s[v];}};Element.implement("clone",function(r,p){r=r!==false;var w=this.cloneNode(r),q;if(r){var s=w.getElementsByTagName("*"),u=this.getElementsByTagName("*"); 313 | for(q=s.length;q--;){a(s[q],u[q],p);}}a(w,this,p);if(Browser.ie){var t=w.getElementsByTagName("object"),v=this.getElementsByTagName("object");for(q=t.length; 314 | q--;){t[q].outerHTML=v[q].outerHTML;}}return document.id(w);});var f={contains:function(p){return Slick.contains(this,p);}};if(!document.contains){Document.implement(f); 315 | }if(!document.createElement("div").contains){Element.implement(f);}Element.implement("hasChild",function(p){return this!==p&&this.contains(p);});[Element,Window,Document].invoke("implement",{addListener:function(s,r){if(s=="unload"){var p=r,q=this; 316 | r=function(){q.removeListener("unload",r);p();};}else{k[$uid(this)]=this;}if(this.addEventListener){this.addEventListener(s,r,!!arguments[2]);}else{this.attachEvent("on"+s,r); 317 | }return this;},removeListener:function(q,p){if(this.removeEventListener){this.removeEventListener(q,p,!!arguments[2]);}else{this.detachEvent("on"+q,p); 318 | }return this;},retrieve:function(q,p){var s=e($uid(this)),r=s[q];if(p!=null&&r==null){r=s[q]=p;}return r!=null?r:null;},store:function(q,p){var r=e($uid(this)); 319 | r[q]=p;return this;},eliminate:function(p){var q=e($uid(this));delete q[p];return this;}});if(window.attachEvent&&!window.addEventListener){window.addListener("unload",function(){Object.each(k,j); 320 | if(window.CollectGarbage){CollectGarbage();}});}})();Element.Properties={};Element.Properties=new Hash;Element.Properties.style={set:function(a){this.style.cssText=a; 321 | },get:function(){return this.style.cssText;},erase:function(){this.style.cssText="";}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase(); 322 | }};(function(a){if(a!=null){Element.Properties.maxlength=Element.Properties.maxLength={get:function(){var b=this.getAttribute("maxLength");return b==a?null:b; 323 | }};}})(document.createElement("input").getAttribute("maxLength"));Element.Properties.html=(function(){var c=Function.attempt(function(){var e=document.createElement("table"); 324 | e.innerHTML="";});var d=document.createElement("div");var a={table:[1,"","
"],select:[1,""],tbody:[2,"","
"],tr:[3,"","
"]}; 325 | a.thead=a.tfoot=a.tbody;var b={set:function(){var f=Array.flatten(arguments).join("");var g=(!c&&a[this.get("tag")]);if(g){var h=d;h.innerHTML=g[1]+f+g[2]; 326 | for(var e=g[0];e--;){h=h.firstChild;}this.empty().adopt(h.childNodes);}else{this.innerHTML=f;}}};b.erase=b.set;return b;})();(function(){var c=document.html; 327 | Element.Properties.styles={set:function(f){this.setStyles(f);}};var e=(c.style.opacity!=null);var d=/alpha\(opacity=([\d.]+)\)/i;var b=function(g,f){if(!g.currentStyle||!g.currentStyle.hasLayout){g.style.zoom=1; 328 | }if(e){g.style.opacity=f;}else{f=(f==1)?"":"alpha(opacity="+f*100+")";var h=g.style.filter||g.getComputedStyle("filter")||"";g.style.filter=d.test(h)?h.replace(d,f):h+f; 329 | }};Element.Properties.opacity={set:function(g){var f=this.style.visibility;if(g==0&&f!="hidden"){this.style.visibility="hidden";}else{if(g!=0&&f!="visible"){this.style.visibility="visible"; 330 | }}b(this,g);},get:(e)?function(){var f=this.style.opacity||this.getComputedStyle("opacity");return(f=="")?1:f;}:function(){var f,g=(this.style.filter||this.getComputedStyle("filter")); 331 | if(g){f=g.match(d);}return(f==null||g==null)?1:(f[1]/100);}};var a=(c.style.cssFloat==null)?"styleFloat":"cssFloat";Element.implement({getComputedStyle:function(h){if(this.currentStyle){return this.currentStyle[h.camelCase()]; 332 | }var g=Element.getDocument(this).defaultView,f=g?g.getComputedStyle(this,null):null;return(f)?f.getPropertyValue((h==a)?"float":h.hyphenate()):null;},setOpacity:function(f){b(this,f); 333 | return this;},getOpacity:function(){return this.get("opacity");},setStyle:function(g,f){switch(g){case"opacity":return this.set("opacity",parseFloat(f)); 334 | case"float":g=a;}g=g.camelCase();if(typeOf(f)!="string"){var h=(Element.Styles[g]||"@").split(" ");f=Array.from(f).map(function(k,j){if(!h[j]){return""; 335 | }return(typeOf(k)=="number")?h[j].replace("@",Math.round(k)):k;}).join(" ");}else{if(f==String(Number(f))){f=Math.round(f);}}this.style[g]=f;return this; 336 | },getStyle:function(l){switch(l){case"opacity":return this.get("opacity");case"float":l=a;}l=l.camelCase();var f=this.style[l];if(!f||l=="zIndex"){f=[]; 337 | for(var k in Element.ShortStyles){if(l!=k){continue;}for(var j in Element.ShortStyles[k]){f.push(this.getStyle(j));}return f.join(" ");}f=this.getComputedStyle(l); 338 | }if(f){f=String(f);var h=f.match(/rgba?\([\d\s,]+\)/);if(h){f=f.replace(h[0],h[0].rgbToHex());}}if(Browser.opera||(Browser.ie&&isNaN(parseFloat(f)))){if((/^(height|width)$/).test(l)){var g=(l=="width")?["left","right"]:["top","bottom"],i=0; 339 | g.each(function(m){i+=this.getStyle("border-"+m+"-width").toInt()+this.getStyle("padding-"+m).toInt();},this);return this["offset"+l.capitalize()]-i+"px"; 340 | }if(Browser.opera&&String(f).indexOf("px")!=-1){return f;}if((/^border(.+)Width|margin|padding/).test(l)){return"0px";}}return f;},setStyles:function(g){for(var f in g){this.setStyle(f,g[f]); 341 | }return this;},getStyles:function(){var f={};Array.flatten(arguments).each(function(g){f[g]=this.getStyle(g);},this);return f;}});Element.Styles={left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"}; 342 | Element.Styles=new Hash(Element.Styles);Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(l){var k=Element.ShortStyles; 343 | var g=Element.Styles;["margin","padding"].each(function(m){var n=m+l;k[m][n]=g[n]="@px";});var j="border"+l;k.border[j]=g[j]="@px @ rgb(@, @, @)";var i=j+"Width",f=j+"Style",h=j+"Color"; 344 | k[j]={};k.borderWidth[i]=k[j][i]=g[i]="@px";k.borderStyle[f]=k[j][f]=g[f]="@";k.borderColor[h]=k[j][h]=g[h]="rgb(@, @, @)";});}).call(this);(function(){Element.Properties.events={set:function(b){this.addEvents(b); 345 | }};[Element,Window,Document].invoke("implement",{addEvent:function(f,h){var i=this.retrieve("events",{});if(!i[f]){i[f]={keys:[],values:[]};}if(i[f].keys.contains(h)){return this; 346 | }i[f].keys.push(h);var g=f,b=Element.Events[f],d=h,j=this;if(b){if(b.onAdd){b.onAdd.call(this,h);}if(b.condition){d=function(k){if(b.condition.call(this,k)){return h.call(this,k); 347 | }return true;};}g=b.base||g;}var e=function(){return h.call(j);};var c=Element.NativeEvents[g];if(c){if(c==2){e=function(k){k=new Event(k,j.getWindow()); 348 | if(d.call(j,k)===false){k.stop();}};}this.addListener(g,e,arguments[2]);}i[f].values.push(e);return this;},removeEvent:function(e,d){var c=this.retrieve("events"); 349 | if(!c||!c[e]){return this;}var h=c[e];var b=h.keys.indexOf(d);if(b==-1){return this;}var g=h.values[b];delete h.keys[b];delete h.values[b];var f=Element.Events[e]; 350 | if(f){if(f.onRemove){f.onRemove.call(this,d);}e=f.base||e;}return(Element.NativeEvents[e])?this.removeListener(e,g,arguments[2]):this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]); 351 | }return this;},removeEvents:function(b){var d;if(typeOf(b)=="object"){for(d in b){this.removeEvent(d,b[d]);}return this;}var c=this.retrieve("events"); 352 | if(!c){return this;}if(!b){for(d in c){this.removeEvents(d);}this.eliminate("events");}else{if(c[b]){c[b].keys.each(function(e){this.removeEvent(b,e);},this); 353 | delete c[b];}}return this;},fireEvent:function(e,c,b){var d=this.retrieve("events");if(!d||!d[e]){return this;}c=Array.from(c);d[e].keys.each(function(f){if(b){f.delay(b,this,c); 354 | }else{f.apply(this,c);}},this);return this;},cloneEvents:function(e,d){e=document.id(e);var c=e.retrieve("events");if(!c){return this;}if(!d){for(var b in c){this.cloneEvents(e,b); 355 | }}else{if(c[d]){c[d].keys.each(function(f){this.addEvent(d,f);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,orientationchange:2,touchstart:2,touchmove:2,touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; 356 | var a=function(b){var c=b.relatedTarget;if(c==null){return true;}if(!c){return false;}return(c!=this&&c.prefix!="xul"&&typeOf(this)!="document"&&!this.contains(c)); 357 | };Element.Events={mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.firefox)?"DOMMouseScroll":"mousewheel"}}; 358 | Element.Events=new Hash(Element.Events);}).call(this);(function(){var h=document.createElement("div"),e=document.createElement("div");h.style.height="0"; 359 | h.appendChild(e);var d=(e.offsetParent===h);h=e=null;var l=function(m){return k(m,"position")!="static"||a(m);};var i=function(m){return l(m)||(/^(?:table|td|th)$/i).test(m.tagName); 360 | };Element.implement({scrollTo:function(m,n){if(a(this)){this.getWindow().scrollTo(m,n);}else{this.scrollLeft=m;this.scrollTop=n;}return this;},getSize:function(){if(a(this)){return this.getWindow().getSize(); 361 | }return{x:this.offsetWidth,y:this.offsetHeight};},getScrollSize:function(){if(a(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight}; 362 | },getScroll:function(){if(a(this)){return this.getWindow().getScroll();}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var n=this.parentNode,m={x:0,y:0}; 363 | while(n&&!a(n)){m.x+=n.scrollLeft;m.y+=n.scrollTop;n=n.parentNode;}return m;},getOffsetParent:d?function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null; 364 | }var n=(k(m,"position")=="static")?i:l;while((m=m.parentNode)){if(n(m)){return m;}}return null;}:function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null; 365 | }try{return m.offsetParent;}catch(n){}return null;},getOffsets:function(){if(this.getBoundingClientRect&&!Browser.Platform.ios){var r=this.getBoundingClientRect(),o=document.id(this.getDocument().documentElement),q=o.getScroll(),t=this.getScrolls(),s=(k(this,"position")=="fixed"); 366 | return{x:r.left.toInt()+t.x+((s)?0:q.x)-o.clientLeft,y:r.top.toInt()+t.y+((s)?0:q.y)-o.clientTop};}var n=this,m={x:0,y:0};if(a(this)){return m;}while(n&&!a(n)){m.x+=n.offsetLeft; 367 | m.y+=n.offsetTop;if(Browser.firefox){if(!c(n)){m.x+=b(n);m.y+=g(n);}var p=n.parentNode;if(p&&k(p,"overflow")!="visible"){m.x+=b(p);m.y+=g(p);}}else{if(n!=this&&Browser.safari){m.x+=b(n); 368 | m.y+=g(n);}}n=n.offsetParent;}if(Browser.firefox&&!c(this)){m.x-=b(this);m.y-=g(this);}return m;},getPosition:function(p){if(a(this)){return{x:0,y:0};}var q=this.getOffsets(),n=this.getScrolls(); 369 | var m={x:q.x-n.x,y:q.y-n.y};if(p&&(p=document.id(p))){var o=p.getPosition();return{x:m.x-o.x-b(p),y:m.y-o.y-g(p)};}return m;},getCoordinates:function(o){if(a(this)){return this.getWindow().getCoordinates(); 370 | }var m=this.getPosition(o),n=this.getSize();var p={left:m.x,top:m.y,width:n.x,height:n.y};p.right=p.left+p.width;p.bottom=p.top+p.height;return p;},computePosition:function(m){return{left:m.x-j(this,"margin-left"),top:m.y-j(this,"margin-top")}; 371 | },setPosition:function(m){return this.setStyles(this.computePosition(m));}});[Document,Window].invoke("implement",{getSize:function(){var m=f(this);return{x:m.clientWidth,y:m.clientHeight}; 372 | },getScroll:function(){var n=this.getWindow(),m=f(this);return{x:n.pageXOffset||m.scrollLeft,y:n.pageYOffset||m.scrollTop};},getScrollSize:function(){var o=f(this),n=this.getSize(),m=this.getDocument().body; 373 | return{x:Math.max(o.scrollWidth,m.scrollWidth,n.x),y:Math.max(o.scrollHeight,m.scrollHeight,n.y)};},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var m=this.getSize(); 374 | return{top:0,left:0,bottom:m.y,right:m.x,height:m.y,width:m.x};}});var k=Element.getComputedStyle;function j(m,n){return k(m,n).toInt()||0;}function c(m){return k(m,"-moz-box-sizing")=="border-box"; 375 | }function g(m){return j(m,"border-top-width");}function b(m){return j(m,"border-left-width");}function a(m){return(/^(?:body|html)$/i).test(m.tagName); 376 | }function f(m){var n=m.getDocument();return(!n.compatMode||n.compatMode=="CSS1Compat")?n.html:n.body;}}).call(this);Element.alias({position:"setPosition"}); 377 | [Window,Document,Element].invoke("implement",{getHeight:function(){return this.getSize().y;},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y; 378 | },getScrollLeft:function(){return this.getScroll().x;},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x; 379 | },getTop:function(){return this.getPosition().y;},getLeft:function(){return this.getPosition().x;}});(function(){var f=this.Fx=new Class({Implements:[Chain,Events,Options],options:{fps:60,unit:false,duration:500,frames:null,frameSkip:true,link:"ignore"},initialize:function(g){this.subject=this.subject||this; 380 | this.setOptions(g);},getTransition:function(){return function(g){return -(Math.cos(Math.PI*g)-1)/2;};},step:function(g){if(this.options.frameSkip){var h=(this.time!=null)?(g-this.time):0,i=h/this.frameInterval; 381 | this.time=g;this.frame+=i;}else{this.frame++;}if(this.frame=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2);break;}}return e;},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a&&a[0]||1)/3); 425 | }});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,a+2);});});(function(){var d=function(){},a=("onprogress" in new Browser.Request); 426 | var c=this.Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,timeout:0,noCache:false},initialize:function(e){this.xhr=new Browser.Request(); 427 | this.setOptions(e);this.headers=this.options.headers;},onStateChange:function(){var e=this.xhr;if(e.readyState!=4||!this.running){return;}this.running=false; 428 | this.status=0;Function.attempt(function(){var f=e.status;this.status=(f==1223)?204:f;}.bind(this));e.onreadystatechange=d;if(a){e.onprogress=e.onloadstart=d; 429 | }clearTimeout(this.timer);this.response={text:this.xhr.responseText||"",xml:this.xhr.responseXML};if(this.options.isSuccess.call(this,this.status)){this.success(this.response.text,this.response.xml); 430 | }else{this.failure();}},isSuccess:function(){var e=this.status;return(e>=200&&e<300);},isRunning:function(){return !!this.running;},processScripts:function(e){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return Browser.exec(e); 431 | }return e.stripScripts(this.options.evalScripts);},success:function(f,e){this.onSuccess(this.processScripts(f),e);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain(); 432 | },failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},loadstart:function(e){this.fireEvent("loadstart",[e,this.xhr]); 433 | },progress:function(e){this.fireEvent("progress",[e,this.xhr]);},timeout:function(){this.fireEvent("timeout",this.xhr);},setHeader:function(e,f){this.headers[e]=f; 434 | return this;},getHeader:function(e){return Function.attempt(function(){return this.xhr.getResponseHeader(e);}.bind(this));},check:function(){if(!this.running){return true; 435 | }switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.pass(arguments,this));return false;}return false;},send:function(o){if(!this.check(o)){return this; 436 | }this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.running=true;var l=typeOf(o);if(l=="string"||l=="element"){o={data:o};}var h=this.options; 437 | o=Object.append({data:h.data,url:h.url,method:h.method},o);var j=o.data,f=String(o.url),e=o.method.toLowerCase();switch(typeOf(j)){case"element":j=document.id(j).toQueryString(); 438 | break;case"object":case"hash":j=Object.toQueryString(j);}if(this.options.format){var m="format="+this.options.format;j=(j)?m+"&"+j:m;}if(this.options.emulation&&!["get","post"].contains(e)){var k="_method="+e; 439 | j=(j)?k+"&"+j:k;e="post";}if(this.options.urlEncoded&&["post","put"].contains(e)){var g=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers["Content-type"]="application/x-www-form-urlencoded"+g; 440 | }if(!f){f=document.location.pathname;}var i=f.lastIndexOf("/");if(i>-1&&(i=f.indexOf("#"))>-1){f=f.substr(0,i);}if(this.options.noCache){f+=(f.contains("?")?"&":"?")+String.uniqueID(); 441 | }if(j&&e=="get"){f+=(f.contains("?")?"&":"?")+j;j=null;}var n=this.xhr;if(a){n.onloadstart=this.loadstart.bind(this);n.onprogress=this.progress.bind(this); 442 | }n.open(e.toUpperCase(),f,this.options.async,this.options.user,this.options.password);if(this.options.user&&"withCredentials" in n){n.withCredentials=true; 443 | }n.onreadystatechange=this.onStateChange.bind(this);Object.each(this.headers,function(q,p){try{n.setRequestHeader(p,q);}catch(r){this.fireEvent("exception",[p,q]); 444 | }},this);this.fireEvent("request");n.send(j);if(!this.options.async){this.onStateChange();}if(this.options.timeout){this.timer=this.timeout.delay(this.options.timeout,this); 445 | }return this;},cancel:function(){if(!this.running){return this;}this.running=false;var e=this.xhr;e.abort();clearTimeout(this.timer);e.onreadystatechange=d; 446 | if(a){e.onprogress=e.onloadstart=d;}this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});var b={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(e){b[e]=function(g){var f={method:e}; 447 | if(g!=null){f.data=g;}return this.send(f);};});c.implement(b);Element.Properties.send={set:function(e){var f=this.get("send").cancel();f.setOptions(e); 448 | return this;},get:function(){var e=this.retrieve("send");if(!e){e=new c({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")}); 449 | this.store("send",e);}return e;}};Element.implement({send:function(e){var f=this.get("send");f.send({data:this,url:e||f.options.url});return this;}});})(); 450 | Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false,headers:{Accept:"text/html, application/xml, text/xml, */*"}},success:function(e){var d=this.options,b=this.response; 451 | b.html=e.stripScripts(function(f){b.javascript=f;});var c=b.html.match(/]*>([\s\S]*?)<\/body>/i);if(c){b.html=c[1];}var a=new Element("div").set("html",b.html); 452 | b.tree=a.childNodes;b.elements=a.getElements("*");if(d.filter){b.tree=b.elements.filter(d.filter);}if(d.update){document.id(d.update).empty().set("html",b.html); 453 | }else{if(d.append){document.id(d.append).adopt(a.getChildren());}}if(d.evalScripts){Browser.exec(b.javascript);}this.onSuccess(b.tree,b.elements,b.html,b.javascript); 454 | }});Element.Properties.load={set:function(a){var b=this.get("load").cancel();b.setOptions(a);return this;},get:function(){var a=this.retrieve("load");if(!a){a=new Request.HTML({data:this,link:"cancel",update:this,method:"get"}); 455 | this.store("load",a);}return a;}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Type.isObject,url:Type.isString})); 456 | return this;}});if(typeof JSON=="undefined"){this.JSON={};}JSON=new Hash({stringify:JSON.stringify,parse:JSON.parse});(function(){var special={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"}; 457 | var escape=function(chr){return special[chr]||"\\u"+("0000"+chr.charCodeAt(0).toString(16)).slice(-4);};JSON.validate=function(string){string=string.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""); 458 | return(/^[\],:{}\s]*$/).test(string);};JSON.encode=JSON.stringify?function(obj){return JSON.stringify(obj);}:function(obj){if(obj&&obj.toJSON){obj=obj.toJSON(); 459 | }switch(typeOf(obj)){case"string":return'"'+obj.replace(/[\x00-\x1f\\"]/g,escape)+'"';case"array":return"["+obj.map(JSON.encode).clean()+"]";case"object":case"hash":var string=[]; 460 | Object.each(obj,function(value,key){var json=JSON.encode(value);if(json){string.push(JSON.encode(key)+":"+json);}});return"{"+string+"}";case"number":case"boolean":return""+obj; 461 | case"null":return"null";}return null;};JSON.decode=function(string,secure){if(!string||typeOf(string)!="string"){return null;}if(secure||JSON.secure){if(JSON.parse){return JSON.parse(string); 462 | }if(!JSON.validate(string)){throw new Error("JSON could not decode the input; security is enabled and the value is not secure.");}}return eval("("+string+")"); 463 | };}).call(this);Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);Object.append(this.headers,{Accept:"application/json","X-Request":"JSON"}); 464 | },success:function(c){var b;try{b=this.response.json=JSON.decode(c,this.options.secure);}catch(a){this.fireEvent("error",[c,a]);return;}if(b==null){this.onFailure(); 465 | }else{this.onSuccess(b,c);}}});var Cookie=new Class({Implements:Options,options:{path:"/",domain:false,duration:false,secure:false,document:document,encode:true},initialize:function(b,a){this.key=b; 466 | this.setOptions(a);},write:function(b){if(this.options.encode){b=encodeURIComponent(b);}if(this.options.domain){b+="; domain="+this.options.domain;}if(this.options.path){b+="; path="+this.options.path; 467 | }if(this.options.duration){var a=new Date();a.setTime(a.getTime()+this.options.duration*24*60*60*1000);b+="; expires="+a.toGMTString();}if(this.options.secure){b+="; secure"; 468 | }this.options.document.cookie=this.key+"="+b;return this;},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)"); 469 | return(a)?decodeURIComponent(a[1]):null;},dispose:function(){new Cookie(this.key,Object.merge({},this.options,{duration:-1})).write("");return this;}}); 470 | Cookie.write=function(b,c,a){return new Cookie(b,a).write(c);};Cookie.read=function(a){return new Cookie(a).read();};Cookie.dispose=function(b,a){return new Cookie(b,a).dispose(); 471 | };(function(j,l){var m,g,f=[],c,b,n=true;try{n=j.frameElement!=null;}catch(i){}var h=function(){clearTimeout(b);if(m){return;}Browser.loaded=m=true;l.removeListener("DOMContentLoaded",h).removeListener("readystatechange",a); 472 | l.fireEvent("domready");j.fireEvent("domready");};var a=function(){for(var e=f.length;e--;){if(f[e]()){h();return true;}}return false;};var k=function(){clearTimeout(b); 473 | if(!a()){b=setTimeout(k,10);}};l.addListener("DOMContentLoaded",h);var d=l.createElement("div");if(d.doScroll&&!n){f.push(function(){try{d.doScroll();return true; 474 | }catch(o){}return false;});c=true;}if(l.readyState){f.push(function(){var e=l.readyState;return(e=="loaded"||e=="complete");});}if("onreadystatechange" in l){l.addListener("readystatechange",a); 475 | }else{c=true;}if(c){k();}Element.Events.domready={onAdd:function(e){if(m){e.call(this);}}};Element.Events.load={base:"load",onAdd:function(e){if(g&&this==j){e.call(this); 476 | }},condition:function(){if(this==j){h();delete Element.Events.load;}return true;}};j.addEvent("load",function(){g=true;});})(window,document);(function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"window",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object; 477 | },initialize:function(path,options){this.instance="Swiff_"+String.uniqueID();this.setOptions(options);options=this.options;var id=this.id=options.id||this.instance; 478 | var container=document.id(options.container);Swiff.CallBacks[this.instance]={};var params=options.params,vars=options.vars,callBacks=options.callBacks; 479 | var properties=Object.append({height:options.height,width:options.width},options.properties);var self=this;for(var callBack in callBacks){Swiff.CallBacks[this.instance][callBack]=(function(option){return function(){return option.apply(self.object,arguments); 480 | };})(callBacks[callBack]);vars[callBack]="Swiff.CallBacks."+this.instance+"."+callBack;}params.flashVars=Object.toQueryString(vars);if(Browser.ie){properties.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; 481 | params.movie=path;}else{properties.type="application/x-shockwave-flash";}properties.data=path;var build='';}}build+="";this.object=((container)?container.empty():new Element("div")).set("html",build).firstChild; 483 | },replaces:function(element){element=document.id(element,true);element.parentNode.replaceChild(this.toElement(),element);return this;},inject:function(element){document.id(element,true).appendChild(this.toElement()); 484 | return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+""); 485 | return eval(rs);};}).call(this); -------------------------------------------------------------------------------- /Demos/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Simple Modal Dialog 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 |
19 |
20 |
21 | 56 |
57 | 58 |

Lightbox Examples

59 | 60 |
61 | 62 | 84 |
85 | 86 |

© 2011 Plasm. All Rights Reserved.

87 |
88 |
89 | 90 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Screenshot](https://raw.github.com/plasm/simplemodal/master/logotipo.png) 2 | 3 | http://simplemodal.plasm.it 4 | --------------------------- 5 | Modal - A simple modal window 6 | =========================================== 7 | SIMPLE MODAL is a small [MooTools](http://mootools.net/) plugin to create modal windows. 8 | It can be used to generate alert or confirm messages with few lines of code. Confirm configuration involves the use of callbacks to be applied to affirmative action; it can work in asynchronous mode and retrieve content from external pages or getting the inline content. 9 | SIMPLE MODAL is not a lightbox although the possibility to hide parts of its layout may partially make it similar. 10 | 11 | How to Use 12 | ---------- 13 | 14 | Minimal configuration 15 | 16 | 17 | ALERT INTEGRATION 18 | ----------------- 19 | Snippet code Javascript: 20 | 21 | #JS 22 | 23 | $("myElement").addEvent("click", function(){ 24 | var SM = new SimpleModal({"btn_ok":"Alert button"}); 25 | SM.show({ 26 | "title":"Title", 27 | "contents":"Your message..." 28 | }); 29 | }); 30 | 31 | Snippet code HTML: 32 | 33 | #HTML 34 | 35 | Alert 36 | 37 | 38 | MODAL-AJAX INTEGRATION 39 | ---------------------- 40 | Snippet code Javascript: 41 | 42 | #JS 43 | 44 | $("myElement").addEvent("click", function(){ 45 | var SM = new SimpleModal({"width":600}); 46 | SM.addButton("Action button", "btn primary", function(){ 47 | this.hide(); 48 | }); 49 | SM.addButton("Cancel", "btn"); 50 | SM.show({ 51 | "model":"modal-ajax", 52 | "title":"Title", 53 | "param":{ 54 | "url":"file-content.php", 55 | "onRequestComplete": function(){ /* Action on request complete */ } 56 | } 57 | }); 58 | }); 59 | 60 | Snippet code HTML: 61 | 62 | #HTML 63 | 64 | Open Modal 65 | 66 | 67 | LIGHTBOX SUPPORT 68 | ---------------- 69 | Automatic lightbox support: 70 | 71 | #HTML 72 | 73 | 74 | Example 75 | 76 | -------------------------------------------------------------------------------- /Source/assets/css/simplemodal.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Mootools Simple Modal 3 | * Version 1.0 4 | * Copyright (c) 2011 Marco Dell'Anna - http://www.plasm.it 5 | * 6 | * Markup Modal 7 | *
8 | *
9 | * × 10 | *

SimpleModal Title

11 | *
12 | *
13 | *
14 | *

15 | * Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 16 | *

17 | *
18 | *
19 | * 23 | *
24 | */ 25 | /* Vars */ 26 | /* Overlay style */ 27 | #simple-modal-overlay { 28 | position: fixed ; 29 | display: block; 30 | z-index: 99998; 31 | top: 0; 32 | left: 0; 33 | width: 100%; 34 | height: 100%; 35 | background-color: #000000; 36 | background-position: center center; 37 | background-repeat: no-repeat; 38 | background: -webkit-gradient(radial, center center, 0, center center, 460, from(#ffffff), to(#291a49)); 39 | background: -webkit-radial-gradient(circle, #ffffff, #291a49); 40 | background: -moz-radial-gradient(circle, #ffffff, #291a49); 41 | background: -ms-radial-gradient(circle, #ffffff, #291a49); 42 | } 43 | .simple-modal { 44 | /* Style rewrite */ 45 | 46 | width: 600px; 47 | left: 20px; 48 | top: 20px; 49 | /* */ 50 | 51 | position: absolute; 52 | position: fixed; 53 | margin: 0; 54 | color: #808080; 55 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 56 | font-size: 13px; 57 | font-weight: normal; 58 | line-height: 18px; 59 | background-color: #FFFFFF; 60 | border: 1px solid #EAEEFA; 61 | border: 1px solid rgba(234, 238, 250, 0.6); 62 | -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.6); 63 | -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.6); 64 | box-shadow: 0 0 3px rgba(0, 0, 0, 0.6); 65 | z-index: 99999; 66 | border-radius: 6px; 67 | -webkit-border-radius: 6px; 68 | -moz-border-radius: 6px; 69 | } 70 | .simple-modal .simple-modal-header { 71 | padding: 5px 15px; 72 | margin: 0; 73 | border-bottom: 1px solid #EEEEEE; 74 | } 75 | .simple-modal .simple-modal-header h1 { 76 | margin: 0; 77 | color: #404040; 78 | font-size: 18px; 79 | font-weight: bold; 80 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 81 | line-height: 36px; 82 | } 83 | .simple-modal a.close, .simple-modal a.previous-image, .simple-modal a.next-image { 84 | position: absolute; 85 | top: 16px; 86 | color: #999; 87 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 88 | font-size: 17px; 89 | font-weight: normal; 90 | line-height: 10px; 91 | text-decoration: none; 92 | } 93 | .simple-modal a.close { 94 | right: 15px; 95 | } 96 | .simple-modal a.previous-image { 97 | right: 80px; 98 | } 99 | .simple-modal a.next-image { 100 | right: 60px; 101 | } 102 | .simple-modal a.close:hover, .simple-modal a.previous-image:hover, .simple-modal a.next-image:hover { 103 | color: #444; 104 | } 105 | .simple-modal .simple-modal-body { 106 | padding: 15px; 107 | /* Extra style */ 108 | 109 | } 110 | .simple-modal .simple-modal-body div.contents { 111 | overflow: hidden; 112 | } 113 | .simple-modal .simple-modal-body p { 114 | font-size: 13px; 115 | font-weight: normal; 116 | color: #606060; 117 | line-height: 18px; 118 | } 119 | .simple-modal .simple-modal-body p img { 120 | display: block; 121 | margin: 0 auto 10px auto; 122 | } 123 | .simple-modal .simple-modal-footer { 124 | display: block; 125 | background-color: #F5F5F5; 126 | padding: 14px 15px 15px; 127 | border-top: 1px solid #EEEEEE; 128 | -webkit-border-radius: 0 0 6px 6px; 129 | -moz-border-radius: 0 0 6px 6px; 130 | border-radius: 0 0 6px 6px; 131 | -webkit-box-shadow: inset 0 1px 0 #FFF; 132 | -moz-box-shadow: inset 0 1px 0 #FFF; 133 | box-shadow: inset 0 1px 0 #FFF; 134 | zoom: 1; 135 | margin-bottom: 0; 136 | text-align: center; 137 | } 138 | .simple-modal .simple-modal-footer a.btn { 139 | text-decoration: none; 140 | cursor: pointer; 141 | display: inline-block; 142 | background-repeat: no-repeat; 143 | padding: 5px 14px 6px; 144 | color: #333; 145 | font-size: 13px; 146 | line-height: normal; 147 | border: 1px solid transparent; 148 | -webkit-transition: 0.2s linear all; 149 | -moz-transition: 0.2s linear all; 150 | transition: 0.2s linear all; 151 | border-radius: 3px; 152 | -webkit-border-radius: 3px; 153 | -moz-border-radius: 3px; 154 | } 155 | .simple-modal .simple-modal-footer a.btn.primary { 156 | color: #FFF; 157 | text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); 158 | background-color: #999; 159 | background-repeat: repeat-x; 160 | margin-right: 15px; 161 | } 162 | .simple-modal .simple-modal-footer a.btn.primary:hover { 163 | border: 1px solid #444; 164 | background-color: #444; 165 | } 166 | .simple-modal .simple-modal-footer a.btn.secondary { 167 | padding: 5px 2px 6px; 168 | } 169 | .simple-modal .simple-modal-footer a.btn.secondary:hover { 170 | color: #999; 171 | } 172 | /* Draggable style */ 173 | .simple-modal.draggable .simple-modal-header:hover { 174 | cursor: move; 175 | background-color: #f8f8f8; 176 | -webkit-border-top-left-radius: 6px; 177 | -webkit-border-top-right-radius: 6px; 178 | -moz-border-radius-topleft: 6px; 179 | -moz-border-radius-topright: 6px; 180 | border-top-left-radius: 6px; 181 | border-top-right-radius: 6px; 182 | } 183 | /* Loading style */ 184 | .simple-modal.loading .simple-modal-body { 185 | min-height: 60px; 186 | background: transparent url("../images/loader.gif") no-repeat center center; 187 | } 188 | .simple-modal.loading .simple-modal-body div.contents { 189 | display: none; 190 | } 191 | .simple-modal.loading .close, .simple-modal.loading .simple-modal-header, .simple-modal.loading .simple-modal-footer { 192 | display: none; 193 | } 194 | /* Hide header */ 195 | .simple-modal.hide-header .simple-modal-header { 196 | display: none; 197 | } 198 | /* Hide header */ 199 | .simple-modal.hide-footer .simple-modal-footer { 200 | display: none; 201 | } 202 | -------------------------------------------------------------------------------- /Source/assets/images/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/Source/assets/images/loader.gif -------------------------------------------------------------------------------- /Source/assets/less/simplemodal.less: -------------------------------------------------------------------------------- 1 | /* 2 | * Mootools Simple Modal 3 | * Version 1.0 4 | * Copyright (c) 2011 Marco Dell'Anna - http://www.plasm.it 5 | * 6 | * Markup Modal 7 | *
8 | *
9 | * × 10 | *

SimpleModal Title

11 | *
12 | *
13 | *
14 | *

15 | * Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 16 | *

17 | *
18 | *
19 | * 23 | *
24 | */ 25 | 26 | /* Vars */ 27 | @radiuscontainer:6px; 28 | 29 | .rounded-corners (@radius: 6px) { 30 | border-radius: @radius; 31 | -webkit-border-radius: @radius; 32 | -moz-border-radius: @radius; 33 | } 34 | 35 | /* Overlay style */ 36 | #simple-modal-overlay{ 37 | position:fixed ; 38 | display:block; 39 | z-index: 99998; 40 | top:0; 41 | left:0; 42 | width:100%; 43 | height:100%; 44 | background-color: #000000; 45 | background-position: center center; 46 | background-repeat: no-repeat; 47 | background: -webkit-gradient(radial, center center, 0, center center, 460, from(#FFF), to(#291A49)); 48 | background: -webkit-radial-gradient(circle, #FFF, #291A49); 49 | background: -moz-radial-gradient(circle, #FFF, #291A49); 50 | background: -ms-radial-gradient(circle, #FFF, #291A49); 51 | } 52 | 53 | .simple-modal{ 54 | /* Style rewrite */ 55 | width:600px; 56 | left:20px; 57 | top:20px; 58 | /* */ 59 | position: absolute; 60 | position: fixed; 61 | margin: 0; 62 | color: #808080; 63 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 64 | font-size: 13px; 65 | font-weight: normal; 66 | line-height: 18px; 67 | background-color: #FFFFFF; 68 | border: 1px solid #EAEEFA; 69 | border: 1px solid rgba(234, 238, 250, 0.6); 70 | -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.6); 71 | -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.6); 72 | box-shadow: 0 0 3px rgba(0, 0, 0, 0.6); 73 | z-index:99999; 74 | .rounded-corners; 75 | 76 | .simple-modal-header{ 77 | padding:5px 15px; 78 | margin:0; 79 | border-bottom:1px solid #EEEEEE; 80 | 81 | h1{ 82 | margin:0; 83 | color:#404040; 84 | font-size:18px; 85 | font-weight:bold; 86 | font-family:"Helvetica Neue",Helvetica,Arial,sans-serif; 87 | line-height:36px; 88 | } 89 | } 90 | 91 | a.close{ 92 | position: absolute; 93 | right: 15px; 94 | top: 15px; 95 | color: #999; 96 | font-family:"Helvetica Neue",Helvetica,Arial,sans-serif; 97 | font-size: 17px; 98 | font-weight:normal; 99 | line-height: 10px; 100 | text-decoration:none; 101 | } 102 | 103 | a.close:hover{ 104 | color:#444; 105 | } 106 | 107 | .simple-modal-body{ 108 | padding: 15px; 109 | 110 | div.contents{ 111 | overflow:hidden; 112 | } 113 | 114 | /* Extra style */ 115 | p{ 116 | font-size:13px; 117 | font-weight:normal; 118 | color:#606060; 119 | line-height:18px; 120 | 121 | img{ 122 | display:block; 123 | margin:0 auto 10px auto; 124 | } 125 | } 126 | } 127 | 128 | .simple-modal-footer{ 129 | display:block; 130 | background-color: #F5F5F5; 131 | padding: 14px 15px 15px; 132 | border-top: 1px solid #EEEEEE; 133 | -webkit-border-radius: 0 0 @radiuscontainer @radiuscontainer; 134 | -moz-border-radius: 0 0 @radiuscontainer @radiuscontainer; 135 | border-radius: 0 0 @radiuscontainer @radiuscontainer; 136 | -webkit-box-shadow: inset 0 1px 0 #FFF; 137 | -moz-box-shadow: inset 0 1px 0 #FFF; 138 | box-shadow: inset 0 1px 0 #FFF; 139 | zoom: 1; 140 | margin-bottom: 0; 141 | text-align:center; 142 | 143 | a.btn{ 144 | text-decoration:none; 145 | cursor: pointer; 146 | display: inline-block; 147 | background-repeat: no-repeat; 148 | padding: 5px 14px 6px; 149 | color: #333; 150 | font-size: 13px; 151 | line-height: normal; 152 | border: 1px solid transparent; 153 | -webkit-transition: 0.2s linear all; 154 | -moz-transition: 0.2s linear all; 155 | transition: 0.2s linear all; 156 | .rounded-corners(3px); 157 | } 158 | 159 | a.btn.primary{ 160 | color: #FFF; 161 | text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); 162 | background-color: #999; 163 | background-repeat: repeat-x; 164 | margin-right:15px; 165 | &:hover{ 166 | border: 1px solid #444; 167 | background-color: #444; 168 | } 169 | } 170 | 171 | a.btn.secondary{ 172 | padding: 5px 2px 6px; 173 | &:hover{ 174 | color:#999; 175 | } 176 | } 177 | } 178 | } 179 | 180 | /* Draggable style */ 181 | .simple-modal.draggable .simple-modal-header:hover{ 182 | cursor:move; 183 | background-color:#f8f8f8; 184 | -webkit-border-top-left-radius: @radiuscontainer; 185 | -webkit-border-top-right-radius: @radiuscontainer; 186 | -moz-border-radius-topleft: @radiuscontainer; 187 | -moz-border-radius-topright: @radiuscontainer; 188 | border-top-left-radius: @radiuscontainer; 189 | border-top-right-radius: @radiuscontainer; 190 | } 191 | 192 | /* Loading style */ 193 | .simple-modal.loading{ 194 | .simple-modal-body{ 195 | min-height:60px; 196 | background:transparent url("../images/loader.gif") no-repeat center center; 197 | 198 | div.contents{ 199 | display:none; 200 | } 201 | } 202 | 203 | .close, .simple-modal-header, .simple-modal-footer{ 204 | display:none; 205 | } 206 | } 207 | 208 | /* Hide header */ 209 | .simple-modal.hide-header{ 210 | .simple-modal-header{ 211 | display:none; 212 | } 213 | } 214 | 215 | /* Hide header */ 216 | .simple-modal.hide-footer{ 217 | .simple-modal-footer{ 218 | display:none; 219 | } 220 | } -------------------------------------------------------------------------------- /Source/simple-modal.js: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | description: SIMPLE MODAL is a small plugin to create modal windows. It can be used to generate alert or confirm messages with few lines of code. Confirm configuration involves the use of callbacks to be applied to affirmative action;i t can work in asynchronous mode and retrieve content from external pages or getting the inline content. 4 | 5 | license: MIT-style 6 | 7 | authors: 8 | - Marco Dell'Anna 9 | - Juan Lago 10 | 11 | requires: 12 | - core/1.3: '*' 13 | 14 | provides: 15 | - SimpleModal 16 | ... 17 | 18 | * Mootools Simple Modal 19 | * Version 1.0 20 | * Copyright (c) 2011 Marco Dell'Anna - http://www.plasm.it 21 | * 22 | * Version 1.1 23 | * Copyright (c) 2013 Juan Lago - http://www.livespanske.com 24 | * 25 | * Requires: 26 | * MooTools http://mootools.net 27 | * 28 | * Permission is hereby granted, free of charge, to any person 29 | * obtaining a copy of this software and associated documentation 30 | * files (the "Software"), to deal in the Software without 31 | * restriction, including without limitation the rights to use, 32 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 33 | * copies of the Software, and to permit persons to whom the 34 | * Software is furnished to do so, subject to the following 35 | * conditions: 36 | * 37 | * The above copyright notice and this permission notice shall be 38 | * included in all copies or substantial portions of the Software. 39 | * 40 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 41 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 42 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 43 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 44 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 45 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 46 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 47 | * OTHER DEALINGS IN THE SOFTWARE. 48 | * 49 | * Log: 50 | * 1.0 - Inizio implementazione release stabile [Tested on: ie7/ie8/ie9/Chrome/Firefox7/Safari] 51 | * 1.1 - Extend functionality: Lightbox 52 | */ 53 | var SimpleModal = new Class({ 54 | // Implements 55 | Implements: [Options], 56 | request:null, 57 | buttons:[], 58 | // Protected section for lightbox 59 | lightbox:{}, 60 | // Options 61 | options: { 62 | onAppend: Function, // callback inject in DOM 63 | offsetTop: 40, 64 | overlayOpacity:.3, 65 | overlayColor: "#000000", 66 | width: 400, 67 | draggable: true, 68 | keyEsc: true, 69 | overlayClick: true, 70 | alwaysImage: true, 71 | closeButton: true, // X close button 72 | hideHeader: false, 73 | hideFooter: false, 74 | lightboxExcessWidth:40, // Only for Modal Image (excess pixels created from skin) 75 | lightboxExcessHeight:120, // Only for Modal Image (excess pixels created from skin) 76 | btn_ok: "OK", // Label 77 | btn_cancel: "Cancel", // Label 78 | template:"
\ 79 |

{_TITLE_}

\ 80 |
\ 81 |
\ 82 |
{_CONTENTS_}
\ 83 |
\ 84 |
" 85 | }, 86 | 87 | /** 88 | * Initialization 89 | */ 90 | initialize: function(options) { 91 | //set options 92 | this.setOptions(options); 93 | }, 94 | 95 | /** 96 | * public method show 97 | * Open Modal 98 | * @options: param to rewrite 99 | * @return node HTML 100 | */ 101 | show: function(options){ 102 | if(!options) options = {}; 103 | 104 | // Require redraw? 105 | options.draw = options.draw == undefined ? true : options.draw; 106 | 107 | // Inserisce Overlay 108 | if (options.draw) 109 | this._overlay("show"); 110 | 111 | // Switch different modal 112 | switch( options.model ){ 113 | 114 | // Require title && contents && callback 115 | case "confirm": 116 | // Add button confirm 117 | this.addButton(this.options.btn_ok, "btn primary btn-margin", function(){ 118 | try{ options.callback() } catch(err){}; 119 | this.hide(); 120 | }) 121 | 122 | // Add button cancel 123 | this.addButton(this.options.btn_cancel, "btn secondary"); 124 | 125 | // Rendering 126 | var node = this._drawWindow(options); 127 | 128 | // Add Esc Behaviour 129 | this._addEscBehaviour(); 130 | 131 | break; 132 | 133 | // Require title && contents (define the action buttons externally) 134 | case "modal": 135 | // Rendering 136 | var node = this._drawWindow(options); 137 | 138 | // Add Esc Behaviour 139 | this._addEscBehaviour(); 140 | break; 141 | 142 | // Require title && url contents (define the action buttons externally) 143 | case "modal-ajax": 144 | // Rendering 145 | var node = this._drawWindow(options); 146 | 147 | this._loadContents({ 148 | "url":options.param.url || "", 149 | "onRequestComplete":options.param.onRequestComplete||Function 150 | }) 151 | break; 152 | 153 | // Require title, url contents, lightbox group and the order inside of the group 154 | case "lightbox": 155 | 156 | // lightbox require render the arrows 157 | options.arrows = true; 158 | 159 | // Set information about the current lightbox 160 | this.lightbox.element = options.lightbox.element; 161 | this.lightbox.group = options.lightbox.group; 162 | this.lightbox.order = options.lightbox.order; 163 | 164 | // Rendering 165 | var node = this._drawWindow(options); 166 | 167 | this._loadContents({ 168 | "url": options.param.url || "", 169 | "order": this.lightbox.order, 170 | "draw": options.draw, 171 | "onRequestComplete": options.param.onRequestComplete||Function 172 | }); 173 | break; 174 | 175 | // Require title && contents 176 | default: 177 | // Alert 178 | // Add button 179 | this.addButton(this.options.btn_ok, "btn primary"); 180 | 181 | // Rendering 182 | var node = this._drawWindow(options); 183 | 184 | // Add Esc Behaviour 185 | this._addEscBehaviour(); 186 | break; 187 | } 188 | 189 | // Custom size Modal 190 | node.setStyles({width:this.options.width}); 191 | 192 | // Hide Header &&/|| Footer 193 | if( this.options.hideHeader ) node.addClass("hide-header"); 194 | if( this.options.hideFooter ) node.addClass("hide-footer"); 195 | 196 | 197 | // Add Button X 198 | if( this.options.closeButton ) this._addCloseButton(); 199 | 200 | 201 | // Enabled Drag Window 202 | if( this.options.draggable ){ 203 | var headDrag = node.getElement(".simple-modal-header"); 204 | new Drag(node, { handle:headDrag }); 205 | // Set handle cursor 206 | headDrag.setStyle("cursor", "move") 207 | node.addClass("draggable"); 208 | } 209 | 210 | // Resize Stage 211 | this._display(); 212 | }, 213 | 214 | /** 215 | * public method hide 216 | * Close model window 217 | * return 218 | */ 219 | hide: function(){ 220 | 221 | try{ 222 | if( typeof(this.request) == "object" ) this.request.cancel(); 223 | }catch(err){} 224 | 225 | this._overlay('hide'); 226 | 227 | return; 228 | }, 229 | 230 | /** 231 | * private method _drawWindow 232 | * Rendering window 233 | * return node SM 234 | */ 235 | _drawWindow: function(options) { 236 | 237 | var node; 238 | 239 | if (options.draw) 240 | { 241 | // Add Node in DOM 242 | node = new Element("div#simple-modal", {"class":"simple-modal"}); 243 | 244 | node.inject($$("body")[0]); 245 | } 246 | else 247 | node = document.getElement('#simple-modal.simple-modal'); 248 | 249 | // Set Contents 250 | var html = this._template(this.options.template, {"_TITLE_":options.title || "Untitled", "_CONTENTS_":options.contents || ""}); 251 | 252 | node.set("html", html); 253 | 254 | // Add all buttons 255 | this._injectAllButtons(); 256 | 257 | // Add arrows 258 | if (options.arrows) 259 | this._addArrows(); 260 | 261 | // Callback append 262 | this.options.onAppend(); 263 | 264 | return node; 265 | }, 266 | 267 | /** 268 | * public method addButton 269 | * Add button to Modal button array 270 | * require @label:string, @classe:string, @clickEvent:event 271 | * @return node HTML 272 | */ 273 | addButton: function(label, classe, clickEvent){ 274 | var bt = new Element('a',{ 275 | "title" : label, 276 | "text" : label, 277 | "class" : classe, 278 | "events": { 279 | click: (clickEvent || this.hide).bind(this) 280 | } 281 | }); 282 | this.buttons.push(bt); 283 | return bt; 284 | }, 285 | 286 | /** 287 | * private method _injectAllButtons 288 | * Inject all buttons in simple-modal-footer 289 | * @return 290 | */ 291 | _injectAllButtons: function(){ 292 | this.buttons.each( function(e, i){ 293 | e.inject( $("simple-modal").getElement(".simple-modal-footer") ); 294 | }); 295 | return; 296 | }, 297 | 298 | /** 299 | * private method _addCloseButton 300 | * Inject Close botton (X button) 301 | * @return node HTML 302 | */ 303 | _addCloseButton: function(){ 304 | var b = new Element("a", {"class":"close", "href":"#", "html":"x"}); 305 | 306 | b.inject($("simple-modal"), "top"); 307 | 308 | // Aggiunge bottome X Close 309 | b.addEvent("click", function(e){ 310 | if(e) e.stop(); 311 | this.hide(); 312 | }.bind( this )) 313 | 314 | return b; 315 | }, 316 | 317 | /** 318 | * private method _addArrows 319 | * Inject arrows (Left and Right arrows) 320 | */ 321 | _addArrows: function(){ 322 | 323 | // Create and inject next image button 324 | var btnnext = new Element("a", {"class":"next-image", "style":"display:none", "href":"#", "html":"»"}); 325 | 326 | btnnext.inject($("simple-modal"), "top"); 327 | 328 | btnnext.addEvent("click", function(e){ 329 | if(e) e.stop(); 330 | 331 | this._viewNextElement(); 332 | }.bind(this)); 333 | 334 | // Create and inject previous image button 335 | var btnprevious = new Element("a", {"class":"previous-image", "style":"display:none", "href":"#", "html":"«"}); 336 | 337 | btnprevious.inject($("simple-modal"), "top"); 338 | 339 | btnprevious.addEvent("click", function(e){ 340 | if(e) e.stop(); 341 | 342 | this._viewPreviousElement(); 343 | }.bind(this)); 344 | 345 | // Set visibility of arrows 346 | this._setArrowsVisibility(); 347 | 348 | }, 349 | /** 350 | * private method _viewNextElement 351 | * Load the next element relative to the lightbox in the simple modal 352 | */ 353 | _viewNextElement: function(){ 354 | var elements = this._getElementsByGroup(this.lightbox.group); 355 | 356 | this.lightbox.order++; 357 | 358 | var next_element = elements[this.lightbox.order]; 359 | 360 | this.show({ 361 | "model": "lightbox", 362 | "title": next_element.get('title'), 363 | "draw": false, // Is not required redraw 364 | "param":{ 365 | "url": next_element.get('href'), 366 | "onRequestComplete": function(){ } 367 | }, 368 | "lightbox": { 369 | "element" : next_element, 370 | "group": this.lightbox.group, 371 | "order": this.lightbox.order 372 | } 373 | }); 374 | }, 375 | /** 376 | * private method _viewPreviousElement 377 | * Load the next element relative to the lightbox in the simple modal 378 | */ 379 | _viewPreviousElement: function(){ 380 | var elements = this._getElementsByGroup(this.lightbox.group); 381 | 382 | this.lightbox.order--; 383 | 384 | var previous_element = elements[this.lightbox.order]; 385 | 386 | this.show({ 387 | "model": "lightbox", 388 | "title": previous_element.get('title'), 389 | "draw": false, // Is not required redraw 390 | "param":{ 391 | "url": previous_element.get('href'), 392 | "onRequestComplete": function(){ } 393 | }, 394 | "lightbox": { 395 | "element" : previous_element, 396 | "group": this.lightbox.group, 397 | "order": this.lightbox.order 398 | } 399 | }); 400 | }, 401 | /** 402 | * private method _setArrowsVisibility 403 | * Automatically set the visibility of the Arrows 404 | */ 405 | _setArrowsVisibility: function(){ 406 | 407 | var left_arrow = document.getElement('.simple-modal a.previous-image'); 408 | var right_arrow = document.getElement('.simple-modal a.next-image'); 409 | var total_slides = this.getTotalByGroup(this.lightbox.group); 410 | 411 | // Set visibility of the left arrow (Previous image) 412 | if (this.lightbox.order == 0) 413 | left_arrow.setStyle('display', 'none'); 414 | else 415 | left_arrow.setStyle('display', 'inline'); 416 | 417 | 418 | // Set visibility of the right arrow (Next image) 419 | if (total_slides > 0 && this.lightbox.order < total_slides - 1) 420 | right_arrow.setStyle('display', 'inline'); 421 | else 422 | right_arrow.setStyle('display', 'none'); 423 | 424 | }, 425 | /** 426 | * private method _getElementsByGroup 427 | * Retrieve all elements by group 428 | * @options string Group Name 429 | * @return DOM Nodes 430 | */ 431 | _getElementsByGroup: function(group) { 432 | 433 | var links = $$("a").filter(function(el) { 434 | return el.rel && el.rel.contains('simplemodal[' + group + ']'); 435 | }); 436 | 437 | return links; 438 | }, 439 | /** 440 | * public method _getTotalByGroup 441 | * Count the number of lightboxes are in a certain group 442 | * @options string Group Name 443 | * @return integer Number of lightboxes by group 444 | */ 445 | getTotalByGroup: function(group) { 446 | return this._getElementsByGroup(group).length; 447 | }, 448 | /** 449 | * private method _overlay 450 | * Create/Destroy overlay and Modal 451 | * @return 452 | */ 453 | _overlay: function(status) { 454 | switch( status ) { 455 | case 'show': 456 | 457 | this._overlay('hide'); 458 | 459 | var overlay = new Element("div", {"id":"simple-modal-overlay"}); 460 | overlay.inject( $$("body")[0] ); 461 | overlay.setStyle("background-color", this.options.overlayColor); 462 | overlay.fade("hide").fade(this.options.overlayOpacity); 463 | 464 | // Behaviour 465 | if( this.options.overlayClick){ 466 | overlay.addEvent("click", function(e){ 467 | if(e) e.stop(); 468 | this.hide(); 469 | }.bind(this)) 470 | } 471 | 472 | // Add Control Resize 473 | this.__resize = this._display.bind(this); 474 | window.addEvent("resize", this.__resize ); 475 | break; 476 | 477 | case 'hide': 478 | 479 | // Remove Event Resize 480 | window.removeEvent("resize", this._display); 481 | 482 | // Remove Event Resize 483 | if(this.options.keyEsc) 484 | { 485 | var fixEV = Browser.name != 'ie' ? "keydown" : "onkeydown"; 486 | window.removeEvent(fixEV, this._removeSM); 487 | } 488 | 489 | // Remove Overlay 490 | try 491 | { 492 | $('simple-modal-overlay').destroy(); 493 | } 494 | catch(err){} 495 | 496 | // Remove Modal 497 | try{ 498 | $('simple-modal').destroy(); 499 | } 500 | catch(err){} 501 | break; 502 | } 503 | 504 | return; 505 | }, 506 | 507 | /** 508 | * private method _loadContents 509 | * Async request for modal ajax 510 | * @return 511 | */ 512 | _loadContents: function(param){ 513 | // Set Loading 514 | $('simple-modal').addClass("loading"); 515 | 516 | // Match image file 517 | var re = new RegExp( /([^\/\\]+)\.(jpg|png|gif)$/i ); 518 | 519 | if( param.url.match(re) || this.options.alwaysImage){ 520 | 521 | // Hide Header/Footer 522 | $('simple-modal').addClass("hide-footer"); 523 | 524 | // Remove All Event on Overlay 525 | $("simple-modal-overlay").removeEvents(); // Prevent Abort 526 | 527 | // Immagine 528 | var images = [param.url]; 529 | new Asset.images(images, { 530 | onProgress: function(i) { 531 | immagine = this; 532 | }, 533 | onComplete: function() { 534 | try{ 535 | // Remove loading 536 | $('simple-modal').removeClass("loading"); 537 | 538 | // Imposta dimensioni 539 | var content = $('simple-modal').getElement(".simple-modal-body"); 540 | var padding = content.getStyle("padding").split(" "); 541 | var width = immagine.get("width").toInt(); 542 | var height = immagine.get("height").toInt(); 543 | 544 | // Porportional scale 545 | var ns = this._scaleImage(width, height); 546 | width = ns.width 547 | height = ns.height 548 | 549 | // Width 550 | var myFx1 = new Fx.Tween($("simple-modal"), { 551 | duration: 'normal', 552 | transition: 'sine:out', 553 | link: 'cancel', 554 | property: 'width' 555 | }).start($("simple-modal").getCoordinates().width, width + padding[1].toInt() + padding[3].toInt() + $('simple-modal').getStyle('border-left-width').toInt() + $('simple-modal').getStyle('border-right-width').toInt()) 556 | 557 | // Height 558 | var myFx2 = new Fx.Tween(content, { 559 | duration: 'normal', 560 | transition: 'sine:out', 561 | link: 'cancel', 562 | property: 'height' 563 | }).start(content.getCoordinates().height, height).chain(function(){ 564 | 565 | 566 | // Inject 567 | immagine.inject( $('simple-modal').getElement(".contents").empty() ).fade("hide").setStyles({"width":width, "height":height}).fade("in"); 568 | 569 | this._display(); 570 | 571 | // Add Esc Behaviour 572 | this._addEscBehaviour(); 573 | 574 | }.bind(this)); 575 | 576 | // Left 577 | var myFx3 = new Fx.Tween($("simple-modal"), { 578 | duration: 'normal', 579 | transition: 'sine:out', 580 | link: 'cancel', 581 | property: 'left' 582 | }).start($("simple-modal").getCoordinates().left, (window.getCoordinates().width - width)/2); 583 | 584 | 585 | 586 | }catch(err){} 587 | }.bind(this) 588 | }); 589 | 590 | } 591 | else 592 | { 593 | 594 | // Request HTML 595 | this.request = new Request.HTML({ 596 | evalScripts:false, 597 | url: param.url, 598 | method: 'get', 599 | onRequest: function(){}, 600 | onSuccess: function(responseTree, responseElements, responseHTML, responseJavaScript){ 601 | $('simple-modal').removeClass("loading"); 602 | $('simple-modal').getElement(".contents").set("html", responseHTML); 603 | param.onRequestComplete(); 604 | 605 | // Execute script page loaded 606 | eval(responseJavaScript) 607 | 608 | // Resize 609 | this._display(); 610 | 611 | // Add Esc Behaviour 612 | this._addEscBehaviour(); 613 | }.bind(this), 614 | onFailure: function(){ 615 | $('simple-modal').removeClass("loading"); 616 | $('simple-modal').getElement(".contents").set("html", "loading failed") 617 | } 618 | }).send(); 619 | } 620 | }, 621 | 622 | /** 623 | * private method _scaleImage 624 | * Calculate scale image proportional 625 | * @return {width, height} 626 | */ 627 | _scaleImage: function(w, h){ 628 | 629 | var removeH = this.options.lightboxExcessHeight + this.options.offsetTop; 630 | var removeW = this.options.lightboxExcessWidth; 631 | var width = w ; 632 | var height = h ; 633 | var newWidth = window.getSize().x - removeW; 634 | var newHeight = window.getSize().y - removeH; 635 | 636 | ratio = (width <= height) ? height / newHeight : width / newWidth; 637 | 638 | // Ratio 639 | ratio = Math.max(ratio, 1.0); 640 | 641 | // New sizes 642 | w = parseInt(width / ratio); 643 | h = parseInt(height / ratio); 644 | return {"width":w, "height":h} 645 | }, 646 | 647 | /** 648 | * private method _display 649 | * Move interface 650 | * @return 651 | */ 652 | _display: function(){ 653 | // Update overlay 654 | 655 | try{ 656 | $("simple-modal-overlay").setStyles({ 657 | height: window.getCoordinates().height //$$("body")[0].getScrollSize().y 658 | }); 659 | } 660 | catch(err){} 661 | 662 | // Update position popup 663 | try{ 664 | var offsetTop = this.options.offsetTop || 0; //this.options.offsetTop != null ? this.options.offsetTop : window.getScroll().y; 665 | 666 | $("simple-modal").setStyles({ 667 | top: offsetTop, 668 | left: ((window.getCoordinates().width - $("simple-modal").getCoordinates().width)/2 ) 669 | }); 670 | } catch(err){} 671 | 672 | return; 673 | }, 674 | 675 | /** 676 | * private method _addEscBehaviour 677 | * add Event ESC 678 | * @return 679 | */ 680 | _addEscBehaviour: function(){ 681 | if(this.options.keyEsc){ 682 | this._removeSM = function(e){ 683 | if( e.key == "esc" ) this.hide(); 684 | }.bind(this) 685 | // Remove Event Resize 686 | if(this.options.keyEsc){ 687 | var fixEV = Browser.name != 'ie' ? "keydown" : "onkeydown"; 688 | window.addEvent(fixEV, this._removeSM ); 689 | } 690 | } 691 | }, 692 | 693 | /** 694 | * private method _template 695 | * simple template by Thomas Fuchs 696 | * @return 697 | */ 698 | _template:function(s,d){ 699 | for(var p in d) 700 | s=s.replace(new RegExp('{'+p+'}','g'), d[p]); 701 | return s; 702 | } 703 | }); 704 | 705 | /** 706 | * Lightbox loader 707 | */ 708 | SimpleModal.autoload = function() { 709 | var links = $$("a").filter(function(el) { 710 | return el.rel && el.rel.test(/^simplemodal/i); 711 | }); 712 | 713 | var order = []; 714 | 715 | // Instance to SimpleModal (One instance for all lightboxes) 716 | var SM = new SimpleModal(); 717 | 718 | 719 | $$(links).each(function(el) { 720 | 721 | // Obtain lightbox group 722 | var relation= el.rel.replace(/[[]|]/gi," "); 723 | var rel0 = relation.split(" "); 724 | 725 | // Obtain order 726 | order[rel0[1]] = order[rel0[1]] == null ? 0 : order[rel0[1]] + 1; 727 | 728 | // Avoid group order as static var 729 | var group_order = order[rel0[1]]; 730 | 731 | // Create custom event per link 732 | el.addEvent('click', function(e) { 733 | 734 | e.stop(); 735 | 736 | SM.show({ 737 | "model": "lightbox", 738 | "title": this.get('title'), 739 | "param":{ 740 | "url": this.get('href'), 741 | "onRequestComplete": function(){ } 742 | }, 743 | "lightbox": { 744 | "element" : this, 745 | "group": rel0[1], 746 | "order": group_order 747 | } 748 | }); 749 | 750 | }); 751 | 752 | }); 753 | 754 | } 755 | 756 | /** 757 | * Lightbox boot 758 | */ 759 | window.addEvent("domready", SimpleModal.autoload); -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simplemodal.js", 3 | "description": "A simple modal window", 4 | "version": "1.0", 5 | "author": { 6 | "name": "Marco Dell'Anna" 7 | }, 8 | "keywords": [ 9 | "javascript", 10 | "window modal", 11 | "modal" 12 | ], 13 | "main": [ 14 | "./Source/simple-modal.js", 15 | "./Source/assets/css/simplemodal.css", 16 | "./Source/assets/images/loader.gif" 17 | ], 18 | "repository": { 19 | "type": "git", 20 | "url": "https://github.com/plasm/simplemodal.git" 21 | }, 22 | "readme": "README.md", 23 | "licenses": [ 24 | { 25 | "type": "MIT", 26 | "url": "http://opensource.org/licenses/MIT" 27 | } 28 | ], 29 | "ignore": [ 30 | "Demos", 31 | "README.md", 32 | "logotipo.png", 33 | "package.yml" 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /logotipo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plasm/simplemodal/6c09dbf6fbb56b86f998e92dfda3ed51bf74b166/logotipo.png -------------------------------------------------------------------------------- /package.yml: -------------------------------------------------------------------------------- 1 | name: SimpleModal 2 | author: plasm 3 | category: Interface 4 | tags: [overlay,modal,interface] 5 | current: 1.0 6 | copyright: "© [Marco Dell'Anna](http://www.plasm.it)" 7 | url: "http://simplemodal.plasm.it" 8 | 9 | sources: 10 | - "Source/simple-modal.js" 11 | 12 | demo: http://simplemodal.plasm.it --------------------------------------------------------------------------------