-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvorple-element-manipulation.h
124 lines (78 loc) · 3.55 KB
/
vorple-element-manipulation.h
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
#Ifndef VORPLE_ELEMENT_MANIPULATION;
System_file;
Constant VORPLE_ELEMENT_MANIPULATION;
Include "vorple.h";
! Adding, removing, hiding, moving and other basic manipulation of HTML document elements.
!===========================
! Clear, Remove, Hide, Show
[ VorpleClearElement classes ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').last().empty()"));
];
[ VorpleClearAllElementsNamed classes ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').empty()"));
];
[ VorpleRemoveElement classes ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').last().remove()"));
];
[ VorpleRemoveAllElementsNamed classes ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').remove()"));
];
[ VorpleHideElement classes ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').last().hide()"));
];
[ VorpleHideAllElementsNamed classes ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').hide()"));
];
[ VorpleShowElement classes ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').last().show()"));
];
[ VorpleShowAllElementsNamed classes ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').show()"));
];
!============================
! Move under, at start, before, after
[ VorpleMoveElementUnder classes target ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').last().appendTo('.", target, "')"));
];
[ VorpleMoveAllElementsUnder classes target ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').appendTo('.", target, "')"));
];
[ VorpleMoveElementAtStart classes target ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').last().prependTo('.", target, "')"));
];
[ VorpleMoveAllElementsAtStart classes target ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').prependTo('.", target, "')"));
];
[ VorpleMoveElementBefore classes target ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').last().insertBefore($('.", target, ":last'))"));
];
[ VorpleMoveAllElementsBefore classes target ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').insertBefore($('.", target, ":last'))"));
];
[ VorpleMoveElementAfter classes target ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').last().insertAfter($('.", target, ":last'))"));
];
[ VorpleMoveAllElementsAfter classes target ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').insertAfter($('.", target, ":last'))"));
];
!=======================
! Add, remove names, and rename
[ VorpleAddNameToElement newname classes ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').last().addClass('", newname, "')"));
];
[ VorpleAddNameToAllElements newname classes ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').addClass('", newname, "')"));
];
[ VorpleRemoveNameFromElement oldname classes ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').last().removeClass('", oldname, "')"));
];
[ VorpleRemoveNameFromAllElements oldname classes ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", classes, "').removeClass('", oldname, "')"));
];
[ VorpleRenameElement oldname newname ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", oldname, "').last().removeClass('", oldname, "').addClass('", newname, "')"));
];
[ VorpleRenameAllElements oldname newname ;
VorpleExecuteJavaScriptCommand(BuildCommand("$('.", oldname, "').removeClass('", oldname, "').addClass('", newname, "')"));
];
#Endif;