From 909b1786a1b0d42e7cb39cf6b18fffe2bc020652 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Tue, 23 Apr 2013 03:36:39 -0400 Subject: refactoring of the questions title search view --- askbot/media/js/live_search.js | 2 +- askbot/media/js/live_search_new_thread.js | 2 +- askbot/media/js/utils.js | 5 +++++ askbot/templates/embed/ask_by_widget.html | 2 +- askbot/templates/meta/bottom_scripts.html | 2 +- askbot/tests/page_load_tests.py | 6 +++--- askbot/urls.py | 7 +++---- askbot/views/commands.py | 17 +++++++++-------- 8 files changed, 24 insertions(+), 19 deletions(-) diff --git a/askbot/media/js/live_search.js b/askbot/media/js/live_search.js index 98e01179..1aebb6ce 100644 --- a/askbot/media/js/live_search.js +++ b/askbot/media/js/live_search.js @@ -461,7 +461,7 @@ FullTextSearch.prototype.sendTitleSearchQuery = function(query_text) { var data = {query_text: query_text}; var me = this; $.ajax({ - url: askbot['urls']['titleSearch'], + url: askbot['urls']['apiGetQuestions'], data: data, dataType: 'json', success: function(data, text_status, xhr){ diff --git a/askbot/media/js/live_search_new_thread.js b/askbot/media/js/live_search_new_thread.js index d17951eb..21b5c876 100644 --- a/askbot/media/js/live_search_new_thread.js +++ b/askbot/media/js/live_search_new_thread.js @@ -2,7 +2,7 @@ var liveSearchNewThreadInit = function(auto_focus_out) { var query = $('input#id_title.questionTitleInput'); var prev_text = $.trim(query.val()); - var search_url = askbot['urls']['titleSearch']; + var search_url = askbot['urls']['apiGetQuestions']; var running = false; var q_list_sel = 'question-list'; //id of question listing div diff --git a/askbot/media/js/utils.js b/askbot/media/js/utils.js index db15b656..f2cc0108 100644 --- a/askbot/media/js/utils.js +++ b/askbot/media/js/utils.js @@ -54,6 +54,11 @@ var getSingletonController = function(controllerClass, name) { return controller; }; +var setController = function(controller, name) { + askbot['controllers'] = askbot['controllers'] || {}; + askbot['controllers'][name] = controller; +}; + var getUniqueValues = function(values) { var uniques = new Object(); var out = new Array(); diff --git a/askbot/templates/embed/ask_by_widget.html b/askbot/templates/embed/ask_by_widget.html index 5060301c..0ad03d82 100644 --- a/askbot/templates/embed/ask_by_widget.html +++ b/askbot/templates/embed/ask_by_widget.html @@ -210,7 +210,7 @@