5398d29d76e4abdde013b1529b4ade07b8b23ae2
Jeremy D Completed Info Maker secti...

Jeremy D authored 12 years ago

assets/script_mod.js   1) /*
assets/script_mod.js   2)  * SMF Package Manager Generator
assets/script_mod.js   3)  * Author: SleePy (JeremyD)
assets/script_mod.js   4)  * Repository: https://github.com/jdarwood007/smf_package_maker
assets/script_mod.js   5)  * License: BSD 3 Clause; See license.txt
assets/script_mod.js   6) */
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js   7) window.$j = jQuery.noConflict();
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js   8) 
Jeremy D Completed Info Maker secti...

Jeremy D authored 12 years ago

assets/script_mod.js   9) /* This gets things going once the document has loaded, also makes sure JQuery is here. */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js  10) jQuery(document).ready(function(){
Jeremy D Completed Info Maker secti...

Jeremy D authored 12 years ago

assets/script_mod.js  11) 	/* Start off some counting */
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js  12) 	window.file_count = 1;
assets/script_mod.js  13) 	window.edit_count = new Array();
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js      14) 	edit_count[file_count] = 1;
assets/script.js      15) 
Jeremy D Forgot about using live, i...

Jeremy D authored 12 years ago

assets/script_mod.js  16) 	/* Bind some stuff to our files, using live so they auto update as new stuff is added. */
Jeremy D Add native compatibility wi...

Jeremy D authored 11 years ago

assets/script_mod.js  17) 	$j(document).on('click', '.collapse_file', collapse_file);
assets/script_mod.js  18) 	$j(document).on('click', '.expand_file', expand_file);
assets/script_mod.js  19) 	$j(document).on('click', '.delete_file', delete_file);
assets/script_mod.js  20) 	$j(document).on('click', '.restore_file', restore_file);
Jeremy D Forgot about using live, i...

Jeremy D authored 12 years ago

assets/script_mod.js  21) 
assets/script_mod.js  22) 	/* Now we will bind to the actual edits, again using live. */
Jeremy D Add native compatibility wi...

Jeremy D authored 11 years ago

assets/script_mod.js  23) 	$j(document).on('click', '.collapse_change', collapse_edit);
assets/script_mod.js  24) 	$j(document).on('click', '.expand_change', expand_edit);
assets/script_mod.js  25) 	$j(document).on('click', '.delete_change', delete_edit);
assets/script_mod.js  26) 	$j(document).on('click', '.restore_change', restore_edit);
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js      27) 
Jeremy D Completed Info Maker secti...

Jeremy D authored 12 years ago

assets/script_mod.js  28) 	/* Give our buttons some actions. */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js  29) 	$j('#add_file').click(create_new_file);
Jeremy D Add native compatibility wi...

Jeremy D authored 11 years ago

assets/script_mod.js  30) 	$j(document).on('click', '.add_edit', create_new_edit);
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js  31) 	$j('#show_preview').click(show_edit_preview);
Jeremy D Completed Info Maker secti...

Jeremy D authored 12 years ago

assets/script_mod.js  32) 
assets/script_mod.js  33) 	/* The details and basic buttons. */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js  34) 	$j('#collapse_basic').click(function(){$j('#basic_info .info').hide(); $j('#collapse_basic').hide(); $j('#restore_basic').show();});
assets/script_mod.js  35) 	$j('#restore_basic').click(function(){$j('#basic_info .info').show(); $j('#restore_basic').hide(); $j('#collapse_basic').show();});
assets/script_mod.js  36) 	$j('#collapse_details').click(function(){$j('#details_info .info').hide(); $j('#collapse_details').hide(); $j('#restore_details').show();});
assets/script_mod.js  37) 	$j('#restore_details').click(function(){$j('#details_info .info').show(); $j('#restore_details').hide(); $j('#collapse_details').show();});
Jeremy D Forgot about using live, i...

Jeremy D authored 12 years ago

assets/script_mod.js  38) 
assets/script_mod.js  39) 	/* Kick things off by creating a file. */
assets/script_mod.js  40) 	create_new_file();
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js      41) });
assets/script.js      42) 
assets/script.js      43) /* Handles adding files */
assets/script.js      44) function create_new_file()
assets/script.js      45) {
assets/script.js      46) 	/* We have been through this before */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js  47) 	$j('#file_container').append($j('#file_template').html().replace(/#FILEINDEX#/g, file_count));
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js      48) 
assets/script.js      49) 	/* Now we pretend to click said element */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js  50) 	$j('#file-' + file_count).find('.add_edit').click();
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js      51) 
assets/script.js      52) 	/* Move the index and add defaults */
assets/script.js      53) 	file_count++;
assets/script.js      54) 	edit_count[file_count] = 1;
assets/script.js      55) 
assets/script.js      56) 	update_counter();
assets/script.js      57) }
assets/script.js      58) 
assets/script.js      59) /* Handles adding of edits */
assets/script.js      60) function create_new_edit()
assets/script.js      61) {
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js  62) 	var file_index = $j(this).attr('data-file');
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js      63) 
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js  64) 	$j('#file-' + file_index + '-edit_container').append($j('#edit_template').html().replace(/#FILEINDEX#/g, file_index).replace(/#EDITINDEX#/g, edit_count[file_index]));
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js      65) 	edit_count[file_index]++;
assets/script.js      66) 
assets/script.js      67) 	update_counter();
assets/script.js      68) }
assets/script.js      69) 
assets/script.js      70) /* Handles collapsing of the edit */
assets/script.js      71) function collapse_edit()
assets/script.js      72) {
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js  73) 	var file_index = $j(this).attr('data-file');
assets/script_mod.js  74) 	var edit_index = $j(this).attr('data-edit');
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js      75) 
assets/script.js      76) 	/* Simply hide the edit, and give a expand button */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js  77) 	$j('#file-' + file_index + '-edit-' + edit_index + ' .edits').hide();
assets/script_mod.js  78) 	$j('#file-' + file_index + '-edit-' + edit_index + ' .expand_change').show();
assets/script_mod.js  79) 	$j(this).hide();
Jeremy D Forgot about using live, i...

Jeremy D authored 12 years ago

assets/script_mod.js  80) 
assets/script_mod.js  81) 	return false;
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js      82) }
assets/script.js      83) 
assets/script.js      84) /* Handles expanding of the edit */
assets/script.js      85) function expand_edit()
assets/script.js      86) {
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js  87) 	var file_index = $j(this).attr('data-file');
assets/script_mod.js  88) 	var edit_index = $j(this).attr('data-edit');
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js      89) 
assets/script.js      90) 	/* Simply show the edit, and return to the original collapse button */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js  91) 	$j('#file-' + file_index + '-edit-' + edit_index + ' .edits').show();
assets/script_mod.js  92) 	$j('#file-' + file_index + '-edit-' + edit_index + ' .collapse_change').show();
assets/script_mod.js  93) 	$j(this).hide();
Jeremy D Forgot about using live, i...

Jeremy D authored 12 years ago

assets/script_mod.js  94) 
assets/script_mod.js  95) 	return false;
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js      96) }
assets/script.js      97) 
assets/script.js      98) /* Handles deleting a edit */
assets/script.js      99) function delete_edit()
assets/script.js     100) {
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js 101) 	var file_index = $j(this).attr('data-file');
assets/script_mod.js 102) 	var edit_index = $j(this).attr('data-edit');
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     103) 
assets/script.js     104) 	/* First we let the data know its deleted. */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 105) 	$j('#file-' + file_index + '-edit-' + edit_index + '-delete').val('1');
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     106) 
assets/script.js     107) 	/* Then we hide this header, collapse the edit and show the restore button */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 108) 	$j('#file-' + file_index + '-edit-' + edit_index + ' .edits').hide();
assets/script_mod.js 109) 	$j('#file-' + file_index + '-edit-' + edit_index + ' .restore_change').show();
assets/script_mod.js 110) 	$j(this).hide();
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     111) 
assets/script.js     112) 	update_counter();
Jeremy D Forgot about using live, i...

Jeremy D authored 12 years ago

assets/script_mod.js 113) 	return false;
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     114) }
assets/script.js     115) 
assets/script.js     116) /* Handles restoring a edit */
assets/script.js     117) function restore_edit()
assets/script.js     118) {
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js 119) 	var file_index = $j(this).attr('data-file');
assets/script_mod.js 120) 	var edit_index = $j(this).attr('data-edit');
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     121) 
assets/script.js     122) 	/* First we let the data know its deleted. */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 123) 	$j('#file-' + file_index + '-edit-' + edit_index + '-delete').val('0');
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     124) 
assets/script.js     125) 	/* Then we hide this header, collapse the edit and show the restore button */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 126) 	$j('#file-' + file_index + '-edit-' + edit_index + ' .edits').show();
assets/script_mod.js 127) 	$j('#file-' + file_index + '-edit-' + edit_index + ' .delete_change').show();
assets/script_mod.js 128) 	$j(this).hide();
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     129) 
assets/script.js     130) 	update_counter();
Jeremy D Forgot about using live, i...

