PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/neutrino atomic edition 08/tpl/default/post_form.html

http://neutrino-cms.googlecode.com/
HTML | 100 lines | 91 code | 9 blank | 0 comment | 0 complexity | b588a22c656cc642434e6727bc35062b MD5 | raw file
  1<script type="text/javascript">
  2var clientPC = navigator.userAgent.toLowerCase(); // Get client info
  3var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
  4				&& (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
  5				&& (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));
  6
  7var countOfFields = 1;
  8var curFieldNameId = 1;
  9var maxFieldLimit = 10;
 10
 11function deleteField(a) {
 12	var contDiv = a.parentNode;
 13	contDiv.parentNode.removeChild(contDiv);
 14	countOfFields--;
 15	return false;
 16}
 17function addField() {
 18	countOfFields++;
 19	curFieldNameId++;
 20	var p = document.createElement("p");
 21	p.innerHTML = '<input name="usrfile[]" type="file" id="fi'+curFieldNameId+'" /> <a onclick="return deleteField(this)" href="#">[X]</a> <a onclick="return addField()" href="#">[+]</a> <a onclick="f_name_l(\'fi'+curFieldNameId+'\')" style="cursor: pointer;">[^]</a>';
 22	document.getElementById("files").appendChild(p);
 23	return false;
 24}
 25function addFieldL() {
 26		countOfFields++;
 27		curFieldNameId++;
 28		var p = document.createElement("p");
 29		p.innerHTML = '<input name="linksa['+curFieldNameId+']" type="text" /> <input name="linkst[]" type="text" /><a onclick="return deleteField(this)" href="#">[X]</a> <a onclick="return addFieldL()" href="#">[+]</a>';
 30		document.getElementById("linkss").appendChild(p);
 31		return false;
 32}
 33function mozz (str1,str2) {
 34	var ss = document.postfo.text.scrollTop;
 35	sel1 = document.postfo.text.value.substr(0, document.postfo.text.selectionStart);
 36	sel2 = document.postfo.text.value.substr(document.postfo.text.selectionEnd);
 37
 38
 39	sel = document.postfo.text.value.substr(document.postfo.text.selectionStart,
 40	document.postfo.text.selectionEnd - document.postfo.text.selectionStart);
 41
 42
 43	var text = document.postfo.text.firstChild;
 44	document.postfo.text.value = sel1 + str1 + sel + str2 + sel2;
 45
 46
 47	selPos = str1.length + sel1.length + sel.length + str2.length;
 48	document.postfo.text.setSelectionRange(sel1.length, selPos);
 49	document.postfo.text.scrollTop = ss;
 50}
 51function insert(str1,str2) {
 52	if (is_nav) { mozz (str1,str2); }
 53	frm = document.forms[0].text;
 54	seltxt = frm.document.selection.createRange();
 55	seltxt.text = str1+seltxt.text+str2;
 56	document.forms[0].text.focus();
 57}
 58function f_name_l(fileId){
 59	var formFile = document.getElementById(fileId);
 60	file_name=formFile.value.replace(/^([^\\\/]*(\\|\/))*/,"");
 61	if(file_name!="") {
 62		insert('<a href="files\/'+file_name+'">','<\/a>');
 63	}
 64}
 65</script>
 66<form method="post" name="postfo" action="" enctype="multipart/form-data">
 67		<?php echo $ptfup; ?>
 68		<input type="hidden" name="action" value="<?php echo $_v['action'];?>" /><input type="hidden" name="p" value="<?php echo @$_v['p'];?>" />
 69		<fieldset>
 70				<legend>?????????</legend>
 71				<input type="text" name="title" style="width:100%;" value="<?php echo @$post['title'];?>" />
 72		</fieldset>
 73		<fieldset>
 74			<legend>?????</legend>
 75			<textarea name="text" id="text" rows="8" cols="4" style="width:100%; height:410px"><?php echo @$post['text'];?></textarea></fieldset>
 76		<?if(!isset($_v['pg']) && @$_v['action']!="new_pag") { ?>
 77		<fieldset>
 78				<legend>????, ????? ???????:</legend>
 79				<input type="text" name="tags" value="<?php echo @$post['tags']?>" size="50" style="width:100%" />
 80		</fieldset>
 81		<fieldset style="width:75%;margin:0 auto;">
 82			<legend><a href="#" onclick="var open=document.getElementById('additionally'); if(open.style.display=='none')open.style.display='block'; else open.style.display='none';return false"><?php echo $_l['extra_post'];?></a></legend>
 83			<div id="additionally" style="display:none">
 84				<p><input name="closep" id="closep" type="checkbox" <?if(@gbuffer($_v['p'],"close")) { echo "checked='checked'"; }?> /> <label for="closep"><?php echo $_l['o_close'];?></label></p>
 85				<p><input name="nocomm" id="nocomm" type="checkbox" <?if(@gbuffer($_v['p'],"comments")) { echo "checked='checked'"; }?> /> <label for="nocomm"><?php echo $_l['o_commoff'];?></label></p>
 86				<p><input name="comhidden" id="comhidden" type="checkbox" <?if(@gbuffer($_v['p'],"hidecomm")) { echo "checked='checked'"; }?> /> <label for="comhidden"><?php echo $_l['o_commhide'];?></label></p>
 87				<p><input name="nomailc" id="nomailc" type="checkbox" <?if(@gbuffer($_v['p'],"nomail")) { echo "checked='checked'"; }?> /> <label for="nomailc"><?php echo $_l['o_nomail'];?></label></p>
 88				<p><input name="norss" id="norss" type="checkbox" <?if(@gbuffer($_v['p'],"norss")) { echo "checked='checked'"; }?> /> <label for="norss"><?php echo $_l['o_hrss'];?></label></p>
 89			</div>
 90		</fieldset>
 91
 92		<fieldset style="width:75%;margin:0 auto;"><legend><?php echo $_l['extra_post_files']?></legend>
 93		<div id="files">
 94			<p><input name="usrfile[]" type="file" id="fi1" /> <a onclick="return addField()" href="#">[+]</a> <a onclick="f_name_l('fi1')" style="cursor: pointer;">[^]</a></p>
 95		</div>
 96	</fieldset>
 97	<?}?>
 98	<?php echo $ptfdw; ?><br />
 99	<input name="msubmit" type="submit" id="go" value="<?php echo $_l['c_submit']?>" /><input type="reset" id="cansel" value="<?php echo $_l['c_reset']?>" />
100</form>