lot of changes in fetching
This commit is contained in:
parent
25ca29403c
commit
48323ac1af
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.currentface = "home";
|
||||||
this.desktopData = {"home":"","settings":"","work":"","favorite":"","apps_manager":"","sections":""};
|
this.desktopData = {"home":"","settings":"","work":"","favorite":"","apps_manager":"","sections":""};
|
||||||
this.tp = "";
|
this.tp = "";
|
||||||
|
this.sectionList;
|
||||||
this.initialize = function(){
|
this.initialize = function(){
|
||||||
var theme = o.theme;
|
var theme = o.theme;
|
||||||
$.getJSON("/desktop/get_desktop_settings",{id:o.desktopId},function(desktopSettings){
|
$.getJSON("/desktop/get_desktop_settings",{id:o.desktopId},function(desktopSettings){
|
||||||
|
@ -112,7 +113,7 @@ var orbitDesktop = function(dom){
|
||||||
$(".group").each(function(){groupWrapperWidth+=$(this).width();})
|
$(".group").each(function(){groupWrapperWidth+=$(this).width();})
|
||||||
groupWrapperWidth+=200;
|
groupWrapperWidth+=200;
|
||||||
groupWrapperHeight = $(".group").height() + 20;
|
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);
|
$("#group_wrapper").css("width",groupWrapperWidth);
|
||||||
|
|
||||||
$(".grp").sortable({
|
$(".grp").sortable({
|
||||||
|
@ -172,7 +173,7 @@ var orbitDesktop = function(dom){
|
||||||
var tilecolor = tilecolors[Math.floor(Math.random()*tilecolors.length)];
|
var tilecolor = tilecolors[Math.floor(Math.random()*tilecolors.length)];
|
||||||
var op = opacity[Math.floor(Math.random()*opacity.length)];
|
var op = opacity[Math.floor(Math.random()*opacity.length)];
|
||||||
if(tile.data_category == "app")
|
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
|
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>');
|
$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);
|
$group.find("ul").append($li);
|
||||||
|
@ -185,6 +186,7 @@ var orbitDesktop = function(dom){
|
||||||
}
|
}
|
||||||
var loadSectionList = function(){
|
var loadSectionList = function(){
|
||||||
$.getJSON("/desktop/getsectionlist",{desktopid:o.desktopId},function(sectionlist){
|
$.getJSON("/desktop/getsectionlist",{desktopid:o.desktopId},function(sectionlist){
|
||||||
|
o.sectionList = eval(sectionlist);
|
||||||
$.each(sectionlist,function(i,section){
|
$.each(sectionlist,function(i,section){
|
||||||
var tempstyle="";
|
var tempstyle="";
|
||||||
if(i==0){
|
if(i==0){
|
||||||
|
@ -266,9 +268,22 @@ var orbitDesktop = function(dom){
|
||||||
})
|
})
|
||||||
$('.tinycanvas').tinyscrollbar({ axis: 'x'});
|
$('.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]){
|
if(!o.desktopData[o.currentface]){
|
||||||
$(o.contentHolder).empty().load("/desktop/"+target,function(){
|
$(o.contentHolder).empty().load("/desktop/"+target,function(){
|
||||||
bindHandlers();
|
loadApps();
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
$(o.contentHolder).html(o.desktopData[o.currentface]);
|
$(o.contentHolder).html(o.desktopData[o.currentface]);
|
||||||
|
@ -313,17 +328,45 @@ var orbitDesktop = function(dom){
|
||||||
if( !$sdm.children('.sdm_o') ){
|
if( !$sdm.children('.sdm_o') ){
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
$sdm.hover(function(){
|
$sdm.hover(function(){$(this).addClass('thmc2');}, function(){$(this).removeClass('thmc2');});
|
||||||
$(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]){
|
if(!o.desktopData[o.currentface]){
|
||||||
$(o.contentHolder).empty().load("/desktop/"+target,function(){
|
$(o.contentHolder).empty().load("/desktop/"+target,function(){
|
||||||
bindHandlers();
|
loadApps();
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
$(o.contentHolder).html(o.desktopData[o.currentface]);
|
$(o.contentHolder).html(o.desktopData[o.currentface]);
|
||||||
|
@ -405,7 +448,7 @@ var orbitDesktop = function(dom){
|
||||||
|
|
||||||
$(o.contentHolder).empty().load("/desktop/"+target,function(){
|
$(o.contentHolder).empty().load("/desktop/"+target,function(){
|
||||||
bindHandlers();
|
bindHandlers();
|
||||||
sections();
|
themes();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
this.loadWallpaper = function(wallpaper){
|
this.loadWallpaper = function(wallpaper){
|
||||||
|
@ -447,6 +490,7 @@ orbitDesktop.prototype.themefolder = "themes";
|
||||||
orbitDesktop.prototype.widgetfolder = "desktop_widgets";
|
orbitDesktop.prototype.widgetfolder = "desktop_widgets";
|
||||||
orbitDesktop.prototype.desktopId = "1";
|
orbitDesktop.prototype.desktopId = "1";
|
||||||
orbitDesktop.prototype.notifyImgPath = "temp";
|
orbitDesktop.prototype.notifyImgPath = "temp";
|
||||||
|
orbitDesktop.prototype.iconPath = "/assets/icons/";
|
||||||
|
|
||||||
var uselessfunction = function(){
|
var uselessfunction = function(){
|
||||||
$.post("/desktop/temp_func",{sectionid:"4f83e7bbbd98eb041600001d"});
|
$.post("/desktop/temp_func",{sectionid:"4f83e7bbbd98eb041600001d"});
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
class DesktopController< ApplicationController
|
class DesktopController< ApplicationController
|
||||||
layout 'desktop'
|
layout 'desktop'
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
|
|
||||||
|
#to load pages...
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@desktop = current_user.desktop
|
@desktop = current_user.desktop
|
||||||
@section = @desktop.sections.first
|
@section = @desktop.sections.first
|
||||||
|
@ -18,6 +21,19 @@ class DesktopController< ApplicationController
|
||||||
def sections
|
def sections
|
||||||
render :layout => false
|
render :layout => false
|
||||||
end
|
end
|
||||||
|
def settings
|
||||||
|
render :layout => false
|
||||||
|
end
|
||||||
|
|
||||||
|
def settingthemes
|
||||||
|
render "desktop/settings/themes", :layout => false
|
||||||
|
end
|
||||||
|
|
||||||
|
def settingsections
|
||||||
|
render "desktop/settings/sections", :layout => false
|
||||||
|
end
|
||||||
|
|
||||||
|
#ajax data load....
|
||||||
|
|
||||||
def save_desktop_settings
|
def save_desktop_settings
|
||||||
@desktop = Desktop.find(params["id"])
|
@desktop = Desktop.find(params["id"])
|
||||||
|
@ -32,18 +48,6 @@ class DesktopController< ApplicationController
|
||||||
render :json => @desktop.to_json
|
render :json => @desktop.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
def settings
|
|
||||||
render :layout => false
|
|
||||||
end
|
|
||||||
|
|
||||||
def settingthemes
|
|
||||||
render "desktop/settings/themes", :layout => false
|
|
||||||
end
|
|
||||||
|
|
||||||
def settingsections
|
|
||||||
render "desktop/settings/sections", :layout => false
|
|
||||||
end
|
|
||||||
|
|
||||||
def getgroups
|
def getgroups
|
||||||
@section = Section.find(params["sectionid"])
|
@section = Section.find(params["sectionid"])
|
||||||
@groups = @section.groups
|
@groups = @section.groups
|
||||||
|
@ -76,4 +80,18 @@ class DesktopController< ApplicationController
|
||||||
b << {"success"=>"true"}
|
b << {"success"=>"true"}
|
||||||
render :json=>b.to_json
|
render :json=>b.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def getapplist
|
||||||
|
@desktop = Desktop.find(params["desktopid"])
|
||||||
|
@sections = @desktop.sections
|
||||||
|
a = Array.new
|
||||||
|
@sections.each do |section|
|
||||||
|
@groups = section.groups
|
||||||
|
@groups.each do |group|
|
||||||
|
@tiles = group.tiles.where(:data_category.all => ["app"])
|
||||||
|
a << @tiles
|
||||||
|
end
|
||||||
|
end
|
||||||
|
render :json=>a.to_json
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -19,8 +19,8 @@
|
||||||
<div id="group_wrapper" class="overview">
|
<div id="group_wrapper" class="overview">
|
||||||
|
|
||||||
<div class="group g_sep op03" id='seperator' style="height: 516px;display:none;"></div>
|
<div class="group g_sep op03" id='seperator' style="height: 516px;display:none;"></div>
|
||||||
<div class="group_search">
|
<div class="group_search" id="app_list">
|
||||||
<div class="element w1 h1 hp vp thmc2" data-category="desktop">
|
<!-- <div class="element w1 h1 hp vp thmc2" data-category="desktop">
|
||||||
<span class="tile thmc2"></span>
|
<span class="tile thmc2"></span>
|
||||||
<a href="" class="appicon"><img src="" alt=""></a>
|
<a href="" class="appicon"><img src="" alt=""></a>
|
||||||
<h1 class="appname thmtxt">社團記事</h1>
|
<h1 class="appname thmtxt">社團記事</h1>
|
||||||
|
@ -174,7 +174,7 @@
|
||||||
<span class="tile thmc2"></span>
|
<span class="tile thmc2"></span>
|
||||||
<a href="" class="appicon"><img src="" alt=""></a>
|
<a href="" class="appicon"><img src="" alt=""></a>
|
||||||
<h1 class="appname thmtxt">O-Music</h1>
|
<h1 class="appname thmtxt">O-Music</h1>
|
||||||
</div>
|
</div>-->
|
||||||
</div>
|
</div>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<div class="scrollbar sb_h"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
|
<div class="scrollbar sb_h"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
|
||||||
<div class="viewport">
|
<div class="viewport">
|
||||||
<div id="group_wrapper" class="overview">
|
<div id="group_wrapper" class="overview">
|
||||||
<div class="group">
|
<!-- <div class="group">
|
||||||
<div class="section_label" >
|
<div class="section_label" >
|
||||||
<ul>
|
<ul>
|
||||||
<li class="element w1 h1 hp vp thmtxt"><span class="tile thmc1"></span><span class="thmtxt">section 1</span></li>
|
<li class="element w1 h1 hp vp thmtxt"><span class="tile thmc1"></span><span class="thmtxt">section 1</span></li>
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
<li class="element w1 hh2 hp vp" data-category="abc">
|
<li class="element w1 hh2 hp vp" data-category="abc">
|
||||||
<h1 class="appname thmtxth">Garage Band</h1>
|
<h1 class="appname thmtxth">Garage Band</h1>
|
||||||
</li>
|
</li>
|
||||||
<li class="element w1 hh2 hp vp" data-category="abc">
|
<li class="element w1 hh2 hp vp" data-category="abc">
|
||||||
<h1 class="appname thmtxth">Garage Band</h1>
|
<h1 class="appname thmtxth">Garage Band</h1>
|
||||||
</li>
|
</li>
|
||||||
<li class="element w1 hh2 hp vp" data-category="abc">
|
<li class="element w1 hh2 hp vp" data-category="abc">
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
<li class="element w1 hh2 hp vp" data-category="abc">
|
<li class="element w1 hh2 hp vp" data-category="abc">
|
||||||
<h1 class="appname thmtxth">Garage Band</h1>
|
<h1 class="appname thmtxth">Garage Band</h1>
|
||||||
</li>
|
</li>
|
||||||
<li class="element w1 hh2 hp vp" data-category="abc">
|
<li class="element w1 hh2 hp vp" data-category="abc">
|
||||||
<h1 class="appname thmtxth">Garage Band</h1>
|
<h1 class="appname thmtxth">Garage Band</h1>
|
||||||
</li>
|
</li>
|
||||||
<li class="element w1 hh2 hp vp" data-category="abc">
|
<li class="element w1 hh2 hp vp" data-category="abc">
|
||||||
|
@ -123,7 +123,7 @@
|
||||||
<li class="element w1 hh2 hp vp" data-category="abc">
|
<li class="element w1 hh2 hp vp" data-category="abc">
|
||||||
<h1 class="appname thmtxth">Garage Band</h1>
|
<h1 class="appname thmtxth">Garage Band</h1>
|
||||||
</li>
|
</li>
|
||||||
<li class="element w1 hh2 hp vp" data-category="abc">
|
<li class="element w1 hh2 hp vp" data-category="abc">
|
||||||
<h1 class="appname thmtxth">Garage Band</h1>
|
<h1 class="appname thmtxth">Garage Band</h1>
|
||||||
</li>
|
</li>
|
||||||
<li class="element w1 hh2 hp vp" data-category="abc">
|
<li class="element w1 hh2 hp vp" data-category="abc">
|
||||||
|
@ -147,7 +147,7 @@
|
||||||
<li class="element w1 hh2 hp vp" data-category="abc">
|
<li class="element w1 hh2 hp vp" data-category="abc">
|
||||||
<h1 class="appname thmtxth">Garage Band</h1>
|
<h1 class="appname thmtxth">Garage Band</h1>
|
||||||
</li>
|
</li>
|
||||||
<li class="element w1 hh2 hp vp" data-category="abc">
|
<li class="element w1 hh2 hp vp" data-category="abc">
|
||||||
<h1 class="appname thmtxth">Garage Band</h1>
|
<h1 class="appname thmtxth">Garage Band</h1>
|
||||||
</li>
|
</li>
|
||||||
<li class="element w1 hh2 hp vp" data-category="abc">
|
<li class="element w1 hh2 hp vp" data-category="abc">
|
||||||
|
@ -167,7 +167,7 @@
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>-->
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Fucking section setting page...
|
section setting page...
|
|
@ -112,6 +112,7 @@ Orbit::Application.routes.draw do
|
||||||
match '/desktop/getsectionlist/'=>'desktop#getsectionlist'
|
match '/desktop/getsectionlist/'=>'desktop#getsectionlist'
|
||||||
match '/desktop/settingthemes/'=>'desktop#settingthemes'
|
match '/desktop/settingthemes/'=>'desktop#settingthemes'
|
||||||
match '/desktop/settingsections/'=>'desktop#settingsections'
|
match '/desktop/settingsections/'=>'desktop#settingsections'
|
||||||
|
match '/desktop/getapplist/'=>'desktop#getapplist'
|
||||||
match '/desktop/temp_func/'=>'desktop#temp_func'
|
match '/desktop/temp_func/'=>'desktop#temp_func'
|
||||||
|
|
||||||
match '/panel/:app_name/front_end/:app_action/:id' => 'pages#show_from_link', :constraints => lambda { |request|
|
match '/panel/:app_name/front_end/:app_action/:id' => 'pages#show_from_link', :constraints => lambda { |request|
|
||||||
|
|
Reference in New Issue