Dock change and getting values from db

This commit is contained in:
Harry Bomrah 2012-04-05 20:32:56 +08:00
parent a0d5e847e0
commit 20bfd0d984
145 changed files with 217 additions and 85 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -11,4 +11,3 @@
//= require bootstrap //= require bootstrap
//= require orbitdesktopAPI //= require orbitdesktopAPI
//= require orbitdesktop //= require orbitdesktop
//= require desktopload

View File

@ -1,5 +1,6 @@
orbitDesktop.prototype.themefolder = "desktop_themes"; orbitDesktop.prototype.themefolder = "desktop_themes";
orbitDesktopAPI.prototype.notifyImgPath = "/assets/"; orbitDesktopAPI.prototype.notifyImgPath = "/assets/";
alert("<%= @desktop.inspect %>")
var od = new orbitDesktop("#ajax_container"); var od = new orbitDesktop("#ajax_container");

View File

@ -14,6 +14,12 @@ var orbitDesktop = function(dom){
this.tp = ""; this.tp = "";
this.initialize = function(){ 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){ $.getJSON("/"+o.themefolder+"/"+theme+"/settings/"+theme+".json",function(ts){
o.themesettings = eval(ts); o.themesettings = eval(ts);
$('head').append( $('<link rel="stylesheet" id="dyn_css" type="text/css" />').attr('href', "/"+o.themefolder+"/"+theme+"/css/"+ts.css)); $('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); $("#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){ this.initializeDesktop = function(target){
if(!target)target = "desktop"; if(!target)target = "desktop";
@ -134,7 +149,10 @@ var orbitDesktop = function(dom){
} }
}; };
this.tempFunc = function(){ 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){ this.initializeAppSearch = function(target){
o.currenthtml = target; o.currenthtml = target;
@ -239,72 +257,16 @@ var orbitDesktop = function(dom){
$("div#bgover").css({"position":"fixed","top":"0px","left":"0px","z-index":"-1","width":ww,"height":wh}); $("div#bgover").css({"position":"fixed","top":"0px","left":"0px","z-index":"-1","width":ww,"height":wh});
}; };
this.loadIconCache = function(){ this.loadIconCache = function(){
$("#home_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.home); var imgs = $("ul.docklist img");
$("#app_manager_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.app_manager); $.each(imgs,function(){
$("#sections_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.sections); var setting_name = $(this).attr("id").replace("_icon","");
$("#settings_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.settings); $(this).attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons[setting_name])
$("#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);
} }
o.initialize(); o.initialize();
} }
orbitDesktop.prototype.themefolder = "themes"; orbitDesktop.prototype.themefolder = "themes";
orbitDesktop.prototype.desktopId = "1";
orbitDesktop.prototype.notifyImgPath = "temp";
// devin
(function(){
$(document).ready(function(){
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();
});
});
}());

View File

@ -33,11 +33,9 @@ var orbitDesktopAPI = function(){
img = "note_alert.png"; img = "note_alert.png";
break; 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); $notify.find(".note_message").text(msg);
if(!time)time=5000; else time=time*1000; if(!time)time=5000; else time=time*1000;
$notify.slideDown().delay(time).slideUp(); $notify.slideDown().delay(time).slideUp();
}; };
}; };
orbitDesktopAPI.prototype.notifyImgPath = "";

View File

@ -2,10 +2,11 @@ class DesktopController< ApplicationController
layout 'desktop' layout 'desktop'
before_filter :authenticate_user! before_filter :authenticate_user!
def index def index
@desktop = current_user.desktop
end end
def desktop def desktop
render :layout => false render :layout => false
end end
@ -17,11 +18,15 @@ class DesktopController< ApplicationController
render :layout => false render :layout => false
end 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 end
def get_desktop_theme def get_desktop_settings
@desktop = Desktop.find(params["id"])
render :json => @desktop.to_json
end end
end end

View File

@ -10,7 +10,10 @@ class Desktop
before_create :initialize_section before_create :initialize_section
def 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
end end

View File

@ -7,7 +7,8 @@ class Group
before_create :initialize_tile before_create :initialize_tile
def initialize_tile def initialize_tile
self.build_tile self.tiles.build
self.tiles.build
end end
end end

View File

