diff --git a/assets/binary.go b/assets/binary.go index 0f2f9862..ef095152 100644 --- a/assets/binary.go +++ b/assets/binary.go @@ -117,7 +117,7 @@ func publicJsApplicationJs() (*asset, error) { return a, nil } -var _publicJsForm2jsJs = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x8c\x56\xdb\x6e\xdb\x38\x13\xbe\x2f\xd0\x77\x70\x84\x1f\x06\x59\x33\x72\xf2\x03\x7b\xb1\x56\xd8\x20\x49\x73\x51\xa0\xe8\x2e\xb6\x59\x60\x01\x45\x2d\x64\x8b\xb6\x69\x4b\xa2\x42\x51\x3e\x29\x7a\xf7\x1d\x1e\x74\x88\x81\xed\xae\x2f\x64\x6a\xf8\xcd\xe9\x9b\xe1\x88\xd3\x0f\xa3\xb5\x52\x45\x39\x9b\x4e\x57\x5c\xad\xab\xb9\xbf\x10\xd9\x34\x8b\x0f\xb1\xda\x0b\xb9\x9d\x2e\x85\xcc\xfe\xbf\x29\x47\x1f\xa6\xef\xdf\xa1\x65\x95\x2f\x14\x17\x39\x8a\xc9\x1c\xd7\x7c\x89\xd4\xb1\x60\x62\x39\x62\x87\x42\x48\x55\x5e\x50\xea\x55\x79\xc2\x96\x3c\x67\x89\x37\x1e\xbb\xdd\x4c\x24\x55\xca\xce\x37\xad\xd4\x77\xaa\xb8\x7e\xfb\x4e\xe7\x08\x37\x2c\x2d\xd9\xc0\x8b\xd5\xa5\x60\xa7\x8d\x03\xcc\x58\xa1\x1f\x67\x09\xae\xed\x1a\xcd\x9d\x66\xec\xbb\xe0\x8d\xb1\xa6\x41\x6a\xcd\x4b\xd2\xe5\x80\xeb\x76\x39\x62\x28\x23\x5b\xb2\x21\x2f\x24\x25\x12\xd7\x92\xca\x5b\x25\x2b\x36\x5b\xc6\x60\x27\xe8\x23\xd8\xbc\xc9\xe1\xf5\x15\xde\xf3\x2a\x4d\x71\xbd\xa1\x1a\xdf\xf4\xc8\xed\x19\x72\xdb\x22\xb7\xd4\xf3\x3d\x0d\x8c\xe5\xaa\xca\x58\xae\x4a\x3f\x65\xf9\x4a\xad\x6f\x7e\xc1\x75\x4a\x8d\xc7\x26\xa3\x2d\x75\x60\xa6\x54\x92\xe7\x2b\xef\x36\x11\x0b\xa3\xe0\xaf\x98\x7a\x4c\x99\x5e\xde\x1f\x3f\x27\x28\xc3\xb3\x2c\xd8\xc5\x72\x54\xd0\x30\x22\x82\xe4\xf4\x4a\x87\x9c\x41\x21\x73\xd0\xad\x16\x4a\x48\x4a\xef\xa4\x8c\x8f\xaf\xaf\x6d\x7c\x5f\x45\xc2\xbe\xf0\x52\x5d\x9c\x15\xe5\xad\x52\x8b\xc2\xb8\xde\xaf\x79\xca\x90\xa0\x59\x98\x4f\x26\x11\xae\x0b\x5a\x68\xec\x22\x56\x28\x41\xc2\x31\x07\x2c\x1b\xe6\x0b\x0a\x61\x39\x59\x23\x99\xaa\x64\x3e\x9a\xa3\x02\x18\xde\xe2\xa6\x63\x7d\x8e\x4a\x72\x47\x1e\x70\x6d\x83\xaf\x1b\xf2\xa2\x1f\x47\x72\x20\x7b\xb2\x23\x15\x91\x24\x27\x0a\x32\xca\xc8\x89\x7c\x22\xf7\x01\x94\x13\x1d\x21\xbb\xe3\x4d\x4b\x5a\x70\x9c\x4c\x70\x5d\xd1\x32\x3c\x46\xfe\x2e\x4e\x2b\x53\xad\xbb\xf1\x18\x55\xba\x4f\x80\x78\xfd\x6f\x98\xc7\x35\x84\xab\x78\x0e\x65\xfa\x64\xf1\x79\x9c\xb1\xe0\x9e\x7e\xf2\xcb\x22\xe5\x0a\x3d\xe0\x40\x02\x83\x41\x4e\x8b\x40\x81\xae\x71\x77\x00\x77\x87\x9b\xfb\xd6\xdd\x41\xbb\x3b\xd1\xfb\xf0\x10\x39\x2d\x2f\x0a\x3d\xac\x9d\x9e\x1c\xe6\xe3\x35\x34\x16\x68\xee\x41\x73\x7f\xd3\x4a\x83\xbd\xd6\x04\xd8\x9e\xd2\x2b\x30\x11\xee\x23\xaa\x1f\x13\x2f\xf2\xba\x3e\x87\xbd\x16\x7f\x79\xed\x40\x5e\xe8\x4d\xf4\xc2\x82\xde\x88\x8c\x2e\xf4\x8a\x5e\xfb\x59\xac\x16\x6b\x34\x45\x61\x7c\x79\xfa\x11\x4d\xf0\xed\x73\xe8\xd6\xfa\x79\x75\xf9\x2b\x08\x6f\xf1\x73\x34\xe5\x26\xda\xcc\x06\xb9\xa3\xd7\xc1\xee\x26\x6b\x83\xdc\xb9\x20\xb3\x70\x07\x25\x96\x7e\x51\x95\x6b\xfb\xd2\xb8\xca\x3a\x99\x76\xd9\xcb\xa8\x6c\x5b\xe1\x04\xc2\x9e\x36\x79\x46\x9b\x04\xda\x2c\x55\x1c\x7a\xee\xf0\xdb\x12\x79\x61\xe4\xe1\x8f\x97\xd7\xe3\xf1\x81\x52\x39\xc8\x5d\x00\x13\x65\x35\x87\x56\x44\x57\x64\x88\xf7\x30\x0e\xd4\x84\x0a\x6d\xe7\x22\x0f\x05\xc4\xa9\x9f\x50\xb8\x46\xff\xdb\xf0\xaa\x7e\x76\xbc\xd5\xfd\xf8\xaf\xb6\x81\x4e\x5f\xb2\x22\x8d\x17\x0c\xd8\xfc\x3e\xe4\x13\xbf\xa2\xe7\xe8\x7f\x18\xe6\x24\xf1\x3c\x13\x85\xf7\xc3\x9b\x88\x89\x7e\x66\x26\x9e\x97\x50\x41\x3c\xfa\x09\x8d\xac\x0f\xb9\x80\xf3\x05\xc7\xea\x2c\x50\xd8\x38\x4b\x57\x43\x75\xbf\x02\xa6\xcd\x20\xd0\x66\xc2\x2c\xa2\x79\x98\x77\x48\xd7\x06\xc3\x4c\x07\x38\x11\x85\x66\xa7\x47\x77\x34\x5c\x38\x94\x71\x85\xa6\xdf\x43\xe8\x08\x9b\xd9\x73\x78\x0b\x3d\xe1\x2b\x56\x2a\x04\x05\x9a\x5c\x47\x18\x0f\x1c\xd4\x0d\x3e\xf7\x19\x42\xe9\x7f\xea\x34\xa7\x6e\xdb\x6a\x02\x51\x27\x4d\x4f\xdf\x10\x2e\x65\xa0\xe5\x64\x68\x39\x19\xbe\x72\xaa\x57\xad\x37\x90\x55\x8d\xfe\xb9\xf9\x51\xf4\x83\x23\x41\x29\x8c\xeb\x8c\x6c\xec\xe8\xe0\x34\xee\x04\x81\x43\xf3\xf6\x34\x5e\xdd\xf2\xd9\xaa\xdb\xee\x6d\x58\x59\xde\xdb\x80\xd9\x99\xd1\xd4\x5f\x72\x59\xaa\x07\x18\x76\x49\x60\x47\x1e\x9c\x14\x4e\x79\xdb\xe0\xb1\xf9\x52\x68\x35\xdd\x2a\x99\x9f\xb3\x83\xfa\xc6\xe7\x29\x4c\xe8\x36\x50\xde\x3b\xb1\x68\xa1\x9d\x98\x89\x9c\xf0\x32\x9e\xa7\x2c\x81\x8e\x00\x91\xc5\x43\x3f\xe8\x00\x52\x30\xca\x49\x41\x01\x46\x04\x0e\x52\xba\x1d\x8f\xb7\xe0\x5c\x13\x97\x8e\xc7\xa9\x99\x56\x3a\x94\x30\x8d\xba\xaa\x16\xb6\xbd\x20\x0c\x18\xd4\x5f\x01\xd0\x8e\x81\xcf\x5f\x7f\xff\xf3\xe9\xf5\xe9\xf1\xaf\xa7\xbb\x3f\x1e\xef\xa0\xbe\xc0\x32\x5d\x20\xc3\x10\xe8\xe9\x81\xa8\xe7\xa2\xb1\xd7\x9a\xa3\x61\xad\x7d\xcc\x0a\x62\x06\xe9\x2c\x6f\x06\xfd\xf3\x8f\x9e\xbe\x3d\x7e\x79\x7c\x78\x3a\xf3\xd0\x99\xea\x8f\xd2\x73\x08\x67\x67\xaa\x0f\xce\xc0\xbc\x73\xbc\xea\x68\xea\xcb\x3d\x60\x71\x89\xb8\x63\x90\x1b\x16\xc6\x63\xfb\x7f\x61\x0e\x4c\x57\x70\x2d\xea\xe2\xdd\x68\x10\x4f\xec\xf3\x0c\xc8\x13\x37\xb7\x8c\xc0\x83\x19\xda\xfb\x5a\xa0\x0d\xe1\xc6\xd7\x66\x58\x2d\xde\xa9\x6b\xea\x9a\x72\xcf\x75\xf2\x9b\x8e\x0d\xf8\xb8\xc4\x25\xf3\x0c\xed\xde\xcc\xac\x5b\xf2\xbd\x59\x87\xd6\xdf\x5e\x5f\x89\x2f\x62\xcf\xe4\x03\x60\x10\x76\x7a\x32\x4e\xb8\xf0\x66\xc6\xeb\x62\xcd\x16\x5b\xed\x74\x63\x3f\x68\xe6\xbe\xa3\x6f\x05\x7d\x0a\xf6\x92\x60\x34\x0d\x7a\x2e\x0e\x3f\x51\xd6\x37\x93\x5e\xb7\xbd\xa7\x5c\xfc\x17\xb0\x75\x34\xb4\xdc\x6d\x39\x9d\x66\x2e\x59\xbc\x0d\x4c\x2c\xf3\x4a\x29\xb8\x93\xd9\xf4\x25\x2b\x99\x72\x6b\x18\xb6\x19\x6f\x5f\x78\x16\xaf\x98\x37\x6b\xc9\x0f\xac\x01\xb8\x82\xc4\x55\xaa\x66\x6f\xad\xdb\xcd\xa1\x0f\xdb\x6e\xad\xfa\x08\x58\xc5\x67\x16\xac\xca\xb0\x5a\x5d\x71\xd7\x48\xd8\xd3\xbe\xa5\xc2\xcf\x00\xcc\x8b\x94\x91\x8d\x3e\xfa\x39\x29\x88\x9d\xe1\xdb\x2e\x45\xe1\x52\xd4\x1f\xb4\x1c\x34\xfa\x7b\x57\x79\x7f\x7c\x8a\x57\xba\xf0\xc8\x13\x85\xb9\x89\x62\x38\xbb\x57\x30\x41\xda\x59\x1d\x14\x37\x59\x50\xb8\xef\x69\x1e\x16\x70\x5f\x60\x29\x5b\x28\x4d\xe1\xc6\xce\x51\x23\x35\x2e\x70\xd7\xf6\x9b\x76\xc1\x1a\x98\x30\xef\xdf\xfd\x1d\x00\x00\xff\xff\x6d\xe1\xcf\xc9\x9f\x0b\x00\x00") +var _publicJsForm2jsJs = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x5a\x6d\x53\x1b\x47\x12\xfe\x2c\x57\xf9\x3f\xb4\xa9\xab\x48\x0a\x42\xe0\xa4\xee\x43\xe0\x88\x23\x40\x04\xe5\x84\x44\x49\xc2\x8e\x4b\x56\x52\xab\xdd\x11\x1a\x58\xed\xea\x76\x57\x06\x82\xf9\xef\xd7\x3d\xef\x23\x2d\x76\xf0\xb9\xea\x1c\x82\x34\xbd\x3d\x4f\xbf\x4d\xf7\xf4\xcc\xb2\xfb\xfd\xf7\x2f\x5f\xc0\xf7\x70\x9c\x2e\xef\x33\x7e\x35\x2f\xa0\x16\xd6\xe1\x87\xbd\xd7\x7b\x70\x1e\xdc\xf1\x05\xbc\x0d\x72\x1e\x73\xf6\x91\xb8\x04\xe7\x05\xcb\x16\x3c\xcf\x79\x9a\x00\xcf\x61\xce\x32\x36\xbd\x87\xab\x2c\x48\x0a\x16\x35\x60\x96\x31\x06\xe9\x0c\xc2\x79\x90\x5d\xb1\x06\x14\x29\x04\xc9\x3d\x2c\x59\x96\xe3\x84\x74\x5a\x04\x3c\xe1\xc9\x15\x04\x10\xa2\x44\x01\x88\xdc\xc5\x1c\xa1\xf2\x74\x56\xdc\x06\x19\xc3\x09\x11\x04\x79\x9e\x86\x3c\x40\x4c\x88\xd2\x70\xb5\x60\x49\x11\x14\x24\x73\xc6\x63\x96\x43\xad\x98\x33\xd8\x1a\xaa\x19\x5b\x75\x21\x28\x62\x41\x2c\x10\x79\x02\xf4\x5c\x3f\x86\x5b\x5e\xcc\xd3\x55\x01\x19\xcb\x8b\x8c\x87\x84\xd3\x40\xa6\x30\x5e\x45\xa4\x8b\x7e\x1c\xf3\x05\x57\x52\x68\xba\x70\x47\x2e\x00\x11\x7c\x95\xa3\x35\xa4\x73\x03\x16\x69\xc4\x67\xf4\xc9\x84\x89\xcb\xd5\x34\xe6\xf9\xbc\x01\x11\x27\xf8\xe9\xaa\x40\x62\x4e\xc4\x90\x25\x34\x0b\xed\xd9\x4d\x33\xc8\x59\x2c\xd5\x43\x14\x8e\x36\x08\xbb\xad\x96\x82\x8f\x24\x2d\xc9\xc1\x85\x72\x59\x4e\x94\xdb\x79\xba\xf0\x2d\xe2\x52\xaf\xd9\x2a\x4b\x50\x34\x13\xf3\xa2\x14\x5d\x28\x24\x5f\xb3\xb0\x20\x0a\x4d\x99\xa5\x71\x9c\xde\x92\x99\x61\x9a\x44\x9c\xac\xcb\xf7\x4d\x30\x47\xc8\x11\x4c\xd3\x8f\x4c\x98\x26\x17\x40\x92\x16\xa8\xb9\xd4\x86\xe2\xb2\xb4\x01\x57\x8f\xf2\x79\x10\xc7\x30\x65\xca\x87\x28\x9e\x27\x02\x8e\xc8\xda\xba\x8c\x34\xc9\x0b\x5c\x17\x3c\x88\x61\x99\x66\x42\xf4\xba\xd5\x4d\xab\xca\x59\x1b\x86\xfd\xd3\xd1\xbb\xd6\xa0\x0d\x9d\x21\x5c\x0c\xfa\x6f\x3b\x27\xed\x13\xd8\x6a\x0d\x71\xbc\xd5\x80\x77\x9d\xd1\x59\xff\x72\x04\xc8\x31\x68\xf5\x46\xef\xa1\x7f\x0a\xad\xde\x7b\xf8\x77\xa7\x77\xd2\x80\xf6\xef\x17\x83\xf6\x70\x08\xfd\x81\x80\xeb\x9c\x5f\x74\x3b\x6d\xa4\x77\x7a\xc7\xdd\xcb\x93\x4e\xef\x57\x38\xc2\xb9\xbd\xfe\x08\xba\x9d\xf3\xce\x08\x81\x47\x7d\x21\x54\xc1\x75\xda\x43\x02\x3c\x6f\x0f\x8e\xcf\x70\xd8\x3a\xea\x74\x3b\xa3\xf7\x0d\x01\x76\xda\x19\xf5\x08\xfb\xb4\x3f\x80\x16\x5c\xb4\x06\xa3\xce\xf1\x65\xb7\x35\x80\x8b\xcb\xc1\x45\x7f\xd8\x46\x35\x4e\x10\xba\xd7\xe9\x9d\x0e\x50\x52\xfb\xbc\xdd\x1b\x35\x51\x32\xd2\xa0\xfd\x16\x07\x30\x3c\x6b\x75\xbb\x24\x4e\xe0\xb5\x2e\xd1\x92\x01\xe9\x0a\xc7\xfd\x8b\xf7\x83\xce\xaf\x67\x23\x38\xeb\x77\x4f\xda\x48\x3c\x6a\xa3\x86\xad\xa3\x6e\x5b\x8a\x43\x03\x8f\xbb\xad\xce\x79\x03\x4e\x5a\xe7\xad\x5f\xdb\x62\x56\x1f\x91\xa4\x9d\xc4\x2a\x35\x85\x77\x67\x6d\x22\x93\xdc\x16\xfe\x1c\x8f\x3a\xfd\x1e\x99\x74\xdc\xef\x8d\x06\x38\x6c\xa0\xc5\x83\x91\x99\xfe\xae\x33\x6c\x37\xa0\x35\xe8\x0c\xc9\x39\xa7\x83\xfe\xb9\x34\x96\x5c\x8c\xb3\xfa\x02\x08\xe7\xf6\xda\x12\x89\xdc\xef\x47\x09\x59\x68\x7c\x39\x6c\x1b\x50\x38\x69\xb7\xba\x88\x87\x21\xeb\x6d\x84\xd5\x06\xfb\x97\x60\x85\x39\x97\x95\xd4\x18\x38\xc1\xa4\xdf\x87\xbd\x9f\x9a\xf8\x43\x75\x48\xa2\xf0\x05\x12\x5f\xff\xb4\xbf\xf7\xc3\xfe\x8f\x3f\x12\x69\xf7\xe5\x0b\xfa\xaf\x36\x5b\x25\x22\xa1\xa1\x96\xa5\x69\x81\x05\x28\x08\x8b\x34\xbb\xaf\xbf\x7c\xf1\xf0\xf2\x45\x85\xcf\xb0\x54\xdc\x2f\x19\xae\x3a\x76\x47\x6b\x30\x87\x57\x87\x87\x50\x5d\x25\x11\x9b\xf1\x84\x45\x55\xf8\xee\x3b\x50\x1c\x98\xd7\xab\x98\x95\x31\xc8\x27\x4d\x05\x51\x07\x82\xae\xec\xee\x42\x2f\x8d\xd8\x6f\x43\x1a\xf8\x1c\x70\xa8\xf5\xa8\xd5\x0f\xf0\xf1\x23\xfe\xcf\xe2\x1c\x13\xc6\xea\x23\xf1\xe1\x90\xa4\x69\x23\x84\x30\xf9\xa0\x19\x2c\x22\x34\xa2\xa2\x45\xb5\xce\x4f\x9a\x30\x60\x57\x58\x63\x58\x86\xe5\x11\xf3\x13\x7f\xd2\xe4\x7e\x91\xae\x72\xad\x20\xf1\xca\xe9\x35\xed\x07\x57\xbc\x03\x77\x94\xa5\xb7\x39\x02\x5d\xc5\xe9\x34\x88\x73\xa2\x92\xff\x9a\xb3\x34\x5b\xfc\x70\x5d\x66\xc0\x63\x8d\xaa\x01\x3a\xd8\x38\x5c\xf9\x78\x0b\x4b\x23\xc8\xc2\xba\x75\x40\x31\xa9\x88\x4d\xa5\x82\x61\x1b\xb0\x02\x2b\x54\x0e\x84\x0a\x1f\x83\x78\x85\x85\x21\x63\x4b\xac\xc3\x8c\xb6\x0b\x32\xe3\xb7\xe0\x63\x90\x87\x19\x5f\x16\xb8\x3b\x50\xe1\x92\x33\xb7\x92\x60\xc1\xb6\x20\x28\x54\x45\x55\x5e\xc9\x49\xd0\x2a\x44\x54\xb1\xcb\x20\xd0\x2a\x2e\xa8\xb8\x39\x73\x25\xc0\x2f\xcb\x20\x0b\x16\x40\x46\x51\x94\xe0\xa1\x1d\x33\xda\x45\x3e\x0d\x11\x31\xb9\x7a\x14\x4f\xa4\x62\x4c\x3e\x81\x1a\x2e\x48\x5e\x54\x73\xe0\x51\x9d\xea\x57\x90\x65\xc1\xbd\x10\x43\xac\x8a\x2b\xf7\xe0\x23\x26\x36\x0d\x74\xe4\x83\xc6\xb5\x0a\x22\x0b\x2e\x05\xcb\x82\x26\x04\xa8\xae\x28\xe9\xd5\x66\xd5\x03\xca\x6f\xf8\xb2\xbd\x58\x16\xf7\xf0\x70\x94\xa6\x31\x0b\x12\x44\xc2\x5d\x29\x8e\xc4\x23\x60\xe2\x59\xc1\xee\x0a\xe5\xc7\x86\x07\x87\x32\x99\x87\x97\xa0\xcd\xc7\x58\x8e\xa7\x41\x78\x03\x0f\xa7\x2a\x66\x8f\x10\xae\xf2\x02\x37\x13\x13\x44\x9c\x7b\xc5\x0a\xc1\x2e\x81\x3d\x14\x8c\x6c\x27\xea\xcc\x84\x62\x3d\x0c\x88\xa3\x1c\xae\x64\x12\x2a\x27\x91\x93\x78\xe4\x44\x0b\xc7\x33\xce\x50\xf9\x5b\x2e\x77\x0a\x44\x8a\x68\x0e\x85\xd5\x3e\xc5\xdd\x45\x18\x26\x84\x62\x46\x57\x8c\x5e\x6a\x1d\xd6\x74\xfc\x1a\xd6\x8f\x0d\xeb\xac\x86\x67\x67\x63\x43\xdf\x06\x19\x77\xc2\xf3\x60\x1a\x33\x9b\x4d\x0e\x0d\xd7\xb9\x3b\x7a\x23\x6d\xda\xc7\xc5\x8f\xe9\x42\x0b\xdf\xad\x20\x36\x46\x6b\x15\xe2\xd3\x27\xff\x59\xb2\x8a\xe3\xba\x4b\x12\xb0\xeb\x70\x76\x61\x6c\xc2\x79\xcf\x24\x9c\x43\xa2\xd5\x63\xd0\xb0\xcf\x12\xed\x51\xde\x8c\x59\x72\x55\xcc\xe1\x5f\xf0\xcf\xfa\x66\xe4\x0e\x8d\x4d\x3a\xd7\x45\x5a\x1c\xea\xe2\x67\x29\x08\x9f\x8b\xb5\x5c\x45\x7f\xe8\xe6\xab\x89\x6e\x52\x19\x74\x74\xdf\x89\x4c\x5c\xea\xe8\x2c\xfd\x5d\x61\x7f\x0c\x32\x11\xbe\xb7\x32\xdf\x0f\x61\x3c\x69\x10\xbd\x12\xae\xb2\x4c\xc4\x52\x8c\x38\x3e\xd9\x53\x53\x76\x71\xbf\x76\x54\xc0\x65\x21\x73\x6f\x07\xbb\x89\xc5\x94\xca\xa4\x2a\x1e\x62\x91\x08\xb3\x35\x73\x13\xdb\x1a\x99\x72\xa9\x70\x56\x4b\x4c\x44\x17\x6a\x37\x13\x53\x17\xab\x26\xd6\x75\xd8\x32\x5e\xde\xa2\x4a\xfb\x14\x86\x9e\x52\xa7\x25\x23\xd7\x4c\xe5\x76\x8e\x8d\x67\x4d\x9b\x80\xba\xeb\xc9\x63\xbe\xbd\x3d\x11\x8c\x8a\xb3\xe2\x19\x6f\x07\x24\x25\x0c\x8a\x1a\x7a\xf2\xd4\x10\x0d\xe2\xf3\x96\xb2\x28\xca\x15\x51\xd8\xe5\x2f\x55\xde\x95\x0a\x9e\x06\xbe\x3c\x9b\x50\xcf\x91\x77\xa0\x04\x89\xb5\x23\x8a\x3a\x2c\xb3\x34\x64\x79\x4e\xbc\x0a\xda\x4a\xf5\x52\xd4\x2c\x5c\xbd\x93\xb8\x3b\xc4\x85\x44\x41\x45\x43\x6c\x54\x99\x4c\x7e\x8c\xda\x83\xa8\x14\xfb\x50\xa5\x8f\x6a\x43\xc6\x1f\x87\xe2\xb3\x0a\x8f\xaa\xe0\xe7\x4d\xbf\xea\x19\x65\x9e\x28\xae\xba\x6a\x11\x25\x37\x25\x5d\x9c\x00\x54\x25\xa3\xe5\x5f\xa5\xea\x6f\x86\x94\x7e\xe5\x45\x7f\xb3\x6c\x6d\x3a\xc5\xaa\xf4\x84\x53\x74\x55\xa2\xb4\x91\xfb\x19\xc6\xec\xe1\x51\x26\x89\x48\x83\xdc\x21\xf0\x06\x5c\x37\x00\xe3\x15\xcb\xb1\xd0\x52\x7e\x25\x49\x17\xb4\xe5\xd8\x6c\x1b\x08\x3c\x03\x45\x6a\x9d\xa2\x35\x1e\xc1\x0c\x3a\xd1\x9d\x0f\x64\x47\xf2\xdb\x9f\x46\x82\x4a\x5b\x0c\x38\xd4\x64\x1e\x03\xc7\xba\x63\x6d\x55\xb5\x08\xc9\xdb\xdb\x4e\x12\x29\x9f\x3a\x8c\x63\x3e\x69\x0a\xaa\x82\x14\xb9\x6d\xe3\x85\x49\x5a\xd3\x81\x10\x81\xc1\xc4\xb6\x63\x51\x18\xeb\x74\xb0\xc1\x1e\xc0\x42\x24\xb2\xde\xf9\x42\x68\x74\xb0\x66\x86\x62\x6a\xe6\xcb\x98\x17\x35\x7f\x9d\x3a\xfe\x14\x25\xec\x60\xcd\xa9\x54\x01\xc4\x97\x83\x75\xef\x52\x7d\xae\x6a\x5d\xd0\x45\xb5\x6b\xe9\xa1\x6b\xf4\x90\x95\x6d\x3c\x74\xad\x3c\xa4\xab\x87\xe6\xc0\x49\x96\x7b\x7c\x3d\x51\x5a\x56\x27\xe3\xaa\x52\x50\xf8\x4a\xb3\xe8\xea\xff\x33\xbc\x96\x70\x1a\x4f\xa8\x70\x23\x55\xb8\x51\x41\x72\x26\x20\x51\x2b\x60\xa7\x08\xe4\x1b\x5a\xfc\x7b\xfa\x91\x7d\x66\x34\x1c\xdf\x4c\x94\x07\xf5\x68\x1b\xaa\x93\xea\x81\x66\x7c\xd4\x5f\x4c\xeb\x2b\x20\xd7\x35\xde\x31\x1a\x3f\x2d\xa4\x3a\xae\x22\xb8\x43\x2b\x17\xf2\x6c\x98\x4d\x8d\xf5\x57\x99\x10\xbe\x7d\xcd\x45\x50\x84\xf3\xda\x6e\x6d\x1c\xec\xfc\xf5\xe7\x64\xbb\xfe\xe6\xc3\x58\x7d\xa7\xdf\x7b\x3b\x3f\x21\xf1\x4d\xfd\xc3\x64\x97\xd7\x0f\x5c\x57\x4a\xb0\x12\x2b\x29\x36\xb4\x60\x5e\x1f\x40\x8c\xb1\x91\x7c\x26\x32\xb1\x8d\x8c\x3b\xc9\x81\x1c\xc7\x93\x3a\xd8\x35\xb5\x5c\xe5\x73\xe7\x89\xd1\xc1\x7a\xc9\x73\xd7\xa6\x9b\x14\x84\x63\x73\x7d\xc3\xd3\xea\x53\x7d\x38\x6e\x5f\xcf\x2b\x09\xa8\x76\x3d\x4d\xb0\x3b\x97\xce\x0f\x70\x13\xe4\x59\xf9\xe1\xa6\x87\x4e\x38\x3f\x29\x38\xee\xf7\x77\xfd\x59\xad\x3a\x9e\x54\xeb\x98\x1b\x3b\xaf\xa9\xa4\x5c\xbb\xcb\x30\xdf\x5c\x87\xda\x2f\x2a\xa9\x1d\x49\x4d\x71\xa7\x91\xd5\xf6\x1a\x50\x22\xa3\x5a\x37\xde\x72\xeb\xc1\xf6\x21\xa8\xa1\x51\x52\x68\xf9\xca\x56\x93\xb1\x62\xc0\x68\x96\x10\x9d\x02\xe4\x96\x20\xf3\x5c\x06\x4d\xd4\x45\xad\x80\x13\x1d\x78\xc2\x23\xca\x21\xdf\xd4\x66\x3f\x65\x9a\x78\xd6\x8b\x83\x90\x61\xc6\xfc\xe1\xe6\x4c\xfd\x53\xed\xc3\xe4\x1f\xf5\xdd\x2b\xdc\xcd\xaa\xa2\x9a\x29\x04\xec\x03\x2f\x13\xfe\x1f\x2c\xef\xb2\xff\x13\x95\x5c\xf6\x7c\x9b\x3e\xad\xfe\x49\xc9\xac\xf5\xdd\xb6\x63\x54\xc2\x85\x54\x5f\x70\xff\x3e\x62\x61\x40\x87\x55\xa5\x28\x4f\xd4\x31\x44\x88\x09\xf1\x40\x8d\x07\x95\x04\x8f\x7a\x7f\xb1\x2c\xdd\x99\x06\x74\x64\xa1\x5b\x30\x3c\x71\x2f\xd5\x63\x8b\x95\x16\x73\x6c\xc5\x8b\x39\x92\x5f\x37\xe0\x56\xcc\xaf\x16\xd4\x46\xd1\xfd\xd6\x42\xdc\x41\xd2\x15\x68\xa1\x4c\x89\x78\x86\xfd\x4a\x7c\xdf\xb4\x10\x1d\x6c\x3a\x59\x80\x67\x24\x56\xc5\xd3\xe2\x22\xb8\x91\x17\xa3\xf3\x20\x9f\xc3\x2d\x5d\xac\xc2\x0d\xbb\x57\xcd\x30\xe9\x4b\xba\xc8\xcd\x8f\x68\xb8\xfd\xcc\x90\x27\x09\x51\x60\x6a\x41\x83\x88\xee\xe3\xa4\x4c\xd5\xdf\x98\x87\xbb\xfe\xf2\x93\xcd\xc5\xd8\x71\x2b\x2e\xbf\x12\xa2\x68\x3f\x0e\x9c\x99\xda\xe7\xaf\xc4\x96\x8c\x09\xf5\xec\x95\xec\x80\x7d\x29\x19\xfd\x4d\xc9\x2c\x4f\x12\x5d\x52\x50\xad\xcc\x92\xa4\xa8\xe8\x86\xca\x33\x6f\x2c\xdd\x4b\xba\x61\xad\xfa\xc8\xb2\x42\x74\x0d\x35\x47\x7d\x07\xd5\xea\x57\x52\x1a\x9f\xd8\x84\xfe\x5e\xca\x7e\xb5\x76\x1a\x73\x5c\x26\xe7\xb3\xfa\xea\x4f\x47\x6d\xcf\xdb\x65\x4b\x44\x2b\x54\xe2\x7c\x9a\x52\xdb\xfd\x63\x8c\x1b\xa1\x4c\xf6\x0f\xe3\x37\xb8\x15\x36\x0b\x96\xdb\x0d\x00\x8b\xf5\x36\xea\x52\xba\x3c\xa4\x57\x1e\x1e\x1d\x97\x88\x0a\xf6\x24\xeb\x78\xe2\x54\x8f\xff\x8b\xff\x36\xaa\xf2\xba\xa0\xcf\xb9\x70\xb3\x58\x97\x16\x63\x5d\xf1\xb4\x0b\xd7\x13\x68\x73\xdb\x14\xf9\x03\x58\x4e\x7b\x58\xce\xe8\xbe\x3d\x0e\xf0\x04\x4c\x17\x52\x74\xb8\x12\xf5\x6e\x07\x16\x2c\xa0\x0b\x79\xf9\xba\xc0\x54\x59\x7f\x01\x38\x2e\xd1\x32\xfc\xcc\x36\x54\xaf\x4a\x7c\xc6\x1f\xa5\x88\x07\x7f\x63\x41\x3e\x21\xd4\x03\xf7\x13\xca\xeb\x54\xf4\x59\xf9\xa5\x3d\xc2\xda\x06\x5e\xd0\x01\xff\x99\x93\x5c\x09\x2c\x5d\xfb\x82\xfa\x87\xce\x31\x07\xc4\x2d\x3a\x52\x6e\x81\x02\x55\x57\x3d\xa5\x8c\xe2\x0a\xc6\x70\xea\x0b\x19\x87\xb5\xf6\x8a\xe3\xe1\xb1\xa7\x04\xd6\x35\x27\x06\x0e\x8f\xe7\x49\x61\xed\xd3\x73\x14\x83\x3e\x42\x11\x69\xd3\x96\x6f\x71\x03\x20\x21\x1d\x0f\x78\xe7\x55\x76\x57\x64\x41\x28\x60\xff\xd7\x7b\x86\x35\xcb\x32\xaf\xec\xfe\x0c\x7b\xf0\x46\x8b\xdd\xa7\xa9\xc3\xd5\xf4\x5b\xdc\x6e\x3c\xe9\xb8\x6f\x81\x5f\x7a\xc4\x77\x6f\xc5\x70\x93\x5e\xbb\x55\x6a\xce\x78\x96\x17\xc7\x73\x1e\x47\x2a\xdb\xc5\x05\x14\xd4\x1c\x76\xe7\x60\x9d\xf9\x67\x52\xdd\x74\x6f\x86\xc5\x99\xfe\x55\x37\x4e\xbe\xb6\xce\xa8\x99\xa0\xb0\x21\x9f\xc6\xd8\xc4\x94\xdc\x16\x7d\x2e\xd5\x36\xb5\x4c\x9e\xad\xde\x5a\x6e\x0a\x84\x66\xa4\xef\x75\xa9\x45\xf1\xb8\x95\x56\xaa\x17\x71\x97\x74\xa8\x04\xaa\xab\x13\xd9\x21\x0a\xb5\x1a\xca\x08\x45\x53\x5d\x32\xe5\x96\x1e\x2a\xbd\xd7\x35\xad\x7b\x42\x7c\x01\xd4\x2d\xbb\x57\xf5\xa8\xa9\x3b\x16\x88\xfe\x7c\xb2\x6e\x0d\x03\x27\xf9\x14\x71\xdb\xe1\xf9\x44\x66\x94\x5e\x7a\x3e\xf7\xc4\xc9\xba\x47\xfb\xd5\x9c\x1d\xac\xb9\xa6\xe1\x13\xee\xa5\x5f\x44\xd6\xc7\xe2\x4e\xef\xe2\x72\xf4\x69\xd4\xfe\x7d\xd4\x1a\xb4\x5b\xb8\xf1\x6f\x68\x60\x9d\xe9\x78\x4e\x96\x58\xe9\xba\x27\x6a\x81\x89\xaa\xb8\x5e\xc1\x4a\x6a\x81\x36\x64\xf8\x96\x4e\xd6\x50\x1e\xa5\x59\x9f\x9d\x63\x2e\x1f\x8d\xe1\xe6\xfe\xd1\xca\x7d\x84\x0d\xe8\x6f\xe3\xc5\x61\xbb\xdb\x3e\x1e\x69\xef\x55\xbe\xd6\x75\x95\xbf\x63\x97\x3d\xa0\x7d\x18\xe3\x89\x6c\x57\x1c\xc7\x4a\x8c\x05\xdf\xda\x75\xf3\x9e\x5a\x67\x1b\xe5\xf3\xf9\x79\xed\x4b\x7d\x62\x77\x70\xeb\x77\xc5\xdb\xf5\xbe\x94\x99\xba\x32\x9b\x92\x21\x5a\x23\x13\x1a\x13\x2d\x53\x31\x0c\x5d\xd4\x38\x13\xdc\x8d\xd7\x2d\x1a\x82\x47\xee\xd7\x12\x2c\x1e\x59\x24\x45\x17\xb7\x87\xb2\x4e\x96\xd9\x23\x83\x2e\x63\xb8\x11\x79\xd7\x20\xc3\xf2\xe5\x42\x48\x89\xa5\xf6\x99\xfc\x96\xe3\x3a\x74\x67\xeb\x15\xaa\xde\x7b\x57\x42\x3c\x19\x43\x55\x64\x7b\x75\xdf\xa1\xe8\xcc\x57\xc4\x12\x24\x7a\x25\xd3\x2c\xd2\x6e\x7a\xcb\xb2\x63\x9c\x53\xab\x6b\x4c\x8d\x91\x05\x11\x4f\x15\x80\x6f\x43\x38\x67\xe1\x8d\x34\xc1\x12\xed\x5d\xb0\xea\xad\xea\xeb\xcd\x95\x83\x2d\x10\xa6\xe9\x1d\xc1\xaf\x67\xbf\xfe\xf7\x3c\x99\xa2\xf1\xab\x3f\xd1\xf9\x95\x41\xbf\xfa\x5a\x6c\xc7\x9c\x52\x15\x2d\xa3\x8f\x65\x1a\xf2\x69\xc6\x82\x1b\x7b\x70\x90\x1e\x99\xae\x8a\x22\x4d\x74\xbc\x74\x08\x58\xce\x8a\x35\x5a\xbe\x9a\x2e\xf8\x3a\x91\x2f\x82\x2b\x66\x68\x15\x6f\xf5\x96\xc9\x54\x2f\xac\xd7\x27\x7c\x49\x63\xa7\x93\xf7\x00\xa5\x12\xb2\x5c\x6a\x2d\x14\x24\x15\x1e\x46\x6f\x93\x58\xd4\x5f\x52\xf2\xac\xe5\x8c\x3e\x21\x78\x78\xbe\x7a\x56\xba\xdf\xc8\xa8\x4c\xa9\x6c\x16\x9b\x32\x89\xb9\xa0\xe9\x66\xcd\x34\x81\x0b\xfa\xab\x85\x65\x4c\xa5\xdc\x72\x34\x35\xb5\xe1\xb7\x74\xba\x51\x4c\x05\x6e\x6e\xde\x03\xe9\x84\x15\xeb\x4a\xcf\x35\xeb\xc0\xc1\x75\xdf\xaf\x88\xfb\x56\x85\xe4\x4b\xb7\x2f\x78\xf3\xa3\xfb\x51\x70\x25\xca\xe6\x96\x64\xa5\x3f\xb0\x13\xef\x79\x50\x2a\x7e\xa8\xf9\xf6\x25\x0f\x9e\x40\xe3\xf5\x77\x3d\xa4\x96\x62\xa4\xf7\x2f\xb9\xf2\x4e\x5d\xb7\xa8\xe2\xfc\xee\x30\x38\x47\xb7\xcf\xb6\x8e\x66\xd9\xc8\xbf\x10\x10\x76\x3d\x8a\xf6\xf4\xbf\x01\x00\x00\xff\xff\x59\xc8\xb8\x70\xcc\x28\x00\x00") func publicJsForm2jsJsBytes() ([]byte, error) { return bindataRead( @@ -132,7 +132,7 @@ func publicJsForm2jsJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "public/js/form2js.js", size: 2975, mode: os.FileMode(438), modTime: time.Unix(1467104291, 0)} + info := bindataFileInfo{name: "public/js/form2js.js", size: 10444, mode: os.FileMode(438), modTime: time.Unix(1468870791, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/assets/embed/public/js/form2js.js b/assets/embed/public/js/form2js.js index ccb684ae..38304d3b 100644 --- a/assets/embed/public/js/form2js.js +++ b/assets/embed/public/js/form2js.js @@ -1,2 +1,356 @@ -/* https://github.com/maxatwork/form2js */ -(function(a,b){if(typeof exports!=="undefined"&&typeof module!=="undefined"&&module.exports){module.exports=b()}else{if(typeof define==="function"&&define.amd){define(b)}else{a.form2js=b()}}}(this,function(){function e(m,k,j,q,l,r){r=r?true:false;if(typeof j=="undefined"||j==null){j=true}if(typeof k=="undefined"||k==null){k="."}if(arguments.length<5){l=false}m=typeof m=="string"?document.getElementById(m):m;var p=[],o,n=0;if(m.constructor==Array||(typeof NodeList!="undefined"&&m.constructor==NodeList)){while(o=m[n++]){p=p.concat(d(o,q,l,r))}}else{p=d(m,q,l,r)}return b(p,j,k)}function b(s,A,C){var p={},q={},y,x,w,v,u,r,n,t,o,m,z,D,B;for(y=0;y<s.length;y++){u=s[y].value;if(A&&(u===""||u===null)){continue}D=s[y].name;B=D.split(C);r=[];n=p;t="";for(x=0;x<B.length;x++){z=B[x].split("][");if(z.length>1){for(w=0;w<z.length;w++){if(w==0){z[w]=z[w]+"]"}else{if(w==z.length-1){z[w]="["+z[w]}else{z[w]="["+z[w]+"]"}}m=z[w].match(/([a-z_]+)?\[([a-z_][a-z0-9_]+?)\]/i);if(m){for(v=1;v<m.length;v++){if(m[v]){r.push(m[v])}}}else{r.push(z[w])}}}else{r=r.concat(z)}}for(x=0;x<r.length;x++){z=r[x];if(z.indexOf("[]")>-1&&x==r.length-1){o=z.substr(0,z.indexOf("["));t+=o;if(!n[o]){n[o]=[]}n[o].push(u)}else{if(z.indexOf("[")>-1){o=z.substr(0,z.indexOf("["));m=z.replace(/(^([a-z_]+)?\[)|(\]$)/gi,"");t+="_"+o+"_"+m;if(!q[t]){q[t]={}}if(o!=""&&!n[o]){n[o]=[]}if(x==r.length-1){if(o==""){n.push(u);q[t][m]=n[n.length-1]}else{n[o].push(u);q[t][m]=n[o][n[o].length-1]}}else{if(!q[t][m]){if((/^[0-9a-z_]+\[?/i).test(r[x+1])){n[o].push({})}else{n[o].push([])}q[t][m]=n[o][n[o].length-1]}}n=q[t][m]}else{t+=z;if(x<r.length-1){if(!n[z]){n[z]={}}n=n[z]}else{n[z]=u}}}}}return p}function d(l,k,m,j){var i=a(l,k,m,j);return i.length>0?i:g(l,k,m,j)}function g(l,k,n,j){var i=[],m=l.firstChild;while(m){i=i.concat(a(m,k,n,j));m=m.nextSibling}return i}function a(m,k,o,j){if(m.disabled&&!j){return[]}var l,n,i,p=f(m,o);l=k&&k(m);if(l&&l.name){i=[l]}else{if(p!=""&&m.nodeName.match(/INPUT|TEXTAREA/i)){n=c(m,j);if(null===n){i=[]}else{i=[{name:p,value:n}]}}else{if(p!=""&&m.nodeName.match(/SELECT/i)){n=c(m,j);i=[{name:p.replace(/\[\]$/,""),value:n}]}else{i=g(m,k,o,j)}}}return i}function f(i,j){if(i.name&&i.name!=""){return i.name}else{if(j&&i.id&&i.id!=""){return i.id}else{return""}}}function c(j,i){if(j.disabled&&!i){return null}switch(j.nodeName){case"INPUT":case"TEXTAREA":switch(j.type.toLowerCase()){case"radio":if(j.checked&&j.value==="false"){return false}case"checkbox":if(j.checked&&j.value==="true"){return true}if(!j.checked&&j.value==="true"){return false}if(j.checked){return j.value}break;case"button":case"reset":case"submit":case"image":return"";break;default:return j.value;break}break;case"SELECT":return h(j);break;default:break}return null}function h(o){var k=o.multiple,j=[],n,p,m;if(!k){return o.value}for(n=o.getElementsByTagName("option"),p=0,m=n.length;p<m;p++){if(n[p].selected){j.push(n[p].value)}}return j}return e})); +/** + * Copyright (c) 2010 Maxim Vasiliev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @author Maxim Vasiliev + * Date: 09.09.2010 + * Time: 19:02:33 + */ + + +(function (root, factory) +{ + if (typeof exports !== 'undefined' && typeof module !== 'undefined' && module.exports) { + // NodeJS + module.exports = factory(); + } + else if (typeof define === 'function' && define.amd) + { + // AMD. Register as an anonymous module. + define(factory); + } + else + { + // Browser globals + root.form2js = factory(); + } +}(this, function () +{ + "use strict"; + + /** + * Returns form values represented as Javascript object + * "name" attribute defines structure of resulting object + * + * @param rootNode {Element|String} root form element (or it's id) or array of root elements + * @param delimiter {String} structure parts delimiter defaults to '.' + * @param skipEmpty {Boolean} should skip empty text values, defaults to true + * @param nodeCallback {Function} custom function to get node value + * @param useIdIfEmptyName {Boolean} if true value of id attribute of field will be used if name of field is empty + */ + function form2js(rootNode, delimiter, skipEmpty, nodeCallback, useIdIfEmptyName, getDisabled) + { + getDisabled = getDisabled ? true : false; + if (typeof skipEmpty == 'undefined' || skipEmpty == null) skipEmpty = true; + if (typeof delimiter == 'undefined' || delimiter == null) delimiter = '.'; + if (arguments.length < 5) useIdIfEmptyName = false; + + rootNode = typeof rootNode == 'string' ? document.getElementById(rootNode) : rootNode; + + var formValues = [], + currNode, + i = 0; + + /* If rootNode is array - combine values */ + if (rootNode.constructor == Array || (typeof NodeList != "undefined" && rootNode.constructor == NodeList)) + { + while(currNode = rootNode[i++]) + { + formValues = formValues.concat(getFormValues(currNode, nodeCallback, useIdIfEmptyName, getDisabled)); + } + } + else + { + formValues = getFormValues(rootNode, nodeCallback, useIdIfEmptyName, getDisabled); + } + + return processNameValues(formValues, skipEmpty, delimiter); + } + + /** + * Processes collection of { name: 'name', value: 'value' } objects. + * @param nameValues + * @param skipEmpty if true skips elements with value == '' or value == null + * @param delimiter + */ + function processNameValues(nameValues, skipEmpty, delimiter) + { + var result = {}, + arrays = {}, + i, j, k, l, + value, + nameParts, + currResult, + arrNameFull, + arrName, + arrIdx, + namePart, + name, + _nameParts; + + for (i = 0; i < nameValues.length; i++) + { + value = nameValues[i].value; + + if (skipEmpty && (value === '' || value === null)) continue; + + name = nameValues[i].name; + _nameParts = name.split(delimiter); + nameParts = []; + currResult = result; + arrNameFull = ''; + + for(j = 0; j < _nameParts.length; j++) + { + namePart = _nameParts[j].split(']['); + if (namePart.length > 1) + { + for(k = 0; k < namePart.length; k++) + { + if (k == 0) + { + namePart[k] = namePart[k] + ']'; + } + else if (k == namePart.length - 1) + { + namePart[k] = '[' + namePart[k]; + } + else + { + namePart[k] = '[' + namePart[k] + ']'; + } + + arrIdx = namePart[k].match(/([a-z_]+)?\[([a-z_][a-z0-9_]+?)\]/i); + if (arrIdx) + { + for(l = 1; l < arrIdx.length; l++) + { + if (arrIdx[l]) nameParts.push(arrIdx[l]); + } + } + else{ + nameParts.push(namePart[k]); + } + } + } + else + nameParts = nameParts.concat(namePart); + } + + for (j = 0; j < nameParts.length; j++) + { + namePart = nameParts[j]; + + if (namePart.indexOf('[]') > -1 && j == nameParts.length - 1) + { + arrName = namePart.substr(0, namePart.indexOf('[')); + arrNameFull += arrName; + + if (!currResult[arrName]) currResult[arrName] = []; + currResult[arrName].push(value); + } + else if (namePart.indexOf('[') > -1) + { + arrName = namePart.substr(0, namePart.indexOf('[')); + arrIdx = namePart.replace(/(^([a-z_]+)?\[)|(\]$)/gi, ''); + + /* Unique array name */ + arrNameFull += '_' + arrName + '_' + arrIdx; + + /* + * Because arrIdx in field name can be not zero-based and step can be + * other than 1, we can't use them in target array directly. + * Instead we're making a hash where key is arrIdx and value is a reference to + * added array element + */ + + if (!arrays[arrNameFull]) arrays[arrNameFull] = {}; + if (arrName != '' && !currResult[arrName]) currResult[arrName] = []; + + if (j == nameParts.length - 1) + { + if (arrName == '') + { + currResult.push(value); + arrays[arrNameFull][arrIdx] = convertValue(currResult[currResult.length - 1]); + } + else + { + currResult[arrName].push(value); + arrays[arrNameFull][arrIdx] = convertValue(currResult[arrName][currResult[arrName].length - 1]); + } + } + else + { + if (!arrays[arrNameFull][arrIdx]) + { + if ((/^[0-9a-z_]+\[?/i).test(nameParts[j+1])) currResult[arrName].push({}); + else currResult[arrName].push([]); + + arrays[arrNameFull][arrIdx] = convertValue(currResult[arrName][currResult[arrName].length - 1]); + } + } + + currResult = convertValue(arrays[arrNameFull][arrIdx]); + } + else + { + arrNameFull += namePart; + + if (j < nameParts.length - 1) /* Not the last part of name - means object */ + { + if (!currResult[namePart]) currResult[namePart] = {}; + currResult = convertValue(currResult[namePart]); + } + else + { + currResult[namePart] = convertValue(value); + } + } + } + } + + return result; + } + + function convertValue(value) { + if value == "true" return true; + if value == "false" return false; + if (!isNaN(value)) return parseInt(value); + return value; + } + + function getFormValues(rootNode, nodeCallback, useIdIfEmptyName, getDisabled) + { + var result = extractNodeValues(rootNode, nodeCallback, useIdIfEmptyName, getDisabled); + return result.length > 0 ? result : getSubFormValues(rootNode, nodeCallback, useIdIfEmptyName, getDisabled); + } + + function getSubFormValues(rootNode, nodeCallback, useIdIfEmptyName, getDisabled) + { + var result = [], + currentNode = rootNode.firstChild; + + while (currentNode) + { + result = result.concat(extractNodeValues(currentNode, nodeCallback, useIdIfEmptyName, getDisabled)); + currentNode = currentNode.nextSibling; + } + + return result; + } + + function extractNodeValues(node, nodeCallback, useIdIfEmptyName, getDisabled) { + if (node.disabled && !getDisabled) return []; + + var callbackResult, fieldValue, result, fieldName = getFieldName(node, useIdIfEmptyName); + + callbackResult = nodeCallback && nodeCallback(node); + + if (callbackResult && callbackResult.name) { + result = [callbackResult]; + } + else if (fieldName != '' && node.nodeName.match(/INPUT|TEXTAREA/i)) { + fieldValue = getFieldValue(node, getDisabled); + if (null === fieldValue) { + result = []; + } else { + result = [ { name: fieldName, value: fieldValue} ]; + } + } + else if (fieldName != '' && node.nodeName.match(/SELECT/i)) { + fieldValue = getFieldValue(node, getDisabled); + result = [ { name: fieldName.replace(/\[\]$/, ''), value: fieldValue } ]; + } + else { + result = getSubFormValues(node, nodeCallback, useIdIfEmptyName, getDisabled); + } + + return result; + } + + function getFieldName(node, useIdIfEmptyName) + { + if (node.name && node.name != '') return node.name; + else if (useIdIfEmptyName && node.id && node.id != '') return node.id; + else return ''; + } + + + function getFieldValue(fieldNode, getDisabled) + { + if (fieldNode.disabled && !getDisabled) return null; + + switch (fieldNode.nodeName) { + case 'INPUT': + case 'TEXTAREA': + switch (fieldNode.type.toLowerCase()) { + case 'radio': + if (fieldNode.checked && fieldNode.value === "false") return false; + case 'checkbox': + if (fieldNode.checked && fieldNode.value === "true") return true; + if (!fieldNode.checked && fieldNode.value === "true") return false; + if (fieldNode.checked) return fieldNode.value; + break; + + case 'button': + case 'reset': + case 'submit': + case 'image': + return ''; + break; + + default: + return fieldNode.value; + break; + } + break; + + case 'SELECT': + return getSelectedOptionValue(fieldNode); + break; + + default: + break; + } + + return null; + } + + function getSelectedOptionValue(selectNode) + { + var multiple = selectNode.multiple, + result = [], + options, + i, l; + + if (!multiple) return selectNode.value; + + for (options = selectNode.getElementsByTagName("option"), i = 0, l = options.length; i < l; i++) + { + if (options[i].selected) result.push(options[i].value); + } + + return result; + } + + return form2js; + +}));