diff --git a/app/assets/javascripts/orbitdesktop.js b/app/assets/javascripts/orbitdesktop.js index 087ebfbd..0db73390 100755 --- a/app/assets/javascripts/orbitdesktop.js +++ b/app/assets/javascripts/orbitdesktop.js @@ -24,7 +24,7 @@ var orbitDesktop = function(dom){ this.transitionTime = 500; this.currenthtml = "desktop.html"; this.currentface = "home"; - this.desktopData = {"home":"","settings":"","work":"","favorite":"","apps_manager":"","sections":"","journal_p":"","appstore":"","orbit":""}; + this.desktopData = {"home":"","settings":"","work":"","favorite":"","apps_manager":"","sections":"","journal_p":"","appstore":"","orbit":"","books":"","seminar_p":""}; this.tp = ""; this.sectionList; this.initialize = function(){ @@ -137,6 +137,15 @@ var orbitDesktop = function(dom){ }); } }); + $("a#d_seminar_p").click(function(){ + var target = $(this).attr("href"); + if(o.currenthtml!=target){ + o.desktopData[o.currentface] = $(o.contentHolder).html(); + $("#content").hide("drop",o.transitionTime,function(){ + o.initializeSeminar(target); + }); + } + }); $(window).resize(function(){ var ww = $(window).width(); $("img#thmbackground").attr({"width":ww}); @@ -1380,6 +1389,68 @@ var orbitDesktop = function(dom){ bindHandlers(); } } + this.initializeSeminar = function(target){ + o.currenthtml = target; + o.currentface = "seminar_p"; + var bindHandlers = function(){ + $('.s_menu a').on({ + click: function(){ + if(!$(this).hasClass('active')){ + var tfunc = $(this).attr('href'); + switch(tfunc){ + case 'list': + list(); + break; + case 'addseminar': + addseminar(); + break; + } + $('.s_menu a').removeClass('thmc1 thmtxt active'); + $(this).addClass('thmc1 thmtxt active'); + } + }, + mouseenter: function(){ + if(!$(this).hasClass('active')){ + $(this).switchClass('admtxt','thmc1 thmtxt',0); + } + }, + mouseleave: function(){ + var t = $(this).hasClass('active') ? '' : 'thmc1 thmtxt'; + $(this).switchClass(t,'admtxt',0); + } + }); + } + + var list = function(){ + var bindHandlers = function(){ + + } + + $("div#seminar_p div#panel_r").load("/desktop/seminar_p_list",function(){ + bindHandlers(); + }) + } + + var addseminar = function(){ + var bindHandlers = function(){ + + } + + $("div#seminar_p div#panel_r").load("/desktop/seminar_p_add",function(){ + bindHandlers(); + }) + } + if(!o.desktopData[o.currentface]){ + $(o.contentHolder).empty().load("/desktop/"+target,function(){ + list(); + bindHandlers(); + }); + }else{ + $(o.contentHolder).html(o.desktopData[o.currentface]); + list(); + bindHandlers(); + } + } this.loadWallpaper = function(wallpaper){ // this is to load new wallpaper if(!wallpaper)wallpapernm = o.themesettings.background;else wallpapernm = wallpaper var ww = $(window).width(); diff --git a/app/controllers/desktop_publications_controller.rb b/app/controllers/desktop_publications_controller.rb index f09520a2..74983fca 100644 --- a/app/controllers/desktop_publications_controller.rb +++ b/app/controllers/desktop_publications_controller.rb @@ -23,6 +23,18 @@ class DesktopPublicationsController< ApplicationController render "desktop/books/add", :layout => false end + def seminar_p + render "desktop/seminar_p", :layout => false + end + + def seminar_p_list + render "desktop/seminar_pages/list", :layout => false + end + + def seminar_p_add + render "desktop/seminar_pages/add", :layout => false + end + def create_journal Journal.create(user_id: current_user.id, title: "Ice Cream Sandwich") b = Array.new diff --git a/app/views/desktop/books/seminar.html.erb b/app/views/desktop/books/seminar.html.erb deleted file mode 100644 index cea6c091..00000000 --- a/app/views/desktop/books/seminar.html.erb +++ /dev/null @@ -1 +0,0 @@ -this is seminar page. \ No newline at end of file diff --git a/app/views/desktop/seminar_p.html.erb b/app/views/desktop/seminar_p.html.erb new file mode 100644 index 00000000..8815c90c --- /dev/null +++ b/app/views/desktop/seminar_p.html.erb @@ -0,0 +1,33 @@ +