Jeremy D authored 12 years ago

assets/script_mod.js 131) 	return false;
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     132) }
assets/script.js     133) 
assets/script.js     134) /* Handles collapsing of the file */
assets/script.js     135) function collapse_file()
assets/script.js     136) {
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js 137) 	var file_index = $j(this).attr('data-file');
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     138) 
assets/script.js     139) 	/* Simply hide the file, and give a expand button */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 140) 	$j('#file-' + file_index + '-edit_container').hide();
assets/script_mod.js 141) 	$j('#file-' + file_index + ' .expand_file').show();
assets/script_mod.js 142) 	$j(this).hide();
Jeremy D Forgot about using live, i...

Jeremy D authored 12 years ago

assets/script_mod.js 143) 
assets/script_mod.js 144) 	return false;
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     145) }
assets/script.js     146) 
assets/script.js     147) /* Handles expanding of the file */
assets/script.js     148) function expand_file()
assets/script.js     149) {
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js 150) 	var file_index = $j(this).attr('data-file');
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     151) 
assets/script.js     152) 	/* Simply show the file, and return to the original collapse button */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 153) 	$j('#file-' + file_index + '-edit_container').show();
assets/script_mod.js 154) 	$j('#file-' + file_index + ' .collapse_file').show();
assets/script_mod.js 155) 	$j(this).hide();
Jeremy D Forgot about using live, i...

Jeremy D authored 12 years ago

assets/script_mod.js 156) 
assets/script_mod.js 157) 	return false;
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     158) }
assets/script.js     159) 
assets/script.js     160) /* Handles deleting a file */
assets/script.js     161) function delete_file()
assets/script.js     162) {
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js 163) 	var file_index = $j(this).attr('data-file');
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     164) 
assets/script.js     165) 	/* First we let the data know its deleted. */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 166) 	$j('#file-' + file_index + '-delete').val('1');
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     167) 
assets/script.js     168) 	/* Then we hide this header, collapse the edit and show the restore button */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 169) 	$j('#file-' + file_index + '-edit_container').hide();
assets/script_mod.js 170) 	$j('#file-' + file_index + ' .restore_file').show();
assets/script_mod.js 171) 	$j(this).hide();
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     172) 
assets/script.js     173) 	update_counter();
Jeremy D Forgot about using live, i...

Jeremy D authored 12 years ago

assets/script_mod.js 174) 	return false;
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     175) }
assets/script.js     176) 
assets/script.js     177) /* Handles restoring a file */
assets/script.js     178) function restore_file()
assets/script.js     179) {
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js 180) 	var file_index = $j(this).attr('data-file');
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     181) 
assets/script.js     182) 	/* First we let the data know its deleted. */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 183) 	$j('#file-' + file_index + '-delete').val('0');
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     184) 
assets/script.js     185) 	/* Then we hide this header, collapse the edit and show the restore button */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 186) 	$j('#file-' + file_index + '-edit_container').show();
assets/script_mod.js 187) 	$j('#file-' + file_index + ' .delete_file').show();
assets/script_mod.js 188) 	$j(this).hide();
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     189) 
assets/script.js     190) 	update_counter();
Jeremy D Forgot about using live, i...

Jeremy D authored 12 years ago

assets/script_mod.js 191) 	return false;
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     192) }
assets/script.js     193) 
assets/script.js     194) /* This is the nasty guy */
assets/script.js     195) function show_edit_preview()
assets/script.js     196) {
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 197) 	$j('#preview_container').show();
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     198) 
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js 199) 	var author = $j('#basic_info_name').val().replace(/ /g,'_');
assets/script_mod.js 200) 	var name = $j('#basic_info_mod').val().replace(/ /g,'_');
assets/script_mod.js 201) 	var version = $j('#basic_info_version').val().replace(/ /g,'_');
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     202) 
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js 203) 	var preview = '<' + '?xml version="1.0"?' + '>' + "\n" + '\
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     204) <!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">' + "\n" + '\
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js 205) <!-- This package was generated by SleePys Modification Maker at https://sleepycode.com -->' + "\n" + '\
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     206) <modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">' + "\n" + '\
assets/script.js     207) 	<id>' + author + ':' + name + '</id>' + "\n" + '\
assets/script.js     208) 	<version>' + version + '</version>' + "\n";
assets/script.js     209) 
assets/script.js     210) 	i = 1;
assets/script.js     211) 	for (i = 1; i < file_count; i++)
assets/script.js     212) 	{
assets/script.js     213) 		/* Skip this edit if we deleted it. */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 214) 		if ($j('#file-' + i + '-delete').val() == '1')
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     215) 		{
assets/script.js     216) 			continue;
assets/script.js     217) 		}
assets/script.js     218) 
assets/script.js     219) 		/* Find our edit count */
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js 220) 		var ecount = edit_count[i];
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     221) 
assets/script.js     222) 		/* Get the file info */
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js 223) 		var file_type = $j('#file-' + i + '-file_type').val();
assets/script_mod.js 224) 		var file_name = $j('#file-' + i + '-file_name').val();
assets/script_mod.js 225) 		var file_fail = $j('#file-' + i + '-file_fail').val();
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     226) 
assets/script.js     227) 		/* Start off with the file attribute */
assets/script.js     228) 		preview += "\n" + '\
assets/script.js     229) 	<file name="' + file_type + '/' + file_name + '"';
assets/script.js     230) 
assets/script.js     231) 		/* We don't need to define the default error type. */
Jeremy D Add native compatibility wi...