@ -2,7 +2,7 @@ class Section
include Mongoid::Document include Mongoid::Document
include Mongoid::Timestamps include Mongoid::Timestamps
field :name, default: "Section" field :name
belongs_to :desktop belongs_to :desktop
has_many :groups, :autosave => true, :dependent => :destroy has_many :groups, :autosave => true, :dependent => :destroy
@ -10,7 +10,8 @@ class Section
before_create :initialize_group before_create :initialize_group
def initialize_group def initialize_group
self.build_group self.groups.build
self.groups.build
end end
end end

View File

@ -81,3 +81,11 @@ Change Theme: <select id="change_theme">
</div> </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>

View File

@ -98,6 +98,8 @@ Orbit::Application.routes.draw do
match '/desktop/desktop'=>'desktop#desktop' match '/desktop/desktop'=>'desktop#desktop'
match '/desktop/app_manager'=>'desktop#app_manager' match '/desktop/app_manager'=>'desktop#app_manager'
match '/desktop/sections'=>'desktop#sections' match '/desktop/sections'=>'desktop#sections'
match '/desktop/get_desktop_settings/'=>'desktop#get_desktop_settings'
match '/desktop/save_desktop_settings/'=>'desktop#save_desktop_settings'
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|
!request.query_string.include?("inner=true") !request.query_string.include?("inner=true")
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 805 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

View File

@ -1 +1,39 @@
{"css":"default.css","background":"chris.jpeg","tilecolor":["thmc1","thmc2"],"icons":{"home":"home.png","app_manager":"apps.png","sections":"sections.png"}} {
"css":"default.css",
"background":"background.jpg",
"tilecolor":["thmc1","thmc2"],
"icons":{
"home":"d_home.png",
"app_manager":"d_app_manager.png",
"sections":"d_sections.png",
"settings":"d_settings.png",
"publication":"d_publication.png",
"journal_p":"d_journal_p.png",
"seminar_p":"d_seminar_p.png",
"books":"d_books.png",
"research":"d_research.png",
"research_d":"d_research_d.png",
"research_p":"d_research_p.png",
"patents":"d_patents.png",
"labs":"d_labs.png",
"experience":"d_experience.png",
"working":"d_working.png",
"education":"d_education.png",
"honors":"d_honors.png",
"activities":"d_activities.png",
"clubs":"d_clubs.png",
"landt":"d_landt.png",
"courses":"d_courses.png",
"homework":"d_homework.png",
"certification":"d_certification.png",
"personal":"d_personal.png",
"mypage":"d_mypage.png",
"blog":"d_blog.png",
"album":"d_album.png",
"calendar":"d_calendar.png",
"files":"d_files.png",
"orbit":"d_orbit.png",
"connection":"d_connection.png",
"appstore":"d_appstore.png"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 805 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

View File

@ -1 +1,39 @@
{"css":"sexy.css","background":"background.jpg","tilecolor":["thmc1","thmc2"],"icons":{"home":"home.png","app_manager":"apps.png","sections":"sections.png"}} {
"css":"default.css",
"background":"background.jpg",
"tilecolor":["thmc1","thmc2"],
"icons":{
"home":"d_home.png",
"app_manager":"d_app_manager.png",
"sections":"d_sections.png",
"settings":"d_settings.png",
"publication":"d_publication.png",
"journal_p":"d_journal_p.png",
"seminar_p":"d_seminar_p.png",
"books":"d_books.png",
"research":"d_research.png",
"research_d":"d_research_d.png",
"research_p":"d_research_p.png",
"patents":"d_patents.png",
"labs":"d_labs.png",
"experience":"d_experience.png",
"working":"d_working.png",
"education":"d_education.png",
"honors":"d_honors.png",
"activities":"d_activities.png",
"clubs":"d_clubs.png",
"landt":"d_landt.png",
"courses":"d_courses.png",
"homework":"d_homework.png",
"certification":"d_certification.png",
"personal":"d_personal.png",
"mypage":"d_mypage.png",
"blog":"d_blog.png",
"album":"d_album.png",
"calendar":"d_calendar.png",
"files":"d_files.png",
"orbit":"d_orbit.png",
"connection":"d_connection.png",
"appstore":"d_appstore.png"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 805 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Some files were not shown because too many files have changed in this diff Show More