This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/assets/javascripts/orbitdesktopAPI.js

43 lines
1.1 KiB
JavaScript
Raw Normal View History

2012-03-28 10:53:30 +00:00
// 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;
};
var orbitDesktopAPI = function(){
o = this;
2012-03-29 11:50:23 +00:00
this.notify = function(msg,type,time){
var $notify = $("#orbitnote");
var img;
if(!type)type="";
switch(type){
case "alert":
img = "note_alert.png";
break;
case "imp":
img = "note_imp.png";
break;
case "success":
img = "note_success.png";
break;
default:
img = "note_alert.png";
break;
}
$notify.find("img#note_img").attr("src","/assets/"+img);
$notify.find(".note_message").text(msg);
if(!time)time=5000; else time=time*1000;
$notify.slideDown().delay(time).slideUp();
2012-03-28 10:53:30 +00:00
};
2012-03-29 11:50:23 +00:00
};
orbitDesktopAPI.prototype.notifyImgPath = "";