From 793d739726f132ad8c3daa229e242b85d357b986 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 25 Mar 2013 18:44:06 +0800 Subject: [PATCH] features and widgets added Conflicts: app/assets/javascripts/orbitdesktop.js --- app/assets/images/icons/envocab.png | Bin 0 -> 8410 bytes app/assets/images/icons/wikibooks.png | Bin 0 -> 8198 bytes app/assets/javascripts/orbitdesktop.js | 219 ++++++++++++++++------ app/assets/javascripts/orbitdesktopAPI.js | 10 +- app/controllers/desktop_controller.rb | 14 +- app/models/desktop/desktop_widget.rb | 3 +- app/models/desktop/tile.rb | 3 +- app/uploaders/image_uploader.rb | 4 +- app/views/desktop/index.html.erb | 2 +- 9 files changed, 193 insertions(+), 62 deletions(-) create mode 100644 app/assets/images/icons/envocab.png create mode 100644 app/assets/images/icons/wikibooks.png diff --git a/app/assets/images/icons/envocab.png b/app/assets/images/icons/envocab.png new file mode 100644 index 0000000000000000000000000000000000000000..32516059686c2fa845ada4bb1d28e20ee878a574 GIT binary patch literal 8410 zcmV<0ASK_4P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl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|07*qoM6N<$f@$0jtpET3 literal 0 HcmV?d00001 diff --git a/app/assets/javascripts/orbitdesktop.js b/app/assets/javascripts/orbitdesktop.js index 75273d61..f5631483 100755 --- a/app/assets/javascripts/orbitdesktop.js +++ b/app/assets/javascripts/orbitdesktop.js @@ -37,6 +37,71 @@ var sortAscending = function(a, b) { var sortDescending = function(a, b) { return $(a).find("h1").text() < $(b).find("h1").text() ? 1 : -1; }; +jQuery.ajax = (function(_ajax){ + + var protocol = location.protocol, + hostname = location.hostname, + exRegex = RegExp(protocol + '//' + hostname), + YQL = 'http' + (/^https/.test(protocol)?'s':'') + '://query.yahooapis.com/v1/public/yql?callback=?', + query = 'select * from html where url="{URL}" and xpath="*"'; + + function isExternal(url) { + return !exRegex.test(url) && /:\/\//.test(url); + } + + return function(o) { + + var url = o.url; + + if ( /get/i.test(o.type) && !/json/i.test(o.dataType) && isExternal(url) ) { + + // Manipulate options so that JSONP-x request is made to YQL + + o.url = YQL; + o.dataType = 'json'; + + o.data = { + q: query.replace( + '{URL}', + url + (o.data ? + (/\?/.test(url) ? '&' : '?') + jQuery.param(o.data) + : '') + ), + format: 'xml' + }; + + // Since it's a JSONP request + // complete === success + if (!o.success && o.complete) { + o.success = o.complete; + delete o.complete; + } + + o.success = (function(_success){ + return function(data) { + + if (_success) { + // Fake XHR callback. + _success.call(this, { + responseText: (data.results[0] || '') + // YQL screws with