-
Notifications
You must be signed in to change notification settings - Fork 16
/
ixedit.js
executable file
·5680 lines (4865 loc) · 309 KB
/
ixedit.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* ==================== IXEDIT ==================== */
/*!
* IxEdit v0.0.1
* https://github.com/perchouli/ixedit
*
* Created by Sociomedia Inc.
* Now maintained by Perchouli <[email protected]>
* Licensed under GPL.
*
* IxEdit depends on and has links to jQuery and jQuery UI JavaScript Libraries.
*
* Date: 2014-05-06
*/
// ixedit object.
var ixedit = {
appName: 'IxEdit',
version: '0.0.1',
term: '2014',
hasLocalDb: false,
detectBrowserLang: function(){
try {
return (navigator.browserLanguage || navigator.language || navigator.userLanguage).substr(0,2);
}catch(e){
return undefined;
}
},
// Define alert messages for booting.
babyLang: {
en : {
'needLocalStorage':'IxEdit needs client-side database storage',
'needCurrentJQueryUI':'IxEdit needs jQuery UI 1.7 or higher.',
'needJQueryUI':'IxEdit needs jQuery UI.',
'needCurrentJQuery':'IxEdit jQuery 1.3 or higher.',
'needJQuery':'IxEdit needs jQuery.'
},
ja : {
'needLocalStorage':'IxEdit を利用するには、クライアントサイド・データベース・ストレージ。',
'needCurrentJQueryUI':'IxEdit を利用するには jQuery UI 1.7 以上が必要です。',
'needJQueryUI':'IxEdit を利用するには JQuery UI が必要です。',
'needCurrentJQuery':'IxEdit を利用するには、jQuery 1.3 以上が必要です。',
'needJQuery':'IxEdit を利用するには、jQuery が必要です。'
},
zh : {
'needLocalStorage':'IxEdit 需要本地存储的支持,请使用支持localStorage的浏览器',
'needCurrentJQueryUI':'IxEdit 需要使用jQuery UI 1.7以上的支持',
'needJQueryUI':'IxEdit 需要jQuery UI 支持',
'needCurrentJQuery':'IxEdit 需要jQuery1.3以上版本的支持',
'needJQuery':'IxEdit 需要jQuery js库的支持。'
}
},
boot: function(){
// Check jQuery
if(window.jQuery){
var jQueryVersion = jQuery.fn.jquery;
var jQueryVersionArray = jQueryVersion.split('.');
// Check jQuery version
if(jQueryVersionArray[0]>='1'){
// Check jQuery UI
if(jQuery.ui){
var jQueryUIVersion = jQuery.ui.version;
var jQueryUIVersionArray = jQueryUIVersion.split('.');
// Check jQuery UI version
return true;
} else {
window.alert(ixedit.babyLabel.needJQueryUI);
return false;
};
} else {
window.alert(ixedit.babyLabel.needCurrentJQuery);
return false;
};
} else {
window.alert(ixedit.babyLabel.needJQuery);
return false;
};
}
};
// Detect browser language
ixedit.browserLang = ixedit.detectBrowserLang();
switch(ixedit.browserLang){
case 'en':
ixedit.babyLabel = ixedit.babyLang['en'];
break;
case 'ja':
ixedit.babyLabel = ixedit.babyLang['ja'];
break;
case 'zh':
ixedit.babyLabel = ixedit.babyLang['zh'];
break;
default:
ixedit.babyLabel = ixedit.babyLang['en'];
};
if(ixedit.boot()){ // Is boot true? Here you go the rest.
// ---------- IxEdit Lang Property
ixedit.lang = {
//Chinese
zh : {
'appName':'IxEdit',
'listStatusItem':'组项目',
'listStatusItems':'组项目',
'listStatusSelected':'个操作对象',
'inputHeaderUseracton':'动作',
'inputHeaderSystemfeedback':'效果',
'inputHeaderCondition':'条件',
'inputHeaderComment':'备注',
'inputHeaderStatusItem':'组项目',
'inputHeaderStatusItems':'组项目',
'inputHeaderStatusNone':'暂无',
'inputHeaderStatusCommented':'注释',
'inputLabelElement':'对象选择器',
'inputLabelEvent':'事件',
'inputLabelPreventDefault':'阻止默认行为',
'inputLabelStopBubbling':'阻止事件冒泡',
'inputLabelDelay':'延迟',
'inputLabelCommand':'命令',
'inputLabelCss':'属性',
'inputLabelClassName':'Class名',
'inputLabelValue':'值',
'inputLabelAttribute':'属性',
'inputLabelEventName':'事件名',
'inputLabelDuration':'持续时间',
'inputLabelEffect':'效果',
'inputLabelOpacity':'不透明度',
'inputLabelEasing':'加减速',
'inputLabelStatus':'状态',
'inputLabelIncludeComment':'包含备注',
'inputLabelFunction':'函数名',
'inputLabelArgument':'参数',
'inputLabelAlertMessage':'消息',
'inputLabelInsertHTMLValue':'HTML',
'inputLabelInsertHTMLPoint':'插入点',
'inputLabelDraggableMoveCursor':'鼠标移到可移动元素上,指针变成可移动状态',
'inputLabelDraggableOpacify':'移动时透明',
'inputLabelDraggableRevert':'没有接收移动时返回原处',
'inputLabelDraggableContainment':'移不出父容器',
'inputLabelResizableKeepAspect':'保持高宽比例',
'inputLabelResizableHandle':'允许调整方向',
'inputLabelResizableTop':'上',
'inputLabelResizableRight':'右',
'inputLabelResizableBottom':'下',
'inputLabelResizableLeft':'左',
'inputLabelResizableTR':'上-右',
'inputLabelResizableBR':'下-右',
'inputLabelResizableBL':'下-左',
'inputLabelResizableTL':'上-左',
'inputLabelResizableContainment':'不能超过父容器',
'inputLabelDragAxes':'轴',
'inputLabelSortableRevert':'插入时有动态效果',
'inputLabelAccordionAutoHeight':'锁定高度',
'inputLabelAccordionCollapsible':'允许关闭全部',
'inputLabelTabsSelected':'默认tab',
'inputLabelTabsSelectedAnnotation':'(从1开始,0表示没有默认显示tab)',
'inputLabelTabsFade':'渐隐',
'inputLabelTabsSlide':'滑动',
'inputLabelBlockSwitchFade':'渐隐',
'inputLabelBlockSwitchSlide':'滑动',
'inputLabelDatePickerFormat':'格式',
'inputLabelDatePickerHasButton':'包含日期选择按钮',
'inputLabelDatePickerShowMonthAfterYear':'在年之后显示月份',
'inputLabelLoadURL':'URL',
'inputLabelLoadURLAnnotation':'注意:你请求的远程文件,必须和此页面在同一域下',
'inputLabelDialogWidth':'宽度',
'inputLabelDialogHeight':'高度',
'inputLabelDialogLeft':'左距离',
'inputLabelDialogTop':'上距离',
'inputLabelDialogDraggable':'允许拖动',
'inputLabelDialogButtons':'包含按钮',
'inputLabelDialogLabel':'按钮上的文字',
'inputLabelDialogId':'ID',
'inputLabelDialogLeftAnnotation':'(空表示居中,负值表示右距离)',
'inputLabelDialogTopAnnotation':'(空表示居中,负值表示下距离)',
'inputLabelJumpUrl':'URL',
'eventLoad':'Load:页面加载',
'eventUnload':'Unload:页面关闭',
'eventChange':'Change:发生变化',
'eventClick':'Click:点击',
'eventDblClick':'Double Click:双击',
'eventDrop':'Drop:接收拖动时',
'eventError':'Error:发生错误',
'eventFocus':'Focus:获得焦点',
'eventFocusOut':'Focus Out:失去焦点',
'eventKeyDown':'Key Down:按下键盘按键时',
'eventKeyPress':'Key Press:按下字面键时',
'eventKeyUp':'Key Up:按键弹起时',
'eventMouseDown':'Mouse Down:鼠标任意键被按下时',
'eventMouseMove':'Mouse Move:鼠标移动时',
'eventMouseOut':'Mouse Out:鼠标移出时',
'eventMouseOver':'Mouse Over:鼠标浮过时',
'eventMouseUp':'Mouse Up:鼠标按键弹起时',
'eventResize':'Resize:改变尺寸时',
'eventScroll':'Scroll:滚动时',
'eventSelect':'Select:被选中时',
'eventSubmit':'Submit:提交时',
'insertHTMLOverwrite':'重写选择元素的内部HTML',
'insertHTMLInsideBottom':'在选择元素的内部下方插入',
'insertHTMLInsideTop':'在选择元素的内部上方插入',
'insertHTMLAfter':'在选择元素的后方插入',
'insertHTMLBefore':'在选择元素的前方插入',
'dragAxesX':'X轴',
'dragAxesY':'Y轴',
'dragAxesXY':'X轴和Y轴',
'mainButtonNew':'新建',
'mainButtonDuplicate':'复制副本',
'mainButtonDelete':'删除',
'mainButtonReload':'刷新',
'mainButtonEdit':'编辑',
'mainButtonCancel':'取消',
'mainButtonReset':'复原',
'mainButtonDoneReload':'保存并刷新页面',
'mainButtonDone':'保存',
'mainButtonClose':'关闭',
'mainButtonImport':'导入',
'condTypeIf':'匹配',
'condTypeIfNot':'不匹配',
'of':'',
'listHeaderCheck':' ',
'listHeaderEvent':'事件',
'listHeaderTrigger':'触发选择器',
'listHeaderTarget':'响应选择器',
'listHeaderCommand':'响应动作',
'listHeaderComment':'备注',
'utilityAbout':'关于 ' + ixedit.appName,
'utilityDeploy':'导出js代码',
'utilityExport':'导出设置',
'utilityImport':'导入设置',
'utilityShowJson':'显示JSON',
'utilityShowDb':'显示数据库记录',
'utilityDiscardDb':'丢弃数据表',
'commandHelp':'命令帮助',
'messageNoCondition':'暂时不要求条件. 点击 \"+\" 按钮可以添加一个',
'messageCommndNotSupported':'现在不能编辑此命令',
'none':'默认',
'normal':'默认',
'linear':'无',
'add':'添加',
'remove':'移除',
'alertDeletingItem1':'你确定要删除此项吗?',
'alertDeletingItem2':'你确定要删除这些吗? ',
'alertDeletingItem3':' 项目?',
'alertloadDemo':'当前页面已经存在脚本,要加载吗?',
'version':'Version',
'copyright':'Created by Sociomedia Inc. <br />Maintained by Perchouli < [email protected] >',
'instructionDeploy':'<h2>To embed the generated JavaScript code to your HTML</h2><ol><li>Copy the following JavaScript code.</li><li>Open your HTML file with a text editor.</li><li>Paste the code to very bottom of inside the <head> element.</li><li>Delete the line which is loading IxEdit script file like <script type="text/javascript" src="yourpath/ixedit.js"></script>.</li><li>Delete the line which is loading IxEdit CSS file like <link type="text/css" href="yourpath/ixedit.css" rel="stylesheet"> also.</li><li>Save the HTML file and reload it with a browser.</li></ol>',
'instructionImport':'<h2>To import data from another IxEdit-editing page</h2><ol><li>Copy the data in the Exporting dialog from the page you want to import from.</li><li>Paste the data into the following text area.</li><li>Hit the Import button.</li></ol>',
'instructionExport':'<h2>To export the data to another IxEdit-editing page</h2><ol><li>Copy the following data.</li><li>Go to the IxEdit-editing browser window you want to import to.</li><li>Open Import dialog and paste the data.</li></ol>',
'importSelectorLabel':'Import by : ',
'importSelectorOptionLabel0':'Copy-Pasting',
'importSelectorOptionLabel1':'Choose from existing data',
'tipRouteBtn':'导入/导出/部署',
'tipXRayBtn':'点击页面元素以选择对象元素选择器',
'instructionXRay1':'点击目标元素以指定对象选择器',
'cancel':'取消',
'unloadingCaution':'你已经通过IxEdit改变了一些数据,它们尚未保存,如果你关闭/离开/刷新浏览器,改变的数据将丢失。\n\n如果你想保存它们,请先点击取消,然后点击"保存"按钮',
'dayNamesMinSu':'日',
'dayNamesMinMo':'一',
'dayNamesMinTu':'二',
'dayNamesMinWe':'三',
'dayNamesMinTh':'四',
'dayNamesMinFr':'五',
'dayNamesMinSa':'六',
'dayNamesShortSu':'星期日',
'dayNamesShortMo':'星期一',
'dayNamesShortTu':'星期二',
'dayNamesShortWe':'星期三',
'dayNamesShortTh':'星期四',
'dayNamesShortFr':'星期五',
'dayNamesShortSa':'星期六',
'monthNames1':'一月',
'monthNames2':'二月',
'monthNames3':'三月',
'monthNames4':'四月',
'monthNames5':'五月',
'monthNames6':'六月',
'monthNames7':'七月',
'monthNames8':'八月',
'monthNames9':'九月',
'monthNames10':'十月',
'monthNames11':'十一月',
'monthNames12':'十二月',
'monthNamesShort1':'一月',
'monthNamesShort2':'二月',
'monthNamesShort3':'三月',
'monthNamesShort4':'四月',
'monthNamesShort5':'五月',
'monthNamesShort6':'六月',
'monthNamesShort7':'七月',
'monthNamesShort8':'八月',
'monthNamesShort9':'九月',
'monthNamesShort10':'十月',
'monthNamesShort11':'十一月',
'monthNamesShort12':'十二月',
'dayName':'日期',
'cmdCat0':'DOM',
'cmdCat1':'效果',
'cmdCat2':'特效',
'cmdCat11':'其他',
'cmdCat21':'高级',
'datePickerToday':'本月',
'datePickerClose':'关闭'
},
// English
en : {
'appName':'IxEdit',
'listStatusItem':'Item',
'listStatusItems':'Items',
'listStatusSelected':'Selected',
'inputHeaderUseracton':'Action',
'inputHeaderSystemfeedback':'Reaction',
'inputHeaderCondition':'Condition',
'inputHeaderComment':'Comment',
'inputHeaderStatusItem':'Item',
'inputHeaderStatusItems':'Items',
'inputHeaderStatusNone':'None',
'inputHeaderStatusCommented':'Commented',
'inputLabelElement':'Selector',
'inputLabelEvent':'Event',
'inputLabelPreventDefault':'Prevent default behavior',
'inputLabelStopBubbling':'Stop bubbling',
'inputLabelDelay':'Delay',
'inputLabelCommand':'Command',
'inputLabelCss':'Property',
'inputLabelClassName':'Class Name',
'inputLabelValue':'Value',
'inputLabelAttribute':'Attribute',
'inputLabelEventName':'Event Name',
'inputLabelDuration':'Duration',
'inputLabelEffect':'Effect',
'inputLabelOpacity':'Opacity',
'inputLabelEasing':'Easing',
'inputLabelStatus':'Status',
'inputLabelIncludeComment':'Include comment',
'inputLabelFunction':'Function Name',
'inputLabelArgument':'Argument',
'inputLabelAlertMessage':'Message',
'inputLabelInsertHTMLValue':'HTML',
'inputLabelInsertHTMLPoint':'Insert Point',
'inputLabelDraggableMoveCursor':'Move Cursor',
'inputLabelDraggableOpacify':'Opacify while dragging',
'inputLabelDraggableRevert':'Revert unless dropped on a droppable',
'inputLabelDraggableContainment':'Bound to parent element',
'inputLabelResizableKeepAspect':'Keep aspect ratio',
'inputLabelResizableHandle':'Handle',
'inputLabelResizableTop':'Top',
'inputLabelResizableRight':'Right',
'inputLabelResizableBottom':'Bottom',
'inputLabelResizableLeft':'Left',
'inputLabelResizableTR':'T-R',
'inputLabelResizableBR':'B-R',
'inputLabelResizableBL':'B-L',
'inputLabelResizableTL':'T-L',
'inputLabelResizableContainment':'Bound to parent element',
'inputLabelDragAxes':'Axis',
'inputLabelSortableRevert':'Animated Insertion',
'inputLabelAccordionAutoHeight':'Fixed Height',
'inputLabelAccordionCollapsible':'Allow All Closed',
'inputLabelTabsSelected':'Default Tab Number',
'inputLabelTabsSelectedAnnotation':'(1-based index. 0 for none.)',
'inputLabelTabsFade':'Fade',
'inputLabelTabsSlide':'Slide',
'inputLabelBlockSwitchFade':'Fade',
'inputLabelBlockSwitchSlide':'Slide',
'inputLabelDatePickerFormat':'Format',
'inputLabelDatePickerHasButton':'Has Picker Button',
'inputLabelDatePickerShowMonthAfterYear':'Show Month after Year',
'inputLabelLoadURL':'URL',
'inputLabelLoadURLAnnotation':'Notice: Remote file you request and this page should be in the same domain.',
'inputLabelDialogWidth':'Width',
'inputLabelDialogHeight':'Height',
'inputLabelDialogLeft':'Left',
'inputLabelDialogTop':'Top',
'inputLabelDialogDraggable':'Draggable',
'inputLabelDialogButtons':'Buttons',
'inputLabelDialogLabel':'Label',
'inputLabelDialogId':'ID',
'inputLabelDialogLeftAnnotation':'(Blank for Center. - for Right.)',
'inputLabelDialogTopAnnotation':'(Blank for Center. - for Bottom.)',
'inputLabelJumpUrl':'URL',
'eventLoad':'Load',
'eventUnload':'Unload',
'eventChange':'Change',
'eventClick':'Click',
'eventDblClick':'Double Click',
'eventDrop':'Drop',
'eventError':'Error',
'eventFocus':'Focus',
'eventFocusOut':'Focus Out',
'eventKeyDown':'Key Down',
'eventKeyPress':'Key Press',
'eventKeyUp':'Key Up',
'eventMouseDown':'Mouse Down',
'eventMouseMove':'Mouse Move',
'eventMouseOut':'Mouse Out',
'eventMouseOver':'Mouse Over',
'eventMouseUp':'Mouse Up',
'eventResize':'Resize',
'eventScroll':'Scroll',
'eventSelect':'Select',
'eventSubmit':'Submit',
'insertHTMLOverwrite':'Overwrite inside of selected element',
'insertHTMLInsideBottom':'Inside-bottom of selected element',
'insertHTMLInsideTop':'Inside-top of selected element',
'insertHTMLAfter':'After selected element',
'insertHTMLBefore':'Before selected element',
'dragAxesX':'X',
'dragAxesY':'Y',
'dragAxesXY':'X and Y',
'mainButtonNew':'New',
'mainButtonDuplicate':'Duplicate',
'mainButtonDelete':'Delete',
'mainButtonReload':'Reload',
'mainButtonEdit':'Edit',
'mainButtonCancel':'Cancel',
'mainButtonReset':'Revert',
'mainButtonDoneReload':'Done and Reload',
'mainButtonDone':'Done',
'mainButtonClose':'Close',
'mainButtonImport':'Import',
'condTypeIf':'matches',
'condTypeIfNot':'doesn\'t match',
'of':'of',
'listHeaderCheck':' ',
'listHeaderEvent':'Action Event',
'listHeaderTrigger':'Action Selector',
'listHeaderTarget':'Reaction Selector',
'listHeaderCommand':'Reaction Command',
'listHeaderComment':'Comment',
'utilityAbout':'About ' + ixedit.appName,
'utilityDeploy':'Deploy',
'utilityExport':'Export',
'utilityImport':'Import',
'utilityShowJson':'Show JSON',
'utilityShowDb':'Show DB records',
'utilityDiscardDb':'Discard DB table',
'commandHelp':'Command Help',
'messageNoCondition':'There is no condition currently. Click \"+\" button to add one.',
'messageCommndNotSupported':'command is not editable now.',
'none':'None',
'normal':'Normal',
'linear':'None',
'add':'Add',
'remove':'Remove',
'alertDeletingItem1':'Are you sure you want to delete this item?',
'alertDeletingItem2':'Are you sure you want to delete these ',
'alertDeletingItem3':' items?',
'alertloadDemo':'Some interactions are embedded on this page. Do you want to load them?',
'version':'Version',
'copyright':'Created by Sociomedia Inc. <br />Maintained by Perchouli < [email protected] >',
'instructionDeploy':'<h2>To embed the generated JavaScript code to your HTML</h2><ol><li>Copy the following JavaScript code.</li><li>Open your HTML file with a text editor.</li><li>Paste the code to very bottom of inside the <head> element.</li><li>Delete the line which is loading IxEdit script file like <script type="text/javascript" src="yourpath/ixedit.js"></script>.</li><li>Delete the line which is loading IxEdit CSS file like <link type="text/css" href="yourpath/ixedit.css" rel="stylesheet"> also.</li><li>Save the HTML file and reload it with a browser.</li></ol>',
'instructionImport':'<h2>To import data by copy-pasting from another IxEdit-editing page</h2><ol><li>Copy data from the Exporting dialog of the page you want to import from.</li><li>Paste the data into the following text area.</li><li>Hit the Import button.</li></ol>',
'instructionImportFromDB':'<h2>To import data from existing interactions which have made on this browser</h2><ol><li>Choose one from following table.</li><li>Hit the Import button.</li></ol>',
'instructionExport':'<h2>To export the data to another IxEdit-editing page</h2><ol><li>Copy the following data.</li><li>Go to the IxEdit-editing browser window you want to import to.</li><li>Open Import dialog and paste the data.</li></ol>',
'importSelectorLabel':'Import by : ',
'importSelectorOptionLabel0':'Copy-Pasting',
'importSelectorOptionLabel1':'Choose from existing data',
'tipRouteBtn':'Route Menu',
'tipXRayBtn':'Choose selector by clicking on the page.',
'instructionXRay1':'Click on the target element to specify the selector.',
'cancel':'Cancel',
'unloadingCaution':'You have modified some data with IxEdit, and it has not saved. If you close/leave/reload the window, your changes will be lost. \n\nTo save, cancel leaving this page and hit the "Done" button on IxEdit editor.',
'dayNamesMinSu':'Su',
'dayNamesMinMo':'Mo',
'dayNamesMinTu':'Tu',
'dayNamesMinWe':'We',
'dayNamesMinTh':'Th',
'dayNamesMinFr':'Fr',
'dayNamesMinSa':'Sa',
'dayNamesShortSu':'Sun',
'dayNamesShortMo':'Mon',
'dayNamesShortTu':'Tue',
'dayNamesShortWe':'Wed',
'dayNamesShortTh':'Thr',
'dayNamesShortFr':'Fri',
'dayNamesShortSa':'Sat',
'monthNames1':'January',
'monthNames2':'February',
'monthNames3':'March',
'monthNames4':'April',
'monthNames5':'May',
'monthNames6':'June',
'monthNames7':'July',
'monthNames8':'August',
'monthNames9':'September',
'monthNames10':'October',
'monthNames11':'November',
'monthNames12':'December',
'monthNamesShort1':'Jan',
'monthNamesShort2':'Feb',
'monthNamesShort3':'Mar',
'monthNamesShort4':'Apr',
'monthNamesShort5':'May',
'monthNamesShort6':'Jun',
'monthNamesShort7':'Jul',
'monthNamesShort8':'Aug',
'monthNamesShort9':'Sep',
'monthNamesShort10':'Oct',
'monthNamesShort11':'Nov',
'monthNamesShort12':'Dec',
'dayName':'Dayname',
'cmdCat0':'DOM',
'cmdCat1':'Effect',
'cmdCat2':'Generate',
'cmdCat11':'Misc',
'cmdCat21':'Advanced',
'datePickerToday':'This Month',
'datePickerClose':'Close'
},
// Japanese
ja : {
'appName':'IxEdit',
'listStatusItem':'項目',
'listStatusItems':'項目',
'listStatusSelected':'個を選択',
'inputHeaderUseracton':'アクション',
'inputHeaderSystemfeedback':'リアクション',
'inputHeaderCondition':'条件',
'inputHeaderComment':'コメント',
'inputHeaderStatusItem':'項目',
'inputHeaderStatusItems':'項目',
'inputHeaderStatusNone':'なし',
'inputHeaderStatusCommented':'あり',
'inputLabelElement':'セレクタ',
'inputLabelEvent':'イベント',
'inputLabelPreventDefault':'通常動作をキャンセル',
'inputLabelStopBubbling':'バブリングを停止',
'inputLabelDelay':'遅れ',
'inputLabelCommand':'コマンド',
'inputLabelCss':'プロパティ',
'inputLabelClassName':'クラス名',
'inputLabelValue':'値',
'inputLabelAttribute':'属性',
'inputLabelEventName':'イベント名',
'inputLabelDuration':'継続時間',
'inputLabelEffect':'効果',
'inputLabelOpacity':'不透明度',
'inputLabelEasing':'加減速',
'inputLabelStatus':'状態',
'inputLabelIncludeComment':'コメントを含める',
'inputLabelFunction':'関数名',
'inputLabelArgument':'引数',
'inputLabelAlertMessage':'メッセージ',
'inputLabelInsertHTMLValue':'HTML',
'inputLabelInsertHTMLPoint':'挿入ポイント',
'inputLabelDraggableMoveCursor':'移動カーソル',
'inputLabelDraggableOpacify':'ドラッグ中に半透明にする',
'inputLabelDraggableRevert':'ドロップ不可の要素にドロップされたら戻す',
'inputLabelDraggableContainment':'親要素内に拘束する',
'inputLabelResizableKeepAspect':'縦横比を保つ',
'inputLabelResizableHandle':'つまみ',
'inputLabelResizableTop':'上',
'inputLabelResizableRight':'右',
'inputLabelResizableBottom':'下',
'inputLabelResizableLeft':'左',
'inputLabelResizableTR':'右上',
'inputLabelResizableBR':'右下',
'inputLabelResizableBL':'左下',
'inputLabelResizableTL':'左上',
'inputLabelResizableContainment':'親要素に拘束',
'inputLabelDragAxes':'軸',
'inputLabelSortableRevert':'挿入のアニメート',
'inputLabelAccordionAutoHeight':'高さ固定',
'inputLabelAccordionCollapsible':'すべてを閉じることを許可',
'inputLabelTabsSelected':'初期タブ番号',
'inputLabelTabsSelectedAnnotation':'(1ベースの番号。 0で選択なし)',
'inputLabelTabsFade':'フェード',
'inputLabelTabsSlide':'スライド',
'inputLabelBlockSwitchFade':'フェード',
'inputLabelBlockSwitchSlide':'スライド',
'inputLabelDatePickerFormat':'フォーマット',
'inputLabelDatePickerHasButton':'ピッカーボタンあり',
'inputLabelDatePickerShowMonthAfterYear':'月を年の後に表示',
'inputLabelLoadURL':'URL',
'inputLabelLoadURLAnnotation':'注意:リクエストする外部ファイルは、このページと同じドメイン上にある必要があります。',
'inputLabelDialogWidth':'Width',
'inputLabelDialogHeight':'Height',
'inputLabelDialogLeft':'Left',
'inputLabelDialogTop':'Top',
'inputLabelDialogDraggable':'ドラッグ可能に',
'inputLabelDialogButtons':'ボタン',
'inputLabelDialogLabel':'ラベル',
'inputLabelDialogId':'ID',
'inputLabelDialogLeftAnnotation':'(空欄で中央、- で右寄せ)',
'inputLabelDialogTopAnnotation':'(空欄で中央、- で下寄せ)',
'inputLabelJumpUrl':'URL',
'eventLoad':'ロード',
'eventUnload':'アンロード',
'eventChange':'値変更',
'eventClick':'クリック',
'eventDblClick':'ダブルクリック',
'eventDrop':'ドロップ',
'eventError':'エラー',
'eventFocus':'フォーカス',
'eventFocusOut':'フォーカスアウト',
'eventKeyDown':'キーダウン',
'eventKeyPress':'キープレス',
'eventKeyUp':'キーアップ',
'eventMouseDown':'マウスダウン',
'eventMouseMove':'マウスムーブ',
'eventMouseOut':'マウスアウト',
'eventMouseOver':'マウスオーバー',
'eventMouseUp':'マウスアップ',
'eventResize':'リサイズ',
'eventScroll':'スクロール',
'eventSelect':'セレクト',
'eventSubmit':'サブミット',
'insertHTMLOverwrite':'セレクトした要素内を上書き',
'insertHTMLInsideBottom':'セレクトした要素内の末尾',
'insertHTMLInsideTop':'セレクトした要素内の先頭',
'insertHTMLAfter':'セレクトした要素の後',
'insertHTMLBefore':'セレクトした要素の前',
'dragAxesX':'X',
'dragAxesY':'Y',
'dragAxesXY':'X と Y',
'mainButtonNew':'新規',
'mainButtonDuplicate':'複製',
'mainButtonDelete':'削除',
'mainButtonReload':'リロード',
'mainButtonEdit':'編集',
'mainButtonCancel':'キャンセル',
'mainButtonReset':'復帰',
'mainButtonDoneReload':'完了してリロード',
'mainButtonDone':'完了',
'mainButtonClose':'閉じる',
'mainButtonImport':'インポート',
'condTypeIf':'以下に一致',
'condTypeIfNot':'以下に不一致',
'of':'',
'listHeaderCheck':' ',
'listHeaderEvent':'アクションイベント',
'listHeaderTrigger':'アクションセレクタ',
'listHeaderTarget':'リアクションセレクタ',
'listHeaderCommand':'リアクションコマンド',
'listHeaderComment':'コメント',
'utilityAbout':ixedit.appName + ' について',
'utilityDeploy':'デプロイ',
'utilityExport':'エクスポート',
'utilityImport':'インポート',
'utilityShowJson':'JSON を表示',
'utilityShowDb':'DB レコードを表示',
'utilityDiscardDb':'DB テーブルを消去',
'commandHelp':'コマンドヘルプ',
'messageNoCondition':'現在条件はありません。追加するには \"+\" ボタンをクリックします。',
'messageCommndNotSupported':'コマンドは現在編集できません。',
'none':'なし',
'normal':'通常',
'linear':'なし',
'add':'追加',
'remove':'削除',
'alertDeletingItem1':'この項目を本当に削除しますか?',
'alertDeletingItem2':'これら',
'alertDeletingItem3':'項目を本当に削除しますか?',
'alertloadDemo':'このページにはインタラクションが埋め込まれています。読み込みますか?',
'version':'バージョン',
'copyright':'Created by Sociomedia Inc. <br />Maintained by Perchouli < [email protected] >',
'instructionDeploy':'<h2>生成された JavaScript コードを HTML に埋め込むには</h2><ol><li>下の JavaScript コードをコピーします。</li><li>テキストエディタで HTML ファイルを開きます。</li><li><head> 要素内の一番下にコードをペーストします。</li><li>IxEdit スクリプトファイルを読み込むための <script type="text/javascript" src="yourpath/ixedit.js"></script> のような行を削除します。</li><li>IxEdit の CSS を読み込むための <link type="text/css" href="yourpath/ixedit.css" rel="stylesheet"> のような行も削除します。</li><li>HTML ファイルを保存し、ブラウザでリロードします。</li></ol>',
'instructionImport':'<h2>他の IxEdit で編集中のページからデータをインポートするには</h2><ol><li>インポート元のページのエクスポートダイアログでデータをコピーします。</li><li>下のテキストエリアにデータをペーストします。</li><li>インポートボタンを押します。</li></ol>',
'instructionImportFromDB':'<h2>このブラウザで作成した既存のインタラクションからデータをインポートするには</h2><ol><li>下のテーブルからひとつ選びます。</li><li>インポートボタンを押します。</li></ol>',
'instructionExport':'<h2>他の IxEdit で編集中のページにデータをエクスポートするには</h2><ol><li>下のデータをコピーします。</li><li>インポートさせたい IxEdit で編集中のブラウザウィンドウを開きます。</li><li>インポートダイアログを開きデータをペーストします。</li></ol>',
'importSelectorLabel':'インポート方法: ',
'importSelectorOptionLabel0':'コピー&ペースト',
'importSelectorOptionLabel1':'既存データから選択',
'tipRouteBtn':'メニュー',
'tipXRayBtn':'ページ上のクリックでセレクタを指定します。',
'instructionXRay1':'目的の要素をクリックしてセレクタを指定してください。',
'cancel':'キャンセル',
'unloadingCaution':'IxEdit 上で編集中の保存されていないデータがあります。ウインドウを閉じる/離れる/リロードするとそれらの変更が失われます。\n\n保存するには、このページにとどまり、IxEdit エディタ上で「完了」ボタンを押します。',
'dayNamesMinSu':'日',
'dayNamesMinMo':'月',
'dayNamesMinTu':'火',
'dayNamesMinWe':'水',
'dayNamesMinTh':'木',
'dayNamesMinFr':'金',
'dayNamesMinSa':'土',
'dayNamesShortSu':'日',
'dayNamesShortMo':'月',
'dayNamesShortTu':'火',
'dayNamesShortWe':'水',
'dayNamesShortTh':'木',
'dayNamesShortFr':'金',
'dayNamesShortSa':'土',
'monthNames1':'1月',
'monthNames2':'2月',
'monthNames3':'3月',
'monthNames4':'4月',
'monthNames5':'5月',
'monthNames6':'6月',
'monthNames7':'7月',
'monthNames8':'8月',
'monthNames9':'9月',
'monthNames10':'10月',
'monthNames11':'11月',
'monthNames12':'12月',
'monthNamesShort1':'1月',
'monthNamesShort2':'2月',
'monthNamesShort3':'3月',
'monthNamesShort4':'4月',
'monthNamesShort5':'5月',
'monthNamesShort6':'6月',
'monthNamesShort7':'7月',
'monthNamesShort8':'8月',
'monthNamesShort9':'9月',
'monthNamesShort10':'10月',
'monthNamesShort11':'11月',
'monthNamesShort12':'12月',
'dayName':'曜日',
'cmdCat0':'DOM',
'cmdCat1':'イフェクト',
'cmdCat2':'生成',
'cmdCat11':'その他',
'cmdCat21':'アドバンスド',
'datePickerToday':'今月',
'datePickerClose':'閉じる'
}
};
if(ixedit.browserLang){
switch(ixedit.browserLang){
case 'en':
ixedit.label = ixedit.lang['en'];
break;
case 'ja':
ixedit.label = ixedit.lang['ja'];
break;
case 'zh':
ixedit.label = ixedit.lang['zh'];
break;
default:
ixedit.label = ixedit.lang['en'];
};
}else{
ixedit.label = ixedit.lang['en'];
};
// ---------- IxEdit Additional Properties
ixedit.format = 1; // Version of data format.
ixedit.enableMultiActions = true; // Enabling multiple reactions for one interaction.
ixedit.advancedMode = false; // Advanced mode
ixedit.inactivatingAll = false; // Inactivating all interactions.
ixedit.deployed = false; // If there is a deployed code or not.
ixedit.prevScrollTop = 0; // For recording dialog position in a drag event.
ixedit.prevScrollLeft = 0; // For recording dialog position in a drag event.
ixedit.dbName = "ixedit-database"; // DB name
ixedit.applicationName = "application1"; // Table name for common data.
ixedit.projectName = "project1"; // Table name for Ix records.
ixedit.screenID = ''; // Temporary record name (screenid column).
ixedit.addingNewIx = false; // Now creating a new interaction?
ixedit.gimmickAnimation = false; // Allow gimmick animations?
ixedit.evtMenuSource = '';
ixedit.cmdMenuSource = '';
ixedit.condCmdMenuSource = '';
ixedit.embedSources = [];
// ---------- IxEdit Other Properties as Object
ixedit.localdbi = new Object();
ixedit.dbi = ixedit.localdbi;
// Common preferences defaults
ixedit.commonPrefs = new Object();
ixedit.commonPrefs.inspectorWidth = 530;
ixedit.commonPrefs.inspectorHeight = 350;
// ixedit.commonPrefs.inspectorTop = 0; // Dont specify default for default centering
// ixedit.commonPrefs.inspectorLeft = 0; // Dont specify default for default centering
// ixedit.commonPrefs.inspectorWindowOffsetY = 0;
// ixedit.commonPrefs.inspectorWindowOffsetX = 0;
ixedit.commonPrefs.inspectorColumnCheckWidth = 25;
ixedit.commonPrefs.inspectorColumnEventWidth = '17%';
ixedit.commonPrefs.inspectorColumnTriggerWidth = '17%';
ixedit.commonPrefs.inspectorColumnTargetsWidth = '17%';
ixedit.commonPrefs.inspectorColumnCommandsWidth = '17%';
ixedit.commonPrefs.inspectorShaded = false;
ixedit.commonPrefs.areasShown = [true, true, false, false]; // Action, Reaction, Condition, Comment areas.
ixedit.commonPrefs.deployWithComment = false;
// Individual preferences defaults.
ixedit.prefs = new Object();
ixedit.prefs.sortKey = 'trigger';
ixedit.prefs.inspectorScrollTop = 0;
ixedit.prefs.selectedLineNo = [];
// IXS ARRAY
ixedit.ixs = new Array();
// Adding a new interaction.
ixedit.ixs.add = function(ixObj){
this[this.length] = ixObj;
};
// Bind all interactions.
ixedit.ixs.setAll = function(){
var thisLength = this.length;
for(var cnt=0; cnt<thisLength; cnt++){
var theIx = this[cnt];
theIx.set();
}
};
// Unbind all interactions.
ixedit.ixs.unsetAll = function(){
var thisLength = this.length;
for(var cnt=0; cnt<thisLength; cnt++){
var theIx = this[cnt];
theIx.unset();
}
};
// Reset all interactions.
ixedit.ixs.resetAll = function(){
var thisLength = this.length;
for(var cnt=0; cnt<thisLength; cnt++){
this.unsetAll();
this.setAll();
}
};
// Remove an interaction from ixs.
ixedit.ixs.del = function(ixNo){
this.splice(ixNo,1);
};
// Activate or inactivate with the checkbox.
ixedit.ixs.activate = function(isActivating, lineNo){
var targetIxNo = ixedit.listItems[lineNo].no;
var targetIx = this[targetIxNo];
var theTr = jQuery('.ixedit-table-item').eq(lineNo);
var theEditButton = jQuery('#ixedit-button-edit');
if(isActivating){
theTr.removeClass('inactive');
targetIx.active = true;
targetIx.set();
theEditButton.removeAttr('disabled').removeClass('disabled'); // enable the delete button then remove class
} else {
theTr.addClass('inactive');
targetIx.active = false;
targetIx.unset();
theEditButton.attr('disabled', 'disabled').addClass('disabled'); // Disable the delete button then add class
};
};
// Generate deploying code.
ixedit.ixs.getJqueryCode = function(){
var usedCommands = new Object();
var preserves = new Array();
var isIncludingComments = ixedit.commonPrefs.deployWithComment;
var theCodes = new Array();
var prefix = '<script type=\"text/javascript\">\n\t\n\tif(window.ixedit){ixedit.deployed = true};\n\tif(window.jQuery){jQuery(function(){\n';
var thisLength = this.length;
for(var ixCnt=0; ixCnt<thisLength; ixCnt++){ // Loop for length of ixs.
// Loop for length of actions in the ix, then get the command names.
for(var k=0; k<ixedit.ixs[ixCnt].actions.length; k++){
var theCommandName = ixedit.ixs[ixCnt].actions[k].command;
if(!usedCommands[theCommandName]){
usedCommands[theCommandName]=ixedit.cmds[theCommandName];
}
};
// Gather ix.code, then generate script string.
if(isIncludingComments){ // If including comment.
var theComment = this[ixCnt].code.comment;
if(theComment != ''){ // If there is a comment.
var insertingComment = theComment.replace(/\n/g,'\n\t\t\/\/ ');
insertingComment = '\t\t\/\/ ' + insertingComment + '\n';
} else { // If there is no comment.
var insertingComment = '';
};
theCodes[theCodes.length] = insertingComment + '\t\t' + this[ixCnt].code.source + '\n';
} else { // If not including comment.
theCodes[theCodes.length] = '\t\t' + this[ixCnt].code.source + '\n';
}
};
// Gather cms.preserve
for(var i in usedCommands){
if(ixedit.cmds[i] && ixedit.cmds[i].preserve && ixedit.cmds[i].preserv!=''){ //Put preserve into the array.
preserves[preserves.length] = ixedit.cmds[i].preserve;
}
};
if(preserves.length>0){ // If there is a preserve.
var preservedCode = '\t\t' + preserves.join('\n\t\t') + '\n' ;
}else{
var preservedCode = '';
};
var suffix = '\t})};\n</script>';
return prefix + preservedCode + theCodes.join('') + suffix;
};
// Select optin object.
ixedit.selectOptions = new Object();
// CMDS OBJECT
ixedit.cmds = new Object(); // This is for cmd instances
// CONDCMDS OBJECT
ixedit.condcmds = new Object(); // This is for condcmd instances.
// LOSTWORLD OBJECT
ixedit.lostWorld = new Object(); // This is a jQuery object and for pre-buffering when loading page.
// ========== CLASSES ==========
// ---- IX CLASS
ixedit.ix = function(){
this.name = '';
this.screenName = '';
this.active = true;
this.trigger = '';
this.screenTrigger = this.trigger;
this.event = 'click';
this.screenEvent = '';
this.preventDefault = false;
this.stopBubbling = false;
this.target = '';
this.screenTarget = '';
this.delay = 0;
this.screenDelay = '';
this.comment = '';
this.screenComment = '';
this.conditions = new Array(); //conditions = [{'type':'string', 'target':'string', 'command':'string', 'params':[attr1, ...]}, ...]
this.actions = new Array(); //actions = [{'command':'string', 'params':['command attributes'], 'subparams':[['aaa':'bbb'],['ccc':'ddd']]}, ...]
this.screenActions = '';
};
// Generate JavaScript code from each ix and bind it.
ixedit.ix.prototype.set = function(){
var isToRealtimeBinding = false; // Realtime binding?
this.func = function(){}; // Initialize ix.func
this.code = new Object();
// Make vars from current ix to use them within the binding functions.
var theIx = this;
var theEvent = theIx.event;
var theStopBubbling = theIx.stopBubbling;
var theTrigger = theIx.trigger;
var theComment = theIx.comment;
var theLostWorld = ixedit.lostWorld;
var isLive = false;
// Detect if this can be realtime-bound.
// If there is no trigger, you get an error.
if(theEvent == 'load' || theEvent == 'unload') { // load or unload event?
isToRealtimeBinding = true;
} else { // Another event?
if(theTrigger != ''){ // If you have a trigger.
isToRealtimeBinding = true; // OK, realtime bind.
}
};
// Eval theFuncCode string
function getFunked(funcCode){
if(theStopBubbling){ // If stop bubbling
// You can not eval if you insert 'return false' when generating funcCode
// So insert it within this getFunked function.
var funked = function(event, ui){ eval(funcCode); event.stopPropagation(); };
}else{
var funked = function(event, ui){ eval(funcCode) };
};
return funked;
};
// Prepare the final code generating.
// There are two codes. One is for realtime bining. One is for deploying.
// For realtime one, add code of excluding ixedit-dialog and make connection with ix.funcs.
// For deploy one, make it as a text string and let the comment be inserted.
// Prefix
if(theEvent=='load') {
var chainPrefix0 = ''; // for realtime binding
var chainPrefix1 = ''; // for deploying