Best Python code snippet using lisa_python
selection.py
Source:selection.py  
...36    { 'desc':       'sel.modify (generic)',37      'tests':      [38        { 'id':         'SM:m.f.c_TEXT-1_SC-1',39          'desc':       'move caret 1 character forward',40          'function':   'sel.modify("move", "forward", "character");',41          'pad':        'foo b^ar baz',42          'expected':   'foo ba^r baz' },43        { 'id':         'SM:m.b.c_TEXT-1_SC-1',44          'desc':       'move caret 1 character backward',45          'function':   'sel.modify("move", "backward", "character");',46          'pad':        'foo b^ar baz',47          'expected':   'foo ^bar baz' },48        { 'id':         'SM:m.f.c_TEXT-1_SI-1',49          'desc':       'move caret forward (sollapse selection)',50          'function':   'sel.modify("move", "forward", "character");',51          'pad':        'foo [bar] baz',52          'expected':   'foo bar^ baz' },53        { 'id':         'SM:m.b.c_TEXT-1_SI-1',54          'desc':       'move caret backward (collapse selection)',55          'function':   'sel.modify("move", "backward", "character");',56          'pad':        'foo [bar] baz',57          'expected':   'foo ^bar baz' },58        { 'id':         'SM:m.f.w_TEXT-1_SC-1',59          'desc':       'move caret 1 word forward',60          'function':   'sel.modify("move", "forward", "word");',61          'pad':        'foo b^ar baz',62          'expected':   'foo bar^ baz' },63        { 'id':         'SM:m.f.w_TEXT-1_SC-2',64          'desc':       'move caret 1 word forward',65          'function':   'sel.modify("move", "forward", "word");',66          'pad':        'foo^ bar baz',67          'expected':   'foo bar^ baz' },68        { 'id':         'SM:m.f.w_TEXT-1_SI-1',69          'desc':       'move caret 1 word forward from non-collapsed selection',70          'function':   'sel.modify("move", "forward", "word");',71          'pad':        'foo [bar] baz',72          'expected':   'foo bar baz^' },73        { 'id':         'SM:m.b.w_TEXT-1_SC-1',74          'desc':       'move caret 1 word backward',75          'function':   'sel.modify("move", "backward", "word");',76          'pad':        'foo b^ar baz',77          'expected':   'foo ^bar baz' },78        { 'id':         'SM:m.b.w_TEXT-1_SC-3',79          'desc':       'move caret 1 word backward',80          'function':   'sel.modify("move", "backward", "word");',81          'pad':        'foo bar ^baz',82          'expected':   'foo ^bar baz' },83        { 'id':         'SM:m.b.w_TEXT-1_SI-1',84          'desc':       'move caret 1 word backward from non-collapsed selection',85          'function':   'sel.modify("move", "backward", "word");',86          'pad':        'foo [bar] baz',87          'expected':   '^foo bar baz' }88      ]89    },90    { 'desc':       'sel.modify: move forward over combining diacritics, etc.',91      'tests':      [92        { 'id':         'SM:m.f.c_CHAR-2_SC-1',93          'desc':       'move 1 character forward over combined o with diaeresis',94          'function':   'sel.modify("move", "forward", "character");',95          'pad':        'fo^öbarbaz',96          'expected':   'foö^barbaz' },97        { 'id':         'SM:m.f.c_CHAR-3_SC-1',98          'desc':       'move 1 character forward over character with combining diaeresis above',99          'function':   'sel.modify("move", "forward", "character");',100          'pad':        'fo^öbarbaz',101          'expected':   'foö^barbaz' },102        { 'id':         'SM:m.f.c_CHAR-4_SC-1',103          'desc':       'move 1 character forward over character with combining diaeresis below',104          'function':   'sel.modify("move", "forward", "character");',105          'pad':        'fo^o̤barbaz',106          'expected':   'foo̤^barbaz' },107        { 'id':         'SM:m.f.c_CHAR-5_SC-1',108          'desc':       'move 1 character forward over character with combining diaeresis above and below',109          'function':   'sel.modify("move", "forward", "character");',110          'pad':        'fo^ö̤barbaz',111          'expected':   'foö̤^barbaz' },112        { 'id':         'SM:m.f.c_CHAR-5_SI-1',113          'desc':       'move 1 character forward over character with combining diaeresis above and below, selection on diaeresis above',114          'function':   'sel.modify("move", "forward", "character");',115          'pad':        'foo[̈]̤barbaz',116          'expected':   'foö̤^barbaz' },117        { 'id':         'SM:m.f.c_CHAR-5_SI-2',118          'desc':       'move 1 character forward over character with combining diaeresis above and below, selection on diaeresis below',119          'function':   'sel.modify("move", "forward", "character");',120          'pad':        'foö[̤]barbaz',121          'expected':   'foö̤^barbaz' },122        { 'id':         'SM:m.f.c_CHAR-5_SL',123          'desc':       'move 1 character forward over character with combining diaeresis above and below, selection oblique on diaeresis and preceding text',124          'function':   'sel.modify("move", "forward", "character");',125          'pad':        'fo[ö]̤barbaz',126          'expected':   'foö̤^barbaz' },127        { 'id':         'SM:m.f.c_CHAR-5_SR',128          'desc':       'move 1 character forward over character with combining diaeresis above and below, selection oblique on diaeresis and following text',129          'function':   'sel.modify("move", "forward", "character");',130          'pad':        'foö[̤bar]baz',131          'expected':   'foö̤bar^baz' },132        { 'id':         'SM:m.f.c_CHAR-6_SC-1',133          'desc':       'move 1 character forward over character with enclosing square',134          'function':   'sel.modify("move", "forward", "character");',135          'pad':        'fo^o⃞barbaz',136          'expected':   'foo⃞^barbaz' },137        { 'id':         'SM:m.f.c_CHAR-7_SC-1',138          'desc':       'move 1 character forward over character with combining long solidus overlay',139          'function':   'sel.modify("move", "forward", "character");',140          'pad':        'fo^o̸barbaz',141          'expected':   'foo̸^barbaz' }142      ]143    },144    { 'desc':       'sel.modify: move backward over combining diacritics, etc.',145      'tests':      [146        { 'id':         'SM:m.b.c_CHAR-2_SC-1',147          'desc':       'move 1 character backward over combined o with diaeresis',148          'function':   'sel.modify("move", "backward", "character");',149          'pad':        'foö^barbaz',150          'expected':   'fo^öbarbaz' },151        { 'id':         'SM:m.b.c_CHAR-3_SC-1',152          'desc':       'move 1 character backward over character with combining diaeresis above',153          'function':   'sel.modify("move", "backward", "character");',154          'pad':        'foö^barbaz',155          'expected':   'fo^öbarbaz' },156        { 'id':         'SM:m.b.c_CHAR-4_SC-1',157          'desc':       'move 1 character backward over character with combining diaeresis below',158          'function':   'sel.modify("move", "backward", "character");',159          'pad':        'foo̤^barbaz',160          'expected':   'fo^o̤barbaz' },161        { 'id':         'SM:m.b.c_CHAR-5_SC-1',162          'desc':       'move 1 character backward over character with combining diaeresis above and below',163          'function':   'sel.modify("move", "backward", "character");',164          'pad':        'foö̤^barbaz',165          'expected':   'fo^ö̤barbaz' },166        { 'id':         'SM:m.b.c_CHAR-5_SI-1',167          'desc':       'move 1 character backward over character with combining diaeresis above and below, selection on diaeresis above',168          'function':   'sel.modify("move", "backward", "character");',169          'pad':        'foo[̈]̤barbaz',170          'expected':   'fo^ö̤barbaz' },171        { 'id':         'SM:m.b.c_CHAR-5_SI-2',172          'desc':       'move 1 character backward over character with combining diaeresis above and below, selection on diaeresis below',173          'function':   'sel.modify("move", "backward", "character");',174          'pad':        'foö[̤]barbaz',175          'expected':   'fo^ö̤barbaz' },176        { 'id':         'SM:m.b.c_CHAR-5_SL',177          'desc':       'move 1 character backward over character with combining diaeresis above and below, selection oblique on diaeresis and preceding text',178          'function':   'sel.modify("move", "backward", "character");',179          'pad':        'fo[ö]̤barbaz',180          'expected':   'fo^ö̤barbaz' },181        { 'id':         'SM:m.b.c_CHAR-5_SR',182          'desc':       'move 1 character backward over character with combining diaeresis above and below, selection oblique on diaeresis and following text',183          'function':   'sel.modify("move", "backward", "character");',184          'pad':        'foö[̤bar]baz',185          'expected':   'fo^ö̤barbaz' },186        { 'id':         'SM:m.b.c_CHAR-6_SC-1',187          'desc':       'move 1 character backward over character with enclosing square',188          'function':   'sel.modify("move", "backward", "character");',189          'pad':        'foo⃞^barbaz',190          'expected':   'fo^o⃞barbaz' },191        { 'id':         'SM:m.b.c_CHAR-7_SC-1',192          'desc':       'move 1 character backward over character with combining long solidus overlay',193          'function':   'sel.modify("move", "backward", "character");',194          'pad':        'foo̸^barbaz',195          'expected':   'fo^o̸barbaz' }196      ]197    },198    { 'desc':       'sel.modify: move forward/backward/left/right in RTL text',199      'tests':      [200        { 'id':         'SM:m.f.c_Pdir:rtl-1_SC-1',201          'desc':       'move caret forward 1 character in right-to-left text',202          'function':   'sel.modify("move", "forward", "character");',203          'pad':        '<p dir="rtl">foo b^ar baz</p>',204          'expected':   '<p dir="rtl">foo ba^r baz</p>' },205        206        { 'id':         'SM:m.b.c_Pdir:rtl-1_SC-1',207          'desc':       'move caret backward 1 character in right-to-left text',208          'function':   'sel.modify("move", "backward", "character");',209          'pad':        '<p dir="rtl">foo ba^r baz</p>',210          'expected':   '<p dir="rtl">foo b^ar baz</p>' },211        212        { 'id':         'SM:m.r.c_Pdir:rtl-1_SC-1',213          'desc':       'move caret 1 character to the right in LTR text within RTL context',214          'function':   'sel.modify("move", "right", "character");',215          'pad':        '<p dir="rtl">foo b^ar baz</p>',216          'expected':   '<p dir="rtl">foo ba^r baz</p>' },217        218        { 'id':         'SM:m.l.c_Pdir:rtl-1_SC-1',219          'desc':       'move caret 1 character to the left in LTR text within RTL context',220          'function':   'sel.modify("move", "left", "character");',221          'pad':        '<p dir="rtl">foo ba^r baz</p>',222          'expected':   '<p dir="rtl">foo b^ar baz</p>' },223        { 'id':         'SM:m.f.c_TEXT:ar-1_SC-1',224          'desc':       'move caret forward 1 character in Arabic text',225          'function':   'sel.modify("move", "forward", "character");',226          'pad':        'مرح^با العالم',227          'expected':   'مرحب^ا العالم' },228        229        { 'id':         'SM:m.b.c_TEXT:ar-1_SC-1',230          'desc':       'move caret backward 1 character in Arabic text',231          'function':   'sel.modify("move", "backward", "character");',232          'pad':        'مرح^با العالم',233          'expected':   'مر^حبا العالم' },234        235        { 'id':         'SM:m.f.c_TEXT:he-1_SC-1',236          'desc':       'move caret forward 1 character in Hebrew text',237          'function':   'sel.modify("move", "forward", "character");',238          'pad':        'של^ום עולם',239          'expected':   'שלו^ם עולם' },240        241        { 'id':         'SM:m.b.c_TEXT:he-1_SC-1',242          'desc':       'move caret backward 1 character in Hebrew text',243          'function':   'sel.modify("move", "backward", "character");',244          'pad':        'של^ום עולם',245          'expected':   'ש^לום עולם' },246        { 'id':         'SM:m.f.c_BDOdir:rtl-1_SC-1',247          'desc':       'move caret forward 1 character inside <bdo>',248          'function':   'sel.modify("move", "forward", "character");',249          'pad':        'foo <bdo dir="rtl">b^ar</bdo> baz',250          'expected':   'foo <bdo dir="rtl">ba^r</bdo> baz' },251        252        { 'id':         'SM:m.b.c_BDOdir:rtl-1_SC-1',253          'desc':       'move caret backward 1 character inside <bdo>',254          'function':   'sel.modify("move", "backward", "character");',255          'pad':        'foo <bdo dir="rtl">ba^r</bdo> baz',256          'expected':   'foo <bdo dir="rtl">b^ar</bdo> baz' },257        258        { 'id':         'SM:m.r.c_BDOdir:rtl-1_SC-1',259          'desc':       'move caret 1 character to the right inside <bdo>',260          'function':   'sel.modify("move", "right", "character");',261          'pad':        'foo <bdo dir="rtl">ba^r</bdo> baz',262          'expected':   'foo <bdo dir="rtl">b^ar</bdo> baz' },263        264        { 'id':         'SM:m.l.c_BDOdir:rtl-1_SC-1',265          'desc':       'move caret 1 character to the left inside <bdo>',266          'function':   'sel.modify("move", "left", "character");',267          'pad':        'foo <bdo dir="rtl">b^ar</bdo> baz',268          'expected':   'foo <bdo dir="rtl">ba^r</bdo> baz' },269        270        { 'id':         'SM:m.f.c_TEXTrle-1_SC-rtl-1',271          'desc':       'move caret forward in RTL text within RLE-PDF marks',272          'function':   'sel.modify("move", "forward", "character");',273          'pad':        'I said, "(RLE)‫car يعني سي^ارة‬(PDF)".',274          'expected':   'I said, "(RLE)‫car يعني سيا^رة‬(PDF)".' },275        276        { 'id':         'SM:m.b.c_TEXTrle-1_SC-rtl-1',277          'desc':       'move caret backward in RTL text within RLE-PDF marks',278          'function':   'sel.modify("move", "backward", "character");',279          'pad':        'I said, "(RLE)‫car يعني سي^ارة‬(PDF)".',280          'expected':   'I said, "(RLE)‫car يعني س^يارة‬(PDF)".' },281        282        { 'id':         'SM:m.r.c_TEXTrle-1_SC-rtl-1',283          'desc':       'move caret 1 character to the right in RTL text within RLE-PDF marks',284          'function':   'sel.modify("move", "right", "character");',285          'pad':        'I said, "(RLE)‫car يعني سي^ارة‬(PDF)".',286          'expected':   'I said, "(RLE)‫car يعني س^يارة‬(PDF)".' },287        288        { 'id':         'SM:m.l.c_TEXTrle-1_SC-rtl-1',289          'desc':       'move caret 1 character to the left in RTL text within RLE-PDF marks',290          'function':   'sel.modify("move", "left", "character");',291          'pad':        'I said, "(RLE)‫car يعني سي^ارة‬(PDF)".',292          'expected':   'I said, "(RLE)‫car يعني سيا^رة‬(PDF)".' },293        294        { 'id':         'SM:m.f.c_TEXTrle-1_SC-ltr-1',295          'desc':       'move caret forward in LTR text within RLE-PDF marks',296          'function':   'sel.modify("move", "forward", "character");',297          'pad':        'I said, "(RLE)‫c^ar يعني سيارة‬(PDF)".',298          'expected':   'I said, "(RLE)‫ca^r يعني سيارة‬(PDF)".' },299        { 'id':         'SM:m.b.c_TEXTrle-1_SC-ltr-1',300          'desc':       'move caret backward in LTR text within RLE-PDF marks',301          'function':   'sel.modify("move", "backward", "character");',302          'pad':        'I said, "(RLE)‫ca^r يعني سيارة‬(PDF)".',303          'expected':   'I said, "(RLE)‫c^ar يعني سيارة‬(PDF)".' },304        { 'id':         'SM:m.r.c_TEXTrle-1_SC-ltr-1',305          'desc':       'move caret 1 character to the right in LTR text within RLE-PDF marks',306          'function':   'sel.modify("move", "right", "character");',307          'pad':        'I said, "(RLE)‫c^ar يعني سيارة‬(PDF)".',308          'expected':   'I said, "(RLE)‫ca^r يعني سيارة‬(PDF)".' },309        { 'id':         'SM:m.l.c_TEXTrle-1_SC-ltr-1',310          'desc':       'move caret 1 character to the left in LTR text within RLE-PDF marks',311          'function':   'sel.modify("move", "left", "character");',312          'pad':        'I said, "(RLE)‫ca^r يعني سيارة‬(PDF)".',313          'expected':   'I said, "(RLE)‫c^ar يعني سيارة‬(PDF)".' },314        { 'id':         'SM:m.f.c_TEXTrlo-1_SC-rtl-1',315          'desc':       'move caret forward in RTL text within RLO-PDF marks',316          'function':   'sel.modify("move", "forward", "character");',317          'pad':        'I said, "(RLO)‮car يعني سي^ارة‬(PDF)".',318          'expected':   'I said, "(RLO)‮car يعني سيا^رة‬(PDF)".' },    319        { 'id':         'SM:m.b.c_TEXTrlo-1_SC-rtl-1',320          'desc':       'move caret backward in RTL text within RLO-PDF marks',321          'function':   'sel.modify("move", "backward", "character");',322          'pad':        'I said, "(RLO)‮car يعني سي^ارة‬(PDF)".',323          'expected':   'I said, "(RLO)‮car يعني س^يارة‬(PDF)".' },324        325        { 'id':         'SM:m.r.c_TEXTrlo-1_SC-rtl-1',326          'desc':       'move caret 1 character to the right in RTL text within RLO-PDF marks',327          'function':   'sel.modify("move", "right", "character");',328          'pad':        'I said, "(RLO)‮car يعني سي^ارة‬(PDF)".',329          'expected':   'I said, "(RLO)‮car يعني س^يارة‬(PDF)".' },    330        { 'id':         'SM:m.l.c_TEXTrlo-1_SC-rtl-1',331          'desc':       'move caret 1 character to the left in RTL text within RLO-PDF marks',332          'function':   'sel.modify("move", "left", "character");',333          'pad':        'I said, "(RLO)‮car يعني سي^ارة‬(PDF)".',334          'expected':   'I said, "(RLO)‮car يعني سيا^رة‬(PDF)".' },335        336        { 'id':         'SM:m.f.c_TEXTrlo-1_SC-ltr-1',337          'desc':       'move caret forward in Latin text within RLO-PDF marks',338          'function':   'sel.modify("move", "forward", "character");',339          'pad':        'I said, "(RLO)‮c^ar يعني سيارة‬(PDF)".',340          'expected':   'I said, "(RLO)‮ca^r يعني سيارة‬(PDF)".' },341        342        { 'id':         'SM:m.b.c_TEXTrlo-1_SC-ltr-1',343          'desc':       'move caret backward in Latin text within RLO-PDF marks',344          'function':   'sel.modify("move", "backward", "character");',345          'pad':        'I said, "(RLO)‮ca^r يعني سيارة‬(PDF)".',346          'expected':   'I said, "(RLO)‮c^ar يعني سيارة‬(PDF)".' },347        348        { 'id':         'SM:m.r.c_TEXTrlo-1_SC-ltr-1',349          'desc':       'move caret 1 character to the right in Latin text within RLO-PDF marks',350          'function':   'sel.modify("move", "right", "character");',351          'pad':        'I said, "(RLO)‮ca^r يعني سيارة‬(PDF)".',352          'expected':   'I said, "(RLO)‮c^ar يعني سيارة‬(PDF)".' },    353        { 'id':         'SM:m.l.c_TEXTrlo-1_SC-ltr-1',354          'desc':       'move caret 1 character to the left in Latin text within RLO-PDF marks',355          'function':   'sel.modify("move", "left", "character");',356          'pad':        'I said, "(RLO)‮c^ar يعني سيارة‬(PDF)".',357          'expected':   'I said, "(RLO)‮ca^r يعني سيارة‬(PDF)".' },358        359        { 'id':         'SM:m.f.c_TEXTrlm-1_SC-1',360          'desc':       'move caret forward in RTL text within neutral characters followed by RLM',361          'function':   'sel.modify("move", "forward", "character");',362          'pad':        'I said, "يعني سيارة!^?!‏(RLM)".',363          'expected':   'I said, "يعني سيارة!?^!‏(RLM)".' },364        365        { 'id':         'SM:m.b.c_TEXTrlm-1_SC-1',366          'desc':       'move caret backward in RTL text within neutral characters followed by RLM',367          'function':   'sel.modify("move", "backward", "character");',368          'pad':        'I said, "يعني سيارة!?^!‏(RLM)".',369          'expected':   'I said, "يعني سيارة!^?!‏(RLM)".' },370        371        { 'id':         'SM:m.r.c_TEXTrlm-1_SC-1',372          'desc':       'move caret 1 character to the right in RTL text within neutral characters followed by RLM',373          'function':   'sel.modify("move", "right", "character");',374          'pad':        'I said, "يعني سيارة!?^!‏(RLM)".',375          'expected':   'I said, "يعني سيارة!^?!‏(RLM)".' },376        377        { 'id':         'SM:m.l.c_TEXTrlm-1_SC-1',378          'desc':       'move caret 1 character to the left in RTL text within neutral characters followed by RLM',379          'function':   'sel.modify("move", "left", "character");',380          'pad':        'I said, "يعني سيارة!^?!‏(RLM)".',381          'expected':   'I said, "يعني سيارة!?^!‏(RLM)".' }382      ]383    },384    { 'desc':       'sel.modify: move forward/backward over words in Japanese text',385      'tests':      [386        { 'id':         'SM:m.f.w_TEXT-jp_SC-1',387          'desc':       'move caret forward 1 word in Japanese text (adjective)',388          'function':   'sel.modify("move", "forward", "word");',389          'pad':        '^面白い例文をテストしましょう。',390          'expected':   '面白い^例文をテストしましょう。' },391        392        { 'id':         'SM:m.f.w_TEXT-jp_SC-2',393          'desc':       'move caret forward 1 word in Japanese text (in the middle of a word)',394          'function':   'sel.modify("move", "forward", "word");',395          'pad':        '面^白い例文をテストしましょう。',396          'expected':   '面白い^例文をテストしましょう。' },397        398        { 'id':         'SM:m.f.w_TEXT-jp_SC-3',399          'desc':       'move caret forward 1 word in Japanese text (noun)',400          'function':   'sel.modify("move", "forward", "word");',401          'pad':        '面白い^例文をテストしましょう。',402          'expected':   [ '面白い例文^をテストしましょう。',403                          '面白い例文を^テストしましょう。' ] },404        405        { 'id':         'SM:m.f.w_TEXT-jp_SC-4',406          'desc':       'move caret forward 1 word in Japanese text (Katakana)',407          'function':   'sel.modify("move", "forward", "word");',408          'pad':        '面白い例文を^テストしましょう。',409          'expected':   '面白い例文をテスト^しましょう。' },410        411        { 'id':         'SM:m.f.w_TEXT-jp_SC-5',412          'desc':       'move caret forward 1 word in Japanese text (verb)',413          'function':   'sel.modify("move", "forward", "word");',414          'pad':        '面白い例文をテスト^しましょう。',415          'expected':   '面白い例文をテストしましょう^。' }416      ]417    },418    { 'desc':       'sel.modify: extend selection forward',419      'tests':      [420        { 'id':         'SM:e.f.c_TEXT-1_SC-1',421          'desc':       'extend selection 1 character forward',422          'function':   'sel.modify("extend", "forward", "character");',423          'pad':        'foo ^bar baz',424          'expected':   'foo [b]ar baz' },425        { 'id':         'SM:e.f.c_TEXT-1_SI-1',426          'desc':       'extend selection 1 character forward',427          'function':   'sel.modify("extend", "forward", "character");',428          'pad':        'foo [b]ar baz',429          'expected':   'foo [ba]r baz' },430        { 'id':         'SM:e.f.w_TEXT-1_SC-1',431          'desc':       'extend selection 1 word forward',432          'function':   'sel.modify("extend", "forward", "word");',433          'pad':        'foo ^bar baz',434          'expected':   'foo [bar] baz' },435        { 'id':         'SM:e.f.w_TEXT-1_SI-1',436          'desc':       'extend selection 1 word forward',437          'function':   'sel.modify("extend", "forward", "word");',438          'pad':        'foo [b]ar baz',439          'expected':   'foo [bar] baz' },440        { 'id':         'SM:e.f.w_TEXT-1_SI-2',441          'desc':       'extend selection 1 word forward',442          'function':   'sel.modify("extend", "forward", "word");',443          'pad':        'foo [bar] baz',444          'expected':   'foo [bar baz]' }445      ]446    },447    { 'desc':       'sel.modify: extend selection backward, shrinking it',448      'tests':      [449        { 'id':         'SM:e.b.c_TEXT-1_SI-2',450          'desc':       'extend selection 1 character backward',451          'function':   'sel.modify("extend", "backward", "character");',452          'pad':        'foo [bar] baz',453          'expected':   'foo [ba]r baz' },454        { 'id':         'SM:e.b.c_TEXT-1_SI-1',455          'desc':       'extend selection 1 character backward',456          'function':   'sel.modify("extend", "backward", "character");',457          'pad':        'foo [b]ar baz',458          'expected':   'foo ^bar baz' },459        { 'id':         'SM:e.b.w_TEXT-1_SI-3',460          'desc':       'extend selection 1 word backward',461          'function':   'sel.modify("extend", "backward", "word");',462          'pad':        'foo [bar baz]',463          'expected':   'foo [bar] baz' },464        { 'id':         'SM:e.b.w_TEXT-1_SI-2',465          'desc':       'extend selection 1 word backward',466          'function':   'sel.modify("extend", "backward", "word");',467          'pad':        'foo [bar] baz',468          'expected':   'foo ^bar baz' },469        { 'id':         'SM:e.b.w_TEXT-1_SI-4',470          'desc':       'extend selection 1 word backward',471          'function':   'sel.modify("extend", "backward", "word");',472          'pad':        'foo b[ar baz]',473          'expected':   'foo b[ar] baz' },474        { 'id':         'SM:e.b.w_TEXT-1_SI-5',475          'desc':       'extend selection 1 word backward',476          'function':   'sel.modify("extend", "backward", "word");',477          'pad':        'foo b[ar] baz',478          'expected':   'foo b^ar baz' }479      ]480    },481    { 'desc':       'sel.modify: extend selection backward, creating or extending a reverse selections',482      'tests':      [483        { 'id':         'SM:e.b.c_TEXT-1_SC-1',484          'desc':       'extend selection 1 character backward',485          'function':   'sel.modify("extend", "backward", "character");',486          'pad':        'foo b^ar baz',487          'expected':   'foo ]b[ar baz' },488        { 'id':         'SM:e.b.c_TEXT-1_SIR-1',489          'desc':       'extend selection 1 character backward',490          'function':   'sel.modify("extend", "backward", "character");',491          'pad':        'foo b]a[r baz',492          'expected':   'foo ]ba[r baz' },493        { 'id':         'SM:e.b.w_TEXT-1_SIR-1',494          'desc':       'extend selection 1 word backward',495          'function':   'sel.modify("extend", "backward", "word");',496          'pad':        'foo b]a[r baz',497          'expected':   'foo ]ba[r baz' },498        { 'id':         'SM:e.b.w_TEXT-1_SIR-2',499          'desc':       'extend selection 1 word backward',500          'function':   'sel.modify("extend", "backward", "word");',501          'pad':        'foo ]ba[r baz',502          'expected':   ']foo ba[r baz' }503      ]504    },505    { 'desc':       'sel.modify: extend selection forward, shrinking a reverse selections',506      'tests':      [507        { 'id':         'SM:e.f.c_TEXT-1_SIR-1',508          'desc':       'extend selection 1 character forward',509          'function':   'sel.modify("extend", "forward", "character");',510          'pad':        'foo b]a[r baz',511          'expected':   'foo ba^r baz' },512        { 'id':         'SM:e.f.c_TEXT-1_SIR-2',513          'desc':       'extend selection 1 character forward',514          'function':   'sel.modify("extend", "forward", "character");',515          'pad':        'foo ]ba[r baz',516          'expected':   'foo b]a[r baz' },517        { 'id':         'SM:e.f.w_TEXT-1_SIR-1',518          'desc':       'extend selection 1 word forward',519          'function':   'sel.modify("extend", "forward", "word");',520          'pad':        'foo ]ba[r baz',521          'expected':   'foo ba^r baz' },522        { 'id':         'SM:e.f.w_TEXT-1_SIR-3',523          'desc':       'extend selection 1 word forward',524          'function':   'sel.modify("extend", "forward", "word");',525          'pad':        ']foo ba[r baz',526          'expected':   'foo ]ba[r baz' }527      ]528    },529    { 'desc':       'sel.modify: extend selection forward to line boundary',530      'tests':      [531        { 'id':         'SM:e.f.lb_BR.BR-1_SC-1',532          'desc':       'extend selection forward to line boundary',533          'function':   'sel.modify("extend", "forward", "lineboundary");',534          'pad':        'fo^o<br>bar<br>baz',535          'expected':   'fo[o]<br>bar<br>baz' },536        { 'id':         'SM:e.f.lb_BR.BR-1_SI-1',537          'desc':       'extend selection forward to next line boundary',538          'function':   'sel.modify("extend", "forward", "lineboundary");',539          'pad':        'fo[o]<br>bar<br>baz',540          'expected':   'fo[o<br>bar]<br>baz' },541        { 'id':         'SM:e.f.lb_BR.BR-1_SM-1',542          'desc':       'extend selection forward to line boundary',543          'function':   'sel.modify("extend", "forward", "lineboundary");',544          'pad':        'fo[o<br>b]ar<br>baz',545          'expected':   'fo[o<br>bar]<br>baz' },546        { 'id':         'SM:e.f.lb_P.P.P-1_SC-1',547          'desc':       'extend selection forward to line boundary',548          'function':   'sel.modify("extend", "forward", "lineboundary");',549          'pad':        '<p>fo^o</p><p>bar</p><p>baz</p>',550          'expected':   '<p>fo[o]</p><p>bar</p><p>baz</p>' },551        { 'id':         'SM:e.f.lb_P.P.P-1_SI-1',552          'desc':       'extend selection forward to next line boundary',553          'function':   'sel.modify("extend", "forward", "lineboundary");',554          'pad':        '<p>fo[o]</p><p>bar</p><p>baz</p>',555          'expected':   '<p>fo[o</p><p>bar]</p><p>baz</p>' },556        { 'id':         'SM:e.f.lb_P.P.P-1_SM-1',557          'desc':       'extend selection forward to line boundary',558          'function':   'sel.modify("extend", "forward", "lineboundary");',559          'pad':        '<p>fo[o</p><p>b]ar</p><p>baz</p>',560          'expected':   '<p>fo[o</p><p>bar]</p><p>baz</p>' },561        { 'id':         'SM:e.f.lb_P.P.P-1_SMR-1',562          'desc':       'extend selection forward to line boundary',563          'function':   'sel.modify("extend", "forward", "lineboundary");',564          'pad':        '<p>foo</p><p>b]a[r</p><p>baz</p>',565          'expected':   '<p>foo</p><p>ba[r]</p><p>baz</p>' }566      ]567    },568    { 'desc':       'sel.modify: extend selection backward to line boundary',569      'tests':      [570        { 'id':         'SM:e.b.lb_BR.BR-1_SC-2',571          'desc':       'extend selection backward to line boundary',572          'function':   'sel.modify("extend", "backward", "lineboundary");',573          'pad':        'foo<br>bar<br>b^az',574          'expected':   'foo<br>bar<br>]b[az' },575        { 'id':         'SM:e.b.lb_BR.BR-1_SIR-2',576          'desc':       'extend selection backward to previous line boundary',577          'function':   'sel.modify("extend", "backward", "lineboundary");',578          'pad':        'foo<br>bar<br>]b[az',579          'expected':   'foo<br>]bar<br>b[az' },580        { 'id':         'SM:e.b.lb_BR.BR-1_SMR-2',581          'desc':       'extend selection backward to line boundary',582          'function':   'sel.modify("extend", "backward", "lineboundary");',583          'pad':        'foo<br>ba]r<br>b[az',584          'expected':   'foo<br>]bar<br>b[az' },585        { 'id':         'SM:e.b.lb_P.P.P-1_SC-2',586          'desc':       'extend selection backward to line boundary',587          'function':   'sel.modify("extend", "backward", "lineboundary");',588          'pad':        '<p>foo</p><p>bar</p><p>b^az</p>',589          'expected':   '<p>foo</p><p>bar</p><p>]b[az</p>' },590        { 'id':         'SM:e.b.lb_P.P.P-1_SIR-2',591          'desc':       'extend selection backward to previous line boundary',592          'function':   'sel.modify("extend", "backward", "lineboundary");',593          'pad':        '<p>foo</p><p>bar</p><p>]b[az</p>',594          'expected':   '<p>foo</p><p>]bar</p><p>b[az</p>' },595        { 'id':         'SM:e.b.lb_P.P.P-1_SMR-2',596          'desc':       'extend selection backward to line boundary',597          'function':   'sel.modify("extend", "backward", "lineboundary");',598          'pad':        '<p>foo</p><p>ba]r</p><p>b[az</p>',599          'expected':   '<p>foo</p><p>]bar</p><p>b[az</p>' },600        { 'id':         'SM:e.b.lb_P.P.P-1_SM-2',601          'desc':       'extend selection backward to line boundary',602          'function':   'sel.modify("extend", "backward", "lineboundary");',603          'pad':        '<p>foo</p><p>b[a]r</p><p>baz</p>',604          'expected':   '<p>foo</p><p>]b[ar</p><p>baz</p>' }605      ]606    },607    { 'desc':       'sel.modify: extend selection forward to next line (NOTE: use identical text in every line!)',608      'tests':      [609        { 'id':         'SM:e.f.l_BR.BR-2_SC-1',610          'desc':       'extend selection forward to next line',611          'function':   'sel.modify("extend", "forward", "line");',612          'pad':        'fo^o<br>foo<br>foo',613          'expected':   'fo[o<br>fo]o<br>foo' },614        { 'id':         'SM:e.f.l_BR.BR-2_SI-1',615          'desc':       'extend selection forward to next line',616          'function':   'sel.modify("extend", "forward", "line");',617          'pad':        'fo[o]<br>foo<br>foo',618          'expected':   'fo[o<br>foo]<br>foo' },619        { 'id':         'SM:e.f.l_BR.BR-2_SM-1',620          'desc':       'extend selection forward to next line',621          'function':   'sel.modify("extend", "forward", "line");',622          'pad':        'fo[o<br>f]oo<br>foo',623          'expected':   'fo[o<br>foo<br>f]oo' },624        { 'id':         'SM:e.f.l_P.P-1_SC-1',625          'desc':       'extend selection forward to next line over paragraph boundaries',626          'function':   'sel.modify("extend", "forward", "line");',627          'pad':        '<p>foo^bar</p><p>foobar</p>',628          'expected':   '<p>foo[bar</p><p>foo]bar</p>' },629        { 'id':         'SM:e.f.l_P.P-1_SMR-1',630          'desc':       'extend selection forward to next line over paragraph boundaries',631          'function':   'sel.modify("extend", "forward", "line");',632          'pad':        '<p>fo]obar</p><p>foob[ar</p>',633          'expected':   '<p>foobar</p><p>fo]ob[ar</p>' }634      ]635    },636    { 'desc':       'sel.modify: extend selection backward to previous line (NOTE: use identical text in every line!)',637      'tests':      [638        { 'id':         'SM:e.b.l_BR.BR-2_SC-2',639          'desc':       'extend selection backward to previous line',640          'function':   'sel.modify("extend", "backward", "line");',641          'pad':        'foo<br>foo<br>f^oo',642          'expected':   'foo<br>f]oo<br>f[oo' },643        { 'id':         'SM:e.b.l_BR.BR-2_SIR-2',644          'desc':       'extend selection backward to previous line',645          'function':   'sel.modify("extend", "backward", "line");',646          'pad':        'foo<br>foo<br>]f[oo',647          'expected':   'foo<br>]foo<br>f[oo' },648        { 'id':         'SM:e.b.l_BR.BR-2_SMR-2',649          'desc':       'extend selection backward to previous line',650          'function':   'sel.modify("extend", "backward", "line");',651          'pad':        'foo<br>fo]o<br>f[oo',652          'expected':   'fo]o<br>foo<br>f[oo' },653        { 'id':         'SM:e.b.l_P.P-1_SC-2',654          'desc':       'extend selection backward to next line over paragraph boundaries',655          'function':   'sel.modify("extend", "backward", "line");',656          'pad':        '<p>foobar</p><p>foo^bar</p>',657          'expected':   '<p>foo]bar</p><p>foo[bar</p>' },658        { 'id':         'SM:e.b.l_P.P-1_SM-1',659          'desc':       'extend selection backward to next line over paragraph boundaries',660          'function':   'sel.modify("extend", "backward", "line");',661          'pad':        '<p>fo[obar</p><p>foob]ar</p>',662          'expected':   '<p>fo[ob]ar</p><p>foobar</p>' }663      ]664    },665    { 'desc':       'sel.selectAllChildren(<element>)',666      'function':   'sel.selectAllChildren(doc.getElementById("div"));',667      'tests':      [668        { 'id':         'SAC:div_DIV-1_SC-1',669          'desc':       'selectAllChildren(<div>)',670          'pad':        'foo<div id="div">bar <span>ba^z</span></div>qoz',671          'expected':   [ 'foo<div id="div">[bar <span>baz</span>}</div>qoz',672                          'foo<div id="div">{bar <span>baz</span>}</div>qoz' ] },673      ]674    }...test_personal_infomation.js
Source:test_personal_infomation.js  
1$(document).ready(function(){2	/***3	 *  ç¨äºç¨æ·ä¸ªäººä¸å¿ï¼é¼ æ ç§»å°å°åè½ä¸èæ¯åè²ï¼é¼ æ ç§»å¼æ¢å¤ä»¥åï¼4	 * @author nele nele0716@163.com  2013-11-35	 */6	var modify_user_info_node=$("#modify_user_info");7	var search_user_grade_node=$("#search_user_grade");8	 modify_user_info_node.mouseover(function(){9		 modify_user_info_node.css("background-color","#66CC99"); 10	 });11	 12   modify_user_info_node.mouseout(function(){ 13		 modify_user_info_node.css("background-color","#99CCFF"); 14	 });15	16   search_user_grade_node.mouseover(function(){17	   search_user_grade_node.css("background-color","#66CC99"); 18   });19   20   search_user_grade_node.mouseout(function() {21	   search_user_grade_node.css("background-color","#99CCFF"); 22   });23   24   25   /***26    * å è½½æ¾ç¤ºå¦æ ¡ï¼ä¸ä¸ï¼ç级ç页é¢å°å½å页é¢27    * @author nele nele0716@163.com 2013-11-328    */29 modify_user_info_node.click(function(){30		 $("#main").load("show_or_modify_personal_info.jsp");31	});32	 33	  /***34	  * æ¾ç¤ºç¨æ·å¦æ ¡ï¼ä¸ä¸ï¼ç级ï¼ç¨äºä¿®æ¹35	  * @author nele  nele0716@163.com 2013-11-3 36	  */37	/*$("#test_modify_user_info_modify_class_btn").click(function(){38		var show_xy_major__class_node=$("#show_class_div");39		  show_xy_major__class_node.load("show_xy_major_class_toModify.jsp");40	});*/41    var bj;//å½åä¸ä¸ççº§ç»æ42	var bjId;//å½åç级id43 $("#test_modify_user_info_modify_class_btn").click(function(){44	 $("#show_class_div").hide();45	$("#show_xy_major_class").show("slow",function(){46		var xyIdString=$("#xy").find("option:first").val();47		var majorIdString=$("#major").find("option:first").val();48		var bjIdString=$("#bj").find("option:first").val();49		var xyId=parseInt(xyIdString, 10);50		var majorId=parseInt(majorIdString,10);51		bjId=parseInt(bjIdString,10);52		$.ajax({53	    	   type: "POST",54	    	   url: "getAllXyAndMajorAndClass",55	    	   data:{56	    		      "xyId":xyId,57	    		      "majorId":majorId,58	    		      },59	    	         // æåè¿åmap60	    	   success: function(data){61         	    	   var options="";62         	    	   var majoroptions="";63         	    	   var bjoptions="";64         	    	   //å
ååºå¦é¢ åmajorçlist å¨evalè§£æ65                       // var xueYuan=eval("("+data["xueYuan"]+")");\66         	    	   var xueYuanDemo=data["xueYuan"];67         	    	   var majorDemo=data["major"];68         	    	   var bjDamo=data["bj"];69         	    	   var major=eval("("+majorDemo+")");70         	    	   var xueYuan=eval("("+xueYuanDemo+")");71         	    	    bj=eval("("+bjDamo+")");72         	    	    73         	    for(var i=0;i<xueYuan.length;i++){74         	        if(xyId==xueYuan[i].xyId){75         	    		   options+="<option value="+xueYuan[i].xyId+" selected='selected'>"+xueYuan[i].xyName+"</option>";76         	    	    }77         	    		 else{78         	    			options+="<option value="+xueYuan[i].xyId+">"+xueYuan[i].xyName+"</option>";79         	    		  }80         	    	  }81         	82         	    	  83         	 for(var j=0;j<major.length;j++){84         	         if(majorId==major[j].majorId){85         	    			 majoroptions+="<option value="+major[j].majorId+" selected='selected'>"+major[j].majorName+"</option>";86            	    	    }87            	    		else{88            	    		majoroptions+="<option value="+major[j].majorId+">"+major[j].majorName+"</option>";89            	    	   }90         	    	 }91         	 92         	for(var k=0;k<bj.length;k++){93	    		  if(bjId==bj[k].classId){94	    			  bjoptions+="<option value="+bj[k].classId+" selected='selected'>"+bj[k].classGrade+"</option>";95	    	       }96	    		else{97	    			  bjoptions+="<option value="+bj[k].classId+">"+bj[k].classGrade+"</option>";98	    	   }99	    	 }100                     $("#xy").html(options);101         	    	 $("#major").html(majoroptions);102         	    	 $("#bj").html(bjoptions);103	    	   }, 104	    	   error:function(data){105	    		     alert(data);106	    	   },107	      });	108	});  109	});110	111   /***112    * 妿 ¡æ¹åï¼ä¸ä¸èå¨113    * @author nele nele0716@163.com 2013-11-5114    */115    $("#xy").change(function(){116       var xyIdModifyString=$("#xy").val();117       var xyIdModify=parseInt(xyIdModifyString, 10);118       $.ajax({119			  type:"post",120		      url:"getMajor",121		      dataType:"json",122		      cache:false,123		      data:{124		    	  "xyId":xyIdModify,125		      },126		      success:function(data){127      	    	  var dataObj=eval("("+data+")");//讲å符åè½¬æ¢æjsonæ ¼å¼128//		    	   alert(dataObj.length);//å¯ä»¥å»jsonå¼å¾é¿åº¦129      	    	 var options="";130      	    	 options+="<option value='0'>==è¯·éæ©ç±»å==</option>"; 131      	    	  for(var i=0;i<dataObj.length;i++){132      	    		  options+="<option value="+dataObj[i].majorId+">"+dataObj[i].majorName+"</option>";//æ¼åoption133      	    	  }134      	    	  135      	    	  $("#major").html(options);//讲optionså å
¥<select>ä¸136		          $("#bj").html("<option>==è¯·éæ©ç级==</option>")137		      },138		      error:function(data){139		    	  alert(data);140		      }141		   });142    	143    });144 145    /***146     * ä¸ä¸æ¹åæ¶ï¼è·å¾å¯¹åºçççº§ï¼æ¾ç¤ºå¨ç级ç䏿å表ä¸147     * @author nele nele0716@163.com 2013-11-4148     */149    $("#major").change(function(){150    	var majorIdModifyString=$("#major").val();151    	var majorIdModify=parseInt(majorIdModifyString, 10);152    	 $.ajax({153		    	type:"post",154		    	url:"getClass",155		    	dataType:"json",156		    	cache:false,157		        data:{158		        	"majorId":majorIdModify,159		        },160		        success:function(data){161		        	var result=eval("("+data+")");162		        	var options="";163		        	options+="<option value='0'>==è¯·éæ©ç±»å==</option>";164		        	for(var i=0;i<result.length;i++){165		        		options+="<option value="+result[i].classId+">"+result[i].classGrade+"</options>";166		        	}167		        	$("#bj").html(options);168		        },169		        error:function(data){170		        	alert(data);171		        }172		    }); 173    	174    });175    176    /***177     * éæ©æ°ç级æ¶ãè·å¾æ°ç级çid178     * @author nele  nele0716@163.com 2013-11-5179     */180     var bjIdModify;//éæ©çæ°ç级çid181	 $("#bj").change(function(){182		    var bjIdModifyString=$("#bj").val();183		    bjIdModify=parseInt(bjIdModifyString, 10);	    184	});185	 186	 /***187	  * æäº¤ä¿®æ¹çå¦é¢ï¼ä¸ä¸ï¼ç级ï¼188	  * @author nele nele0716@163.com 2013-11-4189	  */190	$("#modify_ok").click(function(){191		var bjIdModifyString=$("#bj").val();192		var bjIdModifySubmit=parseInt(bjIdModifyString, 10);193		var s_num=$("#sno").val();194		var pk_sno_string=$("#pk_sno").val();195	    var pk_sno=parseInt(pk_sno_string, 10);196		$("#show_xy_major_class").hide("fast");197		$("#show_class_div").show("slow");198		if(bjIdModify!=bjId){199			for(var k=0;k<bj.length;k++){200				if(bj[k].classId==bjIdModify)201					$("#bjName").text(bj[k].classGrade);202			}203			$.ajax({204				type:"post",205				url:"modifyClassId",206				dataType:"json",207			    cache:false, 208			    data:{209			    	"classId":bjIdModifySubmit,210			    	"sno":pk_sno,211			    },212			    success:function(data){213			    	alert(data);214			    },215			    error:function(data){216			    	alert("ä¿®æ¹ç级åºéï¼");217			    }218			});219	    }220		221	});222	223	/**224	 * ä¿®æ¹ç级idåæ¶æä½225	 * @author nele nele0716@163.com  2013-11-5226	 */227	$("#bi_modify_cancal_btn").click(function(){228		$("#show_xy_major_class").hide("fast");229		$("#show_class_div").show("slow");230	});231	232	/***233	 * ç¹å»ä¿®æ¹å¯ç ï¼æ¾ç¤ºä¿®æ¹div234	 * @author nele nele0716@163.com 2013-11-5235	 */236   $("#click_to_modify_pwd").click(function(){237	     $("#click_modify_pwd_div").hide();238	     $("#show_modify_pwd_box").show("slow");239   });240   241   242   /***243    * 对è¾å
¥åå§å¯ç è¿è¡éªè¯244    * @author nele  nele0716@163.com 2013-11-6245    */246   $("#pre_pwd").blur(function(){247	   var sno=$("#sno").val();248	   var pre_pwd_node=$("#pre_pwd");249	   var waring_node= $("#right_show_error_warning");250	   var new_pwd_node=$("#new_pwd");251	   var new_pwd_again_node=$("#new_pwd_again");252	   var pre_pwd=pre_pwd_node.val();253	   if(pre_pwd==""){254		   waring_node.html("åå§å¯ç ä¸è½ä¸ºç©ºï¼");255		   return;256	   }257	   $.ajax({258		      type:"post",259			  url:"verifyToPrePwd",260		      dataType:"json",261		      cache:false, 262		      data:{263		    	  "prePwd":pre_pwd,264		    	  "s_num":sno,265		      },266		      success:function(data){267		    	 if(data=="åå§å¯ç ä¸æ£ç¡®"){268		    		 if(new_pwd_node.attr("disabled")!="disabled")269			    		    new_pwd_node.attr("disabled","disabled");270			    	if(new_pwd_again_node.attr("disabled")!="disabled")271			    			 new_pwd_again_node.attr("disabled","disabled");272			    	waring_node.html("åå§å¯ç ä¸æ£ç¡®,è¯·éæ°è¾å
¥");273		    		 return;274		    	 }275		    	 else{276		    		 if(new_pwd_node.attr("disabled")=="disabled")277			    		    new_pwd_node.attr("disabled",false);278			    	if(new_pwd_again_node.attr("disabled")=="disabled")279			    			 new_pwd_again_node.attr("disabled",false);280		    		 waring_node.html("åå§å¯ç æ£ç¡®");281		    	 }282		    		 283		      },284		      error:function(data){285		    	  alert("éªè¯åå§å¯ç åºç°é误ï¼");286		    	  return;287		      }288	    });289   });290    291   /***292    * ç¹å»ååè¾æ°å¯ç ï¼å¹¶æäº¤ä¿®æ¹å¯ç 293    * @author nele nele0716@163.com 2013-11-5294    */295   $("#pwd_modify_ok").click(function(){296	   var sno=$("#sno").val();297	   var pk_sno_string=$("#pk_sno").val();298	   var pk_sno=parseInt(pk_sno_string, 10);299	   var pre_pwd_node=$("#pre_pwd");300	   var new_pwd_node=$("#new_pwd");301	   var new_pwd_again_node=$("#new_pwd_again");302	   var  waring_node= $("#right_show_error_warning");303	   var new_pwd=new_pwd_node.val();304	   var new_pwd_again=new_pwd_again_node.val();305	   pre_pwd_node.val("");306	   new_pwd_node.val("");307	   new_pwd_again_node.val("");308	   309	   if(new_pwd==""){310		   waring_node.html("æ°å¯ç ä¸è½ä¸ºç©º!");311		   return;312	   }313	   if(new_pwd_again==""){314		   waring_node.html("æ°å¯ç éå¤ä¸è½ä¸ºç©º!");315		   return;316	   }317	   if(new_pwd!=new_pwd_again){318		   waring_node.html("两次è¾å
¥çæ°å¯ç ä¸ä¸è´");319		   return;320	   }321	   $.ajax({322		  type:"post",323		  url:"studentModifyPwd",324	      dataType:"json",325	      cache:false, 326	      data:{327	    	  "pwd":new_pwd,328	    	  "sno":pk_sno,329	      },330	      success:function(data){331	    	  alert(data);332	    	  $("#show_modify_pwd_box").hide();333	          $("#click_modify_pwd_div").show();	  334	      },335	      error:function(data){336	    	   alert("æ´æ¹å¯ç å¤±è´¥å¦");337	      }338		   339	   });340	   341   });342    /***343     *å¯ç ä¿®æ¹divåæ¶344     * @author nele nele0716@163.com 2013-11-6345     */346   $("#pwd_modify_cancel").click(function(){347         $("#show_modify_pwd_box").hide();348         $("#click_modify_pwd_div").show();349   });350   351   352   /**353    * ç¹å»ä¿®æ¹é®ç®±354    * @author nele nele0716@163.com 2013-11-6355    */356   $("#email_submit_modify_btn").click(function(){357	   var new_email_node=$("#email_modify_text");358	   var new_email=new_email_node.val();359	   var pk_sno_string=$("#pk_sno").val();360	   var pk_sno=parseInt(pk_sno_string, 10);361	   var emailReg=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;362	   if(!emailReg.test(new_email)){363		   $("#email_warning").text("é®ç®±æ ¼å¼ä¸æ£ç¡®ï¼");364		   return;365	   }366	   else{367		   $("#email_warning").text("");368	   }369	   $.ajax({370		    type:"post",371		    url:"modifyEmail",372		    dataType:"json",373		    cache:false, 374		    data:{375		    	  "new_email":new_email,376		    	  "sno":pk_sno,377		      },378		      success:function(data){379		    	  alert(data);  380		      },381		      error:function(data){382		    	  alert("ä¿®æ¹é®ç®±é误ï¼");383		      }384		   385	   });386   });...headerinfoconf.js
Source:headerinfoconf.js  
1var global_pageintegration_header={2		email_old : null,3		phoneNum_old : null,4		descInfo_old : null,5		modifyUserInfo:function(){6			var canSendRequest = true;7//			var modifyUserInfoUserNameTF = new Gv.form.TextField({8//				id : 'modifyUserInfoUserNameTF-id',9//				fieldLabel : 'ç¨æ·å',10//				allowBlank : true,11//				disabled : true,12//				value : "aaa"13//			});14			//alert(global_pageintegration_header.LonginUserEmail);15			var modifyUserInfoEmailEF = new Gv.form.EmailField({16				id : 'modifyUserInfoEmailEF-id',17				fieldLabel : '<i class="gv-field-required-star">*</i>é®ç®±å°å',18				allowBlank : false,19				//value : global_pageintegration_header.LonginUserEmail,20				blankText : 'é®ç®±å°åä¸è½ä¸ºç©º',21				emptyText : "请è¾å
¥é®ç®±å°å"22			});23			var modifyUserInfoPhoneNumTF = new Gv.form.TextField({24				id : 'modifyUserInfoPhoneNumTF-id',25				fieldLabel : 'ææºå·',26				//value : global_pageintegration_header.LonginUserPhoneNum,27				allowBlank : true,28				emptyText : "请è¾å
¥ææºå·"29			});30			var modifyUserInfoDescInfoTA = new Gv.form.TextArea({31				id : 'modifyUserInfoDescInfoTA-id',32				height : 50,33				fieldLabel : 'æè¿°ä¿¡æ¯',34				allowBlank : true,35				//value : global_pageintegration_header.LonginUserDescInfo,36				emptyText : "请è¾å
¥æè¿°ä¿¡æ¯",37				maxLength : 12838			});39			var modifyUserInfoForm = new Gv.form.FormPanel({40				id : 'modifyUserInfoForm-id',41				layout : 'form',// ååå½¢å¼form,ååå½¢å¼column42				items : [ modifyUserInfoEmailEF,modifyUserInfoPhoneNumTF,modifyUserInfoDescInfoTA ]43			});44			var modifyUserInfoWin = new Gv.Window(45					{46						id : 'modifyUserInfoWin-id',47						title : 'ä¿®æ¹ä¸ªäººä¿¡æ¯',48						width : 415,49						height : 140,50						bodyStyle : 'padding:10px;',51						items : [ modifyUserInfoForm ],52						listeners:{53							afterLayout : function() {54								//ç´§è´è¾å
¥å¯ç 55								$("#modifyUserInfoEmailEF-id").bind('keyup',function(){56									this.value = this.value.replace(/\s/g,'');57								});58								$("#modifyUserInfoPhoneNumTF-id").bind('keyup',function(){59									this.value = this.value.replace(/\s/g,'');60								});61							}62						},63						tbar : [64								{65									text : '确认',66									handler : function() {67										if(!canSendRequest){68											return;69										}70										var emailVal = modifyUserInfoEmailEF.value().trim();71										var phoneNumVal = modifyUserInfoPhoneNumTF.value().trim();72										var userDescVal = modifyUserInfoDescInfoTA.value().trim();73										Gv.log("emailVal : " + emailVal);74										Gv.log("phoneNumVal : " + phoneNumVal);75										Gv.log("userDescVal : " + userDescVal);76										if(global_pageintegration_header.email_old == emailVal && global_pageintegration_header.phoneNum_old == phoneNumVal && global_pageintegration_header.descInfo_old == userDescVal){77											Gv.msg.info({html:'å项å¼é½æªæ¹å,ä¸éè¦ä¿®æ¹!',zIndex : 11000});78											return;79										}80										var checkNoError = true;81										if(!modifyUserInfoEmailEF.validate()){82											checkNoError = false;83										}84//										if(emailVal == null || emailVal == ""){85//											modifyUserInfoEmailEF.setTipsContent('Emailä¸è½ä¸ºç©º');86//											modifyUserInfoEmailEF.addError();87//											checkNoError = false;88//										}else{89//											var eamilPtn = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,4}$/;90//											if (emailVal != "" && emailVal != null91//													&& !eamilPtn.exec(emailVal)) {92//												modifyUserInfoEmailEF.setTipsContent('䏿¯åæ³çEmailï¼è¯·éæ°è¾å
¥');93//												modifyUserInfoEmailEF.addError();94//												checkNoError = false;95//											}96//										}97										var phoneNumPtn = /^1[3|5|8][0-9]\d{8}$/;98										if (phoneNumVal != "" && phoneNumVal != null99												&& !phoneNumPtn.exec(phoneNumVal)) {100											modifyUserInfoPhoneNumTF.setTipsContent('䏿¯å®æ´ç11使æºå·æè
æ£ç¡®çææºå·ï¼è¯·éæ°è¾å
¥');101											modifyUserInfoPhoneNumTF.addError();102											checkNoError = false;103										}104										if(userDescVal.length > 128){105											modifyUserInfoDescInfoTA.setTipsContent('æè¿°ä¿¡æ¯ä¸è½è¶
è¿128个å符ï¼è¯·éæ°è¾å
¥');106											modifyUserInfoDescInfoTA.addError();107											checkNoError = false;108										}109										if(!checkNoError){110											return;111										}112//									var tabId = Gv.frameTabPanel.getCurrentTabId();113//									Gv.maskMsg(true, 'tab-content-' + tabId, 'å è½½ä¸ï¼è¯·ç¨å...');114									Gv.ajax({115													url : '/pageframe/main/modifyUserInfo.action',116													data : {117														email : emailVal,118														phoneNum : phoneNumVal,119														descInfo : userDescVal,120														test : null121													},122													type : 'post',123													async : true,124													dataType : 'json',125													beforeSend:function(){126														canSendRequest = false;127													},128													successFun : function(retVal) {129														canSendRequest = true;130														//Gv.maskMsg(false, 'tab-content-' + tabId, 'å è½½ä¸ï¼è¯·ç¨å...');131														if(retVal.result){132															modifyUserInfoWin.close();133															Gv.msgNote("æä½æåï¼");134														}else{135															Gv.msg.error({html:retVal.msg,136																zIndex : 11000});137														}138													}139												});140									}141								}, {142									text : 'åæ¶',143									handler : function() {144										modifyUserInfoWin.close();145									}146								} ]147					});148			Gv.ajax({149				url : '/pageframe/main/queryLoginUser.action',150				data : {151				},152				type : 'post',153				async : true,154				dataType : 'json',155				beforeSend:function(){156					canSendRequest = false;157				},158				successFun : function(retVal) {159					canSendRequest = true;160					Gv.log(retVal);161					if(retVal.result){162						modifyUserInfoEmailEF.value(retVal.email);163						modifyUserInfoPhoneNumTF.value(retVal.phoneNum);164						modifyUserInfoDescInfoTA.value(retVal.descInfo);165						global_pageintegration_header.email_old = retVal.email;166						global_pageintegration_header.phoneNum_old = retVal.phoneNum;167						global_pageintegration_header.descInfo_old = retVal.descInfo;168					}else{169						Gv.msg.error({html:retVal.msg,170							zIndex : 11000});171					}172				}173			});174		},175		modifyPwd:function(){176			var canSendRequest = true;177			var modifyPwdNewPwd = new Gv.form.Password({178				id : 'modifyPwdNewPwd-id',179				fieldLabel : '<i class="gv-field-required-star">*</i>æ°å¯ç ',180				allowBlank : false,181				blankText : 'æ°å¯ç ä¸è½ä¸ºç©º',182				emptyText : "请è¾å
¥æ°å¯ç "183			});184			var modifyPwdVerifyNewPwd = new Gv.form.Password({185				id : 'modifyPwdVerifyNewPwd-id',186				fieldLabel : '<i class="gv-field-required-star">*</i>确认æ°å¯ç ',187				allowBlank : false,188				blankText : '确认æ°å¯ç ä¸è½ä¸ºç©º',189				emptyText : "请è¾å
¥æ°å¯ç "190			});191			var modifyPwdForm = new Gv.form.FormPanel({192				id : 'modifyPwdForm-id',193				layout : 'form',// ååå½¢å¼form,ååå½¢å¼column194				items : [ modifyPwdNewPwd,modifyPwdVerifyNewPwd ]195			});196			var modifyPwdWin = new Gv.Window(197					{198						id : 'modifyPwd-id',199						title : 'ä¿®æ¹ä¸ªäººå¯ç ',200						width : 415,201						height : 90,202						bodyStyle : 'padding:10px;',203						items : [ modifyPwdForm ],204						listeners:{205							afterLayout : function() {206								//ç¦æ¢è¾å
¥ç©ºæ ¼207								$("#modifyPwdNewPwd-id").bind('keydown',function(e){208									e=window.event||e;209									if(e.keyCode==32){210										e.keyCode = 0;211										return false;212									}213								});214								$("#modifyPwdVerifyNewPwd-id").bind('keydown',function(e){215									e=window.event||e;216									if(e.keyCode==32){217										e.keyCode = 0;218										return false;219									}220								});221							}222						},223						tbar : [224								{225									text : '确认',226									handler : function(id,text) {227										if(!canSendRequest){228											return;229										}230										var newPwd = modifyPwdNewPwd.value().trim();231										var newPwd2 = modifyPwdVerifyNewPwd.value().trim();232										Gv.log("newPwd : " + newPwd);233										var checkNoError = true;234										if(newPwd == null || newPwd == ""){235											modifyPwdNewPwd.setTipsContent('æ°å¯ç ä¸è½ä¸ºç©º');236											modifyPwdNewPwd.addError();237											checkNoError = false;238										}else if(newPwd.length < 6 || newPwd.length > 16){239											modifyPwdNewPwd.setTipsContent('å¯ç ç±6-16ä½åç¬¦ç»æ');240											modifyPwdNewPwd.addError();241											checkNoError = false;242										}243										if(newPwd2 == null || newPwd2 == ""){244											modifyPwdVerifyNewPwd.setTipsContent('确认æ°å¯ç ä¸è½ä¸ºç©º');245											modifyPwdVerifyNewPwd.addError();246											checkNoError = false;247										}else if (newPwd2 != newPwd) {248											modifyPwdVerifyNewPwd.setTipsContent('确认æ°å¯ç ä¸æ°å¯ç ä¸ä¸è´');249											modifyPwdVerifyNewPwd.addError();250											checkNoError = false;251										}252										if(!checkNoError){253											return;254										}255//									var tabId = Gv.frameTabPanel.getCurrentTabId();256//									Gv.maskMsg(true, 'tab-content-' + tabId, 'å è½½ä¸ï¼è¯·ç¨å...');257										Gv.get(id).html(Gv.LoadingHtml);258										Gv.ajax({259													url : '/pageframe/main/modifyPwd.action',260													data : {261														newPwd : newPwd262													},263													type : 'post',264													async : true,265													dataType : 'json',266													beforeSend:function(){267														canSendRequest = false;268													},269													successFun : function(retVal) {270														Gv.get(id).html("ç¡®å®");271														canSendRequest = true;272														//Gv.maskMsg(false, 'tab-content-' + tabId, 'å è½½ä¸ï¼è¯·ç¨å...');273														modifyPwdWin.close();274														if(retVal.result){275															Gv.msgNote("æä½æåï¼");276														}else{277															Gv.msg.error({html:retVal.msg,278																zIndex : 11000});279														}280													}281												});282									}283								}, {284									text : 'åæ¶',285									handler : function() {286										modifyPwdWin.close();287									}288								} ]289					});290		},291		infoConf:function(){292		}...abilities.js
Source:abilities.js  
1'use strict';2exports.BattleAbilities = {3	"defeatist": {4		inherit: true,5		onModifyAtk: function (atk, pokemon) {6			if (pokemon.hp <= pokemon.maxhp / 4) {7				return this.chainModify(0.5);8			}9		},10		onModifySpA: function (atk, pokemon) {11			if (pokemon.hp <= pokemon.maxhp / 4) {12				return this.chainModify(0.5);13			}14		},15		desc: "Halves Attack damage when the user's health is below 1/4",16		shortDesc: "Halves Attack damage when the user's health is below 1/4",17	},18	"gluttony": {19		inherit: true,20		onEatItem: function (item, pokemon) {21			if (!pokemon.volatiles['gluttony']) pokemon.addVolatile('gluttony');22		},23		effect: {24			duration: 2,25			onStart: function (target) {26				this.add('-start', target, 'ability: Gluttony');27			},28			onModifySpe: function (spe, pokemon) {29				return this.chainModify(0.66);30			},31			onModifyAtk: function (atk, pokemon) {32				return this.chainModify(0.66);33			},34			onModifyAtkPriority: 6,35			onSourceModifyAtk: function (atk, attacker, defender, move) {36				if (move.type === 'Ice' || move.type === 'Fire') {37					this.debug('Gluttony weaken');38					return this.chainModify(0.5);39				}40			},41			onModifySpAPriority: 5,42			onSourceModifySpA: function (atk, attacker, defender, move) {43				if (move.type === 'Ice' || move.type === 'Fire') {44					this.debug('Gluttony weaken');45					return this.chainModify(0.5);46				}47			},48			onEnd: function (target) {49				this.add('-end', target, 'ability: Gluttony');50			},51		},52		desc: "Doubles berries effects upon being eaten.",53		shortDesc: "Doubles berries effects upon being eaten. Lowers users speed and atk by 1 stage for 2 turns, adds thick fat effect",54	},55	"immunity": {56		inherit: true,57		desc: "This Pokemon cannot be poisoned, burned or paralyzed. Gaining this Ability while poisoned, burned or paralyzed cures it.",58		shortDesc: "This Pokemon cannot be poisoned, burned or paralyzed. Gaining this Ability while poisoned, burned or paralyzed cures it.",59		onUpdate: function (pokemon) {60			if (pokemon.status === 'psn' || pokemon.status === 'tox' || pokemon.status === 'par' || pokemon.status === 'brn') {61				this.add('-activate', pokemon, 'ability: Immunity');62				pokemon.cureStatus();63			}64		},65		onSetStatus: function (status, target, source, effect) {66			if (status.id !== 'psn' && status.id !== 'tox' || status.id !== 'brn' || status.id !== 'par') return;67			if (!effect || !effect.status) return false;68			this.add('-immune', target, '[msg]', '[from] ability: Immunity');69			return false;70		},71	},72	"turboblaze": {73		inherit: true,74		onModifyAtkPriority: 5,75		onModifyAtk: function (atk, attacker, defender, move) {76			if (move.type === 'Fire') {77				this.debug('TurboBlaze boost');78				return this.chainModify(1.5);79			}80		},81		onModifySpAPriority: 5,82		onModifySpA: function (atk, attacker, defender, move) {83			if (move.type === 'Fire') {84				this.debug('TurboBlaze boost');85				return this.chainModify(1.5);86			}87		},88		desc: "Boosts Fire type attacks by 1.5x.",89		shortDesc: "Boosts Fire type attacks by 1.5x.",90	},91	"teravolt": {92		inherit: true,93		onModifyAtkPriority: 5,94		onModifyAtk: function (atk, attacker, defender, move) {95			if (move.type === 'Electric') {96				this.debug('Teravolt boost');97				return this.chainModify(1.5);98			}99		},100		onModifySpAPriority: 5,101		onModifySpA: function (atk, attacker, defender, move) {102			if (move.type === 'Electric') {103				this.debug('Teravolt boost');104				return this.chainModify(1.5);105			}106		},107		desc: "Boosts Electric type attacks by 1.5x.",108		shortDesc: "Boosts Electric type attacks by 1.5x.",109	},110	"moldbreaker": {111		inherit: true,112		onHit: function (target, source, move) {113			if (move && move.effectType === 'Move') {114				this.chainModify(1.33);115			}116		},117		onModifyMove: function (move, pokemon) {118			if (move.basePower < 120 && pokemon.types.indexOf(move.type) > -1) this.chainModify(1.25);119		},120		desc: "Ignores abilities, increases the power of all STAB moves at or under 120 BP by 50%. In return, damage taken is increased by 33%.",121		shortDesc: "Ignores Abilities, Boosts STAB Moves under 120 BP by 50%, but takes 33% more damage.",122	},123	"unburden": {124		inherit: true,125		onAfterUseItem: function (item, pokemon) {126			if (pokemon !== this.effectData.target) return;127			pokemon.addVolatile('unburden');128		},129		onTakeItem: function (item, pokemon) {130			pokemon.addVolatile('unburden');131		},132		onEnd: function (pokemon) {133			pokemon.removeVolatile('unburden');134		},135		effect: {136			onModifySpe: function (spe, pokemon) {137				if (!pokemon.item) {138					return this.chainModify(1.5);139				}140			},141		},142		desc: "1.5x Speed when the user loses their item.",143		shortDesc: "1.5x Speed when the user loses their item.",144	},145	"intimidate": {146		inherit: true,147		onStart: function (pokemon) {148			let foeactive = pokemon.side.foe.active;149			let activated = false;150			for (let i = 0; i < foeactive.length; i++) {151				if (!foeactive[i] || !this.isAdjacent(foeactive[i], pokemon)) continue;152				if (!activated) {153					this.add('-ability', pokemon, 'Intimidate', 'boost');154					activated = true;155				}156				if (foeactive[i].volatiles['substitute'] || foeactive[i].ability === 'intimidate') {157					this.add('-immune', foeactive[i], '[msg]');158				} else {159					this.boost({atk: -1}, foeactive[i], pokemon);160				}161				if (Math.floor(Math.random() * 99) < 20) {162					this.boost({spe: -1}, foeactive[i], pokemon);163				}164			}165		},166		desc: "Intimidate cannot affect other Intimidate users. In return, Intimidate also has a 20% chance to lower the enemies' Speed by one stage.",167		shortDesc: "Intimidaters are immune to Intimidate, Intimidaters has 20% chance to lower foe's Speed by 1 stage.",168	},169	"stickyhold": {170		inherit: true,171		onAfterDamage: function (target, source, effect, damage) {172			if (effect && effect.flags['contact']) {173				this.add('-ability', target, 'Sticky Hold');174				this.boost({175					spe: -1,176				}, source, target, null, true);177			}178		},179		desc: "User's item cannot be knocked off, and lowers Speed by one stage upon being hit by a contact move.",180		shortDesc: "User's item cannot be knocked off, and lowers Speed by one stage upon being hit by a contact move.",181	},182	"gooey": {183		inherit: true,184		onAfterDamage: function (damage, target, source, effect) {185			if (effect && effect.flags['contact']) {186				this.add('-ability', target, 'Gooey');187				this.boost({spe: -2}, source, target, null, true);188			}189		},190		desc: "If the user is hit by a contact move, the attacker's speed drops two stages.",191		shortDesc: "If the user is hit by a contact move, the attacker's speed drops two stages.",192	},193	"multitype": {194		inherit: true,195		desc: "If this Pokemon is an Arceus or Dunsparce, its type changes to match its held Plate or Z-Crystal.",196		shortDesc: "If this Pokemon is an Arceus or Dunsparce, its type changes to match its held Plate or Z-Crystal.",197	},...Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
