Implemented selection of macro code on click

This commit is contained in:
Tobi Schäfer 2012-04-21 14:55:15 +00:00
parent c321c837d0
commit 8e0e494d9a
3 changed files with 30 additions and 3 deletions

View file

@ -476,11 +476,13 @@ HopObject.prototype.upload_macro = function(param, name) {
HopObject.prototype.macro_macro = function(param, handler) {
var ctor = this.constructor;
if ([Story, Image, File, Poll].indexOf(ctor) > -1) {
res.write('<span class="macro-code">');
res.encode("<% ");
res.write(handler || ctor.name.toLowerCase());
res.write(String.SPACE);
res.write(quote(this.name || this._id));
res.encode(" %>");
res.write('</span>');
}
return;
}

View file

@ -64,10 +64,11 @@ $(function() {
<% listItemFlag <% gettext custom %> %>
%>
<td class="small">
<div class="ample"><strong><% gettext Macro suffix=: %></strong> &lt;%
<div class="ample"><strong><% gettext Macro suffix=: %></strong>
<span class='macro-code'>&lt;%
<% if <% skin.prototype %> is Global then
<% skin.name prefix="skin " %> else
<% skin.name prefix=<% skin.prototype suffix=".skin " | lowercase %> %> %> %&gt;</div>
<% skin.name prefix=<% skin.prototype suffix=".skin " | lowercase %> %> %> %&gt;</span></div>
</td>
<td rowspan="2" width="10" nowrap="nowrap"> </td>
<td valign="bottom" rowspan="2" align="right" class="small">