Add version files and new GIF images for UI components
This commit is contained in:
114
modules/lib/smoke/smoke.css
Normal file
114
modules/lib/smoke/smoke.css
Normal file
@ -0,0 +1,114 @@
|
||||
.smoke-base {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
-moz-transition: all .3s;
|
||||
-webkit-transition: opacity .3s;
|
||||
-o-transition: all .3s;
|
||||
transition: all .3s;
|
||||
}
|
||||
|
||||
.smoke-base.smoke-visible {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.smokebg {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.smoke-base .dialog {
|
||||
position: absolute
|
||||
}
|
||||
|
||||
.dialog-prompt {
|
||||
margin-top: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.dialog-buttons {
|
||||
margin: 10px 0 5px 0
|
||||
}
|
||||
|
||||
.smoke {
|
||||
font-family: sans-serif;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
font-size: 30px;
|
||||
line-height: 130%;
|
||||
}
|
||||
|
||||
.dialog-buttons button {
|
||||
display: inline-block;
|
||||
vertical-align: baseline;
|
||||
cursor: pointer;
|
||||
font-family: sans-serif;
|
||||
font-style: normal;
|
||||
text-decoration: none;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
margin: 0 5px;
|
||||
-webkit-background-clip: padding-box;
|
||||
font-size: 13px;
|
||||
line-height: 13px;
|
||||
font-weight: bold;
|
||||
padding: 9px 12px;
|
||||
}
|
||||
|
||||
.dialog-prompt input {
|
||||
margin: 0;
|
||||
border: 0;
|
||||
font-family: sans-serif;
|
||||
outline: none;
|
||||
border: 1px solid #333;
|
||||
width: 97%;
|
||||
background-color: #fff;
|
||||
font-size: 15px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.smoke-base {
|
||||
background: rgba(0,0,0,.3);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#90000000,endColorstr=#900000000);
|
||||
}
|
||||
|
||||
.smoke-base .dialog {
|
||||
top: 25%;
|
||||
left: 25%;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.smoke-base .dialog-inner {
|
||||
padding: 15px
|
||||
}
|
||||
|
||||
.smoke {
|
||||
text-transform: uppercase;
|
||||
background-color: rgba(255,255,255,1);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#ffffff);
|
||||
}
|
||||
|
||||
.dialog-buttons button {
|
||||
border-radius: 5px;
|
||||
text-transform: uppercase;
|
||||
background-color: rgba(0,0,0,.9);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#222222,endColorstr=#222222);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
button.cancel {
|
||||
background-color: rgba(0,0,0,.7);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#444444,endColorstr=#444444);
|
||||
}
|
||||
|
||||
.queue{
|
||||
display:none;
|
||||
}
|
||||
387
modules/lib/smoke/smoke.js
Normal file
387
modules/lib/smoke/smoke.js
Normal file
@ -0,0 +1,387 @@
|
||||
/*jslint browser: true, onevar: true, undef: true, nomen: false, eqeqeq: true, bitwise: true, regexp: true, newcap: true, immed: true */
|
||||
|
||||
var smoke = {
|
||||
smoketimeout: [],
|
||||
init: false,
|
||||
zindex: 1000,
|
||||
i: 0,
|
||||
|
||||
bodyload: function(id){
|
||||
var ff = document.createElement('div');
|
||||
ff.setAttribute('id','smoke-out-'+id);
|
||||
/* ff.setAttribute('class','smoke-base'); */
|
||||
ff.className = 'smoke-base';
|
||||
ff.style.zIndex = smoke.zindex;
|
||||
smoke.zindex++;
|
||||
document.body.appendChild(ff);
|
||||
},
|
||||
|
||||
newdialog: function(){
|
||||
var newid = new Date().getTime();
|
||||
newid = Math.random(1,99) + newid;
|
||||
|
||||
// make a new container while you're at it
|
||||
if (!smoke.init){
|
||||
smoke.listen(window,"load", function(){
|
||||
smoke.bodyload(newid);
|
||||
});
|
||||
}else{
|
||||
smoke.bodyload(newid);
|
||||
}
|
||||
|
||||
return newid;
|
||||
},
|
||||
|
||||
forceload: function(){},
|
||||
|
||||
build: function (e, f) {
|
||||
smoke.i++;
|
||||
|
||||
// determine stacking order
|
||||
f.stack = smoke.i;
|
||||
|
||||
e = e.replace(/\n/g,'<br />');
|
||||
e = e.replace(/\r/g,'<br />');
|
||||
|
||||
var prompt = '',
|
||||
ok = 'OK',
|
||||
cancel = 'Cancel',
|
||||
classname = '',
|
||||
buttons = '',
|
||||
box;
|
||||
|
||||
if (f.type === 'prompt'){
|
||||
prompt =
|
||||
'<div class="dialog-prompt">'+
|
||||
'<input id="dialog-input-'+f.newid+'" type="text" ' + (f.params.value ? 'value="' + f.params.value + '"' : '') + ' />'+
|
||||
'</div>';
|
||||
}
|
||||
|
||||
if (f.params.ok){
|
||||
ok = f.params.ok;
|
||||
}
|
||||
|
||||
if (f.params.cancel){
|
||||
cancel = f.params.cancel;
|
||||
}
|
||||
|
||||
if (f.params.classname){
|
||||
classname = f.params.classname;
|
||||
}
|
||||
|
||||
if (f.type !== 'signal'){
|
||||
buttons = '<div class="dialog-buttons">';
|
||||
if (f.type === 'alert'){
|
||||
buttons +=
|
||||
'<button class="btn" id="alert-ok-'+f.newid+'">'+ok+'</button>';
|
||||
} else if (f.type === 'prompt' || f.type === 'confirm'){
|
||||
if (f.params.reverseButtons) {
|
||||
buttons +=
|
||||
'<button class="btn" id="'+f.type+'-ok-'+f.newid+'">'+ok+'</button>' +
|
||||
'<button class="btn" id="'+f.type+'-cancel-'+f.newid+'" class="cancel">'+cancel+'</button>';
|
||||
} else {
|
||||
buttons +=
|
||||
'<button class="btn" id="'+f.type+'-cancel-'+f.newid+'" class="cancel">'+cancel+'</button>'+
|
||||
'<button class="btn" id="'+f.type+'-ok-'+f.newid+'">'+ok+'</button>';
|
||||
}
|
||||
}
|
||||
buttons += '</div>';
|
||||
}
|
||||
|
||||
|
||||
box =
|
||||
'<div id="smoke-bg-'+f.newid+'" class="smokebg"></div>'+
|
||||
'<div class="dialog smoke '+classname+'">'+
|
||||
'<div class="dialog-inner">'+
|
||||
e+
|
||||
prompt+
|
||||
buttons+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
|
||||
if (!smoke.init){
|
||||
smoke.listen(window,"load", function(){
|
||||
smoke.finishbuild(e,f,box);
|
||||
});
|
||||
} else{
|
||||
smoke.finishbuild(e,f,box);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
finishbuild: function(e, f, box) {
|
||||
|
||||
var ff = document.getElementById('smoke-out-'+f.newid);
|
||||
|
||||
ff.className = 'smoke-base smoke-visible smoke-' + f.type;
|
||||
ff.innerHTML = box;
|
||||
|
||||
while (ff.innerHTML === ""){
|
||||
ff.innerHTML = box;
|
||||
}
|
||||
|
||||
// clear the timeout if it's already been activated
|
||||
if (smoke.smoketimeout[f.newid]){
|
||||
clearTimeout(smoke.smoketimeout[f.newid]);
|
||||
}
|
||||
|
||||
// close on background click
|
||||
// buberdds got rid of this for ie support?
|
||||
smoke.listen(
|
||||
document.getElementById('smoke-bg-'+f.newid),
|
||||
"click",
|
||||
function () {
|
||||
smoke.destroy(f.type, f.newid);
|
||||
if (f.type === 'prompt' || f.type === 'confirm'){
|
||||
f.callback(false);
|
||||
} else if (f.type === 'alert' && typeof f.callback !== 'undefined') {
|
||||
f.callback();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// listeners for button actions
|
||||
switch (f.type) {
|
||||
case 'alert':
|
||||
smoke.finishbuildAlert(e, f, box);
|
||||
break;
|
||||
case 'confirm':
|
||||
smoke.finishbuildConfirm(e, f, box);
|
||||
break;
|
||||
case 'prompt':
|
||||
smoke.finishbuildPrompt(e, f, box);
|
||||
break;
|
||||
case 'signal':
|
||||
smoke.finishbuildSignal(e, f, box);
|
||||
break;
|
||||
default:
|
||||
throw "Unknown type: " + f.type;
|
||||
}
|
||||
},
|
||||
|
||||
finishbuildAlert: function (e, f, box)
|
||||
{
|
||||
smoke.listen(
|
||||
document.getElementById('alert-ok-'+f.newid),
|
||||
"click",
|
||||
function () {
|
||||
smoke.destroy(f.type, f.newid);
|
||||
if (typeof f.callback !== 'undefined') {
|
||||
f.callback();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// listen for enter key or space, close it
|
||||
document.onkeyup = function (e) {
|
||||
if (!e) {
|
||||
e = window.event;
|
||||
}
|
||||
if (e.keyCode === 13 || e.keyCode === 32 || e.keyCode === 27){
|
||||
smoke.destroy(f.type, f.newid);
|
||||
if (typeof f.callback !== 'undefined') {
|
||||
f.callback();
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
finishbuildConfirm: function (e, f, box)
|
||||
{
|
||||
smoke.listen(
|
||||
document.getElementById('confirm-cancel-' + f.newid),
|
||||
"click",
|
||||
function ()
|
||||
{
|
||||
smoke.destroy(f.type, f.newid);
|
||||
f.callback(false);
|
||||
}
|
||||
);
|
||||
|
||||
smoke.listen(
|
||||
document.getElementById('confirm-ok-' + f.newid),
|
||||
"click",
|
||||
function ()
|
||||
{
|
||||
smoke.destroy(f.type, f.newid);
|
||||
f.callback(true);
|
||||
}
|
||||
);
|
||||
|
||||
// listen for enter key or space, close it & return true, esc will close with false
|
||||
document.onkeyup = function (e){
|
||||
if (!e) {
|
||||
e = window.event;
|
||||
}
|
||||
if (e.keyCode === 13 || e.keyCode === 32){
|
||||
smoke.destroy(f.type, f.newid);
|
||||
f.callback(true);
|
||||
} else if (e.keyCode === 27){
|
||||
smoke.destroy(f.type, f.newid);
|
||||
f.callback(false);
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
finishbuildPrompt: function (e, f, box)
|
||||
{
|
||||
var pi = document.getElementById('dialog-input-'+f.newid);
|
||||
|
||||
setTimeout(function () {
|
||||
pi.focus();
|
||||
pi.select();
|
||||
}, 100);
|
||||
|
||||
// events for cancel button
|
||||
smoke.listen(
|
||||
document.getElementById('prompt-cancel-'+f.newid),
|
||||
"click",
|
||||
function () {
|
||||
smoke.destroy(f.type, f.newid);
|
||||
f.callback(false);
|
||||
}
|
||||
);
|
||||
|
||||
// events for "ok" button
|
||||
smoke.listen(
|
||||
document.getElementById('prompt-ok-'+f.newid),
|
||||
"click",
|
||||
function () {
|
||||
smoke.destroy(f.type, f.newid);
|
||||
f.callback(pi.value);
|
||||
}
|
||||
);
|
||||
|
||||
// listen for enter
|
||||
document.onkeyup = function (e) {
|
||||
if (!e) {
|
||||
e = window.event;
|
||||
}
|
||||
|
||||
if (e.keyCode === 13){
|
||||
smoke.destroy(f.type, f.newid);
|
||||
f.callback(pi.value);
|
||||
} else if (e.keyCode === 27){
|
||||
smoke.destroy(f.type, f.newid);
|
||||
f.callback(false);
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
finishbuildSignal: function (e, f, box)
|
||||
{
|
||||
smoke.smoketimeout[f.newid] = setTimeout(function () {
|
||||
smoke.destroy(f.type, f.newid);
|
||||
}, f.timeout);
|
||||
},
|
||||
|
||||
|
||||
destroy: function (type,id) {
|
||||
var box = document.getElementById('smoke-out-'+id),
|
||||
okButton = document.getElementById(type+'-ok-'+id),
|
||||
cancelButton = document.getElementById(type+'-cancel-'+id);
|
||||
/* box.setAttribute('class','smoke-base'); */
|
||||
box.className = 'smoke-base';
|
||||
|
||||
|
||||
// confirm/alert/prompt remove click listener
|
||||
if (okButton){
|
||||
smoke.stoplistening(okButton, "click", function(){});
|
||||
document.onkeyup = null;
|
||||
}
|
||||
|
||||
// confirm/prompt remove click listener
|
||||
if (cancelButton){
|
||||
smoke.stoplistening(cancelButton, "click", function(){});
|
||||
}
|
||||
|
||||
smoke.i = 0;
|
||||
box.innerHTML = '';
|
||||
if ( box.parentNode ) {
|
||||
box.parentNode.removeChild( box );
|
||||
}
|
||||
},
|
||||
|
||||
alert: function (e, f, g) {
|
||||
if (typeof f !== 'object'){
|
||||
f = false;
|
||||
}
|
||||
|
||||
var id = smoke.newdialog();
|
||||
|
||||
smoke.build(e, {
|
||||
type: 'alert',
|
||||
callback: g,
|
||||
params: f,
|
||||
newid: id
|
||||
});
|
||||
},
|
||||
|
||||
signal: function (e, f) {
|
||||
if (typeof f === 'undefined'){
|
||||
f = 5000;
|
||||
}
|
||||
|
||||
var id = smoke.newdialog();
|
||||
smoke.build(e, {
|
||||
type: 'signal',
|
||||
timeout: f,
|
||||
params: false,
|
||||
newid: id
|
||||
});
|
||||
},
|
||||
|
||||
confirm: function (e, f, g) {
|
||||
if (typeof g !== 'object'){
|
||||
g = false;
|
||||
}
|
||||
|
||||
var id = smoke.newdialog();
|
||||
smoke.build(e, {
|
||||
type: 'confirm',
|
||||
callback: f,
|
||||
params: g,
|
||||
newid: id
|
||||
});
|
||||
},
|
||||
|
||||
prompt: function (e, f, g) {
|
||||
if (typeof g !== 'object'){
|
||||
g = false;
|
||||
}
|
||||
|
||||
var id = smoke.newdialog();
|
||||
return smoke.build(e,{type:'prompt',callback:f,params:g,newid:id});
|
||||
},
|
||||
|
||||
listen: function (e, f, g) {
|
||||
if (e.addEventListener) {
|
||||
return e.addEventListener(f, g, false);
|
||||
}
|
||||
|
||||
if (e.attachEvent){
|
||||
return e.attachEvent('on'+f, g);
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
stoplistening: function (e, f, g) {
|
||||
if (e.removeEventListener) {
|
||||
return e.removeEventListener("click", g, false);
|
||||
}
|
||||
|
||||
if (e.detachEvent){
|
||||
return e.detachEvent('on'+f, g);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
if (!smoke.init) {
|
||||
smoke.listen(window, "load", function () {
|
||||
smoke.init = true;
|
||||
});
|
||||
}
|
||||
1
modules/lib/smoke/smoke.min.js
vendored
Normal file
1
modules/lib/smoke/smoke.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('m 2={P:[],E:b,16:1n,i:0,R:6(7){m q=a.1x(\'o\');q.1y(\'7\',\'2-U-\'+7);q.S=\'2-T\';q.1A.1B=2.16;2.16++;a.1m.1F(q)},G:6(){m 3=1J 1M().1O();3=1Q.1R(1,1S)+3;5(!2.E){2.s(D,"15",6(){2.R(3)})}z{2.R(3)}v 3},1P:6(){},F:6(e,f){2.i++;f.1K=2.i;e=e.1k(/\\n/g,\'<19 />\');e=e.1k(/\\r/g,\'<19 />\');m k=\'\',c=\'1E\',j=\'1C\',I=\'\',w=\'\',9;5(f.4===\'k\'){k=\'<o A="C-k">\'+\'<Y 7="C-Y-\'+f.3+\'" 4="1z" \'+(f.h.J?\'J="\'+f.h.J+\'"\':\'\')+\' />\'+\'</o>\'}5(f.h.c){c=f.h.c}5(f.h.j){j=f.h.j}5(f.h.I){I=f.h.I}5(f.4!==\'M\'){w=\'<o A="C-w">\';5(f.4===\'x\'){w+=\'<p 7="x-c-\'+f.3+\'">\'+c+\'</p>\'}z 5(f.4===\'k\'||f.4===\'B\'){5(f.h.1t){w+=\'<p 7="\'+f.4+\'-c-\'+f.3+\'">\'+c+\'</p>\'+\'<p 7="\'+f.4+\'-j-\'+f.3+\'" A="j">\'+j+\'</p>\'}z{w+=\'<p 7="\'+f.4+\'-j-\'+f.3+\'" A="j">\'+j+\'</p>\'+\'<p 7="\'+f.4+\'-c-\'+f.3+\'">\'+c+\'</p>\'}}w+=\'</o>\'}9=\'<o 7="2-1b-\'+f.3+\'" A="1s"></o>\'+\'<o A="C 2 \'+I+\'">\'+\'<o A="C-1r">\'+e+k+w+\'</o>\'+\'</o>\';5(!2.E){2.s(D,"15",6(){2.Z(e,f,9)})}z{2.Z(e,f,9)}},Z:6(e,f,9){m q=a.l(\'2-U-\'+f.3);q.S=\'2-T 2-1q 2-\'+f.4;q.K=9;1p(q.K===""){q.K=9}5(2.P[f.3]){1D(2.P[f.3])}2.s(a.l(\'2-1b-\'+f.3),"t",6(){2.d(f.4,f.3);5(f.4===\'k\'||f.4===\'B\'){f.8(b)}z 5(f.4===\'x\'&&y f.8!==\'N\'){f.8()}});1o(f.4){O\'x\':2.1g(e,f,9);Q;O\'B\':2.1d(e,f,9);Q;O\'k\':2.1c(e,f,9);Q;O\'M\':2.1a(e,f,9);Q;1u:1v"1w 4: "+f.4;}},1g:6(e,f,9){2.s(a.l(\'x-c-\'+f.3),"t",6(){2.d(f.4,f.3);5(y f.8!==\'N\'){f.8()}});a.L=6(e){5(!e){e=D.W}5(e.u===13||e.u===17||e.u===V){2.d(f.4,f.3);5(y f.8!==\'N\'){f.8()}}}},1d:6(e,f,9){2.s(a.l(\'B-j-\'+f.3),"t",6(){2.d(f.4,f.3);f.8(b)});2.s(a.l(\'B-c-\'+f.3),"t",6(){2.d(f.4,f.3);f.8(X)});a.L=6(e){5(!e){e=D.W}5(e.u===13||e.u===17){2.d(f.4,f.3);f.8(X)}z 5(e.u===V){2.d(f.4,f.3);f.8(b)}}},1c:6(e,f,9){m H=a.l(\'C-Y-\'+f.3);1h(6(){H.1G();H.1H()},1I);2.s(a.l(\'k-j-\'+f.3),"t",6(){2.d(f.4,f.3);f.8(b)});2.s(a.l(\'k-c-\'+f.3),"t",6(){2.d(f.4,f.3);f.8(H.J)});a.L=6(e){5(!e){e=D.W}5(e.u===13){2.d(f.4,f.3);f.8(H.J)}z 5(e.u===V){2.d(f.4,f.3);f.8(b)}}},1a:6(e,f,9){2.P[f.3]=1h(6(){2.d(f.4,f.3)},f.1e)},d:6(4,7){m 9=a.l(\'2-U-\'+7),10=a.l(4+\'-c-\'+7),11=a.l(4+\'-j-\'+7);9.S=\'2-T\';5(10){2.12(10,"t",6(){});a.L=1L}5(11){2.12(11,"t",6(){})}2.i=0;9.K=\'\'},x:6(e,f,g){5(y f!==\'14\'){f=b}m 7=2.G();2.F(e,{4:\'x\',8:g,h:f,3:7})},M:6(e,f){5(y f===\'N\'){f=1N}m 7=2.G();2.F(e,{4:\'M\',1e:f,h:b,3:7})},B:6(e,f,g){5(y g!==\'14\'){g=b}m 7=2.G();2.F(e,{4:\'B\',8:f,h:g,3:7})},k:6(e,f,g){5(y g!==\'14\'){g=b}m 7=2.G();v 2.F(e,{4:\'k\',8:f,h:g,3:7})},s:6(e,f,g){5(e.1f){v e.1f(f,g,b)}5(e.1l){v e.1l(\'1j\'+f,g)}v b},12:6(e,f,g){5(e.1i){v e.1i("t",g,b)}5(e.18){v e.18(\'1j\'+f,g)}v b}};5(!2.E){2.s(D,"15",6(){2.E=X})}',62,117,'||smoke|newid|type|if|function|id|callback|box|document|false|ok|destroy||||params||cancel|prompt|getElementById|var||div|button|ff||listen|click|keyCode|return|buttons|alert|typeof|else|class|confirm|dialog|window|init|build|newdialog|pi|classname|value|innerHTML|onkeyup|signal|undefined|case|smoketimeout|break|bodyload|className|base|out|27|event|true|input|finishbuild|okButton|cancelButton|stoplistening||object|load|zindex|32|detachEvent|br|finishbuildSignal|bg|finishbuildPrompt|finishbuildConfirm|timeout|addEventListener|finishbuildAlert|setTimeout|removeEventListener|on|replace|attachEvent|body|1000|switch|while|visible|inner|smokebg|reverseButtons|default|throw|Unknown|createElement|setAttribute|text|style|zIndex|Cancel|clearTimeout|OK|appendChild|focus|select|100|new|stack|null|Date|5000|getTime|forceload|Math|random|99'.split('|'),0,{}))
|
||||
Reference in New Issue
Block a user