Work in progress. I've moved permissions management to the new dedicated page. Adding permissions is working but deleting ones. I must also filter the list of users available when creating a super admin because the default admin appears inside :p
This commit is contained in:
tonio
2010-11-25 23:19:04 +01:00
parent f7ec14bc87
commit eff3c7d815
14 changed files with 240 additions and 171 deletions
+13 -13
View File
@@ -1,7 +1,7 @@
window.addEvent('domready', function(){
parse_menubar('topmenubar');
parse_menubar('menubar');
infobox = new InfoBox({
parent : $("menubar"),
message : "Loading"
@@ -21,7 +21,7 @@ get_callback = function(name) {
current_anchor = null;
check_anchor = function() {
if (current_anchor.serialized == location.hash
if (current_anchor.serialized == location.hash
&& !$defined(current_anchor.force)) {
return;
}
@@ -67,9 +67,9 @@ function HashWrapper(deflocation) {
};
this.parse_string = function(value, reset) {
var splits = (value.charAt(0) == '#')
var splits = (value.charAt(0) == '#')
? value.substring(1).split('?') : value.split('?');
if (splits.length == 0) {
return this;
}
@@ -143,7 +143,7 @@ function HashWrapper(deflocation) {
this.params.set(name, value);
return this;
};
this.setparams = function(params) {
this.params.extend(params);
return this;
@@ -191,7 +191,7 @@ parse_menubar = function(id) {
var myFx = new Fx.Slide(list, {
duration: 200
});
myFx.wrapper.setStyles({
/*"clear" : "both",*/
"position" : "absolute"
@@ -227,12 +227,12 @@ get_iframe_body = function(id) {
data = targetif.contentDocument.defaultView.document.body;
} else {
data = targetif.document.body;
}
}
} else if (targetif.contentWindow && !saf) {
// IE 5.5 & 6.x
data = targetif.contentWindow.document.body;
}
return (data);
return (data);
}
confirmation = function(question, action, callback) {
@@ -244,12 +244,12 @@ confirmation = function(question, action, callback) {
var elt = ibody.getElement("input[name=result]");
if (elt.get("value") == "ok") {
params = ""
params = "";
if (typeof callback != "undefined") {
params = callback(ibody);
}
new Request({
method: "get",
method: "get",
url: action.get("href"),
onSuccess: function(res) {
window.location.reload();
@@ -262,7 +262,7 @@ confirmation = function(question, action, callback) {
}
setDivHeight = function(id, extrah, modulo) {
var contentsize = $(document.body).getSize().y
var contentsize = $(document.body).getSize().y
- $("topmenubar").getSize().y
- $("header").getSize().y
- $("footer").getSize().y
@@ -326,7 +326,7 @@ searchbox_init = function() {
$("searchfield").addEvent("click", function(event) {
$("searchfield").select();
});
$("searchfield").addEvent("blur", function(event) {
if ($("searchfield").value == "") {
$("searchfield").set("value", gettext("Search..."));
@@ -352,7 +352,7 @@ gethref = function(obj) {
var url = obj.get("href");
var re = new RegExp("^(https?):");
var scheme = re.exec(url);
if (scheme != null) {
var baseurl = scheme[0] + "://" + location.host + location.pathname;
return url.replace(baseurl, "");
+6 -16
View File
@@ -1,34 +1,24 @@
window.addEvent('domready', function() {
var handlers = new Array();
if ($defined($("domcontent"))) {
SqueezeBox.assign($("domcontent").getElements('a[class=boxed]'), {
parse: 'rel',
parse: 'rel',
});
}
if ($defined($("subcontent"))) {
SqueezeBox.assign($("subcontent").getElements('a[class=boxed]'), {
parse: 'rel',
parse: 'rel',
});
}
// handlers['loadDom'] = function(obj, target) {
/* $$('a[name=loadDom]').setStyles({'color' : '#999'});*/
/* obj.setStyles({"color": "black"});*/
// loadPage(target, "content", null);
// };
// handlers['loadContent'] = function(obj, target) {
// loadPage(target, "content", null);
// };
if ($$("a[name=deleteDom]"))
$$("a[name=deleteDom]").addEvent('click', function(event) {
if (!confirm(gettext("Delete this domain?")))
event.stop();
});
if ($$("a[name=deleteMb]"))
$$("a[name=deleteMb]").addEvent('click', function(event) {
event.stop();
@@ -50,7 +40,7 @@ window.addEvent('domready', function() {
event.stop();
});
$(document.body).addEvent('click', function(event) {
target = event.target;
if (target.get('tag') == 'a') {
@@ -92,7 +82,7 @@ newdom = function() {
loadPage = function(url, destination, callback) {
var destination = (destination == null) ? "page" : destination;
if (callback)
new Request({url: url, method: "get", onSuccess: callback}).send();
else
+28
View File
@@ -0,0 +1,28 @@
window.addEvent('domready', function() {
var tip = new Tips($$(".Tips"));
var addperm_url = "";
var accordion = new Accordion('h3.atStart', 'div.atStart', {
opacity: true,
onActive: function(toggler, element){
toggler.setStyle('color', '#ff3300');
addperm_url = element.get("name");
},
onBackground: function(toggler, element) {
toggler.setStyle('color', '#222');
}
}, $('accordion'));
$$("a[name=addperm]").addEvent("click", function(evt) {
evt.stop();
if (addperm_url == "") {
return;
}
SqueezeBox.initialize({
size: {x: 300, y: 280},
handler: 'iframe'
});
SqueezeBox.open(addperm_url);
});
});