Revision: 4667 http://sourceforge.net/p/vexi/code/4667 Author: mkpg2 Date: 2014-02-28 01:33:19 +0000 (Fri, 28 Feb 2014) Log Message: ----------- Improve weekfield. - increment week not year by default when using up/down buttons - should apply to all date fields (or refactor date fields to share code)
Modified Paths: -------------- branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/weekfield.t Added Paths: ----------- branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/datefield_week.t Removed Paths: ------------- branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/vexi/ Modified: branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/weekfield.t =================================================================== --- branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/weekfield.t 2014-02-25 11:53:24 UTC (rev 4666) +++ branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/weekfield.t 2014-02-28 01:33:19 UTC (rev 4667) @@ -75,8 +75,18 @@ var incrementTrap = function(v) { if (selected==null || value==null) return; + var period; + // i.e. if it is focused, then update the focused (and highlighted value) + if(selected?.selected){ + period = selected.period; + }else{ + // else increment the smallest value + // (generaly we want to adjust the smallest part, not the year) + period = "week"; + selected = $week; + } + var amount = trapee==$more?1:-1; - var period = selected.period; value = value.addPeriod(period, amount); return; }; Added: branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/datefield_week.t =================================================================== --- branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/datefield_week.t (rev 0) +++ branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/datefield_week.t 2014-02-28 01:33:19 UTC (rev 4667) @@ -0,0 +1,17 @@ +<!-- public domain --> + +<vexi xmlns:ui="vexi://ui" xmlns:w="vexi.widget" xmlns:poke="poke"> + <w:surface /> + <ui:box orient="vertical"> + <ui:box> + <w:weekfield id="date1" /> + <w:weekfield id="date2" /> + </ui:box> + + $date1.value = vexi.js.Date.today.as("YW"); + $date2.value = vexi.js.Date.today.as("YW"); + + vexi.ui.frame = thisbox; + + </ui:box> +</vexi> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Flow-based real-time traffic analytics software. Cisco certified tool. Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer Customize your own dashboards, set traffic alerts and generate reports. Network behavioral analysis & security monitoring. All-in-one tool. http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn