Prevent conflicts with other libraries
Jeremy D

Jeremy D commited on 2013-04-22 19:42:56
Showing 2 changed files, with 118 additions and 114 deletions.

... ...
@@ -4,40 +4,42 @@
4 4
  * Repository: https://github.com/jdarwood007/smf_package_maker
5 5
  * License: BSD 3 Clause; See license.txt
6 6
 */
7
+$j = jQuery.noConflict();
7 8
 
8 9
 /* This gets things going once the document has loaded, also makes sure JQuery is here. */
9
-$(document).ready(function(){
10
+$j(document).ready(function($){
10 11
 	/* Start off some counting */
11 12
 	action_count = 1;
12 13
 	instruct_count =new Array();
13 14
 	instruct_count[action_count] = 1;
14 15
 
15 16
 	/* Bind some stuff to our actions, using live so they auto update as new stuff is added. */
16
-	$('.collapse_action').live('click', collapse_action);
17
-	$('.expand_action').live('click', expand_action);
18
-	$('.delete_action').live('click', delete_action);
19
-	$('.restore_action').live('click', restore_action);
17
+//	$j(document).on('click', '.collapse_action', collapse_action);
18
+	$j('.collapse_action').live('click', collapse_action);
19
+	$j('.expand_action').live('click', expand_action);
20
+	$j('.delete_action').live('click', delete_action);
21
+	$j('.restore_action').live('click', restore_action);
20 22
 
21 23
 	/* Now we will bind to the actual changes, again using live. */
22
-	$('.collapse_change').live('click', collapse_instruct);
23
-	$('.expand_change').live('click', expand_instruct);
24
-	$('.delete_change').live('click', delete_instruct);
25
-	$('.restore_change').live('cick', restore_instruct);
24
+	$j('.collapse_change').live('click', collapse_instruct);
25
+	$j('.expand_change').live('click', expand_instruct);
26
+	$j('.delete_change').live('click', delete_instruct);
27
+	$j('.restore_change').live('cick', restore_instruct);
26 28
 
27 29
 	/* Now we will bind to some toggles in those changes, again using live. */
28
-	$('.instruct_action').live('change', instruct_change);
29
-	$('.inline_check').live('change', instruct_inline);
30
+	$j('.instruct_action').live('change', instruct_change);
31
+	$j('.inline_check').live('change', instruct_inline);
30 32
 
31 33
 	/* Give our buttons some actions. */
32
-	$('#add_action').click(create_new_action);
33
-	$('.add_instruct').live('click', create_new_instruct);
34
-	$('#show_preview').click(show_instruct_preview);
34
+	$j('#add_action').click(create_new_action);
35
+	$j('.add_instruct').live('click', create_new_instruct);
36
+	$j('#show_preview').click(show_instruct_preview);
35 37
 
36 38
 	/* The details and basic buttons. */
37
-	$('#collapse_basic').click(function(){$('#basic_info .info').hide(); $('#collapse_basic').hide(); $('#restore_basic').show();});
38
-	$('#restore_basic').click(function(){$('#basic_info .info').show(); $('#restore_basic').hide(); $('#collapse_basic').show();});
39
-	$('#collapse_details').click(function(){$('#details_info .info').hide(); $('#collapse_details').hide(); $('#restore_details').show();});
40
-	$('#restore_details').click(function(){$('#details_info .info').show(); $('#restore_details').hide(); $('#collapse_details').show();});
39
+	$j('#collapse_basic').click(function(){$j('#basic_info .info').hide(); $j('#collapse_basic').hide(); $j('#restore_basic').show();});
40
+	$j('#restore_basic').click(function(){$j('#basic_info .info').show(); $j('#restore_basic').hide(); $j('#collapse_basic').show();});
41
+	$j('#collapse_details').click(function(){$j('#details_info .info').hide(); $j('#collapse_details').hide(); $j('#restore_details').show();});
42
+	$j('#restore_details').click(function(){$j('#details_info .info').show(); $j('#restore_details').hide(); $j('#collapse_details').show();});
41 43
 
42 44
 	/* Kick things off by creating a new action. */
43 45
 	create_new_action();
... ...
@@ -47,10 +49,10 @@ $(document).ready(function(){
47 49
 function create_new_action()
48 50
 {
49 51
 	/* We have been through this before */
50
-	$('#action_container').append($('#action_template').html().replace(/#ACTIONINDEX#/g, action_count));
52
+	$j('#action_container').append($j('#action_template').html().replace(/#ACTIONINDEX#/g, action_count));
51 53
 
52 54
 	/* Now we pretend to click said element */
53
-	$('#action-' + action_count).find('.add_instruct').click();
55
+	$j('#action-' + action_count).find('.add_instruct').click();
54 56
 
55 57
 	/* Move the index and add defaults */
56 58
 	action_count++;
... ...
@@ -63,11 +65,11 @@ function create_new_action()
63 65
 /* Handles adding of instructions */
64 66
 function create_new_instruct()
65 67
 {
66
-	action_index = $(this).attr('data-action');
68
+	action_index = $j(this).attr('data-action');
67 69
 
68
-	$('#action-' + action_index + '-instruct_container').append($('#instruct_template').html().replace(/#ACTIONINDEX#/g, action_index).replace(/#INSTRUCTINDEX#/g, instruct_count[action_index]));
70
+	$j('#action-' + action_index + '-instruct_container').append($j('#instruct_template').html().replace(/#ACTIONINDEX#/g, action_index).replace(/#INSTRUCTINDEX#/g, instruct_count[action_index]));
69 71
 
70
-	$('#action-' + action_index + '-instruct-' + instruct_count[action_index] + '-action').change();
72
+	$j('#action-' + action_index + '-instruct-' + instruct_count[action_index] + '-action').change();
71 73
 
72 74
 	instruct_count[action_index]++;
73 75
 
... ...
@@ -77,45 +79,45 @@ function create_new_instruct()
77 79
 /* Handles a change in the instruction */
78 80
 function instruct_change()
79 81
 {
80
-	action_index = $(this).attr('data-action');
81
-	instruct_index = $(this).attr('data-instruct');
82
-	this_act = $(this).val();
82
+	action_index = $j(this).attr('data-action');
83
+	instruct_index = $j(this).attr('data-instruct');
84
+	this_act = $j(this).val();
83 85
 
84 86
 	/* Then choose how to hide them */
85 87
 	if (this_act == 'modification')
86 88
 	{
87
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .destination').hide();
88
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .inline').hide();
89
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .code_block').hide();
89
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .destination').hide();
90
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .inline').hide();
91
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .code_block').hide();
90 92
 
91
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .reverse').show();
92
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .source').show();
93
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .reverse').show();
94
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .source').show();
93 95
 	}
94 96
 	else if ($.inArray(this_act, ["create-dir", "create-file", "remove-dir", "remove-file"]) > -1)
95 97
 	{
96
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .reverse').hide();
97
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .inline').hide();
98
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .code_block').hide();
99
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .source').hide();
98
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .reverse').hide();
99
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .inline').hide();
100
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .code_block').hide();
101
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .source').hide();
100 102
 
101
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .destination').show();
103
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .destination').show();
102 104
 	}
103 105
 	else if ($.inArray(this_act, ["require-dir", "require-file", "move-dir", "move-file"]) > -1)
104 106
 	{
105
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .reverse').hide();
106
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .inline').hide();
107
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .code_block').hide();
107
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .reverse').hide();
108
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .inline').hide();
109
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .code_block').hide();
108 110
 
109
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .source').show();
110
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .destination').show();
111
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .source').show();
112
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .destination').show();
111 113
 	}
112 114
 	else if ($.inArray(this_act, ["code", "database", "readme"]) > -1)
113 115
 	{
114
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .reverse').hide();
115
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .destination').hide();
116
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .reverse').hide();
117
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .destination').hide();
116 118
 
117
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .source').show();
118
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .inline').show();
119
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .source').show();
120
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .inline').show();
119 121
 	}
120 122
 	else
121 123
 	{
... ...
@@ -127,30 +129,30 @@ function instruct_change()
127 129
 /* Handles clicking the inline button */
128 130
 function instruct_inline()
129 131
 {
130
-	action_index = $(this).attr('data-action');
131
-	instruct_index = $(this).attr('data-instruct');
132
-	is_inline = $(this).is(':checked');
132
+	action_index = $j(this).attr('data-action');
133
+	instruct_index = $j(this).attr('data-instruct');
134
+	is_inline = $j(this).is(':checked');
133 135
 
134 136
 	if (is_inline)
135 137
 	{
136
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .code_block').show();
138
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .code_block').show();
137 139
 	}
138 140
 	else
139 141
 	{
140
-		$('#action-' + action_index + '-instruct-' + instruct_index + ' .code_block').hide();
142
+		$j('#action-' + action_index + '-instruct-' + instruct_index + ' .code_block').hide();
141 143
 	}
142 144
 }
143 145
 
144 146
 /* Handles collapsing of the instruct */
145 147
 function collapse_instruct()
146 148
 {
147
-	action_index = $(this).attr('data-action');
148
-	instruct_index = $(this).attr('data-instruct');
149
+	action_index = $j(this).attr('data-action');
150
+	instruct_index = $j(this).attr('data-instruct');
149 151
 
150 152
 	/* Simply hide the instruct, and give a expand button */
151
-	$('#action-' + action_index + '-instruct-' + instruct_index + ' .edits').hide();
152
-	$('#action-' + action_index + '-instruct-' + instruct_index + ' .expand_change').show();
153
-	$(this).hide();
153
+	$j('#action-' + action_index + '-instruct-' + instruct_index + ' .edits').hide();
154
+	$j('#action-' + action_index + '-instruct-' + instruct_index + ' .expand_change').show();
155
+	$j(this).hide();
154 156
 
155 157
 	return false;
156 158
 }
... ...
@@ -158,13 +160,13 @@ function collapse_instruct()
158 160
 /* Handles expanding of the instruct */
159 161
 function expand_instruct()
160 162
 {
161
-	action_index = $(this).attr('data-action');
162
-	instruct_index = $(this).attr('data-instruct');
163
+	action_index = $j(this).attr('data-action');
164
+	instruct_index = $j(this).attr('data-instruct');
163 165
 
164 166
 	/* Simply show the instruct, and return to the original collapse button */
165
-	$('#action-' + action_index + '-instruct-' + instruct_index + ' .edits').show();
166
-	$('#action-' + action_index + '-instruct-' + instruct_index + ' .collapse_change').show();
167
-	$(this).hide();
167
+	$j('#action-' + action_index + '-instruct-' + instruct_index + ' .edits').show();
168
+	$j('#action-' + action_index + '-instruct-' + instruct_index + ' .collapse_change').show();
169
+	$j(this).hide();
168 170
 
169 171
 	return false;
170 172
 }
... ...
@@ -172,16 +174,16 @@ function expand_instruct()
172 174
 /* Handles deleting a instruct */
173 175
 function delete_instruct()
174 176
 {
175
-	action_index = $(this).attr('data-action');
176
-	instruct_index = $(this).attr('data-instruct');
177
+	action_index = $j(this).attr('data-action');
178
+	instruct_index = $j(this).attr('data-instruct');
177 179
 
178 180
 	/* First we let the data know its deleted. */
179
-	$('#action-' + action_index + '-instruct-' + instruct_index + '-delete').val('1');
181
+	$j('#action-' + action_index + '-instruct-' + instruct_index + '-delete').val('1');
180 182
 
181 183
 	/* Then we hide this header, collapse the instruct and show the restore button */
182
-	$('#action-' + action_index + '-instruct-' + instruct_index + ' .edits').hide();
183
-	$('#action-' + action_index + '-instruct-' + instruct_index + ' .restore_change').show();
184
-	$(this).hide();
184
+	$j('#action-' + action_index + '-instruct-' + instruct_index + ' .edits').hide();
185
+	$j('#action-' + action_index + '-instruct-' + instruct_index + ' .restore_change').show();
186
+	$j(this).hide();
185 187
 
186 188
 	update_counter();
187 189
 	return false;
... ...
@@ -190,16 +192,16 @@ function delete_instruct()
190 192
 /* Handles restoring a instruct */
191 193
 function restore_instruct()
192 194
 {
193
-	action_index = $(this).attr('data-action');
194
-	instruct_index = $(this).attr('data-instruct');
195
+	action_index = $j(this).attr('data-action');
196
+	instruct_index = $j(this).attr('data-instruct');
195 197
 
196 198
 	/* First we let the data know its deleted. */
197
-	$('#action-' + action_index + '-instruct-' + instruct_index + '-delete').val('0');
199
+	$j('#action-' + action_index + '-instruct-' + instruct_index + '-delete').val('0');
198 200
 
199 201
 	/* Then we hide this header, collapse the instruct and show the restore button */
200
-	$('#action-' + action_index + '-instruct-' + instruct_index + ' .edits').show();
201
-	$('#action-' + action_index + '-instruct-' + instruct_index + ' .delete_change').show();
202
-	$(this).hide();
202
+	$j('#action-' + action_index + '-instruct-' + instruct_index + ' .edits').show();
203
+	$j('#action-' + action_index + '-instruct-' + instruct_index + ' .delete_change').show();
204
+	$j(this).hide();
203 205
 
204 206
 	update_counter();
205 207
 	return false;
... ...
@@ -208,12 +210,12 @@ function restore_instruct()
208 210
 /* Handles collapsing of the action */
209 211
 function collapse_action()
210 212
 {
211
-	action_index = $(this).attr('data-action');
213
+	action_index = $j(this).attr('data-action');
212 214
 
213 215
 	/* Simply hide the action, and give a expand button */
214
-	$('#action-' + action_index + '-instruct_container').hide();
215
-	$('#action-' + action_index + ' .expand_action').show();
216
-	$(this).hide();
216
+	$j('#action-' + action_index + '-instruct_container').hide();
217
+	$j('#action-' + action_index + ' .expand_action').show();
218
+	$j(this).hide();
217 219
 
218 220
 	return false;
219 221
 }
... ...
@@ -221,12 +223,12 @@ function collapse_action()
221 223
 /* Handles expanding of the action */
222 224
 function expand_action()
223 225
 {
224
-	action_index = $(this).attr('data-action');
226
+	action_index = $j(this).attr('data-action');
225 227
 
226 228
 	/* Simply show the action, and return to the original collapse button */
227
-	$('#action-' + action_index + '-instruct_container').show();
228
-	$('#action-' + action_index + ' .collapse_action').show();
229
-	$(this).hide();
229
+	$j('#action-' + action_index + '-instruct_container').show();
230
+	$j('#action-' + action_index + ' .collapse_action').show();
231
+	$j(this).hide();
230 232
 
231 233
 	return false;
232 234
 }
... ...
@@ -234,15 +236,15 @@ function expand_action()
234 236
 /* Handles deleting a action */
235 237
 function delete_action()
236 238
 {
237
-	action_index = $(this).attr('data-action');
239
+	action_index = $j(this).attr('data-action');
238 240
 
239 241
 	/* First we let the data know its deleted. */
240
-	$('#action-' + action_index + '-delete').val('1');
242
+	$j('#action-' + action_index + '-delete').val('1');
241 243
 
242 244
 	/* Then we hide this header, collapse the instruct and show the restore button */
243
-	$('#action-' + action_index + '-instruct_container').hide();
244
-	$('#action-' + action_index + ' .restore_action').show();
245
-	$(this).hide();
245
+	$j('#action-' + action_index + '-instruct_container').hide();
246
+	$j('#action-' + action_index + ' .restore_action').show();
247
+	$j(this).hide();
246 248
 
247 249
 	update_counter();
248 250
 	return false;
... ...
@@ -251,15 +253,15 @@ function delete_action()
251 253
 /* Handles restoring a action */
252 254
 function restore_action()
253 255
 {
254
-	action_index = $(this).attr('data-action');
256
+	action_index = $j(this).attr('data-action');
255 257
 
256 258
 	/* First we let the data know its deleted. */
257
-	$('#action-' + action_index + '-delete').val('0');
259
+	$j('#action-' + action_index + '-delete').val('0');
258 260
 
259 261
 	/* Then we hide this header, collapse the instruct and show the restore button */
260
-	$('#action-' + action_index + '-instruct_container').show();
261
-	$('#action-' + action_index + ' .delete_action').show();
262
-	$(this).hide();
262
+	$j('#action-' + action_index + '-instruct_container').show();
263
+	$j('#action-' + action_index + ' .delete_action').show();
264
+	$j(this).hide();
263 265
 
264 266
 	update_counter();
265 267
 	return false;
... ...
@@ -268,12 +270,12 @@ function restore_action()
268 270
 /* This is the nasty guy */
269 271
 function show_instruct_preview()
270 272
 {
271
-	$('#preview_container').show();
273
+	$j('#preview_container').show();
272 274
 
273
-	author = $('#basic_info_name').val().replace(/ /g,'_');
274
-	name = $('#basic_info_mod').val().replace(/ /g,'_');
275
-	version = $('#basic_info_version').val().replace(/ /g,'_');
276
-	type = $('#basic_info_type').val();
275
+	author = $j('#basic_info_name').val().replace(/ /g,'_');
276
+	name = $j('#basic_info_mod').val().replace(/ /g,'_');
277
+	version = $j('#basic_info_version').val().replace(/ /g,'_');
278
+	type = $j('#basic_info_type').val();
277 279
 
278 280
 	preview = '<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">' + "\n" + '\
279 281
 <!-- This package was generated by SleePys Package Maker at http://sleepycode.com -->' + "\n" + '\
... ...
@@ -287,14 +289,14 @@ function show_instruct_preview()
287 289
 	for (i = 1; i < action_count; i++)
288 290
 	{
289 291
 		/* Skip this instruct if we deleted it. */
290
-		if ($('#action-' + i + '-delete').val() == '1')
292
+		if ($j('#action-' + i + '-delete').val() == '1')
291 293
 		{
292 294
 			continue;
293 295
 		}
294 296
 
295 297
 		/* Get the action info */
296
-		action_type = $('#action-' + i + '-type').val();
297
-		action_smf_versions = $('#action-' + i + '-smf_versions').val();
298
+		action_type = $j('#action-' + i + '-type').val();
299
+		action_smf_versions = $j('#action-' + i + '-smf_versions').val();
298 300
 
299 301
 		/* We only want valid actions */
300 302
 		if ($.inArray(action_type, ["install", "upgrade", "uninstall"]) > -1)
... ...
@@ -319,18 +321,18 @@ function show_instruct_preview()
319 321
 		for (j = 1; j < instruct_count[i]; j++)
320 322
 		{
321 323
 			/* Skip this instruct if we deleted it. */
322
-			if ($('#action-' + i + '-instruct-' + j + '-delete').val() == '1')
324
+			if ($j('#action-' + i + '-instruct-' + j + '-delete').val() == '1')
323 325
 			{
324 326
 				continue;
325 327
 			}
326 328
 
327 329
 			/* Get our instruction info */
328
-			instruct_action		=	$('#action-' + i + '-instruct-' + j + '-action').val();
329
-			instruct_reverse	=	$('#action-' + i + '-instruct-' + j + '-reverse').is(':checked');
330
-			instruct_inline		=	$('#action-' + i + '-instruct-' + j + '-reverse').is(':checked');
331
-			instruct_source		=	$('#action-' + i + '-instruct-' + j + '-source').val();
332
-			instruct_destination=	$('#action-' + i + '-instruct-' + j + '-destination').val();
333
-			instruct_block		=	$('#action-' + i + '-instruct-' + j + '-block').val().replace('<' + '?php', '').replace('?' + '>', '');
330
+			instruct_action		=	$j('#action-' + i + '-instruct-' + j + '-action').val();
331
+			instruct_reverse	=	$j('#action-' + i + '-instruct-' + j + '-reverse').is(':checked');
332
+			instruct_inline		=	$j('#action-' + i + '-instruct-' + j + '-reverse').is(':checked');
333
+			instruct_source		=	$j('#action-' + i + '-instruct-' + j + '-source').val();
334
+			instruct_destination=	$j('#action-' + i + '-instruct-' + j + '-destination').val();
335
+			instruct_block		=	$j('#action-' + i + '-instruct-' + j + '-block').val().replace('<' + '?php', '').replace('?' + '>', '');
334 336
 
335 337
 			/* Try to make it easier to handle these */
336 338
 			if ($.inArray(instruct_action, ["modification", "code", "database", "readme"]) > -1)
... ...
@@ -394,7 +396,7 @@ function show_instruct_preview()
394 396
 	preview += "\n" + '\
395 397
 </package-info>';
396 398
 
397
-	$('#preview').text(preview);
399
+	$j('#preview').text(preview);
398 400
 }
399 401
 
400 402
 function download_action_generate()
... ...
@@ -403,8 +405,8 @@ function download_action_generate()
403 405
 
404 406
 	$.generateFile({
405 407
 		filename	: 'package-info.xml',
406
-		content		: $('#preview').text(),
407
-		script		: $('#downloadername').val() + '?download'
408
+		content		: $j('#preview').text(),
409
+		script		: $j('#downloadername').val() + '?download'
408 410
 	});
409 411
 }
410 412
 
... ...
@@ -412,7 +414,7 @@ function download_action_data()
412 414
 {
413 415
 	show_instruct_preview();
414 416
 
415
-	data = $.base64.encode($('#preview').text());
417
+	data = $.base64.encode($j('#preview').text());
416 418
 
417 419
 	/* No actionname can be specified by a data URI */
418 420
 	window.location = 'data:application/octet-stream;charset=utf-8;base64,' + data;
... ...
@@ -428,7 +430,7 @@ function update_counter()
428 430
 	for (i = 1; i < action_count; i++)
429 431
 	{
430 432
 		/* Skip this instruct if we deleted it. */
431
-		if ($('#action-' + i + '-delete').val() == '1')
433
+		if ($j('#action-' + i + '-delete').val() == '1')
432 434
 			continue;
433 435
 
434 436
 		temp_action_count++;
... ...
@@ -436,7 +438,7 @@ function update_counter()
436 438
 		for (j = 1; j < instruct_count[i]; j++)
437 439
 		{
438 440
 			/* Skip this instruct if we deleted it. */
439
-			if ($('#action-' + i + '-instruct-' + j + '-delete').val() == '1')
441
+			if ($j('#action-' + i + '-instruct-' + j + '-delete').val() == '1')
440 442
 			{
441 443
 				continue;
442 444
 			}
... ...
@@ -445,6 +447,6 @@ function update_counter()
445 447
 		}
446 448
 	}
447 449
 
448
-	$('#detail_actions').val(temp_action_count);
449
-	$('#detail_instructs').val(temp_instruct_count);
450
+	$j('#detail_actions').val(temp_action_count);
451
+	$j('#detail_instructs').val(temp_instruct_count);
450 452
 }
451 453
\ No newline at end of file
... ...
@@ -5,8 +5,10 @@
5 5
  * License: BSD 3 Clause; See license.txt
6 6
 */
7 7
 
8
+$ = jQuery.noConflict();
9
+
8 10
 /* This gets things going once the document has loaded, also makes sure JQuery is here. */
9
-$(document).ready(function(){
11
+jQuery(document).ready(function(){
10 12
 	/* Start off some counting */
11 13
 	file_count = 1;
12 14
 	edit_count =new Array();
13 15