| author | ymh <ymh.work@gmail.com> |
| Sun, 14 Jul 2024 21:15:54 +0200 | |
| changeset 663 | 9cb6028fcf55 |
| parent 510 | a8f02d66bf02 |
| permissions | -rw-r--r-- |
| 471 | 1 |
(function(root) { |
2 |
"use strict"; |
|
3 |
|
|
4 |
var Backbone = root.Backbone; |
|
5 |
|
|
6 |
var Router = root.Rkns.Router = Backbone.Router.extend({ |
|
7 |
routes: { |
|
| 473 | 8 |
'': 'index' |
| 471 | 9 |
}, |
10 |
|
|
| 473 | 11 |
index: function (parameters) { |
| 471 | 12 |
|
| 473 | 13 |
var result = {}; |
|
510
a8f02d66bf02
adapt the viewRepr to support a temp View (a representation without a model)
rougeronj
parents:
473
diff
changeset
|
14 |
if (parameters !== null){ |
|
a8f02d66bf02
adapt the viewRepr to support a temp View (a representation without a model)
rougeronj
parents:
473
diff
changeset
|
15 |
parameters.split("&").forEach(function(part) { |
|
a8f02d66bf02
adapt the viewRepr to support a temp View (a representation without a model)
rougeronj
parents:
473
diff
changeset
|
16 |
var item = part.split("="); |
|
a8f02d66bf02
adapt the viewRepr to support a temp View (a representation without a model)
rougeronj
parents:
473
diff
changeset
|
17 |
result[item[0]] = decodeURIComponent(item[1]); |
|
a8f02d66bf02
adapt the viewRepr to support a temp View (a representation without a model)
rougeronj
parents:
473
diff
changeset
|
18 |
}); |
| 473 | 19 |
} |
|
510
a8f02d66bf02
adapt the viewRepr to support a temp View (a representation without a model)
rougeronj
parents:
473
diff
changeset
|
20 |
this.trigger('router', result); |
| 471 | 21 |
} |
22 |
}); |
|
23 |
||
24 |
})(window); |