<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>svebee (English) &#187; own buttons</title>
	<atom:link href="http://en.svebee.com/tag/own-buttons/feed" rel="self" type="application/rss+xml" />
	<link>http://en.svebee.com</link>
	<description>Something about everything...</description>
	<lastBuildDate>Tue, 02 Jun 2009 14:05:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Own buttons (HTML view &#8211; Wordpress)</title>
		<link>http://en.svebee.com/50/own-buttons-html-view-wordpress</link>
		<comments>http://en.svebee.com/50/own-buttons-html-view-wordpress#comments</comments>
		<pubDate>Sun, 03 May 2009 14:50:15 +0000</pubDate>
		<dc:creator>svebee</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[html view]]></category>
		<category><![CDATA[own buttons]]></category>
		<category><![CDATA[own taggs]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://en.svebee.com/?p=50</guid>
		<description><![CDATA[As I have little &#8220;break-in“ to my web-page/blog, certain posts are really big/long and they require many different, personal (own) tags. This relates, for example, to Titles (which have a dashed line at top and bottom and a bigger font), pictures, lists, font colour and similar. From the beginning of my web-site I have tried [...]]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 5px" src="http://www.svebee.com/images/vlastiti_gumbi_html-pogled_wordpress.jpg" alt="Vlastiti gumbi (HTML pogled - Wordpress)" align="left" />As I have little &#8220;break-in“ to my web-page/blog, certain posts are really big/long and they require many different, personal (own) tags. This relates, for example, to <strong>Titles </strong>(which have a dashed line at top and bottom and a bigger font), <strong>pictures</strong>, <strong>lists</strong>, <strong>font colour</strong> and similar. From the beginning of my web-site I have tried to be precise and pedantic (as befits my general manner, maybe a little excessively :)) and all my posts are written <strong>&#8220;by hand“</strong> in HTM view in Wordpress. What do I mean &#8220;by hand“? For example, if I want to add a picture to my post, I must add the following code and change it&#8217;s picture location, for each and every single picture, particulary.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>p style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text-align: center&quot;</span><span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.svebee.com/images/phpmysql_2/original/15.jpg&quot;</span><span style="color: #339933;">&gt;&lt;</span>img style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;margin: 5px&quot;</span> src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.svebee.com/images/phpmysql_2/15_thumb.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;PHP &amp; MySQL vodič - osnove&quot;</span> <span style="color: #339933;">/&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>p<span style="color: #339933;">&gt;</span></pre></div></div>

<p>This is one of the Titles in PHP guide.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>a name<span style="color: #339933;">=</span>skupovi_znakova_strings<span style="color: #339933;">&gt;&lt;</span>p style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;font-size: 1.5em; border-top:1px dashed black; border-bottom:1px dashed black&quot;</span><span style="color: #339933;">&gt;</span>Skupovi znakova <span style="color: #009900;">&#40;</span>eng<span style="color: #339933;">.</span> strings<span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> <span style="color: #339933;">&lt;</span>strong<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;&lt;</span>font color<span style="color: #339933;">=</span>blue<span style="color: #339933;">&gt;</span>strings<span style="color: #339933;">.</span>php<span style="color: #339933;">&lt;/</span>font<span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>strong<span style="color: #339933;">&gt;&lt;/</span>p<span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;</span></pre></div></div>

<p><span id="more-50"></span></p>
<p>And so on, they are long and they require very much patience and I need them, for the &#8220;unique“ look of my website, to all be in the <strong>same style</strong>, all titles are the <strong>identical</strong>, all commands are <strong>equal</strong>, the <strong>same colour</strong> and so on. If you write in <strong>&#8220;Visual&#8221;</strong> layout, Wordpress will automatically add many codse for nothing. Also, I like to have everything under &#8220;my control“ so I can directly edit every part of my post, font colour or some picture description. The advantage of this is, as I have said, precise control of and <strong>valid web-pages</strong> (with the presumption you know how to write valid HTML/CSS code).</p>
<p>The disadvantage of this way, is that the <strong>time </strong>taken to write every single post is <strong>very long</strong>. As I wanted to speed it up a little bit, I have copied all the more important tags into one <em>.txt</em> document at my Desktop, so I could easily copy/paste it into my posts, and then I just change my Title, picture location/descirption and similar. However, that was also a little too slow because of constant &#8220;jumping“ from one window to another, selecting, copying and so on. I was looking for some solution, so I could add <strong>my own buttons</strong> in HTML view in Wordpress, for example, the Title open/start tag would be:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>a name<span style="color: #339933;">=</span>anchor<span style="color: #339933;">&gt;&lt;</span>p style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;font-size: 1.5em; border-top:1px dashed black; border-bottom:1px dashed black&quot;</span><span style="color: #339933;">&gt;</span></pre></div></div>

<p>and end/closed tag would be:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;</span></pre></div></div>

<p>just like this, for example, <strong>bold</strong>, <em>italic </em>tag and similar which are built-into Wordpress. After a little searching (with Google, of course), I have <strong><a href="http://www.projectwebdesign.com/custom-buttons-to-wordpress-post-editor">found it</a></strong>. You need to edit a <em>JavaScript </em>file in <em>wp-includes/js/quicktags.js</em> and copy the 7 lines of code for &#8220;add your own button&#8221;. Since there are already some buttons, it&#8217;s enough to copy them and adapt them for your own needs, they&#8217;ll be automatically added in HTML layout in Wordpress. So we have:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">edButtons<span style="color: #009900;">&#91;</span>edButtons<span style="color: #339933;">.</span>length<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span>
<span style="color: #000000; font-weight: bold;">new</span> edButton<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ed_code'</span>
<span style="color: #339933;">,</span><span style="color: #0000ff;">'code'</span>
<span style="color: #339933;">,</span><span style="color: #0000ff;">'&lt;code&gt;'</span>
<span style="color: #339933;">,</span><span style="color: #0000ff;">'&lt;/code&gt;'</span>
<span style="color: #339933;">,</span><span style="color: #0000ff;">'c'</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>We copy the following part, and paste it underneath and change it to suit your own needs.<br />
<strong>Line 1</strong> and <strong>2</strong>, leave as they are, you can just change extension after &#8220;ed_“ in something meaingful, for example for &#8220;spoiler alert“ I put just &#8220;spoiler“.<br />
<strong>Line 3</strong> is the name of that button – what will write in HTML view in Wordpress on it.<br />
<strong>Line 4</strong> is start tag (open tag).<br />
<strong>Line 5</strong> is end tag (closed tag).<br />
<strong>Line 6</strong> you can adjust for your own convenience, for example, beginning letter of the tag.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">edButtons<span style="color: #009900;">&#91;</span>edButtons<span style="color: #339933;">.</span>length<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span>
<span style="color: #000000; font-weight: bold;">new</span> edButton<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ed_spoiler'</span>
<span style="color: #339933;">,</span><span style="color: #0000ff;">'spoiler'</span>
<span style="color: #339933;">,</span><span style="color: #0000ff;">'[spoiler name=&quot;&quot;]'</span>
<span style="color: #339933;">,</span><span style="color: #0000ff;">'[/spoiler]'</span>
<span style="color: #339933;">,</span><span style="color: #0000ff;">'sp'</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>The code, which I put, is my button for insert a <em>&#8220;spoiler alert&#8221;</em> (a spoiler is the content which mustn&#8217;t be seen at first view, for example, the end of some movie/game) in my post, I select my text and press my button named &#8220;spoiler“ and then the tags are automatically added around it (the text).</p>
]]></content:encoded>
			<wfw:commentRss>http://en.svebee.com/50/own-buttons-html-view-wordpress/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
