|
1
|
|
|
/* |
|
2
|
|
|
* This file is part of the Sulu CMS. |
|
3
|
|
|
* |
|
4
|
|
|
* (c) MASSIVE ART WebServices GmbH |
|
5
|
|
|
* |
|
6
|
|
|
* This source file is subject to the MIT license that is bundled |
|
7
|
|
|
* with this source code in the file LICENSE. |
|
8
|
|
|
*/ |
|
9
|
|
|
|
|
10
|
|
|
define(['services/husky/mediator', 'suluarticle/services/base-router'], function(Mediator, BaseRouter) { |
|
11
|
|
|
|
|
12
|
|
|
'use strict'; |
|
13
|
|
|
|
|
14
|
|
|
var routes = { |
|
15
|
|
|
list: _.template('articles:<%= type %>/<%= locale %>'), |
|
|
|
|
|
|
16
|
|
|
add: _.template('articles/<%= locale %>/add:<%= type %>') |
|
17
|
|
|
}, |
|
18
|
|
|
|
|
19
|
|
|
goto = function(route) { |
|
20
|
|
|
Mediator.emit('sulu.router.navigate', route); |
|
21
|
|
|
}; |
|
22
|
|
|
|
|
23
|
|
|
return { |
|
24
|
|
|
toList: function(locale, type) { |
|
25
|
|
|
goto(routes.list({locale: locale, type: type})); |
|
26
|
|
|
}, |
|
27
|
|
|
toAdd: function(locale, type) { |
|
28
|
|
|
goto(routes.add({locale: locale, type: type})); |
|
29
|
|
|
}, |
|
30
|
|
|
toEdit: function(id, locale, tab) { |
|
31
|
|
|
BaseRouter.toEdit(id, locale, tab); |
|
32
|
|
|
}, |
|
33
|
|
|
toEditForce: function(id, locale, tab) { |
|
34
|
|
|
BaseRouter.toEditForce(id, locale, tab); |
|
35
|
|
|
}, |
|
36
|
|
|
toEditUpdate: function(id, locale, tab) { |
|
37
|
|
|
BaseRouter.toEditUpdate(id, locale, tab); |
|
38
|
|
|
}, |
|
39
|
|
|
toPageEdit: function(id, page, locale) { |
|
40
|
|
|
BaseRouter.toPageEdit(id, page, locale); |
|
41
|
|
|
}, |
|
42
|
|
|
toPageAdd: function(id, locale) { |
|
43
|
|
|
BaseRouter.toPageAdd(id, locale); |
|
44
|
|
|
} |
|
45
|
|
|
}; |
|
46
|
|
|
}); |
|
47
|
|
|
|
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.