From 041bd6429418242e3ca70ace97bbb56d04c74d81 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 27 Mar 2024 13:13:18 +0800 Subject: [PATCH] bugfix --- bricks/css/bricks.css | 2 +- bricks/form.js | 2 +- bricks/input.js | 5 ++--- examples/form.ui | 2 +- examples/tt.dspy | 8 ++++++++ examples/ttt.dspy | 8 ++++++++ 6 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 examples/tt.dspy create mode 100644 examples/ttt.dspy diff --git a/bricks/css/bricks.css b/bricks/css/bricks.css index f69b893..6b093e4 100755 --- a/bricks/css/bricks.css +++ b/bricks/css/bricks.css @@ -180,7 +180,7 @@ body { } .inputbox { - background-color: #ddd; + background-color: #f8f8f8; border: 1px solid #ccc; padding: 10px; margin: 0 0 1em 0; diff --git a/bricks/form.js b/bricks/form.js index e4f1ae7..39b63fa 100644 --- a/bricks/form.js +++ b/bricks/form.js @@ -141,7 +141,7 @@ bricks.Form = class extends bricks.VBox { } ] }; - var tbw = new bricks.Toolbar(tb_desc); + var tbw = new bricks.IconTextBar(tb_desc); tbw.bind('command', this.command_handle.bind(this)); box.add_widget(new bricks.Filler()); box.add_widget(tbw); diff --git a/bricks/input.js b/bricks/input.js index e2c1837..2a16e9e 100755 --- a/bricks/input.js +++ b/bricks/input.js @@ -120,7 +120,6 @@ bricks.UiStr =class extends bricks.UiType { this.dom_element.style.width = opts.width; } this.charsize_sizing(); - } create(){ var el = this._create('input'); @@ -147,8 +146,8 @@ bricks.UiStr =class extends bricks.UiType { if (this.opts.defaultVlaue) el.defaultValue = this.opts.defaultValue; this.reset() - if (this.opts.tip) - el.placeholder = bricks.app.i18n._(this.opts.tip); + if (this.opts.placeholder) + el.placeholder = bricks.app.i18n._(this.opts.placeholder); el.addEventListener('focus', this.onfocus.bind(this)); el.addEventListener('onkeydown', this.onkeydown.bind(this)); el.addEventListener('blur', this.onblur.bind(this)); diff --git a/examples/form.ui b/examples/form.ui index 4e6d9be..7b696f5 100644 --- a/examples/form.ui +++ b/examples/form.ui @@ -56,7 +56,7 @@ { "widgettype":"Form", "options":{ - "submit_url":"/ttt/ttt.dspy", + "submit_url":"{{entire_url('ttt.dspy')}}", "title":"Test hahah Form", "description":"test input implemented", "fields":[ diff --git a/examples/tt.dspy b/examples/tt.dspy new file mode 100644 index 0000000..1c9a437 --- /dev/null +++ b/examples/tt.dspy @@ -0,0 +1,8 @@ +info(params_kw) +return { + "widgettype":"Message", + "options":{ + "title":"form data accepted", + "message":json.dumps(params_kw) + } +} diff --git a/examples/ttt.dspy b/examples/ttt.dspy new file mode 100644 index 0000000..1c9a437 --- /dev/null +++ b/examples/ttt.dspy @@ -0,0 +1,8 @@ +info(params_kw) +return { + "widgettype":"Message", + "options":{ + "title":"form data accepted", + "message":json.dumps(params_kw) + } +}