lot of changes in fetching
This commit is contained in:
1 parent
25ca29403c
commit
48323ac1af
8 files changed
+96
-33
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 900 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -12,6 +12,7 @@ var orbitDesktop = function(dom){
|
||||
this.currentface = "home";
|
||||
this.desktopData = {"home":"","settings":"","work":"","favorite":"","apps_manager":"","sections":""};
|
||||
this.tp = "";
|
||||
this.sectionList;
|
||||
this.initialize = function(){
|
||||
var theme = o.theme;
|
||||
$.getJSON("/desktop/get_desktop_settings",{id:o.desktopId},function(desktopSettings){
|
||||
@@ -112,7 +113,7 @@ var orbitDesktop = function(dom){
|
||||
$(".group").each(function(){groupWrapperWidth+=$(this).width();})
|
||||
groupWrapperWidth+=200;
|
||||
groupWrapperHeight = $(".group").height() + 20;
|
||||
groupWrapperHeight = (groupWrapperHeight > ($(window).height()-extraspace))? $(window).height()-extraspace:groupWrapperHeight;
|
||||
// groupWrapperHeight = (groupWrapperHeight > ($(window).height()-extraspace))? $(window).height()-extraspace:groupWrapperHeight;
|
||||
$("#group_wrapper").css("width",groupWrapperWidth);
|
||||
|
||||
$(".grp").sortable({
|
||||
@@ -172,7 +173,7 @@ var orbitDesktop = function(dom){
|
||||
var tilecolor = tilecolors[Math.floor(Math.random()*tilecolors.length)];
|
||||
var op = opacity[Math.floor(Math.random()*opacity.length)];
|
||||
if(tile.data_category == "app")
|
||||
$li = $('<li class="element '+tile.shape+' hp vp" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'"><span class="tile '+tilecolor+' '+op+'"></span><a href="" class="appicon"><img src="" alt=""></a><h1 class="appname thmtxt">'+tile.title+'</h1></li>');
|
||||
$li = $('<li class="element '+tile.shape+' hp vp" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'"><span class="tile '+tilecolor+' '+op+'"></span><a href="'+tile._id+'" class="appicon"><img src="'+o.iconPath+tile.data_content+'.png" alt="" onclick="return false;" ></a><h1 class="appname thmtxt">'+tile.title+'</h1></li>');
|
||||
else
|
||||
$li = $('<li class="element '+tile.shape+' hp vp" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'"><span class="tile '+tilecolor+' '+op+'"></span><h1 class="appname thmtxt">'+tile.title+'</h1><div class="appholder">test content</div></li>');
|
||||
$group.find("ul").append($li);
|
||||
@@ -185,6 +186,7 @@ var orbitDesktop = function(dom){
|
||||
}
|
||||
var loadSectionList = function(){
|
||||
$.getJSON("/desktop/getsectionlist",{desktopid:o.desktopId},function(sectionlist){
|
||||
o.sectionList = eval(sectionlist);
|
||||
$.each(sectionlist,function(i,section){
|
||||
var tempstyle="";
|
||||
if(i==0){
|
||||
@@ -266,9 +268,22 @@ var orbitDesktop = function(dom){
|
||||
})
|
||||
$('.tinycanvas').tinyscrollbar({ axis: 'x'});
|
||||
}
|
||||
var loadApps = function(){
|
||||
$.getJSON("/desktop/getapplist",{desktopid:o.desktopId},function(appss){
|
||||
$.each(appss,function(i,apps){
|
||||
$.each(apps,function(i,app){
|
||||
var $div;
|
||||
$div = $('<div class="element w1 h1 hp vp thmc2" data-category="'+app.data_category+'" data-content="'+app.data_content+'"><span class="tile thmc2"></span><a href="'+app._id+'" class="appicon"><img src="'+o.iconPath+app.data_content+'.png" alt="" onclick="return false;"></a><h1 class="appname thmtxt">'+app.title+'</h1></div>');
|
||||
$("#app_list").append($div);
|
||||
})
|
||||
})
|
||||
|
||||
bindHandlers();
|
||||
})
|
||||
}
|
||||
if(!o.desktopData[o.currentface]){
|
||||
$(o.contentHolder).empty().load("/desktop/"+target,function(){
|
||||
bindHandlers();
|
||||
loadApps();
|
||||
});
|
||||
}else{
|
||||
$(o.contentHolder).html(o.desktopData[o.currentface]);
|
||||
@@ -313,17 +328,45 @@ var orbitDesktop = function(dom){
|
||||
if( !$sdm.children('.sdm_o') ){
|
||||
return;
|
||||
} else {
|
||||
$sdm.hover(function(){
|
||||
$(this).addClass('thmc2');
|
||||
}, function(){
|
||||
$(this).removeClass('thmc2');
|
||||
});
|
||||
$sdm.hover(function(){$(this).addClass('thmc2');}, function(){$(this).removeClass('thmc2');});
|
||||
}
|
||||
};
|
||||
|
||||
var loadApps = function(){
|
||||
$.getJSON("/desktop/getapplist",{desktopid:o.desktopId},function(appss){
|
||||
var $group,$lii,$li;
|
||||
var z=0;
|
||||
for(section in o.sectionList){
|
||||
$group = $('<div class="group"><div class="section_label"><ul class="section_grp"></ul></div><ul class="grp" id="section'+(z+1)+'"></ul></div>');
|
||||
for(x=0;x<4;x++){
|
||||
if(x==0){
|
||||
$li = $('<li class="element w1 h1 hp vp thmtxt"><span class="tile thmc1"></span><span class="thmtxt">'+o.sectionList[z].name+'</span></li>');
|
||||
$group.find("ul.section_grp").append($li);
|
||||
}
|
||||
if(z!=x){
|
||||
$lii = $('<li class="element w1 h1 hp vp thmtxt" style="display: none;" data-category="section'+(x+1)+'"><span class="tile thmc2 op06"></span><span class="thmtxt">'+o.sectionList[x].name+'</span></li>');
|
||||
$group.find("ul.section_grp").append($lii);
|
||||
}
|
||||
}
|
||||
z++;
|
||||
$("div#group_wrapper").append($group);
|
||||
}
|
||||
$.each(appss,function(i,apps){
|
||||
var y=0;
|
||||
$.each(apps,function(i,app){
|
||||
var $div;
|
||||
$div = $('<div class="element w1 h1 hp vp thmc2" data-category="'+app.data_category+'" data-content="'+app.data_content+'"><span class="tile thmc2"></span><a href="'+app._id+'" class="appicon"><img src="'+o.iconPath+app.data_content+'.png" alt="" onclick="return false;"></a><h1 class="appname thmtxt">'+app.title+'</h1></div>');
|
||||
$("#app_list").append($div);
|
||||
})
|
||||
y++;
|
||||
})
|
||||
|
||||
|
||||
bindHandlers();
|
||||
})
|
||||
}
|
||||
if(!o.desktopData[o.currentface]){
|
||||
$(o.contentHolder).empty().load("/desktop/"+target,function(){
|
||||
bindHandlers();
|
||||
loadApps();
|
||||
});
|
||||
}else{
|
||||
$(o.contentHolder).html(o.desktopData[o.currentface]);
|
||||
@@ -405,7 +448,7 @@ var orbitDesktop = function(dom){
|
||||
|
||||
$(o.contentHolder).empty().load("/desktop/"+target,function(){
|
||||
bindHandlers();
|
||||
sections();
|
||||
themes();
|
||||
});
|
||||
};
|
||||
this.loadWallpaper = function(wallpaper){
|
||||
@@ -447,6 +490,7 @@ orbitDesktop.prototype.themefolder = "themes";
|
||||
orbitDesktop.prototype.widgetfolder = "desktop_widgets";
|
||||
orbitDesktop.prototype.desktopId = "1";
|
||||
orbitDesktop.prototype.notifyImgPath = "temp";
|
||||
orbitDesktop.prototype.iconPath = "/assets/icons/";
|
||||
|
||||
var uselessfunction = function(){
|
||||
$.post("/desktop/temp_func",{sectionid:"4f83e7bbbd98eb041600001d"});
|
||||
|
||||
Reference in new issue
Block a user