Skip to content

Commit

Permalink
+ correctly handle query string when using + or #
Browse files Browse the repository at this point in the history
  • Loading branch information
floere committed Feb 5, 2012
1 parent 86e8af2 commit 1dc88ea
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 42 deletions.
7 changes: 4 additions & 3 deletions client/javascripts/picky.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified client/javascripts/picky.source.js.tar
Binary file not shown.
24 changes: 6 additions & 18 deletions client/javascripts/source/picky.controller.js
Expand Up @@ -16,7 +16,7 @@ var PickyController = function(config) {
//
var extractQuery = function(url) {
var match = url && url.match(/q=([^&]+)/);
return match && unescape(match[1] || "");
return match && decodeURIComponent(match[1]).replace(/\+/g, ' ').replace(/#/g, '') || "";
};
this.extractQuery = extractQuery;

Expand Down Expand Up @@ -99,16 +99,10 @@ var PickyController = function(config) {
if (full) { fullSearch(query, params); }
};

var clearButtonClicked = function() {
clearInterval(liveSearchTimerId);
// liveSearchTimer.stop();
};
var clearButtonClicked = function() { clearInterval(liveSearchTimerId); };
this.clearButtonClicked = clearButtonClicked;

var searchTextCleared = function() {
clearInterval(liveSearchTimerId);
// liveSearchTimer.stop();
};
var searchTextCleared = function() { clearInterval(liveSearchTimerId); };
this.searchTextCleared = searchTextCleared;

var shouldTriggerSearch = function(event) {
Expand All @@ -131,19 +125,13 @@ var PickyController = function(config) {
};
this.searchTextEntered = searchTextEntered;

var searchButtonClicked = function(text) {
fullSearch(text);
};
var searchButtonClicked = function(text) { fullSearch(text); };
this.searchButtonClicked = searchButtonClicked;

var allocationChosen = function(text) {
fullSearch(text);
};
var allocationChosen = function(text) { fullSearch(text); };
this.allocationChosen = allocationChosen;

// Move to a view object.
var addinationClicked = function(text, event) {
fullSearch(text, { offset: event.data.offset });
};
var addinationClicked = function(text, event) { fullSearch(text, { offset: event.data.offset }); };
this.addinationClicked = addinationClicked;
};
24 changes: 6 additions & 18 deletions client/test_project/javascripts/picky.controller.js
Expand Up @@ -16,7 +16,7 @@ var PickyController = function(config) {
//
var extractQuery = function(url) {
var match = url && url.match(/q=([^&]+)/);
return match && unescape(match[1] || "");
return match && decodeURIComponent(match[1]).replace(/\+/g, ' ').replace(/#/g, '') || "";
};
this.extractQuery = extractQuery;

Expand Down Expand Up @@ -99,16 +99,10 @@ var PickyController = function(config) {
if (full) { fullSearch(query, params); }
};

var clearButtonClicked = function() {
clearInterval(liveSearchTimerId);
// liveSearchTimer.stop();
};
var clearButtonClicked = function() { clearInterval(liveSearchTimerId); };
this.clearButtonClicked = clearButtonClicked;

var searchTextCleared = function() {
clearInterval(liveSearchTimerId);
// liveSearchTimer.stop();
};
var searchTextCleared = function() { clearInterval(liveSearchTimerId); };
this.searchTextCleared = searchTextCleared;

var shouldTriggerSearch = function(event) {
Expand All @@ -131,19 +125,13 @@ var PickyController = function(config) {
};
this.searchTextEntered = searchTextEntered;

var searchButtonClicked = function(text) {
fullSearch(text);
};
var searchButtonClicked = function(text) { fullSearch(text); };
this.searchButtonClicked = searchButtonClicked;

var allocationChosen = function(text) {
fullSearch(text);
};
var allocationChosen = function(text) { fullSearch(text); };
this.allocationChosen = allocationChosen;

// Move to a view object.
var addinationClicked = function(text, event) {
fullSearch(text, { offset: event.data.offset });
};
var addinationClicked = function(text, event) { fullSearch(text, { offset: event.data.offset }); };
this.addinationClicked = addinationClicked;
};
7 changes: 4 additions & 3 deletions generators/prototypes/client/sinatra/javascripts/picky.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1dc88ea

Please sign in to comment.