|
@@ -40,13 +40,16 @@ $(document).ready(function() {
|
|
|
break;
|
|
break;
|
|
|
case 'select':
|
|
case 'select':
|
|
|
selectHtml = "<select id=\"editbox-input-" + this.name + "\" class=\"editbox-input\">";
|
|
selectHtml = "<select id=\"editbox-input-" + this.name + "\" class=\"editbox-input\">";
|
|
|
- this['values'].forEach(function(item) { // TODO: jQuery-each?
|
|
|
|
|
- if(editBox['options'][0]['value'] == item) {
|
|
|
|
|
- selectHtml += "<option selected value=\"" + item + "\">" + item + "</option>"
|
|
|
|
|
- } else {
|
|
|
|
|
- selectHtml += "<option value=\"" + item + "\">" + item + "</option>"
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ if(typeof this['values'] !== "undefined" && this['values']) {
|
|
|
|
|
+ this['values'].forEach(function(item) { // TODO: jQuery-each?
|
|
|
|
|
+ if(editBox['options'][0]['value'] == item) {
|
|
|
|
|
+ selectHtml += "<option selected value=\"" + item + "\">" + item + "</option>"
|
|
|
|
|
+ } else {
|
|
|
|
|
+ selectHtml += "<option value=\"" + item + "\">" + item + "</option>"
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
selectHtml += "</select>";
|
|
selectHtml += "</select>";
|
|
|
$(optionsContainer).append(this.name + selectHtml + "<br><br>");
|
|
$(optionsContainer).append(this.name + selectHtml + "<br><br>");
|
|
|
break;
|
|
break;
|
|
@@ -116,6 +119,31 @@ $(document).ready(function() {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function newLabelListener() {
|
|
|
|
|
+ $(document).on("click", "#save-new-label", function(e) {
|
|
|
|
|
+
|
|
|
|
|
+ e.preventDefault();
|
|
|
|
|
+
|
|
|
|
|
+ data = {
|
|
|
|
|
+ name: $("#editbox-input-name").val(),
|
|
|
|
|
+ path: $("#editbox-input-path").val()
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $.getJSON("ajax.php?action=saveNewLabel", data, function(r) {
|
|
|
|
|
+ if(r['status'] == "OK") {
|
|
|
|
|
+ location.reload();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ var n = noty({
|
|
|
|
|
+ layout : 'topCenter',
|
|
|
|
|
+ text : 'Irgendwas ist schief gelaufen.<br>Bitte probieren Sie es später noch einmal.',
|
|
|
|
|
+ type : 'error',
|
|
|
|
|
+ timeout : 5000
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function newDocumentListener() {
|
|
function newDocumentListener() {
|
|
|
$(document).on("change", ".fancybox-inner select", function(e) {
|
|
$(document).on("change", ".fancybox-inner select", function(e) {
|
|
|
reloadDraftVars();
|
|
reloadDraftVars();
|
|
@@ -129,7 +157,7 @@ $(document).ready(function() {
|
|
|
filename: $("#editbox-input-filename").val(),
|
|
filename: $("#editbox-input-filename").val(),
|
|
|
labelId: getUrlGetParameter("labelId"),
|
|
labelId: getUrlGetParameter("labelId"),
|
|
|
draftVars: {}
|
|
draftVars: {}
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
$(".editbox-draft-vars").each(function(i) {
|
|
$(".editbox-draft-vars").each(function(i) {
|
|
|
data['draftVars'][$(this).attr("id").replace("editbox-draft-vars-", "")] = $(this).val();
|
|
data['draftVars'][$(this).attr("id").replace("editbox-draft-vars-", "")] = $(this).val();
|
|
@@ -368,6 +396,10 @@ $(document).ready(function() {
|
|
|
case 'manage-label':
|
|
case 'manage-label':
|
|
|
loadBox('.manage-mailboxfolder', function() {});
|
|
loadBox('.manage-mailboxfolder', function() {});
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case 'manage-labels':
|
|
|
|
|
+ loadBox('#add-label', function() { $('.fancybox-inner').append("<a href=\"#\"type=\"button\" id=\"save-new-label\" class=\"btn btn-success\">Label speichern</a>"); });
|
|
|
|
|
+ newLabelListener();
|
|
|
|
|
+ break;
|
|
|
case 'label':
|
|
case 'label':
|
|
|
loadBox('#new-document', function() { reloadDraftVars(); });
|
|
loadBox('#new-document', function() { reloadDraftVars(); });
|
|
|
newDocumentListener();
|
|
newDocumentListener();
|