/*! * jQLite JavaScript Library v1.1.1 (http://code.google.com/p/jqlite/) * Copyright (c) 2010 Brett Fattori (bfattori@gmail.com) * Licensed under the MIT license * http://www.opensource.org/licenses/mit-license.php * * Many thanks to the jQuery team's efforts. Some code is * Copyright (c) 2010, John Resig. See * http://jquery.org/license * * @author Brett Fattori (bfattori@gmail.com) * @author $Author: bfattori $ * @version $Revision: 145 $ * * Created: 03/29/2010 * Modified: $Date: 2010-06-21 11:08:14 -0400 (Mon, 21 Jun 2010) $ */ (function(){function B(){return+new Date}var D=function(a,b){if(a===""&&b)return b;var d=a.split(" "),c=d.shift(),e;if(c.charAt(0)=="#"){var g=i.getElementById(c.substring(1));e=g?[g]:[]}else{e=c.charAt(0)!=="."?c.split(".")[0]:"*";var h=c.split("."),j=null;if(e.indexOf("[")!=-1){j=e;e=e.substr(0,e.indexOf("["))}g=function(o){var n=arguments.callee,k;if(!(k=!n.needClass)){k=n.classes;if(o.className.length==0)k=false;else{for(var r=o.className.split(" "),l=k.length,p=0;p0;g.needAttribute=j!=null;for(c=0;c0;)A.shift()()};var t="jQuery"+B(),S=0,O={};f.noData={embed:true,object:true,applet:true};f.cache={};f.data=function(a,b,d){if(!(a.nodeName&&jQuery.noData[a.nodeName.toLowerCase()])){a=a==window?O:a;var c=a[t];c||(c=a[t]=++S);if(b&&!jQuery.cache[c])jQuery.cache[c]={};if(d!==undefined)jQuery.cache[c][b]=d;return b?jQuery.cache[c][b]:c}};f.removeData= function(a,b){a=a==window?O:a;var d=a[t];if(b){if(jQuery.cache[d]){delete jQuery.cache[d][b];b="";for(b in jQuery.cache[d])break;b||jQuery.removeData(a)}}else{try{delete a[t]}catch(c){a.removeAttribute&&a.removeAttribute(t)}delete jQuery.cache[d]}};f.ajax={status:-1,statusText:"",responseText:null,responseXML:null,send:function(a,b,d){if(f.isFunction(b)){d=b;b={}}if(a){var c=true,e=null,g=null;if(typeof b.async!=="undefined"){c=b.async;delete b.async}if(typeof b.username!=="undefined"){e=b.username; delete b.username}if(typeof b.password!=="undefined"){g=b.password;delete b.password}b=f.param(b);if(b.length!=0)a+=(a.indexOf("?")==-1?"?":"&")+b;b=new XMLHttpRequest;b.open("GET",a,c,e,g);b.send();if(c){a=function(h){var j=arguments.callee;h.status==200?f.ajax.complete(h,j.cb):f.ajax.error(h,j.cb)};a.cb=d;d=function(){var h=arguments.callee;h.req.readyState!=4?setTimeout(h,250):h.xcb(h.req)};d.req=b;d.xcb=a;setTimeout(d,250)}}},complete:function(a,b){f.ajax.status=a.status;f.ajax.responseText=a.responseText; f.ajax.responseXML=a.responseXML;f.isFunction(b)&&b(a.responseText,a.status)},error:function(a,b){f.ajax.status=a.status;f.ajax.statusText=a.statusText;f.isFunction(b)&&b(a.status,a.statusText)}};f.makeArray=function(a,b){var d=b||[];if(a!=null)a.length==null||typeof a==="string"||jQuery.isFunction(a)||typeof a!=="function"&&a.setInterval?L.call(d,a):f.merge(d,a);return d};f.inArray=function(a,b){for(var d=0;d")!=-1){d=f.trim(a).toLowerCase();d=d.indexOf("'); this.canvas = $(''); this.overlay = $('
'); this.loaderMessage = $('
'); this.loader = $('
').append($('
').append($(''))).append(this.loaderMessage); this.start = $('
Click to start'); this.div.append(this.wrapper); this.wrapper.append(this.canvas); this.wrapper.append(this.loader); this.wrapper.append(this.overlay); this.overlay.append($('
Powered by  ').append($('js-dos.com'))); this.overlay.append(this.start); } UI.prototype.onStart = function(fun) { return this.start.click((function(_this) { return function() { fun(); return _this.overlay.hide(); }; })(this)); }; UI.prototype.appendCss = function() { var head, style; head = document.head || document.getElementsByTagName('head')[0]; style = document.createElement('style'); style.type = 'text/css'; if (style.styleSheet) { style.styleSheet.cssText = this.css; } else { style.appendChild(document.createTextNode(this.css)); } return head.appendChild(style); }; UI.prototype.showLoader = function() { this.loader.show(); return this.loaderMessage.html(''); }; UI.prototype.updateMessage = function(message) { return this.loaderMessage.html(message); }; UI.prototype.hideLoader = function() { return this.loader.hide(); }; UI.prototype.css = '.dosbox-container { position: relative; min-width: 320px; min-height: 200px; } .dosbox-canvas { } .dosbox-overlay, .dosbox-loader { position: absolute; left: 0; right: 0; top: 0; bottom: 0; background-color: #333; } .dosbox-start { text-align: center; position: absolute; left: 0; right: 0; bottom: 50%; color: #f80; font-size: 1.5em; text-decoration: underline; cursor: pointer; } .dosbox-overlay a { color: #f80; } .dosbox-loader { display: none; } .dosbox-powered { position: absolute; right: 1em; bottom: 1em; font-size: 0.8em; color: #9C9C9C; } .dosbox-loader-message { text-align: center; position: absolute; left: 0; right: 0; bottom: 50%; margin: 0 0 -3em 0; box-sizing: border-box; color: #f80; font-size: 1.5em; } @-moz-keyframes loading { 0% { left: 0; } 50% { left: 8.33333em; } 100% { left: 0; } } @-webkit-keyframes loading { 0% { left: 0; } 50% { left: 8.33333em; } 100% { left: 0; } } @keyframes loading { 0% { left: 0; } 50% { left: 8.33333em; } 100% { left: 0; } } .st-loader { width: 10em; height: 2.5em; position: absolute; top: 50%; left: 50%; margin: -1.25em 0 0 -5em; box-sizing: border-box; } .st-loader:before, .st-loader:after { content: ""; display: block; position: absolute; top: 0; bottom: 0; width: 1.25em; box-sizing: border-box; border: 0.25em solid #f80; } .st-loader:before { left: -0.76923em; border-right: 0; } .st-loader:after { right: -0.76923em; border-left: 0; } .st-loader .equal { display: block; position: absolute; top: 50%; margin-top: -0.5em; left: 4.16667em; height: 1em; width: 1.66667em; border: 0.25em solid #f80; box-sizing: border-box; border-width: 0.25em 0; -moz-animation: loading 1.5s infinite ease-in-out; -webkit-animation: loading 1.5s infinite ease-in-out; animation: loading 1.5s infinite ease-in-out; }'; return UI; })(); }).call(this); (function() { Dosbox.Xhr = (function() { function Xhr(url, options) { var e; this.success = options.success; this.progress = options.progress; if (window.ActiveXObject) { try { this.xhr = new ActiveXObject('Microsoft.XMLHTTP'); } catch (error) { e = error; this.xhr = null; } } else { this.xhr = new XMLHttpRequest(); } this.xhr.open('GET', url, true); this.xhr.overrideMimeType('text/plain; charset=x-user-defined'); this.xhr.addEventListener('progress', (function(_this) { return function(evt) { if (_this.progress) { return _this.progress(evt.total, evt.loaded); } }; })(this)); this.xhr.onreadystatechange = (function(_this) { return function() { return _this._onReadyStateChange(); }; })(this); this.xhr.send(); } Xhr.prototype._onReadyStateChange = function() { if (this.xhr.readyState === 4 && this.success) { return this.success(this.xhr.responseText); } }; return Xhr; })(); }).call(this);