diff --git a/Gemfile.lock b/Gemfile.lock index c81c0574..339bae0f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -88,8 +88,6 @@ GEM factory_girl_rails (1.7.0) factory_girl (~> 2.6.0) railties (>= 3.0.0) - faraday (0.8.0) - multipart-post (~> 1.1) fastercsv (1.5.4) haml (3.1.4) hike (1.2.1) @@ -123,7 +121,6 @@ GEM encrypted_strings (~> 0.3.3) mongoid (~> 2) multi_json (1.1.0) - multipart-post (1.1.5) nokogiri (1.5.2) nokogiri (1.5.2-x86-mingw32) orm_adapter (0.0.6) @@ -201,7 +198,6 @@ GEM tilt (~> 1.3.2) sexp_processor (3.1.0) shoulda-matchers (1.0.0) - simple_oauth (0.1.7) simplecov (0.6.1) multi_json (~> 1.0) simplecov-html (~> 0.5.3) @@ -227,11 +223,6 @@ GEM treetop (1.4.10) polyglot polyglot (>= 0.3.1) - twitter (2.2.0) - activesupport (>= 2.3.9, < 4) - faraday (~> 0.7) - multi_json (~> 1.0) - simple_oauth (~> 0.1) tzinfo (0.3.32) uglifier (1.2.3) execjs (>= 0.3.0) @@ -285,6 +276,5 @@ DEPENDENCIES spork sprockets tinymce-rails - twitter uglifier watchr diff --git a/app/assets/javascripts/orbitdesktop.js b/app/assets/javascripts/orbitdesktop.js index ecb39f0a..fa20b1cc 100755 --- a/app/assets/javascripts/orbitdesktop.js +++ b/app/assets/javascripts/orbitdesktop.js @@ -1101,7 +1101,22 @@ var orbitDesktop = function(dom){ } $("div#apps_store div#panel_r").load("/desktop_appstore/widgets",function(){ - bindHandlers(); + $.getJSON("/desktop_appstore/getuserwidgets",function(userwidgets){ + var column = $('
'), + counter = 1, + li; + $.each(userwidgets,function(i,widge){ + li = $('
  • '+widge.name+'
    '+widge.shape+'
  • '); + column.find("ul").append(li); + if(counter%5==0){ + $("#journal_p div#paper_list div.overview").append(column); + column = $('
    '); + } + counter++; + }) + //alert(column); + $("#apps_store div#widget_list").append(column); + }) }) } @@ -1109,7 +1124,6 @@ var orbitDesktop = function(dom){ $(o.contentHolder).empty().load("/desktop_appstore/"+target,function(){ widgets(); bindHandlers(); - }); }else{ $(o.contentHolder).html(o.desktopData[o.currentface]); diff --git a/app/controllers/desktop_appstore_controller.rb b/app/controllers/desktop_appstore_controller.rb index 3114cafa..82e27412 100644 --- a/app/controllers/desktop_appstore_controller.rb +++ b/app/controllers/desktop_appstore_controller.rb @@ -8,4 +8,9 @@ class DesktopAppstoreController< ApplicationController render "desktop/appstore/widgets", :layout => false end + def getuserwidgets + @widgets = current_user.desktop_widgets + render :json=>@widgets.to_json + end + end \ No newline at end of file diff --git a/app/models/desktop_widget.rb b/app/models/desktop_widget.rb new file mode 100644 index 00000000..b0c0699e --- /dev/null +++ b/app/models/desktop_widget.rb @@ -0,0 +1,11 @@ +class DesktopWidget + include Mongoid::Document + include Mongoid::Timestamps + + field :name + field :author + field :shape + field :user_id + + belongs_to :user +end \ No newline at end of file diff --git a/app/models/user/user.rb b/app/models/user/user.rb index d09e563e..aca7959b 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -19,6 +19,7 @@ class User has_one :desktop, :autosave => true, :dependent => :destroy has_many :other_accounts, :autosave => true, :dependent => :destroy has_many :journals, :autosave => true, :dependent => :destroy + has_many :desktop_widgets, :autosave => true, :dependent => :destroy belongs_to :role has_and_belongs_to_many :sub_roles accepts_nested_attributes_for :attribute_values, :allow_destroy => true diff --git a/app/views/desktop/appstore/widgets.html.erb b/app/views/desktop/appstore/widgets.html.erb index 294d571f..5cbb049b 100644 --- a/app/views/desktop/appstore/widgets.html.erb +++ b/app/views/desktop/appstore/widgets.html.erb @@ -1 +1,11 @@ -this is widget page... \ No newline at end of file +
    +
    +
    +
    +
    Your Widgets
    +
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 27eb9770..08320cd2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -129,6 +129,7 @@ Orbit::Application.routes.draw do match '/desktop_appstore/appstore'=>'desktop_appstore#appstore' match '/desktop_appstore/widgets'=>'desktop_appstore#widgets' + match '/desktop_appstore/getuserwidgets'=>'desktop_appstore#getuserwidgets' match '/desktop/temp_func/'=>'desktop#temp_func' diff --git a/public/desktop_widgets/clock/clock.js b/public/desktop_widgets/4fa7810ac88514014d7c59bc/4fa7810ac88514014d7c59bc.js similarity index 100% rename from public/desktop_widgets/clock/clock.js rename to public/desktop_widgets/4fa7810ac88514014d7c59bc/4fa7810ac88514014d7c59bc.js diff --git a/public/desktop_widgets/clock/img/bg_blue.png b/public/desktop_widgets/4fa7810ac88514014d7c59bc/img/bg_blue.png similarity index 100% rename from public/desktop_widgets/clock/img/bg_blue.png rename to public/desktop_widgets/4fa7810ac88514014d7c59bc/img/bg_blue.png diff --git a/public/desktop_widgets/clock/img/bg_green.png b/public/desktop_widgets/4fa7810ac88514014d7c59bc/img/bg_green.png similarity index 100% rename from public/desktop_widgets/clock/img/bg_green.png rename to public/desktop_widgets/4fa7810ac88514014d7c59bc/img/bg_green.png diff --git a/public/desktop_widgets/clock/img/bg_orange.png b/public/desktop_widgets/4fa7810ac88514014d7c59bc/img/bg_orange.png similarity index 100% rename from public/desktop_widgets/clock/img/bg_orange.png rename to public/desktop_widgets/4fa7810ac88514014d7c59bc/img/bg_orange.png diff --git a/public/desktop_widgets/clock/index.html.erb b/public/desktop_widgets/4fa7810ac88514014d7c59bc/index.html.erb similarity index 61% rename from public/desktop_widgets/clock/index.html.erb rename to public/desktop_widgets/4fa7810ac88514014d7c59bc/index.html.erb index bdf81c65..2a69e24c 100755 --- a/public/desktop_widgets/clock/index.html.erb +++ b/public/desktop_widgets/4fa7810ac88514014d7c59bc/index.html.erb @@ -51,16 +51,16 @@ .clock .bg.left{ left:0px; } /* Individual styles for each color: */ -.orange .bg.left{ background:url(desktop_widgets/clock/img/bg_orange.png) no-repeat left top; } -.green .bg.left{ background:url(desktop_widgets/clock/img/bg_green.png) no-repeat left top; } -.blue .bg.left{ background:url(desktop_widgets/clock/img/bg_blue.png) no-repeat left top; } +.orange .bg.left{ background:url(desktop_widgets/4fa7810ac88514014d7c59bc/img/bg_orange.png) no-repeat left top; } +.green .bg.left{ background:url(desktop_widgets/4fa7810ac88514014d7c59bc/img/bg_green.png) no-repeat left top; } +.blue .bg.left{ background:url(desktop_widgets/4fa7810ac88514014d7c59bc/img/bg_blue.png) no-repeat left top; } /* The right part of the background: */ .clock .bg.right{ left:37.5px; } -.orange .bg.right{ background:url(desktop_widgets/clock/img/bg_orange.png) no-repeat right top; } -.green .bg.right{ background:url(desktop_widgets/clock/img/bg_green.png) no-repeat right top; } -.blue .bg.right{ background:url(desktop_widgets/clock/img/bg_blue.png) no-repeat right top; } +.orange .bg.right{ background:url(desktop_widgets/4fa7810ac88514014d7c59bc/img/bg_orange.png) no-repeat right top; } +.green .bg.right{ background:url(desktop_widgets/4fa7810ac88514014d7c59bc/img/bg_green.png) no-repeat right top; } +.blue .bg.right{ background:url(desktop_widgets/4fa7810ac88514014d7c59bc/img/bg_blue.png) no-repeat right top; } .clock .front.left{ diff --git a/public/desktop_widgets/clock/temp/bg_blue.png b/public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/bg_blue.png similarity index 100% rename from public/desktop_widgets/clock/temp/bg_blue.png rename to public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/bg_blue.png diff --git a/public/desktop_widgets/clock/temp/bg_green.png b/public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/bg_green.png similarity index 100% rename from public/desktop_widgets/clock/temp/bg_green.png rename to public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/bg_green.png diff --git a/public/desktop_widgets/clock/temp/bg_orange.png b/public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/bg_orange.png similarity index 100% rename from public/desktop_widgets/clock/temp/bg_orange.png rename to public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/bg_orange.png diff --git a/public/desktop_widgets/clock/temp/clock.css b/public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/clock.css similarity index 100% rename from public/desktop_widgets/clock/temp/clock.css rename to public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/clock.css diff --git a/public/desktop_widgets/gmail/gmail.js b/public/desktop_widgets/4fa7812ec88514014d7c59bd/4fa7812ec88514014d7c59bd.js similarity index 100% rename from public/desktop_widgets/gmail/gmail.js rename to public/desktop_widgets/4fa7812ec88514014d7c59bd/4fa7812ec88514014d7c59bd.js diff --git a/public/desktop_widgets/gmail/date.js b/public/desktop_widgets/4fa7812ec88514014d7c59bd/date.js similarity index 100% rename from public/desktop_widgets/gmail/date.js rename to public/desktop_widgets/4fa7812ec88514014d7c59bd/date.js diff --git a/public/desktop_widgets/gmail/index.html.erb b/public/desktop_widgets/4fa7812ec88514014d7c59bd/index.html.erb similarity index 100% rename from public/desktop_widgets/gmail/index.html.erb rename to public/desktop_widgets/4fa7812ec88514014d7c59bd/index.html.erb diff --git a/public/desktop_widgets/googlesearch/googlesearch.js b/public/desktop_widgets/4fa78140c88514014d7c59be/4fa78140c88514014d7c59be.js similarity index 100% rename from public/desktop_widgets/googlesearch/googlesearch.js rename to public/desktop_widgets/4fa78140c88514014d7c59be/4fa78140c88514014d7c59be.js diff --git a/public/desktop_widgets/googlesearch/img/google_64.png b/public/desktop_widgets/4fa78140c88514014d7c59be/img/google_64.png similarity index 100% rename from public/desktop_widgets/googlesearch/img/google_64.png rename to public/desktop_widgets/4fa78140c88514014d7c59be/img/google_64.png diff --git a/public/desktop_widgets/googlesearch/index.html.erb b/public/desktop_widgets/4fa78140c88514014d7c59be/index.html.erb similarity index 85% rename from public/desktop_widgets/googlesearch/index.html.erb rename to public/desktop_widgets/4fa78140c88514014d7c59be/index.html.erb index 8aaf8210..341b8d81 100644 --- a/public/desktop_widgets/googlesearch/index.html.erb +++ b/public/desktop_widgets/4fa78140c88514014d7c59be/index.html.erb @@ -22,7 +22,7 @@ input {