mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/10271] Moved $.querystring to phpbb.parse_querystring.
PHPBB3-10271
This commit is contained in:
parent
082c5c5b32
commit
fa2c06e2ca
1 changed files with 18 additions and 13 deletions
|
@ -3,18 +3,6 @@ var phpbb = {};
|
||||||
(function($) { //avoid conflicts with other libraries
|
(function($) { //avoid conflicts with other libraries
|
||||||
|
|
||||||
|
|
||||||
$.querystring = function(string) {
|
|
||||||
var end = {}, i;
|
|
||||||
|
|
||||||
string = string.split('&');
|
|
||||||
for (i = 0; i < string.length; i++)
|
|
||||||
{
|
|
||||||
end[string[i].split('=')[0]] = decodeURIComponent(string[i].split('=')[1]);
|
|
||||||
}
|
|
||||||
return end;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var dark = $('<div id="darkenwrapper"><div id="darken"> </div></div>');
|
var dark = $('<div id="darkenwrapper"><div id="darken"> </div></div>');
|
||||||
$('body').append(dark);
|
$('body').append(dark);
|
||||||
|
|
||||||
|
@ -160,6 +148,23 @@ phpbb.confirm = function(msg, callback, fadedark) {
|
||||||
return div;
|
return div;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn a querystring into an array.
|
||||||
|
*
|
||||||
|
* @argument string string The querystring to parse.
|
||||||
|
* @returns array The array created.
|
||||||
|
*/
|
||||||
|
phpbb.parse_querystring = function(string) {
|
||||||
|
var end = {}, i;
|
||||||
|
|
||||||
|
string = string.split('&');
|
||||||
|
for (i = 0; i < string.length; i++)
|
||||||
|
{
|
||||||
|
end[string[i].split('=')[0]] = decodeURIComponent(string[i].split('=')[1]);
|
||||||
|
}
|
||||||
|
return end;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Makes a link use AJAX instead of loading an entire page.
|
* Makes a link use AJAX instead of loading an entire page.
|
||||||
|
@ -382,7 +387,7 @@ $('[data-ajax]').each(function() {
|
||||||
phpbb.ajaxify({
|
phpbb.ajaxify({
|
||||||
selector: '#quickmodform',
|
selector: '#quickmodform',
|
||||||
exception: function(el, act, data) {
|
exception: function(el, act, data) {
|
||||||
var d = $.querystring(data).action;
|
var d = phpbb.parse_querystring(data).action;
|
||||||
if (d == 'make_normal')
|
if (d == 'make_normal')
|
||||||
{
|
{
|
||||||
return !(el.find('select option[value="make_global"]').length);
|
return !(el.find('select option[value="make_global"]').length);
|
||||||
|
|
Loading…
Add table
Reference in a new issue