new desktop framework updates

This commit is contained in:
harrybomrah committed 2012-12-27 18:25:54 +08:00
1 parent ad8273d638
commit 37f8c1637a
12 files changed
+180 -256

No files matched your search

+42 -67
View File
@@ -7,6 +7,9 @@
//load = true is used to load the list element by default
//response-type = "json"|"script"|"xml|html" default is json
//autocomplete-list = "listname" an array from which autocomplete will be attached to its respective input or textarea
//ajax-remote="get/delete/post" this will automatically bind the <a> with remote ajax call. By default if the resposne is html, it ll be inserted in container=true
// content-holder = "jquery dom", the returned html of server will be put inside the dom mentioned in content-holder of a tag. this can be used in a tags as attributes
//confirm-message ="Some message", this will prompt user with a confirm box and show the message before ajax call is made.
$.extend($.expr[':'], {
@@ -147,6 +150,42 @@ var orbitDesktop = function(dom){
return false;
})
$("body").on("click","*[ajax-remote]",function(){
var $e = $(this);
var exe = $e.attr("callback-method"); // (typeof $e.attr("callback-method") == "function"? $e.attr("callback-method") : "");
var ca = $e.attr("content-holder");
var a = function(){
$.ajax({
type : $e.attr("ajax-remote"),
url : $e.attr("href"),
success : function(data){
if(typeof data == "string"){
if(ca)
$(ca).html(data);
else
$("div[container=true]").html(data);
}
if(exe)
window.o[o.data_method][exe](data,$e);
}
});
}
if($e.attr("confirm-message")){
o.confirm({
buttons : ["Yes","No"],
highlighted : 2,
message : $e.attr("confirm-message")
},function(value){
if(value){
a();
}
})
}else{
a();
}
return false;
})
$(window).resize(function(){
var ww = $(window).width();
$("img#thmbackground").attr({"width":ww});
@@ -177,6 +216,7 @@ var orbitDesktop = function(dom){
var extractLast = function( term ) {
return split( term ).pop();
}
var autocompleteListName = null;
$("body").on("keydown","*[autocomplete-list]", function( event ) {
autocompleteListName = $(this).attr("autocomplete-list");
@@ -1064,73 +1104,8 @@ var orbitDesktop = function(dom){
this.initializeAppstore.onlinestore();
bindHandlers();
}
this.initializeBooks = function(target,url,cache){
this.initializeBooks.list = function(){
var bindHandlers = function(){
o.simple_drop_down();
o.tinyscrollbar_ext({
main: '.tinycanvas',
fill: '.list_t'
})
}
bindHandlers();
}
this.initializeBooks.addbook = function(){
var bindHandlers = function(){
o.simple_drop_down();
o.tinyscrollbar_ext({
main: '.tinycanvas',
fill: '.s_grid_con'
})
}
bindHandlers();
}
this.initializeBooks.list();
}
this.initializeSeminar = function(target,url,cache){
this.initializeSeminar.list = function(){
var bindHandlers = function(){
o.tinyscrollbar_ext({
main : ".tinycanvas",
fill : ".list_t"
})
}
bindHandlers();
}
this.initializeSeminar.addseminar = function(){
var bindHandlers = function(){
o.simple_drop_down();
o.tinyscrollbar_ext({
main: '.tinycanvas',
fill: '.s_grid_con'
})
}
bindHandlers();
}
this.initializeSeminar.list();
}
this.initializeResearchDomain = function(target,url,cache){
this.initializeResearchDomain.list = function(){