Jeremy D authored 11 years ago

assets/script_mod.js 232) 		if ($j.inArray(file_fail, ["ignore", "skip"]) > -1)
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     233) 		{
assets/script.js     234) 			preview += ' error="' + file_fail + '"';
assets/script.js     235) 		}
assets/script.js     236) 		preview += '>';
assets/script.js     237) 
assets/script.js     238) 		/* Now onto the individual edits we made! */
assets/script.js     239) 		for (j = 1; j < ecount; j++)
assets/script.js     240) 		{
assets/script.js     241) 			/* Skip this edit if we deleted it. */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 242) 			if ($j('#file-' + i + '-edit-' + j + '-delete').val() == '1')
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     243) 			{
assets/script.js     244) 				continue;
assets/script.js     245) 			}
assets/script.js     246) 
assets/script.js     247) 			/* Get our edit info */
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js 248) 			var edit_action		=	$j('#file-' + i + '-edit-' + j + '-action').val();
assets/script_mod.js 249) 			var edit_error		=	$j('#file-' + i + '-edit-' + j + '-error').val();
assets/script_mod.js 250) 			var edit_whitespace	=	$j('#file-' + i + '-edit-' + j + '-action').is(':checked');
assets/script_mod.js 251) 			var edit_search		=	$j('#file-' + i + '-edit-' + j + '-search').val();
assets/script_mod.js 252) 			var edit_replace	=	$j('#file-' + i + '-edit-' + j + '-replace').val();
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     253) 
assets/script.js     254) 			/* Start off our editing */
assets/script.js     255) 			preview += "\n\
assets/script.js     256) 		<operation";
assets/script.js     257) 
assets/script.js     258) 			/* We only need to add error handling for non default */
Jeremy D Add native compatibility wi...

Jeremy D authored 11 years ago

assets/script_mod.js 259) 			if ($j.inArray(edit_error, ["ignore", "required"]) > -1)
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     260) 			{
assets/script.js     261) 				preview += ' error="' + file_fail + '"';
assets/script.js     262) 			}
assets/script.js     263) 			preview += '>';
assets/script.js     264) 
assets/script.js     265) 			/* Handle our search action */
assets/script.js     266) 			if (edit_action == 'end')
assets/script.js     267) 			{
assets/script.js     268) 				preview += "\n" + '\
assets/script.js     269) 			<search position="end"/>';
assets/script.js     270) 			}
assets/script.js     271) 			else
assets/script.js     272) 			{
assets/script.js     273) 				preview += "\n" + '\
assets/script.js     274) 			<search position="' + edit_action + '"';
assets/script.js     275) 
assets/script.js     276) 				/* Ignore whitespace issues */
assets/script.js     277) 				if (edit_whitespace)
assets/script.js     278) 				{
assets/script.js     279) 					preview += ' whitespace="loose"';
assets/script.js     280) 				}
assets/script.js     281) 
assets/script.js     282) 				/* Finally our code. */
assets/script.js     283) 				preview += '><![CDATA[' + edit_search + ']]></search>';
assets/script.js     284) 			}
assets/script.js     285) 
assets/script.js     286) 			/* Now our replace/add operation */
assets/script.js     287) 			preview += "\n" + '\
assets/script.js     288) 			<add><![CDATA[' + edit_replace + ']]></add>' + "\n" + '\
assets/script.js     289) 		</operation>';
assets/script.js     290) 
assets/script.js     291) 		}
assets/script.js     292) 
assets/script.js     293) 		/* Close up the file edit */
assets/script.js     294) 		preview += "\n\
assets/script.js     295) 	</file>";
assets/script.js     296) 
assets/script.js     297) 	}
assets/script.js     298) 
Jeremy D ! Forgot a few closing ret...

