summaryrefslogtreecommitdiff
path: root/src/main.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-11-29 21:53:13 +0200
committerAlon Levy <alon@pobox.com>2014-11-29 22:30:16 +0200
commit87cb13da2cf203ad504904c9f6983297c531bd3e (patch)
treec354f953b271217366ed3de1e5a2a8fa4ff7dddc /src/main.js
parentb23df21411df756a2549857fd7bd02839b2b4fac (diff)
move getParmeterByName to util
Diffstat (limited to 'src/main.js')
-rw-r--r--src/main.js14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/main.js b/src/main.js
index feefcf57..80837cdb 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,12 +1,5 @@
-define(['textanalysis.ui', 'textanalysis', 'buttons', 'history', 'drag_n_drop', 'robot', 'model/core', 'rz_config', 'rz_core', 'view/selection'],
-function(textanalysis_ui, textanalysis, buttons, history, drag_n_drop, robot, model_core, rz_config, rz_core, selection) {
-
- function getParameterByName(name) {
- name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
- var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
- results = regex.exec(location.search);
- return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
- }
+define(['textanalysis.ui', 'textanalysis', 'buttons', 'history', 'drag_n_drop', 'robot', 'model/core', 'rz_config', 'rz_core', 'view/selection', 'util'],
+function(textanalysis_ui, textanalysis, buttons, history, drag_n_drop, robot, model_core, rz_config, rz_core, selection, util) {
function expand(obj){
if (!obj.savesize) {
@@ -26,8 +19,7 @@ function(textanalysis_ui, textanalysis, buttons, history, drag_n_drop,
textanalysis_ui.main();
- // TODO: jquery BBQ: $.deparam.querystring().json;
- json = getParameterByName('json');
+ json = util.getParameterByName('json');
if (json) {
rz_core.load_from_json(json);
}