From 87cb13da2cf203ad504904c9f6983297c531bd3e Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Sat, 29 Nov 2014 21:53:13 +0200 Subject: move getParmeterByName to util --- src/main.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/main.js') 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); } -- cgit v1.3.1