aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/webapp/js/common.js
diff options
context:
space:
mode:
Diffstat (limited to 'id/ConfigWebTool/src/main/webapp/js/common.js')
-rw-r--r--id/ConfigWebTool/src/main/webapp/js/common.js131
1 files changed, 131 insertions, 0 deletions
diff --git a/id/ConfigWebTool/src/main/webapp/js/common.js b/id/ConfigWebTool/src/main/webapp/js/common.js
index 249cb37fa..11fc0b2be 100644
--- a/id/ConfigWebTool/src/main/webapp/js/common.js
+++ b/id/ConfigWebTool/src/main/webapp/js/common.js
@@ -1,3 +1,25 @@
+/*******************************************************************************
+ * Copyright 2014 Federal Chancellery Austria
+ * MOA-ID has been developed in a cooperation between BRZ, the Federal
+ * Chancellery Austria - ICT staff unit, and Graz University of Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ *******************************************************************************/
function oaBusinessService() {
if ($('#OAisbusinessservice').attr('checked') == 'checked') {
@@ -44,6 +66,29 @@ function oaPVP2(){
$('#button_pvp2_hidden').css('display', "block");
}
}
+function oaOAuth20(){
+ if ($('#oa_oauth20_area').css('display') == "block") {
+ $('#oa_oauth20_area').css('display', "none");
+ $('#button_oauth20_show').css('display', "block");
+ $('#button_oauth20_hidden').css('display', "none");
+ } else {
+ $('#oa_oauth20_area').css('display', "block");
+ $('#button_oauth20_show').css('display', "none");
+ $('#button_oauth20_hidden').css('display', "block");
+ }
+}
+function oaFormCustom() {
+ if ($('#formcustom_area').css('display') == "block") {
+ $('#formcustom_area').css('display', "none");
+ $('#formcustom_button_show').css('display', "block");
+ $('#formcustom_button_hidden').css('display', "none");
+ } else {
+ $('#formcustom_area').css('display', "block");
+ $('#formcustom_button_show').css('display', "none");
+ $('#formcustom_button_hidden').css('display', "block");
+ $("#formCustomPreview>iframe").attr("src", "./bkuFramePreview.action");
+ }
+}
function editOA(oaid){
$('#selectOAForm_OAID').val(oaid);
$('#selectOAForm').submit();
@@ -63,9 +108,95 @@ function oaLegacyService() {
}
}
+function AdminTarget() {
+ if ($('#adminTarget').attr('checked') == 'checked') {
+
+ $('#admin_target_area').css('display', "block");
+
+ } else {
+
+ $('#admin_target_area').css('display', "none");
+
+ }
+}
+function HideAdminTarget() {
+ $('#adminTarget').removeAttr("checked");
+ $('#admin_target_area').css('display', "none");
+}
+function oaTargetSubSector() {
+ if ($('#OAisTargetSubSector').attr('checked') == 'checked') {
+
+ $('#wwgrp_OAtarget_subsector').css('display', "block");
+
+ } else {
+
+ $('#wwgrp_OAtarget_subsector').css('display', "none");
+
+ }
+}
+function UseUserNamePassword() {
+ if ($('#isusernamepasswordallowed').size() == 0) {
+ $('#usernamepassword_area').css('display', "none");
+ return;
+ }
+
+ if ($('#isusernamepasswordallowed').attr('checked') == 'checked') {
+ if ($('#editUser_user_username').val() == "") {
+ $('#editUser_user_username').removeAttr("disabled");
+ }
+ $('#usernamepassword_area').css('display', "block");
+
+ } else {
+ $('#editUser_user_username').prop("disabled", "disabled");
+ $('#usernamepassword_area').css('display', "none");
+
+ }
+}
+function sendVerificationMail() {
+ $.ajax({
+ xhr: function() {
+ var xhr = new window.XMLHttpRequest();
+ return xhr;
+ },
+ type: "GET",
+ url: "servlet/sendVerificationMail.action",
+ data: "",
+ success: function (msg) {
+ alert(msg);
+ },
+ error: function () {
+ alert('Anfrage konnte nicht gesendet werden!');
+ },
+ });
+}
+function updateBKUFormPreview(module) {
+ var value = $("#"+module).val();
+
+ $("#formCustomPreview>iframe").attr("src", "./bkuFramePreview.action?module="+module+"&value="+encodeURIComponent(value.replace("#","")));
+}
+
+function userOnLoad() {
+ UseUserNamePassword();
+ return true;
+}
function oaOnLoad() {
oaBusinessService();
oaSSOService();
oaLegacyService();
+ AdminTarget();
+ oaTargetSubSector();
+
+ $(".colorfield").each(
+ function() {
+ $(this).ColorPicker({
+ color : $(this).val(),
+ onSubmit : function(hsb, hex, rgb, el) {
+ $(el).val(hex);
+ updateBKUFormPreview($(el).attr("id"));
+ }
+ });
+ }
+ );
+
return true;
} \ No newline at end of file