Dock change and getting values from db
This commit is contained in:
1 parent
b2c9229099
commit
7309d9c446
145 files changed
+218
-55
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
@@ -10,5 +10,4 @@
|
||||
//= require jquery.tinyscrollbar.min
|
||||
//= require bootstrap
|
||||
//= require orbitdesktopAPI
|
||||
//= require orbitdesktop
|
||||
//= require desktopload
|
||||
//= require orbitdesktop
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
orbitDesktop.prototype.themefolder = "desktop_themes";
|
||||
orbitDesktopAPI.prototype.notifyImgPath = "/assets/";
|
||||
alert("<%= @desktop.inspect %>")
|
||||
var od = new orbitDesktop("#ajax_container");
|
||||
|
||||
@@ -13,7 +13,13 @@ var orbitDesktop = function(dom){
|
||||
this.desktopData = {"home":"","fun":"","work":"","favorite":"","apps_manager":"","sections":""};
|
||||
this.tp = "";
|
||||
this.initialize = function(){
|
||||
var theme = o.theme;
|
||||
var theme = o.theme;
|
||||
$.getJSON("/desktop/get_desktop_settings",{id:o.desktopId},function(desktopSettings){
|
||||
if(desktopSettings){
|
||||
theme = desktopSettings.theme
|
||||
}
|
||||
})
|
||||
|
||||
$.getJSON("/"+o.themefolder+"/"+theme+"/settings/"+theme+".json",function(ts){
|
||||
o.themesettings = eval(ts);
|
||||
$('head').append( $('<link rel="stylesheet" id="dyn_css" type="text/css" />').attr('href', "/"+o.themefolder+"/"+theme+"/css/"+ts.css));
|
||||
@@ -75,6 +81,15 @@ var orbitDesktop = function(dom){
|
||||
$("#holder").animate({scrollLeft:0},1000);
|
||||
}*/
|
||||
});
|
||||
var $widget_fn = $('.widget_fn'),$fn_des = $('.fn_des');
|
||||
$widget_fn.hover(function(){
|
||||
var fn_name = $(this).find('img').attr('alt'),nth = $(this).parents('.d_cate').index(),des_left = $('.dock_child').eq(nth).width();
|
||||
$(this).addClass('thmc1');
|
||||
$fn_des.text(fn_name).css({'top':nth * 60,'left': des_left + 60}).stop(true, true).fadeIn();
|
||||
},function(){
|
||||
$(this).removeClass('thmc1');
|
||||
$fn_des.stop(true, true).fadeOut();
|
||||
});
|
||||
};
|
||||
this.initializeDesktop = function(target){
|
||||
if(!target)target = "desktop";
|
||||
@@ -134,7 +149,10 @@ var orbitDesktop = function(dom){
|
||||
}
|
||||
};
|
||||
this.tempFunc = function(){
|
||||
o.notify("This is test notification!!","alert",2)
|
||||
//o.notify("This is test notification!!","alert",2)
|
||||
$.post("/desktop/save_desktop_settings",{"theme":$("#change_theme").val()},function(){
|
||||
o.notify("Settings Saved!!","success");
|
||||
})
|
||||
}
|
||||
this.initializeAppSearch = function(target){
|
||||
o.currenthtml = target;
|
||||
@@ -239,43 +257,18 @@ var orbitDesktop = function(dom){
|
||||
$("div#bgover").css({"position":"fixed","top":"0px","left":"0px","z-index":"-1","width":ww,"height":wh});
|
||||
};
|
||||
this.loadIconCache = function(){
|
||||
$("#home_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.home);
|
||||
$("#app_manager_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.app_manager);
|
||||
$("#sections_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.sections);
|
||||
$("#settings_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.settings);
|
||||
$("#publication_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.publication);
|
||||
$("#journal_p_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.journal_p);
|
||||
$("#seminar_p_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.seminar_p);
|
||||
$("#books_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.books);
|
||||
$("#research_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.research);
|
||||
$("#research_d_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.research_d);
|
||||
$("#research_p_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.research_p);
|
||||
$("#patents_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.patents);
|
||||
$("#labs_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.labs);
|
||||
$("#experience_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.experience);
|
||||
$("#working_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.working);
|
||||
$("#education_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.education);
|
||||
$("#honors_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.honors);
|
||||
$("#activities_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.activities);
|
||||
$("#clubs_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.clubs);
|
||||
$("#landt_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.landt);
|
||||
$("#courses_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.courses);
|
||||
$("#homework_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.homework);
|
||||
$("#certification_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.certification);
|
||||
$("#personal_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.personal);
|
||||
$("#mypage_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.mypage);
|
||||
$("#blog_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.blog);
|
||||
$("#album_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.album);
|
||||
$("#calendar_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.calendar);
|
||||
$("#files_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.files);
|
||||
$("#orbit_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.orbit);
|
||||
$("#connection_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.connection);
|
||||
$("#appstore_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.appstore);
|
||||
var imgs = $("ul.docklist img");
|
||||
$.each(imgs,function(){
|
||||
var setting_name = $(this).attr("id").replace("_icon","");
|
||||
$(this).attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons[setting_name])
|
||||
})
|
||||
}
|
||||
o.initialize();
|
||||
}
|
||||
|
||||
orbitDesktop.prototype.themefolder = "themes";
|
||||
orbitDesktop.prototype.desktopId = "1";
|
||||
orbitDesktop.prototype.notifyImgPath = "temp";
|
||||
|
||||
// devin
|
||||
(function(){
|
||||
@@ -307,4 +300,4 @@ orbitDesktop.prototype.themefolder = "themes";
|
||||
});
|
||||
|
||||
|
||||
}());
|
||||
}());
|
||||
@@ -33,11 +33,9 @@ var orbitDesktopAPI = function(){
|
||||
img = "note_alert.png";
|
||||
break;
|
||||
}
|
||||
$notify.find("img#note_img").attr("src","/assets/"+img);
|
||||
$notify.find("img#note_img").attr("src",o.notifyImgPath+img);
|
||||
$notify.find(".note_message").text(msg);
|
||||
if(!time)time=5000; else time=time*1000;
|
||||
$notify.slideDown().delay(time).slideUp();
|
||||
};
|
||||
};
|
||||
|
||||
orbitDesktopAPI.prototype.notifyImgPath = "";
|
||||
};
|
||||
@@ -2,10 +2,11 @@ class DesktopController< ApplicationController
|
||||
layout 'desktop'
|
||||
before_filter :authenticate_user!
|
||||
def index
|
||||
|
||||
@desktop = current_user.desktop
|
||||
end
|
||||
|
||||
def desktop
|
||||
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
@@ -17,11 +18,15 @@ class DesktopController< ApplicationController
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def save_desktop_theme
|
||||
|
||||
def save_desktop_settings
|
||||
Desktop.update_attributes(:theme => params["theme"])
|
||||
a = Array.new
|
||||
a << {"success"=>"true"}
|
||||
render :json=>a.to_json
|
||||
end
|
||||
|
||||
def get_desktop_theme
|
||||
|
||||
def get_desktop_settings
|
||||
@desktop = Desktop.find(params["id"])
|
||||
render :json => @desktop.to_json
|
||||
end
|
||||
end
|
||||
@@ -10,7 +10,10 @@ class Desktop
|
||||
before_create :initialize_section
|
||||
|
||||
def initialize_section
|
||||
user.self.build_section
|
||||
self.sections.build(name: "Desktop 1")
|
||||
self.sections.build(name: "Desktop 2")
|
||||
self.sections.build(name: "Desktop 3")
|
||||
self.sections.build(name: "Desktop 4")
|
||||
end
|
||||
|
||||
end
|
||||
+2
-1
@@ -7,7 +7,8 @@ class Group
|
||||
before_create :initialize_tile
|
||||
|
||||
def initialize_tile
|
||||
self.build_tile
|
||||
self.tiles.build
|
||||
self.tiles.build
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@ class Section
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
field :name, default: "Section"
|
||||
field :name
|
||||
|
||||
belongs_to :desktop
|
||||
has_many :groups, :autosave => true, :dependent => :destroy
|
||||
@@ -10,7 +10,8 @@ class Section
|
||||
before_create :initialize_group
|
||||
|
||||
def initialize_group
|
||||
self.build_group
|
||||
self.groups.build
|
||||
self.groups.build
|
||||
end
|
||||
|
||||
end
|
||||
@@ -80,4 +80,12 @@ Change Theme: <select id="change_theme">
|
||||
<div class="note_message">Check the Notifications section for more information.</div>
|
||||
</div>
|
||||
</div>
|
||||
<button onClick="od.tempFunc();">Click</button>
|
||||
<button onClick="od.tempFunc();">Click</button>
|
||||
|
||||
<script>
|
||||
orbitDesktop.prototype.themefolder = "desktop_themes";
|
||||
orbitDesktop.prototype.notifyImgPath = "/assets/";
|
||||
orbitDesktop.prototype.desktopId = "<%= @desktop.id %>";
|
||||
var od = new orbitDesktop("#ajax_container");
|
||||
o.notify("Fuck yeah!! Notification Working!!","imp",5)
|
||||
</script>
|
||||
Reference in new issue
Block a user