From 16c42d5c17cf364d66831c95d30eb4e3d1748de8 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 18 Mar 2024 15:52:27 +0800 Subject: [PATCH] bugfix --- bricks/.DS_Store | Bin 10244 -> 10244 bytes bricks/build.sh | 2 +- bricks/dynamicaccordion.js | 10 ++++++++++ bricks/message.js | 16 +++++++++++++--- bricks/modal.js | 16 ++++++++++++---- bricks/video.js | 1 + examples/.form.ui.swp | Bin 12288 -> 0 bytes examples/{model.ui => modal.ui} | 0 8 files changed, 37 insertions(+), 8 deletions(-) delete mode 100644 examples/.form.ui.swp rename examples/{model.ui => modal.ui} (100%) diff --git a/bricks/.DS_Store b/bricks/.DS_Store index d0b7b692966136aa77b421e39dad0fc702dbaba8..1488c89eefc84b735d68c2765a1b35e70a098937 100755 GIT binary patch delta 1328 zcmeHF+e;Kt9Nus8GGhat)z$R0>ZXxci>;ZO8dhvlpyj46UU8dsrX1Xz)t%Y3vSp== zima%4>*8xs1eR1{^kh_2_7Fnv6+}?&cblan>Bx<;piMOVz}m~7nUayqux*2iK3Ur@2Nxzjfq2x_4j)00<*i{`AY8q{32 zEyeR~qS&v>ie{)sR3+@4P-SDJPtu1KO;)v|JyBIx{Q;$0lY)vBPC;17CDy#6VoG}> zesw&e8plZm&nMZEQYsG0lA#<3$%$$*dB~^kmzPpHkjS{h3X5|3!KTVM6}xryghHhB z%`Hw*>>gD$nds?Wt{Rbg1Cn0}5Lrkys;d`iPgDu(YDgn(X|l;C(%#`vFvxb%(_G6g zN{14C+a=xT7*jMh)5~;oH_P=8=_68D>6p-zaGKu7XdlT<@`+civTB4@lWlB|zC^t} zvYgx^k63f5hj#Mh9q%JV)uO5)8EmXBc0_dZYhio*i{-oJ2Y@UH$iZ6JP=YczumPLV zfJQW-8GGTuA#`E@hvCOCWCRh0fe50A;|$K?9M0n^uHgo5VivbBhx>SdCwPT7SjJnt z#|M1GCw#+i&ccDq;cQ$1SICuRaSpDWt1zFg8-#tH78N7D>gwNadztRaF+Sll$zEY5 zueXq9iiH0$ZL&r(Pm@ZQ| zg$tO$C0xc8rpg7c delta 1327 zcmeHFOHUI~80Cx^ACo?YUHf$$#P*zziBIhsK2!> zBm|pa?}#g!5)8?{QALUkbOp42S(Oy^aJM4KYD_t#$Wh)3H}6#gVR>yWIj%v3Knkv`I`4FsZc>!>P6S0wug@zcyCZ)ln%B^Fsebc!v6 zbQx|9lEjR%s5P_IBZ_`X6*aEJ0x>pDJ9~|2^c^AkPkVFXbIRA0UjR5*kcJG{kc}LO zD8ObEV+%@9i`{6#9<-qcz377<62ee1gki*yzywa=G^TI~Ixgc1Zr~PfV+IfK1W)k{ z&+!`X@c|$43E%J?KR9r!xeQL=?3^o&E9WY?D*Z)HFI=-u(Sd}IWh)=~yY7`Wpy@{0 zWJz@7<`t|HT-3tSH{r%22GdybCM!*QHoshniF zoWprsz(q{sDz4#rGMgFP!Cl50_Y^!(qcx+VL<|Ly;W Hwtw#*&+}iW diff --git a/bricks/build.sh b/bricks/build.sh index 7697107..d3e12a5 100755 --- a/bricks/build.sh +++ b/bricks/build.sh @@ -3,7 +3,7 @@ SOURCES=" page_data_loader.js factory.js uitypesdef.js utils.js \ jsoncall.js myoperator.js scroll.js menu.js modal.js \ markdown_viewer.js video.js audio.js toolbar.js tab.js \ input.js registerfunction.js button.js accordion.js \ - tree.js multiple_state_image.js dynamiccolumn.js form.js message.js \ + tree.js multiple_state_image.js dynamiccolumn.js form.js message.js conform.js \ paging.js datagrid.js dataviewer.js iframe.js \ floaticonbar.js \ miniform.js wterm.js dynamicaccordion.js " diff --git a/bricks/dynamicaccordion.js b/bricks/dynamicaccordion.js index 90ab37c..209d2f2 100644 --- a/bricks/dynamicaccordion.js +++ b/bricks/dynamicaccordion.js @@ -149,6 +149,16 @@ bricks.DynamicAccordion = class extends bricks.VScrollPanel { info.add_widget(w); } delete_record(info, record){ + var conform_w = new bricks.Conform({ + title:'Delete conform', + message:'Are you sure to delete is record?' + }); + conform_w.bind('conform', this.delete_record_act.bind(this, info, record)); + } + delete_record_act(){ + url = this.editable.delete_record_url + '?id=' + record.id; + var hc = new bricks.HttpClient(); + var r = hc.get(url); } async build_new_form(){ var desc = { diff --git a/bricks/message.js b/bricks/message.js index 4f9e6e9..3a90aaf 100644 --- a/bricks/message.js +++ b/bricks/message.js @@ -27,7 +27,7 @@ bricks.BPopup = class extends bricks.VBox { tb.set_css('title'); bricks.VBox.prototype.add_widget.bind(this)(tb); var tit = new bricks.Text({otext:this.title, i18n:true}); - this.content = new bricks.VBox({}); + this.content = new bricks.Filler({}); bricks.VBox.prototype.add_widget.bind(this)(this.content); tb.add_widget(tit); this.holder = bricks.Body; @@ -60,7 +60,7 @@ bricks.BPopup = class extends bricks.VBox { } } -bricks.BMessage = class extends bricks.BPopup { +bricks.BMessage = class extends bricks.Modal { /* { title: @@ -74,9 +74,19 @@ bricks.BMessage = class extends bricks.BPopup { */ constructor(opts){ super(opts); + this.create_message_widget(); + this.set_css('message'); + } + create_message_widget(){ + this.message_w = new bricks.VBox({width:'100%',height:'100%'}); + var w = new bricks.Filler(); + this.message_w.add_widget(w); var t = new bricks.Text({otext:this.opts.message, + wrap:true, + halign:'center', i18n:true}); - this.add_widget(t); + w.add_widget(t); + this.add_widget(this.message_w); } } diff --git a/bricks/modal.js b/bricks/modal.js index 9920a35..fbb1c9b 100755 --- a/bricks/modal.js +++ b/bricks/modal.js @@ -21,7 +21,7 @@ bricks.Modal = class extends bricks.Layout { super(options); this.set_width('100%'); this.set_height('100%'); - this.ancestor_add_widget = Layout.prototype.add_widget.bind(this); + this.ancestor_add_widget = bricks.Layout.prototype.add_widget.bind(this); this.panel = new bricks.VBox({}); this.ancestor_add_widget(this.panel); this.panel.set_width(this.opts.width); @@ -30,18 +30,26 @@ bricks.Modal = class extends bricks.Layout { this.panel.set_css('modal'); archorize(this.panel.dom_element, objget(this.opts, 'archor', 'cc')); this.create_title(); - this.content = new bricks.VBox({width:'100%'}); + this.content = new bricks.Filler({width:'100%'}); this.panel.add_widget(this.content); } create_title(){ this.title_box = new bricks.HBox({width:'100%', height:'auto'}); this.title_box.set_css('title'); this.panel.add_widget(this.title_box); - this.title = new bricks.HBox({height:'100%'}); + this.title_w = new bricks.Filler({height:'100%'}); var icon = new bricks.Icon({url:bricks_resource('imgs/delete.png')}); icon.bind('click', this.dismiss.bind(this)); - this.title_box.add_widget(this.title); + this.title_box.add_widget(this.title_w); this.title_box.add_widget(icon); + if (this.title){ + var w = new bricks.Text({ + otext:this.title, + i18n:true, + dynsize:true + }); + this.title_w.add_widget(w); + } } get_zindex(){ var idx = bricks.last_zindex; diff --git a/bricks/video.js b/bricks/video.js index afdcb5b..a35b63e 100755 --- a/bricks/video.js +++ b/bricks/video.js @@ -81,6 +81,7 @@ bricks.Video = class extends bricks.Layout { } report_ended(){ this.dispatch('play_end',{src:this.video_body.cur_url,type:this.video_body.cur_vtype}); + } report_playok(){ console.log(this.video_body.cur_url, 'play ok'); this.dispatch('play_ok', {src:this.video_body.cur_url,type:this.video_body.cur_vtype}); diff --git a/examples/.form.ui.swp b/examples/.form.ui.swp deleted file mode 100644 index 562379afdf3e1e4b2cbe65a7c0ca36ccbe5ce782..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2TWB0r7{|}5Rj1n48YzgN(~;UL&E{H3Rz(`y)M6WgqVs7fFDUdyEES9X&s@&VZU|4nTL1NMy=h)62c3s$X~^@c zouj^&cf1mHT53KHhh0-aSJCICYS6{zs9Sef&^77#Za(BKrS+v&Kr3+36bQv+=fEb? z*V_|K_1mrOX2*?3E}DDoNGqTf&mKr8S+RDjxqRPp8i+*L>(|Nl?F|Np&( zkPF}^@DX?$ya85#3yy*#;2v-n$bqw)3Hcd(555Mcz`NiDa2&XRfpIVb2Elf4CHQR< z%7gd8d*Ds*DtHPAK*2*`59kE9f^8rNez~5IFThFgBv=9=@W2#cfPw>H2j~D>z`5&? zFZc|c01KcBY;XwN4Q>Ml$bmmM67mB$4c-CIfhWKmml@kewO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