diff --git a/lemonldap-ng-manager/example/skins/default/js/manager.js b/lemonldap-ng-manager/example/skins/default/js/manager.js
index 25619e680..7590ca447 100644
--- a/lemonldap-ng-manager/example/skins/default/js/manager.js
+++ b/lemonldap-ng-manager/example/skins/default/js/manager.js
@@ -3,133 +3,205 @@
*/
/* Help chapters */
-var helpCh={
- 'advanced':'/pages/documentation/current/start.html#advanced_features',
- 'authApache':'/pages/documentation/current/authapache.html',
- 'authBrowserID':'/pages/documentation/current/authbrowserid.html',
- 'authDBI':'/pages/documentation/current/authdbi.html',
- 'authDBIConnection':'/pages/documentation/current/authdbi.html#connection',
- 'authDBILevel':'/pages/documentation/current/authdbi.html#authentication_level',
- 'authDBIPassword':'/pages/documentation/current/authdbi.html#password',
- 'authDBISchema':'/pages/documentation/current/authdbi.html#schema',
- 'authCAS':'/pages/documentation/current/authcas.html',
- 'authChoice':'/pages/documentation/current/authchoice.html',
- 'authFacebook':'/pages/documentation/current/authfacebook.html',
- 'authGoogle':'/pages/documentation/current/authgoogle.html',
- 'authLDAP':'/pages/documentation/current/authldap.html',
- 'authLDAPConnection':'/pages/documentation/current/authldap.html#connection',
- 'authLDAPFilters':'/pages/documentation/current/authldap.html#filters',
- 'authLDAPGroups':'/pages/documentation/current/authldap.html#groups',
- 'authLDAPLevel':'/pages/documentation/current/authldap.html#authentication_level',
- 'authLDAPPassword':'/pages/documentation/current/authldap.html#password',
- 'authNull':'/pages/documentation/current/authnull.html',
- 'authOpenID':'/pages/documentation/current/authopenid.html',
- 'authParams':'/pages/documentation/current/start.html#authentication_users_and_password_databases',
- 'authProxy':'/pages/documentation/current/authproxy.html',
- 'authRemote':'/pages/documentation/current/authremote.html',
- 'authSlave':'/pages/documentation/current/authslave.html',
- 'authSSL':'/pages/documentation/current/authssl.html',
- 'authTwitter':'/pages/documentation/current/authtwitter.html',
- 'authWebID':'/pages/documentation/current/authwebid.html',
- 'authYubikey':'/pages/documentation/current/authyubikey.html',
- 'cookies':'/pages/documentation/current/ssocookie.html',
- 'customfunctions':'/pages/documentation/current/customfunctions.html',
- 'default':'/pages/documentation/current/start.html#configuration',
- 'exportedVars':'/pages/documentation/current/exportedvars.html',
- 'headers':'/pages/documentation/current/writingrulesand_headers.html#headers',
- 'issuerdb':'/pages/documentation/current/start.html#identity_provider',
- 'issuerdbCAS':'/pages/documentation/current/idpcas.html',
- 'issuerdbOpenID':'/pages/documentation/current/idpopenid.html',
- 'issuerdbSAML':'/pages/documentation/current/idpsaml.html',
- 'loginHistory':'/pages/documentation/current/loginhistory.html',
- 'logoutforward':'/pages/documentation/current/logoutforward.html',
- 'logs':'/pages/documentation/current/logs.html',
- 'macrosandgroups':'/pages/documentation/current/exportedvars.html#extend_variables_using_macros_and_groups',
- 'menu':'/pages/documentation/current/portalmenu.html',
- 'menuCatAndApp':'/pages/documentation/current/portalmenu.html#categories_and_applications',
- 'notifications':'/pages/documentation/current/notifications.html',
- 'password':'/pages/documentation/current/resetpassword.html',
- 'portal':'/pages/documentation/current/ssocookie.html#portal_url',
- 'portalcustom':'/pages/documentation/current/portalcustom.html',
- 'portalParams':'/pages/documentation/current/portal.html',
- 'portalRedirections':'/pages/documentation/current/redirections.html#portal_redirections',
- 'post':'/pages/documentation/current/formreplay.html',
- 'redirections':'/pages/documentation/current/redirections.html',
- 'reloadUrls':'/pages/documentation/current/configlocation.html#configuration_reload',
- 'rules':'/pages/documentation/current/writingrulesand_headers.html#rules',
- 'samlIDP':'/pages/documentation/current/authsaml.html#register_partner_identity_provider_on_lemonldapng',
- 'samlIDPExportedAttributes':'/pages/documentation/current/authsaml.html#exported_attributes',
- 'samlIDPMetaDataXML':'/pages/documentation/current/authsaml.html#metadata',
- 'samlIDPOptions':'/pages/documentation/current/authsaml.html#options',
- 'samlService':'/pages/documentation/current/samlservice.html',
- 'samlServiceAA':'/pages/documentation/current/samlservice.html#attribute_authority',
- 'samlServiceAdvanced':'/pages/documentation/current/samlservice.html#advanced',
- 'samlServiceAuthnContexts':'/pages/documentation/current/samlservice.html#authentication_contexts',
- 'samlServiceEntityID':'/pages/documentation/current/samlservice.html#entry_identifier',
- 'samlServiceIDP':'/pages/documentation/current/samlservice.html#identity_provider',
- 'samlServiceNameIDFormats':'/pages/documentation/current/samlservice.html#nameid_formats',
- 'samlServiceOrganization':'/pages/documentation/current/samlservice.html#organization',
- 'samlServiceSecurity':'/pages/documentation/current/samlservice.html#security_parameters',
- 'samlServiceSP':'/pages/documentation/current/samlservice.html#service_provider',
- 'samlSP':'/pages/documentation/current/idpsaml.html#register_partner_service_provider_on_lemonldapng',
- 'samlSPExportedAttributes':'/pages/documentation/current/idpsaml.html#exported_attributes',
- 'samlSPMetaDataXML':'/pages/documentation/current/idpsaml.html#metadata',
- 'samlSPOptions':'/pages/documentation/current/idpsaml.html#options',
- 'securetoken':'/pages/documentation/current/securetoken.html',
- 'security':'/pages/documentation/current/security.html#configure_security_settings',
- 'sessions':'/pages/documentation/current/sessions.html',
- 'sessionsdb':'/pages/documentation/current/start.html#sessions_database',
- 'sympa':'/pages/documentation/current/applications/sympa.html',
- 'userdbParams':'/pages/documentation/current/start.html#authentication_and_users_database',
- 'vhostOptions':'/pages/documentation/current/configvhost.html#options',
- 'virtualHosts':'/pages/documentation/current/configvhost.html',
- 'zimbra':'/pages/documentation/current/applications/zimbra.html'
+var helpCh = {
+ 'advanced': '/pages/documentation/current/start.html#advanced_features',
+ 'authApache': '/pages/documentation/current/authapache.html',
+ 'authBrowserID': '/pages/documentation/current/authbrowserid.html',
+ 'authDBI': '/pages/documentation/current/authdbi.html',
+ 'authDBIConnection': '/pages/documentation/current/authdbi.html#connection',
+ 'authDBILevel': '/pages/documentation/current/authdbi.html#authentication_level',
+ 'authDBIPassword': '/pages/documentation/current/authdbi.html#password',
+ 'authDBISchema': '/pages/documentation/current/authdbi.html#schema',
+ 'authCAS': '/pages/documentation/current/authcas.html',
+ 'authChoice': '/pages/documentation/current/authchoice.html',
+ 'authFacebook': '/pages/documentation/current/authfacebook.html',
+ 'authGoogle': '/pages/documentation/current/authgoogle.html',
+ 'authLDAP': '/pages/documentation/current/authldap.html',
+ 'authLDAPConnection': '/pages/documentation/current/authldap.html#connection',
+ 'authLDAPFilters': '/pages/documentation/current/authldap.html#filters',
+ 'authLDAPGroups': '/pages/documentation/current/authldap.html#groups',
+ 'authLDAPLevel': '/pages/documentation/current/authldap.html#authentication_level',
+ 'authLDAPPassword': '/pages/documentation/current/authldap.html#password',
+ 'authNull': '/pages/documentation/current/authnull.html',
+ 'authOpenID': '/pages/documentation/current/authopenid.html',
+ 'authParams': '/pages/documentation/current/start.html#authentication_users_and_password_databases',
+ 'authProxy': '/pages/documentation/current/authproxy.html',
+ 'authRemote': '/pages/documentation/current/authremote.html',
+ 'authSlave': '/pages/documentation/current/authslave.html',
+ 'authSSL': '/pages/documentation/current/authssl.html',
+ 'authTwitter': '/pages/documentation/current/authtwitter.html',
+ 'authWebID': '/pages/documentation/current/authwebid.html',
+ 'authYubikey': '/pages/documentation/current/authyubikey.html',
+ 'cookies': '/pages/documentation/current/ssocookie.html',
+ 'customfunctions': '/pages/documentation/current/customfunctions.html',
+ 'default': '/pages/documentation/current/start.html#configuration',
+ 'exportedVars': '/pages/documentation/current/exportedvars.html',
+ 'headers': '/pages/documentation/current/writingrulesand_headers.html#headers',
+ 'issuerdb': '/pages/documentation/current/start.html#identity_provider',
+ 'issuerdbCAS': '/pages/documentation/current/idpcas.html',
+ 'issuerdbOpenID': '/pages/documentation/current/idpopenid.html',
+ 'issuerdbSAML': '/pages/documentation/current/idpsaml.html',
+ 'loginHistory': '/pages/documentation/current/loginhistory.html',
+ 'logoutforward': '/pages/documentation/current/logoutforward.html',
+ 'logs': '/pages/documentation/current/logs.html',
+ 'macrosandgroups': '/pages/documentation/current/exportedvars.html#extend_variables_using_macros_and_groups',
+ 'menu': '/pages/documentation/current/portalmenu.html',
+ 'menuCatAndApp': '/pages/documentation/current/portalmenu.html#categories_and_applications',
+ 'notifications': '/pages/documentation/current/notifications.html',
+ 'password': '/pages/documentation/current/resetpassword.html',
+ 'portal': '/pages/documentation/current/ssocookie.html#portal_url',
+ 'portalcustom': '/pages/documentation/current/portalcustom.html',
+ 'portalParams': '/pages/documentation/current/portal.html',
+ 'portalRedirections': '/pages/documentation/current/redirections.html#portal_redirections',
+ 'post': '/pages/documentation/current/formreplay.html',
+ 'redirections': '/pages/documentation/current/redirections.html',
+ 'reloadUrls': '/pages/documentation/current/configlocation.html#configuration_reload',
+ 'rules': '/pages/documentation/current/writingrulesand_headers.html#rules',
+ 'samlIDP': '/pages/documentation/current/authsaml.html#register_partner_identity_provider_on_lemonldapng',
+ 'samlIDPExportedAttributes': '/pages/documentation/current/authsaml.html#exported_attributes',
+ 'samlIDPMetaDataXML': '/pages/documentation/current/authsaml.html#metadata',
+ 'samlIDPOptions': '/pages/documentation/current/authsaml.html#options',
+ 'samlService': '/pages/documentation/current/samlservice.html',
+ 'samlServiceAA': '/pages/documentation/current/samlservice.html#attribute_authority',
+ 'samlServiceAdvanced': '/pages/documentation/current/samlservice.html#advanced',
+ 'samlServiceAuthnContexts': '/pages/documentation/current/samlservice.html#authentication_contexts',
+ 'samlServiceEntityID': '/pages/documentation/current/samlservice.html#entry_identifier',
+ 'samlServiceIDP': '/pages/documentation/current/samlservice.html#identity_provider',
+ 'samlServiceNameIDFormats': '/pages/documentation/current/samlservice.html#nameid_formats',
+ 'samlServiceOrganization': '/pages/documentation/current/samlservice.html#organization',
+ 'samlServiceSecurity': '/pages/documentation/current/samlservice.html#security_parameters',
+ 'samlServiceSP': '/pages/documentation/current/samlservice.html#service_provider',
+ 'samlSP': '/pages/documentation/current/idpsaml.html#register_partner_service_provider_on_lemonldapng',
+ 'samlSPExportedAttributes': '/pages/documentation/current/idpsaml.html#exported_attributes',
+ 'samlSPMetaDataXML': '/pages/documentation/current/idpsaml.html#metadata',
+ 'samlSPOptions': '/pages/documentation/current/idpsaml.html#options',
+ 'securetoken': '/pages/documentation/current/securetoken.html',
+ 'security': '/pages/documentation/current/security.html#configure_security_settings',
+ 'sessions': '/pages/documentation/current/sessions.html',
+ 'sessionsdb': '/pages/documentation/current/start.html#sessions_database',
+ 'sympa': '/pages/documentation/current/applications/sympa.html',
+ 'userdbParams': '/pages/documentation/current/start.html#authentication_and_users_database',
+ 'vhostOptions': '/pages/documentation/current/configvhost.html#options',
+ 'virtualHosts': '/pages/documentation/current/configvhost.html',
+ 'zimbra': '/pages/documentation/current/applications/zimbra.html'
};
/* Init simpleTreeCollection */
var simpleTreeCollection;
/* Convert boolean strings into javascript booleans */
-if (treeautoclose.match('true')){ treeautoclose = true; } else { treeautoclose = false; }
-if (treejquerycss.match('true')){ treejquerycss = true; } else { treejquerycss = false; }
+if (treeautoclose.match('true')) {
+ treeautoclose = true;
+} else {
+ treeautoclose = false;
+}
+if (treejquerycss.match('true')) {
+ treejquerycss = true;
+} else {
+ treejquerycss = false;
+}
-$(document).ready(function(){
+$(document).ready(function() {
/* Menu height */
resizeMenu();
jQuery.event.add(window, "load", resizeMenu);
jQuery.event.add(window, "resize", resizeMenu);
-
+
/* Buttons */
- $('#header a').button({icons:{primary:"ui-icon-home"}});
- $('#header span#css-switch-link').button({icons:{primary:"ui-icon-image"}});
- $('#css-switch button[alt=tree]').button({icons:{primary:"ui-icon-grip-dotted-vertical"}});
- $('#css-switch button[alt=accordion]').button({icons:{primary:"ui-icon-grip-dotted-horizontal"}});
- $('#css-switch button[alt=ui-lightness]').button({icons:{primary:"ui-icon-lightbulb"}});
- $('#css-switch button[alt=ui-darkness]').button({icons:{primary:"ui-icon-star"}});
+ $('#header a').button({
+ icons: {
+ primary: "ui-icon-home"
+ }
+ });
+ $('#header span#css-switch-link').button({
+ icons: {
+ primary: "ui-icon-image"
+ }
+ });
+ $('#css-switch button[alt=tree]').button({
+ icons: {
+ primary: "ui-icon-grip-dotted-vertical"
+ }
+ });
+ $('#css-switch button[alt=accordion]').button({
+ icons: {
+ primary: "ui-icon-grip-dotted-horizontal"
+ }
+ });
+ $('#css-switch button[alt=ui-lightness]').button({
+ icons: {
+ primary: "ui-icon-lightbulb"
+ }
+ });
+ $('#css-switch button[alt=ui-darkness]').button({
+ icons: {
+ primary: "ui-icon-star"
+ }
+ });
$('#buttons button').button();
$('#content button').button();
- $('button#bsave').button({icons:{primary:"ui-icon-disk"}});
- $('button[id*=new]').button({icons:{primary:"ui-icon-circle-plus"}});
- $('button[id*=del]').button({icons:{primary:"ui-icon-circle-minus"}});
- $('#query-switch a[alt=user]').button({icons:{primary:"ui-icon-person"}});
- $('#query-switch a[alt=ip]').button({icons:{primary:"ui-icon-gear"}});
- $('#query-switch a[alt=2ip]').button({icons:{primary:"ui-icon-alert"}});
- $('#query-switch a[alt=list]').button({icons:{primary:"ui-icon-mail-closed"}});
- $('#query-switch a[alt=listDone]').button({icons:{primary:"ui-icon-mail-open"}});
- $('#query-switch a[alt=newNotif]').button({icons:{primary:"ui-icon-circle-plus"}});
- $('#sendNewNotif').button({icons:{primary:"ui-icon-circle-plus"}});
+ $('button#bsave').button({
+ icons: {
+ primary: "ui-icon-disk"
+ }
+ });
+ $('button[id*=new]').button({
+ icons: {
+ primary: "ui-icon-circle-plus"
+ }
+ });
+ $('button[id*=del]').button({
+ icons: {
+ primary: "ui-icon-circle-minus"
+ }
+ });
+ $('#query-switch a[alt=user]').button({
+ icons: {
+ primary: "ui-icon-person"
+ }
+ });
+ $('#query-switch a[alt=ip]').button({
+ icons: {
+ primary: "ui-icon-gear"
+ }
+ });
+ $('#query-switch a[alt=2ip]').button({
+ icons: {
+ primary: "ui-icon-alert"
+ }
+ });
+ $('#query-switch a[alt=list]').button({
+ icons: {
+ primary: "ui-icon-mail-closed"
+ }
+ });
+ $('#query-switch a[alt=listDone]').button({
+ icons: {
+ primary: "ui-icon-mail-open"
+ }
+ });
+ $('#query-switch a[alt=newNotif]').button({
+ icons: {
+ primary: "ui-icon-circle-plus"
+ }
+ });
+ $('#sendNewNotif').button({
+ icons: {
+ primary: "ui-icon-circle-plus"
+ }
+ });
/* Display/hide divs */
- $("#buttons h1").click(function(){
+ $("#buttons h1").click(function() {
$('#buttons h1 img').toggle();
$("#buttons_content").slideToggle('fast');
});
- $("#edition h1").click(function(){
+ $("#edition h1").click(function() {
$('#edition h1 img').toggle();
$("#content").slideToggle('fast');
});
- $("#help h1").click(function(){
+ $("#help h1").click(function() {
$('#help h1 img').toggle();
$("#help_content").slideToggle('fast');
});
@@ -140,14 +212,14 @@ $(document).ready(function(){
minWidth: 500,
modal: true
});
- $('#content_skin button.current').click(function(){
- $('#skinImagePicker').dialog( "open" );
+ $('#content_skin button.current').click(function() {
+ $('#skinImagePicker').dialog("open");
return false;
});
- $('#skinImagePicker button').click(function(){
- var skin = $("img",this).attr('title');
+ $('#skinImagePicker button').click(function() {
+ var skin = $("img", this).attr('title');
changeSkinImage(skin);
- $('#skinImagePicker').dialog( "close" );
+ $('#skinImagePicker').dialog("close");
return false;
});
@@ -157,20 +229,20 @@ $(document).ready(function(){
minWidth: 300,
modal: true
});
- $('#content_applicationListApplication button.current').click(function(){
- $('#appsLogoPicker').dialog( "open" );
+ $('#content_applicationListApplication button.current').click(function() {
+ $('#appsLogoPicker').dialog("open");
return false;
});
- $('#appsLogoPicker button').click(function(){
- var logo = $("img",this).attr('title');
- changeAppsLogo(logo+'.png');
- $('#appsLogoPicker').dialog( "close" );
+ $('#appsLogoPicker button').click(function() {
+ var logo = $("img", this).attr('title');
+ changeAppsLogo(logo + '.png');
+ $('#appsLogoPicker').dialog("close");
return false;
});
/* Display configuration datas */
getCfgAttributes();
- display('cfgDatas','');
+ display('cfgDatas', '');
/* Load Simple Tree */
loadSimpleTree();
@@ -180,37 +252,47 @@ $(document).ready(function(){
autoOpen: false,
modal: true
});
- $('span#css-switch-link').click(function(){
+ $('span#css-switch-link').click(function() {
// Open dialog
- $('#css-switch').dialog( "open" );
+ $('#css-switch').dialog("open");
// Fix focus
- $('#css-switch button').each(function(){
+ $('#css-switch button').each(function() {
$(this).removeClass('ui-state-focus');
});
- if($.cookie("managermenu")){css_menu=$.cookie("managermenu");}
- if($.cookie("managertheme")){css_theme=$.cookie("managertheme");}
- $('#css-switch button[alt='+css_menu+']').addClass('ui-state-focus').focus();
- $('#css-switch button[alt='+css_theme+']').addClass('ui-state-focus');
+ if ($.cookie("managermenu")) {
+ css_menu = $.cookie("managermenu");
+ }
+ if ($.cookie("managertheme")) {
+ css_theme = $.cookie("managertheme");
+ }
+ $('#css-switch button[alt=' + css_menu + ']').addClass('ui-state-focus').focus();
+ $('#css-switch button[alt=' + css_theme + ']').addClass('ui-state-focus');
return false;
});
- if($.cookie("managermenu")) {
+ if ($.cookie("managermenu")) {
simpleTreeSetMenuStyle($.cookie("managermenu"));
}
- if($.cookie("managertheme")) {
- $("link#csstheme").attr("href",themepath+$.cookie("managertheme")+'/jquery-ui-'+jqueryuiversion+'.custom.min.css');
+ if ($.cookie("managertheme")) {
+ $("link#csstheme").attr("href", themepath + $.cookie("managertheme") + '/jquery-ui-' + jqueryuiversion + '.custom.min.css');
}
- $("#css-switch #organization button").click(function(){
- var style=$(this).attr("alt");
- $.cookie("managermenu",style, {expires: 365, path: '/'});
+ $("#css-switch #organization button").click(function() {
+ var style = $(this).attr("alt");
+ $.cookie("managermenu", style, {
+ expires: 365,
+ path: '/'
+ });
simpleTreeSetMenuStyle(style);
- $('#css-switch').dialog( "close" );
+ $('#css-switch').dialog("close");
return false;
});
- $("#css-switch #theme button").click(function(){
- var theme=$(this).attr("alt");
- $.cookie("managertheme",theme, {expires: 365, path: '/'});
- $("link#csstheme").attr("href",themepath+theme+'/jquery-ui-'+jqueryuiversion+'.custom.min.css');
- $('#css-switch').dialog( "close" );
+ $("#css-switch #theme button").click(function() {
+ var theme = $(this).attr("alt");
+ $.cookie("managertheme", theme, {
+ expires: 365,
+ path: '/'
+ });
+ $("link#csstheme").attr("href", themepath + theme + '/jquery-ui-' + jqueryuiversion + '.custom.min.css');
+ $('#css-switch').dialog("close");
return false;
});
@@ -218,64 +300,64 @@ $(document).ready(function(){
loadHelp('default');
});
-function loadSimpleTree(){
+function loadSimpleTree() {
/* Simple Tree */
simpleTreeCollection = $(".simpleTree").simpleTree({
- autoclose:treeautoclose,
- useClickToToggle:true,
- drag:false,
- afterClick:function(node){
- var span=$('span:first',node);
+ autoclose: treeautoclose,
+ useClickToToggle: true,
+ drag: false,
+ afterClick: function(node) {
+ var span = $('span:first', node);
loadHelp(span.attr('help'));
simpleTreeDefaultJqueryClasses();
simpleTreeToggleJqueryClasses();
},
- afterCloseNearby:function(node){
+ afterCloseNearby: function(node) {
simpleTreeDefaultJqueryClasses();
simpleTreeToggleJqueryClasses();
},
- afterNewNode:function(node){
+ afterNewNode: function(node) {
simpleTreeDefaultJqueryClasses();
simpleTreeToggleJqueryClasses();
},
- afterDblClick:function(node){
+ afterDblClick: function(node) {
simpleTreeDefaultJqueryClasses();
simpleTreeToggleJqueryClasses();
},
- afterSetTrigger:function(node){
+ afterSetTrigger: function(node) {
simpleTreeTriggerJqueryClasses();
},
- afterMove:function(destination, source, pos){
- },
- afterAjax:function() {
+ afterMove: function(destination, source, pos) {},
+ afterAjax: function() {
simpleTreeDefaultJqueryClasses();
simpleTreeToggleJqueryClasses();
},
- animate:true,
- docToFolderConvert:true
+ animate: true,
+ docToFolderConvert: true
});
- if(treejquerycss){simpleTreeDefaultJqueryClasses();}
-
+ if (treejquerycss) {
+ simpleTreeDefaultJqueryClasses();
+ }
}
-function simpleTreeSetMenuStyle(style){
- if(style=="tree"){
- $("link#cssmenu").attr("href",csspath+"tree.css");
- treejquerycss=false;
- treeautoclose=false;
- simpleTreeCollection[0].option.autoclose=treeautoclose;
- }else{
- $("link#cssmenu").attr("href",csspath+"accordion.css");
- treejquerycss=true;
- treeautoclose=true;
- simpleTreeCollection[0].option.autoclose=treeautoclose;
+function simpleTreeSetMenuStyle(style) {
+ if (style == "tree") {
+ $("link#cssmenu").attr("href", csspath + "tree.css");
+ treejquerycss = false;
+ treeautoclose = false;
+ simpleTreeCollection[0].option.autoclose = treeautoclose;
+ } else {
+ $("link#cssmenu").attr("href", csspath + "accordion.css");
+ treejquerycss = true;
+ treeautoclose = true;
+ simpleTreeCollection[0].option.autoclose = treeautoclose;
}
simpleTreeDefaultJqueryClasses();
simpleTreeToggleJqueryClasses();
}
/* Add jQuery UI CSS classes to simpleTree */
-function simpleTreeDefaultJqueryClasses(){
+function simpleTreeDefaultJqueryClasses() {
if (treejquerycss) {
$(".simpleTree .root > span").addClass("ui-widget-header ui-corner-all");
$(".simpleTree .folder-open > span").addClass("ui-state-default ui-corner-all");
@@ -289,7 +371,7 @@ function simpleTreeDefaultJqueryClasses(){
}
simpleTreeTriggerJqueryClasses();
}
-function simpleTreeToggleJqueryClasses(){
+function simpleTreeToggleJqueryClasses() {
if (treejquerycss) {
$(".simpleTree .folder-open > span").addClass("ui-state-focus");
$(".simpleTree .folder-open-last > span").addClass("ui-state-focus");
@@ -301,25 +383,17 @@ function simpleTreeToggleJqueryClasses(){
$(".simpleTree span").removeClass("ui-state-focus ui-state-active");
}
}
-function simpleTreeTriggerJqueryClasses(){
+function simpleTreeTriggerJqueryClasses() {
if (treejquerycss) {
$(".simpleTree .folder-open > img.trigger").addClass("ui-icon");
$(".simpleTree .folder-open-last > img.trigger").addClass("ui-icon");
$(".simpleTree .folder-close > img.trigger").addClass("ui-icon");
$(".simpleTree .folder-close-last > img.trigger").addClass("ui-icon");
- $(".simpleTree .folder-open > img.trigger")
- .removeClass("ui-icon-triangle-1-e")
- .addClass("ui-icon-triangle-1-s");
- $(".simpleTree .folder-open-last > img.trigger")
- .removeClass("ui-icon-triangle-1-e")
- .addClass("ui-icon-triangle-1-s");
- $(".simpleTree .folder-close > img.trigger")
- .removeClass("ui-icon-triangle-1-s")
- .addClass("ui-icon-triangle-1-e");
- $(".simpleTree .folder-close-last > img.trigger")
- .removeClass("ui-icon-triangle-1-s")
- .addClass("ui-icon-triangle-1-e");
+ $(".simpleTree .folder-open > img.trigger").removeClass("ui-icon-triangle-1-e").addClass("ui-icon-triangle-1-s");
+ $(".simpleTree .folder-open-last > img.trigger").removeClass("ui-icon-triangle-1-e").addClass("ui-icon-triangle-1-s");
+ $(".simpleTree .folder-close > img.trigger").removeClass("ui-icon-triangle-1-s").addClass("ui-icon-triangle-1-e");
+ $(".simpleTree .folder-close-last > img.trigger").removeClass("ui-icon-triangle-1-s").addClass("ui-icon-triangle-1-e");
} else {
$(".simpleTree img.trigger").removeClass("ui-icon ui-icon-triangle-1-e ui-icon-triangle-1-s");
}
@@ -330,175 +404,177 @@ var currentId;
* @param data input data
* @return escaped string
*/
-function safeSelector(data){
+function safeSelector(data) {
var escaped_data = data;
- escaped_data = escaped_data.replace(/\//g,'\\/');
- escaped_data = escaped_data.replace(/\+/g,'\\+');
- escaped_data = escaped_data.replace(/=/g,'\\=');
+ escaped_data = escaped_data.replace(/\//g, '\\/');
+ escaped_data = escaped_data.replace(/\+/g, '\\+');
+ escaped_data = escaped_data.replace(/=/g, '\\=');
return escaped_data;
}
-function lmtext(id){
- return $('#text_'+safeSelector(id)).attr('name');
+function lmtext(id) {
+ return $('#text_' + safeSelector(id)).attr('name');
}
-function lmdata(id){
- return unescape( $('#text_'+safeSelector(id)).attr('value') );
+function lmdata(id) {
+ return unescape($('#text_' + safeSelector(id)).attr('value'));
}
-function lmparent(id){
- return $('#'+safeSelector(id)).parent().parent().attr('id');
+function lmparent(id) {
+ return $('#' + safeSelector(id)).parent().parent().attr('id');
}
-function setlmtext(id,v,prefixvalue){
- if(!prefixvalue){prefixvalue="";}
- if(v.length==0){
+function setlmtext(id, v, prefixvalue) {
+ if (!prefixvalue) {
+ prefixvalue = "";
+ }
+ if (v.length == 0) {
alert("Null value");
}
else {
- $('#text_'+safeSelector(id)).attr('name',prefixvalue+v);
- $('#text_'+safeSelector(id)).text(v);
+ $('#text_' + safeSelector(id)).attr('name', prefixvalue + v);
+ $('#text_' + safeSelector(id)).text(v);
}
}
-function setlminputtext(id,input,prefixvalue){
- var inputname=$(input).attr('id');
- var inputvalue=$(input).val();
- if(!prefixvalue){prefixvalue="";}
- if(inputvalue.length==0){
- alert('No '+inputname);
+function setlminputtext(id, input, prefixvalue) {
+ var inputname = $(input).attr('id');
+ var inputvalue = $(input).val();
+ if (!prefixvalue) {
+ prefixvalue = "";
+ }
+ if (inputvalue.length == 0) {
+ alert('No ' + inputname);
return false;
}
- setlmtext(id,inputvalue,prefixvalue);
+ setlmtext(id, inputvalue, prefixvalue);
}
-function setlmdata(id,v){
- $('#text_'+safeSelector(id)).attr('value',escape(v));
+function setlmdata(id, v) {
+ $('#text_' + safeSelector(id)).attr('value', escape(v));
}
-function setlminputdata(id,input){
- var inputvalue=$(input).val();
- setlmdata(id,inputvalue);
+function setlminputdata(id, input) {
+ var inputvalue = $(input).val();
+ setlmdata(id, inputvalue);
}
-function setlmrule(id,c,r,v){
- c=$(c).val();
- r=$(r).val();
- v=$(v).val();
- var re=r;
- var text=r;
- if(c.length>0){
- c=c.replace(/\)/g,']').replace(/\(/g,'[');
- re='(?#'+c+')'+r;
- text=c;
+function setlmrule(id, c, r, v) {
+ c = $(c).val();
+ r = $(r).val();
+ v = $(v).val();
+ var re = r;
+ var text = r;
+ if (c.length > 0) {
+ c = c.replace(/\)/g, ']').replace(/\(/g, '[');
+ re = '(?#' + c + ')' + r;
+ text = c;
}
- setlmdata(id,v);
- $('#text_'+safeSelector(id)).attr('name',re);
- $('#text_'+safeSelector(id)).text(text);
+ setlmdata(id, v);
+ $('#text_' + safeSelector(id)).attr('name', re);
+ $('#text_' + safeSelector(id)).text(text);
}
-function setlmgrantsessionrule(id,c,r,v){
- c=$(c).val();
- r=$(r).val();
- v=$(v).val() || '#';
- var re=r;
- var text=r;
- if(c.length>0){
- re=r+'##'+c;
- text=c;
- }
- setlmdata(id,v);
- $('#text_'+safeSelector(id)).attr('name',re);
- $('#text_'+safeSelector(id)).text(text);
+function setlmgrantsessionrule(id, c, r, v) {
+ c = $(c).val();
+ r = $(r).val();
+ v = $(v).val() || '#';
+ var re = r;
+ var text = r;
+ if (c.length > 0) {
+ re = r + '##' + c;
+ text = c;
+ }
+ setlmdata(id, v);
+ $('#text_' + safeSelector(id)).attr('name', re);
+ $('#text_' + safeSelector(id)).text(text);
}
-function setlmfile(id,input){
- var inputname=$(input).attr('id');
- if($(input).val().length==0){
- alert('No '+inputname);
+function setlmfile(id, input) {
+ var inputname = $(input).attr('id');
+ if ($(input).val().length == 0) {
+ alert('No ' + inputname);
return false;
}
- $("#"+inputname+"-loadimg")
- .ajaxStart(function(){
+ $("#" + inputname + "-loadimg").ajaxStart(function() {
$(this).show();
- })
- .ajaxComplete(function(){
+ }).ajaxComplete(function() {
$(this).hide();
});
$.ajaxFileUpload({
- url:scriptname,
- secureuri:false,
- fileElementId:inputname,
- dataType:'json',
- success:function(data,status){
- if(typeof(data.content.errors) != 'undefined' && data.content.errors != ''){
- popup('
Request failed
- Error code: '+data.content.errors+'
');
- }else{
- data.content = data.content.replace(/</g,'<').replace(/>/g,'>');
- setlmdata(id,data.content);
+ url: scriptname,
+ secureuri: false,
+ fileElementId: inputname,
+ dataType: 'json',
+ success: function(data, status) {
+ if (typeof(data.content.errors) != 'undefined' && data.content.errors != '') {
+ popup('Request failed
- Error code: ' + data.content.errors + '
');
+ } else {
+ data.content = data.content.replace(/</g, '<').replace(/>/g, '>');
+ setlmdata(id, data.content);
$('#filearea').val(lmdata(id));
- display('filearea',lmtext(id));
+ display('filearea', lmtext(id));
}
},
- error:function(xhr, ajaxOptions, thrownError){
- popup('Request failed
- Error code: '+xhr.status+', '+thrownError+'
');
+ error: function(xhr, ajaxOptions, thrownError) {
+ popup('Request failed
- Error code: ' + xhr.status + ', ' + thrownError + '
');
}
});
/* Remove global event on loading image */
- $("#"+inputname+"-loadimg").unbind('ajaxStart');
+ $("#" + inputname + "-loadimg").unbind('ajaxStart');
return false;
}
-function setlmsamlassertion(id){
- var ind=$('#samlAssertionIndex').val();
- var bin=$('#samlAssertionBinding').val();
- var loc=$('#samlAssertionLocation').val();
- var def=$('input[type=radio][name=samlAssertionDefaultBoolean]:checked').attr("value");
+function setlmsamlassertion(id) {
+ var ind = $('#samlAssertionIndex').val();
+ var bin = $('#samlAssertionBinding').val();
+ var loc = $('#samlAssertionLocation').val();
+ var def = $('input[type=radio][name=samlAssertionDefaultBoolean]:checked').attr("value");
// Update default value in other assertions.
- var parentId=lmparent(id);
- var t=$('#'+parentId).find('span').get();
- for(i in t){
- if(def=='1'){
- var currentId=$(t[i]).attr('id').replace('text_','');
- if((currentId!=id)&&(currentId!=parentId)){
- var d=lmdata(currentId).split(';');
- d[0]='0';
- setlmdata(currentId,d.join(';'));
+ var parentId = lmparent(id);
+ var t = $('#' + parentId).find('span').get();
+ for (i in t) {
+ if (def == '1') {
+ var currentId = $(t[i]).attr('id').replace('text_', '');
+ if ((currentId != id) && (currentId != parentId)) {
+ var d = lmdata(currentId).split(';');
+ d[0] = '0';
+ setlmdata(currentId, d.join(';'));
}
- // If off, force on the first one.
- }else if(i1){
- d[0]='0';
- }else{
- d[0]='1';
+ // If off, force on the first one.
+ } else if (i < t.length - 1) {
+ var currentId = $(t[t.length - 1 - i]).attr('id').replace('text_', '');
+ var d = lmdata(currentId).split(';');
+ if (t.length - 1 - i > 1) {
+ d[0] = '0';
+ } else {
+ d[0] = '1';
}
- setlmdata(currentId,d.join(';'));
- if(currentId==id){
- def='1';
+ setlmdata(currentId, d.join(';'));
+ if (currentId == id) {
+ def = '1';
}
}
}
- var v=def+';'+ind+';'+bin+';'+loc;
- setlmdata(id,v);
+ var v = def + ';' + ind + ';' + bin + ';' + loc;
+ setlmdata(id, v);
}
-function setlmsamlattribute(id){
- var name=$('#samlAttributeName').val();
- var form=$('#samlAttributeFormat').val();
- var altr=$('#samlAttributeFriendlyName').val();
- var mand=$('input[type=radio][name=samlAttributeMandatoryBoolean]:checked').attr("value");
- var v=mand+';'+name+';'+form+';'+altr;
- setlmtext(id,$('#samlAttributeKey').val());
- setlmdata(id,v);
+function setlmsamlattribute(id) {
+ var name = $('#samlAttributeName').val();
+ var form = $('#samlAttributeFormat').val();
+ var altr = $('#samlAttributeFriendlyName').val();
+ var mand = $('input[type=radio][name=samlAttributeMandatoryBoolean]:checked').attr("value");
+ var v = mand + ';' + name + ';' + form + ';' + altr;
+ setlmtext(id, $('#samlAttributeKey').val());
+ setlmdata(id, v);
}
-function setlmsamlservice(id){
- var bin=$('#samlServiceBinding').val();
- var loc=$('#samlServiceLocation').val();
- var rep=$('#samlServiceResponseLocation').val();
- var v=bin+';'+loc+';'+rep;
- setlmdata(id,v);
+function setlmsamlservice(id) {
+ var bin = $('#samlServiceBinding').val();
+ var loc = $('#samlServiceLocation').val();
+ var rep = $('#samlServiceResponseLocation').val();
+ var v = bin + ';' + loc + ';' + rep;
+ setlmdata(id, v);
}
-function setopenididplist(id){
- var type=$('input[type=radio][name=openIdServerlistBoolean]:checked').attr("value");
- var list=$('#openid_serverlist_text').val();
- setlmdata(id,type+';'+list);
+function setopenididplist(id) {
+ var type = $('input[type=radio][name=openIdServerlistBoolean]:checked').attr("value");
+ var list = $('#openid_serverlist_text').val();
+ setlmdata(id, type + ';' + list);
}
-function display(div,title) {
- var divs=$('#content').children();
- divs.toggleClass('hidden',true);
+function display(div, title) {
+ var divs = $('#content').children();
+ divs.toggleClass('hidden', true);
divs.removeClass('content');
- $('#content_'+div).removeClass('hidden');
- $('#content_'+div).addClass('content');
+ $('#content_' + div).removeClass('hidden');
+ $('#content_' + div).addClass('content');
$('#content_title').html(title);
$('#newkb,#newrb,#delkb,#newkbr,#newrbr,#newgsrb,#newgsrbr,#bdelvh,#bnewvh').hide();
$('#newidpsamlmetadatab,#delidpsamlmetadatab').hide();
@@ -511,34 +587,39 @@ function display(div,title) {
$('#newpostr,#delpost').hide();
$('#newpostdatar,#delpostdata').hide();
// Resize (or hide) Help window
- var height_menu=$('#menu').height();
- var height_buttons_edition=$('#buttons').height()+$('#edition').height();
- var help_height=height_menu-height_buttons_edition-50;
- if(help_height<1){$('#help h1 img').toggle();$('#help_content').toggle();}
- else{$('#help_content').height(help_height);}
+ var height_menu = $('#menu').height();
+ var height_buttons_edition = $('#buttons').height() + $('#edition').height();
+ var help_height = height_menu - height_buttons_edition - 50;
+ if (help_height < 1) {
+ $('#help h1 img').toggle();
+ $('#help_content').toggle();
+ }
+ else {
+ $('#help_content').height(help_height);
+ }
}
function none(id) {
- currentId=id;
- display('default','');
+ currentId = id;
+ display('default', '');
}
-function hashRoot(id){
- currentId=id;
- display('default','');
+function hashRoot(id) {
+ currentId = id;
+ display('default', '');
$('#newkbr').show();
}
-function vhostRoot(id){
- currentId=id;
- display('default','');
+function vhostRoot(id) {
+ currentId = id;
+ display('default', '');
$('#bnewvh').show();
}
-function samlIdpRoot(id){
- currentId=id;
- display('default','');
+function samlIdpRoot(id) {
+ currentId = id;
+ display('default', '');
$('#newidpsamlmetadatab').show();
}
-function samlSpRoot(id){
- currentId=id;
- display('default','');
+function samlSpRoot(id) {
+ currentId = id;
+ display('default', '');
$('#newspsamlmetadatab').show();
}
/* @function splitModuleAndOptions(string data)
@@ -550,153 +631,113 @@ function splitModuleAndOptions(data) {
var module = ''
var options = '';
- if(data.match(' ')){
- module = data.substring(0,data.indexOf(' '));
- options = data.substring(data.indexOf(' ')+1);
- }else{
+ if (data.match(' ')) {
+ module = data.substring(0, data.indexOf(' '));
+ options = data.substring(data.indexOf(' ') + 1);
+ } else {
module = data;
}
- return Array(module,options);
+ return Array(module, options);
}
function authParams(id) {
- currentId=id;
+ currentId = id;
- var t=splitModuleAndOptions(lmdata(id));
+ var t = splitModuleAndOptions(lmdata(id));
// Update options field
- $('#authOptions').val(t[1]);
+ $('#authOptions').val(t[1]);
- if(t[1].length>1){
+ if (t[1].length > 1) {
$('#authOptions').show();
- }else{
+ } else {
$('#authOptions').hide();
}
// Check Multi
$('#authText').unbind('change');
- $('#authText').change(function(){
- var isMulti=false;
- $('#content_authParams option:selected').each(function(){
- if($(this).val()=='Multi'){isMulti=true;}
+ $('#authText').change(function() {
+ var isMulti = false;
+ $('#content_authParams option:selected').each(function() {
+ if ($(this).val() == 'Multi') {
+ isMulti = true;
+ }
});
- if(isMulti){
+ if (isMulti) {
$('#authOptions').show();
- }else{
+ } else {
$('#authOptions').hide();
}
});
- formateSelectAuth('authText',t[0]);
- display('authParams',lmtext(id));
+ formateSelectAuth('authText', t[0]);
+ display('authParams', lmtext(id));
}
-function formateSelectAuth(id,value){
+function formateSelectAuth(id, value) {
// Handle "ldap" case for old versions
- if(value && value.toLowerCase()=="ldap"){
- value="LDAP";
+ if (value && value.toLowerCase() == "ldap") {
+ value = "LDAP";
}
- formateSelect(id,[
- 'Apache=Apache',
- 'AD=Active Directory',
- 'BrowserID=BrowserID (Mozilla Persona)',
- 'Choice=Authentication choice',
- 'CAS=Central Authentication Service (CAS)',
- 'DBI=Database (DBI)',
- 'Demo=Demonstration',
- 'Facebook=Facebook',
- 'Google=Google',
- 'LDAP=LDAP',
- 'Multi=Multiple',
- 'Null=None',
- 'OpenID=OpenID',
- 'Proxy=Proxy',
- 'Radius=Radius',
- 'Remote=Remote',
- 'SAML=SAML v2',
- 'Slave=Slave',
- 'SSL=SSL',
- 'Twitter=Twitter',
- 'WebID=WebID',
- 'Yubikey=Yubikey'
- ],value);
+ formateSelect(id, ['Apache=Apache', 'AD=Active Directory', 'BrowserID=BrowserID (Mozilla Persona)', 'Choice=Authentication choice', 'CAS=Central Authentication Service (CAS)', 'DBI=Database (DBI)', 'Demo=Demonstration', 'Facebook=Facebook', 'Google=Google', 'LDAP=LDAP', 'Multi=Multiple', 'Null=None', 'OpenID=OpenID', 'Proxy=Proxy', 'Radius=Radius', 'Remote=Remote', 'SAML=SAML v2', 'Slave=Slave', 'SSL=SSL', 'Twitter=Twitter', 'WebID=WebID', 'Yubikey=Yubikey'], value);
}
function userdbParams(id) {
- currentId=id;
+ currentId = id;
- var t=splitModuleAndOptions(lmdata(id));
+ var t = splitModuleAndOptions(lmdata(id));
// Update options field
$('#authOptions').val(t[1]);
- if(t[1].length>1){
+ if (t[1].length > 1) {
$('#authOptions').show();
- }else{
- $('#authOptions').hide();
+ } else {
+ $('#authOptions').hide();
}
// Check Multi
$('#authText').unbind('change');
- $('#authText').change(function(){
- var isMulti=false;
- $('#content_authParams option:selected').each(function(){
- if($(this).val()=='Multi'){isMulti=true;}
+ $('#authText').change(function() {
+ var isMulti = false;
+ $('#content_authParams option:selected').each(function() {
+ if ($(this).val() == 'Multi') {
+ isMulti = true;
+ }
});
- if(isMulti){
+ if (isMulti) {
$('#authOptions').show();
- }else{
+ } else {
$('#authOptions').hide();
}
});
- formateSelectUser('authText',t[0]);
- display('authParams',lmtext(id));
+ formateSelectUser('authText', t[0]);
+ display('authParams', lmtext(id));
}
-function formateSelectUser(id,value){
+function formateSelectUser(id, value) {
// Handle "ldap" case for old versions
- if(value && value.toLowerCase()=="ldap"){
- value="LDAP";
+ if (value && value.toLowerCase() == "ldap") {
+ value = "LDAP";
}
- formateSelect(id,[
- 'AD=Active Directory',
- 'DBI=Database (DBI)',
- 'Demo=Demonstration',
- 'Facebook=Facebook',
- 'Google=Google',
- 'LDAP=LDAP',
- 'Multi=Multiple',
- 'Null=None',
- 'OpenID=OpenID',
- 'Proxy=Proxy',
- 'Remote=Remote',
- 'SAML=SAML v2',
- 'Slave=Slave',
- 'WebID=WebID'
- ],value);
+ formateSelect(id, ['AD=Active Directory', 'DBI=Database (DBI)', 'Demo=Demonstration', 'Facebook=Facebook', 'Google=Google', 'LDAP=LDAP', 'Multi=Multiple', 'Null=None', 'OpenID=OpenID', 'Proxy=Proxy', 'Remote=Remote', 'SAML=SAML v2', 'Slave=Slave', 'WebID=WebID'], value);
}
function passworddbParams(id) {
- currentId=id;
+ currentId = id;
$('#authOptions').hide();
- formateSelectPassword('authText',lmdata(id));
- display('authParams',lmtext(id));
+ formateSelectPassword('authText', lmdata(id));
+ display('authParams', lmtext(id));
}
-function formateSelectPassword(id,value){
+function formateSelectPassword(id, value) {
// Handle "ldap" case for old versions
- if(value && value.toLowerCase()=="ldap"){
- value="LDAP";
+ if (value && value.toLowerCase() == "ldap") {
+ value = "LDAP";
}
- formateSelect(id,[
- 'AD=Active Directory',
- 'DBI=Database (DBI)',
- 'Demo=Demonstration',
- 'LDAP=LDAP',
- 'Null=None'
- ],value);
+ formateSelect(id, ['AD=Active Directory', 'DBI=Database (DBI)', 'Demo=Demonstration', 'LDAP=LDAP', 'Null=None'], value);
}
function skinSelect(id) {
- currentId=id;
+ currentId = id;
changeSkinImage(lmdata(id));
- display('skin',lmtext(id));
+ display('skin', lmtext(id));
}
/* Change current skin */
function changeSkinImage(skin) {
@@ -704,11 +745,11 @@ function changeSkinImage(skin) {
$('#skinText').val(skin);
// Set skin to custom if not a registered skin
// Custom field can the be edited
- if ((skin!='pastel') && (skin!='dark') && (skin!='impact') && (skin!='bootstrap')){
+ if ((skin != 'pastel') && (skin != 'dark') && (skin != 'impact') && (skin != 'bootstrap')) {
skin = 'custom';
$('#skinText').removeAttr('readonly');
} else {
- $('#skinText').attr('readonly','readonly');
+ $('#skinText').attr('readonly', 'readonly');
}
// Set image source
var imgsrc = imagepath + 'portal-skins/' + skin + '.png';
@@ -716,163 +757,143 @@ function changeSkinImage(skin) {
$('#content_skin img.current').attr('alt', skin);
}
function nameIdFormatParams(id) {
- currentId=id;
- formateSelect('select',[
- '=',
- 'unspecified=Unspecified',
- 'email=Email',
- 'x509=X509 certificate',
- 'windows=Windows',
- 'kerberos=Kerberos',
- 'entity=Entity',
- 'persistent=Persistent',
- 'transient=Transient',
- 'encrypted=Encrypted'
- ],lmdata(id));
- display('select',lmtext(id));
+ currentId = id;
+ formateSelect('select', ['=', 'unspecified=Unspecified', 'email=Email', 'x509=X509 certificate', 'windows=Windows', 'kerberos=Kerberos', 'entity=Entity', 'persistent=Persistent', 'transient=Transient', 'encrypted=Encrypted'], lmdata(id));
+ display('select', lmtext(id));
}
function bindingParams(id) {
- currentId=id;
- formateSelect('select',[
- '=',
- 'http-post=POST',
- 'http-redirect=REDIRECT',
- 'http-soap=SOAP',
- 'artifact-get=Artifact GET',
- 'artifact-post=Artifact POST'
- ],lmdata(id));
- display('select',lmtext(id));
+ currentId = id;
+ formateSelect('select', ['=', 'http-post=POST', 'http-redirect=REDIRECT', 'http-soap=SOAP', 'artifact-get=Artifact GET', 'artifact-post=Artifact POST'], lmdata(id));
+ display('select', lmtext(id));
}
function authnContextParams(id) {
- currentId=id;
- formateSelect('select',[
- '=',
- 'kerberos=Kerberos',
- 'password-protected-transport=Password protected transport',
- 'password=Password',
- 'tls-client=TLS client certificate',
- ],lmdata(id));
- display('select',lmtext(id));
+ currentId = id;
+ formateSelect( 'select',
+ [ '=',
+ 'kerberos=Kerberos',
+ 'password-protected-transport=Password protected transport',
+ 'password=Password',
+ 'tls-client=TLS client certificate',
+ ], lmdata(id));
+ display('select', lmtext(id));
}
function encryptionModeParams(id) {
- currentId=id;
- formateSelect('select',[
- 'none=None',
- 'nameid=Name ID',
- 'assertion=Assertion'
- ],lmdata(id));
- display('select',lmtext(id));
+ currentId = id;
+ formateSelect('select', ['none=None', 'nameid=Name ID', 'assertion=Assertion'], lmdata(id));
+ display('select', lmtext(id));
}
function timeoutActivityParams(id) {
- currentId=id;
- formateSelect('select',[
- '0=None',
- '900=15 min',
- '1800=30 min',
- '2700=45 min',
- '3600=60 min'
- ],lmdata(id));
- display('select',lmtext(id));
+ currentId = id;
+ formateSelect('select', ['0=None', '900=15 min', '1800=30 min', '2700=45 min', '3600=60 min'], lmdata(id));
+ display('select', lmtext(id));
}
function zimbraByParams(id) {
- currentId=id;
- formateSelect('select',[
- '=',
- 'name=User name',
- 'id=User id',
- 'foreignPrincipal=Foreign principal'
- ],lmdata(id));
- display('select',lmtext(id));
+ currentId = id;
+ formateSelect('select', ['=', 'name=User name', 'id=User id', 'foreignPrincipal=Foreign principal'], lmdata(id));
+ display('select', lmtext(id));
}
function casAccessControlPolicyParams(id) {
- currentId=id;
- formateSelect('select',[
- 'none=None',
- 'error=Display error on portal',
- 'faketicket=Send a fake service ticket'
- ],lmdata(id));
- display('select',lmtext(id));
+ currentId = id;
+ formateSelect('select', ['none=None', 'error=Display error on portal', 'faketicket=Send a fake service ticket'], lmdata(id));
+ display('select', lmtext(id));
}
function btext(id) {
- currentId=id;
+ currentId = id;
$('#btextKey').val(lmtext(id));
$('#btextValue').val(lmdata(id));
- display('btext',lmtext(id));
+ display('btext', lmtext(id));
$('#btextValue,#btextKey').elastic()
$('#newkb,#delkb').show();
}
function bool(id) {
- currentId=id;
- if(lmdata(id)==1){$('#On').prop('checked',true)}else{$('#Off').prop('checked',true)}
- display('bool',lmtext(id));
+ currentId = id;
+ if (lmdata(id) == 1) {
+ $('#On').prop('checked', true)
+ } else {
+ $('#Off').prop('checked', true)
+ }
+ display('bool', lmtext(id));
}
function trool(id) {
- currentId=id;
- if(lmdata(id)==1){$('#TrOn').prop('checked',true)}
- else{if(lmdata(id)==0){$('#TrOff').prop('checked',true)}
- else{$('#TrDefault').prop('checked',true)}}
- display('trool',lmtext(id));
+ currentId = id;
+ if (lmdata(id) == 1) {
+ $('#TrOn').prop('checked', true)
+ }
+ else {
+ if (lmdata(id) == 0) {
+ $('#TrOff').prop('checked', true)
+ }
+ else {
+ $('#TrDefault').prop('checked', true)
+ }
+ }
+ display('trool', lmtext(id));
}
function int(id) {
- currentId=id;
+ currentId = id;
$('#int').val(lmdata(id));
- display('int',lmtext(id));
+ display('int', lmtext(id));
}
function text(id) {
- currentId=id;
+ currentId = id;
$('#text').val(lmdata(id));
- display('text',lmtext(id));
+ display('text', lmtext(id));
}
function textarea(id) {
- currentId=id;
+ currentId = id;
$('#textarea').val(lmdata(id));
- display('textarea',lmtext(id));
+ display('textarea', lmtext(id));
}
function filearea(id) {
- currentId=id;
+ currentId = id;
$('#urlinput').hide();
$('#downloadfile').hide();
$('#generatefile').hide();
$('#filearea').val(lmdata(id));
/* Only samlIDPMetaDataXML and samlSPMetaDataXML element could be loaded from URL */
- if(lmtext(id)=='samlIDPMetaDataXML'){$('#urlinput').show();}
- if(lmtext(id)=='samlSPMetaDataXML') {$('#urlinput').show();}
+ if (lmtext(id) == 'samlIDPMetaDataXML') {
+ $('#urlinput').show();
+ }
+ if (lmtext(id) == 'samlSPMetaDataXML') {
+ $('#urlinput').show();
+ }
/* Only samlServicePrivateKey* elements could generate keys */
- if(lmtext(id)=='samlServicePrivateKeySig'){$('#generatefile').show();}
- if(lmtext(id)=='samlServicePrivateKeyEnc'){$('#generatefile').show();}
+ if (lmtext(id) == 'samlServicePrivateKeySig') {
+ $('#generatefile').show();
+ }
+ if (lmtext(id) == 'samlServicePrivateKeyEnc') {
+ $('#generatefile').show();
+ }
/* If data, then allow to download */
- if(lmdata(id).length){$('#downloadfile').show();}
+ if (lmdata(id).length) {
+ $('#downloadfile').show();
+ }
/* Set switchReadonly text */
$('#switchreadonly span').text(text4edit);
- display('filearea',lmtext(id));
+ display('filearea', lmtext(id));
}
function samlAssertion(id) {
- currentId=id;
- var t=lmdata(id).split(';');
+ currentId = id;
+ var t = lmdata(id).split(';');
// Reset text fields
$('#samlAssertionIndex').removeAttr('value');
$('#samlAssertionLocation').removeAttr('value');
// Fill fields
- if(t[0]==1){
- $('#samlAssertionDefaultOn').prop('checked',true);
- }else{
- $('#samlAssertionDefaultOff').prop('checked',true);
+ if (t[0] == 1) {
+ $('#samlAssertionDefaultOn').prop('checked', true);
+ } else {
+ $('#samlAssertionDefaultOff').prop('checked', true);
}
$('#samlAssertionIndex').val(t[1]);
- formateSelect('samlAssertionBinding',[
- 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact=Artifact',
- 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST=HTTP POST',
- 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect=HTTP Redirect',
- 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP=SOAP'
- ],t[2]);
+ formateSelect('samlAssertionBinding', ['urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact=Artifact', 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST=HTTP POST', 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect=HTTP Redirect', 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP=SOAP'], t[2]);
$('#samlAssertionLocation').val(t[3]);
- display('samlAssertion',lmtext(id));
+ display('samlAssertion', lmtext(id));
}
function samlAttribute(id) {
- currentId=id;
- var t=lmdata(id).split(';');
+ currentId = id;
+ var t = lmdata(id).split(';');
// Reset text fields
$('#samlAttributeKey').removeAttr('value');
@@ -880,317 +901,329 @@ function samlAttribute(id) {
$('#samlAttributeFriendlyName').removeAttr('value');
// Fill fields
- if(t[0]==1){
- $('#samlAttributeMandatoryOn').prop('checked',true);
- }else{
- $('#samlAttributeMandatoryOff').prop('checked',true);
+ if (t[0] == 1) {
+ $('#samlAttributeMandatoryOn').prop('checked', true);
+ } else {
+ $('#samlAttributeMandatoryOff').prop('checked', true);
}
$('#samlAttributeKey').val(lmtext(id));
$('#samlAttributeName').val(t[1]);
- formateSelect('samlAttributeFormat',[
- '=',
- 'urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified=Unspecified',
- 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri=URI',
- 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic=Basic'
- ],t[2]);
+ formateSelect('samlAttributeFormat', ['=', 'urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified=Unspecified', 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri=URI', 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic=Basic'], t[2]);
$('#samlAttributeFriendlyName').val(t[3]);
- display('samlAttribute',lmtext(id));
+ display('samlAttribute', lmtext(id));
$('#newsamlattributeb,#delsamlattributeb').show();
}
-function samlAttributeRoot(id){
- currentId=id;
- display('default','');
+function samlAttributeRoot(id) {
+ currentId = id;
+ display('default', '');
$('#newsamlattributebr').show();
}
-function samlIdpMetaData(id){
- currentId=id;
+function samlIdpMetaData(id) {
+ currentId = id;
$('#samlIdpMetaData').val(lmtext(id));
- display('samlIdpMetaData',lmtext(id));
- if($('#li_'+myB64('/samlIDPMetaDataNode')).find('span').size()==1){
+ display('samlIdpMetaData', lmtext(id));
+ if ($('#li_' + myB64('/samlIDPMetaDataNode')).find('span').size() == 1) {
$('#delidpsamlmetadatab').hide();
- }else{
+ } else {
$('#delidpsamlmetadatab').show();
}
$('#newidpsamlmetadatab').show();
}
-function samlSpMetaData(id){
- currentId=id;
+function samlSpMetaData(id) {
+ currentId = id;
$('#samlSpMetaData').val(lmtext(id));
- display('samlSpMetaData',lmtext(id));
- if($('#li_'+myB64('/samlSPMetaDataNode')).find('span').size()==1){
+ display('samlSpMetaData', lmtext(id));
+ if ($('#li_' + myB64('/samlSPMetaDataNode')).find('span').size() == 1) {
$('#delspsamlmetadatab').hide();
- }else{
+ } else {
$('#delspsamlmetadatab').show();
}
$('#newspsamlmetadatab').show();
}
function samlService(id) {
- currentId=id;
- var t=lmdata(id).split(';');
- formateSelect('samlServiceBinding',[
- 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect=HTTP Redirect',
- 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST=HTTP POST',
- 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact=HTTP Artifact',
- 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP=SOAP'
- ],t[0]);
+ currentId = id;
+ var t = lmdata(id).split(';');
+ formateSelect('samlServiceBinding', ['urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect=HTTP Redirect', 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST=HTTP POST', 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact=HTTP Artifact', 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP=SOAP'], t[0]);
$('#samlServiceLocation').val(t[1]);
$('#samlServiceResponseLocation').val(t[2]);
- display('samlService',lmtext(id));
+ display('samlService', lmtext(id));
}
function openididplist(id) {
- currentId=id;
- var t=lmdata(id).split(';');
- if(t[0]==1){
- $('#openid_serverlist_white').prop('checked',true);
- }else{
- $('#openid_serverlist_black').prop('checked',true);
+ currentId = id;
+ var t = lmdata(id).split(';');
+ if (t[0] == 1) {
+ $('#openid_serverlist_white').prop('checked', true);
+ } else {
+ $('#openid_serverlist_black').prop('checked', true);
}
$('#openid_serverlist_text').val(t[1]);
- display('openid_serverlist',lmtext(id));
+ display('openid_serverlist', lmtext(id));
}
-function securedCookieValues(id){
- currentId=id;
- formateSelect('select',[
- '0='+text4securedCookie0,
- '1='+text4securedCookie1,
- '2='+text4securedCookie2,
- '3='+text4securedCookie3
- ],lmdata(id));
- display('select',lmtext(id));
+function securedCookieValues(id) {
+ currentId = id;
+ formateSelect('select', ['0=' + text4securedCookie0, '1=' + text4securedCookie1, '2=' + text4securedCookie2, '3=' + text4securedCookie3], lmdata(id));
+ display('select', lmtext(id));
}
-function vhost(id){
- currentId=id;
+function vhost(id) {
+ currentId = id;
$('#vhost').val(lmtext(id));
- display('vhost',lmtext(id));
+ display('vhost', lmtext(id));
$('#bdelvh,#bnewvh').show();
}
-function cfgDatas(id){
- var span=$('#'+id+' span');
+function cfgDatas(id) {
+ var span = $('#' + id + ' span');
loadHelp(span.attr('help'));
- display('cfgDatas','');
+ display('cfgDatas', '');
getCfgAttributes();
}
-function delvh(id){
+function delvh(id) {
var vhname = lmtext(id);
- if(confirm('Delete '+vhname+' ?')){delKey(id);}
+ if (confirm('Delete ' + vhname + ' ?')) {
+ delKey(id);
+ }
}
-function rules(id){
- currentId=id;
- var t=lmtext(id);
- var b=t.match(/^(?:\(\?#(.*?)\))?(.*)/);
- if(typeof(b[1])=='undefined')b[1]='';
+function rules(id) {
+ currentId = id;
+ var t = lmtext(id);
+ var b = t.match(/^(?:\(\?#(.*?)\))?(.*)/);
+ if (typeof(b[1]) == 'undefined') b[1] = '';
//$('#rulComment').val(b[1]);
$('#rulComment').val(b[1]);
$('#rulKey').val(b[2]);
$('#rulValue').val(lmdata(id));
- display('rules',lmtext(lmparent(id)));
+ display('rules', lmtext(lmparent(id)));
$('#rulComment,#rulKey,#rulValue').elastic();
- if(t=='default'){
- $('#rulKey').attr('readonly','readonly');
- $('#rulCommentDiv').css('display','none');
+ if (t == 'default') {
+ $('#rulKey').attr('readonly', 'readonly');
+ $('#rulCommentDiv').css('display', 'none');
}
- else{
+ else {
$('#rulKey').removeAttr('readonly');
- $('#rulCommentDiv').css('display','block');
+ $('#rulCommentDiv').css('display', 'block');
$('#delkb').show();
}
$('#newrb').show();
}
-function rulesRoot(id){
- currentId=id;
- display('default','');
+function rulesRoot(id) {
+ currentId = id;
+ display('default', '');
$('#newrbr').show();
}
-function grantSessionRules(id){
- currentId=id;
- var t=lmtext(id);
- var b=t.match(/^(.*?)(?:|##(.*))$/);
- if(typeof(b[2])=='undefined')b[2]='';
- var v=lmdata(id);
- if(v=='#')v=''
+function grantSessionRules(id) {
+ currentId = id;
+ var t = lmtext(id);
+ var b = t.match(/^(.*?)(?:|##(.*))$/);
+ if (typeof(b[2]) == 'undefined') b[2] = '';
+ var v = lmdata(id);
+ if (v == '#') v = ''
$('#grantSessionRulKey').val(b[1]);
$('#grantSessionRulComment').val(b[2]);
$('#grantSessionRulValue').val(v);
- display('grantSessionRules',lmtext(lmparent(id)));
+ display('grantSessionRules', lmtext(lmparent(id)));
$('#grantSessionRulKey,#grantSessionRulComment,#grantSessionRulValue').elastic();
$('#delkb').show();
$('#newgsrb').show();
}
-function grantSessionRulesRoot(id){
- currentId=id;
- display('default','');
+function grantSessionRulesRoot(id) {
+ currentId = id;
+ display('default', '');
$('#newgsrbr').show();
}
function reloadAuthParams() {
- var value=$('#authText').val();
- if($('#authOptions').is(':visible')){
- value+=' '+$('#authOptions').val();
+ var value = $('#authText').val();
+ if ($('#authOptions').is(':visible')) {
+ value += ' ' + $('#authOptions').val();
}
- setlmdata(currentId,value);
+ setlmdata(currentId, value);
$.ajax({
- type:"POST",
- url:scriptname,
- data:{node:'generalParameters/authParams',conf:'authentication userDB passwordDB issuerDB',cfgNum:lmdata('li_cm9vdA2'),authentication:lmdata('li_L2F1dGhlbnRpY2F0aW9u0'),userDB:lmdata('li_L3VzZXJEQg2'),passwordDB:lmdata('li_L3Bhc3N3b3JkREI1'),issuerDB:lmdata('li_L2lzc3VlckRC0')},
- dataType:'html',
- success:function(data){
- if(data==null){networkPb()}
- else{
- var node=$('#li_Z2VuZXJhbFBhcmFtZXRlcnMvYXV0aFBhcmFtcw2 >ul');
+ type: "POST",
+ url: scriptname,
+ data: {
+ node: 'generalParameters/authParams',
+ conf: 'authentication userDB passwordDB issuerDB',
+ cfgNum: lmdata('li_cm9vdA2'),
+ authentication: lmdata('li_L2F1dGhlbnRpY2F0aW9u0'),
+ userDB: lmdata('li_L3VzZXJEQg2'),
+ passwordDB: lmdata('li_L3Bhc3N3b3JkREI1'),
+ issuerDB: lmdata('li_L2lzc3VlckRC0')
+ },
+ dataType: 'html',
+ success: function(data) {
+ if (data == null) {
+ networkPb()
+ }
+ else {
+ var node = $('#li_Z2VuZXJhbFBhcmFtZXRlcnMvYXV0aFBhcmFtcw2 >ul');
node.html(data);
simpleTreeCollection[0].setTreeNodes(node, true);
simpleTreeDefaultJqueryClasses();
simpleTreeToggleJqueryClasses();
}
},
- error:function(xhr, ajaxOptions, thrownError){
- popup('Request failed
- Error code: '+xhr.status+', '+thrownError+'
');
+ error: function(xhr, ajaxOptions, thrownError) {
+ popup('Request failed
- Error code: ' + xhr.status + ', ' + thrownError + '
');
}
});
}
-var count=0;
-function newId(c){
- if(!c){return false;}
+var count = 0;
+function newId(c) {
+ if (!c) {
+ return false;
+ }
count++;
- c=c.replace(/^NewID_(.*)_\d+$/,'$1');
- return 'NewID_'+c+'_'+count;
+ c = c.replace(/^NewID_(.*)_\d+$/, '$1');
+ return 'NewID_' + c + '_' + count;
}
-function newKeyR(){
- var newIdValue=newId(currentId);
- simpleTreeCollection[0].addNode(newIdValue,text4newKey,function(d,s){
- $('>span',s).attr('onClick','btext("'+newIdValue+'")').attr('name',text4newKey).attr('value',value4newKey).attr('id','text_'+newIdValue);
+function newKeyR() {
+ var newIdValue = newId(currentId);
+ simpleTreeCollection[0].addNode(newIdValue, text4newKey, function(d, s) {
+ $('>span', s).attr('onClick', 'btext("' + newIdValue + '")').attr('name', text4newKey).attr('value', value4newKey).attr('id', 'text_' + newIdValue);
btext(newIdValue);
});
return false;
}
-function newKey(){
- var newIdValue=newId(currentId);
- simpleTreeCollection[0].newNodeAfter(newIdValue,text4newKey,function(d,s){
- $('>span',s).attr('onClick','btext("'+newIdValue+'")').attr('name',text4newKey).attr('value',value4newKey).attr('id','text_'+newIdValue);
+function newKey() {
+ var newIdValue = newId(currentId);
+ simpleTreeCollection[0].newNodeAfter(newIdValue, text4newKey, function(d, s) {
+ $('>span', s).attr('onClick', 'btext("' + newIdValue + '")').attr('name', text4newKey).attr('value', value4newKey).attr('id', 'text_' + newIdValue);
btext(newIdValue);
});
return false;
}
-function newRuleR(){
- var newIdValue=newId(currentId);
- simpleTreeCollection[0].addNode(newIdValue,text4newKey,function(d,s){
- $('>span',s).attr('onClick','rules("'+newIdValue+'")').attr('name',text4newKey).attr('value',value4newKey).attr('id','text_'+newIdValue);
+function newRuleR() {
+ var newIdValue = newId(currentId);
+ simpleTreeCollection[0].addNode(newIdValue, text4newKey, function(d, s) {
+ $('>span', s).attr('onClick', 'rules("' + newIdValue + '")').attr('name', text4newKey).attr('value', value4newKey).attr('id', 'text_' + newIdValue);
rules(newIdValue);
});
return false;
}
-function newRule(){
- var newIdValue=newId(currentId);
- simpleTreeCollection[0].newNodeAfter(newIdValue,text4newKey,function(d,s){
- $('>span',s).attr('onClick','rules("'+newIdValue+'")').attr('name',text4newKey).attr('value',value4newKey).attr('id','text_'+newIdValue);
+function newRule() {
+ var newIdValue = newId(currentId);
+ simpleTreeCollection[0].newNodeAfter(newIdValue, text4newKey, function(d, s) {
+ $('>span', s).attr('onClick', 'rules("' + newIdValue + '")').attr('name', text4newKey).attr('value', value4newKey).attr('id', 'text_' + newIdValue);
rules(newIdValue);
});
return false;
}
-function newGrantSessionRuleR(){
- var newIdValue=newId(currentId);
- simpleTreeCollection[0].addNode(newIdValue,text4newCondition,function(d,s){
- $('>span',s).attr('onClick','grantSessionRules("'+newIdValue+'")').attr('name','##'+text4newCondition).removeAttr('value').attr('id','text_'+newIdValue);
- grantSessionRules(newIdValue);
- });
- return false;
+function newGrantSessionRuleR() {
+ var newIdValue = newId(currentId);
+ simpleTreeCollection[0].addNode(newIdValue, text4newCondition, function(d, s) {
+ $('>span', s).attr('onClick', 'grantSessionRules("' + newIdValue + '")').attr('name', '##' + text4newCondition).removeAttr('value').attr('id', 'text_' + newIdValue);
+ grantSessionRules(newIdValue);
+ });
+ return false;
}
-function newGrantSessionRule(){
- var newIdValue=newId(currentId);
- simpleTreeCollection[0].newNodeAfter(newIdValue,text4newCondition,function(d,s){
- $('>span',s).attr('onClick','grantSessionRules("'+newIdValue+'")').attr('name','##'+text4newCondition).removeAttr('value').attr('id','text_'+newIdValue);
- grantSessionRules(newIdValue);
- });
- return false;
+function newGrantSessionRule() {
+ var newIdValue = newId(currentId);
+ simpleTreeCollection[0].newNodeAfter(newIdValue, text4newCondition, function(d, s) {
+ $('>span', s).attr('onClick', 'grantSessionRules("' + newIdValue + '")').attr('name', '##' + text4newCondition).removeAttr('value').attr('id', 'text_' + newIdValue);
+ grantSessionRules(newIdValue);
+ });
+ return false;
}
-function delKey(id){
- if(!id){id=currentId;}
- $('#'+safeSelector(id)).prev().remove();
- $('#'+safeSelector(id)).remove();
+function delKey(id) {
+ if (!id) {
+ id = currentId;
+ }
+ $('#' + safeSelector(id)).prev().remove();
+ $('#' + safeSelector(id)).remove();
}
-function newVh(name){
+function newVh(name) {
// Prompt for virtual host name
- var name = prompt(text4newVhost,'test25.example.com');
- if(!name){return false;}
- var vhId='li_'+myB64('/locationRules/'+name);
- simpleTreeCollection[0].newAjaxNodeIn($('#li_L3ZpcnR1YWxIb3N0cw2'),vhId,name,scriptname+'?type=new&node=virtualHosts/'+name,function(d,s){
- $('>span',s).attr('name',name).attr('help','default').attr('id','text_'+vhId).attr('onclick','vhost(\''+vhId+'\')');
- vhost(vhId);
+ var name = prompt(text4newVhost, 'test25.example.com');
+ if (!name) {
+ return false;
+ }
+ var vhId = 'li_' + myB64('/locationRules/' + name);
+ simpleTreeCollection[0].newAjaxNodeIn($('#li_L3ZpcnR1YWxIb3N0cw2'), vhId, name, scriptname + '?type=new&node=virtualHosts/' + name, function(d, s) {
+ $('>span', s).attr('name', name).attr('help', 'default').attr('id', 'text_' + vhId).attr('onclick', 'vhost(\'' + vhId + '\')');
+ vhost(vhId);
});
}
-function delSamlAttribute(){
+function delSamlAttribute() {
delKey();
}
-function delIdpSamlMetaData(id){
+function delIdpSamlMetaData(id) {
var idpname = lmtext(id);
- if(confirm('Delete '+idpname+' ?')){
+ if (confirm('Delete ' + idpname + ' ?')) {
delKey(id);
samlIdpMetaData(id);
}
}
-function delSpSamlMetaData(id){
+function delSpSamlMetaData(id) {
var spname = lmtext(id);
- if(confirm('Delete '+spname+' ?')){
+ if (confirm('Delete ' + spname + ' ?')) {
delKey(id);
samlSpMetaData(id);
}
}
-function newSamlAttribute(){
- var newIdValue=newId(currentId);
- simpleTreeCollection[0].newNodeAfter(newIdValue,text4newSamlAttribute,function(d,s){
- $('>span',s).attr('onClick','samlAttribute("'+newIdValue+'")').attr('name',text4newSamlAttribute).attr('value',value4newSamlAttribute).attr('id','text_'+newIdValue);
+function newSamlAttribute() {
+ var newIdValue = newId(currentId);
+ simpleTreeCollection[0].newNodeAfter(newIdValue, text4newSamlAttribute, function(d, s) {
+ $('>span', s).attr('onClick', 'samlAttribute("' + newIdValue + '")').attr('name', text4newSamlAttribute).attr('value', value4newSamlAttribute).attr('id', 'text_' + newIdValue);
samlAttribute(newIdValue);
});
return false;
}
-function newSamlAttributeR(){
- var newIdValue=newId(currentId);
- simpleTreeCollection[0].addNode(newIdValue,text4newSamlAttribute,function(d,s){
- $('>span',s).attr('onClick','samlAttribute("'+newIdValue+'")').attr('name',text4newSamlAttribute).attr('value',value4newSamlAttribute).attr('id','text_'+newIdValue);
+function newSamlAttributeR() {
+ var newIdValue = newId(currentId);
+ simpleTreeCollection[0].addNode(newIdValue, text4newSamlAttribute, function(d, s) {
+ $('>span', s).attr('onClick', 'samlAttribute("' + newIdValue + '")').attr('name', text4newSamlAttribute).attr('value', value4newSamlAttribute).attr('id', 'text_' + newIdValue);
samlAttribute(newIdValue);
});
return false;
}
-function newIdpSamlMetaData(){
- var name = prompt(text4newSamlMetaData,'idp-example');
- if(!name){return false;}
- var idpId='li_'+myB64('/samlIDPMetaDataExportedAttributes/'+name);
- simpleTreeCollection[0].newAjaxNodeIn($('#li_L3NhbWxJRFBNZXRhRGF0YU5vZGU1'),idpId,name,scriptname+'?type=new&node=/samlIDPMetaDataNode/'+name,function(d,s){
- $('>span',s).attr('name',name).attr('help','default').attr('id','text_'+idpId).attr('onclick','samlIdpMetaData(\''+idpId+'\')');
+function newIdpSamlMetaData() {
+ var name = prompt(text4newSamlMetaData, 'idp-example');
+ if (!name) {
+ return false;
+ }
+ var idpId = 'li_' + myB64('/samlIDPMetaDataExportedAttributes/' + name);
+ simpleTreeCollection[0].newAjaxNodeIn($('#li_L3NhbWxJRFBNZXRhRGF0YU5vZGU1'), idpId, name, scriptname + '?type=new&node=/samlIDPMetaDataNode/' + name, function(d, s) {
+ $('>span', s).attr('name', name).attr('help', 'default').attr('id', 'text_' + idpId).attr('onclick', 'samlIdpMetaData(\'' + idpId + '\')');
samlIdpMetaData(idpId);
});
}
-function newSpSamlMetaData(){
- var name = prompt(text4newSamlMetaData,'sp-example');
- if(!name){return false;}
- var spId='li_'+myB64('/samlSPMetaDataExportedAttributes/'+name);
- simpleTreeCollection[0].newAjaxNodeIn($('#li_L3NhbWxTUE1ldGFEYXRhTm9kZQ2'),spId,name,scriptname+'?type=new&node=/samlSPMetaDataNode/'+name,function(d,s){
- $('>span',s).attr('name',name).attr('help','default').attr('id','text_'+spId).attr('onclick','samlSpMetaData(\''+spId+'\')');
+function newSpSamlMetaData() {
+ var name = prompt(text4newSamlMetaData, 'sp-example');
+ if (!name) {
+ return false;
+ }
+ var spId = 'li_' + myB64('/samlSPMetaDataExportedAttributes/' + name);
+ simpleTreeCollection[0].newAjaxNodeIn($('#li_L3NhbWxTUE1ldGFEYXRhTm9kZQ2'), spId, name, scriptname + '?type=new&node=/samlSPMetaDataNode/' + name, function(d, s) {
+ $('>span', s).attr('name', name).attr('help', 'default').attr('id', 'text_' + spId).attr('onclick', 'samlSpMetaData(\'' + spId + '\')');
samlSpMetaData(spId);
});
}
-var cfgAttrDone=0;
-function uploadConf(f){
- if(!(f==1))f=0;
+var cfgAttrDone = 0;
+function uploadConf(f) {
+ if (! (f == 1)) f = 0;
$.ajax({
- type:"POST",
- url:scriptname,
- data:{data: $('#li_cm9vdA2').html(),force: f},
- dataType:'json',
- success:function(data){
- if(data==null){networkPb()}
- else{
- var c=''+data.content.result.msg+'
';
- if(data.content.result.cfgNum<=0){
- if(typeof(data.content.errors)!='undefined'){
- c+='Errors
';
- c+='';
- for(m in data.content.errors){
- c+='- '+m+': '+data.content.errors[m]+'
';
+ type: "POST",
+ url: scriptname,
+ data: {
+ data: $('#li_cm9vdA2').html(),
+ force: f
+ },
+ dataType: 'json',
+ success: function(data) {
+ if (data == null) {
+ networkPb()
+ }
+ else {
+ var c = '' + data.content.result.msg + '
';
+ if (data.content.result.cfgNum <= 0) {
+ if (typeof(data.content.errors) != 'undefined') {
+ c += 'Errors
';
+ c += '';
+ for (m in data.content.errors) {
+ c += '- ' + m + ': ' + data.content.errors[m] + '
';
}
- c+='
';
+ c += '
';
}
}
- else{
+ else {
// Update configuration attributes
var cfgNum = data.content.result.cfgNum;
$('#cfgNum').text(cfgNum);
@@ -1199,89 +1232,101 @@ function uploadConf(f){
// Reload menu
$.ajax({
- type:"POST",
- url:scriptname,
- data:{menu:cfgNum},
- dataType:'html',
- success:function(data){
- if(data==null){networkPb()}
- else{
+ type: "POST",
+ url: scriptname,
+ data: {
+ menu: cfgNum
+ },
+ dataType: 'html',
+ success: function(data) {
+ if (data == null) {
+ networkPb()
+ }
+ else {
$("div#menu").html(data);
loadSimpleTree();
- display('cfgDatas','');
+ display('cfgDatas', '');
}
}
});
-
}
- if(typeof(data.content.warnings)!='undefined'){
- c+='Warnings
';
- c+='';
- for(m in data.content.warnings){
- c+='- '+m+': '+data.content.warnings[m]+'
';
+ if (typeof(data.content.warnings) != 'undefined') {
+ c += 'Warnings
';
+ c += '';
+ for (m in data.content.warnings) {
+ c += '- ' + m + ': ' + data.content.warnings[m] + '
';
}
- c+='
';
+ c += '
';
}
- c+=''+data.content.result.other+'
';
- if(typeof(data.content.applyStatus)!='undefined'){
- c+='Application status
';
- c+='';
}
popup(c);
}
},
- error:function(xhr, ajaxOptions, thrownError){
- popup('Request failed
- Error code: '+xhr.status+', '+thrownError+'
');
+ error: function(xhr, ajaxOptions, thrownError) {
+ popup('Request failed
- Error code: ' + xhr.status + ', ' + thrownError + '
');
}
});
}
function getCfgAttributes() {
- if(cfgAttrDone>0)return;
+ if (cfgAttrDone > 0) return;
$.ajax({
- type:"POST",
- url:scriptname,
- data:{cfgNum:lmdata('li_cm9vdA2'),cfgAttr:1},
- dataType:'json',
- success:function(data){
- if(data==null){networkPb()}
- else{
+ type: "POST",
+ url: scriptname,
+ data: {
+ cfgNum: lmdata('li_cm9vdA2'),
+ cfgAttr: 1
+ },
+ dataType: 'json',
+ success: function(data) {
+ if (data == null) {
+ networkPb()
+ }
+ else {
setCfgAttributes(data.content);
cfgAttrDone++;
}
},
- error:function(xhr, ajaxOptions, thrownError){
- var msg = 'Error code: '+xhr.status+', '+thrownError;
- setCfgAttributes({cfgAuthor:msg,cfgAuthorIP:msg,cfgDate:msg});
+ error: function(xhr, ajaxOptions, thrownError) {
+ var msg = 'Error code: ' + xhr.status + ', ' + thrownError;
+ setCfgAttributes({
+ cfgAuthor: msg,
+ cfgAuthorIP: msg,
+ cfgDate: msg
+ });
}
});
}
-function setCfgAttributes(data){
- var t = new Array('cfgAuthor','cfgAuthorIP','cfgDate');
+function setCfgAttributes(data) {
+ var t = new Array('cfgAuthor', 'cfgAuthorIP', 'cfgDate');
// Convert date to locale string
var date = data.cfgDate.toString();
- if(date.match(/^\d+$/)){
- var d=new Date(date*1000);
- data.cfgDate=d.toLocaleString();
+ if (date.match(/^\d+$/)) {
+ var d = new Date(date * 1000);
+ data.cfgDate = d.toLocaleString();
}
// Set configuration data
- for(i in t){
- $('#'+t[i]).text(data[t[i]]);
+ for (i in t) {
+ $('#' + t[i]).text(data[t[i]]);
}
}
/* Warning, it's not a real base64 */
function myB64(s) {
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
- var i=0;
- var res="";
- var s2="";
+ var i = 0;
+ var res = "";
+ var s2 = "";
while (i < s.length) {
chr1 = s.charCodeAt(i++);
chr2 = s.charCodeAt(i++);
@@ -1290,224 +1335,234 @@ function myB64(s) {
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
enc4 = chr3 & 63;
- res+=keyStr.charAt(enc1)+keyStr.charAt(enc2);
+ res += keyStr.charAt(enc1) + keyStr.charAt(enc2);
if (isNaN(chr2)) {
- res+='2';
- break;
- }
- res+=keyStr.charAt(enc3);
- if (isNaN(chr3)) {
- res+='1';
- break;
- }
- res+=keyStr.charAt(enc4);
- if(i==s.length) {
- res+='0';
- }
+ res += '2';
+ break;
+ }
+ res += keyStr.charAt(enc3);
+ if (isNaN(chr3)) {
+ res += '1';
+ break;
+ }
+ res += keyStr.charAt(enc4);
+ if (i == s.length) {
+ res += '0';
+ }
}
return res;
}
/* Function to download a file */
-function downloadFile(id){
- var content=lmdata(id).replace(/"/g,'"');
+function downloadFile(id) {
+ var content = lmdata(id).replace(/"/g, '"');
var inputs = '';
- var filename = prompt(text4newFilename,'lemonldap-ng.txt');
- if(!filename){return false;}
- inputs+='';
- inputs+='';
- jQuery('')
- .appendTo('body').submit().remove();
+ var filename = prompt(text4newFilename, 'lemonldap-ng.txt');
+ if (!filename) {
+ return false;
+ }
+ inputs += '';
+ inputs += '';
+ jQuery('').appendTo('body').submit().remove();
}
/* Function to generate a file */
-function generateFile(id){
+function generateFile(id) {
/* If samlServicePrivateKey* elements, then generate keys */
- if(lmtext(id)=='samlServicePrivateKeySig'||lmtext(id)=='samlServicePrivateKeyEnc'){
- var password = prompt(text4newGeneratedFile,'');
- $('#button-loadimg')
- .ajaxStart(function(){
+ if (lmtext(id) == 'samlServicePrivateKeySig' || lmtext(id) == 'samlServicePrivateKeyEnc') {
+ var password = prompt(text4newGeneratedFile, '');
+ $('#button-loadimg').ajaxStart(function() {
$(this).show();
- })
- .ajaxComplete(function(){
+ }).ajaxComplete(function() {
$(this).hide();
});
$.ajax({
- type:'POST',
- url:scriptname,
- data:{request: 'generateKeys',password: password},
- dataType:'json',
- success:function(data){
- if(data==null){networkPb()}
- else{
+ type: 'POST',
+ url: scriptname,
+ data: {
+ request: 'generateKeys',
+ password: password
+ },
+ dataType: 'json',
+ success: function(data) {
+ if (data == null) {
+ networkPb()
+ }
+ else {
var _public;
var _id;
- setlmdata(id,data.content.private);
- if(lmtext(id)=='samlServicePrivateKeySig'){_public='samlServicePublicKeySig';}
- if(lmtext(id)=='samlServicePrivateKeyEnc'){_public='samlServicePublicKeyEnc';}
- _id=$('#'+lmparent(id)+' span[name='+_public+']').attr('id').replace(/text_/,'');
- setlmdata(_id,data.content.public);
- _id=$('#'+lmparent(id)+' span[name='+lmtext(id)+'Pwd]').attr('id').replace(/text_/,'');
- setlmdata(_id,password);
+ setlmdata(id, data.content.private);
+ if (lmtext(id) == 'samlServicePrivateKeySig') {
+ _public = 'samlServicePublicKeySig';
+ }
+ if (lmtext(id) == 'samlServicePrivateKeyEnc') {
+ _public = 'samlServicePublicKeyEnc';
+ }
+ _id = $('#' + lmparent(id) + ' span[name=' + _public + ']').attr('id').replace(/text_/, '');
+ setlmdata(_id, data.content.public);
+ _id = $('#' + lmparent(id) + ' span[name=' + lmtext(id) + 'Pwd]').attr('id').replace(/text_/, '');
+ setlmdata(_id, password);
filearea(id);
}
},
- error:function(xhr, ajaxOptions, thrownError){
- popup('Request failed
- Error code: '+xhr.status+', '+thrownError+'
');
+ error: function(xhr, ajaxOptions, thrownError) {
+ popup('Request failed
- Error code: ' + xhr.status + ', ' + thrownError + '
');
}
});
$('#button-loadimg').unbind('ajaxStart');
}
}
/* Could not be called directly in _Struct.pm, required values */
-function formateSelect(id,values,selectedValue) {
- var options='';
- for(i=0;i'+val+'';
+function formateSelect(id, values, selectedValue) {
+ var options = '';
+ for (i = 0; i < values.length; i++) {
+ var key = values[i].substring(0, values[i].indexOf('='));
+ var val = values[i].substring(values[i].indexOf('=') + 1);
+ options += '';
}
- $('#'+safeSelector(id)).empty().append(options);
+ $('#' + safeSelector(id)).empty().append(options);
}
/* Function to switch readOnly flag */
function switchReadonly(selector) {
- if ( $(selector).attr("readonly") ) {
+ if ($(selector).attr("readonly")) {
$("#switchreadonly span").text(text4protect);
$(selector).removeAttr("readonly");
} else {
$("#switchreadonly span").text(text4edit);
- $(selector).attr("readonly","readonly");
+ $(selector).attr("readonly", "readonly");
}
}
/* Increase or decrease integer */
function increase() {
current = parseInt($("#int").val());
- if (current != NaN){
- $("#int").val(current+1)
+ if (current != NaN) {
+ $("#int").val(current + 1)
}
}
function decrease() {
current = parseInt($("#int").val());
- if (current != NaN){
- $("#int").val(current-1)
+ if (current != NaN) {
+ $("#int").val(current - 1)
}
}
/* Authentication choice */
-function authChoiceRoot(id){
- currentId=id;
- display('default','');
+function authChoiceRoot(id) {
+ currentId = id;
+ display('default', '');
$('#newchoicer').show();
}
-function newChoiceR(){
- var newIdValue=newId(currentId);
- simpleTreeCollection[0].addNode(newIdValue,text4newKey,function(d,s){
- $('>span',s).attr('onClick','authChoice("'+newIdValue+'")').attr('name',text4newKey).attr('value','Null|Null|Null|').attr('id','text_'+newIdValue);
+function newChoiceR() {
+ var newIdValue = newId(currentId);
+ simpleTreeCollection[0].addNode(newIdValue, text4newKey, function(d, s) {
+ $('>span', s).attr('onClick', 'authChoice("' + newIdValue + '")').attr('name', text4newKey).attr('value', 'Null|Null|Null|').attr('id', 'text_' + newIdValue);
authChoice(newIdValue);
});
return false;
}
-function newChoice(){
- var newIdValue=newId(currentId);
- simpleTreeCollection[0].newNodeAfter(newIdValue,text4newKey,function(d,s){
- $('>span',s).attr('onClick','authChoice("'+newIdValue+'")').attr('name',text4newKey).attr('value','Null|Null|Null|').attr('id','text_'+newIdValue);
+function newChoice() {
+ var newIdValue = newId(currentId);
+ simpleTreeCollection[0].newNodeAfter(newIdValue, text4newKey, function(d, s) {
+ $('>span', s).attr('onClick', 'authChoice("' + newIdValue + '")').attr('name', text4newKey).attr('value', 'Null|Null|Null|').attr('id', 'text_' + newIdValue);
authChoice(newIdValue);
});
return false;
}
-function delChoice(){
+function delChoice() {
delKey();
}
-function authChoice(id){
- currentId=id;
- var t=lmdata(id).split('|');
+function authChoice(id) {
+ currentId = id;
+ var t = lmdata(id).split('|');
$('#authChoiceKey').val(lmtext(id));
- formateSelectAuth('authChoiceAuth',t[0]);
- formateSelectUser('authChoiceUser',t[1]);
- formateSelectPassword('authChoicePassword',t[2]);
+ formateSelectAuth('authChoiceAuth', t[0]);
+ formateSelectUser('authChoiceUser', t[1]);
+ formateSelectPassword('authChoicePassword', t[2]);
$('#authChoiceURL').val(t[3]);
- display('authChoice',lmtext(id));
+ display('authChoice', lmtext(id));
$('#newchoice,#delchoice').show();
}
-function setlmauthchoice(id){
- var key=$('#authChoiceKey').val();
- var auth=$('#authChoiceAuth').val();
- var user=$('#authChoiceUser').val();
- var password=$('#authChoicePassword').val();
- var url=$('#authChoiceURL').val();
- setlmtext(id,key);
- setlmdata(id,auth+'|'+user+'|'+password+'|'+url);
+function setlmauthchoice(id) {
+ var key = $('#authChoiceKey').val();
+ var auth = $('#authChoiceAuth').val();
+ var user = $('#authChoiceUser').val();
+ var password = $('#authChoicePassword').val();
+ var url = $('#authChoiceURL').val();
+ setlmtext(id, key);
+ setlmdata(id, auth + '|' + user + '|' + password + '|' + url);
}
/* Application list */
-function applicationListCategoryRoot(id){
- currentId=id;
- display('default','');
+function applicationListCategoryRoot(id) {
+ currentId = id;
+ display('default', '');
$('#newcategoryr').show();
}
-function newCategoryR(){
- var name = prompt(text4newCategory,'mycategory');
- if(!name){return false;}
- var newIdValue=newId(currentId);
- simpleTreeCollection[0].addNode(newIdValue,name,function(d,s){
- $('>span',s).attr('onClick','applicationListCategory("'+newIdValue+'")').attr('name',name).attr('value','My Category').attr('id','text_'+newIdValue);
+function newCategoryR() {
+ var name = prompt(text4newCategory, 'mycategory');
+ if (!name) {
+ return false;
+ }
+ var newIdValue = newId(currentId);
+ simpleTreeCollection[0].addNode(newIdValue, name, function(d, s) {
+ $('>span', s).attr('onClick', 'applicationListCategory("' + newIdValue + '")').attr('name', name).attr('value', 'My Category').attr('id', 'text_' + newIdValue);
applicationListCategory(newIdValue);
});
return false;
}
-function delCategory(){
+function delCategory() {
delKey();
}
-function applicationListCategory(id){
- currentId=id;
+function applicationListCategory(id) {
+ currentId = id;
$('#applicationListCategoryKey').val(lmtext(id));
$('#applicationListCategoryName').val(lmdata(id));
- display('applicationListCategory',lmtext(id));
+ display('applicationListCategory', lmtext(id));
$('#delcategory,#newapplicationr').show();
}
-function newApplicationR(){
- var name = prompt(text4newApplication,'myapplication');
- if(!name){return false;}
- var newIdValue=newId(currentId);
- simpleTreeCollection[0].addNode(newIdValue,name,function(d,s){
- $('>span',s).attr('onClick','applicationListApplication("'+newIdValue+'")').attr('name',name).attr('value','My application|http://www.example.com|This is a nice application|logo.png|auto').attr('id','text_'+newIdValue);
+function newApplicationR() {
+ var name = prompt(text4newApplication, 'myapplication');
+ if (!name) {
+ return false;
+ }
+ var newIdValue = newId(currentId);
+ simpleTreeCollection[0].addNode(newIdValue, name, function(d, s) {
+ $('>span', s).attr('onClick', 'applicationListApplication("' + newIdValue + '")').attr('name', name).attr('value', 'My application|http://www.example.com|This is a nice application|logo.png|auto').attr('id', 'text_' + newIdValue);
applicationListApplication(newIdValue);
});
return false;
}
-function delApplication(){
+function delApplication() {
delKey();
}
-function setlmapplication(id){
- var key=$('#applicationListApplicationKey').val();
- var name=$('#applicationListApplicationName').val();
- var url=$('#applicationListApplicationURL').val();
- var desc=$('#applicationListApplicationDescription').val();
- var logo=$('#applicationListApplicationLogo').val();
- var display=$('#applicationListApplicationDisplay').val();
- setlmtext(id,key);
- setlmdata(id,name+'|'+url+'|'+desc+'|'+logo+'|'+display);
+function setlmapplication(id) {
+ var key = $('#applicationListApplicationKey').val();
+ var name = $('#applicationListApplicationName').val();
+ var url = $('#applicationListApplicationURL').val();
+ var desc = $('#applicationListApplicationDescription').val();
+ var logo = $('#applicationListApplicationLogo').val();
+ var display = $('#applicationListApplicationDisplay').val();
+ setlmtext(id, key);
+ setlmdata(id, name + '|' + url + '|' + desc + '|' + logo + '|' + display);
}
-function applicationListApplication(id){
- currentId=id;
+function applicationListApplication(id) {
+ currentId = id;
$('#applicationListApplicationKey').val(lmtext(id));
- var t=lmdata(id).split('|');
+ var t = lmdata(id).split('|');
$('#applicationListApplicationName').val(t[0]);
$('#applicationListApplicationURL').val(t[1]);
$('#applicationListApplicationDescription').val(t[2]);
changeAppsLogo(t[3]);
- formateSelect('applicationListApplicationDisplay',[
- 'auto=Automatic',
- 'on=On',
- 'off=Off'
- ],t[4]);
- display('applicationListApplication',lmtext(id));
+ formateSelect('applicationListApplicationDisplay', ['auto=Automatic', 'on=On', 'off=Off'], t[4]);
+ display('applicationListApplication', lmtext(id));
$('#delapplication').show();
}
@@ -1517,11 +1572,11 @@ function changeAppsLogo(logo) {
$('#applicationListApplicationLogo').val(logo);
// Set logo to custom if not a registered logo
// Custom field can be edited
- if ((logo!='attach.png') && (logo!='bell.png') && (logo!='bookmark.png') && (logo!='configure.png') && (logo!='database.png') && (logo!='demo.png') && (logo!='docs.png') && (logo!='folder.png') && (logo!='gear.png') && (logo!='help.png') && (logo!='mailappt.png') && (logo!='money.png') && (logo!='network.png') && (logo!='terminal.png') && (logo!='thumbnail.png') && (logo!='tools.png') && (logo!='tux.png') && (logo!='web.png') && (logo!='wheels.png')){
+ if ((logo != 'attach.png') && (logo != 'bell.png') && (logo != 'bookmark.png') && (logo != 'configure.png') && (logo != 'database.png') && (logo != 'demo.png') && (logo != 'docs.png') && (logo != 'folder.png') && (logo != 'gear.png') && (logo != 'help.png') && (logo != 'mailappt.png') && (logo != 'money.png') && (logo != 'network.png') && (logo != 'terminal.png') && (logo != 'thumbnail.png') && (logo != 'tools.png') && (logo != 'tux.png') && (logo != 'web.png') && (logo != 'wheels.png')) {
logo = 'custom.png';
$('#applicationListApplicationLogo').removeAttr('readonly');
} else {
- $('#applicationListApplicationLogo').attr('readonly','readonly');
+ $('#applicationListApplicationLogo').attr('readonly', 'readonly');
}
// Set image source
var imgsrc = imagepath + 'apps-logos/' + logo;
@@ -1530,124 +1585,128 @@ function changeAppsLogo(logo) {
}
/* Post */
-function postRoot(id){
- currentId=id;
- display('default','');
+function postRoot(id) {
+ currentId = id;
+ display('default', '');
$('#newpostr').show();
}
-function newPostR(){
- var newIdValue=newId(currentId);
+function newPostR() {
+ var newIdValue = newId(currentId);
var newPostKey = 'none';
- simpleTreeCollection[0].addNode(newIdValue,newPostKey,function(d,s){
- $('>span',s).attr('onClick','post("'+newIdValue+'")').attr('name',newPostKey).removeAttr('value').attr('id','text_'+newIdValue);
+ simpleTreeCollection[0].addNode(newIdValue, newPostKey, function(d, s) {
+ $('>span', s).attr('onClick', 'post("' + newIdValue + '")').attr('name', newPostKey).removeAttr('value').attr('id', 'text_' + newIdValue);
post(newIdValue);
});
return false;
}
-function newPostDataR(){
- var newIdValue=newId(currentId);
+function newPostDataR() {
+ var newIdValue = newId(currentId);
var newPostKey = 'login';
- simpleTreeCollection[0].addNode(newIdValue,newPostKey,function(d,s){
- $('>span',s).attr('onClick','postData("'+newIdValue+'")').attr('name','postdata:'+newPostKey).attr('value','$uid').attr('id','text_'+newIdValue);
+ simpleTreeCollection[0].addNode(newIdValue, newPostKey, function(d, s) {
+ $('>span', s).attr('onClick', 'postData("' + newIdValue + '")').attr('name', 'postdata:' + newPostKey).attr('value', '$uid').attr('id', 'text_' + newIdValue);
postData(newIdValue);
});
return false;
}
-function post(id){
- currentId=id;
+function post(id) {
+ currentId = id;
$('#postKey').val(lmtext(id));
$('#postUrl').val(lmdata(id));
- display('post',lmtext(lmparent(id)));
+ display('post', lmtext(lmparent(id)));
$('#delpost,#newpostdatar').show();
}
-function postData(id){
- currentId=id;
- var cleankey = lmtext(id).replace('postdata:','');
+function postData(id) {
+ currentId = id;
+ var cleankey = lmtext(id).replace('postdata:', '');
$('#postDataKey').val(cleankey);
$('#postDataValue').val(lmdata(id));
- display('postdata',cleankey);
+ display('postdata', cleankey);
$('#delpostdata').show();
}
-function delPost(){
+function delPost() {
delKey();
}
-function delPostData(){
+function delPostData() {
delKey();
}
/* Popup */
-function popup(html){
+function popup(html) {
$('#popup').html(html);
$('#popup').dialog({
show: 'fade',
hide: 'explode',
buttons: {
Ok: function() {
- $( this ).dialog( "close" );
+ $(this).dialog("close");
}
}
});
}
-function networkPb(){
+function networkPb() {
popup('Network problem
');
}
/* Help management */
-var lasthelp='';
-function loadHelp(ch){
+var lasthelp = '';
+function loadHelp(ch) {
var url;
// Keep actual page if no help chapter
- if(!ch){return;}
+ if (!ch) {
+ return;
+ }
// Display default help if help chapter not defined
- if(typeof(helpCh[ch])!='string'){ch='default';}
+ if (typeof(helpCh[ch]) != 'string') {
+ ch = 'default';
+ }
// Display new help only if not the last help
- if(ch!=lasthelp){
- url='/doc'+helpCh[ch];
- var html = '';
+ if (ch != lasthelp) {
+ url = '/doc' + helpCh[ch];
+ var html = '';
$('#help_content').html(html);
- lasthelp=ch;
+ lasthelp = ch;
}
}
/* Resize menu */
-function resizeMenu(){
+function resizeMenu() {
// Window height
var wh = $(window).height();
// Header height
var hh = $('#header').height();
// Set menu and data height (include css margins)
- $('#menu').css('height',wh-hh-50);
- $('#data').css('height',wh-hh-40);
+ $('#menu').css('height', wh - hh - 50);
+ $('#data').css('height', wh - hh - 40);
}
/* Boolean or Perl Expression */
-function boolOrPerlExpr(id){
- currentId=id;
+function boolOrPerlExpr(id) {
+ currentId = id;
$('#bopeValue').val('');
$('#bopeValue').hide();
- if(lmdata(id)==1){
- $('#bopeOn').prop('checked',true);
- }else{
- if(lmdata(id)==0){
- $('#bopeOff').prop('checked',true);
- }else{
- $('#bopeExpr').prop('checked',true);
+ if (lmdata(id) == 1) {
+ $('#bopeOn').prop('checked', true);
+ } else {
+ if (lmdata(id) == 0) {
+ $('#bopeOff').prop('checked', true);
+ } else {
+ $('#bopeExpr').prop('checked', true);
$('#bopeValue').val(lmdata(id));
$('#bopeValue').show();
}
}
- display('boolOrPerlExpr',lmtext(id));
+ display('boolOrPerlExpr', lmtext(id));
}
-function setlmbope(id){
- if($('input[type=radio][name=bope]:checked').attr("value")=='-1'){
- setlmdata(id,$('#bopeValue').val());
+function setlmbope(id) {
+ if ($('input[type=radio][name=bope]:checked').attr("value") == '-1') {
+ setlmdata(id, $('#bopeValue').val());
}
}
diff --git a/lemonldap-ng-manager/example/skins/default/js/notifications.js b/lemonldap-ng-manager/example/skins/default/js/notifications.js
index 4a263681d..0ec7c47fa 100644
--- a/lemonldap-ng-manager/example/skins/default/js/notifications.js
+++ b/lemonldap-ng-manager/example/skins/default/js/notifications.js
@@ -5,15 +5,17 @@
*/
function displayNotification(id) {
$.ajax({
- type:"POST",
- url:scriptname,
- data:{'notification':id},
- dataType:'html',
- success:function(data){
+ type: "POST",
+ url: scriptname,
+ data: {
+ 'notification': id
+ },
+ dataType: 'html',
+ success: function(data) {
$('#data').html(data);
},
- error:function(xhr, ajaxOptions, thrownError){
- $('#data').html('Request failed
Error code: '+xhr.status+', '+thrownError);
+ error: function(xhr, ajaxOptions, thrownError) {
+ $('#data').html('Request failed
Error code: ' + xhr.status + ', ' + thrownError);
}
});
}
@@ -25,15 +27,17 @@ function displayNotification(id) {
*/
function displayNotificationDone(id) {
$.ajax({
- type:"POST",
- url:scriptname,
- data:{'notificationDone':id},
- dataType:'html',
- success:function(data){
+ type: "POST",
+ url: scriptname,
+ data: {
+ 'notificationDone': id
+ },
+ dataType: 'html',
+ success: function(data) {
$('#data').html(data);
},
- error:function(xhr, ajaxOptions, thrownError){
- $('#data').html('Request failed
Error code: '+xhr.status+', '+thrownError);
+ error: function(xhr, ajaxOptions, thrownError) {
+ $('#data').html('Request failed
Error code: ' + xhr.status + ', ' + thrownError);
}
});
}
@@ -45,16 +49,18 @@ function displayNotificationDone(id) {
*/
function del(id) {
$.ajax({
- type:"POST",
- url:scriptname,
- data:{'delete':id},
- dataType:'html',
- success:function(data){
- $('#data').html(data);
- $('#uid'+id).remove();
+ type: "POST",
+ url: scriptname,
+ data: {
+ 'delete': id
},
- error:function(xhr, ajaxOptions, thrownError){
- $('#data').html('Request failed
Error code: '+xhr.status+', '+thrownError);
+ dataType: 'html',
+ success: function(data) {
+ $('#data').html(data);
+ $('#uid' + id).remove();
+ },
+ error: function(xhr, ajaxOptions, thrownError) {
+ $('#data').html('Request failed
Error code: ' + xhr.status + ', ' + thrownError);
}
});
}
@@ -66,15 +72,17 @@ function del(id) {
*/
function purge(id) {
$.ajax({
- type:"POST",
- url:scriptname,
- data:{'purge':id},
- dataType:'html',
- success:function(data){
+ type: "POST",
+ url: scriptname,
+ data: {
+ 'purge': id
+ },
+ dataType: 'html',
+ success: function(data) {
$('#data').html(data);
},
- error:function(xhr, ajaxOptions, thrownError){
- $('#data').html('Request failed
Error code: '+xhr.status+', '+thrownError);
+ error: function(xhr, ajaxOptions, thrownError) {
+ $('#data').html('Request failed
Error code: ' + xhr.status + ', ' + thrownError);
}
});
}
@@ -84,7 +92,9 @@ function purge(id) {
function newNotif() {
var data = $("#newNotif").html();
$('#data').html(data);
- $("#data input#date").datepicker({'dateFormat':'yy-mm-dd'});
+ $("#data input#date").datepicker({
+ 'dateFormat': 'yy-mm-dd'
+ });
return;
}
@@ -101,28 +111,48 @@ function sendNewNotif() {
var xml = $("textarea#xml").val();
// Reset CSS
- $("input#uid").css('border-width','0');
- $("input#date").css('border-width','0');
- $("input#ref").css('border-width','0');
- $("textarea#xml").css('border-width','0');
+ $("input#uid").css('border-width', '0');
+ $("input#date").css('border-width', '0');
+ $("input#ref").css('border-width', '0');
+ $("textarea#xml").css('border-width', '0');
// Check data
- if(!uid){$("input#uid").css('border-color','red').css('border-width','2px').focus();return false;}
- if(!date){$("input#date").css('border-color','red').css('border-width','2px').focus();return false;}
- if(!ref){$("input#ref").css('border-color','red').css('border-width','2px').focus();return false;}
- if(!xml){$("textarea#xml").css('border-color','red').css('border-width','2px').focus();return false;}
-
+ if (!uid) {
+ $("input#uid").css('border-color', 'red').css('border-width', '2px').focus();
+ return false;
+ }
+ if (!date) {
+ $("input#date").css('border-color', 'red').css('border-width', '2px').focus();
+ return false;
+ }
+ if (!ref) {
+ $("input#ref").css('border-color', 'red').css('border-width', '2px').focus();
+ return false;
+ }
+ if (!xml) {
+ $("textarea#xml").css('border-color', 'red').css('border-width', '2px').focus();
+ return false;
+ }
+
// Send AJAX request
$.ajax({
- type:"POST",
- url:scriptname,
- data:{'newNotif':{'uid':uid,'date':date,'ref':ref,'condition':condition,'xml':xml}},
- dataType:'html',
- success:function(data){
+ type: "POST",
+ url: scriptname,
+ data: {
+ 'newNotif': {
+ 'uid': uid,
+ 'date': date,
+ 'ref': ref,
+ 'condition': condition,
+ 'xml': xml
+ }
+ },
+ dataType: 'html',
+ success: function(data) {
$('#data').html(data);
},
- error:function(xhr, ajaxOptions, thrownError){
- $('#data').html('Request failed
Error code: '+xhr.status+', '+thrownError);
+ error: function(xhr, ajaxOptions, thrownError) {
+ $('#data').html('Request failed
Error code: ' + xhr.status + ', ' + thrownError);
}
});
}
diff --git a/lemonldap-ng-manager/example/skins/default/js/sessions.js b/lemonldap-ng-manager/example/skins/default/js/sessions.js
index 7cc212491..8f2745d5c 100644
--- a/lemonldap-ng-manager/example/skins/default/js/sessions.js
+++ b/lemonldap-ng-manager/example/skins/default/js/sessions.js
@@ -1,31 +1,35 @@
function displaySession(id) {
$.ajax({
- type:"POST",
- url:scriptname,
- data:{'session':id},
- dataType:'html',
- success:function(data){
+ type: "POST",
+ url: scriptname,
+ data: {
+ 'session': id
+ },
+ dataType: 'html',
+ success: function(data) {
$('#data').html(data);
},
- error:function(xhr, ajaxOptions, thrownError){
- $('#data').html('Request failed
Error code: '+xhr.status+', '+thrownError);
+ error: function(xhr, ajaxOptions, thrownError) {
+ $('#data').html('Request failed
Error code: ' + xhr.status + ', ' + thrownError);
}
});
}
function del(id) {
$.ajax({
- type:"POST",
- url:scriptname,
- data:{'delete':id},
- dataType:'html',
- success:function(data){
+ type: "POST",
+ url: scriptname,
+ data: {
+ 'delete': id
+ },
+ dataType: 'html',
+ success: function(data) {
$('#data').html(data);
// Delete session from tree
- $('#uid'+id).remove();
- $('#ip'+id).remove();
+ $('#uid' + id).remove();
+ $('#ip' + id).remove();
},
- error:function(xhr, ajaxOptions, thrownError){
- $('#data').html('Request failed
Error code: '+xhr.status+', '+thrownError);
+ error: function(xhr, ajaxOptions, thrownError) {
+ $('#data').html('Request failed
Error code: ' + xhr.status + ', ' + thrownError);
}
});
}
diff --git a/lemonldap-ng-manager/example/skins/default/js/tree.js b/lemonldap-ng-manager/example/skins/default/js/tree.js
index 9b6370d35..b14ef8a2c 100644
--- a/lemonldap-ng-manager/example/skins/default/js/tree.js
+++ b/lemonldap-ng-manager/example/skins/default/js/tree.js
@@ -41,11 +41,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
-$.fn.simpleTree = function(opt){
- return this.each(function(){
+$.fn.simpleTree = function(opt) {
+ return this.each(function() {
var TREE = this;
- var ROOT = $('.root',this);
+ var ROOT = $('.root', this);
var mousePressed = false;
var mouseMoved = false;
var dragMoveType = false;
@@ -55,475 +54,490 @@ $.fn.simpleTree = function(opt){
var ajaxCache = Array();
TREE.option = {
- drag: true,
- animate: false,
- autoclose: false,
- speed: 'fast',
- afterAjax: false,
- afterMove: false,
- afterClick: false,
- afterDblClick: false,
+ drag: true,
+ animate: false,
+ autoclose: false,
+ speed: 'fast',
+ afterAjax: false,
+ afterMove: false,
+ afterClick: false,
+ afterDblClick: false,
// added by Erik Dohmen (2BinBusiness.nl) to make context menu cliks available
- afterContextMenu: false,
- docToFolderConvert: false,
- useClickToToggle: false,
- afterCloseNearby: false,
- afterNewNode: false,
- afterSetTrigger: false
+ afterContextMenu: false,
+ docToFolderConvert: false,
+ useClickToToggle: false,
+ afterCloseNearby: false,
+ afterNewNode: false,
+ afterSetTrigger: false
};
- TREE.option = $.extend(TREE.option,opt);
- $.extend(this, {getSelected: function(){
- return $('span.active', this).parent();
- }});
- TREE.closeNearby = function(obj)
- {
- $(obj).siblings().filter('.folder-open, .folder-open-last').each(function(){
- var childUl = $('>ul',this);
+ TREE.option = $.extend(TREE.option, opt);
+ $.extend(this, {
+ getSelected: function() {
+ return $('span.active', this).parent();
+ }
+ });
+ TREE.closeNearby = function(obj) {
+ $(obj).siblings().filter('.folder-open, .folder-open-last').each(function() {
+ var childUl = $('>ul', this);
var className = this.className;
- this.className = className.replace('open','close');
- if(TREE.option.animate)
- {
- childUl.animate({height:"toggle"},TREE.option.speed);
- }else{
+ this.className = className.replace('open', 'close');
+ if (TREE.option.animate) {
+ childUl.animate({
+ height: "toggle"
+ },
+ TREE.option.speed);
+ } else {
childUl.hide();
}
- if(typeof TREE.option.afterCloseNearby == 'function')
- {
- TREE.option.afterCloseNearby($(this).parent());
+ if (typeof TREE.option.afterCloseNearby == 'function') {
+ TREE.option.afterCloseNearby($(this).parent());
}
- });
+ });
};
- TREE.nodeToggle = function(obj)
- {
- var childUl = $('>ul',obj);
- if(obj.className.match('open')){
- obj.className = obj.className.replace('open','close');
- if(TREE.option.animate)
- {
- childUl.animate({height:"toggle"},TREE.option.speed);
- }else{
+ TREE.nodeToggle = function(obj) {
+ var childUl = $('>ul', obj);
+ if (obj.className.match('open')) {
+ obj.className = obj.className.replace('open', 'close');
+ if (TREE.option.animate) {
+ childUl.animate({
+ height: "toggle"
+ },
+ TREE.option.speed);
+ } else {
childUl.hide();
}
- }else{
- obj.className = obj.className.replace('close','open');
- if(TREE.option.animate)
- {
- childUl.animate({height:"toggle"},TREE.option.speed, function(){
- if(TREE.option.autoclose)TREE.closeNearby(obj);
- if(childUl.is('.ajax'))TREE.setAjaxNodes(childUl, obj.id);
+ } else {
+ obj.className = obj.className.replace('close', 'open');
+ if (TREE.option.animate) {
+ childUl.animate({
+ height: "toggle"
+ },
+ TREE.option.speed, function() {
+ if (TREE.option.autoclose) TREE.closeNearby(obj);
+ if (childUl.is('.ajax')) TREE.setAjaxNodes(childUl, obj.id);
});
- }else{
+ } else {
childUl.show();
- if(TREE.option.autoclose)TREE.closeNearby(obj);
- if(childUl.is('.ajax'))TREE.setAjaxNodes(childUl, obj.id);
+ if (TREE.option.autoclose) TREE.closeNearby(obj);
+ if (childUl.is('.ajax')) TREE.setAjaxNodes(childUl, obj.id);
}
}
};
- TREE.setAjaxNodes = function(node, parentId, callback)
- {
- if($.inArray(parentId,ajaxCache) == -1){
- ajaxCache[ajaxCache.length]=parentId;
+ TREE.setAjaxNodes = function(node, parentId, callback) {
+ if ($.inArray(parentId, ajaxCache) == -1) {
+ ajaxCache[ajaxCache.length] = parentId;
var url = $.trim($('>li', node).text());
- if(url && url.indexOf('url:'))
- {
- url=$.trim(url.replace(/.*\{url:(.*)\}/i ,'$1'));
- var js='';
- var call='';
- if(url.indexOf(',js:')){
- call=url.match(/.*,call:(.*)/i);
- if(call==null){call='';}else{call=call[1].replace(/,call.*$/,'');}
- js=url.match(/.*,js:(.*)/i);
- if(js==null){js='';}else{js=js[1].replace(/,call.*$/,'');}
- url=$.trim(url.replace(/,(?:js|call):.*/i ,''));
+ if (url && url.indexOf('url:')) {
+ url = $.trim(url.replace(/.*\{url:(.*)\}/i, '$1'));
+ var js = '';
+ var call = '';
+ if (url.indexOf(',js:')) {
+ call = url.match(/.*,call:(.*)/i);
+ if (call == null) {
+ call = '';
+ } else {
+ call = call[1].replace(/,call.*$/, '');
+ }
+ js = url.match(/.*,js:(.*)/i);
+ if (js == null) {
+ js = '';
+ } else {
+ js = js[1].replace(/,call.*$/, '');
+ }
+ url = $.trim(url.replace(/,(?:js|call):.*/i, ''));
}
$.ajax({
type: "GET",
url: url,
- contentType:'html',
- cache:false,
- success: function(response){
+ contentType: 'html',
+ cache: false,
+ success: function(response) {
node.removeAttr('class');
- if(response.length>0){
+ if (response.length > 0) {
node.html(response);
- $.extend(node,{url:url});
- TREE.setTreeNodes(node, true);
+ $.extend(node, {
+ url: url
+ });
+ TREE.setTreeNodes(node, true);
} else {
- $("li.line",node).remove();
- $("li.doc-last",node).remove();
+ $("li.line", node).remove();
+ $("li.doc-last", node).remove();
}
- if(typeof TREE.option.afterAjax == 'function')
- {
+ if (typeof TREE.option.afterAjax == 'function') {
TREE.option.afterAjax(node);
}
- if(typeof callback == 'function')
- {
+ if (typeof callback == 'function') {
callback(node);
}
- if(js.length){if(!js.match(/\(/))js+='()';$('>span',node.parent()).click(function(){eval(js)});}
- if(call.length){if(!call.match(/\(/))call+='()';eval(call);}
+ if (js.length) {
+ if (!js.match(/\(/)) js += '()';
+ $('>span', node.parent()).click(function() {
+ eval(js)
+ });
+ }
+ if (call.length) {
+ if (!call.match(/\(/)) call += '()';
+ eval(call);
+ }
},
- error: function(xhr, ajaxOptions, thrownError){
+ error: function(xhr, ajaxOptions, thrownError) {
TREE.closeNearby(node);
- alert('Failed to get remote datas. Error code: '+xhr.status+', '+thrownError);
+ alert('Failed to get remote datas. Error code: ' + xhr.status + ', ' + thrownError);
}
});
}
-
+
}
};
- TREE.setTreeNodes = function(obj, useParent){
- obj = useParent? obj.parent():obj;
- $('li>span', obj).addClass('text')
- .bind('selectstart', function() {
+ TREE.setTreeNodes = function(obj, useParent) {
+ obj = useParent ? obj.parent() : obj;
+ $('li>span', obj).addClass('text').bind('selectstart', function() {
return false;
- }).click(function(){
+ }).click(function() {
// Remove all active classes and add the text class
- $('.active',TREE).toggleClass('active').addClass('text');
- if(this.className.match('text'))
- {
- this.className=this.className.replace('text','active');
+ $('.active', TREE).toggleClass('active').addClass('text');
+ if (this.className.match('text')) {
+ this.className = this.className.replace('text', 'active');
}
- if(TREE.option.useClickToToggle)
- {
+ if (TREE.option.useClickToToggle) {
TREE.nodeToggle($(this).parent().get(0));
}
- if(typeof TREE.option.afterClick == 'function')
- {
+ if (typeof TREE.option.afterClick == 'function') {
TREE.option.afterClick($(this).parent());
}
return false;
- }).dblclick(function(){
+ }).dblclick(function() {
mousePressed = false;
- if(!TREE.option.useClickToToggle)
- {
+ if (!TREE.option.useClickToToggle) {
TREE.nodeToggle($(this).parent().get(0));
}
- if(typeof TREE.option.afterDblClick == 'function')
- {
+ if (typeof TREE.option.afterDblClick == 'function') {
TREE.option.afterDblClick($(this).parent());
}
return false;
// added by Erik Dohmen (2BinBusiness.nl) to make context menu actions
// available
- }).bind("contextmenu",function(){
- $('.active',TREE).toggleClass('active').addClass('text');
- if(this.className.match('text'))
- {
- this.className=this.className.replace('text','active');
+ }).bind("contextmenu", function() {
+ $('.active', TREE).toggleClass('active').addClass('text');
+ if (this.className.match('text')) {
+ this.className = this.className.replace('text', 'active');
}
- if(typeof TREE.option.afterContextMenu == 'function')
- {
+ if (typeof TREE.option.afterContextMenu == 'function') {
TREE.option.afterContextMenu($(this).parent());
}
return false;
- }).mousedown(function(event){
+ }).mousedown(function(event) {
mousePressed = true;
cloneNode = $(this).parent().clone();
var LI = $(this).parent();
- if(TREE.option.drag)
- {
+ if (TREE.option.drag) {
$('>ul', cloneNode).hide();
$('body').append('');
- $('#drag_container').hide().css({opacity:'0.8'});
+ $('#drag_container').hide().css({
+ opacity: '0.8'
+ });
$('#drag_container >ul').append(cloneNode);
- $("
").attr({id : "tree_plus",src : imagepath+"tree/plus.gif"}).css({width: "7px",display: "block",position: "absolute",left : "5px",top: "5px", display:'none'}).appendTo("body");
- $(document).bind("mousemove", {LI:LI}, TREE.dragStart).bind("mouseup",TREE.dragEnd);
+ $("
").attr({
+ id: "tree_plus",
+ src: imagepath + "tree/plus.gif"
+ }).css({
+ width: "7px",
+ display: "block",
+ position: "absolute",
+ left: "5px",
+ top: "5px",
+ display: 'none'
+ }).appendTo("body");
+ $(document).bind("mousemove", {
+ LI: LI
+ },
+ TREE.dragStart).bind("mouseup", TREE.dragEnd);
}
return false;
- }).mouseup(function(){
- if(mousePressed && mouseMoved && dragNode_source)
- {
+ }).mouseup(function() {
+ if (mousePressed && mouseMoved && dragNode_source) {
TREE.moveNodeToFolder($(this).parent());
}
TREE.eventDestroy();
});
- $('li', obj).each(function(i){
+ $('li', obj).each(function(i) {
var className = this.className;
var open = false;
- var cloneNode=false;
+ var cloneNode = false;
var LI = this;
- var childNode = $('>ul',this);
- if(childNode.size()>0){
+ var childNode = $('>ul', this);
+ if (childNode.size() > 0) {
var setClassName = 'folder-';
- if(className && className.indexOf('hidden')>=0){
- setClassName=setClassName+'hidden';
- }else if(className && className.indexOf('open')>=0){
- setClassName=setClassName+'open';
- open=true;
- }else{
- setClassName=setClassName+'close';
+ if (className && className.indexOf('hidden') >= 0) {
+ setClassName = setClassName + 'hidden';
+ } else if (className && className.indexOf('open') >= 0) {
+ setClassName = setClassName + 'open';
+ open = true;
+ } else {
+ setClassName = setClassName + 'close';
}
- this.className = setClassName + ($(this).is(':last-child')? '-last':'');
+ this.className = setClassName + ($(this).is(':last-child') ? '-last' : '');
- if(!open || className.indexOf('ajax')>=0)childNode.hide();
+ if (!open || className.indexOf('ajax') >= 0) childNode.hide();
TREE.setTrigger(this);
- }else{
+ } else {
var setClassName = 'doc';
- this.className = setClassName + ($(this).is(':last-child')? '-last':'');
+ this.className = setClassName + ($(this).is(':last-child') ? '-last' : '');
}
- }).before(' ')
- .filter(':last-child').after('');
+ }).before(' ').filter(':last-child').after('');
TREE.setEventLine($('.line, .line-last', obj));
};
- TREE.setTrigger = function(node){
- $('>span',node).before('
');
+ TREE.setTrigger = function(node) {
+ $('>span', node).before('
');
var trigger = $('>.trigger', node);
- trigger.click(function(event){
+ trigger.click(function(event) {
TREE.nodeToggle(node);
});
- trigger.css('float','left');
- if(typeof TREE.option.afterSetTrigger == 'function')
- {
+ trigger.css('float', 'left');
+ if (typeof TREE.option.afterSetTrigger == 'function') {
TREE.option.afterSetTrigger(node);
}
};
- TREE.dragStart = function(event){
+ TREE.dragStart = function(event) {
var LI = $(event.data.LI);
- if(mousePressed)
- {
+ if (mousePressed) {
mouseMoved = true;
- if(dragDropTimer) clearTimeout(dragDropTimer);
- if($('#drag_container:not(:visible)')){
+ if (dragDropTimer) clearTimeout(dragDropTimer);
+ if ($('#drag_container:not(:visible)')) {
$('#drag_container').show();
LI.prev('.line').hide();
dragNode_source = LI;
}
- $('#drag_container').css({position:'absolute', "left" : (event.pageX + 5), "top": (event.pageY + 15) });
- if(LI.is(':visible'))LI.hide();
+ $('#drag_container').css({
+ position: 'absolute',
+ "left": (event.pageX + 5),
+ "top": (event.pageY + 15)
+ });
+ if (LI.is(':visible')) LI.hide();
var temp_move = false;
- if(event.target.tagName.toLowerCase()=='span' && $.inArray(event.target.className, Array('text','active','trigger'))!= -1)
- {
+ if (event.target.tagName.toLowerCase() == 'span' && $.inArray(event.target.className, Array('text', 'active', 'trigger')) != -1) {
var parent = event.target.parentNode;
- var offs = $(parent).offset({scroll:false});
- var screenScroll = {x : (offs.left - 3),y : event.pageY - offs.top};
+ var offs = $(parent).offset({
+ scroll: false
+ });
+ var screenScroll = {
+ x: (offs.left - 3),
+ y: event.pageY - offs.top
+ };
var isrc = $("#tree_plus").attr('src');
- var ajaxChildSize = $('>ul.ajax',parent).size();
- var ajaxChild = $('>ul.ajax',parent);
+ var ajaxChildSize = $('>ul.ajax', parent).size();
+ var ajaxChild = $('>ul.ajax', parent);
screenScroll.x += 19;
screenScroll.y = event.pageY - screenScroll.y + 5;
- if(parent.className.indexOf('folder-close')>=0 && ajaxChildSize==0)
- {
- if(isrc.indexOf('minus')!=-1)$("#tree_plus").attr('src',imagepath+'tree/plus.gif');
- $("#tree_plus").css({"left": screenScroll.x, "top": screenScroll.y}).show();
- dragDropTimer = setTimeout(function(){
- parent.className = parent.className.replace('close','open');
- $('>ul',parent).show();
- }, 700);
- }else if(parent.className.indexOf('folder')>=0 && ajaxChildSize==0){
- if(isrc.indexOf('minus')!=-1)$("#tree_plus").attr('src',imagepath+'tree/plus.gif');
- $("#tree_plus").css({"left": screenScroll.x, "top": screenScroll.y}).show();
- }else if(parent.className.indexOf('folder-close')>=0 && ajaxChildSize>0)
- {
+ if (parent.className.indexOf('folder-close') >= 0 && ajaxChildSize == 0) {
+ if (isrc.indexOf('minus') != -1) $("#tree_plus").attr('src', imagepath + 'tree/plus.gif');
+ $("#tree_plus").css({
+ "left": screenScroll.x,
+ "top": screenScroll.y
+ }).show();
+ dragDropTimer = setTimeout(function() {
+ parent.className = parent.className.replace('close', 'open');
+ $('>ul', parent).show();
+ },
+ 700);
+ } else if (parent.className.indexOf('folder') >= 0 && ajaxChildSize == 0) {
+ if (isrc.indexOf('minus') != -1) $("#tree_plus").attr('src', imagepath + 'tree/plus.gif');
+ $("#tree_plus").css({
+ "left": screenScroll.x,
+ "top": screenScroll.y
+ }).show();
+ } else if (parent.className.indexOf('folder-close') >= 0 && ajaxChildSize > 0) {
mouseMoved = false;
- $("#tree_plus").attr('src',imagepath+'tree/minus.gif');
- $("#tree_plus").css({"left": screenScroll.x, "top": screenScroll.y}).show();
+ $("#tree_plus").attr('src', imagepath + 'tree/minus.gif');
+ $("#tree_plus").css({
+ "left": screenScroll.x,
+ "top": screenScroll.y
+ }).show();
- $('>ul',parent).show();
+ $('>ul', parent).show();
/*
Thanks for the idea of Erik Dohmen
*/
- TREE.setAjaxNodes(ajaxChild,parent.id, function(){
- parent.className = parent.className.replace('close','open');
+ TREE.setAjaxNodes(ajaxChild, parent.id, function() {
+ parent.className = parent.className.replace('close', 'open');
mouseMoved = true;
- $("#tree_plus").attr('src',imagepath+'tree/plus.gif');
- $("#tree_plus").css({"left": screenScroll.x, "top": screenScroll.y}).show();
+ $("#tree_plus").attr('src', imagepath + 'tree/plus.gif');
+ $("#tree_plus").css({
+ "left": screenScroll.x,
+ "top": screenScroll.y
+ }).show();
});
- }else{
- if(TREE.option.docToFolderConvert)
- {
- $("#tree_plus").css({"left": screenScroll.x, "top": screenScroll.y}).show();
- }else{
+ } else {
+ if (TREE.option.docToFolderConvert) {
+ $("#tree_plus").css({
+ "left": screenScroll.x,
+ "top": screenScroll.y
+ }).show();
+ } else {
$("#tree_plus").hide();
}
}
- }else{
+ } else {
$("#tree_plus").hide();
}
return false;
}
return true;
};
- TREE.dragEnd = function(){
- if(dragDropTimer) clearTimeout(dragDropTimer);
+ TREE.dragEnd = function() {
+ if (dragDropTimer) clearTimeout(dragDropTimer);
TREE.eventDestroy();
};
- TREE.setEventLine = function(obj){
- obj.mouseover(function(){
- if(this.className.indexOf('over')<0 && mousePressed && mouseMoved)
- {
- this.className = this.className.replace('line','line-over');
+ TREE.setEventLine = function(obj) {
+ obj.mouseover(function() {
+ if (this.className.indexOf('over') < 0 && mousePressed && mouseMoved) {
+ this.className = this.className.replace('line', 'line-over');
}
- }).mouseout(function(){
- if(this.className.indexOf('over')>=0)
- {
- this.className = this.className.replace('-over','');
+ }).mouseout(function() {
+ if (this.className.indexOf('over') >= 0) {
+ this.className = this.className.replace('-over', '');
}
- }).mouseup(function(){
- if(mousePressed && dragNode_source && mouseMoved)
- {
+ }).mouseup(function() {
+ if (mousePressed && dragNode_source && mouseMoved) {
dragNode_destination = $(this).parents('li:first');
TREE.moveNodeToLine(this);
TREE.eventDestroy();
}
});
};
- TREE.checkNodeIsLast = function(node)
- {
- if(node.className.indexOf('last')>=0)
- {
+ TREE.checkNodeIsLast = function(node) {
+ if (node.className.indexOf('last') >= 0) {
var prev_source = dragNode_source.prev().prev();
- if(prev_source.size()>0)
- {
- prev_source[0].className+='-last';
+ if (prev_source.size() > 0) {
+ prev_source[0].className += '-last';
}
- node.className = node.className.replace('-last','');
+ node.className = node.className.replace('-last', '');
}
};
- TREE.checkLineIsLast = function(line)
- {
- if(line.className.indexOf('last')>=0)
- {
+ TREE.checkLineIsLast = function(line) {
+ if (line.className.indexOf('last') >= 0) {
var prev = $(line).prev();
- if(prev.size()>0)
- {
- prev[0].className = prev[0].className.replace('-last','');
+ if (prev.size() > 0) {
+ prev[0].className = prev[0].className.replace('-last', '');
}
- dragNode_source[0].className+='-last';
+ dragNode_source[0].className += '-last';
}
};
- TREE.eventDestroy = function()
- {
+ TREE.eventDestroy = function() {
// added by Erik Dohmen (2BinBusiness.nl), the unbind mousemove TREE.dragStart action
// like this other mousemove actions binded through other actions ain't removed (use it myself
// to determine location for context menu)
- $(document).unbind('mousemove',TREE.dragStart).unbind('mouseup').unbind('mousedown');
+ $(document).unbind('mousemove', TREE.dragStart).unbind('mouseup').unbind('mousedown');
$('#drag_container, #tree_plus').remove();
- if(dragNode_source)
- {
+ if (dragNode_source) {
$(dragNode_source).show().prev('.line').show();
}
dragNode_destination = dragNode_source = mousePressed = mouseMoved = false;
//ajaxCache = Array();
};
- TREE.convertToFolder = function(node){
- node[0].className = node[0].className.replace('doc','folder-open');
+ TREE.convertToFolder = function(node) {
+ node[0].className = node[0].className.replace('doc', 'folder-open');
node.append('');
TREE.setTrigger(node[0]);
TREE.setEventLine($('.line, .line-last', node));
};
- TREE.convertToDoc = function(node){
+ TREE.convertToDoc = function(node) {
$('>ul', node).remove();
$('img', node).remove();
- node[0].className = node[0].className.replace(/folder-(open|close)/gi , 'doc');
+ node[0].className = node[0].className.replace(/folder-(open|close)/gi, 'doc');
};
- TREE.moveNodeToFolder = function(node)
- {
+ TREE.moveNodeToFolder = function(node) {
// Open node if it's closed
- if(node[0].className.match('close')){TREE.nodeToggle(node[0]);}
- if(!TREE.option.docToFolderConvert && node[0].className.indexOf('doc')!=-1)
- {
+ if (node[0].className.match('close')) {
+ TREE.nodeToggle(node[0]);
+ }
+ if (!TREE.option.docToFolderConvert && node[0].className.indexOf('doc') != -1) {
return true;
- }else if(TREE.option.docToFolderConvert && node[0].className.indexOf('doc')!=-1){
+ } else if (TREE.option.docToFolderConvert && node[0].className.indexOf('doc') != -1) {
TREE.convertToFolder(node);
}
TREE.checkNodeIsLast(dragNode_source[0]);
var lastLine = $('>ul >.line-last', node);
- if(lastLine.size()>0)
- {
+ if (lastLine.size() > 0) {
TREE.moveNodeToLine(lastLine[0]);
}
};
- TREE.moveNodeToLine = function(node){
+ TREE.moveNodeToLine = function(node) {
TREE.checkNodeIsLast(dragNode_source[0]);
TREE.checkLineIsLast(node);
var parent = $(dragNode_source).parents('li:first');
var line = $(dragNode_source).prev('.line');
$(node).before(dragNode_source);
$(dragNode_source).before(line);
- node.className = node.className.replace('-over','');
+ node.className = node.className.replace('-over', '');
var nodeSize = $('>ul >li', parent).not('.line, .line-last').filter(':visible').size();
- if(TREE.option.docToFolderConvert && nodeSize==0)
- {
+ if (TREE.option.docToFolderConvert && nodeSize == 0) {
TREE.convertToDoc(parent);
- }else if(nodeSize==0)
- {
- parent[0].className=parent[0].className.replace('open','close');
- $('>ul',parent).hide();
+ } else if (nodeSize == 0) {
+ parent[0].className = parent[0].className.replace('open', 'close');
+ $('>ul', parent).hide();
}
// added by Erik Dohmen (2BinBusiness.nl) select node
- if($('span:first',dragNode_source).attr('class')=='text')
- {
- $('.active',TREE).toggleClass('active').addClass('text');
- $('span:first',dragNode_source).toggleClass('text').addClass('active');
+ if ($('span:first', dragNode_source).attr('class') == 'text') {
+ $('.active', TREE).toggleClass('active').addClass('text');
+ $('span:first', dragNode_source).toggleClass('text').addClass('active');
}
- if(typeof(TREE.option.afterMove) == 'function')
- {
+ if (typeof(TREE.option.afterMove) == 'function') {
var pos = $(dragNode_source).prevAll(':not(.line)').size();
TREE.option.afterMove($(node).parents('li:first'), $(dragNode_source), pos);
}
};
- TREE.addNode = function(id, text, callback)
- {
- TREE.newNodeIn(TREE.getSelected(),id,text,callback);
+ TREE.addNode = function(id, text, callback) {
+ TREE.newNodeIn(TREE.getSelected(), id, text, callback);
};
- TREE.newNodeIn = function(node, id, text, callback)
- {
- var temp_node = $('');
- TREE.setTreeNodes(temp_node,false);
+ TREE.newNodeIn = function(node, id, text, callback) {
+ var temp_node = $('');
+ TREE.setTreeNodes(temp_node, false);
destination = node;
- dragNode_source = $('.doc-last',temp_node);
+ dragNode_source = $('.doc-last', temp_node);
TREE.moveNodeToFolder(destination);
temp_node.remove();
- if(typeof TREE.option.afterNewNode == 'function')
- {
+ if (typeof TREE.option.afterNewNode == 'function') {
TREE.option.afterNewNode(node);
}
- if(typeof(callback) == 'function')
- {
+ if (typeof(callback) == 'function') {
callback(dragNode_destination, dragNode_source);
}
};
- TREE.newNodeAfter = function(id, text, callback)
- {
- TREE.newNodeIn(TREE.getSelected().parent().parent(),id,text,callback);
+ TREE.newNodeAfter = function(id, text, callback) {
+ TREE.newNodeIn(TREE.getSelected().parent().parent(), id, text, callback);
};
- TREE.newAjaxNodeIn = function(node,id,text,url,callback)
- {
- var temp_node = $('');
- TREE.setTreeNodes(temp_node,false);
+ TREE.newAjaxNodeIn = function(node, id, text, url, callback) {
+ var temp_node = $('');
+ TREE.setTreeNodes(temp_node, false);
destination = node;
- dragNode_source = $('.folder-close-last',temp_node);
+ dragNode_source = $('.folder-close-last', temp_node);
TREE.moveNodeToFolder(destination);
temp_node.remove();
- if(typeof TREE.option.afterNewNode == 'function')
- {
+ if (typeof TREE.option.afterNewNode == 'function') {
TREE.option.afterNewNode(node);
}
- if(typeof(callback) == 'function')
- {
+ if (typeof(callback) == 'function') {
callback(dragNode_destination, dragNode_source);
}
};
- TREE.delNode = function(callback)
- {
+ TREE.delNode = function(callback) {
dragNode_source = TREE.getSelected();
TREE.checkNodeIsLast(dragNode_source[0]);
dragNode_source.prev().remove();
dragNode_source.remove();
- if(typeof(callback) == 'function')
- {
+ if (typeof(callback) == 'function') {
callback(dragNode_destination);
}
};
- TREE.init = function(obj)
- {
+ TREE.init = function(obj) {
TREE.setTreeNodes(obj, false);
};
TREE.init(ROOT);
diff --git a/lemonldap-ng-portal/example/skins/bootstrap/js/skin.js b/lemonldap-ng-portal/example/skins/bootstrap/js/skin.js
index 5d5c6f72b..1e0500d82 100644
--- a/lemonldap-ng-portal/example/skins/bootstrap/js/skin.js
+++ b/lemonldap-ng-portal/example/skins/bootstrap/js/skin.js
@@ -1,5 +1,4 @@
-
-$(document).ready(function(){
+$(document).ready(function() {
// Adapt some class to fit Bootstrap theme
$("div.message-positive").addClass("alert-success");
@@ -9,4 +8,3 @@ $(document).ready(function(){
$("table.info").addClass("table");
});
-
diff --git a/lemonldap-ng-portal/example/skins/common/browserid.js b/lemonldap-ng-portal/example/skins/common/browserid.js
index e288ff228..7df2d82b3 100644
--- a/lemonldap-ng-portal/example/skins/common/browserid.js
+++ b/lemonldap-ng-portal/example/skins/common/browserid.js
@@ -1,12 +1,12 @@
/* Watch login and logout events */
navigator.id.watch({
- loggedInUser: null,
- onlogin: function(assertion) {
- // POST assertion
- $('form.BrowserID').append('').submit();
- },
- onlogout: function() {
- // Do nothing
- }
+ loggedInUser: null,
+ onlogin: function(assertion) {
+ // POST assertion
+ $('form.BrowserID').append('').submit();
+ },
+ onlogout: function() {
+ // Do nothing
+ }
});
diff --git a/lemonldap-ng-portal/example/skins/common/browseridlogin.js b/lemonldap-ng-portal/example/skins/common/browseridlogin.js
index ec8087d74..e56545a19 100644
--- a/lemonldap-ng-portal/example/skins/common/browseridlogin.js
+++ b/lemonldap-ng-portal/example/skins/common/browseridlogin.js
@@ -1,4 +1,4 @@
-$(document).ready(function(){
+$(document).ready(function() {
// Manage auto login
if (browserIdAutoLogin.match('1')) {
@@ -7,7 +7,7 @@ $(document).ready(function(){
// Intercept submit the first time
var intercepted = 0;
- $("form.BrowserID").submit(function( event ) {
+ $("form.BrowserID").submit(function(event) {
if (!intercepted) {
event.preventDefault();
intercepted = 1;
diff --git a/lemonldap-ng-portal/example/skins/common/browseridlogout.js b/lemonldap-ng-portal/example/skins/common/browseridlogout.js
index 9ecf1f672..e0b827206 100644
--- a/lemonldap-ng-portal/example/skins/common/browseridlogout.js
+++ b/lemonldap-ng-portal/example/skins/common/browseridlogout.js
@@ -1,3 +1,3 @@
-$(document).ready(function(){
+$(document).ready(function() {
navigator.id.logout();
});
diff --git a/lemonldap-ng-portal/example/skins/common/portal.js b/lemonldap-ng-portal/example/skins/common/portal.js
index 485c55018..ecc305e5e 100644
--- a/lemonldap-ng-portal/example/skins/common/portal.js
+++ b/lemonldap-ng-portal/example/skins/common/portal.js
@@ -12,20 +12,32 @@
*/
/* Set autocomplete real value */
-if(autocomplete.match('1')){autocomplete='on';}
-if(autocomplete.match('0')){autocomplete='off';}
+if (autocomplete.match('1')) {
+ autocomplete = 'on';
+}
+if (autocomplete.match('0')) {
+ autocomplete = 'off';
+}
/* Set newwindow value (default is false) */
-if(newwindow.match('1')){newwindow=true;}else{newwindow=false;}
+if (newwindow.match('1')) {
+ newwindow = true;
+} else {
+ newwindow = false;
+}
/* Set antiframe value (default is true) */
-if(antiframe.match('0')){antiframe=false;}else{antiframe=true;}
+if (antiframe.match('0')) {
+ antiframe = false;
+} else {
+ antiframe = true;
+}
/* jQuery */
-$(document).ready(function(){
+$(document).ready(function() {
/* AntiFrame script */
- if(antiframe && top!=self){
+ if (antiframe && top != self) {
top.location.href = location.href;
}
@@ -36,7 +48,9 @@ $(document).ready(function(){
opacity: 0.5,
revert: true,
items: "> div.category",
- update: function(){ getOrder(); }
+ update: function() {
+ getOrder();
+ }
});
restoreOrder();
@@ -45,32 +59,42 @@ $(document).ready(function(){
$("div.message").fadeIn('slow');
/* Set timezone */
- $("input[name=timezone]").val( -(new Date().getTimezoneOffset()/60) );
+ $("input[name=timezone]").val(-(new Date().getTimezoneOffset() / 60));
/* Menu tabs */
- var menuTabs = $("#menu").tabs({active:0});
- var menuIndex = $('#menu a[href="#'+displaytab+'"]').parent().index();
- if (menuIndex<0){menuIndex=0;}
- menuTabs.tabs("option","active",menuIndex);
+ var menuTabs = $("#menu").tabs({
+ active: 0
+ });
+ var menuIndex = $('#menu a[href="#' + displaytab + '"]').parent().index();
+ if (menuIndex < 0) {
+ menuIndex = 0;
+ }
+ menuTabs.tabs("option", "active", menuIndex);
/* Authentication choice tabs */
- var authMenuTabs = $("#authMenu").tabs({active:0});
+ var authMenuTabs = $("#authMenu").tabs({
+ active: 0
+ });
// TODO: cookie
//$("#authMenu").tabs({cookie: {name: 'lemonldapauthchoice'}});
- if(choicetab){
- var authMenuIndex = $('#authMenu a[href="#'+choicetab+'"]').parent().index();
- authMenuTabs.tabs("option","active",authMenuIndex);
+ if (choicetab) {
+ var authMenuIndex = $('#authMenu a[href="#' + choicetab + '"]').parent().index();
+ authMenuTabs.tabs("option", "active", authMenuIndex);
}
/* Focus on first visible input */
$("input[type!=hidden]:first").focus();
- if(login){ $("input[type=password]:first").focus(); }
+ if (login) {
+ $("input[type=password]:first").focus();
+ }
/* Password autocompletion */
- $("input[type='password']").attr("autocomplete",autocomplete);
+ $("input[type='password']").attr("autocomplete", autocomplete);
/* Open links in new windows */
- if(newwindow){ $('#appslist a').attr("target", "_blank"); }
+ if (newwindow) {
+ $('#appslist a').attr("target", "_blank");
+ }
/* Complete removeOther link */
if ($("p.removeOther").length) {
@@ -79,12 +103,12 @@ $(document).ready(function(){
var back_url = "";
if (action.indexOf("?") != -1) {
- back_url = action.substring(0,action.indexOf("?")) + "?";
+ back_url = action.substring(0, action.indexOf("?")) + "?";
} else {
back_url = action + "?";
}
- $("form.login input[type=hidden]").each(function(index){
+ $("form.login input[type=hidden]").each(function(index) {
back_url = back_url + "&" + $(this).attr("name") + "=" + $(this).val();
});
@@ -92,7 +116,7 @@ $(document).ready(function(){
link = link + "&method=" + method + "&url=" + $.base64Encode(back_url);
- $("p.removeOther a").attr("href",link);
+ $("p.removeOther a").attr("href", link);
}
});
@@ -104,10 +128,12 @@ var setSelector = "#appslist";
function getOrder() {
// save custom order to persistent session
$.ajax({
- type:"POST",
- url:scriptname,
- data:{storeAppsListOrder:$(setSelector).sortable("toArray").join()},
- dataType:'json'
+ type: "POST",
+ url: scriptname,
+ data: {
+ storeAppsListOrder: $(setSelector).sortable("toArray").join()
+ },
+ dataType: 'json'
});
}
@@ -127,7 +153,7 @@ function restoreOrder() {
// make array from current order
var rebuild = new Array();
- for ( var v=0, len=items.length; v