summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-03-21 12:56:14 +0100
committerBernhard Posselt <nukeawhale@gmail.com>2013-03-21 12:56:14 +0100
commitaa4916b829fd509735f529d3dd961cd17feb6d57 (patch)
tree82550df94bde4af531f9b6fabbafdca10f646745 /js
parentf435e1261b7a993f9520b5a887af0083a6c4f001 (diff)
wired routing
Diffstat (limited to 'js')
-rw-r--r--js/app/services/persistence.coffee38
-rw-r--r--js/public/app.js38
-rw-r--r--js/tests/services/persistenceSpec.coffee40
3 files changed, 58 insertions, 58 deletions
diff --git a/js/app/services/persistence.coffee b/js/app/services/persistence.coffee
index 9070a9a68..80d8d391d 100644
--- a/js/app/services/persistence.coffee
+++ b/js/app/services/persistence.coffee
@@ -73,7 +73,7 @@ angular.module('News').factory '_Persistence', ->
getStarredItems: (onSuccess) ->
params =
onSuccess: onSuccess
- @_request.get 'news_starred_items', params
+ @_request.get 'news_items_starred', params
starItem: (itemId) ->
@@ -84,7 +84,7 @@ angular.module('News').factory '_Persistence', ->
urlParams:
itemId: itemId
- @_request.post 'news_star_item', params
+ @_request.post 'news_items_star', params
@@ -96,7 +96,7 @@ angular.module('News').factory '_Persistence', ->
urlParams:
itemId: itemId
- @_request.post 'news_unstar_item', params
+ @_request.post 'news_items_unstar', params
readItem: (itemId) ->
@@ -107,7 +107,7 @@ angular.module('News').factory '_Persistence', ->
urlParams:
itemId: itemId
- @_request.post 'news_read_item', params
+ @_request.post 'news_items_read', params
@@ -119,7 +119,7 @@ angular.module('News').factory '_Persistence', ->
urlParams:
itemId: itemId
- @_request.post 'news_unread_item', params
+ @_request.post 'news_items_unread', params
###
@@ -137,7 +137,7 @@ angular.module('News').factory '_Persistence', ->
params =
onSuccess: onSuccess
- @_request.get 'news_active_feed', params
+ @_request.get 'news_feeds_active', params
createFeed: (url, parentFolderId, onSuccess, onFailure) ->
@@ -148,7 +148,7 @@ angular.module('News').factory '_Persistence', ->
onSuccess: onSuccess
onFailure: onFailure
- @_request.post 'news_create_feed', params
+ @_request.post 'news_feeds_create', params
deleteFeed: (feedId) ->
@@ -156,7 +156,7 @@ angular.module('News').factory '_Persistence', ->
urlParams:
feedId: feedId
- @_request.post 'news_delete_feed', params
+ @_request.post 'news_feeds_delete', params
moveFeed: (feedId, folderId) ->
@@ -169,7 +169,7 @@ angular.module('News').factory '_Persistence', ->
data:
folderId: folderId
- @_request.post 'news_move_feed', params
+ @_request.post 'news_feeds_move', params
setFeedRead: (feedId, highestItemId) ->
@@ -182,7 +182,7 @@ angular.module('News').factory '_Persistence', ->
data:
highestItemId: highestItemId
- @_request.post 'news_set_feed_read', params
+ @_request.post 'news_feeds_read', params
updateFeed: (feedId) ->
@@ -193,7 +193,7 @@ angular.module('News').factory '_Persistence', ->
urlParams:
feedId: feedId
- @_request.post 'news_update_feed', params
+ @_request.post 'news_feeds_update', params
###
@@ -215,7 +215,7 @@ angular.module('News').factory '_Persistence', ->
urlParams:
folderId: folderId
- @_request.post 'news_open_folder', params
+ @_request.post 'news_folders_open', params
collapseFolder: (folderId) ->
@@ -226,7 +226,7 @@ angular.module('News').factory '_Persistence', ->
urlParams:
folderId: folderId
- @_request.post 'news_collapse_folder', params
+ @_request.post 'news_folders_collapse', params
createFolder: (folderName, parentFolderId=0, onSuccess=null,
@@ -241,7 +241,7 @@ angular.module('News').factory '_Persistence', ->
onSuccess: onSuccess
onFailure: onFailure
- @_request.post 'news_create_folder', params
+ @_request.post 'news_folders_create', params
deleteFolder: (folderId) ->
@@ -253,7 +253,7 @@ angular.module('News').factory '_Persistence', ->
folderId: folderId
- @_request.post 'news_delete_folder', params
+ @_request.post 'news_folders_delete', params
renameFolder: (folderId, folderName) ->
@@ -266,7 +266,7 @@ angular.module('News').factory '_Persistence', ->
data:
folderName: folderName
- @_request.post 'news_rename_folder', params
+ @_request.post 'news_folders_rename', params
@@ -291,21 +291,21 @@ angular.module('News').factory '_Persistence', ->
params =
onSuccess: callback
- @_request.get 'news_user_settings_read', params
+ @_request.get 'news_usersettings_read', params
userSettingsReadShow: ->
###
Sets the reader mode to show all
###
- @_request.post 'news_user_settings_read_show'
+ @_request.post 'news_usersettings_read_show'
userSettingsReadHide: ->
###
Sets the reader mode to show only unread
###
- @_request.post 'news_user_settings_read_hide'
+ @_request.post 'news_usersettings_read_hide'
_trigerHideRead: ->
diff --git a/js/public/app.js b/js/public/app.js
index 49abacf91..84953edac 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -522,7 +522,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
params = {
onSuccess: onSuccess
};
- return this._request.get('news_starred_items', params);
+ return this._request.get('news_items_starred', params);
};
Persistence.prototype.starItem = function(itemId) {
@@ -536,7 +536,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
itemId: itemId
}
};
- return this._request.post('news_star_item', params);
+ return this._request.post('news_items_star', params);
};
Persistence.prototype.unstarItem = function(itemId) {
@@ -550,7 +550,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
itemId: itemId
}
};
- return this._request.post('news_unstar_item', params);
+ return this._request.post('news_items_unstar', params);
};
Persistence.prototype.readItem = function(itemId) {
@@ -564,7 +564,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
itemId: itemId
}
};
- return this._request.post('news_read_item', params);
+ return this._request.post('news_items_read', params);
};
Persistence.prototype.unreadItem = function(itemId) {
@@ -578,7 +578,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
itemId: itemId
}
};
- return this._request.post('news_unread_item', params);
+ return this._request.post('news_items_unread', params);
};
/*
@@ -600,7 +600,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
params = {
onSuccess: onSuccess
};
- return this._request.get('news_active_feed', params);
+ return this._request.get('news_feeds_active', params);
};
Persistence.prototype.createFeed = function(url, parentFolderId, onSuccess, onFailure) {
@@ -613,7 +613,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
onSuccess: onSuccess,
onFailure: onFailure
};
- return this._request.post('news_create_feed', params);
+ return this._request.post('news_feeds_create', params);
};
Persistence.prototype.deleteFeed = function(feedId) {
@@ -623,7 +623,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
feedId: feedId
}
};
- return this._request.post('news_delete_feed', params);
+ return this._request.post('news_feeds_delete', params);
};
Persistence.prototype.moveFeed = function(feedId, folderId) {
@@ -640,7 +640,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
folderId: folderId
}
};
- return this._request.post('news_move_feed', params);
+ return this._request.post('news_feeds_move', params);
};
Persistence.prototype.setFeedRead = function(feedId, highestItemId) {
@@ -657,7 +657,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
highestItemId: highestItemId
}
};
- return this._request.post('news_set_feed_read', params);
+ return this._request.post('news_feeds_read', params);
};
Persistence.prototype.updateFeed = function(feedId) {
@@ -671,7 +671,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
feedId: feedId
}
};
- return this._request.post('news_update_feed', params);
+ return this._request.post('news_feeds_update', params);
};
/*
@@ -699,7 +699,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
folderId: folderId
}
};
- return this._request.post('news_open_folder', params);
+ return this._request.post('news_folders_open', params);
};
Persistence.prototype.collapseFolder = function(folderId) {
@@ -713,7 +713,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
folderId: folderId
}
};
- return this._request.post('news_collapse_folder', params);
+ return this._request.post('news_folders_collapse', params);
};
Persistence.prototype.createFolder = function(folderName, parentFolderId, onSuccess, onFailure) {
@@ -737,7 +737,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
onSuccess: onSuccess,
onFailure: onFailure
};
- return this._request.post('news_create_folder', params);
+ return this._request.post('news_folders_create', params);
};
Persistence.prototype.deleteFolder = function(folderId) {
@@ -751,7 +751,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
folderId: folderId
}
};
- return this._request.post('news_delete_folder', params);
+ return this._request.post('news_folders_delete', params);
};
Persistence.prototype.renameFolder = function(folderId, folderName) {
@@ -768,7 +768,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
folderName: folderName
}
};
- return this._request.post('news_rename_folder', params);
+ return this._request.post('news_folders_rename', params);
};
/*
@@ -801,21 +801,21 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
params = {
onSuccess: callback
};
- return this._request.get('news_user_settings_read', params);
+ return this._request.get('news_usersettings_read', params);
};
Persistence.prototype.userSettingsReadShow = function() {
/*
Sets the reader mode to show all
*/
- return this._request.post('news_user_settings_read_show');
+ return this._request.post('news_usersettings_read_show');
};
Persistence.prototype.userSettingsReadHide = function() {
/*
Sets the reader mode to show only unread
*/
- return this._request.post('news_user_settings_read_hide');
+ return this._request.post('news_usersettings_read_hide');
};
Persistence.prototype._trigerHideRead = function() {
diff --git a/js/tests/services/persistenceSpec.coffee b/js/tests/services/persistenceSpec.coffee
index 2dbcb9ed2..ea2483af0 100644
--- a/js/tests/services/persistenceSpec.coffee
+++ b/js/tests/services/persistenceSpec.coffee
@@ -95,7 +95,7 @@ describe '_Persistence', ->
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
pers.getStarredItems(params.onSuccess)
- expect(@req.get).toHaveBeenCalledWith('news_starred_items', params)
+ expect(@req.get).toHaveBeenCalledWith('news_items_starred', params)
it 'send a correct star item request', =>
@@ -106,7 +106,7 @@ describe '_Persistence', ->
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
pers.starItem(params.urlParams.itemId)
- expect(@req.post).toHaveBeenCalledWith('news_star_item', params)
+ expect(@req.post).toHaveBeenCalledWith('news_items_star', params)
it 'send a correct unstar item request', =>
@@ -117,7 +117,7 @@ describe '_Persistence', ->
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
pers.unstarItem(params.urlParams.itemId)
- expect(@req.post).toHaveBeenCalledWith('news_unstar_item', params)
+ expect(@req.post).toHaveBeenCalledWith('news_items_unstar', params)
it 'send a correct read item request', =>
@@ -129,7 +129,7 @@ describe '_Persistence', ->
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
pers.readItem(params.urlParams.itemId)
- expect(@req.post).toHaveBeenCalledWith('news_read_item', params)
+ expect(@req.post).toHaveBeenCalledWith('news_items_read', params)
it 'send a correct unread item request', =>
@@ -140,7 +140,7 @@ describe '_Persistence', ->
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
pers.unreadItem(params.urlParams.itemId)
- expect(@req.post).toHaveBeenCalledWith('news_unread_item', params)
+ expect(@req.post).toHaveBeenCalledWith('news_items_unread', params)
@@ -167,7 +167,7 @@ describe '_Persistence', ->
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
pers.moveFeed(params.urlParams.feedId, params.data.folderId)
- expect(@req.post).toHaveBeenCalledWith('news_move_feed', params)
+ expect(@req.post).toHaveBeenCalledWith('news_feeds_move', params)
it 'shoud send a correct request for marking all items read', =>
@@ -181,7 +181,7 @@ describe '_Persistence', ->
pers.setFeedRead(params.urlParams.feedId, params.data.highestItemId)
- expect(@req.post).toHaveBeenCalledWith('news_set_feed_read', params)
+ expect(@req.post).toHaveBeenCalledWith('news_feeds_read', params)
it 'send a correct feed update request', =>
@@ -192,7 +192,7 @@ describe '_Persistence', ->
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
pers.updateFeed(params.urlParams.feedId)
- expect(@req.post).toHaveBeenCalledWith('news_update_feed', params)
+ expect(@req.post).toHaveBeenCalledWith('news_feeds_update', params)
it 'send a correct get active feed request', =>
@@ -202,7 +202,7 @@ describe '_Persistence', ->
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
pers.getActiveFeed(params.onSuccess)
- expect(@req.get).toHaveBeenCalledWith('news_active_feed', params)
+ expect(@req.get).toHaveBeenCalledWith('news_feeds_active', params)
it 'send a correct feed delete request', =>
@@ -213,7 +213,7 @@ describe '_Persistence', ->
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
pers.deleteFeed(params.urlParams.feedId)
- expect(@req.post).toHaveBeenCalledWith('news_delete_feed', params)
+ expect(@req.post).toHaveBeenCalledWith('news_feeds_delete', params)
it 'send a correct feed create request', =>
@@ -228,7 +228,7 @@ describe '_Persistence', ->
pers.createFeed(params.data.url, params.data.parentFolderId,
params.onSuccess, params.onFailure)
- expect(@req.post).toHaveBeenCalledWith('news_create_feed', params)
+ expect(@req.post).toHaveBeenCalledWith('news_feeds_create', params)
@@ -253,7 +253,7 @@ describe '_Persistence', ->
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
pers.collapseFolder(params.urlParams.folderId)
- expect(@req.post).toHaveBeenCalledWith('news_collapse_folder', params)
+ expect(@req.post).toHaveBeenCalledWith('news_folders_collapse', params)
it 'send a correct open folder request', =>
@@ -264,7 +264,7 @@ describe '_Persistence', ->
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
pers.openFolder(params.urlParams.folderId)
- expect(@req.post).toHaveBeenCalledWith('news_open_folder', params)
+ expect(@req.post).toHaveBeenCalledWith('news_folders_open', params)
it 'should do a proper folder create request', =>
@@ -279,7 +279,7 @@ describe '_Persistence', ->
pers.createFolder(params.data.folderName, params.data.parentFolderId,
params.onSuccess, params.onFailure)
- expect(@req.post).toHaveBeenCalledWith('news_create_folder', params)
+ expect(@req.post).toHaveBeenCalledWith('news_folders_create', params)
it 'should do a proper folder delete request', =>
@@ -290,7 +290,7 @@ describe '_Persistence', ->
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
pers.deleteFolder(params.urlParams.folderId)
- expect(@req.post).toHaveBeenCalledWith('news_delete_folder', params)
+ expect(@req.post).toHaveBeenCalledWith('news_folders_delete', params)
it 'should do a proper folder rename request', =>
@@ -303,7 +303,7 @@ describe '_Persistence', ->
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
pers.renameFolder(params.urlParams.folderId, params.data.folderName)
- expect(@req.post).toHaveBeenCalledWith('news_rename_folder', params)
+ expect(@req.post).toHaveBeenCalledWith('news_folders_rename', params)
###
@@ -326,7 +326,7 @@ describe '_Persistence', ->
params =
onSuccess: angular.noop
- expect(@req.get).toHaveBeenCalledWith('news_user_settings_read', params)
+ expect(@req.get).toHaveBeenCalledWith('news_usersettings_read', params)
it 'should do a proper get user settings read req and call callback', =>
@@ -336,14 +336,14 @@ describe '_Persistence', ->
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
pers.userSettingsRead(params.onSuccess)
- expect(@req.get).toHaveBeenCalledWith('news_user_settings_read', params)
+ expect(@req.get).toHaveBeenCalledWith('news_usersettings_read', params)
it 'should do a proper user settings read show request', =>
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
pers.userSettingsReadShow()
- expect(@req.post).toHaveBeenCalledWith('news_user_settings_read_show')
+ expect(@req.post).toHaveBeenCalledWith('news_usersettings_read_show')
@@ -351,4 +351,4 @@ describe '_Persistence', ->
pers = new @_Persistence(@req, @loading, @config, @active, @$rootScope)
pers.userSettingsReadHide()
- expect(@req.post).toHaveBeenCalledWith('news_user_settings_read_hide') \ No newline at end of file
+ expect(@req.post).toHaveBeenCalledWith('news_usersettings_read_hide') \ No newline at end of file