Jeremy D authored 12 years ago

assets/script_mod.js 299) 	preview += "\n" + '\
assets/script_mod.js 300) </modification>';
assets/script_mod.js 301) 
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 302) 	$j('#preview').text(preview);
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     303) }
assets/script.js     304) 
assets/script.js     305) function download_file_generate()
assets/script.js     306) {
assets/script.js     307) 	show_edit_preview();
assets/script.js     308) 
Jeremy D Add native compatibility wi...

Jeremy D authored 11 years ago

assets/script_mod.js 309) 	$j.generateFile({
Jeremy D Made it so we can change t...

Jeremy D authored 12 years ago

assets/script_mod.js 310) 		filename	: 'install.xml',
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 311) 		content		: $j('#preview').text(),
assets/script_mod.js 312) 		script		: $j('#downloadername').val() + '?download'
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     313) 	});
assets/script.js     314) }
assets/script.js     315) 
assets/script.js     316) function download_file_data()
assets/script.js     317) {
assets/script.js     318) 	show_edit_preview();
assets/script.js     319) 
Jeremy D Add native compatibility wi...

Jeremy D authored 11 years ago

assets/script_mod.js 320) 	data = $j.base64.encode($j('#preview').text());
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     321) 
assets/script.js     322) 	/* No filename can be specified by a data URI */
Jeremy D Made it so we can change t...

Jeremy D authored 12 years ago

assets/script_mod.js 323) 	window.location = 'data:application/octet-stream;charset=utf-8;base64,' + data;
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     324) }
assets/script.js     325) 
assets/script.js     326) /* Updates our details counters */
assets/script.js     327) function update_counter()
assets/script.js     328) {
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js 329) 	var temp_file_count = 0;
assets/script_mod.js 330) 	var temp_edit_count = 0;
assets/script_mod.js 331) 	var temp_line_count = 0;
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     332) 
Jeremy D Added Package Info stuff a...

Jeremy D authored 12 years ago

assets/script_mod.js 333) 	/* Because of deleted actions, we can't simply use length */
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     334) 	for (i = 1; i < file_count; i++)
assets/script.js     335) 	{
assets/script.js     336) 		/* Skip this edit if we deleted it. */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 337) 		if ($j('#file-' + i + '-delete').val() == '1')
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     338) 			continue;
assets/script.js     339) 
assets/script.js     340) 		temp_file_count++;
assets/script.js     341) 
assets/script.js     342) 		for (j = 1; j < edit_count[i]; j++)
assets/script.js     343) 		{
assets/script.js     344) 			/* Skip this edit if we deleted it. */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 345) 			if ($j('#file-' + i + '-edit-' + j + '-delete').val() == '1')
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     346) 			{
assets/script.js     347) 				continue;
assets/script.js     348) 			}
assets/script.js     349) 
assets/script.js     350) 			temp_edit_count++;
assets/script.js     351) 
assets/script.js     352) 			/* Find out what action we have */
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 353) 			if ($j('#file-' + i + '-edit-' + j + '-action').val() == 'replace')
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     354) 			{
jdarwood007 Add hooks functionality to...

jdarwood007 authored 4 years ago

assets/script_mod.js 355) 				var search = $j('#file-' + i + '-edit-' + j + '-search').val().split("\n").length;
assets/script_mod.js 356) 				var replace = $j('#file-' + i + '-edit-' + j + '-replace').val().split("\n").length;
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     357) 
assets/script.js     358) 				if (replace > search)
assets/script.js     359) 					temp_line_count += (replace - search);
assets/script.js     360) 			}
assets/script.js     361) 			else
assets/script.js     362) 			{
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 363) 				temp_line_count += $j('#file-' + i + '-edit-' + j + '-replace').val().split("\n").length;
Jeremy D Initial SMF Package Maker S...

Jeremy D authored 12 years ago

assets/script.js     364) 			}
assets/script.js     365) 		}
assets/script.js     366) 	}
assets/script.js     367) 
Jeremy D Prevent conflicts with othe...

Jeremy D authored 11 years ago

assets/script_mod.js 368) 	$j('#detail_files').val(temp_file_count);
assets/script_mod.js 369) 	$j('#detail_edits').val(temp_edit_count);
assets/script_mod.js 370) 	$j('#detail_lines').val(temp_line_count);