From: Andrew Dolgov Date: Fri, 19 Nov 2010 09:12:54 +0000 (+0300) Subject: rework label edit dialog X-Git-Tag: 1.5.0~144 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=018caf6f60d0f941eb69e33c77e63306e37f403a;p=tt-rss.git rework label edit dialog --- diff --git a/modules/pref-labels.php b/modules/pref-labels.php index ea1835f8..540df97b 100644 --- a/modules/pref-labels.php +++ b/modules/pref-labels.php @@ -16,43 +16,41 @@ $line = db_fetch_assoc($result); + print "
"; + + print ""; + print ""; + print ""; + print "
".__("Caption")."
"; print "
"; - print "" . $line["caption"] . - " - "; + print ""; print "
"; - print "
" . __("Change colors") . "
"; + print "
" . __("Colors") . "
"; print "
"; print ""; print "
"; - print "
".__("Foreground color:")."".__("Background color:"). + print "
".__("Foreground:")."".__("Background:"). "
"; + $fg_color = $line['fg_color']; + $bg_color = $line['bg_color']; + + print ""; + print ""; + print "
"; print ""; @@ -61,7 +59,7 @@ print "
"; print ""; @@ -69,9 +67,13 @@ print "
"; print "
"; - print "
"; + print ""; + + print "
"; + print ""; print ""; + __('Cancel').""; print "
"; print "]]>"; @@ -163,7 +165,7 @@ if ($subop == "save") { $id = db_escape_string($_REQUEST["id"]); - $caption = db_escape_string(trim($_REQUEST["value"])); + $caption = db_escape_string(trim($_REQUEST["caption"])); db_query($link, "BEGIN"); diff --git a/prefs.js b/prefs.js index b8b1b49b..0c627b21 100644 --- a/prefs.js +++ b/prefs.js @@ -1976,3 +1976,30 @@ function editLabel(id, event) { exception_error("editLabel", e); } } + +function editLabelSave() { + try { + var form = document.forms['label_edit_form']; + + var id = form.id.value; + var caption = form.caption.value; + var fg_color = form.fg_color.value; + var bg_color = form.bg_color.value; + + var query = Form.serialize('label_edit_form'); + + dijit.byId('labelTree').setNameById(id, caption); + setLabelColor(id, fg_color, bg_color); + + closeInfoBox(); + updateFilterList(); + + new Ajax.Request("backend.php", { + parameters: query, + onComplete: function(transport) { + } }); + + } catch (e) { + exception_error("editLabelSave", e); + } +}