Template talk:Code: Difference between revisions From Online Manual

Jump to: navigation, search
 
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
Would it be possible to add the [code] stuff in here so we can do select all with a link? Would having it in a div with a height so scrollbars can be shown also be of use?--[[User:Groundup|Groundup]] 14:42, 1 March 2011 (EST)
Would it be possible to add the [code] stuff in here so we can do select all with a link? Would having it in a div with a height so scrollbars can be shown also be of use?--[[User:Groundup|Groundup]] 14:42, 1 March 2011 (EST)


:<s>Yes, it would be possible to do most of that. HOWEVER.</s> In order for it to :
:<s>Yes, it would be possible to do most of that. HOWEVER. In order for it to :
:*work, we need
:*work, we need
:** we need the "select all" javascript in the skin
:** we need the "select all" javascript in the skin
:** we need to change the code put out by {{Tag|code}}. It needs to include the {{Tag|a}} part, since you can't do "onclick" in wikitext.
:** we need to change the code put out by {{Tag|code}}. It needs to include the {{Tag|a}} part, since you can't do "onclick" in wikitext.</s>
:* look good, we will need some skin changes for the <.code> and <.pre> tags.
:* look good, we will need some skin changes for the <.code> and <.pre> tags.
:To see the effect of <.pre> skin changes, Please look at [[User:AngelinaBelle/sandbox]], using the Classic vs. the default skin.  
:To see the effect of <.pre> skin changes, Please look at [http://wiki.simplemachines.org/smf/index.php?title=User:AngelinaBelle/sandbox&direction=prev&oldid=4664] using the Classic vs. the default skin.  
:The problem code is:
:The problem code is:
: <pre><a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></pre>
: <pre><a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></pre>
Line 16: Line 16:
<pre>&lt;/pre&gt;</code></pre>
<pre>&lt;/pre&gt;</code></pre>
--[[Image:Doc writer badge.png|frameless|x11px|link=User:AngelinaBelle]] [[User:AngelinaBelle|AngelinaBelle]] ([[User_talk:AngelinaBelle|talk]]) 11:43, 2 March 2011 (EST)
--[[Image:Doc writer badge.png|frameless|x11px|link=User:AngelinaBelle]] [[User:AngelinaBelle|AngelinaBelle]] ([[User_talk:AngelinaBelle|talk]]) 11:43, 2 March 2011 (EST)
::Looks like emanuele has solved the selectability thing pragmatically -- with javascript. Why didn't I think of that? --[[Image:Doc writer badge.png|frameless|x11px|link=User:AngelinaBelle]] [[User:AngelinaBelle|AngelinaBelle]] ([[User_talk:AngelinaBelle|talk]]) 19:11, 15 April 2011 (EDT)
== The many ways of writing code ==
There is the code template, the code tag, and then pre. We could change the tag, but we'd need to change the template too to make room for inline code.--[[User:Groundup|Groundup]] 14:17, 18 March 2011 (EDT)
:sorted, I think. {{tl|code}} for code blocks, <nowiki><code></nowiki> for inline code. --[[Image:Doc writer badge.png|frameless|x11px|link=User:AngelinaBelle]] [[User:AngelinaBelle|AngelinaBelle]] ([[User_talk:AngelinaBelle|talk]]) 19:13, 15 April 2011 (EDT)

Latest revision as of 23:13, 15 April 2011

Like SMF

Would it be possible to add the [code] stuff in here so we can do select all with a link? Would having it in a div with a height so scrollbars can be shown also be of use?--Groundup 14:42, 1 March 2011 (EST)

Yes, it would be possible to do most of that. HOWEVER. In order for it to :
  • work, we need
    • we need the "select all" javascript in the skin
    • we need to change the code put out by <code></code>. It needs to include the <a></a> part, since you can't do "onclick" in wikitext.
  • look good, we will need some skin changes for the <.code> and <.pre> tags.
To see the effect of <.pre> skin changes, Please look at [1] using the Classic vs. the default skin.
The problem code is:
<a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a>
The new code for <code></code> could be:
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">
[Select]</a></div>    <code class="codebody"><pre>
</pre></code>

--Doc writer badge.png AngelinaBelle (talk) 11:43, 2 March 2011 (EST)

Looks like emanuele has solved the selectability thing pragmatically -- with javascript. Why didn't I think of that? --Doc writer badge.png AngelinaBelle (talk) 19:11, 15 April 2011 (EDT)

The many ways of writing code

There is the code template, the code tag, and then pre. We could change the tag, but we'd need to change the template too to make room for inline code.--Groundup 14:17, 18 March 2011 (EDT)

sorted, I think. {{code}} for code blocks, <code> for inline code. --Doc writer badge.png AngelinaBelle (talk) 19:13, 15 April 2011 (EDT)


Advertisement: