mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2011-09-21 Junichi Satoh <junichi@rworks.jp>
* include/javascript/jquery.pandora.controls.js: Fixed disabled agents are shown as blank. Contributed by Yusuke Arai. Thanks! git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4975 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
9a3a252d71
commit
1926f11216
@ -1,3 +1,8 @@
|
|||||||
|
2011-09-21 Junichi Satoh <junichi@rworks.jp>
|
||||||
|
|
||||||
|
* include/javascript/jquery.pandora.controls.js: Fixed disabled agents
|
||||||
|
are shown as blank. Contributed by Yusuke Arai. Thanks!
|
||||||
|
|
||||||
2011-09-21 Junichi Satoh <junichi@rworks.jp>
|
2011-09-21 Junichi Satoh <junichi@rworks.jp>
|
||||||
|
|
||||||
* include/help/ja/help_servers.php,
|
* include/help/ja/help_servers.php,
|
||||||
|
@ -2,118 +2,72 @@
|
|||||||
var dummyFunc = function () {
|
var dummyFunc = function () {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
$.extend ({
|
var _pandoraSelectGroupAgent = function (disabled) {
|
||||||
pandoraSelectGroupAgent: new function() {
|
var that = this;
|
||||||
this.defaults = {
|
|
||||||
agentSelect: "select#id_agent",
|
this.defaults = {
|
||||||
recursion: 0,
|
agentSelect: "select#id_agent",
|
||||||
loading: "#agent_loading",
|
recursion: 0,
|
||||||
callbackBefore: dummyFunc,
|
loading: "#agent_loading",
|
||||||
callbackPre: dummyFunc,
|
callbackBefore: dummyFunc,
|
||||||
callbackPost: dummyFunc,
|
callbackPre: dummyFunc,
|
||||||
callbackAfter: dummyFunc,
|
callbackPost: dummyFunc,
|
||||||
debug: false
|
callbackAfter: dummyFunc,
|
||||||
};
|
debug: false,
|
||||||
|
disabled: disabled || false,
|
||||||
/* public methods */
|
};
|
||||||
this.construct = function (settings) {
|
|
||||||
return this.each (function() {
|
/* public methods */
|
||||||
this.config = {};
|
this.construct = function (settings) {
|
||||||
|
return this.each (function() {
|
||||||
this.config = $.extend (this.config, $.pandoraSelectGroupAgent.defaults, settings);
|
this.config = {};
|
||||||
var config = this.config;
|
|
||||||
|
this.config = $.extend (this.config, that.defaults, settings);
|
||||||
$(this).change (function () {
|
var config = this.config;
|
||||||
var $select = $(config.agentSelect).disable ();
|
|
||||||
$(config.loading).show ();
|
$(this).change (function () {
|
||||||
$("option[value!=0]", $select).remove ();
|
var $select = $(config.agentSelect).disable ();
|
||||||
if (! config.callbackBefore (this))
|
$(config.loading).show ();
|
||||||
return;
|
$("option[value!=0]", $select).remove ();
|
||||||
|
if (! config.callbackBefore (this))
|
||||||
jQuery.post ("ajax.php",
|
return;
|
||||||
{"page" : "godmode/groups/group_list",
|
|
||||||
"get_group_agents" : 1,
|
var opts = {
|
||||||
"id_group" : this.value,
|
"page" : "godmode/groups/group_list",
|
||||||
"recursion" : config.recursion
|
"get_group_agents" : 1,
|
||||||
},
|
"id_group" : this.value,
|
||||||
function (data, status) {
|
"recursion" : config.recursion,
|
||||||
jQuery.each (data, function (id, value) {
|
"disabled" : config.disabled ? 1 : 0,
|
||||||
if (id !== 'keycount'){
|
};
|
||||||
config.callbackPre ();
|
|
||||||
option = $("<option></option>")
|
jQuery.post ("ajax.php",
|
||||||
.attr ("value", id)
|
opts,
|
||||||
.html (value);
|
function (data, status) {
|
||||||
config.callbackPost (id, value, option);
|
jQuery.each (data, function (id, value) {
|
||||||
$(config.agentSelect).append (option);
|
if (id !== 'keycount'){
|
||||||
}
|
|
||||||
});
|
|
||||||
$(config.loading).hide ();
|
|
||||||
$select.enable ();
|
|
||||||
config.callbackAfter ();
|
|
||||||
},
|
|
||||||
"json"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$.extend ({
|
|
||||||
pandoraSelectGroupAgentDisabled: new function() {
|
|
||||||
this.defaults = {
|
|
||||||
agentSelect: "select#id_agent",
|
|
||||||
recursion: 0,
|
|
||||||
loading: "#agent_loading",
|
|
||||||
callbackBefore: dummyFunc,
|
|
||||||
callbackPre: dummyFunc,
|
|
||||||
callbackPost: dummyFunc,
|
|
||||||
callbackAfter: dummyFunc,
|
|
||||||
debug: false
|
|
||||||
};
|
|
||||||
|
|
||||||
/* public methods */
|
|
||||||
this.construct = function (settings) {
|
|
||||||
return this.each (function() {
|
|
||||||
this.config = {};
|
|
||||||
|
|
||||||
this.config = $.extend (this.config, $.pandoraSelectGroupAgentDisabled.defaults, settings);
|
|
||||||
var config = this.config;
|
|
||||||
|
|
||||||
$(this).change (function () {
|
|
||||||
var $select = $(config.agentSelect).disable ();
|
|
||||||
$(config.loading).show ();
|
|
||||||
$("option[value!=0]", $select).remove ();
|
|
||||||
if (! config.callbackBefore (this))
|
|
||||||
return;
|
|
||||||
|
|
||||||
jQuery.post ("ajax.php",
|
|
||||||
{"page" : "godmode/groups/group_list",
|
|
||||||
"get_group_agents" : 1,
|
|
||||||
"disabled" : 1,
|
|
||||||
"id_group" : this.value,
|
|
||||||
"recursion" : config.recursion
|
|
||||||
},
|
|
||||||
function (data, status) {
|
|
||||||
jQuery.each (data, function (id, value) {
|
|
||||||
config.callbackPre ();
|
config.callbackPre ();
|
||||||
option = $("<option></option>")
|
option = $("<option></option>")
|
||||||
.attr ("value", id)
|
.attr ("value", id)
|
||||||
.html (value);
|
.html (value);
|
||||||
config.callbackPost (id, value, option);
|
config.callbackPost (id, value, option);
|
||||||
$(config.agentSelect).append (option);
|
$(config.agentSelect).append (option);
|
||||||
});
|
}
|
||||||
$(config.loading).hide ();
|
});
|
||||||
$select.enable ();
|
$(config.loading).hide ();
|
||||||
config.callbackAfter ();
|
$select.enable ();
|
||||||
},
|
config.callbackAfter ();
|
||||||
"json"
|
},
|
||||||
);
|
"json"
|
||||||
});
|
);
|
||||||
});
|
});
|
||||||
};
|
});
|
||||||
}
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
$.extend ({
|
||||||
|
pandoraSelectGroupAgent: new _pandoraSelectGroupAgent(),
|
||||||
|
pandoraSelectGroupAgentDisabled: new _pandoraSelectGroupAgent(true),
|
||||||
});
|
});
|
||||||
|
|
||||||
$.extend ({
|
$.extend ({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user