diff --git a/app/assets/images/icons/bookkeeper.png b/app/assets/images/icons/bookkeeper.png new file mode 100755 index 00000000..41b3bf26 Binary files /dev/null and b/app/assets/images/icons/bookkeeper.png differ diff --git a/app/assets/images/icons/calendar.png b/app/assets/images/icons/calendar.png new file mode 100755 index 00000000..a2f6ae71 Binary files /dev/null and b/app/assets/images/icons/calendar.png differ diff --git a/app/assets/images/icons/diary.png b/app/assets/images/icons/diary.png new file mode 100755 index 00000000..38bfa20c Binary files /dev/null and b/app/assets/images/icons/diary.png differ diff --git a/app/assets/images/icons/doc.png b/app/assets/images/icons/doc.png new file mode 100755 index 00000000..36cb273b Binary files /dev/null and b/app/assets/images/icons/doc.png differ diff --git a/app/assets/images/icons/facebook.png b/app/assets/images/icons/facebook.png new file mode 100755 index 00000000..03c3ddd5 Binary files /dev/null and b/app/assets/images/icons/facebook.png differ diff --git a/app/assets/images/icons/gmail.png b/app/assets/images/icons/gmail.png new file mode 100755 index 00000000..44ff25b7 Binary files /dev/null and b/app/assets/images/icons/gmail.png differ diff --git a/app/assets/images/icons/iclock.png b/app/assets/images/icons/iclock.png new file mode 100755 index 00000000..4200755e Binary files /dev/null and b/app/assets/images/icons/iclock.png differ diff --git a/app/assets/images/icons/movies.png b/app/assets/images/icons/movies.png new file mode 100755 index 00000000..6e75b450 Binary files /dev/null and b/app/assets/images/icons/movies.png differ diff --git a/app/assets/images/icons/musicbox.png b/app/assets/images/icons/musicbox.png new file mode 100755 index 00000000..6071215f Binary files /dev/null and b/app/assets/images/icons/musicbox.png differ diff --git a/app/assets/images/icons/newsfeed.png b/app/assets/images/icons/newsfeed.png new file mode 100755 index 00000000..cb20cd92 Binary files /dev/null and b/app/assets/images/icons/newsfeed.png differ diff --git a/app/assets/images/icons/talk.png b/app/assets/images/icons/talk.png new file mode 100755 index 00000000..6f498870 Binary files /dev/null and b/app/assets/images/icons/talk.png differ diff --git a/app/assets/images/icons/ted.png b/app/assets/images/icons/ted.png new file mode 100755 index 00000000..d9063ce0 Binary files /dev/null and b/app/assets/images/icons/ted.png differ diff --git a/app/assets/images/icons/weather.png b/app/assets/images/icons/weather.png new file mode 100755 index 00000000..d7033439 Binary files /dev/null and b/app/assets/images/icons/weather.png differ diff --git a/app/assets/images/icons/youtube.png b/app/assets/images/icons/youtube.png new file mode 100755 index 00000000..400ce4c1 Binary files /dev/null and b/app/assets/images/icons/youtube.png differ diff --git a/app/assets/javascripts/orbitdesktop.js b/app/assets/javascripts/orbitdesktop.js index 03efc5dd..62556aec 100755 --- a/app/assets/javascripts/orbitdesktop.js +++ b/app/assets/javascripts/orbitdesktop.js @@ -15,7 +15,7 @@ var orbitDesktop = function(dom){ this.sectionList; this.initialize = function(){ var theme = o.theme; - $.getJSON("/desktop/get_desktop_settings",{id:o.desktopId},function(desktopSettings){ + $.getJSON("/desktop/get_desktop_settings",{"get":"desktop","desktopid":o.desktopId},function(desktopSettings){ if(desktopSettings){ theme = desktopSettings.theme; o.theme = theme; @@ -103,20 +103,20 @@ var orbitDesktop = function(dom){ var bindHandlers = function(){ var groupWrapperWidth = 0; var groupWrapperHeight = 0; - $(".element").mousedown(function(){ + $("div#desktop .element").mousedown(function(){ currentElement = $(this); elementParent = $(this).parent(); }) - $(".group").mouseenter(function(){ + $("div#desktop .group").mouseenter(function(){ targetParent = $(this); }) - $(".group").each(function(){groupWrapperWidth+=$(this).width();}) + $("div#desktop .group").each(function(){groupWrapperWidth+=$(this).width();}) groupWrapperWidth+=200; groupWrapperHeight = $(".group").height() + 20; // groupWrapperHeight = (groupWrapperHeight > ($(window).height()-extraspace))? $(window).height()-extraspace:groupWrapperHeight; - $("#group_wrapper").css("width",groupWrapperWidth); + $("div#desktop #group_wrapper").css("width",groupWrapperWidth); - $(".grp").sortable({ + $("div#desktop .grp").sortable({ connectWith: ".grp", tolerance: 'pointer' , revert:true, @@ -128,19 +128,19 @@ var orbitDesktop = function(dom){ //targetParent.width(currentElement.width()); var newWidth = targetElementWidth+currentElementWidth; targetParent.css("max-width",newWidth); - var newParentWidth = $("#group_wrapper").width()+currentElementWidth; - $("#group_wrapper").css("width",newParentWidth); + var newParentWidth = $("div#desktop #group_wrapper").width()+currentElementWidth; + $("div#desktop #group_wrapper").css("width",newParentWidth); }else if(targetParent.height()<540){ var newWidth = targetElementWidth - (540-targetElementWidth); targetParent.css("max-width",newWidth); - var newParentWidth = $("#group_wrapper").width()+currentElementWidth; - $("#group_wrapper").css("width",newParentWidth); + var newParentWidth = $("div#desktop #group_wrapper").width()+currentElementWidth; + $("div#desktop #group_wrapper").css("width",newParentWidth); } } }); - $('.tinycanvas').tinyscrollbar({ axis: 'x'}); - $("div.scrollbar").hover(function(){ + $('div#desktop .tinycanvas').tinyscrollbar({ axis: 'x'}); + $("div#desktop div.scrollbar").hover(function(){ $(this).removeClass('op01'); }, function(){ $(this).addClass('op01'); @@ -162,7 +162,7 @@ var orbitDesktop = function(dom){ } var loadTiles = function(id){ - $("div#group_wrapper").empty(); + $("div#desktop div#group_wrapper").empty(); $.getJSON("/desktop/getgroups",{sectionid:id},function(groups){ var tilecolors = o.themesettings.tilecolor; var opacity = ["op05","op06","op07","op08","op09"]; @@ -178,7 +178,7 @@ var orbitDesktop = function(dom){ $li = $('
  • '+tile.title+'

    Loading...
  • '); $group.find("ul").append($li); }) - $("div#group_wrapper").append($group); + $("div#desktop div#group_wrapper").append($group); }) bindHandlers(); o.initializeWidgets(); @@ -191,19 +191,19 @@ var orbitDesktop = function(dom){ var tempstyle=""; if(i==0){ tempstyle = "style='display:none;'"; - $("span#section_heading").text(section.name); + $("div#desktop span#section_heading").text(section.name); } - $("ul#section_list").append($('
  • '+section.name+'
  • ')); + $("div#desktop ul#section_list").append($('
  • '+section.name+'
  • ')); }) bindSecondaryHandlers(); }) } var bindSecondaryHandlers = function(){ - $("ul#section_list li.section_name").click(function(){ - $("li.section_name").show(); + $("div#desktop ul#section_list li.section_name").click(function(){ + $("div#desktop li.section_name").show(); $(this).hide(); - $("span#section_heading").text($(this).text()); + $("div#desktop span#section_heading").text($(this).text()); loadTiles($(this).find("a").attr("href")); }) } @@ -221,49 +221,45 @@ var orbitDesktop = function(dom){ } }; this.tempFunc = function(th){ - //o.notify("This is test notification!!","alert",2) - console.log(th); - $.post("/desktop/save_desktop_settings",{"id":o.desktopId,"theme":th},function(){ - o.notify("Settings Saved!!","success"); - }) + } this.initializeAppSearch = function(target){ o.currenthtml = target; o.currentface = "apps_manager"; var searchArray,allApps; var bindHandlers = function(){ - $("#group_wrapper").css("min-width",$(window).width()-100); - $(".group_search").css("width",$(window).width()-200); + $("div#app_manager #group_wrapper").css("min-width",$(window).width()-100); + $("div#app_manager .group_search").css("width",$(window).width()-200); //for textbox search - $("#searchbox").focus(function(){$(this).val("");}).keyup(function(e){ + $("div#app_manager #searchbox").focus(function(){$(this).val("");}).keyup(function(e){ if($(this).val()){ - $(".search_result").empty(); - $("#seperator").hide(); - searchArray = $(".element:containsi("+$(this).val()+")"); + $("div#app_manager .search_result").empty(); + $("div#app_manager #seperator").hide(); + searchArray = $("div#app_manager .element:containsi("+$(this).val()+")"); if(searchArray.length>0){ - $("#seperator").show(); + $("div#app_manager #seperator").show(); searchArray.each(function(){ var $newelement = $(''); - $(".search_result").prepend($newelement); + $("div#app_manager .search_result").prepend($newelement); }) } - }else{$("#seperator").hide();$(".search_result").empty();} + }else{$("div#app_manager #seperator").hide();$("div#app_manager .search_result").empty();} }).blur(function(){$(this).val("Search");}); //for Alphabet sorting - $("a#alphabet_sort_btn").click(function(){ + $("div#app_manager a#alphabet_sort_btn").click(function(){ switch ($(this).attr("href")){ case "ascending": $(this).attr("href","descending").find(".thmtxt").text("Alphabet [Z-A]"); - allApps = $(".group_search .element").sort(sortAscending); + allApps = $("div#app_manager .group_search .element").sort(sortAscending); break; case "descending": $(this).attr("href","ascending").find(".thmtxt").text("Alphabet [A-Z]"); - allApps = $(".group_search .element").sort(sortDescending); + allApps = $("div#app_manager .group_search .element").sort(sortDescending); break; } - $(".group_search").html(allApps); + $("div#app_manager .group_search").html(allApps); return false; }) $('.tinycanvas').tinyscrollbar({ axis: 'x'}); @@ -295,13 +291,13 @@ var orbitDesktop = function(dom){ o.currentface = "sections"; var elementParent,element,groupWrapperWidth; var bindHandlers = function(){ - $(".group").width(530); - $(".group").each(function(){groupWrapperWidth+=$(this).width();}) + $("div#sections .group").width(530); + $("div#sections .group").each(function(){groupWrapperWidth+=$(this).width();}) groupWrapperWidth+=200; // groupWrapperHeight = $(".group").height() + 20; // groupWrapperHeight = (groupWrapperHeight > ($(window).height()-extraspace))? $(window).height()-extraspace:groupWrapperHeight; - $("#group_wrapper").css("width",groupWrapperWidth); - $("#group_wrapper .to_drop").sortable({ + $("div#sections #group_wrapper").css("width",groupWrapperWidth); + $("div#sections #group_wrapper .to_drop").sortable({ start:function(){ var $elementParent = $(this).parent().parent(); elementParent = $elementParent; @@ -312,7 +308,7 @@ var orbitDesktop = function(dom){ elementParent.find("div.section_label ul li:not(:nth-child(1))").fadeOut(500); } }); - $(".section_label ul li:not(:nth-child(1))").droppable({ + $("div#sections .section_label ul li:not(:nth-child(1))").droppable({ drop:function(){ if($("#"+$(this).attr("data-category")+" .element").length>=24){ o.notify("Section is full.","alert"); @@ -388,7 +384,7 @@ var orbitDesktop = function(dom){ o.currenthtml = target; o.currentface = "settings"; var bindHandlers = function(){ - $("ul#setting_left_nav li a").click(function(){ + $("div#settings ul#setting_left_nav li a").click(function(){ var tfunc = $(this).attr("href"); switch(tfunc){ case "themes": @@ -398,10 +394,10 @@ var orbitDesktop = function(dom){ sections(); break; } - $("ul#setting_left_nav li a").removeClass('thmc1 thmtxt').data('clicked',null); + $("div#settings ul#setting_left_nav li a").removeClass('thmc1 thmtxt').data('clicked',null); $(this).addClass('thmc1 thmtxt').data('clicked',true); }); - $("ul#setting_left_nav li a").hover(function(){ + $("div#settings ul#setting_left_nav li a").hover(function(){ $(this).removeClass('admtxt').addClass('thmc1 thmtxt'); }, function(){ var t = $(this).data('clicked') ? '' : 'thmc1 thmtxt'; @@ -415,9 +411,31 @@ var orbitDesktop = function(dom){ sh = $(this).siblings('.s_tab').height(); $(this).css({'height': h-sh-24}).tinyscrollbar({ axis: 'y'}); }); + + $("a#name_save_btn").click(function(){ + var desktopnm = new Array; + $("#desktop_names input").each(function(){ + desktopnm.push($(this).val()); + }) + $.post("/desktop/save_desktop_settings",{"save":"desktopnames","desktopid":o.desktopId,"desktopnms":desktopnm},function(result,status){ + if(status=="success"){ + if(result[0].success=="true") + o.notify("Names Saved!!","success",2); + else + o.notify("Name saving failed!!","imp",2); + }else{ + o.notify("Connection problem!!","alert",2); + } + }) + }) } - $("div#panel_r").load("/desktop/settingsections",function(){ + $("div#settings div#panel_r").load("/desktop/settingsections",function(){ + $.getJSON("/desktop/get_desktop_settings",{"get":"sectionnames","desktopid":o.desktopId},function(sectionnames){ + $("#desktop_names input").each(function(i){ + $(this).val(sectionnames[i]); + }) bindHandlers(); + }) }) } @@ -427,7 +445,16 @@ var orbitDesktop = function(dom){ o.changeTheme($(this).find('.theme_name').text()); $(".theme_list > li").removeClass('thmc1').data('clicked',null).find('.theme_name').removeClass('thmtxt'); $(this).addClass('thmc1').data('clicked',true).find('.theme_name').addClass('thmtxt'); - od.tempFunc($(this).text()); + $.post("/desktop/save_desktop_settings",{"save":"theme","desktopid":o.desktopId,"theme":$(this).text()},function(result,status){ + if(status=="success"){ + if(result[0].success=="true") + o.notify("Theme Saved!!","success",2); + else + o.notify("Theme saving failed!!","imp",2); + }else{ + o.notify("Connection problem!!","alert",2); + } + }); }); $('.tinycanvas').each(function(){ var h = $(this).parent().height(), @@ -460,8 +487,11 @@ var orbitDesktop = function(dom){ }); } - $("div#panel_r").load("/desktop/settingthemes",function(){ + $("div#settings div#panel_r").load("/desktop/settingthemes",function(){ + $.getJSON("/desktop/get_desktop_settings",{"get":"theme","desktopid":o.desktopId},function(theme){ + $("#st1 ul.theme_list li:containsi("+theme+")").addClass("thmc1").find("span").addClass("thmtxt"); bindHandlers(); + }) }) } @@ -510,7 +540,7 @@ orbitDesktop.prototype.widgetfolder = "desktop_widgets"; orbitDesktop.prototype.desktopId = "1"; orbitDesktop.prototype.notifyImgPath = "temp"; orbitDesktop.prototype.iconPath = "/assets/icons/"; - +orbitDesktop.prototype.currentLanguage = "en"; var uselessfunction = function(){ $.post("/desktop/temp_func",{sectionid:"4f83e7bbbd98eb041600001d"}); } diff --git a/app/assets/stylesheets/desktopmain.css b/app/assets/stylesheets/desktopmain.css index f862c7bd..35121f3d 100644 --- a/app/assets/stylesheets/desktopmain.css +++ b/app/assets/stylesheets/desktopmain.css @@ -271,7 +271,7 @@ a:focus { outline: none; } .theme_plate > div:first-child { margin-right: 48px;} .s_title { font-size: 15px; line-height: 60px; text-align: left; } .s_action { padding: 24px 0; overflow: hidden; } -#theme_submit { +.setting_btn { display: block; float: right; font-size: 15px; diff --git a/app/controllers/desktop_controller.rb b/app/controllers/desktop_controller.rb index 2706fc8a..4cf425a2 100644 --- a/app/controllers/desktop_controller.rb +++ b/app/controllers/desktop_controller.rb @@ -35,16 +35,42 @@ class DesktopController< ApplicationController #ajax data load.... def save_desktop_settings - @desktop = Desktop.find(params["id"]) - @desktop.update_attributes(:theme => params["theme"]) + @desktop = Desktop.find(params["desktopid"]) + @savewhat = params["save"] + case @savewhat + when "theme" + @desktop.update_attributes(:theme => params["theme"]) + when "desktopnames" + @sections = @desktop.sections + x = 0; + @sections.each do |section| + @desktopnewnames = params["desktopnms"] + section.update_attributes(:name => @desktopnewnames[x] ) + x = x+1 + end + end a = Array.new a << {"success"=>"true"} render :json=>a.to_json end def get_desktop_settings - @desktop = Desktop.find(params["id"]) - render :json => @desktop.to_json + @desktop = Desktop.find(params["desktopid"]) + @getwhat = params["get"] + case @getwhat + when "desktop" + render :json => @desktop.to_json + when "sectionnames" + secnames = Array.new + @sections = @desktop.sections + @sections.each do |section| + secnames << section.name + end + render :json => secnames.to_json + when "theme" + @theme = @desktop.theme + render :json => @theme.to_json + end end def getgroups diff --git a/app/views/desktop/index.html.erb b/app/views/desktop/index.html.erb index 9e9eef50..fb3cf642 100755 --- a/app/views/desktop/index.html.erb +++ b/app/views/desktop/index.html.erb @@ -59,6 +59,7 @@
    +
    @@ -81,6 +82,7 @@ orbitDesktop.prototype.notifyImgPath = "/assets/"; orbitDesktop.prototype.desktopId = "<%= @desktop.id %>"; orbitDesktop.prototype.sectionId = "<%= @section.id %>"; + orbitDesktop.prototype.currentLanguage = "<%= I18n.locale %>"; //uselessfunction(); var od = new orbitDesktop("#ajax_container"); o.notify("Notification Working!!","imp",3) diff --git a/app/views/desktop/settings.html.erb b/app/views/desktop/settings.html.erb index 7d29ea8a..df41ef60 100644 --- a/app/views/desktop/settings.html.erb +++ b/app/views/desktop/settings.html.erb @@ -22,15 +22,6 @@
    -
    \ No newline at end of file diff --git a/app/views/desktop/settings/sections.html.erb b/app/views/desktop/settings/sections.html.erb index 784d0fd2..02e538d8 100644 --- a/app/views/desktop/settings/sections.html.erb +++ b/app/views/desktop/settings/sections.html.erb @@ -1,19 +1,18 @@ -
    +
    Sections Name
    -
      -
    • -
    • -
    • -
    • +
        +
      • +
      • +
      • +
    -
    \ No newline at end of file diff --git a/app/views/desktop/settings/themes.html.erb b/app/views/desktop/settings/themes.html.erb index f43d4509..061be9aa 100644 --- a/app/views/desktop/settings/themes.html.erb +++ b/app/views/desktop/settings/themes.html.erb @@ -1,4 +1,3 @@ -
    - \ No newline at end of file diff --git a/app/views/layouts/_orbit_bar.html.erb b/app/views/layouts/_orbit_bar.html.erb index 2322b62f..0ab9af1a 100644 --- a/app/views/layouts/_orbit_bar.html.erb +++ b/app/views/layouts/_orbit_bar.html.erb @@ -15,7 +15,7 @@