mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-19 05:58:34 +02:00
Merge with mainline
This commit is contained in:
@@ -225,7 +225,7 @@ div.right {
|
||||
.logo {
|
||||
float: right;
|
||||
/*margin: 5px 0 0 5px;*/
|
||||
height: 90px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.dropdown {
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.5 KiB |
+50
-20
@@ -9,7 +9,9 @@ var AnchorNavigation = new Class({
|
||||
checkinterval: 300,
|
||||
defloadingtext: gettext("Loading..."),
|
||||
defloadingcolor: "gray",
|
||||
defcallback: null
|
||||
defcallback: null,
|
||||
spin_disabled: false,
|
||||
spin_target: undefined
|
||||
},
|
||||
|
||||
initialize: function(deflocation, options) {
|
||||
@@ -29,13 +31,24 @@ var AnchorNavigation = new Class({
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* Disable the spinner.
|
||||
*/
|
||||
disable_spinner: function() {
|
||||
this.options.spin_disabled = true;
|
||||
},
|
||||
|
||||
enable_spinner: function() {
|
||||
this.options.spin_disabled = false;
|
||||
},
|
||||
|
||||
reset_loading_infos: function() {
|
||||
this.loading_message = this.options.defloadingtext;
|
||||
this.loading_color = this.options.defloadingcolor;
|
||||
},
|
||||
|
||||
reset: function() {
|
||||
this.base = null;
|
||||
this.base = '';
|
||||
this.params.empty();
|
||||
return this;
|
||||
},
|
||||
@@ -53,11 +66,13 @@ var AnchorNavigation = new Class({
|
||||
if (reset) {
|
||||
this.reset();
|
||||
}
|
||||
this.base = (splits[0] == "") ? this.deflocation : splits[0];
|
||||
this.base = splits[0];
|
||||
|
||||
var re = new RegExp("/$");
|
||||
if (!this.base.match(re)) {
|
||||
this.base += '/';
|
||||
if (this.base != "") {
|
||||
var re = new RegExp("/$");
|
||||
if (!this.base.match(re)) {
|
||||
this.base += '/';
|
||||
}
|
||||
}
|
||||
if (splits.length > 1) {
|
||||
var params = splits[1].split('&');
|
||||
@@ -112,6 +127,7 @@ var AnchorNavigation = new Class({
|
||||
for (var i = 0; i < elems.length; i++) {
|
||||
this.setparamfromstring(elems[i]);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
setparamfromstring: function(str) {
|
||||
@@ -182,16 +198,14 @@ var AnchorNavigation = new Class({
|
||||
},
|
||||
|
||||
check_anchor: function() {
|
||||
if (this.serialized == location.hash
|
||||
&& !$defined(this.force)) {
|
||||
if (this.serialized == location.hash && this.force == undefined) {
|
||||
return;
|
||||
}
|
||||
delete(this.force);
|
||||
this.from_string(location.hash);
|
||||
if (!this.serialized) {
|
||||
location.hash = this.deflocation;
|
||||
return;
|
||||
}
|
||||
|
||||
this.from_string((location.hash != "") ? location.hash : "#" + this.deflocation);
|
||||
location.hash = this.serialized;
|
||||
|
||||
if (!this.updatenext) {
|
||||
this.updatenext = true;
|
||||
return;
|
||||
@@ -199,10 +213,17 @@ var AnchorNavigation = new Class({
|
||||
|
||||
var query = this.serialized.substring(1);
|
||||
|
||||
infobox.show(this.loading_message, {
|
||||
profile: this.loading_color,
|
||||
spinner: true
|
||||
});
|
||||
if (!this.options.spin_disabled) {
|
||||
var target = this.options.spin_target ? this.options.spin_target
|
||||
: document.body;
|
||||
$(target).spin({
|
||||
message: this.loading_message
|
||||
});
|
||||
/*infobox.show(this.loading_message, {
|
||||
profile: this.loading_color,
|
||||
spinner: true
|
||||
});*/
|
||||
}
|
||||
new Request.JSON({
|
||||
url: query,
|
||||
noCache : true,
|
||||
@@ -210,16 +231,25 @@ var AnchorNavigation = new Class({
|
||||
ajax_login_redirect();
|
||||
},
|
||||
onSuccess: function(resp) {
|
||||
if (!this.options.spin_disabled) {
|
||||
var target = this.options.spin_target ? this.options.spin_target
|
||||
: document.body;
|
||||
$(target).unspin();
|
||||
}
|
||||
if (resp.status == "ko") {
|
||||
infobox.error(resp.respmsg);
|
||||
return;
|
||||
}
|
||||
var callback = ($defined(resp.callback)) ? resp.callback : "default";
|
||||
this.callbacks[callback](resp);
|
||||
infobox.info(gettext("Done"));
|
||||
infobox.hide(1);
|
||||
/*infobox.info(gettext("Done"));
|
||||
infobox.hide(1);*/
|
||||
this.reset_loading_infos();
|
||||
}.bind(this),
|
||||
onFailure: function(xhr) {
|
||||
$(document.body).set("html", xhr.responseText);
|
||||
$(document.body).setStyle("overflow", "auto");
|
||||
}
|
||||
}).get();
|
||||
}).get("json=1");
|
||||
}
|
||||
});
|
||||
|
||||
+16
-11
@@ -153,8 +153,10 @@ checkTableSelection = function(text) {
|
||||
return confirm(text);
|
||||
};
|
||||
|
||||
searchbox_init = function() {
|
||||
function searchbox_init() {
|
||||
var myFx = new Fx.Slide($("searchparams"));
|
||||
var $searchfield = $("searchfield");
|
||||
|
||||
myFx.hide();
|
||||
$("searchopts").addEvent("click", function(event) {
|
||||
myFx.cancel();
|
||||
@@ -164,28 +166,31 @@ searchbox_init = function() {
|
||||
myFx.cancel();
|
||||
myFx.toggle();
|
||||
});
|
||||
$("searchfield").addEvent("change", function(event) {
|
||||
$searchfield.addEvent("change", function(event) {
|
||||
var criteria = "";
|
||||
var pattern = this.get("value");
|
||||
|
||||
$$("input[name=scriteria]:checked").each(function(obj) {
|
||||
criteria = obj.value;
|
||||
});
|
||||
var pattern = $("searchfield").get("value");
|
||||
if (pattern != "") {
|
||||
var params = "pattern=" + pattern + "&criteria=" + criteria;
|
||||
current_anchor.updateparams(params);
|
||||
current_anchor.setparams({
|
||||
pattern: pattern,
|
||||
criteria: criteria
|
||||
});
|
||||
} else {
|
||||
current_anchor.deleteParam("pattern");
|
||||
current_anchor.deleteParam("criteria");
|
||||
}
|
||||
current_anchor.update();
|
||||
});
|
||||
$("searchfield").addEvent("click", function(event) {
|
||||
$("searchfield").select();
|
||||
$searchfield.addEvent("click", function(event) {
|
||||
$searchfield.select();
|
||||
});
|
||||
|
||||
$("searchfield").addEvent("blur", function(event) {
|
||||
if ($("searchfield").value == "") {
|
||||
$("searchfield").set("value", gettext("Search..."));
|
||||
$searchfield.addEvent("blur", function(event) {
|
||||
if ($searchfield.value == "") {
|
||||
$searchfield.set("value", gettext("Search..."));
|
||||
}
|
||||
});
|
||||
$("searchbox").setStyle("float", "left");
|
||||
@@ -193,7 +198,7 @@ searchbox_init = function() {
|
||||
if (frag.indexOf('?') != -1) {
|
||||
var params = frag.substring(frag.indexOf('?') + 1).parseQueryString();
|
||||
if ($defined(params.pattern)) {
|
||||
$("searchfield").set("value", params.pattern);
|
||||
$searchfield.set("value", params.pattern);
|
||||
}
|
||||
if ($defined(params.criteria)) {
|
||||
$("crit_" + params.criteria).checked = true;
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
*/
|
||||
|
||||
function navbarcallback(event) {
|
||||
event.stop();
|
||||
current_anchor.setparams(navparams);
|
||||
current_anchor.parse_string($(event.target).getParent().get("href")).update();
|
||||
event.stop();
|
||||
current_anchor.reset()
|
||||
.setparams(navparams)
|
||||
.updateparams(this.get("href"))
|
||||
.update();
|
||||
}
|
||||
|
||||
function updatelisting(resp) {
|
||||
@@ -23,7 +25,7 @@ function updatelisting(resp) {
|
||||
}
|
||||
if ($defined(resp.navbar)) {
|
||||
$("navbar").set("html", resp.navbar);
|
||||
$("navbar").getChildren("a").addEvent("click", navbarcallback);
|
||||
$$("#navbar a").addEvent("click", navbarcallback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user