// Compiled by ClojureScript 0.0-2138
goog.provide('lt.objs.notifos');
goog.require('cljs.core');
goog.require('lt.util.js');
goog.require('crate.binding');
goog.require('crate.binding');
goog.require('lt.util.js');
goog.require('lt.objs.command');
goog.require('lt.objs.command');
goog.require('lt.objs.statusbar');
goog.require('lt.objs.statusbar');
goog.require('lt.object');
goog.require('lt.object');
lt.objs.notifos.standard_timeout = 10000;
/**
* @param {...*} var_args
*/
lt.objs.notifos.msg_STAR_ = (function() { 
var msg_STAR___delegate = function (m,p__7687){var vec__7689 = p__7687;var opts = cljs.core.nth.call(null,vec__7689,0,null);var m__$1 = ((typeof m === 'string')?m:cljs.core.pr_str.call(null,m));return lt.object.merge_BANG_.call(null,lt.objs.statusbar.statusbar_loader,cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"message","message",1968829305),m__$1,new cljs.core.Keyword(null,"class","class",1108647146),""], null),opts));
};
var msg_STAR_ = function (m,var_args){
var p__7687 = null;if (arguments.length > 1) {
  p__7687 = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1),0);} 
return msg_STAR___delegate.call(this,m,p__7687);};
msg_STAR_.cljs$lang$maxFixedArity = 1;
msg_STAR_.cljs$lang$applyTo = (function (arglist__7690){
var m = cljs.core.first(arglist__7690);
var p__7687 = cljs.core.rest(arglist__7690);
return msg_STAR___delegate(m,p__7687);
});
msg_STAR_.cljs$core$IFn$_invoke$arity$variadic = msg_STAR___delegate;
return msg_STAR_;
})()
;
/**
* Display message in bottom statusbar. Takes map of options with following keys:
* 
* * :class - css class for message. Use 'error' to display error message
* * :timeout - Number of ms before message times out. Default is 10000 (10s)
*/
lt.objs.notifos.set_msg_BANG_ = (function() {
var set_msg_BANG_ = null;
var set_msg_BANG___1 = (function (msg){lt.objs.notifos.msg_STAR_.call(null,msg);
clearTimeout(lt.objs.notifos.cur_timeout);
return lt.objs.notifos.cur_timeout = lt.util.js.wait.call(null,lt.objs.notifos.standard_timeout,(function (){return lt.objs.notifos.msg_STAR_.call(null,"");
}));
});
var set_msg_BANG___2 = (function (msg,opts){lt.objs.notifos.msg_STAR_.call(null,msg,opts);
clearTimeout(lt.objs.notifos.cur_timeout);
return lt.objs.notifos.cur_timeout = lt.util.js.wait.call(null,(function (){var or__3520__auto__ = new cljs.core.Keyword(null,"timeout","timeout",3994960083).cljs$core$IFn$_invoke$arity$1(opts);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return lt.objs.notifos.standard_timeout;
}
})(),(function (){return lt.objs.notifos.msg_STAR_.call(null,"");
}));
});
set_msg_BANG_ = function(msg,opts){
switch(arguments.length){
case 1:
return set_msg_BANG___1.call(this,msg);
case 2:
return set_msg_BANG___2.call(this,msg,opts);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
set_msg_BANG_.cljs$core$IFn$_invoke$arity$1 = set_msg_BANG___1;
set_msg_BANG_.cljs$core$IFn$_invoke$arity$2 = set_msg_BANG___2;
return set_msg_BANG_;
})()
;
/**
* Display working spinner with optional statusbar message
*/
lt.objs.notifos.working = (function() {
var working = null;
var working__0 = (function (){return working.call(null,null);
});
var working__1 = (function (msg){if(cljs.core.truth_(msg))
{lt.objs.notifos.set_msg_BANG_.call(null,msg);
} else
{}
return lt.objs.statusbar.loader_inc.call(null);
});
working = function(msg){
switch(arguments.length){
case 0:
return working__0.call(this);
case 1:
return working__1.call(this,msg);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
working.cljs$core$IFn$_invoke$arity$0 = working__0;
working.cljs$core$IFn$_invoke$arity$1 = working__1;
return working;
})()
;
/**
* Hide working spinner with optional statusbar message
*/
lt.objs.notifos.done_working = (function() {
var done_working = null;
var done_working__0 = (function (){return lt.objs.statusbar.loader_dec.call(null);
});
var done_working__1 = (function (msg){lt.objs.notifos.set_msg_BANG_.call(null,msg);
return lt.objs.statusbar.loader_dec.call(null);
});
done_working = function(msg){
switch(arguments.length){
case 0:
return done_working__0.call(this);
case 1:
return done_working__1.call(this,msg);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
done_working.cljs$core$IFn$_invoke$arity$0 = done_working__0;
done_working.cljs$core$IFn$_invoke$arity$1 = done_working__1;
return done_working;
})()
;
lt.objs.command.command.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"command","command",1964298941),new cljs.core.Keyword(null,"reset-working","reset-working",2350080037),new cljs.core.Keyword(null,"desc","desc",1016984067),"Status Bar: Reset working indicator",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){return lt.objs.statusbar.loader_set.call(null);
})], null));
