Msg box added and background image saving complete

This commit is contained in:
Harry Bomrah committed 2012-04-18 22:01:12 +08:00
1 parent b4bf81d40a
commit 4bad25e682
6 files changed
+117 -55

No files matched your search

+32 -14
View File
@@ -1,18 +1,5 @@
// JavaScript Document
$.extend($.expr[':'], {
'containsi': function (elem, i, match, array) {
return (elem.textContent || elem.innerText || '').toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0;
}
});
$.fn.sort = function(c) {
return this.pushStack([].sort.apply(this, arguments), []);
};
var sortAscending = function(a, b) {
return $(a).find("h1").text() > $(b).find("h1").text() ? 1 : -1;
};
var sortDescending = function(a, b) {
return $(a).find("h1").text() < $(b).find("h1").text() ? 1 : -1;
};
//Harry Bomrah
var orbitDesktopAPI = function(){
o = this;
this.notify = function(msg,type,time){
@@ -63,4 +50,35 @@ var orbitDesktopAPI = function(){
}
return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
};
this.changeWallpaper = function(wallpaper){
$("img#thmbackground").attr("src",o.wallpaperPath+wallpaper);
o.saveWallpaper(wallpaper);
};
this.confirm = function(msg,btnvalues,highlighted,callbackfn){
if(!btnvalues)btnvalues=["Ok","Cancel"];
if(highlighted!=1 || highlighted!=2)highlighted=2;
if(!msg)msg = "Are you sure?"
var $confirm = $("#orbitdiag");
$confirm.find(".diag_action a").addClass("admbg admtxt");
$confirm.find(".diag_message").text(msg);
if(highlighted == 1)
$confirm.find("#diag_confirm").removeClass("admbg admtxt").addClass("thmc1 thmtxt");
if(highlighted == 2)
$confirm.find("#diag_cancel").removeClass("admbg admtxt").addClass("thmc1 thmtxt");
$confirm.find("#diag_confirm").text(btnvalues[0]).one("click",function(){
$confirm.hide();
$confirm.find(".diag_action a").unbind();
if(typeof callbackfn=="function")
callbackfn.call(this,true);
});
$confirm.find("#diag_cancel").text(btnvalues[1]).one("click",function(){
$confirm.hide();
$confirm.find(".diag_action a").unbind();
if(typeof callbackfn=="function")
callbackfn.call(this,false);
});
$confirm.show();
}
};
orbitDesktopAPI.prototype.notifyImgPath = "temp";
orbitDesktopAPI.prototype.wallpaperPath = "temp";