From aa3997f7cf7990666e6bc5014d0957f0b61d200a Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Thu, 29 Mar 2012 19:50:23 +0800 Subject: [PATCH] with notifications and other changes --- app/assets/images/note_alert.png | Bin 0 -> 1099 bytes app/assets/images/note_imp.png | Bin 0 -> 2496 bytes app/assets/javascripts/desktopload.js.erb | 1 + app/assets/javascripts/orbitdesktop.js | 8 +++--- app/assets/javascripts/orbitdesktopAPI.js | 29 +++++++++++++++++++--- app/assets/stylesheets/desktopmain.css | 27 ++++++++++++++++++++ app/controllers/desktop_controller.rb | 10 +++++++- app/views/desktop/index.html.erb | 10 ++++++-- config/routes.rb | 2 ++ 9 files changed, 76 insertions(+), 11 deletions(-) create mode 100644 app/assets/images/note_alert.png create mode 100644 app/assets/images/note_imp.png diff --git a/app/assets/images/note_alert.png b/app/assets/images/note_alert.png new file mode 100644 index 0000000000000000000000000000000000000000..6ebda48e6394388690f57bd3aa0ca13d9032a1aa GIT binary patch literal 1099 zcmV-R1ho5!P)V>IRB3Hx05CHzGC40XGT-R2dH?_e zp-DtRR9J<@*jtE|RTRMS-<ccC}xU!2m-qh z6cy135%f?9QBPZ{m+Zy#F(^~Ip;CjcT$QXMU9Nqu}9)IC-v0N-2X?Sw{=+%)-lfMBd`Ah&b9j zp&n_fpYTR2FcX!C=$8R=Z`Iwyu*tgdFSg1!F;#K^A5`55RCCij{D#ew>BQqnb@Gp- zFU>8btZT?bc^dnr=TEil$M+b-nug5UC$Vq5bZ{Z0`s% z>JvEFJ|6oj!_X}okR?RB_yxYLj=qFmrGh z-ogsQjbh)(bz`;C+hl2b81Lde>~GbC)kI715H`rXb=(=c*0TcDjTRdoHuTHp@%{Sz z8WCgOs%oCAaS!g3!-iQVGHe*N@kZGZ%#%gb@3PJQ0$<|?9Fpb3l`=2gf}5q&E|6*A zm>kEvIF`Ov23Fm8QntURaY~k*{e}lt)2i|rGV(X%z^d0|4Xn-pcR@#b{{f$+Xj3~R RgQ@@k002ovPDHLkV1fgr3wZzl literal 0 HcmV?d00001 diff --git a/app/assets/images/note_imp.png b/app/assets/images/note_imp.png new file mode 100644 index 0000000000000000000000000000000000000000..eb1306a98af4e9795d2282b1c308355323f77b6d GIT binary patch literal 2496 zcmV;x2|xCUP)(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRZ_MoC0LRCwC#S!r-p5R#CvBr(fflH8kn@7d4SA0Ta1Oz=AX zaQevt$Z2)+$Q<6C0vWG}=IHGQ=c5;zzio(v}6+VguhIbI|!od47C z9cw>=ZhWfGtV_t4Gjb$ilBowLBZ^40v|b~6ooj6cVT=wA zqw&zc4?^JM^Ggd?mrbvLZ$`xx!_DvisBrDtKaxyl>T#E=B04{{3{BBAWHm#_cJKL3 z#meQBnMtGdRNtYzMfJ-?mt8s0dgKMqVDxTpRV7B>eCNrrzEcfSc}YLf^(n0{VcY>_g^{Va;3=Q#`Nzleeh)O;AvO{!P;4Y;rE&z zFeC#SuTBZM7evLH6tqqu(;M|AaLk!=XX&EFKksU7Zmq7a zW`ma%FYQ0xu{wXnk~bzx$M#%ZOB98R!e$e}FbszGH9eI-qgpU!1swy4!xgo2wvF_h zz<46=<0T2KXal1gf$WFP$PfA222J`e>39sm%5sc<(7GiNkJ?p%hQgAIB4cuNN zE7{Qh&Vif!JikWtdC+tGBoQks9^f?1pcNJn+%Z#@VG10WNO9D2RV`Qml}ndw?09GI zin+6@iz3s?tA}6jHqSkAgT&kkq5J}0k}*9p{knLU|!^zSl__2!IC1x28K5zl4CD<$|Jqj z6w~n~yOxu4e<3{15aRD1{#kx;VJ*XRINsAYmbYO3W4y->i?NV(Ibr#IgQlv%Fm%`q z3`UYV9I+8(jd4WkX8oaac;pZ_CXDWe-ZQtPAda3Fas&LR2quTM+u`VL@~rv*nTEk$b+&Bcx4Tu7m5V?mMvXJAW#yn|Bbh^7SiX^Ljo9DHOy|bMwRA*pN5AZ3m7uH6N?I ze)$Wu-450vA<5~8+e{?gTuhPE30+RZ$GZCREIUHF0ErPH@J>v-dST0OR^OgHaRNSp zLH{c|o{|+AnxR3})d|R%NR&|~AR$?3|M*`EjQ#uXcQ_=(K*7H1mItAmdM25IJf4Kd z#l!ED5GwF#@%Hxk*?;WQNMW#F@z|hxC8+v1G%E{T9z((1cRoBE3@132gVf%(=*W&& ze>?&evFz9cvRy|8t&GL%I2Z1e&qZCWR5 z4b;O&&M{^fBva#_w)-};Rb^5o8AXM$ZvDoYcddV#q|+dTfbblKgEr`v4$w55$t*}m zcV#vn&v#v3^&WM8UZ*G;8qdHYCMZx~L;(XwjxIHxd}hC&XVI$~y6ch0<_0TE+s*T1 zal!H>xhe8#Z>WnloNj3RNnt!z0uZE%3OkEdUH7}p=m65%7<5C1CbGyDMPL<|!z?O= z<#03fQ1p9TR$0SF#{(|G0T(O5Nm%&o0eBq&NH!-#@Tj<^zDcc}w^LPQ_8+*pJipidzkPpXI~5QZa|hmk#dA1hHZPR%l)R8BkSoq73dW+n}r z%MDI+00e+(!leQs4R9Pi0lK48Ikl?+9Xnoyl1?gYNf>Nl1Z=PfuuOmuFai(G>4F6c z-m=0j+p?w4%bJQX&mr~F%a0EZ4^iWCCU-@WBO~Z+E_ub29BGV=27R}!+2)>J4X7rdsepNYfTb)@6a|46Fw)rp z+T$NEEDIdZAkg1?RqWlC`)01b<++@Lz4`eU>xW<4`Rf^drxy^O15JRW34OFE^5;nH z+-}&M6h6BKMF5Hd1qK9Gnu2B#N^rn3>2uNnAk+mS06^&k@#7s{?(E6+o^&!y7#gf; zqTA+-itBE_Yw<%HcIQOo*~K?LQPtP8u}YvB)jH>i3r4O?(t8eEOc2{Tp*~t=YG(KG6I6&K09)dge)j z2m-(W0O8zB@+EtlaPu+QMDghnm>}m508k7IJuYu=*{YTA=Nuz57A').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") }