Jump to content
php.lv forumi

Smarkup text editors.


zintis8789

Recommended Posts

Es izmantoju smarkup text editoru.

Vienam textarea radas smarkup dizains bet otram nerādas kods:

<script type="text/javascript" src="smarkup/smarkup.js"></script>
<script type="text/javascript" src="smarkup/conf/html/conf.js"></script>
<p>Teksts:
<textarea name="zina" id="html">
</textarea>
<p>Teksts:
<textarea name="ievads" id="html"  >
</textarea>

<script type="text/javascript">
SMarkUp.bind(
	'html', //textarea id 
	'html', //makup configuration name 
	300		//height of textarea
);
</script>
<script type="text/javascript">
var remove = document.getElementById('remove');
remove.onclick = function() {
	if (this.rel == 'on') {
		this.innerHTML = 'Return SmartMarkUP Back';
		this.rel = 'off';
		var textarea = SMarkUp.getInstance('html');
		textarea.remove();
	} else {
		this.innerHTML = 'Remove SmartMarkUP';
		this.rel = 'on';
		SMarkUp.bind(
			'html', //textarea id 
			'html', //makup configuration name 
			300		//height of textarea
		);
	}
	return false;
};
</script>

Link to comment
Share on other sites

Nedrīkst būt elementi ar vienādiem id.

Es meiģināju:

<script type="text/javascript" src="smarkup/smarkup.js"></script>
<script type="text/javascript" src="smarkup/conf/html/conf.js"></script>
<p>Teksts:
<textarea name="zina" id="html">
</textarea>
<p>Teksts:
<textarea name="ievads" id="html1"  >
</textarea>

<script type="text/javascript">
       SMarkUp.bind(
               'html', //textarea id 
               'html', //makup configuration name 
               300             //height of textarea
       );
</script>
<script type="text/javascript">
       var remove = document.getElementById('remove');
       remove.onclick = function() {
               if (this.rel == 'on') {
                       this.innerHTML = 'Return SmartMarkUP Back';
                       this.rel = 'off';
                       var textarea = SMarkUp.getInstance('html');
                       textarea.remove();
               } else {
                       this.innerHTML = 'Remove SmartMarkUP';
                       this.rel = 'on';
                       SMarkUp.bind(
                               'html', //textarea id 
                               'html', //makup configuration name 
                               300             //height of textarea
                       );
               }
               return false;
       };
</script>
<script type="text/javascript">
       SMarkUp.bind(
               'html1', //textarea id 
               'html1', //makup configuration name 
               300             //height of textarea
       );
</script>
<script type="text/javascript">
       var remove = document.getElementById('remove');
       remove.onclick = function() {
               if (this.rel == 'on') {
                       this.innerHTML = 'Return SmartMarkUP Back';
                       this.rel = 'off';
                       var textarea = SMarkUp.getInstance('html1');
                       textarea.remove();
               } else {
                       this.innerHTML = 'Remove SmartMarkUP';
                       this.rel = 'on';
                       SMarkUp.bind(
                               'html1', //textarea id 
                               'html1', //makup configuration name 
                               300             //height of textarea
                       );
               }
               return false;
       };
</script>


Bet tikuntā otram textaream neradas dizains

Edited by zintis8789
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...