diff --git a/app/assets/images/note_alert.png b/app/assets/images/note_alert.png new file mode 100644 index 00000000..6ebda48e Binary files /dev/null and b/app/assets/images/note_alert.png differ diff --git a/app/assets/images/note_imp.png b/app/assets/images/note_imp.png new file mode 100644 index 00000000..eb1306a9 Binary files /dev/null and b/app/assets/images/note_imp.png differ diff --git a/app/assets/javascripts/desktopload.js.erb b/app/assets/javascripts/desktopload.js.erb index 56b7b9b3..e48d13cf 100644 --- a/app/assets/javascripts/desktopload.js.erb +++ b/app/assets/javascripts/desktopload.js.erb @@ -1,4 +1,5 @@ orbitDesktop.prototype.themefolder = "desktop_themes"; +orbitDesktopAPI.prototype.notifyImgPath = "/assets/"; var od = new orbitDesktop("#ajax_container"); diff --git a/app/assets/javascripts/orbitdesktop.js b/app/assets/javascripts/orbitdesktop.js index 6b233082..6280193b 100755 --- a/app/assets/javascripts/orbitdesktop.js +++ b/app/assets/javascripts/orbitdesktop.js @@ -18,7 +18,6 @@ var orbitDesktop = function(dom){ o.themesettings = eval(ts); $('head').append( $('').attr('href', "/"+o.themefolder+"/"+theme+"/css/"+ts.css)); $(document).ready(function(){o.loadWallpaper();o.bindDesktopEvents();o.loadIconCache();o.initializeDesktop();}); - return; }) }; @@ -134,7 +133,7 @@ var orbitDesktop = function(dom){ } }; this.tempFunc = function(){ - alert(o.tp); + o.notify("This is test notification!!","imp") } this.initializeAppSearch = function(target){ o.currenthtml = target; @@ -204,8 +203,9 @@ var orbitDesktop = function(dom){ }); $(".section_label ul li:not(:nth-child(1))").droppable({ drop:function(){ - if($("#"+$(this).attr("data-category")+" .element").length>=24) - o.notify("Section is full"); + if($("#"+$(this).attr("data-category")+" .element").length>=24){ + o.notify("Section is full.","alert"); + } else $("#"+$(this).attr("data-category")).append(element); } diff --git a/app/assets/javascripts/orbitdesktopAPI.js b/app/assets/javascripts/orbitdesktopAPI.js index c6e0f128..282f9dc8 100644 --- a/app/assets/javascripts/orbitdesktopAPI.js +++ b/app/assets/javascripts/orbitdesktopAPI.js @@ -15,8 +15,29 @@ var sortDescending = function(a, b) { }; var orbitDesktopAPI = function(){ o = this; - this.notify = function(msg){ - alert(msg); + this.notify = function(msg,type,time){ + var $notify = $("#orbitnote"); + var img; + if(!type)type=""; + switch(type){ + case "alert": + img = "note_alert.png"; + break; + case "imp": + img = "note_imp.png"; + break; + case "success": + img = "note_success.png"; + break; + default: + img = "note_alert.png"; + break; + } + $notify.find("img#note_img").attr("src","/assets/"+img); + $notify.find(".note_message").text(msg); + if(!time)time=5000; else time=time*1000; + $notify.slideDown().delay(time).slideUp(); }; - -}; \ No newline at end of file +}; + +orbitDesktopAPI.prototype.notifyImgPath = ""; \ No newline at end of file diff --git a/app/assets/stylesheets/desktopmain.css b/app/assets/stylesheets/desktopmain.css index 866f87a3..180abd9c 100644 --- a/app/assets/stylesheets/desktopmain.css +++ b/app/assets/stylesheets/desktopmain.css @@ -175,6 +175,33 @@ a { text-decoration: none; } .clear { clear: both; } +/* Orbit Notification */ +#orbitnote { + position: absolute; + top: 0; + left: 50%; + margin-left: -206px; + z-index: 99999; + width: 400px; + padding: 0 6px 6px 6px; + background-color: #000; + background-color: rgba(0,0,0,0.6); +} +.note_holder { + background-color: #f3f3f3; + border: solid 1px #fff; + border-top: none; + overflow: hidden; + padding: 24px 24px; +} +.note_type { float: left; } +.note_type img { display: block; } +.note_message { + color: #333; + margin: 10px 0 0 48px; + font-size: 15px; +} + /* fake Orbit bar */ #orbitbar { height: 28px; diff --git a/app/controllers/desktop_controller.rb b/app/controllers/desktop_controller.rb index 1b13ec59..a8dfb275 100644 --- a/app/controllers/desktop_controller.rb +++ b/app/controllers/desktop_controller.rb @@ -7,5 +7,13 @@ class DesktopController< ApplicationController def desktop render :layout => false - end + end + + def app_manager + render :layout => false + end + + def sections + render :layout => false + end end \ No newline at end of file diff --git a/app/views/desktop/index.html.erb b/app/views/desktop/index.html.erb index 2bcc0846..c5209dff 100755 --- a/app/views/desktop/index.html.erb +++ b/app/views/desktop/index.html.erb @@ -1,8 +1,8 @@
- - + +
@@ -21,4 +21,10 @@ Change Theme:
+ \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 18783655..913de734 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -96,6 +96,8 @@ Orbit::Application.routes.draw do end match '/desktop/'=>'desktop#index' match '/desktop/desktop'=>'desktop#desktop' + match '/desktop/app_manager'=>'desktop#app_manager' + match '/desktop/sections'=>'desktop#sections' match '/panel/:app_name/front_end/:app_action/:id' => 'pages#show_from_link', :constraints => lambda { |request| !request.query_string.include?("inner=true") }