diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 01decd871..491bf9961 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -10,6 +10,7 @@ - **Button** - Added `labeled button` variation for display a count next to a button. - **Divider** - Vertical divider can now be used multiple times in a single column row (not just 50/50 split). #2808 - **Input** - Added `disabled` state for inputs #2694 +- **API** - Added `encodeParameters` option to enable/disable parameters being encoded with `encodeURIComponent` #2752 **Additional Enhancements** - **Menu** - `text menu` now uses padding for hitboxes to make target area for links larger diff --git a/src/definitions/behaviors/api.js b/src/definitions/behaviors/api.js index 401d6f9a2..2c3845ef0 100644 --- a/src/definitions/behaviors/api.js +++ b/src/definitions/behaviors/api.js @@ -109,7 +109,7 @@ $.api = $.fn.api = function(parameters) { ; } else if(settings.on == 'now') { - module.debug('Querying API now', triggerEvent); + module.debug('Querying API endpoint immediately'); module.query(); } } @@ -358,7 +358,11 @@ $.api = $.fn.api = function(parameters) { } else { module.verbose('Found required variable', variable, value); - url = url.replace(templatedString, module.get.urlEncodedValue(value)); + value = (settings.encodeParameters) + ? module.get.urlEncodedValue(value) + : value + ; + url = url.replace(templatedString, value); } }); } @@ -724,7 +728,7 @@ $.api = $.fn.api = function(parameters) { module.debug('URL value is already encoded, avoiding double encoding', value); return value; } - module.verbose('Encoding value for url', value, encodedValue); + module.verbose('Encoding value using encodeURIComponent', value, encodedValue); return encodedValue; }, defaultData: function() { @@ -990,7 +994,7 @@ $.api.settings = { name : 'API', namespace : 'api', - debug : true, + debug : false, verbose : false, performance : true, @@ -1015,6 +1019,8 @@ $.api.settings = { // duration for error state errorDuration : 2000, + encodeParameters : true, + // API action to use action : false, diff --git a/src/definitions/modules/tab.js b/src/definitions/modules/tab.js index e1860d8b3..ee91e30b7 100644 --- a/src/definitions/modules/tab.js +++ b/src/definitions/modules/tab.js @@ -440,10 +440,11 @@ $.fn.tab = function(parameters) { var $tab = module.get.tabElement(tabPath), apiSettings = { - dataType : 'html', - on : 'now', - cache : settings.alwaysRefresh, - headers : { + dataType : 'html', + encodeParameters : false, + on : 'now', + cache : settings.alwaysRefresh, + headers : { 'X-Remote': true }, onSuccess : function(response) {