From bac20cbd23a0474a7ca8c95e28693bf355d3df3c Mon Sep 17 00:00:00 2001 From: Eugene Poltorakov Date: Tue, 7 May 2013 14:08:34 +0300 Subject: [PATCH] #601 - replace with --- build/widget-buttons/widget-buttons-coverage.js | 4 ++-- build/widget-buttons/widget-buttons-debug.js | 14 ++++++-------- build/widget-buttons/widget-buttons-min.js | 2 +- build/widget-buttons/widget-buttons.js | 14 ++++++-------- src/widget-buttons/js/widget-buttons.js | 14 ++++++-------- 5 files changed, 21 insertions(+), 27 deletions(-) diff --git a/build/widget-buttons/widget-buttons-coverage.js b/build/widget-buttons/widget-buttons-coverage.js index ee31b2c14d7..a0c9f48bf30 100644 --- a/build/widget-buttons/widget-buttons-coverage.js +++ b/build/widget-buttons/widget-buttons-coverage.js @@ -1,6 +1,6 @@ if (typeof __coverage__ === 'undefined') { __coverage__ = {}; } if (!__coverage__['build/widget-buttons/widget-buttons.js']) { - __coverage__['build/widget-buttons/widget-buttons.js'] = {"path":"build/widget-buttons/widget-buttons.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"138":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"164":0,"165":0,"166":0,"167":0,"168":0,"169":0,"170":0,"171":0,"172":0,"173":0,"174":0,"175":0,"176":0,"177":0,"178":0,"179":0,"180":0,"181":0,"182":0,"183":0,"184":0,"185":0,"186":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"193":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"200":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"207":0,"208":0,"209":0,"210":0,"211":0,"212":0,"213":0,"214":0,"215":0,"216":0,"217":0,"218":0,"219":0,"220":0,"221":0,"222":0,"223":0,"224":0,"225":0,"226":0,"227":0,"228":0,"229":0,"230":0,"231":0,"232":0,"233":0,"234":0,"235":0,"236":0,"237":0,"238":0,"239":0,"240":0,"241":0,"242":0,"243":0,"244":0,"245":0,"246":0,"247":0,"248":0,"249":0,"250":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0],"30":[0,0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0,0],"37":[0,0],"38":[0,0],"39":[0,0],"40":[0,0],"41":[0,0],"42":[0,0],"43":[0,0],"44":[0,0],"45":[0,0],"46":[0,0],"47":[0,0],"48":[0,0],"49":[0,0],"50":[0,0],"51":[0,0],"52":[0,0],"53":[0,0],"54":[0,0],"55":[0,0],"56":[0,0],"57":[0,0],"58":[0,0],"59":[0,0],"60":[0,0],"61":[0,0],"62":[0,0],"63":[0,0],"64":[0,0],"65":[0,0],"66":[0,0],"67":[0,0],"68":[0,0],"69":[0,0],"70":[0,0],"71":[0,0],"72":[0,0],"73":[0,0],"74":[0,0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":45}}},"2":{"name":"isNode","line":27,"loc":{"start":{"line":27,"column":0},"end":{"line":27,"column":22}}},"3":{"name":"WidgetButtons","line":46,"loc":{"start":{"line":46,"column":0},"end":{"line":46,"column":25}}},"4":{"name":"(anonymous_4)","line":167,"loc":{"start":{"line":167,"column":13},"end":{"line":167,"column":32}}},"5":{"name":"(anonymous_5)","line":258,"loc":{"start":{"line":258,"column":17},"end":{"line":258,"column":29}}},"6":{"name":"(anonymous_6)","line":273,"loc":{"start":{"line":273,"column":16},"end":{"line":273,"column":28}}},"7":{"name":"(anonymous_7)","line":275,"loc":{"start":{"line":275,"column":43},"end":{"line":275,"column":61}}},"8":{"name":"(anonymous_8)","line":360,"loc":{"start":{"line":360,"column":15},"end":{"line":360,"column":49}}},"9":{"name":"(anonymous_9)","line":402,"loc":{"start":{"line":402,"column":15},"end":{"line":402,"column":40}}},"10":{"name":"(anonymous_10)","line":450,"loc":{"start":{"line":450,"column":18},"end":{"line":450,"column":45}}},"11":{"name":"(anonymous_11)","line":470,"loc":{"start":{"line":470,"column":34},"end":{"line":470,"column":76}}},"12":{"name":"(anonymous_12)","line":506,"loc":{"start":{"line":506,"column":20},"end":{"line":506,"column":32}}},"13":{"name":"(anonymous_13)","line":531,"loc":{"start":{"line":531,"column":19},"end":{"line":531,"column":37}}},"14":{"name":"(anonymous_14)","line":599,"loc":{"start":{"line":599,"column":25},"end":{"line":599,"column":52}}},"15":{"name":"(anonymous_15)","line":609,"loc":{"start":{"line":609,"column":47},"end":{"line":609,"column":69}}},"16":{"name":"(anonymous_16)","line":648,"loc":{"start":{"line":648,"column":23},"end":{"line":648,"column":41}}},"17":{"name":"(anonymous_17)","line":676,"loc":{"start":{"line":676,"column":20},"end":{"line":676,"column":38}}},"18":{"name":"(anonymous_18)","line":702,"loc":{"start":{"line":702,"column":17},"end":{"line":702,"column":36}}},"19":{"name":"(anonymous_19)","line":706,"loc":{"start":{"line":706,"column":30},"end":{"line":706,"column":65}}},"20":{"name":"(anonymous_20)","line":728,"loc":{"start":{"line":728,"column":16},"end":{"line":728,"column":43}}},"21":{"name":"(anonymous_21)","line":758,"loc":{"start":{"line":758,"column":17},"end":{"line":758,"column":36}}},"22":{"name":"(anonymous_22)","line":762,"loc":{"start":{"line":762,"column":30},"end":{"line":762,"column":65}}},"23":{"name":"(anonymous_23)","line":783,"loc":{"start":{"line":783,"column":24},"end":{"line":783,"column":42}}},"24":{"name":"(anonymous_24)","line":833,"loc":{"start":{"line":833,"column":19},"end":{"line":833,"column":38}}},"25":{"name":"(anonymous_25)","line":838,"loc":{"start":{"line":838,"column":30},"end":{"line":838,"column":49}}},"26":{"name":"(anonymous_26)","line":850,"loc":{"start":{"line":850,"column":25},"end":{"line":850,"column":43}}},"27":{"name":"(anonymous_27)","line":877,"loc":{"start":{"line":877,"column":17},"end":{"line":877,"column":35}}},"28":{"name":"processButtons","line":881,"loc":{"start":{"line":881,"column":8},"end":{"line":881,"column":63}}},"29":{"name":"(anonymous_29)","line":925,"loc":{"start":{"line":925,"column":20},"end":{"line":925,"column":32}}},"30":{"name":"(anonymous_30)","line":945,"loc":{"start":{"line":945,"column":21},"end":{"line":945,"column":55}}},"31":{"name":"(anonymous_31)","line":976,"loc":{"start":{"line":976,"column":21},"end":{"line":976,"column":57}}},"32":{"name":"(anonymous_32)","line":1026,"loc":{"start":{"line":1026,"column":19},"end":{"line":1026,"column":38}}},"33":{"name":"(anonymous_33)","line":1030,"loc":{"start":{"line":1030,"column":30},"end":{"line":1030,"column":49}}},"34":{"name":"(anonymous_34)","line":1071,"loc":{"start":{"line":1071,"column":26},"end":{"line":1071,"column":44}}},"35":{"name":"(anonymous_35)","line":1101,"loc":{"start":{"line":1101,"column":25},"end":{"line":1101,"column":57}}},"36":{"name":"(anonymous_36)","line":1117,"loc":{"start":{"line":1117,"column":26},"end":{"line":1117,"column":45}}},"37":{"name":"(anonymous_37)","line":1137,"loc":{"start":{"line":1137,"column":18},"end":{"line":1137,"column":45}}},"38":{"name":"(anonymous_38)","line":1170,"loc":{"start":{"line":1170,"column":26},"end":{"line":1170,"column":38}}},"39":{"name":"(anonymous_39)","line":1191,"loc":{"start":{"line":1191,"column":27},"end":{"line":1191,"column":46}}},"40":{"name":"(anonymous_40)","line":1215,"loc":{"start":{"line":1215,"column":25},"end":{"line":1215,"column":38}}},"41":{"name":"(anonymous_41)","line":1264,"loc":{"start":{"line":1264,"column":32},"end":{"line":1264,"column":45}}},"42":{"name":"(anonymous_42)","line":1285,"loc":{"start":{"line":1285,"column":31},"end":{"line":1285,"column":44}}},"43":{"name":"(anonymous_43)","line":1298,"loc":{"start":{"line":1298,"column":32},"end":{"line":1298,"column":45}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1306,"column":79}},"2":{"start":{"line":11,"column":0},"end":{"line":23,"column":33}},"3":{"start":{"line":27,"column":0},"end":{"line":29,"column":1}},"4":{"start":{"line":28,"column":4},"end":{"line":28,"column":29}},"5":{"start":{"line":46,"column":0},"end":{"line":54,"column":1}},"6":{"start":{"line":48,"column":4},"end":{"line":50,"column":5}},"7":{"start":{"line":49,"column":8},"end":{"line":49,"column":80}},"8":{"start":{"line":53,"column":4},"end":{"line":53,"column":30}},"9":{"start":{"line":56,"column":0},"end":{"line":150,"column":2}},"10":{"start":{"line":160,"column":0},"end":{"line":164,"column":2}},"11":{"start":{"line":166,"column":0},"end":{"line":170,"column":2}},"12":{"start":{"line":168,"column":8},"end":{"line":168,"column":43}},"13":{"start":{"line":181,"column":0},"end":{"line":183,"column":2}},"14":{"start":{"line":185,"column":0},"end":{"line":1301,"column":2}},"15":{"start":{"line":260,"column":8},"end":{"line":260,"column":46}},"16":{"start":{"line":261,"column":8},"end":{"line":261,"column":36}},"17":{"start":{"line":264,"column":8},"end":{"line":267,"column":11}},"18":{"start":{"line":269,"column":8},"end":{"line":269,"column":53}},"19":{"start":{"line":270,"column":8},"end":{"line":270,"column":53}},"20":{"start":{"line":275,"column":8},"end":{"line":277,"column":11}},"21":{"start":{"line":276,"column":12},"end":{"line":276,"column":28}},"22":{"start":{"line":279,"column":8},"end":{"line":279,"column":36}},"23":{"start":{"line":280,"column":8},"end":{"line":280,"column":32}},"24":{"start":{"line":281,"column":8},"end":{"line":281,"column":35}},"25":{"start":{"line":361,"column":8},"end":{"line":362,"column":36}},"26":{"start":{"line":365,"column":8},"end":{"line":368,"column":9}},"27":{"start":{"line":366,"column":12},"end":{"line":366,"column":53}},"28":{"start":{"line":367,"column":12},"end":{"line":367,"column":50}},"29":{"start":{"line":370,"column":8},"end":{"line":370,"column":60}},"30":{"start":{"line":371,"column":8},"end":{"line":371,"column":69}},"31":{"start":{"line":372,"column":8},"end":{"line":372,"column":59}},"32":{"start":{"line":375,"column":8},"end":{"line":375,"column":48}},"33":{"start":{"line":378,"column":8},"end":{"line":378,"column":57}},"34":{"start":{"line":380,"column":8},"end":{"line":385,"column":11}},"35":{"start":{"line":387,"column":8},"end":{"line":387,"column":20}},"36":{"start":{"line":403,"column":8},"end":{"line":403,"column":39}},"37":{"start":{"line":403,"column":30},"end":{"line":403,"column":37}},"38":{"start":{"line":405,"column":8},"end":{"line":406,"column":20}},"39":{"start":{"line":408,"column":8},"end":{"line":408,"column":60}},"40":{"start":{"line":411,"column":8},"end":{"line":414,"column":9}},"41":{"start":{"line":412,"column":12},"end":{"line":412,"column":42}},"42":{"start":{"line":413,"column":12},"end":{"line":413,"column":62}},"43":{"start":{"line":417,"column":8},"end":{"line":417,"column":76}},"44":{"start":{"line":451,"column":8},"end":{"line":451,"column":46}},"45":{"start":{"line":451,"column":32},"end":{"line":451,"column":44}},"46":{"start":{"line":453,"column":8},"end":{"line":454,"column":18}},"47":{"start":{"line":457,"column":8},"end":{"line":478,"column":9}},"48":{"start":{"line":458,"column":12},"end":{"line":458,"column":64}},"49":{"start":{"line":459,"column":12},"end":{"line":459,"column":28}},"50":{"start":{"line":460,"column":12},"end":{"line":460,"column":45}},"51":{"start":{"line":463,"column":12},"end":{"line":467,"column":13}},"52":{"start":{"line":466,"column":16},"end":{"line":466,"column":63}},"53":{"start":{"line":470,"column":12},"end":{"line":477,"column":15}},"54":{"start":{"line":471,"column":16},"end":{"line":471,"column":63}},"55":{"start":{"line":473,"column":16},"end":{"line":476,"column":17}},"56":{"start":{"line":474,"column":20},"end":{"line":474,"column":45}},"57":{"start":{"line":475,"column":20},"end":{"line":475,"column":32}},"58":{"start":{"line":481,"column":8},"end":{"line":491,"column":9}},"59":{"start":{"line":483,"column":12},"end":{"line":483,"column":46}},"60":{"start":{"line":485,"column":12},"end":{"line":490,"column":15}},"61":{"start":{"line":493,"column":8},"end":{"line":493,"column":20}},"62":{"start":{"line":508,"column":8},"end":{"line":508,"column":76}},"63":{"start":{"line":510,"column":8},"end":{"line":515,"column":11}},"64":{"start":{"line":532,"column":8},"end":{"line":533,"column":44}},"65":{"start":{"line":537,"column":8},"end":{"line":539,"column":9}},"66":{"start":{"line":538,"column":12},"end":{"line":538,"column":65}},"67":{"start":{"line":542,"column":8},"end":{"line":546,"column":19}},"68":{"start":{"line":548,"column":8},"end":{"line":548,"column":43}},"69":{"start":{"line":549,"column":8},"end":{"line":549,"column":61}},"70":{"start":{"line":552,"column":8},"end":{"line":554,"column":9}},"71":{"start":{"line":553,"column":12},"end":{"line":553,"column":53}},"72":{"start":{"line":557,"column":8},"end":{"line":557,"column":55}},"73":{"start":{"line":559,"column":8},"end":{"line":559,"column":33}},"74":{"start":{"line":560,"column":8},"end":{"line":560,"column":32}},"75":{"start":{"line":564,"column":8},"end":{"line":566,"column":9}},"76":{"start":{"line":565,"column":12},"end":{"line":565,"column":45}},"77":{"start":{"line":570,"column":8},"end":{"line":570,"column":59}},"78":{"start":{"line":571,"column":8},"end":{"line":571,"column":61}},"79":{"start":{"line":574,"column":8},"end":{"line":574,"column":60}},"80":{"start":{"line":575,"column":8},"end":{"line":575,"column":66}},"81":{"start":{"line":578,"column":8},"end":{"line":578,"column":72}},"82":{"start":{"line":580,"column":8},"end":{"line":580,"column":22}},"83":{"start":{"line":600,"column":8},"end":{"line":603,"column":41}},"84":{"start":{"line":606,"column":8},"end":{"line":606,"column":77}},"85":{"start":{"line":609,"column":8},"end":{"line":619,"column":17}},"86":{"start":{"line":610,"column":12},"end":{"line":610,"column":23}},"87":{"start":{"line":612,"column":12},"end":{"line":618,"column":13}},"88":{"start":{"line":613,"column":16},"end":{"line":613,"column":50}},"89":{"start":{"line":615,"column":16},"end":{"line":617,"column":17}},"90":{"start":{"line":616,"column":20},"end":{"line":616,"column":37}},"91":{"start":{"line":622,"column":8},"end":{"line":625,"column":9}},"92":{"start":{"line":623,"column":12},"end":{"line":623,"column":61}},"93":{"start":{"line":624,"column":12},"end":{"line":624,"column":49}},"94":{"start":{"line":627,"column":8},"end":{"line":627,"column":25}},"95":{"start":{"line":649,"column":8},"end":{"line":650,"column":61}},"96":{"start":{"line":652,"column":8},"end":{"line":654,"column":9}},"97":{"start":{"line":653,"column":12},"end":{"line":653,"column":54}},"98":{"start":{"line":656,"column":8},"end":{"line":656,"column":27}},"99":{"start":{"line":677,"column":8},"end":{"line":677,"column":17}},"100":{"start":{"line":679,"column":8},"end":{"line":683,"column":9}},"101":{"start":{"line":680,"column":12},"end":{"line":680,"column":64}},"102":{"start":{"line":682,"column":12},"end":{"line":682,"column":58}},"103":{"start":{"line":685,"column":8},"end":{"line":685,"column":20}},"104":{"start":{"line":703,"column":8},"end":{"line":703,"column":29}},"105":{"start":{"line":706,"column":8},"end":{"line":709,"column":11}},"106":{"start":{"line":708,"column":12},"end":{"line":708,"column":59}},"107":{"start":{"line":711,"column":8},"end":{"line":711,"column":27}},"108":{"start":{"line":729,"column":8},"end":{"line":731,"column":55}},"109":{"start":{"line":733,"column":8},"end":{"line":739,"column":9}},"110":{"start":{"line":735,"column":12},"end":{"line":735,"column":31}},"111":{"start":{"line":738,"column":12},"end":{"line":738,"column":47}},"112":{"start":{"line":741,"column":8},"end":{"line":741,"column":52}},"113":{"start":{"line":759,"column":8},"end":{"line":759,"column":33}},"114":{"start":{"line":760,"column":8},"end":{"line":760,"column":35}},"115":{"start":{"line":762,"column":8},"end":{"line":768,"column":17}},"116":{"start":{"line":763,"column":12},"end":{"line":763,"column":23}},"117":{"start":{"line":765,"column":12},"end":{"line":767,"column":13}},"118":{"start":{"line":766,"column":16},"end":{"line":766,"column":60}},"119":{"start":{"line":784,"column":8},"end":{"line":784,"column":66}},"120":{"start":{"line":787,"column":8},"end":{"line":787,"column":69}},"121":{"start":{"line":790,"column":8},"end":{"line":807,"column":9}},"122":{"start":{"line":791,"column":12},"end":{"line":791,"column":37}},"123":{"start":{"line":792,"column":12},"end":{"line":792,"column":58}},"124":{"start":{"line":793,"column":12},"end":{"line":793,"column":73}},"125":{"start":{"line":796,"column":12},"end":{"line":800,"column":14}},"126":{"start":{"line":803,"column":12},"end":{"line":803,"column":50}},"127":{"start":{"line":806,"column":12},"end":{"line":806,"column":62}},"128":{"start":{"line":809,"column":8},"end":{"line":809,"column":48}},"129":{"start":{"line":810,"column":8},"end":{"line":810,"column":55}},"130":{"start":{"line":813,"column":8},"end":{"line":815,"column":9}},"131":{"start":{"line":814,"column":12},"end":{"line":814,"column":59}},"132":{"start":{"line":817,"column":8},"end":{"line":817,"column":22}},"133":{"start":{"line":834,"column":8},"end":{"line":836,"column":34}},"134":{"start":{"line":838,"column":8},"end":{"line":856,"column":17}},"135":{"start":{"line":839,"column":12},"end":{"line":841,"column":31}},"136":{"start":{"line":843,"column":12},"end":{"line":843,"column":58}},"137":{"start":{"line":843,"column":49},"end":{"line":843,"column":56}},"138":{"start":{"line":845,"column":12},"end":{"line":845,"column":32}},"139":{"start":{"line":850,"column":12},"end":{"line":852,"column":15}},"140":{"start":{"line":851,"column":16},"end":{"line":851,"column":55}},"141":{"start":{"line":854,"column":12},"end":{"line":854,"column":50}},"142":{"start":{"line":855,"column":12},"end":{"line":855,"column":52}},"143":{"start":{"line":858,"column":8},"end":{"line":858,"column":29}},"144":{"start":{"line":878,"column":8},"end":{"line":879,"column":28}},"145":{"start":{"line":881,"column":8},"end":{"line":905,"column":9}},"146":{"start":{"line":882,"column":12},"end":{"line":882,"column":52}},"147":{"start":{"line":882,"column":43},"end":{"line":882,"column":50}},"148":{"start":{"line":884,"column":12},"end":{"line":884,"column":40}},"149":{"start":{"line":886,"column":12},"end":{"line":904,"column":13}},"150":{"start":{"line":887,"column":16},"end":{"line":887,"column":43}},"151":{"start":{"line":888,"column":16},"end":{"line":888,"column":41}},"152":{"start":{"line":890,"column":16},"end":{"line":893,"column":17}},"153":{"start":{"line":891,"column":20},"end":{"line":891,"column":61}},"154":{"start":{"line":892,"column":20},"end":{"line":892,"column":58}},"155":{"start":{"line":897,"column":16},"end":{"line":897,"column":52}},"156":{"start":{"line":900,"column":16},"end":{"line":900,"column":50}},"157":{"start":{"line":903,"column":16},"end":{"line":903,"column":75}},"158":{"start":{"line":908,"column":8},"end":{"line":912,"column":9}},"159":{"start":{"line":909,"column":12},"end":{"line":909,"column":46}},"160":{"start":{"line":911,"column":12},"end":{"line":911,"column":55}},"161":{"start":{"line":914,"column":8},"end":{"line":914,"column":23}},"162":{"start":{"line":926,"column":8},"end":{"line":926,"column":48}},"163":{"start":{"line":927,"column":8},"end":{"line":927,"column":60}},"164":{"start":{"line":928,"column":8},"end":{"line":928,"column":55}},"165":{"start":{"line":946,"column":8},"end":{"line":948,"column":75}},"166":{"start":{"line":951,"column":8},"end":{"line":951,"column":73}},"167":{"start":{"line":954,"column":8},"end":{"line":954,"column":65}},"168":{"start":{"line":977,"column":8},"end":{"line":980,"column":45}},"169":{"start":{"line":982,"column":8},"end":{"line":984,"column":9}},"170":{"start":{"line":983,"column":12},"end":{"line":983,"column":28}},"171":{"start":{"line":986,"column":8},"end":{"line":986,"column":29}},"172":{"start":{"line":988,"column":8},"end":{"line":988,"column":24}},"173":{"start":{"line":990,"column":8},"end":{"line":990,"column":34}},"174":{"start":{"line":993,"column":8},"end":{"line":1004,"column":9}},"175":{"start":{"line":994,"column":12},"end":{"line":994,"column":64}},"176":{"start":{"line":995,"column":12},"end":{"line":995,"column":63}},"177":{"start":{"line":998,"column":12},"end":{"line":1003,"column":13}},"178":{"start":{"line":1001,"column":16},"end":{"line":1001,"column":41}},"179":{"start":{"line":1002,"column":16},"end":{"line":1002,"column":52}},"180":{"start":{"line":1027,"column":8},"end":{"line":1028,"column":59}},"181":{"start":{"line":1030,"column":8},"end":{"line":1088,"column":17}},"182":{"start":{"line":1031,"column":12},"end":{"line":1035,"column":49}},"183":{"start":{"line":1039,"column":12},"end":{"line":1039,"column":45}},"184":{"start":{"line":1039,"column":36},"end":{"line":1039,"column":43}},"185":{"start":{"line":1041,"column":12},"end":{"line":1041,"column":66}},"186":{"start":{"line":1043,"column":12},"end":{"line":1067,"column":13}},"187":{"start":{"line":1044,"column":16},"end":{"line":1044,"column":48}},"188":{"start":{"line":1045,"column":16},"end":{"line":1045,"column":55}},"189":{"start":{"line":1050,"column":16},"end":{"line":1066,"column":17}},"190":{"start":{"line":1053,"column":20},"end":{"line":1053,"column":52}},"191":{"start":{"line":1057,"column":20},"end":{"line":1062,"column":21}},"192":{"start":{"line":1060,"column":24},"end":{"line":1060,"column":68}},"193":{"start":{"line":1061,"column":24},"end":{"line":1061,"column":46}},"194":{"start":{"line":1064,"column":20},"end":{"line":1064,"column":56}},"195":{"start":{"line":1065,"column":20},"end":{"line":1065,"column":42}},"196":{"start":{"line":1071,"column":12},"end":{"line":1074,"column":21}},"197":{"start":{"line":1072,"column":16},"end":{"line":1072,"column":79}},"198":{"start":{"line":1073,"column":16},"end":{"line":1073,"column":38}},"199":{"start":{"line":1078,"column":12},"end":{"line":1082,"column":13}},"200":{"start":{"line":1079,"column":16},"end":{"line":1079,"column":41}},"201":{"start":{"line":1080,"column":16},"end":{"line":1080,"column":52}},"202":{"start":{"line":1081,"column":16},"end":{"line":1081,"column":23}},"203":{"start":{"line":1085,"column":12},"end":{"line":1087,"column":13}},"204":{"start":{"line":1086,"column":16},"end":{"line":1086,"column":73}},"205":{"start":{"line":1102,"column":8},"end":{"line":1102,"column":65}},"206":{"start":{"line":1104,"column":8},"end":{"line":1104,"column":64}},"207":{"start":{"line":1104,"column":25},"end":{"line":1104,"column":62}},"208":{"start":{"line":1105,"column":8},"end":{"line":1105,"column":67}},"209":{"start":{"line":1105,"column":25},"end":{"line":1105,"column":65}},"210":{"start":{"line":1118,"column":8},"end":{"line":1118,"column":33}},"211":{"start":{"line":1118,"column":24},"end":{"line":1118,"column":31}},"212":{"start":{"line":1120,"column":8},"end":{"line":1120,"column":54}},"213":{"start":{"line":1121,"column":8},"end":{"line":1123,"column":9}},"214":{"start":{"line":1122,"column":12},"end":{"line":1122,"column":34}},"215":{"start":{"line":1138,"column":8},"end":{"line":1140,"column":24}},"216":{"start":{"line":1143,"column":8},"end":{"line":1154,"column":9}},"217":{"start":{"line":1145,"column":12},"end":{"line":1147,"column":13}},"218":{"start":{"line":1146,"column":16},"end":{"line":1146,"column":33}},"219":{"start":{"line":1150,"column":12},"end":{"line":1150,"column":47}},"220":{"start":{"line":1151,"column":12},"end":{"line":1153,"column":13}},"221":{"start":{"line":1152,"column":16},"end":{"line":1152,"column":40}},"222":{"start":{"line":1157,"column":8},"end":{"line":1159,"column":9}},"223":{"start":{"line":1158,"column":12},"end":{"line":1158,"column":39}},"224":{"start":{"line":1171,"column":8},"end":{"line":1171,"column":48}},"225":{"start":{"line":1173,"column":8},"end":{"line":1175,"column":9}},"226":{"start":{"line":1174,"column":12},"end":{"line":1174,"column":54}},"227":{"start":{"line":1193,"column":8},"end":{"line":1193,"column":75}},"228":{"start":{"line":1196,"column":8},"end":{"line":1197,"column":46}},"229":{"start":{"line":1216,"column":8},"end":{"line":1220,"column":19}},"230":{"start":{"line":1223,"column":8},"end":{"line":1232,"column":9}},"231":{"start":{"line":1225,"column":12},"end":{"line":1225,"column":45}},"232":{"start":{"line":1227,"column":12},"end":{"line":1227,"column":45}},"233":{"start":{"line":1228,"column":12},"end":{"line":1228,"column":40}},"234":{"start":{"line":1229,"column":12},"end":{"line":1229,"column":57}},"235":{"start":{"line":1231,"column":12},"end":{"line":1231,"column":19}},"236":{"start":{"line":1235,"column":8},"end":{"line":1244,"column":9}},"237":{"start":{"line":1237,"column":12},"end":{"line":1237,"column":30}},"238":{"start":{"line":1239,"column":12},"end":{"line":1239,"column":47}},"239":{"start":{"line":1240,"column":12},"end":{"line":1240,"column":40}},"240":{"start":{"line":1241,"column":12},"end":{"line":1241,"column":50}},"241":{"start":{"line":1243,"column":12},"end":{"line":1243,"column":19}},"242":{"start":{"line":1246,"column":8},"end":{"line":1246,"column":34}},"243":{"start":{"line":1247,"column":8},"end":{"line":1247,"column":36}},"244":{"start":{"line":1248,"column":8},"end":{"line":1248,"column":36}},"245":{"start":{"line":1265,"column":8},"end":{"line":1267,"column":59}},"246":{"start":{"line":1270,"column":8},"end":{"line":1272,"column":9}},"247":{"start":{"line":1271,"column":12},"end":{"line":1271,"column":52}},"248":{"start":{"line":1286,"column":8},"end":{"line":1286,"column":54}},"249":{"start":{"line":1299,"column":8},"end":{"line":1299,"column":44}},"250":{"start":{"line":1303,"column":0},"end":{"line":1303,"column":32}}},"branchMap":{"1":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":4},"end":{"line":48,"column":4}},{"start":{"line":48,"column":4},"end":{"line":48,"column":4}}]},"2":{"line":365,"type":"if","locations":[{"start":{"line":365,"column":8},"end":{"line":365,"column":8}},{"start":{"line":365,"column":8},"end":{"line":365,"column":8}}]},"3":{"line":367,"type":"binary-expr","locations":[{"start":{"line":367,"column":12},"end":{"line":367,"column":19}},{"start":{"line":367,"column":24},"end":{"line":367,"column":48}}]},"4":{"line":370,"type":"binary-expr","locations":[{"start":{"line":370,"column":8},"end":{"line":370,"column":15}},{"start":{"line":370,"column":20},"end":{"line":370,"column":58}}]},"5":{"line":371,"type":"binary-expr","locations":[{"start":{"line":371,"column":25},"end":{"line":371,"column":41}},{"start":{"line":371,"column":46},"end":{"line":371,"column":67}}]},"6":{"line":372,"type":"binary-expr","locations":[{"start":{"line":372,"column":8},"end":{"line":372,"column":23}},{"start":{"line":372,"column":28},"end":{"line":372,"column":57}}]},"7":{"line":403,"type":"if","locations":[{"start":{"line":403,"column":8},"end":{"line":403,"column":8}},{"start":{"line":403,"column":8},"end":{"line":403,"column":8}}]},"8":{"line":408,"type":"binary-expr","locations":[{"start":{"line":408,"column":8},"end":{"line":408,"column":15}},{"start":{"line":408,"column":20},"end":{"line":408,"column":58}}]},"9":{"line":411,"type":"if","locations":[{"start":{"line":411,"column":8},"end":{"line":411,"column":8}},{"start":{"line":411,"column":8},"end":{"line":411,"column":8}}]},"10":{"line":413,"type":"binary-expr","locations":[{"start":{"line":413,"column":19},"end":{"line":413,"column":35}},{"start":{"line":413,"column":39},"end":{"line":413,"column":61}}]},"11":{"line":417,"type":"cond-expr","locations":[{"start":{"line":417,"column":38},"end":{"line":417,"column":63}},{"start":{"line":417,"column":66},"end":{"line":417,"column":75}}]},"12":{"line":451,"type":"if","locations":[{"start":{"line":451,"column":8},"end":{"line":451,"column":8}},{"start":{"line":451,"column":8},"end":{"line":451,"column":8}}]},"13":{"line":457,"type":"if","locations":[{"start":{"line":457,"column":8},"end":{"line":457,"column":8}},{"start":{"line":457,"column":8},"end":{"line":457,"column":8}}]},"14":{"line":458,"type":"binary-expr","locations":[{"start":{"line":458,"column":12},"end":{"line":458,"column":19}},{"start":{"line":458,"column":24},"end":{"line":458,"column":62}}]},"15":{"line":463,"type":"if","locations":[{"start":{"line":463,"column":12},"end":{"line":463,"column":12}},{"start":{"line":463,"column":12},"end":{"line":463,"column":12}}]},"16":{"line":473,"type":"if","locations":[{"start":{"line":473,"column":16},"end":{"line":473,"column":16}},{"start":{"line":473,"column":16},"end":{"line":473,"column":16}}]},"17":{"line":481,"type":"if","locations":[{"start":{"line":481,"column":8},"end":{"line":481,"column":8}},{"start":{"line":481,"column":8},"end":{"line":481,"column":8}}]},"18":{"line":481,"type":"binary-expr","locations":[{"start":{"line":481,"column":12},"end":{"line":481,"column":18}},{"start":{"line":481,"column":22},"end":{"line":481,"column":32}}]},"19":{"line":537,"type":"if","locations":[{"start":{"line":537,"column":8},"end":{"line":537,"column":8}},{"start":{"line":537,"column":8},"end":{"line":537,"column":8}}]},"20":{"line":564,"type":"if","locations":[{"start":{"line":564,"column":8},"end":{"line":564,"column":8}},{"start":{"line":564,"column":8},"end":{"line":564,"column":8}}]},"21":{"line":612,"type":"if","locations":[{"start":{"line":612,"column":12},"end":{"line":612,"column":12}},{"start":{"line":612,"column":12},"end":{"line":612,"column":12}}]},"22":{"line":615,"type":"if","locations":[{"start":{"line":615,"column":16},"end":{"line":615,"column":16}},{"start":{"line":615,"column":16},"end":{"line":615,"column":16}}]},"23":{"line":615,"type":"binary-expr","locations":[{"start":{"line":615,"column":20},"end":{"line":615,"column":27}},{"start":{"line":615,"column":31},"end":{"line":615,"column":46}}]},"24":{"line":622,"type":"if","locations":[{"start":{"line":622,"column":8},"end":{"line":622,"column":8}},{"start":{"line":622,"column":8},"end":{"line":622,"column":8}}]},"25":{"line":622,"type":"binary-expr","locations":[{"start":{"line":622,"column":12},"end":{"line":622,"column":22}},{"start":{"line":622,"column":26},"end":{"line":622,"column":32}}]},"26":{"line":649,"type":"cond-expr","locations":[{"start":{"line":650,"column":16},"end":{"line":650,"column":41}},{"start":{"line":650,"column":44},"end":{"line":650,"column":60}}]},"27":{"line":652,"type":"if","locations":[{"start":{"line":652,"column":8},"end":{"line":652,"column":8}},{"start":{"line":652,"column":8},"end":{"line":652,"column":8}}]},"28":{"line":679,"type":"if","locations":[{"start":{"line":679,"column":8},"end":{"line":679,"column":8}},{"start":{"line":679,"column":8},"end":{"line":679,"column":8}}]},"29":{"line":680,"type":"binary-expr","locations":[{"start":{"line":680,"column":19},"end":{"line":680,"column":41}},{"start":{"line":680,"column":45},"end":{"line":680,"column":63}}]},"30":{"line":682,"type":"binary-expr","locations":[{"start":{"line":682,"column":19},"end":{"line":682,"column":25}},{"start":{"line":682,"column":30},"end":{"line":682,"column":41}},{"start":{"line":682,"column":45},"end":{"line":682,"column":56}}]},"31":{"line":733,"type":"if","locations":[{"start":{"line":733,"column":8},"end":{"line":733,"column":8}},{"start":{"line":733,"column":8},"end":{"line":733,"column":8}}]},"32":{"line":741,"type":"binary-expr","locations":[{"start":{"line":741,"column":8},"end":{"line":741,"column":17}},{"start":{"line":741,"column":22},"end":{"line":741,"column":50}}]},"33":{"line":787,"type":"cond-expr","locations":[{"start":{"line":787,"column":36},"end":{"line":787,"column":50}},{"start":{"line":787,"column":53},"end":{"line":787,"column":68}}]},"34":{"line":790,"type":"if","locations":[{"start":{"line":790,"column":8},"end":{"line":790,"column":8}},{"start":{"line":790,"column":8},"end":{"line":790,"column":8}}]},"35":{"line":793,"type":"cond-expr","locations":[{"start":{"line":793,"column":55},"end":{"line":793,"column":62}},{"start":{"line":793,"column":65},"end":{"line":793,"column":71}}]},"36":{"line":803,"type":"binary-expr","locations":[{"start":{"line":803,"column":12},"end":{"line":803,"column":17}},{"start":{"line":803,"column":22},"end":{"line":803,"column":48}}]},"37":{"line":810,"type":"binary-expr","locations":[{"start":{"line":810,"column":20},"end":{"line":810,"column":32}},{"start":{"line":810,"column":36},"end":{"line":810,"column":54}}]},"38":{"line":813,"type":"if","locations":[{"start":{"line":813,"column":8},"end":{"line":813,"column":8}},{"start":{"line":813,"column":8},"end":{"line":813,"column":8}}]},"39":{"line":840,"type":"binary-expr","locations":[{"start":{"line":840,"column":28},"end":{"line":840,"column":37}},{"start":{"line":840,"column":41},"end":{"line":840,"column":70}}]},"40":{"line":843,"type":"if","locations":[{"start":{"line":843,"column":12},"end":{"line":843,"column":12}},{"start":{"line":843,"column":12},"end":{"line":843,"column":12}}]},"41":{"line":843,"type":"binary-expr","locations":[{"start":{"line":843,"column":16},"end":{"line":843,"column":24}},{"start":{"line":843,"column":28},"end":{"line":843,"column":45}}]},"42":{"line":854,"type":"binary-expr","locations":[{"start":{"line":854,"column":12},"end":{"line":854,"column":25}},{"start":{"line":854,"column":30},"end":{"line":854,"column":48}}]},"43":{"line":882,"type":"if","locations":[{"start":{"line":882,"column":12},"end":{"line":882,"column":12}},{"start":{"line":882,"column":12},"end":{"line":882,"column":12}}]},"44":{"line":890,"type":"if","locations":[{"start":{"line":890,"column":16},"end":{"line":890,"column":16}},{"start":{"line":890,"column":16},"end":{"line":890,"column":16}}]},"45":{"line":892,"type":"binary-expr","locations":[{"start":{"line":892,"column":20},"end":{"line":892,"column":27}},{"start":{"line":892,"column":32},"end":{"line":892,"column":56}}]},"46":{"line":900,"type":"binary-expr","locations":[{"start":{"line":900,"column":16},"end":{"line":900,"column":23}},{"start":{"line":900,"column":28},"end":{"line":900,"column":48}}]},"47":{"line":903,"type":"binary-expr","locations":[{"start":{"line":903,"column":17},"end":{"line":903,"column":33}},{"start":{"line":903,"column":38},"end":{"line":903,"column":59}}]},"48":{"line":908,"type":"if","locations":[{"start":{"line":908,"column":8},"end":{"line":908,"column":8}},{"start":{"line":908,"column":8},"end":{"line":908,"column":8}}]},"49":{"line":982,"type":"if","locations":[{"start":{"line":982,"column":8},"end":{"line":982,"column":8}},{"start":{"line":982,"column":8},"end":{"line":982,"column":8}}]},"50":{"line":990,"type":"binary-expr","locations":[{"start":{"line":990,"column":8},"end":{"line":990,"column":15}},{"start":{"line":990,"column":20},"end":{"line":990,"column":32}}]},"51":{"line":993,"type":"if","locations":[{"start":{"line":993,"column":8},"end":{"line":993,"column":8}},{"start":{"line":993,"column":8},"end":{"line":993,"column":8}}]},"52":{"line":998,"type":"if","locations":[{"start":{"line":998,"column":12},"end":{"line":998,"column":12}},{"start":{"line":998,"column":12},"end":{"line":998,"column":12}}]},"53":{"line":998,"type":"binary-expr","locations":[{"start":{"line":998,"column":16},"end":{"line":998,"column":31}},{"start":{"line":999,"column":20},"end":{"line":999,"column":72}}]},"54":{"line":1031,"type":"binary-expr","locations":[{"start":{"line":1031,"column":34},"end":{"line":1031,"column":50}},{"start":{"line":1031,"column":54},"end":{"line":1031,"column":56}}]},"55":{"line":1039,"type":"if","locations":[{"start":{"line":1039,"column":12},"end":{"line":1039,"column":12}},{"start":{"line":1039,"column":12},"end":{"line":1039,"column":12}}]},"56":{"line":1050,"type":"if","locations":[{"start":{"line":1050,"column":16},"end":{"line":1050,"column":16}},{"start":{"line":1050,"column":16},"end":{"line":1050,"column":16}}]},"57":{"line":1057,"type":"if","locations":[{"start":{"line":1057,"column":20},"end":{"line":1057,"column":20}},{"start":{"line":1057,"column":20},"end":{"line":1057,"column":20}}]},"58":{"line":1078,"type":"if","locations":[{"start":{"line":1078,"column":12},"end":{"line":1078,"column":12}},{"start":{"line":1078,"column":12},"end":{"line":1078,"column":12}}]},"59":{"line":1085,"type":"if","locations":[{"start":{"line":1085,"column":12},"end":{"line":1085,"column":12}},{"start":{"line":1085,"column":12},"end":{"line":1085,"column":12}}]},"60":{"line":1104,"type":"if","locations":[{"start":{"line":1104,"column":8},"end":{"line":1104,"column":8}},{"start":{"line":1104,"column":8},"end":{"line":1104,"column":8}}]},"61":{"line":1105,"type":"if","locations":[{"start":{"line":1105,"column":8},"end":{"line":1105,"column":8}},{"start":{"line":1105,"column":8},"end":{"line":1105,"column":8}}]},"62":{"line":1118,"type":"if","locations":[{"start":{"line":1118,"column":8},"end":{"line":1118,"column":8}},{"start":{"line":1118,"column":8},"end":{"line":1118,"column":8}}]},"63":{"line":1121,"type":"if","locations":[{"start":{"line":1121,"column":8},"end":{"line":1121,"column":8}},{"start":{"line":1121,"column":8},"end":{"line":1121,"column":8}}]},"64":{"line":1143,"type":"if","locations":[{"start":{"line":1143,"column":8},"end":{"line":1143,"column":8}},{"start":{"line":1143,"column":8},"end":{"line":1143,"column":8}}]},"65":{"line":1145,"type":"if","locations":[{"start":{"line":1145,"column":12},"end":{"line":1145,"column":12}},{"start":{"line":1145,"column":12},"end":{"line":1145,"column":12}}]},"66":{"line":1151,"type":"if","locations":[{"start":{"line":1151,"column":12},"end":{"line":1151,"column":12}},{"start":{"line":1151,"column":12},"end":{"line":1151,"column":12}}]},"67":{"line":1157,"type":"if","locations":[{"start":{"line":1157,"column":8},"end":{"line":1157,"column":8}},{"start":{"line":1157,"column":8},"end":{"line":1157,"column":8}}]},"68":{"line":1173,"type":"if","locations":[{"start":{"line":1173,"column":8},"end":{"line":1173,"column":8}},{"start":{"line":1173,"column":8},"end":{"line":1173,"column":8}}]},"69":{"line":1196,"type":"cond-expr","locations":[{"start":{"line":1196,"column":65},"end":{"line":1196,"column":69}},{"start":{"line":1197,"column":12},"end":{"line":1197,"column":26}}]},"70":{"line":1223,"type":"if","locations":[{"start":{"line":1223,"column":8},"end":{"line":1223,"column":8}},{"start":{"line":1223,"column":8},"end":{"line":1223,"column":8}}]},"71":{"line":1235,"type":"if","locations":[{"start":{"line":1235,"column":8},"end":{"line":1235,"column":8}},{"start":{"line":1235,"column":8},"end":{"line":1235,"column":8}}]},"72":{"line":1267,"type":"binary-expr","locations":[{"start":{"line":1267,"column":22},"end":{"line":1267,"column":26}},{"start":{"line":1267,"column":30},"end":{"line":1267,"column":58}}]},"73":{"line":1270,"type":"if","locations":[{"start":{"line":1270,"column":8},"end":{"line":1270,"column":8}},{"start":{"line":1270,"column":8},"end":{"line":1270,"column":8}}]},"74":{"line":1270,"type":"binary-expr","locations":[{"start":{"line":1270,"column":12},"end":{"line":1270,"column":19}},{"start":{"line":1270,"column":23},"end":{"line":1270,"column":40}},{"start":{"line":1270,"column":44},"end":{"line":1270,"column":65}}]}},"code":["(function () { YUI.add('widget-buttons', function (Y, NAME) {","","/**","Provides header/body/footer button support for Widgets that use the","`WidgetStdMod` extension.","","@module widget-buttons","@since 3.4.0","**/","","var YArray = Y.Array,"," YLang = Y.Lang,"," YObject = Y.Object,",""," ButtonPlugin = Y.Plugin.Button,"," Widget = Y.Widget,"," WidgetStdMod = Y.WidgetStdMod,",""," getClassName = Y.ClassNameManager.getClassName,"," isArray = YLang.isArray,"," isNumber = YLang.isNumber,"," isString = YLang.isString,"," isValue = YLang.isValue;","","// Utility to determine if an object is a Y.Node instance, even if it was","// created in a different YUI sandbox.","function isNode(node) {"," return !!node.getDOMNode;","}","","/**","Provides header/body/footer button support for Widgets that use the","`WidgetStdMod` extension.","","This Widget extension makes it easy to declaratively configure a widget's","buttons. It adds a `buttons` attribute along with button- accessor and mutator","methods. All button nodes have the `Y.Plugin.Button` plugin applied.","","This extension also includes `HTML_PARSER` support to seed a widget's `buttons`","from those which already exist in its DOM.","","@class WidgetButtons","@extensionfor Widget","@since 3.4.0","**/","function WidgetButtons() {"," // Require `Y.WidgetStdMod`."," if (!this._stdModNode) {"," Y.error('WidgetStdMod must be added to a Widget before WidgetButtons.');"," }",""," // Has to be setup before the `initializer()`."," this._buttonsHandles = {};","}","","WidgetButtons.ATTRS = {"," /**"," Collection containing a widget's buttons.",""," The collection is an Object which contains an Array of `Y.Node`s for every"," `WidgetStdMod` section (header, body, footer) which has one or more buttons."," All button nodes have the `Y.Plugin.Button` plugin applied.",""," This attribute is very flexible in the values it will accept. `buttons` can"," be specified as a single Array, or an Object of Arrays keyed to a particular"," section.",""," All specified values will be normalized to this type of structure:",""," {"," header: [...],"," footer: [...]"," }",""," A button can be specified as a `Y.Node`, config Object, or String name for a"," predefined button on the `BUTTONS` prototype property. When a config Object"," is provided, it will be merged with any defaults provided by a button with"," the same `name` defined on the `BUTTONS` property.",""," See `addButton()` for the detailed list of configuration properties.",""," For convenience, a widget's buttons will always persist and remain rendered"," after header/body/footer content updates. Buttons should be removed by"," updating this attribute or using the `removeButton()` method.",""," @example"," {"," // Uses predefined \"close\" button by string name."," header: ['close'],",""," footer: ["," {"," name : 'cancel',"," label : 'Cancel',"," action: 'hide'"," },",""," {"," name : 'okay',"," label : 'Okay',"," isDefault: true,",""," events: {"," click: function (e) {"," this.hide();"," }"," }"," }"," ]"," }",""," @attribute buttons"," @type Object"," @default {}"," @since 3.4.0"," **/"," buttons: {"," getter: '_getButtons',"," setter: '_setButtons',"," value : {}"," },",""," /**"," The current default button as configured through this widget's `buttons`.",""," A button can be configured as the default button in the following ways:",""," * As a config Object with an `isDefault` property:"," `{label: 'Okay', isDefault: true}`.",""," * As a Node with a `data-default` attribute:"," ``.",""," This attribute is **read-only**; anytime there are changes to this widget's"," `buttons`, the `defaultButton` will be updated if needed.",""," **Note:** If two or more buttons are configured to be the default button,"," the last one wins.",""," @attribute defaultButton"," @type Node"," @default null"," @readOnly"," @since 3.5.0"," **/"," defaultButton: {"," readOnly: true,"," value : null"," }","};","","/**","CSS classes used by `WidgetButtons`.","","@property CLASS_NAMES","@type Object","@static","@since 3.5.0","**/","WidgetButtons.CLASS_NAMES = {"," button : getClassName('button'),"," buttons: Widget.getClassName('buttons'),"," primary: getClassName('button', 'primary')","};","","WidgetButtons.HTML_PARSER = {"," buttons: function (srcNode) {"," return this._parseButtons(srcNode);"," }","};","","/**","The list of button configuration properties which are specific to","`WidgetButtons` and should not be passed to `Y.Plugin.Button.createNode()`.","","@property NON_BUTTON_NODE_CFG","@type Array","@static","@since 3.5.0","**/","WidgetButtons.NON_BUTTON_NODE_CFG = ["," 'action', 'classNames', 'context', 'events', 'isDefault', 'section'","];","","WidgetButtons.prototype = {"," // -- Public Properties ----------------------------------------------------",""," /**"," Collection of predefined buttons mapped by name -> config.",""," These button configurations will serve as defaults for any button added to a"," widget's buttons which have the same `name`.",""," See `addButton()` for a list of possible configuration values.",""," @property BUTTONS"," @type Object"," @default {}"," @see addButton()"," @since 3.5.0"," **/"," BUTTONS: {},",""," /**"," The HTML template to use when creating the node which wraps all buttons of a"," section. By default it will have the CSS class: \"yui3-widget-buttons\".",""," @property BUTTONS_TEMPLATE"," @type String"," @default \"\""," @since 3.5.0"," **/"," BUTTONS_TEMPLATE: '',",""," /**"," The default section to render buttons in when no section is specified.",""," @property DEFAULT_BUTTONS_SECTION"," @type String"," @default Y.WidgetStdMod.FOOTER"," @since 3.5.0"," **/"," DEFAULT_BUTTONS_SECTION: WidgetStdMod.FOOTER,",""," // -- Protected Properties -------------------------------------------------",""," /**"," A map of button node `_yuid` -> event-handle for all button nodes which were"," created by this widget.",""," @property _buttonsHandles"," @type Object"," @protected"," @since 3.5.0"," **/",""," /**"," A map of this widget's `buttons`, both name -> button and"," section:name -> button.",""," @property _buttonsMap"," @type Object"," @protected"," @since 3.5.0"," **/",""," /**"," Internal reference to this widget's default button.",""," @property _defaultButton"," @type Node"," @protected"," @since 3.5.0"," **/",""," // -- Lifecycle Methods ----------------------------------------------------",""," initializer: function () {"," // Creates button mappings and sets the `defaultButton`."," this._mapButtons(this.get('buttons'));"," this._updateDefaultButton();",""," // Bound with `Y.bind()` to make more extensible."," this.after({"," buttonsChange : Y.bind('_afterButtonsChange', this),"," defaultButtonChange: Y.bind('_afterDefaultButtonChange', this)"," });",""," Y.after(this._bindUIButtons, this, 'bindUI');"," Y.after(this._syncUIButtons, this, 'syncUI');"," },",""," destructor: function () {"," // Detach all event subscriptions this widget added to its `buttons`."," YObject.each(this._buttonsHandles, function (handle) {"," handle.detach();"," });",""," delete this._buttonsHandles;"," delete this._buttonsMap;"," delete this._defaultButton;"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Adds a button to this widget.",""," The new button node will have the `Y.Plugin.Button` plugin applied, be added"," to this widget's `buttons`, and rendered in the specified `section` at the"," specified `index` (or end of the section when no `index` is provided). If"," the section does not exist, it will be created.",""," This fires the `buttonsChange` event and adds the following properties to"," the event facade:",""," * `button`: The button node or config object to add.",""," * `section`: The `WidgetStdMod` section (header/body/footer) where the"," button will be added.",""," * `index`: The index at which the button will be in the section.",""," * `src`: \"add\"",""," **Note:** The `index` argument will be passed to the Array `splice()`"," method, therefore a negative value will insert the `button` that many items"," from the end. The `index` property on the `buttonsChange` event facade is"," the index at which the `button` was added.",""," @method addButton"," @param {Node|Object|String} button The button to add. This can be a `Y.Node`"," instance, config Object, or String name for a predefined button on the"," `BUTTONS` prototype property. When a config Object is provided, it will"," be merged with any defaults provided by any `srcNode` and/or a button"," with the same `name` defined on the `BUTTONS` property. The following"," are the possible configuration properties beyond what Node plugins"," accept by default:"," @param {Function|String} [button.action] The default handler that should"," be called when the button is clicked. A String name of a Function that"," exists on the `context` object can also be provided. **Note:**"," Specifying a set of `events` will override this setting."," @param {String|String[]} [button.classNames] Additional CSS classes to add"," to the button node."," @param {Object} [button.context=this] Context which any `events` or"," `action` should be called with. Defaults to `this`, the widget."," **Note:** `e.target` will access the button node in the event handlers."," @param {Boolean} [button.disabled=false] Whether the button should be"," disabled."," @param {String|Object} [button.events=\"click\"] Event name, or set of"," events and handlers to bind to the button node. **See:** `Y.Node.on()`,"," this value is passed as the first argument to `on()`."," @param {Boolean} [button.isDefault=false] Whether the button is the"," default button."," @param {String} [button.label] The visible text/value displayed in the"," button."," @param {String} [button.name] A name which can later be used to reference"," this button. If a button is defined on the `BUTTONS` property with this"," same name, its configuration properties will be merged in as defaults."," @param {String} [button.section] The `WidgetStdMod` section (header, body,"," footer) where the button should be added."," @param {Node} [button.srcNode] An existing Node to use for the button,"," default values will be seeded from this node, but are overriden by any"," values specified in the config object. By default a new <button>"," node will be created."," @param {String} [button.template] A specific template to use when creating"," a new button node (e.g. \"<a />\"). **Note:** Specifying a `srcNode`"," will overide this."," @param {String} [section=\"footer\"] The `WidgetStdMod` section"," (header/body/footer) where the button should be added. This takes"," precedence over the `button.section` configuration property."," @param {Number} [index] The index at which the button should be inserted. If"," not specified, the button will be added to the end of the section. This"," value is passed to the Array `splice()` method, therefore a negative"," value will insert the `button` that many items from the end."," @chainable"," @see Plugin.Button.createNode()"," @since 3.4.0"," **/"," addButton: function (button, section, index) {"," var buttons = this.get('buttons'),"," sectionButtons, atIndex;",""," // Makes sure we have the full config object."," if (!isNode(button)) {"," button = this._mergeButtonConfig(button);"," section || (section = button.section);"," }",""," section || (section = this.DEFAULT_BUTTONS_SECTION);"," sectionButtons = buttons[section] || (buttons[section] = []);"," isNumber(index) || (index = sectionButtons.length);",""," // Insert new button at the correct position."," sectionButtons.splice(index, 0, button);",""," // Determine the index at which the `button` now exists in the array."," atIndex = YArray.indexOf(sectionButtons, button);",""," this.set('buttons', buttons, {"," button : button,"," section: section,"," index : atIndex,"," src : 'add'"," });",""," return this;"," },",""," /**"," Returns a button node from this widget's `buttons`.",""," @method getButton"," @param {Number|String} name The string name or index of the button."," @param {String} [section=\"footer\"] The `WidgetStdMod` section"," (header/body/footer) where the button exists. Only applicable when"," looking for a button by numerical index, or by name but scoped to a"," particular section."," @return {Node} The button node."," @since 3.5.0"," **/"," getButton: function (name, section) {"," if (!isValue(name)) { return; }",""," var map = this._buttonsMap,"," buttons;",""," section || (section = this.DEFAULT_BUTTONS_SECTION);",""," // Supports `getButton(1, 'header')` signature."," if (isNumber(name)) {"," buttons = this.get('buttons');"," return buttons[section] && buttons[section][name];"," }",""," // Looks up button by name or section:name."," return arguments.length > 1 ? map[section + ':' + name] : map[name];"," },",""," /**"," Removes a button from this widget.",""," The button will be removed from this widget's `buttons` and its DOM. Any"," event subscriptions on the button which were created by this widget will be"," detached. If the content section becomes empty after removing the button"," node, then the section will also be removed.",""," This fires the `buttonsChange` event and adds the following properties to"," the event facade:",""," * `button`: The button node to remove.",""," * `section`: The `WidgetStdMod` section (header/body/footer) where the"," button should be removed from.",""," * `index`: The index at which the button exists in the section.",""," * `src`: \"remove\"",""," @method removeButton"," @param {Node|Number|String} button The button to remove. This can be a"," `Y.Node` instance, index, or String name of a button."," @param {String} [section=\"footer\"] The `WidgetStdMod` section"," (header/body/footer) where the button exists. Only applicable when"," removing a button by numerical index, or by name but scoped to a"," particular section."," @chainable"," @since 3.5.0"," **/"," removeButton: function (button, section) {"," if (!isValue(button)) { return this; }",""," var buttons = this.get('buttons'),"," index;",""," // Shortcut if `button` is already an index which is needed for slicing."," if (isNumber(button)) {"," section || (section = this.DEFAULT_BUTTONS_SECTION);"," index = button;"," button = buttons[section][index];"," } else {"," // Supports `button` being the string name."," if (isString(button)) {"," // `getButton()` is called this way because its behavior is"," // different based on the number of arguments."," button = this.getButton.apply(this, arguments);"," }",""," // Determines the `section` and `index` at which the button exists."," YObject.some(buttons, function (sectionButtons, currentSection) {"," index = YArray.indexOf(sectionButtons, button);",""," if (index > -1) {"," section = currentSection;"," return true;"," }"," });"," }",""," // Button was found at an appropriate index."," if (button && index > -1) {"," // Remove button from `section` array."," buttons[section].splice(index, 1);",""," this.set('buttons', buttons, {"," button : button,"," section: section,"," index : index,"," src : 'remove'"," });"," }",""," return this;"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Binds UI event listeners. This method is inserted via AOP, and will execute"," after `bindUI()`.",""," @method _bindUIButtons"," @protected"," @since 3.4.0"," **/"," _bindUIButtons: function () {"," // Event handlers are bound with `bind()` to make them more extensible."," var afterContentChange = Y.bind('_afterContentChangeButtons', this);",""," this.after({"," visibleChange : Y.bind('_afterVisibleChangeButtons', this),"," headerContentChange: afterContentChange,"," bodyContentChange : afterContentChange,"," footerContentChange: afterContentChange"," });"," },",""," /**"," Returns a button node based on the specified `button` node or configuration.",""," The button node will either be created via `Y.Plugin.Button.createNode()`,"," or when `button` is specified as a node already, it will by `plug()`ed with"," `Y.Plugin.Button`.",""," @method _createButton"," @param {Node|Object} button Button node or configuration object."," @return {Node} The button node."," @protected"," @since 3.5.0"," **/"," _createButton: function (button) {"," var config, buttonConfig, nonButtonNodeCfg,"," i, len, action, context, handle;",""," // Makes sure the exiting `Y.Node` instance is from this YUI sandbox and"," // is plugged with `Y.Plugin.Button`."," if (isNode(button)) {"," return Y.one(button.getDOMNode()).plug(ButtonPlugin);"," }",""," // Merge `button` config with defaults and back-compat."," config = Y.merge({"," context: this,"," events : 'click',"," label : button.value"," }, button);",""," buttonConfig = Y.merge(config);"," nonButtonNodeCfg = WidgetButtons.NON_BUTTON_NODE_CFG;",""," // Remove all non-button Node config props."," for (i = 0, len = nonButtonNodeCfg.length; i < len; i += 1) {"," delete buttonConfig[nonButtonNodeCfg[i]];"," }",""," // Create the button node using the button Node-only config."," button = ButtonPlugin.createNode(buttonConfig);",""," context = config.context;"," action = config.action;",""," // Supports `action` as a String name of a Function on the `context`"," // object."," if (isString(action)) {"," action = Y.bind(action, context);"," }",""," // Supports all types of crazy configs for event subscriptions and"," // stores a reference to the returned `EventHandle`."," handle = button.on(config.events, action, context);"," this._buttonsHandles[Y.stamp(button, true)] = handle;",""," // Tags the button with the configured `name` and `isDefault` settings."," button.setData('name', this._getButtonName(config));"," button.setData('default', this._getButtonDefault(config));",""," // Add any CSS classnames to the button node."," YArray.each(YArray(config.classNames), button.addClass, button);",""," return button;"," },",""," /**"," Returns the buttons container for the specified `section`, passing a truthy"," value for `create` will create the node if it does not already exist.",""," **Note:** It is up to the caller to properly insert the returned container"," node into the content section.",""," @method _getButtonContainer"," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @param {Boolean} create Whether the buttons container should be created if"," it does not already exist."," @return {Node} The buttons container node for the specified `section`."," @protected"," @see BUTTONS_TEMPLATE"," @since 3.5.0"," **/"," _getButtonContainer: function (section, create) {"," var sectionClassName = WidgetStdMod.SECTION_CLASS_NAMES[section],"," buttonsClassName = WidgetButtons.CLASS_NAMES.buttons,"," contentBox = this.get('contentBox'),"," containerSelector, container;",""," // Search for an existing buttons container within the section."," containerSelector = '.' + sectionClassName + ' .' + buttonsClassName;",""," // Search only inside the current widget"," contentBox.all(containerSelector).each(function(node, index) {"," var widget;",""," if (!container) {"," widget = Y.Widget.getByNode(node);",""," if (!widget || widget === this) {"," container = node;"," }"," }"," }, this);",""," // Create the `container` if it doesn't already exist."," if (!container && create) {"," container = Y.Node.create(this.BUTTONS_TEMPLATE);"," container.addClass(buttonsClassName);"," }",""," return container;"," },",""," /**"," Returns whether or not the specified `button` is configured to be the"," default button.",""," When a button node is specified, the button's `getData()` method will be"," used to determine if the button is configured to be the default. When a"," button config object is specified, the `isDefault` prop will determine"," whether the button is the default.",""," **Note:** `` is supported via the"," `button.getData('default')` API call.",""," @method _getButtonDefault"," @param {Node|Object} button The button node or configuration object."," @return {Boolean} Whether the button is configured to be the default button."," @protected"," @since 3.5.0"," **/"," _getButtonDefault: function (button) {"," var isDefault = isNode(button) ?"," button.getData('default') : button.isDefault;",""," if (isString(isDefault)) {"," return isDefault.toLowerCase() === 'true';"," }",""," return !!isDefault;"," },",""," /**"," Returns the name of the specified `button`.",""," When a button node is specified, the button's `getData('name')` method is"," preferred, but will fallback to `get('name')`, and the result will determine"," the button's name. When a button config object is specified, the `name` prop"," will determine the button's name.",""," **Note:** `` is supported via the"," `button.getData('name')` API call.",""," @method _getButtonName"," @param {Node|Object} button The button node or configuration object."," @return {String} The name of the button."," @protected"," @since 3.5.0"," **/"," _getButtonName: function (button) {"," var name;",""," if (isNode(button)) {"," name = button.getData('name') || button.get('name');"," } else {"," name = button && (button.name || button.type);"," }",""," return name;"," },",""," /**"," Getter for the `buttons` attribute. A copy of the `buttons` object is"," returned so the stored state cannot be modified by the callers of"," `get('buttons')`.",""," This will recreate a copy of the `buttons` object, and each section array"," (the button nodes are *not* copied/cloned.)",""," @method _getButtons"," @param {Object} buttons The widget's current `buttons` state."," @return {Object} A copy of the widget's current `buttons` state."," @protected"," @since 3.5.0"," **/"," _getButtons: function (buttons) {"," var buttonsCopy = {};",""," // Creates a new copy of the `buttons` object."," YObject.each(buttons, function (sectionButtons, section) {"," // Creates of copy of the array of button nodes."," buttonsCopy[section] = sectionButtons.concat();"," });",""," return buttonsCopy;"," },",""," /**"," Adds the specified `button` to the buttons map (both name -> button and"," section:name -> button), and sets the button as the default if it is"," configured as the default button.",""," **Note:** If two or more buttons are configured with the same `name` and/or"," configured to be the default button, the last one wins.",""," @method _mapButton"," @param {Node} button The button node to map."," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @protected"," @since 3.5.0"," **/"," _mapButton: function (button, section) {"," var map = this._buttonsMap,"," name = this._getButtonName(button),"," isDefault = this._getButtonDefault(button);",""," if (name) {"," // name -> button"," map[name] = button;",""," // section:name -> button"," map[section + ':' + name] = button;"," }",""," isDefault && (this._defaultButton = button);"," },",""," /**"," Adds the specified `buttons` to the buttons map (both name -> button and"," section:name -> button), and set the a button as the default if one is"," configured as the default button.",""," **Note:** This will clear all previous button mappings and null-out any"," previous default button! If two or more buttons are configured with the same"," `name` and/or configured to be the default button, the last one wins.",""," @method _mapButtons"," @param {Node[]} buttons The button nodes to map."," @protected"," @since 3.5.0"," **/"," _mapButtons: function (buttons) {"," this._buttonsMap = {};"," this._defaultButton = null;",""," YObject.each(buttons, function (sectionButtons, section) {"," var i, len;",""," for (i = 0, len = sectionButtons.length; i < len; i += 1) {"," this._mapButton(sectionButtons[i], section);"," }"," }, this);"," },",""," /**"," Returns a copy of the specified `config` object merged with any defaults"," provided by a `srcNode` and/or a predefined configuration for a button"," with the same `name` on the `BUTTONS` property.",""," @method _mergeButtonConfig"," @param {Object|String} config Button configuration object, or string name."," @return {Object} A copy of the button configuration object merged with any"," defaults."," @protected"," @since 3.5.0"," **/"," _mergeButtonConfig: function (config) {"," var buttonConfig, defConfig, name, button, tagName, label;",""," // Makes sure `config` is an Object and a copy of the specified value."," config = isString(config) ? {name: config} : Y.merge(config);",""," // Seeds default values from the button node, if there is one."," if (config.srcNode) {"," button = config.srcNode;"," tagName = button.get('tagName').toLowerCase();"," label = button.get(tagName === 'input' ? 'value' : 'text');",""," // Makes sure the button's current values override any defaults."," buttonConfig = {"," disabled : !!button.get('disabled'),"," isDefault: this._getButtonDefault(button),"," name : this._getButtonName(button)"," };",""," // Label should only be considered when not an empty string."," label && (buttonConfig.label = label);",""," // Merge `config` with `buttonConfig` values."," Y.mix(config, buttonConfig, false, null, 0, true);"," }",""," name = this._getButtonName(config);"," defConfig = this.BUTTONS && this.BUTTONS[name];",""," // Merge `config` with predefined default values."," if (defConfig) {"," Y.mix(config, defConfig, false, null, 0, true);"," }",""," return config;"," },",""," /**"," `HTML_PARSER` implementation for the `buttons` attribute.",""," **Note:** To determine a button node's name its `data-name` and `name`"," attributes are examined. Whether the button should be the default is"," determined by its `data-default` attribute.",""," @method _parseButtons"," @param {Node} srcNode This widget's srcNode to search for buttons."," @return {null|Object} `buttons` Config object parsed from this widget's DOM."," @protected"," @since 3.5.0"," **/"," _parseButtons: function (srcNode) {"," var buttonSelector = '.' + WidgetButtons.CLASS_NAMES.button,"," sections = ['header', 'body', 'footer'],"," buttonsConfig = null;",""," YArray.each(sections, function (section) {"," var container = this._getButtonContainer(section),"," buttons = container && container.all(buttonSelector),"," sectionButtons;",""," if (!buttons || buttons.isEmpty()) { return; }",""," sectionButtons = [];",""," // Creates a button config object for every button node found and"," // adds it to the section. This way each button configuration can be"," // merged with any defaults provided by predefined `BUTTONS`."," buttons.each(function (button) {"," sectionButtons.push({srcNode: button});"," });",""," buttonsConfig || (buttonsConfig = {});"," buttonsConfig[section] = sectionButtons;"," }, this);",""," return buttonsConfig;"," },",""," /**"," Setter for the `buttons` attribute. This processes the specified `config`"," and returns a new `buttons` object which is stored as the new state; leaving"," the original, specified `config` unmodified.",""," The button nodes will either be created via `Y.Plugin.Button.createNode()`,"," or when a button is already a Node already, it will by `plug()`ed with"," `Y.Plugin.Button`.",""," @method _setButtons"," @param {Array|Object} config The `buttons` configuration to process."," @return {Object} The processed `buttons` object which represents the new"," state."," @protected"," @since 3.5.0"," **/"," _setButtons: function (config) {"," var defSection = this.DEFAULT_BUTTONS_SECTION,"," buttons = {};",""," function processButtons(buttonConfigs, currentSection) {"," if (!isArray(buttonConfigs)) { return; }",""," var i, len, button, section;",""," for (i = 0, len = buttonConfigs.length; i < len; i += 1) {"," button = buttonConfigs[i];"," section = currentSection;",""," if (!isNode(button)) {"," button = this._mergeButtonConfig(button);"," section || (section = button.section);"," }",""," // Always passes through `_createButton()` to make sure the node"," // is decorated as a button."," button = this._createButton(button);",""," // Use provided `section` or fallback to the default section."," section || (section = defSection);",""," // Add button to the array of buttons for the specified section."," (buttons[section] || (buttons[section] = [])).push(button);"," }"," }",""," // Handle `config` being either an Array or Object of Arrays."," if (isArray(config)) {"," processButtons.call(this, config);"," } else {"," YObject.each(config, processButtons, this);"," }",""," return buttons;"," },",""," /**"," Syncs this widget's current button-related state to its DOM. This method is"," inserted via AOP, and will execute after `syncUI()`.",""," @method _syncUIButtons"," @protected"," @since 3.4.0"," **/"," _syncUIButtons: function () {"," this._uiSetButtons(this.get('buttons'));"," this._uiSetDefaultButton(this.get('defaultButton'));"," this._uiSetVisibleButtons(this.get('visible'));"," },",""," /**"," Inserts the specified `button` node into this widget's DOM at the specified"," `section` and `index` and updates the section content.",""," The section and button container nodes will be created if they do not"," already exist.",""," @method _uiInsertButton"," @param {Node} button The button node to insert into this widget's DOM."," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @param {Number} index Index at which the `button` should be positioned."," @protected"," @since 3.5.0"," **/"," _uiInsertButton: function (button, section, index) {"," var buttonsClassName = WidgetButtons.CLASS_NAMES.button,"," buttonContainer = this._getButtonContainer(section, true),"," sectionButtons = buttonContainer.all('.' + buttonsClassName);",""," // Inserts the button node at the correct index."," buttonContainer.insertBefore(button, sectionButtons.item(index));",""," // Adds the button container to the section content."," this.setStdModContent(section, buttonContainer, 'after');"," },",""," /**"," Removes the button node from this widget's DOM and detaches any event"," subscriptions on the button that were created by this widget. The section"," content will be updated unless `{preserveContent: true}` is passed in the"," `options`.",""," By default the button container node will be removed when this removes the"," last button of the specified `section`; and if no other content remains in"," the section node, it will also be removed.",""," @method _uiRemoveButton"," @param {Node} button The button to remove and destroy."," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @param {Object} [options] Additional options."," @param {Boolean} [options.preserveContent=false] Whether the section"," content should be updated."," @protected"," @since 3.5.0"," **/"," _uiRemoveButton: function (button, section, options) {"," var yuid = Y.stamp(button, this),"," handles = this._buttonsHandles,"," handle = handles[yuid],"," buttonContainer, buttonClassName;",""," if (handle) {"," handle.detach();"," }",""," delete handles[yuid];",""," button.remove();",""," options || (options = {});",""," // Remove the button container and section nodes if needed."," if (!options.preserveContent) {"," buttonContainer = this._getButtonContainer(section);"," buttonClassName = WidgetButtons.CLASS_NAMES.button;",""," // Only matters if we have a button container which is empty."," if (buttonContainer &&"," buttonContainer.all('.' + buttonClassName).isEmpty()) {",""," buttonContainer.remove();"," this._updateContentButtons(section);"," }"," }"," },",""," /**"," Sets the current `buttons` state to this widget's DOM by rendering the"," specified collection of `buttons` and updates the contents of each section"," as needed.",""," Button nodes which already exist in the DOM will remain intact, or will be"," moved if they should be in a new position. Old button nodes which are no"," longer represented in the specified `buttons` collection will be removed,"," and any event subscriptions on the button which were created by this widget"," will be detached.",""," If the button nodes in this widget's DOM actually change, then each content"," section will be updated (or removed) appropriately.",""," @method _uiSetButtons"," @param {Object} buttons The current `buttons` state to visually represent."," @protected"," @since 3.5.0"," **/"," _uiSetButtons: function (buttons) {"," var buttonClassName = WidgetButtons.CLASS_NAMES.button,"," sections = ['header', 'body', 'footer'];",""," YArray.each(sections, function (section) {"," var sectionButtons = buttons[section] || [],"," numButtons = sectionButtons.length,"," buttonContainer = this._getButtonContainer(section, numButtons),"," buttonsUpdated = false,"," oldNodes, i, button, buttonIndex;",""," // When there's no button container, there are no new buttons or old"," // buttons that we have to deal with for this section."," if (!buttonContainer) { return; }",""," oldNodes = buttonContainer.all('.' + buttonClassName);",""," for (i = 0; i < numButtons; i += 1) {"," button = sectionButtons[i];"," buttonIndex = oldNodes.indexOf(button);",""," // Buttons already rendered in the Widget should remain there or"," // moved to their new index. New buttons will be added to the"," // current `buttonContainer`."," if (buttonIndex > -1) {"," // Remove button from existing buttons nodeList since its in"," // the DOM already."," oldNodes.splice(buttonIndex, 1);",""," // Check that the button is at the right position, if not,"," // move it to its new position."," if (buttonIndex !== i) {"," // Using `i + 1` because the button should be at index"," // `i`; it's inserted before the node which comes after."," buttonContainer.insertBefore(button, i + 1);"," buttonsUpdated = true;"," }"," } else {"," buttonContainer.appendChild(button);"," buttonsUpdated = true;"," }"," }",""," // Safely removes the old button nodes which are no longer part of"," // this widget's `buttons`."," oldNodes.each(function (button) {"," this._uiRemoveButton(button, section, {preserveContent: true});"," buttonsUpdated = true;"," }, this);",""," // Remove leftover empty button containers and updated the StdMod"," // content area."," if (numButtons === 0) {"," buttonContainer.remove();"," this._updateContentButtons(section);"," return;"," }",""," // Adds the button container to the section content."," if (buttonsUpdated) {"," this.setStdModContent(section, buttonContainer, 'after');"," }"," }, this);"," },",""," /**"," Adds the \"yui3-button-primary\" CSS class to the new `defaultButton` and"," removes it from the old default button.",""," @method _uiSetDefaultButton"," @param {Node} newButton The new `defaultButton`."," @param {Node} oldButton The old `defaultButton`."," @protected"," @since 3.5.0"," **/"," _uiSetDefaultButton: function (newButton, oldButton) {"," var primaryClassName = WidgetButtons.CLASS_NAMES.primary;",""," if (newButton) { newButton.addClass(primaryClassName); }"," if (oldButton) { oldButton.removeClass(primaryClassName); }"," },",""," /**"," Focuses this widget's `defaultButton` if there is one and this widget is"," visible.",""," @method _uiSetVisibleButtons"," @param {Boolean} visible Whether this widget is visible."," @protected"," @since 3.5.0"," **/"," _uiSetVisibleButtons: function (visible) {"," if (!visible) { return; }",""," var defaultButton = this.get('defaultButton');"," if (defaultButton) {"," defaultButton.focus();"," }"," },",""," /**"," Removes the specified `button` from the buttons map (both name -> button and"," section:name -> button), and nulls-out the `defaultButton` if it is"," currently the default button.",""," @method _unMapButton"," @param {Node} button The button node to remove from the buttons map."," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @protected"," @since 3.5.0"," **/"," _unMapButton: function (button, section) {"," var map = this._buttonsMap,"," name = this._getButtonName(button),"," sectionName;",""," // Only delete the map entry if the specified `button` is mapped to it."," if (name) {"," // name -> button"," if (map[name] === button) {"," delete map[name];"," }",""," // section:name -> button"," sectionName = section + ':' + name;"," if (map[sectionName] === button) {"," delete map[sectionName];"," }"," }",""," // Clear the default button if its the specified `button`."," if (this._defaultButton === button) {"," this._defaultButton = null;"," }"," },",""," /**"," Updates the `defaultButton` attribute if it needs to be updated by comparing"," its current value with the protected `_defaultButton` property.",""," @method _updateDefaultButton"," @protected"," @since 3.5.0"," **/"," _updateDefaultButton: function () {"," var defaultButton = this._defaultButton;",""," if (this.get('defaultButton') !== defaultButton) {"," this._set('defaultButton', defaultButton);"," }"," },",""," /**"," Updates the content attribute which corresponds to the specified `section`.",""," The method updates the section's content to its current `childNodes`"," (text and/or HTMLElement), or will null-out its contents if the section is"," empty. It also specifies a `src` of `buttons` on the change event facade.",""," @method _updateContentButtons"," @param {String} section The `WidgetStdMod` section (header/body/footer) to"," update."," @protected"," @since 3.5.0"," **/"," _updateContentButtons: function (section) {"," // `childNodes` return text nodes and HTMLElements."," var sectionContent = this.getStdModNode(section).get('childNodes');",""," // Updates the section to its current contents, or null if it is empty."," this.set(section + 'Content', sectionContent.isEmpty() ? null :"," sectionContent, {src: 'buttons'});"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles this widget's `buttonsChange` event which fires anytime the"," `buttons` attribute is modified.",""," **Note:** This method special-cases the `buttons` modifications caused by"," `addButton()` and `removeButton()`, both of which set the `src` property on"," the event facade to \"add\" and \"remove\" respectively.",""," @method _afterButtonsChange"," @param {EventFacade} e"," @protected"," @since 3.4.0"," **/"," _afterButtonsChange: function (e) {"," var buttons = e.newVal,"," section = e.section,"," index = e.index,"," src = e.src,"," button;",""," // Special cases `addButton()` to only set and insert the new button."," if (src === 'add') {"," // Make sure we have the button node."," button = buttons[section][index];",""," this._mapButton(button, section);"," this._updateDefaultButton();"," this._uiInsertButton(button, section, index);",""," return;"," }",""," // Special cases `removeButton()` to only remove the specified button."," if (src === 'remove') {"," // Button node already exists on the event facade."," button = e.button;",""," this._unMapButton(button, section);"," this._updateDefaultButton();"," this._uiRemoveButton(button, section);",""," return;"," }",""," this._mapButtons(buttons);"," this._updateDefaultButton();"," this._uiSetButtons(buttons);"," },",""," /**"," Handles this widget's `headerContentChange`, `bodyContentChange`,"," `footerContentChange` events by making sure the `buttons` remain rendered"," after changes to the content areas.",""," These events are very chatty, so extra caution is taken to avoid doing extra"," work or getting into an infinite loop.",""," @method _afterContentChangeButtons"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterContentChangeButtons: function (e) {"," var src = e.src,"," pos = e.stdModPosition,"," replace = !pos || pos === WidgetStdMod.REPLACE;",""," // Only do work when absolutely necessary."," if (replace && src !== 'buttons' && src !== Widget.UI_SRC) {"," this._uiSetButtons(this.get('buttons'));"," }"," },",""," /**"," Handles this widget's `defaultButtonChange` event by adding the"," \"yui3-button-primary\" CSS class to the new `defaultButton` and removing it"," from the old default button.",""," @method _afterDefaultButtonChange"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterDefaultButtonChange: function (e) {"," this._uiSetDefaultButton(e.newVal, e.prevVal);"," },",""," /**"," Handles this widget's `visibleChange` event by focusing the `defaultButton`"," if there is one.",""," @method _afterVisibleChangeButtons"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterVisibleChangeButtons: function (e) {"," this._uiSetVisibleButtons(e.newVal);"," }","};","","Y.WidgetButtons = WidgetButtons;","","","}, '@VERSION@', {\"requires\": [\"button-plugin\", \"cssbutton\", \"widget-stdmod\"]});","","}());"]}; + __coverage__['build/widget-buttons/widget-buttons.js'] = {"path":"build/widget-buttons/widget-buttons.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"138":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"164":0,"165":0,"166":0,"167":0,"168":0,"169":0,"170":0,"171":0,"172":0,"173":0,"174":0,"175":0,"176":0,"177":0,"178":0,"179":0,"180":0,"181":0,"182":0,"183":0,"184":0,"185":0,"186":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"193":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"200":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"207":0,"208":0,"209":0,"210":0,"211":0,"212":0,"213":0,"214":0,"215":0,"216":0,"217":0,"218":0,"219":0,"220":0,"221":0,"222":0,"223":0,"224":0,"225":0,"226":0,"227":0,"228":0,"229":0,"230":0,"231":0,"232":0,"233":0,"234":0,"235":0,"236":0,"237":0,"238":0,"239":0,"240":0,"241":0,"242":0,"243":0,"244":0,"245":0,"246":0,"247":0,"248":0,"249":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0,0],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0,0],"37":[0,0],"38":[0,0],"39":[0,0],"40":[0,0],"41":[0,0],"42":[0,0],"43":[0,0],"44":[0,0],"45":[0,0],"46":[0,0],"47":[0,0],"48":[0,0],"49":[0,0],"50":[0,0],"51":[0,0],"52":[0,0],"53":[0,0],"54":[0,0],"55":[0,0],"56":[0,0],"57":[0,0],"58":[0,0],"59":[0,0],"60":[0,0],"61":[0,0],"62":[0,0],"63":[0,0],"64":[0,0],"65":[0,0],"66":[0,0],"67":[0,0],"68":[0,0],"69":[0,0],"70":[0,0],"71":[0,0],"72":[0,0],"73":[0,0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":45}}},"2":{"name":"isNode","line":27,"loc":{"start":{"line":27,"column":0},"end":{"line":27,"column":22}}},"3":{"name":"WidgetButtons","line":46,"loc":{"start":{"line":46,"column":0},"end":{"line":46,"column":25}}},"4":{"name":"(anonymous_4)","line":167,"loc":{"start":{"line":167,"column":13},"end":{"line":167,"column":32}}},"5":{"name":"(anonymous_5)","line":258,"loc":{"start":{"line":258,"column":17},"end":{"line":258,"column":29}}},"6":{"name":"(anonymous_6)","line":273,"loc":{"start":{"line":273,"column":16},"end":{"line":273,"column":28}}},"7":{"name":"(anonymous_7)","line":275,"loc":{"start":{"line":275,"column":43},"end":{"line":275,"column":61}}},"8":{"name":"(anonymous_8)","line":360,"loc":{"start":{"line":360,"column":15},"end":{"line":360,"column":49}}},"9":{"name":"(anonymous_9)","line":402,"loc":{"start":{"line":402,"column":15},"end":{"line":402,"column":40}}},"10":{"name":"(anonymous_10)","line":450,"loc":{"start":{"line":450,"column":18},"end":{"line":450,"column":45}}},"11":{"name":"(anonymous_11)","line":470,"loc":{"start":{"line":470,"column":34},"end":{"line":470,"column":76}}},"12":{"name":"(anonymous_12)","line":506,"loc":{"start":{"line":506,"column":20},"end":{"line":506,"column":32}}},"13":{"name":"(anonymous_13)","line":531,"loc":{"start":{"line":531,"column":19},"end":{"line":531,"column":37}}},"14":{"name":"(anonymous_14)","line":599,"loc":{"start":{"line":599,"column":25},"end":{"line":599,"column":52}}},"15":{"name":"(anonymous_15)","line":609,"loc":{"start":{"line":609,"column":47},"end":{"line":609,"column":61}}},"16":{"name":"(anonymous_16)","line":646,"loc":{"start":{"line":646,"column":23},"end":{"line":646,"column":41}}},"17":{"name":"(anonymous_17)","line":674,"loc":{"start":{"line":674,"column":20},"end":{"line":674,"column":38}}},"18":{"name":"(anonymous_18)","line":700,"loc":{"start":{"line":700,"column":17},"end":{"line":700,"column":36}}},"19":{"name":"(anonymous_19)","line":704,"loc":{"start":{"line":704,"column":30},"end":{"line":704,"column":65}}},"20":{"name":"(anonymous_20)","line":726,"loc":{"start":{"line":726,"column":16},"end":{"line":726,"column":43}}},"21":{"name":"(anonymous_21)","line":756,"loc":{"start":{"line":756,"column":17},"end":{"line":756,"column":36}}},"22":{"name":"(anonymous_22)","line":760,"loc":{"start":{"line":760,"column":30},"end":{"line":760,"column":65}}},"23":{"name":"(anonymous_23)","line":781,"loc":{"start":{"line":781,"column":24},"end":{"line":781,"column":42}}},"24":{"name":"(anonymous_24)","line":831,"loc":{"start":{"line":831,"column":19},"end":{"line":831,"column":38}}},"25":{"name":"(anonymous_25)","line":836,"loc":{"start":{"line":836,"column":30},"end":{"line":836,"column":49}}},"26":{"name":"(anonymous_26)","line":848,"loc":{"start":{"line":848,"column":25},"end":{"line":848,"column":43}}},"27":{"name":"(anonymous_27)","line":875,"loc":{"start":{"line":875,"column":17},"end":{"line":875,"column":35}}},"28":{"name":"processButtons","line":879,"loc":{"start":{"line":879,"column":8},"end":{"line":879,"column":63}}},"29":{"name":"(anonymous_29)","line":923,"loc":{"start":{"line":923,"column":20},"end":{"line":923,"column":32}}},"30":{"name":"(anonymous_30)","line":943,"loc":{"start":{"line":943,"column":21},"end":{"line":943,"column":55}}},"31":{"name":"(anonymous_31)","line":974,"loc":{"start":{"line":974,"column":21},"end":{"line":974,"column":57}}},"32":{"name":"(anonymous_32)","line":1024,"loc":{"start":{"line":1024,"column":19},"end":{"line":1024,"column":38}}},"33":{"name":"(anonymous_33)","line":1028,"loc":{"start":{"line":1028,"column":30},"end":{"line":1028,"column":49}}},"34":{"name":"(anonymous_34)","line":1069,"loc":{"start":{"line":1069,"column":26},"end":{"line":1069,"column":44}}},"35":{"name":"(anonymous_35)","line":1099,"loc":{"start":{"line":1099,"column":25},"end":{"line":1099,"column":57}}},"36":{"name":"(anonymous_36)","line":1115,"loc":{"start":{"line":1115,"column":26},"end":{"line":1115,"column":45}}},"37":{"name":"(anonymous_37)","line":1135,"loc":{"start":{"line":1135,"column":18},"end":{"line":1135,"column":45}}},"38":{"name":"(anonymous_38)","line":1168,"loc":{"start":{"line":1168,"column":26},"end":{"line":1168,"column":38}}},"39":{"name":"(anonymous_39)","line":1189,"loc":{"start":{"line":1189,"column":27},"end":{"line":1189,"column":46}}},"40":{"name":"(anonymous_40)","line":1213,"loc":{"start":{"line":1213,"column":25},"end":{"line":1213,"column":38}}},"41":{"name":"(anonymous_41)","line":1262,"loc":{"start":{"line":1262,"column":32},"end":{"line":1262,"column":45}}},"42":{"name":"(anonymous_42)","line":1283,"loc":{"start":{"line":1283,"column":31},"end":{"line":1283,"column":44}}},"43":{"name":"(anonymous_43)","line":1296,"loc":{"start":{"line":1296,"column":32},"end":{"line":1296,"column":45}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1304,"column":79}},"2":{"start":{"line":11,"column":0},"end":{"line":23,"column":33}},"3":{"start":{"line":27,"column":0},"end":{"line":29,"column":1}},"4":{"start":{"line":28,"column":4},"end":{"line":28,"column":29}},"5":{"start":{"line":46,"column":0},"end":{"line":54,"column":1}},"6":{"start":{"line":48,"column":4},"end":{"line":50,"column":5}},"7":{"start":{"line":49,"column":8},"end":{"line":49,"column":80}},"8":{"start":{"line":53,"column":4},"end":{"line":53,"column":30}},"9":{"start":{"line":56,"column":0},"end":{"line":150,"column":2}},"10":{"start":{"line":160,"column":0},"end":{"line":164,"column":2}},"11":{"start":{"line":166,"column":0},"end":{"line":170,"column":2}},"12":{"start":{"line":168,"column":8},"end":{"line":168,"column":43}},"13":{"start":{"line":181,"column":0},"end":{"line":183,"column":2}},"14":{"start":{"line":185,"column":0},"end":{"line":1299,"column":2}},"15":{"start":{"line":260,"column":8},"end":{"line":260,"column":46}},"16":{"start":{"line":261,"column":8},"end":{"line":261,"column":36}},"17":{"start":{"line":264,"column":8},"end":{"line":267,"column":11}},"18":{"start":{"line":269,"column":8},"end":{"line":269,"column":53}},"19":{"start":{"line":270,"column":8},"end":{"line":270,"column":53}},"20":{"start":{"line":275,"column":8},"end":{"line":277,"column":11}},"21":{"start":{"line":276,"column":12},"end":{"line":276,"column":28}},"22":{"start":{"line":279,"column":8},"end":{"line":279,"column":36}},"23":{"start":{"line":280,"column":8},"end":{"line":280,"column":32}},"24":{"start":{"line":281,"column":8},"end":{"line":281,"column":35}},"25":{"start":{"line":361,"column":8},"end":{"line":362,"column":36}},"26":{"start":{"line":365,"column":8},"end":{"line":368,"column":9}},"27":{"start":{"line":366,"column":12},"end":{"line":366,"column":53}},"28":{"start":{"line":367,"column":12},"end":{"line":367,"column":50}},"29":{"start":{"line":370,"column":8},"end":{"line":370,"column":60}},"30":{"start":{"line":371,"column":8},"end":{"line":371,"column":69}},"31":{"start":{"line":372,"column":8},"end":{"line":372,"column":59}},"32":{"start":{"line":375,"column":8},"end":{"line":375,"column":48}},"33":{"start":{"line":378,"column":8},"end":{"line":378,"column":57}},"34":{"start":{"line":380,"column":8},"end":{"line":385,"column":11}},"35":{"start":{"line":387,"column":8},"end":{"line":387,"column":20}},"36":{"start":{"line":403,"column":8},"end":{"line":403,"column":39}},"37":{"start":{"line":403,"column":30},"end":{"line":403,"column":37}},"38":{"start":{"line":405,"column":8},"end":{"line":406,"column":20}},"39":{"start":{"line":408,"column":8},"end":{"line":408,"column":60}},"40":{"start":{"line":411,"column":8},"end":{"line":414,"column":9}},"41":{"start":{"line":412,"column":12},"end":{"line":412,"column":42}},"42":{"start":{"line":413,"column":12},"end":{"line":413,"column":62}},"43":{"start":{"line":417,"column":8},"end":{"line":417,"column":76}},"44":{"start":{"line":451,"column":8},"end":{"line":451,"column":46}},"45":{"start":{"line":451,"column":32},"end":{"line":451,"column":44}},"46":{"start":{"line":453,"column":8},"end":{"line":454,"column":18}},"47":{"start":{"line":457,"column":8},"end":{"line":478,"column":9}},"48":{"start":{"line":458,"column":12},"end":{"line":458,"column":64}},"49":{"start":{"line":459,"column":12},"end":{"line":459,"column":28}},"50":{"start":{"line":460,"column":12},"end":{"line":460,"column":45}},"51":{"start":{"line":463,"column":12},"end":{"line":467,"column":13}},"52":{"start":{"line":466,"column":16},"end":{"line":466,"column":63}},"53":{"start":{"line":470,"column":12},"end":{"line":477,"column":15}},"54":{"start":{"line":471,"column":16},"end":{"line":471,"column":63}},"55":{"start":{"line":473,"column":16},"end":{"line":476,"column":17}},"56":{"start":{"line":474,"column":20},"end":{"line":474,"column":45}},"57":{"start":{"line":475,"column":20},"end":{"line":475,"column":32}},"58":{"start":{"line":481,"column":8},"end":{"line":491,"column":9}},"59":{"start":{"line":483,"column":12},"end":{"line":483,"column":46}},"60":{"start":{"line":485,"column":12},"end":{"line":490,"column":15}},"61":{"start":{"line":493,"column":8},"end":{"line":493,"column":20}},"62":{"start":{"line":508,"column":8},"end":{"line":508,"column":76}},"63":{"start":{"line":510,"column":8},"end":{"line":515,"column":11}},"64":{"start":{"line":532,"column":8},"end":{"line":533,"column":44}},"65":{"start":{"line":537,"column":8},"end":{"line":539,"column":9}},"66":{"start":{"line":538,"column":12},"end":{"line":538,"column":65}},"67":{"start":{"line":542,"column":8},"end":{"line":546,"column":19}},"68":{"start":{"line":548,"column":8},"end":{"line":548,"column":43}},"69":{"start":{"line":549,"column":8},"end":{"line":549,"column":61}},"70":{"start":{"line":552,"column":8},"end":{"line":554,"column":9}},"71":{"start":{"line":553,"column":12},"end":{"line":553,"column":53}},"72":{"start":{"line":557,"column":8},"end":{"line":557,"column":55}},"73":{"start":{"line":559,"column":8},"end":{"line":559,"column":33}},"74":{"start":{"line":560,"column":8},"end":{"line":560,"column":32}},"75":{"start":{"line":564,"column":8},"end":{"line":566,"column":9}},"76":{"start":{"line":565,"column":12},"end":{"line":565,"column":45}},"77":{"start":{"line":570,"column":8},"end":{"line":570,"column":59}},"78":{"start":{"line":571,"column":8},"end":{"line":571,"column":61}},"79":{"start":{"line":574,"column":8},"end":{"line":574,"column":60}},"80":{"start":{"line":575,"column":8},"end":{"line":575,"column":66}},"81":{"start":{"line":578,"column":8},"end":{"line":578,"column":72}},"82":{"start":{"line":580,"column":8},"end":{"line":580,"column":22}},"83":{"start":{"line":600,"column":8},"end":{"line":603,"column":41}},"84":{"start":{"line":606,"column":8},"end":{"line":606,"column":77}},"85":{"start":{"line":609,"column":8},"end":{"line":617,"column":17}},"86":{"start":{"line":610,"column":12},"end":{"line":611,"column":55}},"87":{"start":{"line":613,"column":12},"end":{"line":615,"column":13}},"88":{"start":{"line":614,"column":16},"end":{"line":614,"column":33}},"89":{"start":{"line":616,"column":12},"end":{"line":616,"column":29}},"90":{"start":{"line":620,"column":8},"end":{"line":623,"column":9}},"91":{"start":{"line":621,"column":12},"end":{"line":621,"column":61}},"92":{"start":{"line":622,"column":12},"end":{"line":622,"column":49}},"93":{"start":{"line":625,"column":8},"end":{"line":625,"column":25}},"94":{"start":{"line":647,"column":8},"end":{"line":648,"column":61}},"95":{"start":{"line":650,"column":8},"end":{"line":652,"column":9}},"96":{"start":{"line":651,"column":12},"end":{"line":651,"column":54}},"97":{"start":{"line":654,"column":8},"end":{"line":654,"column":27}},"98":{"start":{"line":675,"column":8},"end":{"line":675,"column":17}},"99":{"start":{"line":677,"column":8},"end":{"line":681,"column":9}},"100":{"start":{"line":678,"column":12},"end":{"line":678,"column":64}},"101":{"start":{"line":680,"column":12},"end":{"line":680,"column":58}},"102":{"start":{"line":683,"column":8},"end":{"line":683,"column":20}},"103":{"start":{"line":701,"column":8},"end":{"line":701,"column":29}},"104":{"start":{"line":704,"column":8},"end":{"line":707,"column":11}},"105":{"start":{"line":706,"column":12},"end":{"line":706,"column":59}},"106":{"start":{"line":709,"column":8},"end":{"line":709,"column":27}},"107":{"start":{"line":727,"column":8},"end":{"line":729,"column":55}},"108":{"start":{"line":731,"column":8},"end":{"line":737,"column":9}},"109":{"start":{"line":733,"column":12},"end":{"line":733,"column":31}},"110":{"start":{"line":736,"column":12},"end":{"line":736,"column":47}},"111":{"start":{"line":739,"column":8},"end":{"line":739,"column":52}},"112":{"start":{"line":757,"column":8},"end":{"line":757,"column":33}},"113":{"start":{"line":758,"column":8},"end":{"line":758,"column":35}},"114":{"start":{"line":760,"column":8},"end":{"line":766,"column":17}},"115":{"start":{"line":761,"column":12},"end":{"line":761,"column":23}},"116":{"start":{"line":763,"column":12},"end":{"line":765,"column":13}},"117":{"start":{"line":764,"column":16},"end":{"line":764,"column":60}},"118":{"start":{"line":782,"column":8},"end":{"line":782,"column":66}},"119":{"start":{"line":785,"column":8},"end":{"line":785,"column":69}},"120":{"start":{"line":788,"column":8},"end":{"line":805,"column":9}},"121":{"start":{"line":789,"column":12},"end":{"line":789,"column":37}},"122":{"start":{"line":790,"column":12},"end":{"line":790,"column":58}},"123":{"start":{"line":791,"column":12},"end":{"line":791,"column":73}},"124":{"start":{"line":794,"column":12},"end":{"line":798,"column":14}},"125":{"start":{"line":801,"column":12},"end":{"line":801,"column":50}},"126":{"start":{"line":804,"column":12},"end":{"line":804,"column":62}},"127":{"start":{"line":807,"column":8},"end":{"line":807,"column":48}},"128":{"start":{"line":808,"column":8},"end":{"line":808,"column":55}},"129":{"start":{"line":811,"column":8},"end":{"line":813,"column":9}},"130":{"start":{"line":812,"column":12},"end":{"line":812,"column":59}},"131":{"start":{"line":815,"column":8},"end":{"line":815,"column":22}},"132":{"start":{"line":832,"column":8},"end":{"line":834,"column":34}},"133":{"start":{"line":836,"column":8},"end":{"line":854,"column":17}},"134":{"start":{"line":837,"column":12},"end":{"line":839,"column":31}},"135":{"start":{"line":841,"column":12},"end":{"line":841,"column":58}},"136":{"start":{"line":841,"column":49},"end":{"line":841,"column":56}},"137":{"start":{"line":843,"column":12},"end":{"line":843,"column":32}},"138":{"start":{"line":848,"column":12},"end":{"line":850,"column":15}},"139":{"start":{"line":849,"column":16},"end":{"line":849,"column":55}},"140":{"start":{"line":852,"column":12},"end":{"line":852,"column":50}},"141":{"start":{"line":853,"column":12},"end":{"line":853,"column":52}},"142":{"start":{"line":856,"column":8},"end":{"line":856,"column":29}},"143":{"start":{"line":876,"column":8},"end":{"line":877,"column":28}},"144":{"start":{"line":879,"column":8},"end":{"line":903,"column":9}},"145":{"start":{"line":880,"column":12},"end":{"line":880,"column":52}},"146":{"start":{"line":880,"column":43},"end":{"line":880,"column":50}},"147":{"start":{"line":882,"column":12},"end":{"line":882,"column":40}},"148":{"start":{"line":884,"column":12},"end":{"line":902,"column":13}},"149":{"start":{"line":885,"column":16},"end":{"line":885,"column":43}},"150":{"start":{"line":886,"column":16},"end":{"line":886,"column":41}},"151":{"start":{"line":888,"column":16},"end":{"line":891,"column":17}},"152":{"start":{"line":889,"column":20},"end":{"line":889,"column":61}},"153":{"start":{"line":890,"column":20},"end":{"line":890,"column":58}},"154":{"start":{"line":895,"column":16},"end":{"line":895,"column":52}},"155":{"start":{"line":898,"column":16},"end":{"line":898,"column":50}},"156":{"start":{"line":901,"column":16},"end":{"line":901,"column":75}},"157":{"start":{"line":906,"column":8},"end":{"line":910,"column":9}},"158":{"start":{"line":907,"column":12},"end":{"line":907,"column":46}},"159":{"start":{"line":909,"column":12},"end":{"line":909,"column":55}},"160":{"start":{"line":912,"column":8},"end":{"line":912,"column":23}},"161":{"start":{"line":924,"column":8},"end":{"line":924,"column":48}},"162":{"start":{"line":925,"column":8},"end":{"line":925,"column":60}},"163":{"start":{"line":926,"column":8},"end":{"line":926,"column":55}},"164":{"start":{"line":944,"column":8},"end":{"line":946,"column":75}},"165":{"start":{"line":949,"column":8},"end":{"line":949,"column":73}},"166":{"start":{"line":952,"column":8},"end":{"line":952,"column":65}},"167":{"start":{"line":975,"column":8},"end":{"line":978,"column":45}},"168":{"start":{"line":980,"column":8},"end":{"line":982,"column":9}},"169":{"start":{"line":981,"column":12},"end":{"line":981,"column":28}},"170":{"start":{"line":984,"column":8},"end":{"line":984,"column":29}},"171":{"start":{"line":986,"column":8},"end":{"line":986,"column":24}},"172":{"start":{"line":988,"column":8},"end":{"line":988,"column":34}},"173":{"start":{"line":991,"column":8},"end":{"line":1002,"column":9}},"174":{"start":{"line":992,"column":12},"end":{"line":992,"column":64}},"175":{"start":{"line":993,"column":12},"end":{"line":993,"column":63}},"176":{"start":{"line":996,"column":12},"end":{"line":1001,"column":13}},"177":{"start":{"line":999,"column":16},"end":{"line":999,"column":41}},"178":{"start":{"line":1000,"column":16},"end":{"line":1000,"column":52}},"179":{"start":{"line":1025,"column":8},"end":{"line":1026,"column":59}},"180":{"start":{"line":1028,"column":8},"end":{"line":1086,"column":17}},"181":{"start":{"line":1029,"column":12},"end":{"line":1033,"column":49}},"182":{"start":{"line":1037,"column":12},"end":{"line":1037,"column":45}},"183":{"start":{"line":1037,"column":36},"end":{"line":1037,"column":43}},"184":{"start":{"line":1039,"column":12},"end":{"line":1039,"column":66}},"185":{"start":{"line":1041,"column":12},"end":{"line":1065,"column":13}},"186":{"start":{"line":1042,"column":16},"end":{"line":1042,"column":48}},"187":{"start":{"line":1043,"column":16},"end":{"line":1043,"column":55}},"188":{"start":{"line":1048,"column":16},"end":{"line":1064,"column":17}},"189":{"start":{"line":1051,"column":20},"end":{"line":1051,"column":52}},"190":{"start":{"line":1055,"column":20},"end":{"line":1060,"column":21}},"191":{"start":{"line":1058,"column":24},"end":{"line":1058,"column":68}},"192":{"start":{"line":1059,"column":24},"end":{"line":1059,"column":46}},"193":{"start":{"line":1062,"column":20},"end":{"line":1062,"column":56}},"194":{"start":{"line":1063,"column":20},"end":{"line":1063,"column":42}},"195":{"start":{"line":1069,"column":12},"end":{"line":1072,"column":21}},"196":{"start":{"line":1070,"column":16},"end":{"line":1070,"column":79}},"197":{"start":{"line":1071,"column":16},"end":{"line":1071,"column":38}},"198":{"start":{"line":1076,"column":12},"end":{"line":1080,"column":13}},"199":{"start":{"line":1077,"column":16},"end":{"line":1077,"column":41}},"200":{"start":{"line":1078,"column":16},"end":{"line":1078,"column":52}},"201":{"start":{"line":1079,"column":16},"end":{"line":1079,"column":23}},"202":{"start":{"line":1083,"column":12},"end":{"line":1085,"column":13}},"203":{"start":{"line":1084,"column":16},"end":{"line":1084,"column":73}},"204":{"start":{"line":1100,"column":8},"end":{"line":1100,"column":65}},"205":{"start":{"line":1102,"column":8},"end":{"line":1102,"column":64}},"206":{"start":{"line":1102,"column":25},"end":{"line":1102,"column":62}},"207":{"start":{"line":1103,"column":8},"end":{"line":1103,"column":67}},"208":{"start":{"line":1103,"column":25},"end":{"line":1103,"column":65}},"209":{"start":{"line":1116,"column":8},"end":{"line":1116,"column":33}},"210":{"start":{"line":1116,"column":24},"end":{"line":1116,"column":31}},"211":{"start":{"line":1118,"column":8},"end":{"line":1118,"column":54}},"212":{"start":{"line":1119,"column":8},"end":{"line":1121,"column":9}},"213":{"start":{"line":1120,"column":12},"end":{"line":1120,"column":34}},"214":{"start":{"line":1136,"column":8},"end":{"line":1138,"column":24}},"215":{"start":{"line":1141,"column":8},"end":{"line":1152,"column":9}},"216":{"start":{"line":1143,"column":12},"end":{"line":1145,"column":13}},"217":{"start":{"line":1144,"column":16},"end":{"line":1144,"column":33}},"218":{"start":{"line":1148,"column":12},"end":{"line":1148,"column":47}},"219":{"start":{"line":1149,"column":12},"end":{"line":1151,"column":13}},"220":{"start":{"line":1150,"column":16},"end":{"line":1150,"column":40}},"221":{"start":{"line":1155,"column":8},"end":{"line":1157,"column":9}},"222":{"start":{"line":1156,"column":12},"end":{"line":1156,"column":39}},"223":{"start":{"line":1169,"column":8},"end":{"line":1169,"column":48}},"224":{"start":{"line":1171,"column":8},"end":{"line":1173,"column":9}},"225":{"start":{"line":1172,"column":12},"end":{"line":1172,"column":54}},"226":{"start":{"line":1191,"column":8},"end":{"line":1191,"column":75}},"227":{"start":{"line":1194,"column":8},"end":{"line":1195,"column":46}},"228":{"start":{"line":1214,"column":8},"end":{"line":1218,"column":19}},"229":{"start":{"line":1221,"column":8},"end":{"line":1230,"column":9}},"230":{"start":{"line":1223,"column":12},"end":{"line":1223,"column":45}},"231":{"start":{"line":1225,"column":12},"end":{"line":1225,"column":45}},"232":{"start":{"line":1226,"column":12},"end":{"line":1226,"column":40}},"233":{"start":{"line":1227,"column":12},"end":{"line":1227,"column":57}},"234":{"start":{"line":1229,"column":12},"end":{"line":1229,"column":19}},"235":{"start":{"line":1233,"column":8},"end":{"line":1242,"column":9}},"236":{"start":{"line":1235,"column":12},"end":{"line":1235,"column":30}},"237":{"start":{"line":1237,"column":12},"end":{"line":1237,"column":47}},"238":{"start":{"line":1238,"column":12},"end":{"line":1238,"column":40}},"239":{"start":{"line":1239,"column":12},"end":{"line":1239,"column":50}},"240":{"start":{"line":1241,"column":12},"end":{"line":1241,"column":19}},"241":{"start":{"line":1244,"column":8},"end":{"line":1244,"column":34}},"242":{"start":{"line":1245,"column":8},"end":{"line":1245,"column":36}},"243":{"start":{"line":1246,"column":8},"end":{"line":1246,"column":36}},"244":{"start":{"line":1263,"column":8},"end":{"line":1265,"column":59}},"245":{"start":{"line":1268,"column":8},"end":{"line":1270,"column":9}},"246":{"start":{"line":1269,"column":12},"end":{"line":1269,"column":52}},"247":{"start":{"line":1284,"column":8},"end":{"line":1284,"column":54}},"248":{"start":{"line":1297,"column":8},"end":{"line":1297,"column":44}},"249":{"start":{"line":1301,"column":0},"end":{"line":1301,"column":32}}},"branchMap":{"1":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":4},"end":{"line":48,"column":4}},{"start":{"line":48,"column":4},"end":{"line":48,"column":4}}]},"2":{"line":365,"type":"if","locations":[{"start":{"line":365,"column":8},"end":{"line":365,"column":8}},{"start":{"line":365,"column":8},"end":{"line":365,"column":8}}]},"3":{"line":367,"type":"binary-expr","locations":[{"start":{"line":367,"column":12},"end":{"line":367,"column":19}},{"start":{"line":367,"column":24},"end":{"line":367,"column":48}}]},"4":{"line":370,"type":"binary-expr","locations":[{"start":{"line":370,"column":8},"end":{"line":370,"column":15}},{"start":{"line":370,"column":20},"end":{"line":370,"column":58}}]},"5":{"line":371,"type":"binary-expr","locations":[{"start":{"line":371,"column":25},"end":{"line":371,"column":41}},{"start":{"line":371,"column":46},"end":{"line":371,"column":67}}]},"6":{"line":372,"type":"binary-expr","locations":[{"start":{"line":372,"column":8},"end":{"line":372,"column":23}},{"start":{"line":372,"column":28},"end":{"line":372,"column":57}}]},"7":{"line":403,"type":"if","locations":[{"start":{"line":403,"column":8},"end":{"line":403,"column":8}},{"start":{"line":403,"column":8},"end":{"line":403,"column":8}}]},"8":{"line":408,"type":"binary-expr","locations":[{"start":{"line":408,"column":8},"end":{"line":408,"column":15}},{"start":{"line":408,"column":20},"end":{"line":408,"column":58}}]},"9":{"line":411,"type":"if","locations":[{"start":{"line":411,"column":8},"end":{"line":411,"column":8}},{"start":{"line":411,"column":8},"end":{"line":411,"column":8}}]},"10":{"line":413,"type":"binary-expr","locations":[{"start":{"line":413,"column":19},"end":{"line":413,"column":35}},{"start":{"line":413,"column":39},"end":{"line":413,"column":61}}]},"11":{"line":417,"type":"cond-expr","locations":[{"start":{"line":417,"column":38},"end":{"line":417,"column":63}},{"start":{"line":417,"column":66},"end":{"line":417,"column":75}}]},"12":{"line":451,"type":"if","locations":[{"start":{"line":451,"column":8},"end":{"line":451,"column":8}},{"start":{"line":451,"column":8},"end":{"line":451,"column":8}}]},"13":{"line":457,"type":"if","locations":[{"start":{"line":457,"column":8},"end":{"line":457,"column":8}},{"start":{"line":457,"column":8},"end":{"line":457,"column":8}}]},"14":{"line":458,"type":"binary-expr","locations":[{"start":{"line":458,"column":12},"end":{"line":458,"column":19}},{"start":{"line":458,"column":24},"end":{"line":458,"column":62}}]},"15":{"line":463,"type":"if","locations":[{"start":{"line":463,"column":12},"end":{"line":463,"column":12}},{"start":{"line":463,"column":12},"end":{"line":463,"column":12}}]},"16":{"line":473,"type":"if","locations":[{"start":{"line":473,"column":16},"end":{"line":473,"column":16}},{"start":{"line":473,"column":16},"end":{"line":473,"column":16}}]},"17":{"line":481,"type":"if","locations":[{"start":{"line":481,"column":8},"end":{"line":481,"column":8}},{"start":{"line":481,"column":8},"end":{"line":481,"column":8}}]},"18":{"line":481,"type":"binary-expr","locations":[{"start":{"line":481,"column":12},"end":{"line":481,"column":18}},{"start":{"line":481,"column":22},"end":{"line":481,"column":32}}]},"19":{"line":537,"type":"if","locations":[{"start":{"line":537,"column":8},"end":{"line":537,"column":8}},{"start":{"line":537,"column":8},"end":{"line":537,"column":8}}]},"20":{"line":564,"type":"if","locations":[{"start":{"line":564,"column":8},"end":{"line":564,"column":8}},{"start":{"line":564,"column":8},"end":{"line":564,"column":8}}]},"21":{"line":611,"type":"binary-expr","locations":[{"start":{"line":611,"column":28},"end":{"line":611,"column":35}},{"start":{"line":611,"column":39},"end":{"line":611,"column":54}}]},"22":{"line":613,"type":"if","locations":[{"start":{"line":613,"column":12},"end":{"line":613,"column":12}},{"start":{"line":613,"column":12},"end":{"line":613,"column":12}}]},"23":{"line":620,"type":"if","locations":[{"start":{"line":620,"column":8},"end":{"line":620,"column":8}},{"start":{"line":620,"column":8},"end":{"line":620,"column":8}}]},"24":{"line":620,"type":"binary-expr","locations":[{"start":{"line":620,"column":12},"end":{"line":620,"column":22}},{"start":{"line":620,"column":26},"end":{"line":620,"column":32}}]},"25":{"line":647,"type":"cond-expr","locations":[{"start":{"line":648,"column":16},"end":{"line":648,"column":41}},{"start":{"line":648,"column":44},"end":{"line":648,"column":60}}]},"26":{"line":650,"type":"if","locations":[{"start":{"line":650,"column":8},"end":{"line":650,"column":8}},{"start":{"line":650,"column":8},"end":{"line":650,"column":8}}]},"27":{"line":677,"type":"if","locations":[{"start":{"line":677,"column":8},"end":{"line":677,"column":8}},{"start":{"line":677,"column":8},"end":{"line":677,"column":8}}]},"28":{"line":678,"type":"binary-expr","locations":[{"start":{"line":678,"column":19},"end":{"line":678,"column":41}},{"start":{"line":678,"column":45},"end":{"line":678,"column":63}}]},"29":{"line":680,"type":"binary-expr","locations":[{"start":{"line":680,"column":19},"end":{"line":680,"column":25}},{"start":{"line":680,"column":30},"end":{"line":680,"column":41}},{"start":{"line":680,"column":45},"end":{"line":680,"column":56}}]},"30":{"line":731,"type":"if","locations":[{"start":{"line":731,"column":8},"end":{"line":731,"column":8}},{"start":{"line":731,"column":8},"end":{"line":731,"column":8}}]},"31":{"line":739,"type":"binary-expr","locations":[{"start":{"line":739,"column":8},"end":{"line":739,"column":17}},{"start":{"line":739,"column":22},"end":{"line":739,"column":50}}]},"32":{"line":785,"type":"cond-expr","locations":[{"start":{"line":785,"column":36},"end":{"line":785,"column":50}},{"start":{"line":785,"column":53},"end":{"line":785,"column":68}}]},"33":{"line":788,"type":"if","locations":[{"start":{"line":788,"column":8},"end":{"line":788,"column":8}},{"start":{"line":788,"column":8},"end":{"line":788,"column":8}}]},"34":{"line":791,"type":"cond-expr","locations":[{"start":{"line":791,"column":55},"end":{"line":791,"column":62}},{"start":{"line":791,"column":65},"end":{"line":791,"column":71}}]},"35":{"line":801,"type":"binary-expr","locations":[{"start":{"line":801,"column":12},"end":{"line":801,"column":17}},{"start":{"line":801,"column":22},"end":{"line":801,"column":48}}]},"36":{"line":808,"type":"binary-expr","locations":[{"start":{"line":808,"column":20},"end":{"line":808,"column":32}},{"start":{"line":808,"column":36},"end":{"line":808,"column":54}}]},"37":{"line":811,"type":"if","locations":[{"start":{"line":811,"column":8},"end":{"line":811,"column":8}},{"start":{"line":811,"column":8},"end":{"line":811,"column":8}}]},"38":{"line":838,"type":"binary-expr","locations":[{"start":{"line":838,"column":28},"end":{"line":838,"column":37}},{"start":{"line":838,"column":41},"end":{"line":838,"column":70}}]},"39":{"line":841,"type":"if","locations":[{"start":{"line":841,"column":12},"end":{"line":841,"column":12}},{"start":{"line":841,"column":12},"end":{"line":841,"column":12}}]},"40":{"line":841,"type":"binary-expr","locations":[{"start":{"line":841,"column":16},"end":{"line":841,"column":24}},{"start":{"line":841,"column":28},"end":{"line":841,"column":45}}]},"41":{"line":852,"type":"binary-expr","locations":[{"start":{"line":852,"column":12},"end":{"line":852,"column":25}},{"start":{"line":852,"column":30},"end":{"line":852,"column":48}}]},"42":{"line":880,"type":"if","locations":[{"start":{"line":880,"column":12},"end":{"line":880,"column":12}},{"start":{"line":880,"column":12},"end":{"line":880,"column":12}}]},"43":{"line":888,"type":"if","locations":[{"start":{"line":888,"column":16},"end":{"line":888,"column":16}},{"start":{"line":888,"column":16},"end":{"line":888,"column":16}}]},"44":{"line":890,"type":"binary-expr","locations":[{"start":{"line":890,"column":20},"end":{"line":890,"column":27}},{"start":{"line":890,"column":32},"end":{"line":890,"column":56}}]},"45":{"line":898,"type":"binary-expr","locations":[{"start":{"line":898,"column":16},"end":{"line":898,"column":23}},{"start":{"line":898,"column":28},"end":{"line":898,"column":48}}]},"46":{"line":901,"type":"binary-expr","locations":[{"start":{"line":901,"column":17},"end":{"line":901,"column":33}},{"start":{"line":901,"column":38},"end":{"line":901,"column":59}}]},"47":{"line":906,"type":"if","locations":[{"start":{"line":906,"column":8},"end":{"line":906,"column":8}},{"start":{"line":906,"column":8},"end":{"line":906,"column":8}}]},"48":{"line":980,"type":"if","locations":[{"start":{"line":980,"column":8},"end":{"line":980,"column":8}},{"start":{"line":980,"column":8},"end":{"line":980,"column":8}}]},"49":{"line":988,"type":"binary-expr","locations":[{"start":{"line":988,"column":8},"end":{"line":988,"column":15}},{"start":{"line":988,"column":20},"end":{"line":988,"column":32}}]},"50":{"line":991,"type":"if","locations":[{"start":{"line":991,"column":8},"end":{"line":991,"column":8}},{"start":{"line":991,"column":8},"end":{"line":991,"column":8}}]},"51":{"line":996,"type":"if","locations":[{"start":{"line":996,"column":12},"end":{"line":996,"column":12}},{"start":{"line":996,"column":12},"end":{"line":996,"column":12}}]},"52":{"line":996,"type":"binary-expr","locations":[{"start":{"line":996,"column":16},"end":{"line":996,"column":31}},{"start":{"line":997,"column":20},"end":{"line":997,"column":72}}]},"53":{"line":1029,"type":"binary-expr","locations":[{"start":{"line":1029,"column":34},"end":{"line":1029,"column":50}},{"start":{"line":1029,"column":54},"end":{"line":1029,"column":56}}]},"54":{"line":1037,"type":"if","locations":[{"start":{"line":1037,"column":12},"end":{"line":1037,"column":12}},{"start":{"line":1037,"column":12},"end":{"line":1037,"column":12}}]},"55":{"line":1048,"type":"if","locations":[{"start":{"line":1048,"column":16},"end":{"line":1048,"column":16}},{"start":{"line":1048,"column":16},"end":{"line":1048,"column":16}}]},"56":{"line":1055,"type":"if","locations":[{"start":{"line":1055,"column":20},"end":{"line":1055,"column":20}},{"start":{"line":1055,"column":20},"end":{"line":1055,"column":20}}]},"57":{"line":1076,"type":"if","locations":[{"start":{"line":1076,"column":12},"end":{"line":1076,"column":12}},{"start":{"line":1076,"column":12},"end":{"line":1076,"column":12}}]},"58":{"line":1083,"type":"if","locations":[{"start":{"line":1083,"column":12},"end":{"line":1083,"column":12}},{"start":{"line":1083,"column":12},"end":{"line":1083,"column":12}}]},"59":{"line":1102,"type":"if","locations":[{"start":{"line":1102,"column":8},"end":{"line":1102,"column":8}},{"start":{"line":1102,"column":8},"end":{"line":1102,"column":8}}]},"60":{"line":1103,"type":"if","locations":[{"start":{"line":1103,"column":8},"end":{"line":1103,"column":8}},{"start":{"line":1103,"column":8},"end":{"line":1103,"column":8}}]},"61":{"line":1116,"type":"if","locations":[{"start":{"line":1116,"column":8},"end":{"line":1116,"column":8}},{"start":{"line":1116,"column":8},"end":{"line":1116,"column":8}}]},"62":{"line":1119,"type":"if","locations":[{"start":{"line":1119,"column":8},"end":{"line":1119,"column":8}},{"start":{"line":1119,"column":8},"end":{"line":1119,"column":8}}]},"63":{"line":1141,"type":"if","locations":[{"start":{"line":1141,"column":8},"end":{"line":1141,"column":8}},{"start":{"line":1141,"column":8},"end":{"line":1141,"column":8}}]},"64":{"line":1143,"type":"if","locations":[{"start":{"line":1143,"column":12},"end":{"line":1143,"column":12}},{"start":{"line":1143,"column":12},"end":{"line":1143,"column":12}}]},"65":{"line":1149,"type":"if","locations":[{"start":{"line":1149,"column":12},"end":{"line":1149,"column":12}},{"start":{"line":1149,"column":12},"end":{"line":1149,"column":12}}]},"66":{"line":1155,"type":"if","locations":[{"start":{"line":1155,"column":8},"end":{"line":1155,"column":8}},{"start":{"line":1155,"column":8},"end":{"line":1155,"column":8}}]},"67":{"line":1171,"type":"if","locations":[{"start":{"line":1171,"column":8},"end":{"line":1171,"column":8}},{"start":{"line":1171,"column":8},"end":{"line":1171,"column":8}}]},"68":{"line":1194,"type":"cond-expr","locations":[{"start":{"line":1194,"column":65},"end":{"line":1194,"column":69}},{"start":{"line":1195,"column":12},"end":{"line":1195,"column":26}}]},"69":{"line":1221,"type":"if","locations":[{"start":{"line":1221,"column":8},"end":{"line":1221,"column":8}},{"start":{"line":1221,"column":8},"end":{"line":1221,"column":8}}]},"70":{"line":1233,"type":"if","locations":[{"start":{"line":1233,"column":8},"end":{"line":1233,"column":8}},{"start":{"line":1233,"column":8},"end":{"line":1233,"column":8}}]},"71":{"line":1265,"type":"binary-expr","locations":[{"start":{"line":1265,"column":22},"end":{"line":1265,"column":26}},{"start":{"line":1265,"column":30},"end":{"line":1265,"column":58}}]},"72":{"line":1268,"type":"if","locations":[{"start":{"line":1268,"column":8},"end":{"line":1268,"column":8}},{"start":{"line":1268,"column":8},"end":{"line":1268,"column":8}}]},"73":{"line":1268,"type":"binary-expr","locations":[{"start":{"line":1268,"column":12},"end":{"line":1268,"column":19}},{"start":{"line":1268,"column":23},"end":{"line":1268,"column":40}},{"start":{"line":1268,"column":44},"end":{"line":1268,"column":65}}]}},"code":["(function () { YUI.add('widget-buttons', function (Y, NAME) {","","/**","Provides header/body/footer button support for Widgets that use the","`WidgetStdMod` extension.","","@module widget-buttons","@since 3.4.0","**/","","var YArray = Y.Array,"," YLang = Y.Lang,"," YObject = Y.Object,",""," ButtonPlugin = Y.Plugin.Button,"," Widget = Y.Widget,"," WidgetStdMod = Y.WidgetStdMod,",""," getClassName = Y.ClassNameManager.getClassName,"," isArray = YLang.isArray,"," isNumber = YLang.isNumber,"," isString = YLang.isString,"," isValue = YLang.isValue;","","// Utility to determine if an object is a Y.Node instance, even if it was","// created in a different YUI sandbox.","function isNode(node) {"," return !!node.getDOMNode;","}","","/**","Provides header/body/footer button support for Widgets that use the","`WidgetStdMod` extension.","","This Widget extension makes it easy to declaratively configure a widget's","buttons. It adds a `buttons` attribute along with button- accessor and mutator","methods. All button nodes have the `Y.Plugin.Button` plugin applied.","","This extension also includes `HTML_PARSER` support to seed a widget's `buttons`","from those which already exist in its DOM.","","@class WidgetButtons","@extensionfor Widget","@since 3.4.0","**/","function WidgetButtons() {"," // Require `Y.WidgetStdMod`."," if (!this._stdModNode) {"," Y.error('WidgetStdMod must be added to a Widget before WidgetButtons.');"," }",""," // Has to be setup before the `initializer()`."," this._buttonsHandles = {};","}","","WidgetButtons.ATTRS = {"," /**"," Collection containing a widget's buttons.",""," The collection is an Object which contains an Array of `Y.Node`s for every"," `WidgetStdMod` section (header, body, footer) which has one or more buttons."," All button nodes have the `Y.Plugin.Button` plugin applied.",""," This attribute is very flexible in the values it will accept. `buttons` can"," be specified as a single Array, or an Object of Arrays keyed to a particular"," section.",""," All specified values will be normalized to this type of structure:",""," {"," header: [...],"," footer: [...]"," }",""," A button can be specified as a `Y.Node`, config Object, or String name for a"," predefined button on the `BUTTONS` prototype property. When a config Object"," is provided, it will be merged with any defaults provided by a button with"," the same `name` defined on the `BUTTONS` property.",""," See `addButton()` for the detailed list of configuration properties.",""," For convenience, a widget's buttons will always persist and remain rendered"," after header/body/footer content updates. Buttons should be removed by"," updating this attribute or using the `removeButton()` method.",""," @example"," {"," // Uses predefined \"close\" button by string name."," header: ['close'],",""," footer: ["," {"," name : 'cancel',"," label : 'Cancel',"," action: 'hide'"," },",""," {"," name : 'okay',"," label : 'Okay',"," isDefault: true,",""," events: {"," click: function (e) {"," this.hide();"," }"," }"," }"," ]"," }",""," @attribute buttons"," @type Object"," @default {}"," @since 3.4.0"," **/"," buttons: {"," getter: '_getButtons',"," setter: '_setButtons',"," value : {}"," },",""," /**"," The current default button as configured through this widget's `buttons`.",""," A button can be configured as the default button in the following ways:",""," * As a config Object with an `isDefault` property:"," `{label: 'Okay', isDefault: true}`.",""," * As a Node with a `data-default` attribute:"," ``.",""," This attribute is **read-only**; anytime there are changes to this widget's"," `buttons`, the `defaultButton` will be updated if needed.",""," **Note:** If two or more buttons are configured to be the default button,"," the last one wins.",""," @attribute defaultButton"," @type Node"," @default null"," @readOnly"," @since 3.5.0"," **/"," defaultButton: {"," readOnly: true,"," value : null"," }","};","","/**","CSS classes used by `WidgetButtons`.","","@property CLASS_NAMES","@type Object","@static","@since 3.5.0","**/","WidgetButtons.CLASS_NAMES = {"," button : getClassName('button'),"," buttons: Widget.getClassName('buttons'),"," primary: getClassName('button', 'primary')","};","","WidgetButtons.HTML_PARSER = {"," buttons: function (srcNode) {"," return this._parseButtons(srcNode);"," }","};","","/**","The list of button configuration properties which are specific to","`WidgetButtons` and should not be passed to `Y.Plugin.Button.createNode()`.","","@property NON_BUTTON_NODE_CFG","@type Array","@static","@since 3.5.0","**/","WidgetButtons.NON_BUTTON_NODE_CFG = ["," 'action', 'classNames', 'context', 'events', 'isDefault', 'section'","];","","WidgetButtons.prototype = {"," // -- Public Properties ----------------------------------------------------",""," /**"," Collection of predefined buttons mapped by name -> config.",""," These button configurations will serve as defaults for any button added to a"," widget's buttons which have the same `name`.",""," See `addButton()` for a list of possible configuration values.",""," @property BUTTONS"," @type Object"," @default {}"," @see addButton()"," @since 3.5.0"," **/"," BUTTONS: {},",""," /**"," The HTML template to use when creating the node which wraps all buttons of a"," section. By default it will have the CSS class: \"yui3-widget-buttons\".",""," @property BUTTONS_TEMPLATE"," @type String"," @default \"\""," @since 3.5.0"," **/"," BUTTONS_TEMPLATE: '',",""," /**"," The default section to render buttons in when no section is specified.",""," @property DEFAULT_BUTTONS_SECTION"," @type String"," @default Y.WidgetStdMod.FOOTER"," @since 3.5.0"," **/"," DEFAULT_BUTTONS_SECTION: WidgetStdMod.FOOTER,",""," // -- Protected Properties -------------------------------------------------",""," /**"," A map of button node `_yuid` -> event-handle for all button nodes which were"," created by this widget.",""," @property _buttonsHandles"," @type Object"," @protected"," @since 3.5.0"," **/",""," /**"," A map of this widget's `buttons`, both name -> button and"," section:name -> button.",""," @property _buttonsMap"," @type Object"," @protected"," @since 3.5.0"," **/",""," /**"," Internal reference to this widget's default button.",""," @property _defaultButton"," @type Node"," @protected"," @since 3.5.0"," **/",""," // -- Lifecycle Methods ----------------------------------------------------",""," initializer: function () {"," // Creates button mappings and sets the `defaultButton`."," this._mapButtons(this.get('buttons'));"," this._updateDefaultButton();",""," // Bound with `Y.bind()` to make more extensible."," this.after({"," buttonsChange : Y.bind('_afterButtonsChange', this),"," defaultButtonChange: Y.bind('_afterDefaultButtonChange', this)"," });",""," Y.after(this._bindUIButtons, this, 'bindUI');"," Y.after(this._syncUIButtons, this, 'syncUI');"," },",""," destructor: function () {"," // Detach all event subscriptions this widget added to its `buttons`."," YObject.each(this._buttonsHandles, function (handle) {"," handle.detach();"," });",""," delete this._buttonsHandles;"," delete this._buttonsMap;"," delete this._defaultButton;"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Adds a button to this widget.",""," The new button node will have the `Y.Plugin.Button` plugin applied, be added"," to this widget's `buttons`, and rendered in the specified `section` at the"," specified `index` (or end of the section when no `index` is provided). If"," the section does not exist, it will be created.",""," This fires the `buttonsChange` event and adds the following properties to"," the event facade:",""," * `button`: The button node or config object to add.",""," * `section`: The `WidgetStdMod` section (header/body/footer) where the"," button will be added.",""," * `index`: The index at which the button will be in the section.",""," * `src`: \"add\"",""," **Note:** The `index` argument will be passed to the Array `splice()`"," method, therefore a negative value will insert the `button` that many items"," from the end. The `index` property on the `buttonsChange` event facade is"," the index at which the `button` was added.",""," @method addButton"," @param {Node|Object|String} button The button to add. This can be a `Y.Node`"," instance, config Object, or String name for a predefined button on the"," `BUTTONS` prototype property. When a config Object is provided, it will"," be merged with any defaults provided by any `srcNode` and/or a button"," with the same `name` defined on the `BUTTONS` property. The following"," are the possible configuration properties beyond what Node plugins"," accept by default:"," @param {Function|String} [button.action] The default handler that should"," be called when the button is clicked. A String name of a Function that"," exists on the `context` object can also be provided. **Note:**"," Specifying a set of `events` will override this setting."," @param {String|String[]} [button.classNames] Additional CSS classes to add"," to the button node."," @param {Object} [button.context=this] Context which any `events` or"," `action` should be called with. Defaults to `this`, the widget."," **Note:** `e.target` will access the button node in the event handlers."," @param {Boolean} [button.disabled=false] Whether the button should be"," disabled."," @param {String|Object} [button.events=\"click\"] Event name, or set of"," events and handlers to bind to the button node. **See:** `Y.Node.on()`,"," this value is passed as the first argument to `on()`."," @param {Boolean} [button.isDefault=false] Whether the button is the"," default button."," @param {String} [button.label] The visible text/value displayed in the"," button."," @param {String} [button.name] A name which can later be used to reference"," this button. If a button is defined on the `BUTTONS` property with this"," same name, its configuration properties will be merged in as defaults."," @param {String} [button.section] The `WidgetStdMod` section (header, body,"," footer) where the button should be added."," @param {Node} [button.srcNode] An existing Node to use for the button,"," default values will be seeded from this node, but are overriden by any"," values specified in the config object. By default a new <button>"," node will be created."," @param {String} [button.template] A specific template to use when creating"," a new button node (e.g. \"<a />\"). **Note:** Specifying a `srcNode`"," will overide this."," @param {String} [section=\"footer\"] The `WidgetStdMod` section"," (header/body/footer) where the button should be added. This takes"," precedence over the `button.section` configuration property."," @param {Number} [index] The index at which the button should be inserted. If"," not specified, the button will be added to the end of the section. This"," value is passed to the Array `splice()` method, therefore a negative"," value will insert the `button` that many items from the end."," @chainable"," @see Plugin.Button.createNode()"," @since 3.4.0"," **/"," addButton: function (button, section, index) {"," var buttons = this.get('buttons'),"," sectionButtons, atIndex;",""," // Makes sure we have the full config object."," if (!isNode(button)) {"," button = this._mergeButtonConfig(button);"," section || (section = button.section);"," }",""," section || (section = this.DEFAULT_BUTTONS_SECTION);"," sectionButtons = buttons[section] || (buttons[section] = []);"," isNumber(index) || (index = sectionButtons.length);",""," // Insert new button at the correct position."," sectionButtons.splice(index, 0, button);",""," // Determine the index at which the `button` now exists in the array."," atIndex = YArray.indexOf(sectionButtons, button);",""," this.set('buttons', buttons, {"," button : button,"," section: section,"," index : atIndex,"," src : 'add'"," });",""," return this;"," },",""," /**"," Returns a button node from this widget's `buttons`.",""," @method getButton"," @param {Number|String} name The string name or index of the button."," @param {String} [section=\"footer\"] The `WidgetStdMod` section"," (header/body/footer) where the button exists. Only applicable when"," looking for a button by numerical index, or by name but scoped to a"," particular section."," @return {Node} The button node."," @since 3.5.0"," **/"," getButton: function (name, section) {"," if (!isValue(name)) { return; }",""," var map = this._buttonsMap,"," buttons;",""," section || (section = this.DEFAULT_BUTTONS_SECTION);",""," // Supports `getButton(1, 'header')` signature."," if (isNumber(name)) {"," buttons = this.get('buttons');"," return buttons[section] && buttons[section][name];"," }",""," // Looks up button by name or section:name."," return arguments.length > 1 ? map[section + ':' + name] : map[name];"," },",""," /**"," Removes a button from this widget.",""," The button will be removed from this widget's `buttons` and its DOM. Any"," event subscriptions on the button which were created by this widget will be"," detached. If the content section becomes empty after removing the button"," node, then the section will also be removed.",""," This fires the `buttonsChange` event and adds the following properties to"," the event facade:",""," * `button`: The button node to remove.",""," * `section`: The `WidgetStdMod` section (header/body/footer) where the"," button should be removed from.",""," * `index`: The index at which the button exists in the section.",""," * `src`: \"remove\"",""," @method removeButton"," @param {Node|Number|String} button The button to remove. This can be a"," `Y.Node` instance, index, or String name of a button."," @param {String} [section=\"footer\"] The `WidgetStdMod` section"," (header/body/footer) where the button exists. Only applicable when"," removing a button by numerical index, or by name but scoped to a"," particular section."," @chainable"," @since 3.5.0"," **/"," removeButton: function (button, section) {"," if (!isValue(button)) { return this; }",""," var buttons = this.get('buttons'),"," index;",""," // Shortcut if `button` is already an index which is needed for slicing."," if (isNumber(button)) {"," section || (section = this.DEFAULT_BUTTONS_SECTION);"," index = button;"," button = buttons[section][index];"," } else {"," // Supports `button` being the string name."," if (isString(button)) {"," // `getButton()` is called this way because its behavior is"," // different based on the number of arguments."," button = this.getButton.apply(this, arguments);"," }",""," // Determines the `section` and `index` at which the button exists."," YObject.some(buttons, function (sectionButtons, currentSection) {"," index = YArray.indexOf(sectionButtons, button);",""," if (index > -1) {"," section = currentSection;"," return true;"," }"," });"," }",""," // Button was found at an appropriate index."," if (button && index > -1) {"," // Remove button from `section` array."," buttons[section].splice(index, 1);",""," this.set('buttons', buttons, {"," button : button,"," section: section,"," index : index,"," src : 'remove'"," });"," }",""," return this;"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Binds UI event listeners. This method is inserted via AOP, and will execute"," after `bindUI()`.",""," @method _bindUIButtons"," @protected"," @since 3.4.0"," **/"," _bindUIButtons: function () {"," // Event handlers are bound with `bind()` to make them more extensible."," var afterContentChange = Y.bind('_afterContentChangeButtons', this);",""," this.after({"," visibleChange : Y.bind('_afterVisibleChangeButtons', this),"," headerContentChange: afterContentChange,"," bodyContentChange : afterContentChange,"," footerContentChange: afterContentChange"," });"," },",""," /**"," Returns a button node based on the specified `button` node or configuration.",""," The button node will either be created via `Y.Plugin.Button.createNode()`,"," or when `button` is specified as a node already, it will by `plug()`ed with"," `Y.Plugin.Button`.",""," @method _createButton"," @param {Node|Object} button Button node or configuration object."," @return {Node} The button node."," @protected"," @since 3.5.0"," **/"," _createButton: function (button) {"," var config, buttonConfig, nonButtonNodeCfg,"," i, len, action, context, handle;",""," // Makes sure the exiting `Y.Node` instance is from this YUI sandbox and"," // is plugged with `Y.Plugin.Button`."," if (isNode(button)) {"," return Y.one(button.getDOMNode()).plug(ButtonPlugin);"," }",""," // Merge `button` config with defaults and back-compat."," config = Y.merge({"," context: this,"," events : 'click',"," label : button.value"," }, button);",""," buttonConfig = Y.merge(config);"," nonButtonNodeCfg = WidgetButtons.NON_BUTTON_NODE_CFG;",""," // Remove all non-button Node config props."," for (i = 0, len = nonButtonNodeCfg.length; i < len; i += 1) {"," delete buttonConfig[nonButtonNodeCfg[i]];"," }",""," // Create the button node using the button Node-only config."," button = ButtonPlugin.createNode(buttonConfig);",""," context = config.context;"," action = config.action;",""," // Supports `action` as a String name of a Function on the `context`"," // object."," if (isString(action)) {"," action = Y.bind(action, context);"," }",""," // Supports all types of crazy configs for event subscriptions and"," // stores a reference to the returned `EventHandle`."," handle = button.on(config.events, action, context);"," this._buttonsHandles[Y.stamp(button, true)] = handle;",""," // Tags the button with the configured `name` and `isDefault` settings."," button.setData('name', this._getButtonName(config));"," button.setData('default', this._getButtonDefault(config));",""," // Add any CSS classnames to the button node."," YArray.each(YArray(config.classNames), button.addClass, button);",""," return button;"," },",""," /**"," Returns the buttons container for the specified `section`, passing a truthy"," value for `create` will create the node if it does not already exist.",""," **Note:** It is up to the caller to properly insert the returned container"," node into the content section.",""," @method _getButtonContainer"," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @param {Boolean} create Whether the buttons container should be created if"," it does not already exist."," @return {Node} The buttons container node for the specified `section`."," @protected"," @see BUTTONS_TEMPLATE"," @since 3.5.0"," **/"," _getButtonContainer: function (section, create) {"," var sectionClassName = WidgetStdMod.SECTION_CLASS_NAMES[section],"," buttonsClassName = WidgetButtons.CLASS_NAMES.buttons,"," contentBox = this.get('contentBox'),"," containerSelector, container;",""," // Search for an existing buttons container within the section."," containerSelector = '.' + sectionClassName + ' .' + buttonsClassName;",""," // Search only inside the current widget"," contentBox.all(containerSelector).some(function(node){"," var widget = Y.Widget.getByNode(node),"," isBelongs = !widget || widget === this;",""," if (isBelongs) {"," container = node;"," }"," return isBelongs;"," }, this);",""," // Create the `container` if it doesn't already exist."," if (!container && create) {"," container = Y.Node.create(this.BUTTONS_TEMPLATE);"," container.addClass(buttonsClassName);"," }",""," return container;"," },",""," /**"," Returns whether or not the specified `button` is configured to be the"," default button.",""," When a button node is specified, the button's `getData()` method will be"," used to determine if the button is configured to be the default. When a"," button config object is specified, the `isDefault` prop will determine"," whether the button is the default.",""," **Note:** `` is supported via the"," `button.getData('default')` API call.",""," @method _getButtonDefault"," @param {Node|Object} button The button node or configuration object."," @return {Boolean} Whether the button is configured to be the default button."," @protected"," @since 3.5.0"," **/"," _getButtonDefault: function (button) {"," var isDefault = isNode(button) ?"," button.getData('default') : button.isDefault;",""," if (isString(isDefault)) {"," return isDefault.toLowerCase() === 'true';"," }",""," return !!isDefault;"," },",""," /**"," Returns the name of the specified `button`.",""," When a button node is specified, the button's `getData('name')` method is"," preferred, but will fallback to `get('name')`, and the result will determine"," the button's name. When a button config object is specified, the `name` prop"," will determine the button's name.",""," **Note:** `` is supported via the"," `button.getData('name')` API call.",""," @method _getButtonName"," @param {Node|Object} button The button node or configuration object."," @return {String} The name of the button."," @protected"," @since 3.5.0"," **/"," _getButtonName: function (button) {"," var name;",""," if (isNode(button)) {"," name = button.getData('name') || button.get('name');"," } else {"," name = button && (button.name || button.type);"," }",""," return name;"," },",""," /**"," Getter for the `buttons` attribute. A copy of the `buttons` object is"," returned so the stored state cannot be modified by the callers of"," `get('buttons')`.",""," This will recreate a copy of the `buttons` object, and each section array"," (the button nodes are *not* copied/cloned.)",""," @method _getButtons"," @param {Object} buttons The widget's current `buttons` state."," @return {Object} A copy of the widget's current `buttons` state."," @protected"," @since 3.5.0"," **/"," _getButtons: function (buttons) {"," var buttonsCopy = {};",""," // Creates a new copy of the `buttons` object."," YObject.each(buttons, function (sectionButtons, section) {"," // Creates of copy of the array of button nodes."," buttonsCopy[section] = sectionButtons.concat();"," });",""," return buttonsCopy;"," },",""," /**"," Adds the specified `button` to the buttons map (both name -> button and"," section:name -> button), and sets the button as the default if it is"," configured as the default button.",""," **Note:** If two or more buttons are configured with the same `name` and/or"," configured to be the default button, the last one wins.",""," @method _mapButton"," @param {Node} button The button node to map."," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @protected"," @since 3.5.0"," **/"," _mapButton: function (button, section) {"," var map = this._buttonsMap,"," name = this._getButtonName(button),"," isDefault = this._getButtonDefault(button);",""," if (name) {"," // name -> button"," map[name] = button;",""," // section:name -> button"," map[section + ':' + name] = button;"," }",""," isDefault && (this._defaultButton = button);"," },",""," /**"," Adds the specified `buttons` to the buttons map (both name -> button and"," section:name -> button), and set the a button as the default if one is"," configured as the default button.",""," **Note:** This will clear all previous button mappings and null-out any"," previous default button! If two or more buttons are configured with the same"," `name` and/or configured to be the default button, the last one wins.",""," @method _mapButtons"," @param {Node[]} buttons The button nodes to map."," @protected"," @since 3.5.0"," **/"," _mapButtons: function (buttons) {"," this._buttonsMap = {};"," this._defaultButton = null;",""," YObject.each(buttons, function (sectionButtons, section) {"," var i, len;",""," for (i = 0, len = sectionButtons.length; i < len; i += 1) {"," this._mapButton(sectionButtons[i], section);"," }"," }, this);"," },",""," /**"," Returns a copy of the specified `config` object merged with any defaults"," provided by a `srcNode` and/or a predefined configuration for a button"," with the same `name` on the `BUTTONS` property.",""," @method _mergeButtonConfig"," @param {Object|String} config Button configuration object, or string name."," @return {Object} A copy of the button configuration object merged with any"," defaults."," @protected"," @since 3.5.0"," **/"," _mergeButtonConfig: function (config) {"," var buttonConfig, defConfig, name, button, tagName, label;",""," // Makes sure `config` is an Object and a copy of the specified value."," config = isString(config) ? {name: config} : Y.merge(config);",""," // Seeds default values from the button node, if there is one."," if (config.srcNode) {"," button = config.srcNode;"," tagName = button.get('tagName').toLowerCase();"," label = button.get(tagName === 'input' ? 'value' : 'text');",""," // Makes sure the button's current values override any defaults."," buttonConfig = {"," disabled : !!button.get('disabled'),"," isDefault: this._getButtonDefault(button),"," name : this._getButtonName(button)"," };",""," // Label should only be considered when not an empty string."," label && (buttonConfig.label = label);",""," // Merge `config` with `buttonConfig` values."," Y.mix(config, buttonConfig, false, null, 0, true);"," }",""," name = this._getButtonName(config);"," defConfig = this.BUTTONS && this.BUTTONS[name];",""," // Merge `config` with predefined default values."," if (defConfig) {"," Y.mix(config, defConfig, false, null, 0, true);"," }",""," return config;"," },",""," /**"," `HTML_PARSER` implementation for the `buttons` attribute.",""," **Note:** To determine a button node's name its `data-name` and `name`"," attributes are examined. Whether the button should be the default is"," determined by its `data-default` attribute.",""," @method _parseButtons"," @param {Node} srcNode This widget's srcNode to search for buttons."," @return {null|Object} `buttons` Config object parsed from this widget's DOM."," @protected"," @since 3.5.0"," **/"," _parseButtons: function (srcNode) {"," var buttonSelector = '.' + WidgetButtons.CLASS_NAMES.button,"," sections = ['header', 'body', 'footer'],"," buttonsConfig = null;",""," YArray.each(sections, function (section) {"," var container = this._getButtonContainer(section),"," buttons = container && container.all(buttonSelector),"," sectionButtons;",""," if (!buttons || buttons.isEmpty()) { return; }",""," sectionButtons = [];",""," // Creates a button config object for every button node found and"," // adds it to the section. This way each button configuration can be"," // merged with any defaults provided by predefined `BUTTONS`."," buttons.each(function (button) {"," sectionButtons.push({srcNode: button});"," });",""," buttonsConfig || (buttonsConfig = {});"," buttonsConfig[section] = sectionButtons;"," }, this);",""," return buttonsConfig;"," },",""," /**"," Setter for the `buttons` attribute. This processes the specified `config`"," and returns a new `buttons` object which is stored as the new state; leaving"," the original, specified `config` unmodified.",""," The button nodes will either be created via `Y.Plugin.Button.createNode()`,"," or when a button is already a Node already, it will by `plug()`ed with"," `Y.Plugin.Button`.",""," @method _setButtons"," @param {Array|Object} config The `buttons` configuration to process."," @return {Object} The processed `buttons` object which represents the new"," state."," @protected"," @since 3.5.0"," **/"," _setButtons: function (config) {"," var defSection = this.DEFAULT_BUTTONS_SECTION,"," buttons = {};",""," function processButtons(buttonConfigs, currentSection) {"," if (!isArray(buttonConfigs)) { return; }",""," var i, len, button, section;",""," for (i = 0, len = buttonConfigs.length; i < len; i += 1) {"," button = buttonConfigs[i];"," section = currentSection;",""," if (!isNode(button)) {"," button = this._mergeButtonConfig(button);"," section || (section = button.section);"," }",""," // Always passes through `_createButton()` to make sure the node"," // is decorated as a button."," button = this._createButton(button);",""," // Use provided `section` or fallback to the default section."," section || (section = defSection);",""," // Add button to the array of buttons for the specified section."," (buttons[section] || (buttons[section] = [])).push(button);"," }"," }",""," // Handle `config` being either an Array or Object of Arrays."," if (isArray(config)) {"," processButtons.call(this, config);"," } else {"," YObject.each(config, processButtons, this);"," }",""," return buttons;"," },",""," /**"," Syncs this widget's current button-related state to its DOM. This method is"," inserted via AOP, and will execute after `syncUI()`.",""," @method _syncUIButtons"," @protected"," @since 3.4.0"," **/"," _syncUIButtons: function () {"," this._uiSetButtons(this.get('buttons'));"," this._uiSetDefaultButton(this.get('defaultButton'));"," this._uiSetVisibleButtons(this.get('visible'));"," },",""," /**"," Inserts the specified `button` node into this widget's DOM at the specified"," `section` and `index` and updates the section content.",""," The section and button container nodes will be created if they do not"," already exist.",""," @method _uiInsertButton"," @param {Node} button The button node to insert into this widget's DOM."," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @param {Number} index Index at which the `button` should be positioned."," @protected"," @since 3.5.0"," **/"," _uiInsertButton: function (button, section, index) {"," var buttonsClassName = WidgetButtons.CLASS_NAMES.button,"," buttonContainer = this._getButtonContainer(section, true),"," sectionButtons = buttonContainer.all('.' + buttonsClassName);",""," // Inserts the button node at the correct index."," buttonContainer.insertBefore(button, sectionButtons.item(index));",""," // Adds the button container to the section content."," this.setStdModContent(section, buttonContainer, 'after');"," },",""," /**"," Removes the button node from this widget's DOM and detaches any event"," subscriptions on the button that were created by this widget. The section"," content will be updated unless `{preserveContent: true}` is passed in the"," `options`.",""," By default the button container node will be removed when this removes the"," last button of the specified `section`; and if no other content remains in"," the section node, it will also be removed.",""," @method _uiRemoveButton"," @param {Node} button The button to remove and destroy."," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @param {Object} [options] Additional options."," @param {Boolean} [options.preserveContent=false] Whether the section"," content should be updated."," @protected"," @since 3.5.0"," **/"," _uiRemoveButton: function (button, section, options) {"," var yuid = Y.stamp(button, this),"," handles = this._buttonsHandles,"," handle = handles[yuid],"," buttonContainer, buttonClassName;",""," if (handle) {"," handle.detach();"," }",""," delete handles[yuid];",""," button.remove();",""," options || (options = {});",""," // Remove the button container and section nodes if needed."," if (!options.preserveContent) {"," buttonContainer = this._getButtonContainer(section);"," buttonClassName = WidgetButtons.CLASS_NAMES.button;",""," // Only matters if we have a button container which is empty."," if (buttonContainer &&"," buttonContainer.all('.' + buttonClassName).isEmpty()) {",""," buttonContainer.remove();"," this._updateContentButtons(section);"," }"," }"," },",""," /**"," Sets the current `buttons` state to this widget's DOM by rendering the"," specified collection of `buttons` and updates the contents of each section"," as needed.",""," Button nodes which already exist in the DOM will remain intact, or will be"," moved if they should be in a new position. Old button nodes which are no"," longer represented in the specified `buttons` collection will be removed,"," and any event subscriptions on the button which were created by this widget"," will be detached.",""," If the button nodes in this widget's DOM actually change, then each content"," section will be updated (or removed) appropriately.",""," @method _uiSetButtons"," @param {Object} buttons The current `buttons` state to visually represent."," @protected"," @since 3.5.0"," **/"," _uiSetButtons: function (buttons) {"," var buttonClassName = WidgetButtons.CLASS_NAMES.button,"," sections = ['header', 'body', 'footer'];",""," YArray.each(sections, function (section) {"," var sectionButtons = buttons[section] || [],"," numButtons = sectionButtons.length,"," buttonContainer = this._getButtonContainer(section, numButtons),"," buttonsUpdated = false,"," oldNodes, i, button, buttonIndex;",""," // When there's no button container, there are no new buttons or old"," // buttons that we have to deal with for this section."," if (!buttonContainer) { return; }",""," oldNodes = buttonContainer.all('.' + buttonClassName);",""," for (i = 0; i < numButtons; i += 1) {"," button = sectionButtons[i];"," buttonIndex = oldNodes.indexOf(button);",""," // Buttons already rendered in the Widget should remain there or"," // moved to their new index. New buttons will be added to the"," // current `buttonContainer`."," if (buttonIndex > -1) {"," // Remove button from existing buttons nodeList since its in"," // the DOM already."," oldNodes.splice(buttonIndex, 1);",""," // Check that the button is at the right position, if not,"," // move it to its new position."," if (buttonIndex !== i) {"," // Using `i + 1` because the button should be at index"," // `i`; it's inserted before the node which comes after."," buttonContainer.insertBefore(button, i + 1);"," buttonsUpdated = true;"," }"," } else {"," buttonContainer.appendChild(button);"," buttonsUpdated = true;"," }"," }",""," // Safely removes the old button nodes which are no longer part of"," // this widget's `buttons`."," oldNodes.each(function (button) {"," this._uiRemoveButton(button, section, {preserveContent: true});"," buttonsUpdated = true;"," }, this);",""," // Remove leftover empty button containers and updated the StdMod"," // content area."," if (numButtons === 0) {"," buttonContainer.remove();"," this._updateContentButtons(section);"," return;"," }",""," // Adds the button container to the section content."," if (buttonsUpdated) {"," this.setStdModContent(section, buttonContainer, 'after');"," }"," }, this);"," },",""," /**"," Adds the \"yui3-button-primary\" CSS class to the new `defaultButton` and"," removes it from the old default button.",""," @method _uiSetDefaultButton"," @param {Node} newButton The new `defaultButton`."," @param {Node} oldButton The old `defaultButton`."," @protected"," @since 3.5.0"," **/"," _uiSetDefaultButton: function (newButton, oldButton) {"," var primaryClassName = WidgetButtons.CLASS_NAMES.primary;",""," if (newButton) { newButton.addClass(primaryClassName); }"," if (oldButton) { oldButton.removeClass(primaryClassName); }"," },",""," /**"," Focuses this widget's `defaultButton` if there is one and this widget is"," visible.",""," @method _uiSetVisibleButtons"," @param {Boolean} visible Whether this widget is visible."," @protected"," @since 3.5.0"," **/"," _uiSetVisibleButtons: function (visible) {"," if (!visible) { return; }",""," var defaultButton = this.get('defaultButton');"," if (defaultButton) {"," defaultButton.focus();"," }"," },",""," /**"," Removes the specified `button` from the buttons map (both name -> button and"," section:name -> button), and nulls-out the `defaultButton` if it is"," currently the default button.",""," @method _unMapButton"," @param {Node} button The button node to remove from the buttons map."," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @protected"," @since 3.5.0"," **/"," _unMapButton: function (button, section) {"," var map = this._buttonsMap,"," name = this._getButtonName(button),"," sectionName;",""," // Only delete the map entry if the specified `button` is mapped to it."," if (name) {"," // name -> button"," if (map[name] === button) {"," delete map[name];"," }",""," // section:name -> button"," sectionName = section + ':' + name;"," if (map[sectionName] === button) {"," delete map[sectionName];"," }"," }",""," // Clear the default button if its the specified `button`."," if (this._defaultButton === button) {"," this._defaultButton = null;"," }"," },",""," /**"," Updates the `defaultButton` attribute if it needs to be updated by comparing"," its current value with the protected `_defaultButton` property.",""," @method _updateDefaultButton"," @protected"," @since 3.5.0"," **/"," _updateDefaultButton: function () {"," var defaultButton = this._defaultButton;",""," if (this.get('defaultButton') !== defaultButton) {"," this._set('defaultButton', defaultButton);"," }"," },",""," /**"," Updates the content attribute which corresponds to the specified `section`.",""," The method updates the section's content to its current `childNodes`"," (text and/or HTMLElement), or will null-out its contents if the section is"," empty. It also specifies a `src` of `buttons` on the change event facade.",""," @method _updateContentButtons"," @param {String} section The `WidgetStdMod` section (header/body/footer) to"," update."," @protected"," @since 3.5.0"," **/"," _updateContentButtons: function (section) {"," // `childNodes` return text nodes and HTMLElements."," var sectionContent = this.getStdModNode(section).get('childNodes');",""," // Updates the section to its current contents, or null if it is empty."," this.set(section + 'Content', sectionContent.isEmpty() ? null :"," sectionContent, {src: 'buttons'});"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles this widget's `buttonsChange` event which fires anytime the"," `buttons` attribute is modified.",""," **Note:** This method special-cases the `buttons` modifications caused by"," `addButton()` and `removeButton()`, both of which set the `src` property on"," the event facade to \"add\" and \"remove\" respectively.",""," @method _afterButtonsChange"," @param {EventFacade} e"," @protected"," @since 3.4.0"," **/"," _afterButtonsChange: function (e) {"," var buttons = e.newVal,"," section = e.section,"," index = e.index,"," src = e.src,"," button;",""," // Special cases `addButton()` to only set and insert the new button."," if (src === 'add') {"," // Make sure we have the button node."," button = buttons[section][index];",""," this._mapButton(button, section);"," this._updateDefaultButton();"," this._uiInsertButton(button, section, index);",""," return;"," }",""," // Special cases `removeButton()` to only remove the specified button."," if (src === 'remove') {"," // Button node already exists on the event facade."," button = e.button;",""," this._unMapButton(button, section);"," this._updateDefaultButton();"," this._uiRemoveButton(button, section);",""," return;"," }",""," this._mapButtons(buttons);"," this._updateDefaultButton();"," this._uiSetButtons(buttons);"," },",""," /**"," Handles this widget's `headerContentChange`, `bodyContentChange`,"," `footerContentChange` events by making sure the `buttons` remain rendered"," after changes to the content areas.",""," These events are very chatty, so extra caution is taken to avoid doing extra"," work or getting into an infinite loop.",""," @method _afterContentChangeButtons"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterContentChangeButtons: function (e) {"," var src = e.src,"," pos = e.stdModPosition,"," replace = !pos || pos === WidgetStdMod.REPLACE;",""," // Only do work when absolutely necessary."," if (replace && src !== 'buttons' && src !== Widget.UI_SRC) {"," this._uiSetButtons(this.get('buttons'));"," }"," },",""," /**"," Handles this widget's `defaultButtonChange` event by adding the"," \"yui3-button-primary\" CSS class to the new `defaultButton` and removing it"," from the old default button.",""," @method _afterDefaultButtonChange"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterDefaultButtonChange: function (e) {"," this._uiSetDefaultButton(e.newVal, e.prevVal);"," },",""," /**"," Handles this widget's `visibleChange` event by focusing the `defaultButton`"," if there is one.",""," @method _afterVisibleChangeButtons"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterVisibleChangeButtons: function (e) {"," this._uiSetVisibleButtons(e.newVal);"," }","};","","Y.WidgetButtons = WidgetButtons;","","","}, '@VERSION@', {\"requires\": [\"button-plugin\", \"cssbutton\", \"widget-stdmod\"]});","","}());"]}; } var __cov_qZehDbyJMynHUgy8OljS4A = __coverage__['build/widget-buttons/widget-buttons.js']; -__cov_qZehDbyJMynHUgy8OljS4A.s['1']++;YUI.add('widget-buttons',function(Y,NAME){__cov_qZehDbyJMynHUgy8OljS4A.f['1']++;__cov_qZehDbyJMynHUgy8OljS4A.s['2']++;var YArray=Y.Array,YLang=Y.Lang,YObject=Y.Object,ButtonPlugin=Y.Plugin.Button,Widget=Y.Widget,WidgetStdMod=Y.WidgetStdMod,getClassName=Y.ClassNameManager.getClassName,isArray=YLang.isArray,isNumber=YLang.isNumber,isString=YLang.isString,isValue=YLang.isValue;__cov_qZehDbyJMynHUgy8OljS4A.s['3']++;function isNode(node){__cov_qZehDbyJMynHUgy8OljS4A.f['2']++;__cov_qZehDbyJMynHUgy8OljS4A.s['4']++;return!!node.getDOMNode;}__cov_qZehDbyJMynHUgy8OljS4A.s['5']++;function WidgetButtons(){__cov_qZehDbyJMynHUgy8OljS4A.f['3']++;__cov_qZehDbyJMynHUgy8OljS4A.s['6']++;if(!this._stdModNode){__cov_qZehDbyJMynHUgy8OljS4A.b['1'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['7']++;Y.error('WidgetStdMod must be added to a Widget before WidgetButtons.');}else{__cov_qZehDbyJMynHUgy8OljS4A.b['1'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['8']++;this._buttonsHandles={};}__cov_qZehDbyJMynHUgy8OljS4A.s['9']++;WidgetButtons.ATTRS={buttons:{getter:'_getButtons',setter:'_setButtons',value:{}},defaultButton:{readOnly:true,value:null}};__cov_qZehDbyJMynHUgy8OljS4A.s['10']++;WidgetButtons.CLASS_NAMES={button:getClassName('button'),buttons:Widget.getClassName('buttons'),primary:getClassName('button','primary')};__cov_qZehDbyJMynHUgy8OljS4A.s['11']++;WidgetButtons.HTML_PARSER={buttons:function(srcNode){__cov_qZehDbyJMynHUgy8OljS4A.f['4']++;__cov_qZehDbyJMynHUgy8OljS4A.s['12']++;return this._parseButtons(srcNode);}};__cov_qZehDbyJMynHUgy8OljS4A.s['13']++;WidgetButtons.NON_BUTTON_NODE_CFG=['action','classNames','context','events','isDefault','section'];__cov_qZehDbyJMynHUgy8OljS4A.s['14']++;WidgetButtons.prototype={BUTTONS:{},BUTTONS_TEMPLATE:'',DEFAULT_BUTTONS_SECTION:WidgetStdMod.FOOTER,initializer:function(){__cov_qZehDbyJMynHUgy8OljS4A.f['5']++;__cov_qZehDbyJMynHUgy8OljS4A.s['15']++;this._mapButtons(this.get('buttons'));__cov_qZehDbyJMynHUgy8OljS4A.s['16']++;this._updateDefaultButton();__cov_qZehDbyJMynHUgy8OljS4A.s['17']++;this.after({buttonsChange:Y.bind('_afterButtonsChange',this),defaultButtonChange:Y.bind('_afterDefaultButtonChange',this)});__cov_qZehDbyJMynHUgy8OljS4A.s['18']++;Y.after(this._bindUIButtons,this,'bindUI');__cov_qZehDbyJMynHUgy8OljS4A.s['19']++;Y.after(this._syncUIButtons,this,'syncUI');},destructor:function(){__cov_qZehDbyJMynHUgy8OljS4A.f['6']++;__cov_qZehDbyJMynHUgy8OljS4A.s['20']++;YObject.each(this._buttonsHandles,function(handle){__cov_qZehDbyJMynHUgy8OljS4A.f['7']++;__cov_qZehDbyJMynHUgy8OljS4A.s['21']++;handle.detach();});__cov_qZehDbyJMynHUgy8OljS4A.s['22']++;delete this._buttonsHandles;__cov_qZehDbyJMynHUgy8OljS4A.s['23']++;delete this._buttonsMap;__cov_qZehDbyJMynHUgy8OljS4A.s['24']++;delete this._defaultButton;},addButton:function(button,section,index){__cov_qZehDbyJMynHUgy8OljS4A.f['8']++;__cov_qZehDbyJMynHUgy8OljS4A.s['25']++;var buttons=this.get('buttons'),sectionButtons,atIndex;__cov_qZehDbyJMynHUgy8OljS4A.s['26']++;if(!isNode(button)){__cov_qZehDbyJMynHUgy8OljS4A.b['2'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['27']++;button=this._mergeButtonConfig(button);__cov_qZehDbyJMynHUgy8OljS4A.s['28']++;(__cov_qZehDbyJMynHUgy8OljS4A.b['3'][0]++,section)||(__cov_qZehDbyJMynHUgy8OljS4A.b['3'][1]++,section=button.section);}else{__cov_qZehDbyJMynHUgy8OljS4A.b['2'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['29']++;(__cov_qZehDbyJMynHUgy8OljS4A.b['4'][0]++,section)||(__cov_qZehDbyJMynHUgy8OljS4A.b['4'][1]++,section=this.DEFAULT_BUTTONS_SECTION);__cov_qZehDbyJMynHUgy8OljS4A.s['30']++;sectionButtons=(__cov_qZehDbyJMynHUgy8OljS4A.b['5'][0]++,buttons[section])||(__cov_qZehDbyJMynHUgy8OljS4A.b['5'][1]++,buttons[section]=[]);__cov_qZehDbyJMynHUgy8OljS4A.s['31']++;(__cov_qZehDbyJMynHUgy8OljS4A.b['6'][0]++,isNumber(index))||(__cov_qZehDbyJMynHUgy8OljS4A.b['6'][1]++,index=sectionButtons.length);__cov_qZehDbyJMynHUgy8OljS4A.s['32']++;sectionButtons.splice(index,0,button);__cov_qZehDbyJMynHUgy8OljS4A.s['33']++;atIndex=YArray.indexOf(sectionButtons,button);__cov_qZehDbyJMynHUgy8OljS4A.s['34']++;this.set('buttons',buttons,{button:button,section:section,index:atIndex,src:'add'});__cov_qZehDbyJMynHUgy8OljS4A.s['35']++;return this;},getButton:function(name,section){__cov_qZehDbyJMynHUgy8OljS4A.f['9']++;__cov_qZehDbyJMynHUgy8OljS4A.s['36']++;if(!isValue(name)){__cov_qZehDbyJMynHUgy8OljS4A.b['7'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['37']++;return;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['7'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['38']++;var map=this._buttonsMap,buttons;__cov_qZehDbyJMynHUgy8OljS4A.s['39']++;(__cov_qZehDbyJMynHUgy8OljS4A.b['8'][0]++,section)||(__cov_qZehDbyJMynHUgy8OljS4A.b['8'][1]++,section=this.DEFAULT_BUTTONS_SECTION);__cov_qZehDbyJMynHUgy8OljS4A.s['40']++;if(isNumber(name)){__cov_qZehDbyJMynHUgy8OljS4A.b['9'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['41']++;buttons=this.get('buttons');__cov_qZehDbyJMynHUgy8OljS4A.s['42']++;return(__cov_qZehDbyJMynHUgy8OljS4A.b['10'][0]++,buttons[section])&&(__cov_qZehDbyJMynHUgy8OljS4A.b['10'][1]++,buttons[section][name]);}else{__cov_qZehDbyJMynHUgy8OljS4A.b['9'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['43']++;return arguments.length>1?(__cov_qZehDbyJMynHUgy8OljS4A.b['11'][0]++,map[section+':'+name]):(__cov_qZehDbyJMynHUgy8OljS4A.b['11'][1]++,map[name]);},removeButton:function(button,section){__cov_qZehDbyJMynHUgy8OljS4A.f['10']++;__cov_qZehDbyJMynHUgy8OljS4A.s['44']++;if(!isValue(button)){__cov_qZehDbyJMynHUgy8OljS4A.b['12'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['45']++;return this;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['12'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['46']++;var buttons=this.get('buttons'),index;__cov_qZehDbyJMynHUgy8OljS4A.s['47']++;if(isNumber(button)){__cov_qZehDbyJMynHUgy8OljS4A.b['13'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['48']++;(__cov_qZehDbyJMynHUgy8OljS4A.b['14'][0]++,section)||(__cov_qZehDbyJMynHUgy8OljS4A.b['14'][1]++,section=this.DEFAULT_BUTTONS_SECTION);__cov_qZehDbyJMynHUgy8OljS4A.s['49']++;index=button;__cov_qZehDbyJMynHUgy8OljS4A.s['50']++;button=buttons[section][index];}else{__cov_qZehDbyJMynHUgy8OljS4A.b['13'][1]++;__cov_qZehDbyJMynHUgy8OljS4A.s['51']++;if(isString(button)){__cov_qZehDbyJMynHUgy8OljS4A.b['15'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['52']++;button=this.getButton.apply(this,arguments);}else{__cov_qZehDbyJMynHUgy8OljS4A.b['15'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['53']++;YObject.some(buttons,function(sectionButtons,currentSection){__cov_qZehDbyJMynHUgy8OljS4A.f['11']++;__cov_qZehDbyJMynHUgy8OljS4A.s['54']++;index=YArray.indexOf(sectionButtons,button);__cov_qZehDbyJMynHUgy8OljS4A.s['55']++;if(index>-1){__cov_qZehDbyJMynHUgy8OljS4A.b['16'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['56']++;section=currentSection;__cov_qZehDbyJMynHUgy8OljS4A.s['57']++;return true;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['16'][1]++;}});}__cov_qZehDbyJMynHUgy8OljS4A.s['58']++;if((__cov_qZehDbyJMynHUgy8OljS4A.b['18'][0]++,button)&&(__cov_qZehDbyJMynHUgy8OljS4A.b['18'][1]++,index>-1)){__cov_qZehDbyJMynHUgy8OljS4A.b['17'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['59']++;buttons[section].splice(index,1);__cov_qZehDbyJMynHUgy8OljS4A.s['60']++;this.set('buttons',buttons,{button:button,section:section,index:index,src:'remove'});}else{__cov_qZehDbyJMynHUgy8OljS4A.b['17'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['61']++;return this;},_bindUIButtons:function(){__cov_qZehDbyJMynHUgy8OljS4A.f['12']++;__cov_qZehDbyJMynHUgy8OljS4A.s['62']++;var afterContentChange=Y.bind('_afterContentChangeButtons',this);__cov_qZehDbyJMynHUgy8OljS4A.s['63']++;this.after({visibleChange:Y.bind('_afterVisibleChangeButtons',this),headerContentChange:afterContentChange,bodyContentChange:afterContentChange,footerContentChange:afterContentChange});},_createButton:function(button){__cov_qZehDbyJMynHUgy8OljS4A.f['13']++;__cov_qZehDbyJMynHUgy8OljS4A.s['64']++;var config,buttonConfig,nonButtonNodeCfg,i,len,action,context,handle;__cov_qZehDbyJMynHUgy8OljS4A.s['65']++;if(isNode(button)){__cov_qZehDbyJMynHUgy8OljS4A.b['19'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['66']++;return Y.one(button.getDOMNode()).plug(ButtonPlugin);}else{__cov_qZehDbyJMynHUgy8OljS4A.b['19'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['67']++;config=Y.merge({context:this,events:'click',label:button.value},button);__cov_qZehDbyJMynHUgy8OljS4A.s['68']++;buttonConfig=Y.merge(config);__cov_qZehDbyJMynHUgy8OljS4A.s['69']++;nonButtonNodeCfg=WidgetButtons.NON_BUTTON_NODE_CFG;__cov_qZehDbyJMynHUgy8OljS4A.s['70']++;for(i=0,len=nonButtonNodeCfg.length;i-1){__cov_qZehDbyJMynHUgy8OljS4A.b['56'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['190']++;oldNodes.splice(buttonIndex,1);__cov_qZehDbyJMynHUgy8OljS4A.s['191']++;if(buttonIndex!==i){__cov_qZehDbyJMynHUgy8OljS4A.b['57'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['192']++;buttonContainer.insertBefore(button,i+1);__cov_qZehDbyJMynHUgy8OljS4A.s['193']++;buttonsUpdated=true;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['57'][1]++;}}else{__cov_qZehDbyJMynHUgy8OljS4A.b['56'][1]++;__cov_qZehDbyJMynHUgy8OljS4A.s['194']++;buttonContainer.appendChild(button);__cov_qZehDbyJMynHUgy8OljS4A.s['195']++;buttonsUpdated=true;}}__cov_qZehDbyJMynHUgy8OljS4A.s['196']++;oldNodes.each(function(button){__cov_qZehDbyJMynHUgy8OljS4A.f['34']++;__cov_qZehDbyJMynHUgy8OljS4A.s['197']++;this._uiRemoveButton(button,section,{preserveContent:true});__cov_qZehDbyJMynHUgy8OljS4A.s['198']++;buttonsUpdated=true;},this);__cov_qZehDbyJMynHUgy8OljS4A.s['199']++;if(numButtons===0){__cov_qZehDbyJMynHUgy8OljS4A.b['58'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['200']++;buttonContainer.remove();__cov_qZehDbyJMynHUgy8OljS4A.s['201']++;this._updateContentButtons(section);__cov_qZehDbyJMynHUgy8OljS4A.s['202']++;return;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['58'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['203']++;if(buttonsUpdated){__cov_qZehDbyJMynHUgy8OljS4A.b['59'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['204']++;this.setStdModContent(section,buttonContainer,'after');}else{__cov_qZehDbyJMynHUgy8OljS4A.b['59'][1]++;}},this);},_uiSetDefaultButton:function(newButton,oldButton){__cov_qZehDbyJMynHUgy8OljS4A.f['35']++;__cov_qZehDbyJMynHUgy8OljS4A.s['205']++;var primaryClassName=WidgetButtons.CLASS_NAMES.primary;__cov_qZehDbyJMynHUgy8OljS4A.s['206']++;if(newButton){__cov_qZehDbyJMynHUgy8OljS4A.b['60'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['207']++;newButton.addClass(primaryClassName);}else{__cov_qZehDbyJMynHUgy8OljS4A.b['60'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['208']++;if(oldButton){__cov_qZehDbyJMynHUgy8OljS4A.b['61'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['209']++;oldButton.removeClass(primaryClassName);}else{__cov_qZehDbyJMynHUgy8OljS4A.b['61'][1]++;}},_uiSetVisibleButtons:function(visible){__cov_qZehDbyJMynHUgy8OljS4A.f['36']++;__cov_qZehDbyJMynHUgy8OljS4A.s['210']++;if(!visible){__cov_qZehDbyJMynHUgy8OljS4A.b['62'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['211']++;return;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['62'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['212']++;var defaultButton=this.get('defaultButton');__cov_qZehDbyJMynHUgy8OljS4A.s['213']++;if(defaultButton){__cov_qZehDbyJMynHUgy8OljS4A.b['63'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['214']++;defaultButton.focus();}else{__cov_qZehDbyJMynHUgy8OljS4A.b['63'][1]++;}},_unMapButton:function(button,section){__cov_qZehDbyJMynHUgy8OljS4A.f['37']++;__cov_qZehDbyJMynHUgy8OljS4A.s['215']++;var map=this._buttonsMap,name=this._getButtonName(button),sectionName;__cov_qZehDbyJMynHUgy8OljS4A.s['216']++;if(name){__cov_qZehDbyJMynHUgy8OljS4A.b['64'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['217']++;if(map[name]===button){__cov_qZehDbyJMynHUgy8OljS4A.b['65'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['218']++;delete map[name];}else{__cov_qZehDbyJMynHUgy8OljS4A.b['65'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['219']++;sectionName=section+':'+name;__cov_qZehDbyJMynHUgy8OljS4A.s['220']++;if(map[sectionName]===button){__cov_qZehDbyJMynHUgy8OljS4A.b['66'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['221']++;delete map[sectionName];}else{__cov_qZehDbyJMynHUgy8OljS4A.b['66'][1]++;}}else{__cov_qZehDbyJMynHUgy8OljS4A.b['64'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['222']++;if(this._defaultButton===button){__cov_qZehDbyJMynHUgy8OljS4A.b['67'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['223']++;this._defaultButton=null;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['67'][1]++;}},_updateDefaultButton:function(){__cov_qZehDbyJMynHUgy8OljS4A.f['38']++;__cov_qZehDbyJMynHUgy8OljS4A.s['224']++;var defaultButton=this._defaultButton;__cov_qZehDbyJMynHUgy8OljS4A.s['225']++;if(this.get('defaultButton')!==defaultButton){__cov_qZehDbyJMynHUgy8OljS4A.b['68'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['226']++;this._set('defaultButton',defaultButton);}else{__cov_qZehDbyJMynHUgy8OljS4A.b['68'][1]++;}},_updateContentButtons:function(section){__cov_qZehDbyJMynHUgy8OljS4A.f['39']++;__cov_qZehDbyJMynHUgy8OljS4A.s['227']++;var sectionContent=this.getStdModNode(section).get('childNodes');__cov_qZehDbyJMynHUgy8OljS4A.s['228']++;this.set(section+'Content',sectionContent.isEmpty()?(__cov_qZehDbyJMynHUgy8OljS4A.b['69'][0]++,null):(__cov_qZehDbyJMynHUgy8OljS4A.b['69'][1]++,sectionContent),{src:'buttons'});},_afterButtonsChange:function(e){__cov_qZehDbyJMynHUgy8OljS4A.f['40']++;__cov_qZehDbyJMynHUgy8OljS4A.s['229']++;var buttons=e.newVal,section=e.section,index=e.index,src=e.src,button;__cov_qZehDbyJMynHUgy8OljS4A.s['230']++;if(src==='add'){__cov_qZehDbyJMynHUgy8OljS4A.b['70'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['231']++;button=buttons[section][index];__cov_qZehDbyJMynHUgy8OljS4A.s['232']++;this._mapButton(button,section);__cov_qZehDbyJMynHUgy8OljS4A.s['233']++;this._updateDefaultButton();__cov_qZehDbyJMynHUgy8OljS4A.s['234']++;this._uiInsertButton(button,section,index);__cov_qZehDbyJMynHUgy8OljS4A.s['235']++;return;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['70'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['236']++;if(src==='remove'){__cov_qZehDbyJMynHUgy8OljS4A.b['71'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['237']++;button=e.button;__cov_qZehDbyJMynHUgy8OljS4A.s['238']++;this._unMapButton(button,section);__cov_qZehDbyJMynHUgy8OljS4A.s['239']++;this._updateDefaultButton();__cov_qZehDbyJMynHUgy8OljS4A.s['240']++;this._uiRemoveButton(button,section);__cov_qZehDbyJMynHUgy8OljS4A.s['241']++;return;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['71'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['242']++;this._mapButtons(buttons);__cov_qZehDbyJMynHUgy8OljS4A.s['243']++;this._updateDefaultButton();__cov_qZehDbyJMynHUgy8OljS4A.s['244']++;this._uiSetButtons(buttons);},_afterContentChangeButtons:function(e){__cov_qZehDbyJMynHUgy8OljS4A.f['41']++;__cov_qZehDbyJMynHUgy8OljS4A.s['245']++;var src=e.src,pos=e.stdModPosition,replace=(__cov_qZehDbyJMynHUgy8OljS4A.b['72'][0]++,!pos)||(__cov_qZehDbyJMynHUgy8OljS4A.b['72'][1]++,pos===WidgetStdMod.REPLACE);__cov_qZehDbyJMynHUgy8OljS4A.s['246']++;if((__cov_qZehDbyJMynHUgy8OljS4A.b['74'][0]++,replace)&&(__cov_qZehDbyJMynHUgy8OljS4A.b['74'][1]++,src!=='buttons')&&(__cov_qZehDbyJMynHUgy8OljS4A.b['74'][2]++,src!==Widget.UI_SRC)){__cov_qZehDbyJMynHUgy8OljS4A.b['73'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['247']++;this._uiSetButtons(this.get('buttons'));}else{__cov_qZehDbyJMynHUgy8OljS4A.b['73'][1]++;}},_afterDefaultButtonChange:function(e){__cov_qZehDbyJMynHUgy8OljS4A.f['42']++;__cov_qZehDbyJMynHUgy8OljS4A.s['248']++;this._uiSetDefaultButton(e.newVal,e.prevVal);},_afterVisibleChangeButtons:function(e){__cov_qZehDbyJMynHUgy8OljS4A.f['43']++;__cov_qZehDbyJMynHUgy8OljS4A.s['249']++;this._uiSetVisibleButtons(e.newVal);}};__cov_qZehDbyJMynHUgy8OljS4A.s['250']++;Y.WidgetButtons=WidgetButtons;},'@VERSION@',{'requires':['button-plugin','cssbutton','widget-stdmod']}); +__cov_qZehDbyJMynHUgy8OljS4A.s['1']++;YUI.add('widget-buttons',function(Y,NAME){__cov_qZehDbyJMynHUgy8OljS4A.f['1']++;__cov_qZehDbyJMynHUgy8OljS4A.s['2']++;var YArray=Y.Array,YLang=Y.Lang,YObject=Y.Object,ButtonPlugin=Y.Plugin.Button,Widget=Y.Widget,WidgetStdMod=Y.WidgetStdMod,getClassName=Y.ClassNameManager.getClassName,isArray=YLang.isArray,isNumber=YLang.isNumber,isString=YLang.isString,isValue=YLang.isValue;__cov_qZehDbyJMynHUgy8OljS4A.s['3']++;function isNode(node){__cov_qZehDbyJMynHUgy8OljS4A.f['2']++;__cov_qZehDbyJMynHUgy8OljS4A.s['4']++;return!!node.getDOMNode;}__cov_qZehDbyJMynHUgy8OljS4A.s['5']++;function WidgetButtons(){__cov_qZehDbyJMynHUgy8OljS4A.f['3']++;__cov_qZehDbyJMynHUgy8OljS4A.s['6']++;if(!this._stdModNode){__cov_qZehDbyJMynHUgy8OljS4A.b['1'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['7']++;Y.error('WidgetStdMod must be added to a Widget before WidgetButtons.');}else{__cov_qZehDbyJMynHUgy8OljS4A.b['1'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['8']++;this._buttonsHandles={};}__cov_qZehDbyJMynHUgy8OljS4A.s['9']++;WidgetButtons.ATTRS={buttons:{getter:'_getButtons',setter:'_setButtons',value:{}},defaultButton:{readOnly:true,value:null}};__cov_qZehDbyJMynHUgy8OljS4A.s['10']++;WidgetButtons.CLASS_NAMES={button:getClassName('button'),buttons:Widget.getClassName('buttons'),primary:getClassName('button','primary')};__cov_qZehDbyJMynHUgy8OljS4A.s['11']++;WidgetButtons.HTML_PARSER={buttons:function(srcNode){__cov_qZehDbyJMynHUgy8OljS4A.f['4']++;__cov_qZehDbyJMynHUgy8OljS4A.s['12']++;return this._parseButtons(srcNode);}};__cov_qZehDbyJMynHUgy8OljS4A.s['13']++;WidgetButtons.NON_BUTTON_NODE_CFG=['action','classNames','context','events','isDefault','section'];__cov_qZehDbyJMynHUgy8OljS4A.s['14']++;WidgetButtons.prototype={BUTTONS:{},BUTTONS_TEMPLATE:'',DEFAULT_BUTTONS_SECTION:WidgetStdMod.FOOTER,initializer:function(){__cov_qZehDbyJMynHUgy8OljS4A.f['5']++;__cov_qZehDbyJMynHUgy8OljS4A.s['15']++;this._mapButtons(this.get('buttons'));__cov_qZehDbyJMynHUgy8OljS4A.s['16']++;this._updateDefaultButton();__cov_qZehDbyJMynHUgy8OljS4A.s['17']++;this.after({buttonsChange:Y.bind('_afterButtonsChange',this),defaultButtonChange:Y.bind('_afterDefaultButtonChange',this)});__cov_qZehDbyJMynHUgy8OljS4A.s['18']++;Y.after(this._bindUIButtons,this,'bindUI');__cov_qZehDbyJMynHUgy8OljS4A.s['19']++;Y.after(this._syncUIButtons,this,'syncUI');},destructor:function(){__cov_qZehDbyJMynHUgy8OljS4A.f['6']++;__cov_qZehDbyJMynHUgy8OljS4A.s['20']++;YObject.each(this._buttonsHandles,function(handle){__cov_qZehDbyJMynHUgy8OljS4A.f['7']++;__cov_qZehDbyJMynHUgy8OljS4A.s['21']++;handle.detach();});__cov_qZehDbyJMynHUgy8OljS4A.s['22']++;delete this._buttonsHandles;__cov_qZehDbyJMynHUgy8OljS4A.s['23']++;delete this._buttonsMap;__cov_qZehDbyJMynHUgy8OljS4A.s['24']++;delete this._defaultButton;},addButton:function(button,section,index){__cov_qZehDbyJMynHUgy8OljS4A.f['8']++;__cov_qZehDbyJMynHUgy8OljS4A.s['25']++;var buttons=this.get('buttons'),sectionButtons,atIndex;__cov_qZehDbyJMynHUgy8OljS4A.s['26']++;if(!isNode(button)){__cov_qZehDbyJMynHUgy8OljS4A.b['2'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['27']++;button=this._mergeButtonConfig(button);__cov_qZehDbyJMynHUgy8OljS4A.s['28']++;(__cov_qZehDbyJMynHUgy8OljS4A.b['3'][0]++,section)||(__cov_qZehDbyJMynHUgy8OljS4A.b['3'][1]++,section=button.section);}else{__cov_qZehDbyJMynHUgy8OljS4A.b['2'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['29']++;(__cov_qZehDbyJMynHUgy8OljS4A.b['4'][0]++,section)||(__cov_qZehDbyJMynHUgy8OljS4A.b['4'][1]++,section=this.DEFAULT_BUTTONS_SECTION);__cov_qZehDbyJMynHUgy8OljS4A.s['30']++;sectionButtons=(__cov_qZehDbyJMynHUgy8OljS4A.b['5'][0]++,buttons[section])||(__cov_qZehDbyJMynHUgy8OljS4A.b['5'][1]++,buttons[section]=[]);__cov_qZehDbyJMynHUgy8OljS4A.s['31']++;(__cov_qZehDbyJMynHUgy8OljS4A.b['6'][0]++,isNumber(index))||(__cov_qZehDbyJMynHUgy8OljS4A.b['6'][1]++,index=sectionButtons.length);__cov_qZehDbyJMynHUgy8OljS4A.s['32']++;sectionButtons.splice(index,0,button);__cov_qZehDbyJMynHUgy8OljS4A.s['33']++;atIndex=YArray.indexOf(sectionButtons,button);__cov_qZehDbyJMynHUgy8OljS4A.s['34']++;this.set('buttons',buttons,{button:button,section:section,index:atIndex,src:'add'});__cov_qZehDbyJMynHUgy8OljS4A.s['35']++;return this;},getButton:function(name,section){__cov_qZehDbyJMynHUgy8OljS4A.f['9']++;__cov_qZehDbyJMynHUgy8OljS4A.s['36']++;if(!isValue(name)){__cov_qZehDbyJMynHUgy8OljS4A.b['7'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['37']++;return;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['7'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['38']++;var map=this._buttonsMap,buttons;__cov_qZehDbyJMynHUgy8OljS4A.s['39']++;(__cov_qZehDbyJMynHUgy8OljS4A.b['8'][0]++,section)||(__cov_qZehDbyJMynHUgy8OljS4A.b['8'][1]++,section=this.DEFAULT_BUTTONS_SECTION);__cov_qZehDbyJMynHUgy8OljS4A.s['40']++;if(isNumber(name)){__cov_qZehDbyJMynHUgy8OljS4A.b['9'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['41']++;buttons=this.get('buttons');__cov_qZehDbyJMynHUgy8OljS4A.s['42']++;return(__cov_qZehDbyJMynHUgy8OljS4A.b['10'][0]++,buttons[section])&&(__cov_qZehDbyJMynHUgy8OljS4A.b['10'][1]++,buttons[section][name]);}else{__cov_qZehDbyJMynHUgy8OljS4A.b['9'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['43']++;return arguments.length>1?(__cov_qZehDbyJMynHUgy8OljS4A.b['11'][0]++,map[section+':'+name]):(__cov_qZehDbyJMynHUgy8OljS4A.b['11'][1]++,map[name]);},removeButton:function(button,section){__cov_qZehDbyJMynHUgy8OljS4A.f['10']++;__cov_qZehDbyJMynHUgy8OljS4A.s['44']++;if(!isValue(button)){__cov_qZehDbyJMynHUgy8OljS4A.b['12'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['45']++;return this;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['12'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['46']++;var buttons=this.get('buttons'),index;__cov_qZehDbyJMynHUgy8OljS4A.s['47']++;if(isNumber(button)){__cov_qZehDbyJMynHUgy8OljS4A.b['13'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['48']++;(__cov_qZehDbyJMynHUgy8OljS4A.b['14'][0]++,section)||(__cov_qZehDbyJMynHUgy8OljS4A.b['14'][1]++,section=this.DEFAULT_BUTTONS_SECTION);__cov_qZehDbyJMynHUgy8OljS4A.s['49']++;index=button;__cov_qZehDbyJMynHUgy8OljS4A.s['50']++;button=buttons[section][index];}else{__cov_qZehDbyJMynHUgy8OljS4A.b['13'][1]++;__cov_qZehDbyJMynHUgy8OljS4A.s['51']++;if(isString(button)){__cov_qZehDbyJMynHUgy8OljS4A.b['15'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['52']++;button=this.getButton.apply(this,arguments);}else{__cov_qZehDbyJMynHUgy8OljS4A.b['15'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['53']++;YObject.some(buttons,function(sectionButtons,currentSection){__cov_qZehDbyJMynHUgy8OljS4A.f['11']++;__cov_qZehDbyJMynHUgy8OljS4A.s['54']++;index=YArray.indexOf(sectionButtons,button);__cov_qZehDbyJMynHUgy8OljS4A.s['55']++;if(index>-1){__cov_qZehDbyJMynHUgy8OljS4A.b['16'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['56']++;section=currentSection;__cov_qZehDbyJMynHUgy8OljS4A.s['57']++;return true;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['16'][1]++;}});}__cov_qZehDbyJMynHUgy8OljS4A.s['58']++;if((__cov_qZehDbyJMynHUgy8OljS4A.b['18'][0]++,button)&&(__cov_qZehDbyJMynHUgy8OljS4A.b['18'][1]++,index>-1)){__cov_qZehDbyJMynHUgy8OljS4A.b['17'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['59']++;buttons[section].splice(index,1);__cov_qZehDbyJMynHUgy8OljS4A.s['60']++;this.set('buttons',buttons,{button:button,section:section,index:index,src:'remove'});}else{__cov_qZehDbyJMynHUgy8OljS4A.b['17'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['61']++;return this;},_bindUIButtons:function(){__cov_qZehDbyJMynHUgy8OljS4A.f['12']++;__cov_qZehDbyJMynHUgy8OljS4A.s['62']++;var afterContentChange=Y.bind('_afterContentChangeButtons',this);__cov_qZehDbyJMynHUgy8OljS4A.s['63']++;this.after({visibleChange:Y.bind('_afterVisibleChangeButtons',this),headerContentChange:afterContentChange,bodyContentChange:afterContentChange,footerContentChange:afterContentChange});},_createButton:function(button){__cov_qZehDbyJMynHUgy8OljS4A.f['13']++;__cov_qZehDbyJMynHUgy8OljS4A.s['64']++;var config,buttonConfig,nonButtonNodeCfg,i,len,action,context,handle;__cov_qZehDbyJMynHUgy8OljS4A.s['65']++;if(isNode(button)){__cov_qZehDbyJMynHUgy8OljS4A.b['19'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['66']++;return Y.one(button.getDOMNode()).plug(ButtonPlugin);}else{__cov_qZehDbyJMynHUgy8OljS4A.b['19'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['67']++;config=Y.merge({context:this,events:'click',label:button.value},button);__cov_qZehDbyJMynHUgy8OljS4A.s['68']++;buttonConfig=Y.merge(config);__cov_qZehDbyJMynHUgy8OljS4A.s['69']++;nonButtonNodeCfg=WidgetButtons.NON_BUTTON_NODE_CFG;__cov_qZehDbyJMynHUgy8OljS4A.s['70']++;for(i=0,len=nonButtonNodeCfg.length;i-1){__cov_qZehDbyJMynHUgy8OljS4A.b['55'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['189']++;oldNodes.splice(buttonIndex,1);__cov_qZehDbyJMynHUgy8OljS4A.s['190']++;if(buttonIndex!==i){__cov_qZehDbyJMynHUgy8OljS4A.b['56'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['191']++;buttonContainer.insertBefore(button,i+1);__cov_qZehDbyJMynHUgy8OljS4A.s['192']++;buttonsUpdated=true;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['56'][1]++;}}else{__cov_qZehDbyJMynHUgy8OljS4A.b['55'][1]++;__cov_qZehDbyJMynHUgy8OljS4A.s['193']++;buttonContainer.appendChild(button);__cov_qZehDbyJMynHUgy8OljS4A.s['194']++;buttonsUpdated=true;}}__cov_qZehDbyJMynHUgy8OljS4A.s['195']++;oldNodes.each(function(button){__cov_qZehDbyJMynHUgy8OljS4A.f['34']++;__cov_qZehDbyJMynHUgy8OljS4A.s['196']++;this._uiRemoveButton(button,section,{preserveContent:true});__cov_qZehDbyJMynHUgy8OljS4A.s['197']++;buttonsUpdated=true;},this);__cov_qZehDbyJMynHUgy8OljS4A.s['198']++;if(numButtons===0){__cov_qZehDbyJMynHUgy8OljS4A.b['57'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['199']++;buttonContainer.remove();__cov_qZehDbyJMynHUgy8OljS4A.s['200']++;this._updateContentButtons(section);__cov_qZehDbyJMynHUgy8OljS4A.s['201']++;return;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['57'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['202']++;if(buttonsUpdated){__cov_qZehDbyJMynHUgy8OljS4A.b['58'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['203']++;this.setStdModContent(section,buttonContainer,'after');}else{__cov_qZehDbyJMynHUgy8OljS4A.b['58'][1]++;}},this);},_uiSetDefaultButton:function(newButton,oldButton){__cov_qZehDbyJMynHUgy8OljS4A.f['35']++;__cov_qZehDbyJMynHUgy8OljS4A.s['204']++;var primaryClassName=WidgetButtons.CLASS_NAMES.primary;__cov_qZehDbyJMynHUgy8OljS4A.s['205']++;if(newButton){__cov_qZehDbyJMynHUgy8OljS4A.b['59'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['206']++;newButton.addClass(primaryClassName);}else{__cov_qZehDbyJMynHUgy8OljS4A.b['59'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['207']++;if(oldButton){__cov_qZehDbyJMynHUgy8OljS4A.b['60'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['208']++;oldButton.removeClass(primaryClassName);}else{__cov_qZehDbyJMynHUgy8OljS4A.b['60'][1]++;}},_uiSetVisibleButtons:function(visible){__cov_qZehDbyJMynHUgy8OljS4A.f['36']++;__cov_qZehDbyJMynHUgy8OljS4A.s['209']++;if(!visible){__cov_qZehDbyJMynHUgy8OljS4A.b['61'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['210']++;return;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['61'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['211']++;var defaultButton=this.get('defaultButton');__cov_qZehDbyJMynHUgy8OljS4A.s['212']++;if(defaultButton){__cov_qZehDbyJMynHUgy8OljS4A.b['62'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['213']++;defaultButton.focus();}else{__cov_qZehDbyJMynHUgy8OljS4A.b['62'][1]++;}},_unMapButton:function(button,section){__cov_qZehDbyJMynHUgy8OljS4A.f['37']++;__cov_qZehDbyJMynHUgy8OljS4A.s['214']++;var map=this._buttonsMap,name=this._getButtonName(button),sectionName;__cov_qZehDbyJMynHUgy8OljS4A.s['215']++;if(name){__cov_qZehDbyJMynHUgy8OljS4A.b['63'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['216']++;if(map[name]===button){__cov_qZehDbyJMynHUgy8OljS4A.b['64'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['217']++;delete map[name];}else{__cov_qZehDbyJMynHUgy8OljS4A.b['64'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['218']++;sectionName=section+':'+name;__cov_qZehDbyJMynHUgy8OljS4A.s['219']++;if(map[sectionName]===button){__cov_qZehDbyJMynHUgy8OljS4A.b['65'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['220']++;delete map[sectionName];}else{__cov_qZehDbyJMynHUgy8OljS4A.b['65'][1]++;}}else{__cov_qZehDbyJMynHUgy8OljS4A.b['63'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['221']++;if(this._defaultButton===button){__cov_qZehDbyJMynHUgy8OljS4A.b['66'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['222']++;this._defaultButton=null;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['66'][1]++;}},_updateDefaultButton:function(){__cov_qZehDbyJMynHUgy8OljS4A.f['38']++;__cov_qZehDbyJMynHUgy8OljS4A.s['223']++;var defaultButton=this._defaultButton;__cov_qZehDbyJMynHUgy8OljS4A.s['224']++;if(this.get('defaultButton')!==defaultButton){__cov_qZehDbyJMynHUgy8OljS4A.b['67'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['225']++;this._set('defaultButton',defaultButton);}else{__cov_qZehDbyJMynHUgy8OljS4A.b['67'][1]++;}},_updateContentButtons:function(section){__cov_qZehDbyJMynHUgy8OljS4A.f['39']++;__cov_qZehDbyJMynHUgy8OljS4A.s['226']++;var sectionContent=this.getStdModNode(section).get('childNodes');__cov_qZehDbyJMynHUgy8OljS4A.s['227']++;this.set(section+'Content',sectionContent.isEmpty()?(__cov_qZehDbyJMynHUgy8OljS4A.b['68'][0]++,null):(__cov_qZehDbyJMynHUgy8OljS4A.b['68'][1]++,sectionContent),{src:'buttons'});},_afterButtonsChange:function(e){__cov_qZehDbyJMynHUgy8OljS4A.f['40']++;__cov_qZehDbyJMynHUgy8OljS4A.s['228']++;var buttons=e.newVal,section=e.section,index=e.index,src=e.src,button;__cov_qZehDbyJMynHUgy8OljS4A.s['229']++;if(src==='add'){__cov_qZehDbyJMynHUgy8OljS4A.b['69'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['230']++;button=buttons[section][index];__cov_qZehDbyJMynHUgy8OljS4A.s['231']++;this._mapButton(button,section);__cov_qZehDbyJMynHUgy8OljS4A.s['232']++;this._updateDefaultButton();__cov_qZehDbyJMynHUgy8OljS4A.s['233']++;this._uiInsertButton(button,section,index);__cov_qZehDbyJMynHUgy8OljS4A.s['234']++;return;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['69'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['235']++;if(src==='remove'){__cov_qZehDbyJMynHUgy8OljS4A.b['70'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['236']++;button=e.button;__cov_qZehDbyJMynHUgy8OljS4A.s['237']++;this._unMapButton(button,section);__cov_qZehDbyJMynHUgy8OljS4A.s['238']++;this._updateDefaultButton();__cov_qZehDbyJMynHUgy8OljS4A.s['239']++;this._uiRemoveButton(button,section);__cov_qZehDbyJMynHUgy8OljS4A.s['240']++;return;}else{__cov_qZehDbyJMynHUgy8OljS4A.b['70'][1]++;}__cov_qZehDbyJMynHUgy8OljS4A.s['241']++;this._mapButtons(buttons);__cov_qZehDbyJMynHUgy8OljS4A.s['242']++;this._updateDefaultButton();__cov_qZehDbyJMynHUgy8OljS4A.s['243']++;this._uiSetButtons(buttons);},_afterContentChangeButtons:function(e){__cov_qZehDbyJMynHUgy8OljS4A.f['41']++;__cov_qZehDbyJMynHUgy8OljS4A.s['244']++;var src=e.src,pos=e.stdModPosition,replace=(__cov_qZehDbyJMynHUgy8OljS4A.b['71'][0]++,!pos)||(__cov_qZehDbyJMynHUgy8OljS4A.b['71'][1]++,pos===WidgetStdMod.REPLACE);__cov_qZehDbyJMynHUgy8OljS4A.s['245']++;if((__cov_qZehDbyJMynHUgy8OljS4A.b['73'][0]++,replace)&&(__cov_qZehDbyJMynHUgy8OljS4A.b['73'][1]++,src!=='buttons')&&(__cov_qZehDbyJMynHUgy8OljS4A.b['73'][2]++,src!==Widget.UI_SRC)){__cov_qZehDbyJMynHUgy8OljS4A.b['72'][0]++;__cov_qZehDbyJMynHUgy8OljS4A.s['246']++;this._uiSetButtons(this.get('buttons'));}else{__cov_qZehDbyJMynHUgy8OljS4A.b['72'][1]++;}},_afterDefaultButtonChange:function(e){__cov_qZehDbyJMynHUgy8OljS4A.f['42']++;__cov_qZehDbyJMynHUgy8OljS4A.s['247']++;this._uiSetDefaultButton(e.newVal,e.prevVal);},_afterVisibleChangeButtons:function(e){__cov_qZehDbyJMynHUgy8OljS4A.f['43']++;__cov_qZehDbyJMynHUgy8OljS4A.s['248']++;this._uiSetVisibleButtons(e.newVal);}};__cov_qZehDbyJMynHUgy8OljS4A.s['249']++;Y.WidgetButtons=WidgetButtons;},'@VERSION@',{'requires':['button-plugin','cssbutton','widget-stdmod']}); diff --git a/build/widget-buttons/widget-buttons-debug.js b/build/widget-buttons/widget-buttons-debug.js index 027da5a7dc9..3ad31fb65f2 100644 --- a/build/widget-buttons/widget-buttons-debug.js +++ b/build/widget-buttons/widget-buttons-debug.js @@ -606,16 +606,14 @@ WidgetButtons.prototype = { containerSelector = '.' + sectionClassName + ' .' + buttonsClassName; // Search only inside the current widget - contentBox.all(containerSelector).each(function(node, index) { - var widget; + contentBox.all(containerSelector).some(function(node){ + var widget = Y.Widget.getByNode(node), + isBelongs = !widget || widget === this; - if (!container) { - widget = Y.Widget.getByNode(node); - - if (!widget || widget === this) { - container = node; - } + if (isBelongs) { + container = node; } + return isBelongs; }, this); // Create the `container` if it doesn't already exist. diff --git a/build/widget-buttons/widget-buttons-min.js b/build/widget-buttons/widget-buttons-min.js index b7d39906901..924e5a4031d 100644 --- a/build/widget-buttons/widget-buttons-min.js +++ b/build/widget-buttons/widget-buttons-min.js @@ -1,2 +1,2 @@ -YUI.add("widget-buttons",function(e,t){function p(e){return!!e.getDOMNode}function d(){this._stdModNode||e.error("WidgetStdMod must be added to a Widget before WidgetButtons."),this._buttonsHandles={}}var n=e.Array,r=e.Lang,i=e.Object,s=e.Plugin.Button,o=e.Widget,u=e.WidgetStdMod,a=e.ClassNameManager.getClassName,f=r.isArray,l=r.isNumber,c=r.isString,h=r.isValue;d.ATTRS={buttons:{getter:"_getButtons",setter:"_setButtons",value:{}},defaultButton:{readOnly:!0,value:null}},d.CLASS_NAMES={button:a("button"),buttons:o.getClassName("buttons"),primary:a("button","primary")},d.HTML_PARSER={buttons:function(e){return this._parseButtons(e)}},d.NON_BUTTON_NODE_CFG=["action","classNames","context","events","isDefault","section"],d.prototype={BUTTONS:{},BUTTONS_TEMPLATE:"",DEFAULT_BUTTONS_SECTION:u.FOOTER,initializer:function(){this._mapButtons(this.get("buttons")),this._updateDefaultButton(),this.after({buttonsChange:e.bind("_afterButtonsChange",this),defaultButtonChange:e.bind("_afterDefaultButtonChange",this)}),e.after(this._bindUIButtons,this,"bindUI"),e.after(this._syncUIButtons,this,"syncUI")},destructor:function(){i.each(this._buttonsHandles,function(e){e.detach()}),delete this._buttonsHandles,delete this._buttonsMap,delete this._defaultButton},addButton:function(e,t,r){var i=this.get("buttons"),s,o;return p(e)||(e=this._mergeButtonConfig(e),t||(t=e.section)),t||(t=this.DEFAULT_BUTTONS_SECTION),s=i[t]||(i[t]=[]),l(r)||(r=s.length),s.splice(r,0,e),o=n.indexOf(s,e),this.set("buttons",i,{button:e,section:t,index:o,src:"add"}),this},getButton:function(e,t){if(!h(e))return;var n=this._buttonsMap,r;return t||(t=this.DEFAULT_BUTTONS_SECTION),l(e)?(r=this.get("buttons"),r[t]&&r[t][e]):arguments.length>1?n[t+":"+e]:n[e]},removeButton:function(e,t){if(!h(e))return this;var r=this.get("buttons"),s;return l(e)?(t||(t=this.DEFAULT_BUTTONS_SECTION),s=e,e=r[t][s]):(c(e)&&(e=this.getButton.apply(this,arguments)),i.some(r,function(r,i){s=n.indexOf(r,e);if(s>-1)return t=i,!0})),e&&s>-1&&(r[t].splice(s,1),this.set("buttons",r,{button:e,section:t,index:s,src:"remove"})),this},_bindUIButtons:function(){var t=e.bind("_afterContentChangeButtons",this);this.after({visibleChange:e.bind("_afterVisibleChangeButtons",this),headerContentChange:t,bodyContentChange:t,footerContentChange:t})},_createButton:function(t){var r,i,o,u,a,f,l,h;if(p(t))return e.one(t.getDOMNode()).plug(s);r=e.merge({context:this,events:"click",label:t.value},t),i=e.merge(r),o=d.NON_BUTTON_NODE_CFG;for(u=0,a=o.length;u-1?(u.splice(l,1),l!==a&&(s.insertBefore(f,a+1),o=!0)):(s.appendChild(f),o=!0);u.each(function(e){this._uiRemoveButton(e,n,{preserveContent:!0}),o=!0},this);if(i===0){s.remove(),this._updateContentButtons(n);return}o&&this.setStdModContent(n,s,"after")},this)},_uiSetDefaultButton:function(e,t){var n=d.CLASS_NAMES.primary;e&&e.addClass(n),t&&t.removeClass(n)},_uiSetVisibleButtons:function(e){if(!e)return;var t=this.get("defaultButton");t&&t.focus()},_unMapButton +YUI.add("widget-buttons",function(e,t){function p(e){return!!e.getDOMNode}function d(){this._stdModNode||e.error("WidgetStdMod must be added to a Widget before WidgetButtons."),this._buttonsHandles={}}var n=e.Array,r=e.Lang,i=e.Object,s=e.Plugin.Button,o=e.Widget,u=e.WidgetStdMod,a=e.ClassNameManager.getClassName,f=r.isArray,l=r.isNumber,c=r.isString,h=r.isValue;d.ATTRS={buttons:{getter:"_getButtons",setter:"_setButtons",value:{}},defaultButton:{readOnly:!0,value:null}},d.CLASS_NAMES={button:a("button"),buttons:o.getClassName("buttons"),primary:a("button","primary")},d.HTML_PARSER={buttons:function(e){return this._parseButtons(e)}},d.NON_BUTTON_NODE_CFG=["action","classNames","context","events","isDefault","section"],d.prototype={BUTTONS:{},BUTTONS_TEMPLATE:"",DEFAULT_BUTTONS_SECTION:u.FOOTER,initializer:function(){this._mapButtons(this.get("buttons")),this._updateDefaultButton(),this.after({buttonsChange:e.bind("_afterButtonsChange",this),defaultButtonChange:e.bind("_afterDefaultButtonChange",this)}),e.after(this._bindUIButtons,this,"bindUI"),e.after(this._syncUIButtons,this,"syncUI")},destructor:function(){i.each(this._buttonsHandles,function(e){e.detach()}),delete this._buttonsHandles,delete this._buttonsMap,delete this._defaultButton},addButton:function(e,t,r){var i=this.get("buttons"),s,o;return p(e)||(e=this._mergeButtonConfig(e),t||(t=e.section)),t||(t=this.DEFAULT_BUTTONS_SECTION),s=i[t]||(i[t]=[]),l(r)||(r=s.length),s.splice(r,0,e),o=n.indexOf(s,e),this.set("buttons",i,{button:e,section:t,index:o,src:"add"}),this},getButton:function(e,t){if(!h(e))return;var n=this._buttonsMap,r;return t||(t=this.DEFAULT_BUTTONS_SECTION),l(e)?(r=this.get("buttons"),r[t]&&r[t][e]):arguments.length>1?n[t+":"+e]:n[e]},removeButton:function(e,t){if(!h(e))return this;var r=this.get("buttons"),s;return l(e)?(t||(t=this.DEFAULT_BUTTONS_SECTION),s=e,e=r[t][s]):(c(e)&&(e=this.getButton.apply(this,arguments)),i.some(r,function(r,i){s=n.indexOf(r,e);if(s>-1)return t=i,!0})),e&&s>-1&&(r[t].splice(s,1),this.set("buttons",r,{button:e,section:t,index:s,src:"remove"})),this},_bindUIButtons:function(){var t=e.bind("_afterContentChangeButtons",this);this.after({visibleChange:e.bind("_afterVisibleChangeButtons",this),headerContentChange:t,bodyContentChange:t,footerContentChange:t})},_createButton:function(t){var r,i,o,u,a,f,l,h;if(p(t))return e.one(t.getDOMNode()).plug(s);r=e.merge({context:this,events:"click",label:t.value},t),i=e.merge(r),o=d.NON_BUTTON_NODE_CFG;for(u=0,a=o.length;u-1?(u.splice(l,1),l!==a&&(s.insertBefore(f,a+1),o=!0)):(s.appendChild(f),o=!0);u.each(function(e){this._uiRemoveButton(e,n,{preserveContent:!0}),o=!0},this);if(i===0){s.remove(),this._updateContentButtons(n);return}o&&this.setStdModContent(n,s,"after")},this)},_uiSetDefaultButton:function(e,t){var n=d.CLASS_NAMES.primary;e&&e.addClass(n),t&&t.removeClass(n)},_uiSetVisibleButtons:function(e){if(!e)return;var t=this.get("defaultButton");t&&t.focus()},_unMapButton :function(e,t){var n=this._buttonsMap,r=this._getButtonName(e),i;r&&(n[r]===e&&delete n[r],i=t+":"+r,n[i]===e&&delete n[i]),this._defaultButton===e&&(this._defaultButton=null)},_updateDefaultButton:function(){var e=this._defaultButton;this.get("defaultButton")!==e&&this._set("defaultButton",e)},_updateContentButtons:function(e){var t=this.getStdModNode(e).get("childNodes");this.set(e+"Content",t.isEmpty()?null:t,{src:"buttons"})},_afterButtonsChange:function(e){var t=e.newVal,n=e.section,r=e.index,i=e.src,s;if(i==="add"){s=t[n][r],this._mapButton(s,n),this._updateDefaultButton(),this._uiInsertButton(s,n,r);return}if(i==="remove"){s=e.button,this._unMapButton(s,n),this._updateDefaultButton(),this._uiRemoveButton(s,n);return}this._mapButtons(t),this._updateDefaultButton(),this._uiSetButtons(t)},_afterContentChangeButtons:function(e){var t=e.src,n=e.stdModPosition,r=!n||n===u.REPLACE;r&&t!=="buttons"&&t!==o.UI_SRC&&this._uiSetButtons(this.get("buttons"))},_afterDefaultButtonChange:function(e){this._uiSetDefaultButton(e.newVal,e.prevVal)},_afterVisibleChangeButtons:function(e){this._uiSetVisibleButtons(e.newVal)}},e.WidgetButtons=d},"@VERSION@",{requires:["button-plugin","cssbutton","widget-stdmod"]}); diff --git a/build/widget-buttons/widget-buttons.js b/build/widget-buttons/widget-buttons.js index 027da5a7dc9..3ad31fb65f2 100644 --- a/build/widget-buttons/widget-buttons.js +++ b/build/widget-buttons/widget-buttons.js @@ -606,16 +606,14 @@ WidgetButtons.prototype = { containerSelector = '.' + sectionClassName + ' .' + buttonsClassName; // Search only inside the current widget - contentBox.all(containerSelector).each(function(node, index) { - var widget; + contentBox.all(containerSelector).some(function(node){ + var widget = Y.Widget.getByNode(node), + isBelongs = !widget || widget === this; - if (!container) { - widget = Y.Widget.getByNode(node); - - if (!widget || widget === this) { - container = node; - } + if (isBelongs) { + container = node; } + return isBelongs; }, this); // Create the `container` if it doesn't already exist. diff --git a/src/widget-buttons/js/widget-buttons.js b/src/widget-buttons/js/widget-buttons.js index 93f14ebb1bd..bab6824b16a 100644 --- a/src/widget-buttons/js/widget-buttons.js +++ b/src/widget-buttons/js/widget-buttons.js @@ -604,16 +604,14 @@ WidgetButtons.prototype = { containerSelector = '.' + sectionClassName + ' .' + buttonsClassName; // Search only inside the current widget - contentBox.all(containerSelector).each(function(node, index) { - var widget; + contentBox.all(containerSelector).some(function(node){ + var widget = Y.Widget.getByNode(node), + isBelongs = !widget || widget === this; - if (!container) { - widget = Y.Widget.getByNode(node); - - if (!widget || widget === this) { - container = node; - } + if (isBelongs) { + container = node; } + return isBelongs; }, this); // Create the `container` if it doesn't already exist.