* Fixed and finalized Layout.reset_action() as well as Layout.remove() and Skin.remove() methods
* Completely render skin outline and drop down menu from application directory * Moved remaining skins into protected (ie. non-customizable) skin files * Removed obsolete skin files * Removed obsolete code
This commit is contained in:
parent
dff39778a6
commit
75ff272950
9 changed files with 232 additions and 461 deletions
|
@ -534,3 +534,27 @@ default front page.</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<%
|
||||||
|
////////////////////// Notification skins
|
||||||
|
%>
|
||||||
|
|
||||||
|
<% #block %>
|
||||||
|
(You're receiving this mail because you are Administrator of <% param.site %>).
|
||||||
|
|
||||||
|
<% param.site %> (<% param.url %>) has been private for more than <% param.privatetime %> days. Due to policy reasons your site will be blocked in <% param.daysleft %> days if you keep it private. This does *not* mean that your site will be removed, but neither you nor other members of it will have access to <% param.site %> unless one of the system administrators decides to unblock your site.
|
||||||
|
|
||||||
|
So please either change the preferences of your site (select the checkbox "public") or send a mail to <% param.contact %> containing reasons why your site should stay private.
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
<% root.title %> - <% root.url %>
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
<& #delete %>
|
||||||
|
(You're receiving this mail because you are Administrator of <% param.site %>).
|
||||||
|
|
||||||
|
<% param.site %> (<% param.url %>) was inactive for more than <% param.inactivity %> days. You have <% param.daysleft %> days time to reactivate your site, otherwise it will be deleted. Please note that the removal of <% param.site %> is an irreversible process!
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
<% root.title %> - <% root.url %>
|
||||||
|
---------------------------------------
|
|
@ -540,12 +540,12 @@ Admin.prototype.deleteInactiveSites = function() {
|
||||||
if (site.trusted)
|
if (site.trusted)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var idleFor = new Date() - site.lastupdate;
|
var idleFor = new Date() - site.modified;
|
||||||
var timeSinceWarning = new Date() - site.lastdelwarn;
|
var timeSinceWarning = new Date() - site.lastdelwarn;
|
||||||
if (idleFor >= warnThreshold) {
|
if (idleFor >= warnThreshold) {
|
||||||
// check if site-admins have been warned already
|
// check if site-admins have been warned already
|
||||||
var alreadyWarned = false;
|
var alreadyWarned = false;
|
||||||
if (site.lastdelwarn > site.lastupdate)
|
if (site.lastdelwarn > site.modified)
|
||||||
alreadyWarned = true;
|
alreadyWarned = true;
|
||||||
// check whether warn admins or block site
|
// check whether warn admins or block site
|
||||||
if (!alreadyWarned) {
|
if (!alreadyWarned) {
|
||||||
|
|
|
@ -32,7 +32,6 @@ sites.accessname = name
|
||||||
sites.order = created desc
|
sites.order = created desc
|
||||||
|
|
||||||
privateSites = collection(Site)
|
privateSites = collection(Site)
|
||||||
#privateSites.order = SITE_LASTOFFLINE asc
|
|
||||||
privateSites.filter = mode = 'private' and status <> 'blocked'
|
privateSites.filter = mode = 'private' and status <> 'blocked'
|
||||||
|
|
||||||
users = collection(User)
|
users = collection(User)
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
<% #block %>
|
|
||||||
(You're receiving this mail because you are Administrator of <% param.site %>).
|
|
||||||
|
|
||||||
<% param.site %> (<% param.url %>) has been private for more than <% param.privatetime %> days. Due to policy reasons your site will be blocked in <% param.daysleft %> days if you keep it private. This does *not* mean that your site will be removed, but neither you nor other members of it will have access to <% param.site %> unless one of the system administrators decides to unblock your site.
|
|
||||||
|
|
||||||
So please either change the preferences of your site (select the checkbox "public") or send a mail to <% param.contact %> containing reasons why your site should stay private.
|
|
||||||
|
|
||||||
---------------------------------------
|
|
||||||
<% root.title %> - <% root.url %>
|
|
||||||
---------------------------------------
|
|
||||||
|
|
||||||
<& #delete %>
|
|
||||||
(You're receiving this mail because you are Administrator of <% param.site %>).
|
|
||||||
|
|
||||||
<% param.site %> (<% param.url %>) was inactive for more than <% param.inactivity %> days. You have <% param.daysleft %> days time to reactivate your site, otherwise it will be deleted. Please note that the removal of <% param.site %> is an irreversible process!
|
|
||||||
|
|
||||||
---------------------------------------
|
|
||||||
<% root.title %> - <% root.url %>
|
|
||||||
---------------------------------------
|
|
|
@ -22,6 +22,32 @@
|
||||||
// $URL$
|
// $URL$
|
||||||
//
|
//
|
||||||
|
|
||||||
|
Layout.VALUES = [
|
||||||
|
"background color",
|
||||||
|
"link color",
|
||||||
|
"active link color",
|
||||||
|
"visited link color",
|
||||||
|
"big font",
|
||||||
|
"big font size",
|
||||||
|
"big font color",
|
||||||
|
"base font",
|
||||||
|
"base font size",
|
||||||
|
"base font color",
|
||||||
|
"small font",
|
||||||
|
"small font size",
|
||||||
|
"small font color"
|
||||||
|
];
|
||||||
|
|
||||||
|
Layout.remove = function(layout) {
|
||||||
|
layout || (layout = this);
|
||||||
|
if (layout.constructor === Layout) {
|
||||||
|
Skins.remove.call(layout.skins);
|
||||||
|
Images.remove.call(layout.images);
|
||||||
|
layout.getFile().removeDirectory();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Layout.getModes = defineConstants(Layout, "default", "shared");
|
Layout.getModes = defineConstants(Layout, "default", "shared");
|
||||||
|
|
||||||
this.handleMetadata("title");
|
this.handleMetadata("title");
|
||||||
|
@ -118,18 +144,22 @@ Layout.prototype.update = function(data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout.remove = function() {
|
|
||||||
Skins.remove.call(this.skins);
|
|
||||||
this.getFile().removeDirectory();
|
|
||||||
Images.remove.call(this.images);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Layout.prototype.reset_action = function() {
|
Layout.prototype.reset_action = function() {
|
||||||
if (req.postParams.proceed) {
|
if (req.data.proceed) {
|
||||||
try {
|
try {
|
||||||
Skins.remove.call(this.skins);
|
Layout.remove.call(this);
|
||||||
this.getFile().removeDirectory();
|
var skinFiles = app.getSkinfilesInPath(res.skinpath);
|
||||||
|
var content, file;
|
||||||
|
for (var name in skinFiles) {
|
||||||
|
if (content = skinFiles[name][name]) {
|
||||||
|
var dir = this.getFile(name);
|
||||||
|
var file = new helma.File(dir, name + ".skin");
|
||||||
|
dir.makeDirectory();
|
||||||
|
file.open();
|
||||||
|
file.write(content);
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
res.message = gettext("The layout was successfully reset.");
|
res.message = gettext("The layout was successfully reset.");
|
||||||
res.redirect(this.href());
|
res.redirect(this.href());
|
||||||
} catch(ex) {
|
} catch(ex) {
|
||||||
|
@ -207,42 +237,8 @@ Layout.prototype.import_action = function() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout.prototype.getMacroHandler = function(name) {
|
Layout.prototype.getTitle = function() {
|
||||||
switch (name) {
|
return "Layout";
|
||||||
case "skins":
|
|
||||||
return this[name];
|
|
||||||
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Layout.prototype.image_macro = function(param, name, mode) {
|
|
||||||
name || (name = param.name);
|
|
||||||
if (!name) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var image = this.getImage(name, param.fallback);
|
|
||||||
if (!image) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mode || (mode = param.as);
|
|
||||||
var action = param.linkto;
|
|
||||||
delete(param.name);
|
|
||||||
delete(param.as);
|
|
||||||
delete(param.linkto);
|
|
||||||
|
|
||||||
switch (mode) {
|
|
||||||
case "url" :
|
|
||||||
return res.write(image.getUrl());
|
|
||||||
case "thumbnail" :
|
|
||||||
action || (action = image.getUrl());
|
|
||||||
return image.thumbnail_macro(param);
|
|
||||||
}
|
|
||||||
image.render_macro(param);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout.prototype.getImage = function(name, fallback) {
|
Layout.prototype.getImage = function(name, fallback) {
|
||||||
|
@ -269,14 +265,9 @@ Layout.prototype.getSkinPath = function() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
var skinPath = [this.getFile().toString()];
|
var skinPath = [this.getFile().toString()];
|
||||||
//this.parent && (skinPath.push(this.parent.getFile().toString()));
|
|
||||||
return skinPath;
|
return skinPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout.prototype.getTitle = function() {
|
|
||||||
return "Layout";
|
|
||||||
}
|
|
||||||
|
|
||||||
Layout.prototype.getArchive = function(skinpath) {
|
Layout.prototype.getArchive = function(skinpath) {
|
||||||
var zip = new helma.Zip();
|
var zip = new helma.Zip();
|
||||||
for each (var fpath in skinpath) {
|
for each (var fpath in skinpath) {
|
||||||
|
@ -316,15 +307,46 @@ Layout.prototype.getArchive = function(skinpath) {
|
||||||
return zip;
|
return zip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Layout.prototype.getMacroHandler = function(name) {
|
||||||
|
switch (name) {
|
||||||
|
case "skins":
|
||||||
|
return this[name];
|
||||||
|
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Layout.prototype.image_macro = function(param, name, mode) {
|
||||||
|
name || (name = param.name);
|
||||||
|
if (!name) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var image = this.getImage(name, param.fallback);
|
||||||
|
if (!image) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mode || (mode = param.as);
|
||||||
|
var action = param.linkto;
|
||||||
|
delete(param.name);
|
||||||
|
delete(param.as);
|
||||||
|
delete(param.linkto);
|
||||||
|
|
||||||
|
switch (mode) {
|
||||||
|
case "url" :
|
||||||
|
return res.write(image.getUrl());
|
||||||
|
case "thumbnail" :
|
||||||
|
action || (action = image.getUrl());
|
||||||
|
return image.thumbnail_macro(param);
|
||||||
|
}
|
||||||
|
image.render_macro(param);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Layout.prototype.values_macro = function() {
|
Layout.prototype.values_macro = function() {
|
||||||
/* FIXME: should be enough to render res.meta.values in HopObject.onRequest
|
|
||||||
res.push();
|
|
||||||
var skin = new Skin("Site", "values");
|
|
||||||
skin.render();
|
|
||||||
res.pop();
|
|
||||||
*/
|
|
||||||
var values = [];
|
var values = [];
|
||||||
//for each (var key in Layout.VALUES) {
|
|
||||||
for (var key in res.meta.values) {
|
for (var key in res.meta.values) {
|
||||||
values.push({key: key, value: res.meta.values[key]});
|
values.push({key: key, value: res.meta.values[key]});
|
||||||
}
|
}
|
||||||
|
@ -337,19 +359,3 @@ Layout.prototype.values_macro = function() {
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout.VALUES = [
|
|
||||||
"background color",
|
|
||||||
"link color",
|
|
||||||
"active link color",
|
|
||||||
"visited link color",
|
|
||||||
"big font",
|
|
||||||
"big font size",
|
|
||||||
"big font color",
|
|
||||||
"base font",
|
|
||||||
"base font size",
|
|
||||||
"base font color",
|
|
||||||
"small font",
|
|
||||||
"small font size",
|
|
||||||
"small font color"
|
|
||||||
]
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<p class="storyTitle"><% response.title %></p>
|
<p class="storyTitle"><% response.title %></p>
|
||||||
<% response.message prefix='<div class="message">' suffix="</div>" %>
|
<% response.message prefix='<div class="message">' suffix="</div>" %>
|
||||||
<form method="post" action="<% response.action %>">
|
<form method="post" action="<% response.action %>">
|
||||||
<% if <% skin.name %> is null then
|
<% if <% skin.name %> is "" then
|
||||||
<% skin.select prototype prefix=<% gettext Prototype suffix=": " %>
|
<% skin.select prototype prefix=<% gettext Prototype suffix=": " %>
|
||||||
suffix=<% skin.input name prefix=<% gettext Name suffix=": " %> %> %>
|
suffix=<% skin.input name prefix=<% gettext Name suffix=": " %> %> %>
|
||||||
else
|
else
|
||||||
|
@ -12,7 +12,7 @@ else
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top" nowrap="nowrap">
|
<td valign="top" nowrap="nowrap">
|
||||||
<textarea name="source" cols="50" rows="23" wrap="virtual"
|
<textarea name="source" cols="50" rows="23" wrap="virtual"
|
||||||
class="formWide"><% skin.source encoding="form" %></textarea>
|
class="formWide"><% skin.content encoding="form" %></textarea>
|
||||||
<p>
|
<p>
|
||||||
<button type="submit" name="save" value="2">
|
<button type="submit" name="save" value="2">
|
||||||
<% gettext "Save and close" %>
|
<% gettext "Save and close" %>
|
||||||
|
@ -28,7 +28,7 @@ else
|
||||||
<% #listItem %>
|
<% #listItem %>
|
||||||
<li>
|
<li>
|
||||||
<% skin.link edit <% skin.name prefix=<% skin.prototype suffix="." %> %> %>
|
<% skin.link edit <% skin.name prefix=<% skin.prototype suffix="." %> %> %>
|
||||||
<% if <% skin.status %> is modified then
|
<% if <% skin.created %> is null then "" else
|
||||||
<% skin.skin $Skin#status prefix="<div>" suffix="</div>" %>
|
<% skin.skin $Skin#status prefix="<div>" suffix="</div>" %>
|
||||||
%>
|
%>
|
||||||
<% // skin.summary prefix="<div>" suffix="</div>" %>
|
<% // skin.summary prefix="<div>" suffix="</div>" %>
|
||||||
|
@ -36,11 +36,9 @@ else
|
||||||
|
|
||||||
<% #status %>
|
<% #status %>
|
||||||
<span class="small">
|
<span class="small">
|
||||||
(<% gettext "Modified by {0}" <% skin.creator %> %><% if <% skin.custom %> is false then
|
(<% gettext "Modified by {0}" <% skin.creator %> %>
|
||||||
<% skin.link compare prefix=" ... " suffix=<% skin.link reset prefix=" ... " %> %>
|
<% skin.link compare prefix=" ... " %>
|
||||||
else
|
<% skin.link reset prefix=" ... " %>)<br />
|
||||||
<% skin.link restore prefix=" ... " %>
|
|
||||||
%>)<br />
|
|
||||||
<strong><% gettext Macro suffix=: %></strong>
|
<strong><% gettext Macro suffix=: %></strong>
|
||||||
<% <% skin.prototype suffix="." | lowercase %>skin <% skin.name %> %>
|
<% <% skin.prototype suffix="." | lowercase %>skin <% skin.name %> %>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -21,17 +21,42 @@
|
||||||
// $URL$
|
// $URL$
|
||||||
//
|
//
|
||||||
|
|
||||||
Skin.CUSTOMIZABLE_PROTOTYPES = ["Archive", "Choice", "Comment", "File",
|
Skin.remove = function(skin) {
|
||||||
"Global", "Image", "Membership", "Poll", "Site", "Story", "Tag"];
|
skin || (skin = this);
|
||||||
|
if (skin.constructor === Skin) {
|
||||||
|
if (skin.source) {
|
||||||
|
skin.setSource(skin.source);
|
||||||
|
}
|
||||||
|
skin.source = null;
|
||||||
|
skin.remove();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Skin.getPrototypeOptions = function() {
|
||||||
|
var prototypes = [];
|
||||||
|
var content, file;
|
||||||
|
var skinFiles = app.getSkinfilesInPath(res.skinpath);
|
||||||
|
for (var name in skinFiles) {
|
||||||
|
if (skinFiles[name][name]) {
|
||||||
|
prototypes.push({value: name, display: name});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return prototypes.sort(new String.Sorter("display"));
|
||||||
|
}
|
||||||
|
|
||||||
Skin.prototype.constructor = function(prototype, name) {
|
Skin.prototype.constructor = function(prototype, name) {
|
||||||
this.prototype = prototype;
|
this.prototype = prototype || String.EMPTY;
|
||||||
this.name = name;
|
this.name = name || String.EMPTY;
|
||||||
this.creator = this.modifier = session.user;
|
this.creator = this.modifier = session.user;
|
||||||
this.created = this.modified = new Date;
|
this.created = this.modified = new Date;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Skin.prototype.getPermission = function(action) {
|
||||||
|
return res.handlers.skins.getPermission("main");
|
||||||
|
}
|
||||||
|
|
||||||
Skin.prototype.href = function(action) {
|
Skin.prototype.href = function(action) {
|
||||||
res.push();
|
res.push();
|
||||||
res.write(res.handlers.layout.skins.href());
|
res.write(res.handlers.layout.skins.href());
|
||||||
|
@ -43,10 +68,6 @@ Skin.prototype.href = function(action) {
|
||||||
return res.pop();
|
return res.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
Skin.prototype.getPermission = function(action) {
|
|
||||||
return res.handlers.skins.getPermission("main");
|
|
||||||
}
|
|
||||||
|
|
||||||
Skin.prototype.main_action = function() {
|
Skin.prototype.main_action = function() {
|
||||||
return res.redirect(this.href("edit"));
|
return res.redirect(this.href("edit"));
|
||||||
}
|
}
|
||||||
|
@ -56,15 +77,6 @@ Skin.prototype.edit_action = function() {
|
||||||
try {
|
try {
|
||||||
var url = this.href(req.action);
|
var url = this.href(req.action);
|
||||||
this.update(req.postParams);
|
this.update(req.postParams);
|
||||||
/*
|
|
||||||
// FIXME:
|
|
||||||
if (false && this.equals(req.postParams.source)) {
|
|
||||||
Skin.remove.call(this);
|
|
||||||
url = Skins.getRedirectUrl(req.postParams);
|
|
||||||
} else {
|
|
||||||
this.setSource(req.postParams.source);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
res.message = gettext("The changes were saved successfully.");
|
res.message = gettext("The changes were saved successfully.");
|
||||||
if (req.postParams.save == 1) {
|
if (req.postParams.save == 1) {
|
||||||
res.redirect(url);
|
res.redirect(url);
|
||||||
|
@ -84,48 +96,22 @@ Skin.prototype.edit_action = function() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Skin.prototype.getFormOptions = function(name) {
|
|
||||||
switch (name) {
|
|
||||||
case "prototype":
|
|
||||||
return Skin.getPrototypeOptions();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Skin.getPrototypeOptions = function() {
|
|
||||||
var prototypes = [];
|
|
||||||
for each (var name in Skin.CUSTOMIZABLE_PROTOTYPES) {
|
|
||||||
prototypes.push({value: name, display: name});
|
|
||||||
}
|
|
||||||
return prototypes.sort(new String.Sorter("display"));
|
|
||||||
}
|
|
||||||
|
|
||||||
Skin.prototype.update = function(data) {
|
Skin.prototype.update = function(data) {
|
||||||
if (this.isTransient()) {
|
if (this.isTransient()) {
|
||||||
this.source = this.getSource();
|
|
||||||
res.handlers.layout.skins.add(this);
|
res.handlers.layout.skins.add(this);
|
||||||
|
this.source = this.getSource();
|
||||||
}
|
}
|
||||||
this.setSource(data.source);
|
this.setSource(data.source);
|
||||||
this.touch();
|
this.touch();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Skin.remove = function() {
|
|
||||||
if (this.source) {
|
|
||||||
this.setSource(this.source);
|
|
||||||
delete this.source;
|
|
||||||
} else {
|
|
||||||
this.setSource();
|
|
||||||
}
|
|
||||||
this.remove();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Skin.prototype.reset_action = function() {
|
Skin.prototype.reset_action = function() {
|
||||||
if (req.postParams.proceed) {
|
if (req.postParams.proceed) {
|
||||||
try {
|
try {
|
||||||
var str = this.toString();
|
var str = this.toString();
|
||||||
this.setSource(this.source);
|
res.debug(this.source);
|
||||||
this.remove();
|
Skin.remove(this);
|
||||||
res.message = gettext("{0} was successfully reset.", str);
|
res.message = gettext("{0} was successfully reset.", str);
|
||||||
res.redirect(res.handlers.layout.skins.href("modified"));
|
res.redirect(res.handlers.layout.skins.href("modified"));
|
||||||
} catch(ex) {
|
} catch(ex) {
|
||||||
|
@ -139,53 +125,47 @@ Skin.prototype.reset_action = function() {
|
||||||
res.data.body = this.renderSkinAsString("$HopObject#confirm", {
|
res.data.body = this.renderSkinAsString("$HopObject#confirm", {
|
||||||
text: gettext('You are about to reset {0}.', this)
|
text: gettext('You are about to reset {0}.', this)
|
||||||
});
|
});
|
||||||
res.handlers.site.renderSkin("Site#page");
|
res.handlers.skins.renderSkin("$Skins#page");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Skin.prototype.compare_action = function() {
|
Skin.prototype.compare_action = function() {
|
||||||
// get the modified and original skins
|
var originalSkin = this.source || "";
|
||||||
var originalSkin = this.source;
|
var diff = originalSkin.diff(this.getSource());
|
||||||
|
if (!diff) {
|
||||||
if (!originalSkin) {
|
res.data.status = gettext("No differences were found");
|
||||||
res.data.status = gettext("This is a custom skin, therefor no differences can be displayed");
|
|
||||||
} else {
|
} else {
|
||||||
var diff = originalSkin.diff(this.getSource());
|
res.push();
|
||||||
if (!diff) {
|
var sp = new Object();
|
||||||
res.data.status = gettext("No differences were found");
|
for (var i in diff) {
|
||||||
} else {
|
var line = diff[i];
|
||||||
res.push();
|
sp.num = line.num;
|
||||||
var sp = new Object();
|
if (line.deleted) {
|
||||||
for (var i in diff) {
|
sp.status = "DEL";
|
||||||
var line = diff[i];
|
sp["class"] = "removed";
|
||||||
sp.num = line.num;
|
for (var j=0;j<line.deleted.length;j++) {
|
||||||
if (line.deleted) {
|
sp.num = line.num + j;
|
||||||
sp.status = "DEL";
|
sp.line = encode(line.deleted[j]);
|
||||||
sp["class"] = "removed";
|
|
||||||
for (var j=0;j<line.deleted.length;j++) {
|
|
||||||
sp.num = line.num + j;
|
|
||||||
sp.line = encode(line.deleted[j]);
|
|
||||||
this.renderSkin("$Skin#difference", sp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (line.inserted) {
|
|
||||||
sp.status = "ADD";
|
|
||||||
sp["class"] = "added";
|
|
||||||
for (var j=0;j<line.inserted.length;j++) {
|
|
||||||
sp.num = line.num + j;
|
|
||||||
sp.line = encode(line.inserted[j]);
|
|
||||||
this.renderSkin("$Skin#difference", sp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (line.value != null) {
|
|
||||||
sp.status = " ";
|
|
||||||
sp["class"] = "line";
|
|
||||||
sp.line = encode(line.value);
|
|
||||||
this.renderSkin("$Skin#difference", sp);
|
this.renderSkin("$Skin#difference", sp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
res.data.diff = res.pop();
|
if (line.inserted) {
|
||||||
|
sp.status = "ADD";
|
||||||
|
sp["class"] = "added";
|
||||||
|
for (var j=0;j<line.inserted.length;j++) {
|
||||||
|
sp.num = line.num + j;
|
||||||
|
sp.line = encode(line.inserted[j]);
|
||||||
|
this.renderSkin("$Skin#difference", sp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (line.value != null) {
|
||||||
|
sp.status = " ";
|
||||||
|
sp["class"] = "line";
|
||||||
|
sp.line = encode(line.value);
|
||||||
|
this.renderSkin("$Skin#difference", sp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
res.data.diff = res.pop();
|
||||||
}
|
}
|
||||||
res.data.title = gettext("Compare versions of skin {0}.{1}",
|
res.data.title = gettext("Compare versions of skin {0}.{1}",
|
||||||
this.prototype, this.name);
|
this.prototype, this.name);
|
||||||
|
@ -194,32 +174,25 @@ Skin.prototype.compare_action = function() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Skin.prototype.status_macro = function() {
|
Skin.prototype.getFormOptions = function(name) {
|
||||||
return this.isTransient() ? "inherited" : "modified";
|
switch (name) {
|
||||||
}
|
case "prototype":
|
||||||
|
return Skin.getPrototypeOptions();
|
||||||
Skin.prototype.summary_macro = function() {
|
}
|
||||||
return Skins.getSummary("skin", this.prototype, this.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
Skin.prototype.source_macro = function() {
|
|
||||||
return res.write(this.getSource());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Skin.prototype.getSource = function() {
|
Skin.prototype.getSource = function() {
|
||||||
var skinFiles = app.getSkinfilesInPath(res.skinpath)[this.prototype];
|
var skinSet = app.getSkinfilesInPath(res.skinpath)[this.prototype];
|
||||||
if (!skinFiles) {
|
if (skinSet) {
|
||||||
return String.EMPTY;
|
var mainSkin = skinSet[this.prototype];
|
||||||
|
if (mainSkin) {
|
||||||
|
var skin = createSkin(mainSkin).getSubskin(this.name);
|
||||||
|
if (skin) {
|
||||||
|
return skin.getSource();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
var source = skinFiles[this.name];
|
return null; //String.EMPTY;
|
||||||
if (!source) {
|
|
||||||
// FIXME: Strange, the subskin can be rendered but it's not found
|
|
||||||
// in app.getSkinFilesInPath() ...
|
|
||||||
//global[this.prototype].prototype.renderSkin(this.prototype + "#" + this.name);
|
|
||||||
skin = createSkin(skinFiles[this.prototype]).getSubskin(this.name);
|
|
||||||
source = skin && skin.getSource();
|
|
||||||
}
|
|
||||||
return source || String.EMPTY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Skin.prototype.setSource = function(source) {
|
Skin.prototype.setSource = function(source) {
|
||||||
|
@ -272,11 +245,6 @@ Skin.prototype.getMainSkin = function() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Skin.prototype.custom_macro = function() {
|
|
||||||
// FIXME:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Skin.prototype.render = function() {
|
Skin.prototype.render = function() {
|
||||||
return renderSkin(createSkin(this.getSource()));
|
return renderSkin(createSkin(this.getSource()));
|
||||||
}
|
}
|
||||||
|
@ -293,3 +261,11 @@ Skin.prototype.equals = function(source) {
|
||||||
Skin.prototype.toString = function() {
|
Skin.prototype.toString = function() {
|
||||||
return "Skin #" + this._id + ": " + this.prototype + "." + this.name;
|
return "Skin #" + this._id + ": " + this.prototype + "." + this.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Skin.prototype.status_macro = function() {
|
||||||
|
return this.isTransient() ? "inherited" : "modified";
|
||||||
|
}
|
||||||
|
|
||||||
|
Skin.prototype.content_macro = function() {
|
||||||
|
return res.write(this.getSource());
|
||||||
|
}
|
||||||
|
|
|
@ -34,34 +34,18 @@ Skins.prototype.getPermission = function(action) {
|
||||||
|
|
||||||
Skins.prototype.getChildElement = function(name) {
|
Skins.prototype.getChildElement = function(name) {
|
||||||
if (this.parent) {
|
if (this.parent) {
|
||||||
var groupName = path[path.length - 1].name;
|
var group = path[path.length - 1].name;
|
||||||
var group = this.parent.get(groupName);
|
var skin = this.getSkin(group, name);
|
||||||
if (group) {
|
if (skin) {
|
||||||
var skin = group.get(name);
|
return skin;
|
||||||
if (skin) {
|
|
||||||
return skin;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (global[groupName] || groupName === "Global") {
|
if (global[group] || group === "Global") {
|
||||||
return new Skin(groupName, name);
|
return this.getSkin(group, name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new Skins(name, this);
|
return new Skins(name, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: It's not totally clear why this is necessary;
|
|
||||||
// but somehow Helma does not provide the correct path...
|
|
||||||
// FIXME 2: Probably obsolete thanks to a custom Layout.href() method
|
|
||||||
/*
|
|
||||||
Skins.prototype.href = function(action) {
|
|
||||||
res.push();
|
|
||||||
res.write(res.handlers.site.href());
|
|
||||||
res.write("layout/skins/");
|
|
||||||
action && (res.write(action));
|
|
||||||
return res.pop();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
Skins.prototype.main_action = function() {
|
Skins.prototype.main_action = function() {
|
||||||
if (!this._parent) {
|
if (!this._parent) {
|
||||||
res.redirect(res.handlers.layout.skins.href());
|
res.redirect(res.handlers.layout.skins.href());
|
||||||
|
@ -112,8 +96,7 @@ Skins.prototype.getOutline = function(type) {
|
||||||
html.closeTag("a");
|
html.closeTag("a");
|
||||||
html.openTag("ul");
|
html.openTag("ul");
|
||||||
for each (var name in skin) {
|
for each (var name in skin) {
|
||||||
subskin = this.getSkin(prototype, name) ||
|
subskin = this.getSkin(prototype, name);
|
||||||
new Skin(prototype, name);
|
|
||||||
subskin.renderSkin("$Skin#listItem");
|
subskin.renderSkin("$Skin#listItem");
|
||||||
}
|
}
|
||||||
html.closeTag("ul");
|
html.closeTag("ul");
|
||||||
|
@ -124,13 +107,13 @@ Skins.prototype.getOutline = function(type) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Skins.prototype.create_action = function() {
|
Skins.prototype.create_action = function() {
|
||||||
var skin = new Skin(req.data.prototype, req.data.name);
|
var skin = this.getSkin(req.postParams.prototype, req.postParams.name);
|
||||||
if (req.postParams.save) {
|
if (req.postParams.save) {
|
||||||
try {
|
try {
|
||||||
if (!skin.equals(req.postParams.source)) {
|
if (!req.postParams.prototype || !req.postParams.name) {
|
||||||
skin.setSource(req.postParams.source);
|
throw Error("Please choose a prototype and enter a skin name");
|
||||||
this.add(skin);
|
|
||||||
}
|
}
|
||||||
|
skin.update(req.postParams);
|
||||||
res.message = gettext("The changes were saved successfully.");
|
res.message = gettext("The changes were saved successfully.");
|
||||||
if (req.postParams.save == 1) {
|
if (req.postParams.save == 1) {
|
||||||
res.redirect(skin.href("edit"));
|
res.redirect(skin.href("edit"));
|
||||||
|
@ -141,14 +124,13 @@ Skins.prototype.create_action = function() {
|
||||||
res.message = ex;
|
res.message = ex;
|
||||||
app.log(ex);
|
app.log(ex);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (skin.getSource()) {
|
||||||
|
res.data.title = gettext("Edit skin {0}.{1} of {2}",
|
||||||
|
skin.prototype, skin.name, res.handlers.site.title);
|
||||||
} else {
|
} else {
|
||||||
if (skin.getSource()) {
|
res.data.title = gettext('Create a custom skin of {0}',
|
||||||
res.data.title = gettext("Edit skin {0}.{1} of {2}",
|
res.handlers.site.title);
|
||||||
skin.prototype, skin.name, res.handlers.site.title);
|
|
||||||
} else {
|
|
||||||
res.data.title = gettext('Create a custom skin of {0}',
|
|
||||||
res.handlers.site.title);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
res.data.action = this.href(req.action);
|
res.data.action = this.href(req.action);
|
||||||
res.data.body = skin.renderSkinAsString("$Skin#edit");
|
res.data.body = skin.renderSkinAsString("$Skin#edit");
|
||||||
|
@ -192,218 +174,23 @@ Skins.prototype.safe_action = function() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Skins.prototype.getSkin = function(prototype, name) {
|
Skins.prototype.getSkin = function(group, name) {
|
||||||
var skinset = this.get(prototype);
|
var skinSet = path.layout.skins.get(group);
|
||||||
return skinset ? skinset.get(name) : null;
|
if (skinSet) {
|
||||||
}
|
var skin = skinSet.get(name);
|
||||||
|
if (skin) {
|
||||||
Skins.prototype.getSkinSource = function(proto, name) {
|
|
||||||
var skin;
|
|
||||||
if (skin = this.getSkin(proto, name)) {
|
|
||||||
return skin.getSource();
|
|
||||||
}
|
|
||||||
if (app.skinfiles[proto]) {
|
|
||||||
return app.skinfiles[proto][name];
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Skins.prototype.getOriginalSkin = function(proto, name) {
|
|
||||||
var skin;
|
|
||||||
var layout = this._parent;
|
|
||||||
while (layout = layout.parent) {
|
|
||||||
if (skin = layout.skins.getSkin(proto, name)) {
|
|
||||||
return skin;
|
return skin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new Skin(group, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
Skins.remove = function(skins) {
|
||||||
|
skins || (skins = this);
|
||||||
|
if (skins.constructor === Skins) {
|
||||||
|
while (skins.size() > 0) {
|
||||||
|
HopObject.remove(skins.get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Skins.prototype.getOriginalSkinSource = function(proto, name) {
|
|
||||||
var skin;
|
|
||||||
if (skin = this.getOriginalSkin(proto, name)) {
|
|
||||||
return skin.getSource();
|
|
||||||
}
|
|
||||||
if (app.skinfiles[proto]) {
|
|
||||||
return app.skinfiles[proto][name];
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Skins.prototype.getCustomSkins = function() {
|
|
||||||
var coll = [];
|
|
||||||
// object to store the already added skin keys
|
|
||||||
// used to avoid duplicate skins in the list
|
|
||||||
var keys = {};
|
|
||||||
|
|
||||||
// private method to add a custom skin
|
|
||||||
var addSkins = function(mgr) {
|
|
||||||
var size = mgr.custom.size();
|
|
||||||
for (var i=0;i<size;i++) {
|
|
||||||
var s = mgr.custom.get(i);
|
|
||||||
var key = s.proto + ":" + s.name;
|
|
||||||
if (!keys[key]) {
|
|
||||||
keys[key] = s;
|
|
||||||
coll.push(s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var handler = this._parent;
|
|
||||||
while (handler) {
|
|
||||||
addSkins(handler.skins);
|
|
||||||
handler = handler.parent;
|
|
||||||
}
|
|
||||||
return coll;
|
|
||||||
}
|
|
||||||
|
|
||||||
Skins.getSummary = function(prefix, prototype, name) {
|
|
||||||
return gettext("Description of skin {0}", prototype + "." + name);
|
|
||||||
var key = prefix + "." + prototype;
|
|
||||||
name && (key += "." + name);
|
|
||||||
var languages = new Array("en");
|
|
||||||
var syslang;
|
|
||||||
if ((syslang = root.getLocale().getLanguage()) != "en")
|
|
||||||
languages.unshift(syslang);
|
|
||||||
if (res.handlers.site) {
|
|
||||||
var lang = res.handlers.site.getLocale().getLanguage();
|
|
||||||
if (lang != "en" && lang != syslang)
|
|
||||||
languages.unshift(lang);
|
|
||||||
}
|
|
||||||
var lang;
|
|
||||||
for (var i=0; i<languages.length; i+=1) {
|
|
||||||
if (!(lang = app.data[languages[i]])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (lang.getProperty(key)) {
|
|
||||||
return lang.getProperty(key).split("|");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return [prototype + "." + name];
|
|
||||||
}
|
|
||||||
|
|
||||||
Skins.Skinset = function(key, skins, context) {
|
|
||||||
this.key = key;
|
|
||||||
this.skins = skins;
|
|
||||||
this.context = context;
|
|
||||||
this.children = [];
|
|
||||||
this.add = function(obj) {
|
|
||||||
this.children.push(obj);
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
Skins.SKINSETS = [];
|
|
||||||
|
|
||||||
new function() {
|
|
||||||
var newSet = new Skins.Skinset("Root", ["Root.page", "Root.main", "Root.style", "Root.javascript", "Root.sysmgrnavigation", "Root.new"], "Root");
|
|
||||||
newSet.add(new Skins.Skinset("Root.scripts", ["Root.systemscripts", "Global.colorpickerScripts"]));
|
|
||||||
newSet.add(new Skins.Skinset("Root.sitelist", ["Site.preview", "Root.list"]));
|
|
||||||
newSet.add(new Skins.Skinset("Root.rss", ["Root.rss", "Site.rssItem", "Site.rssResource", "Global.rssImage"]));
|
|
||||||
newSet.add(new Skins.Skinset("Root.colorpicker", ["Global.colorpicker", "Global.colorpickerExt", "Global.colorpickerWidget", "Global.colorpickerScripts"]));
|
|
||||||
newSet.add(new Skins.Skinset("Root.welcome", ["Site.welcome", "Site.welcomeowner", "Site.welcomesysadmin", "Root.welcome"]));
|
|
||||||
newSet.add(new Skins.Skinset("Root.various", ["Root.blocked", "Root.notfound", "Root.sysError"]));
|
|
||||||
Skins.SKINSETS.push(newSet);
|
|
||||||
|
|
||||||
newSet = new Skins.Skinset("Site", ["Site.page", "Site.style", "Site.javascript", "Site.main", "Day.main", "Story.dayheader"]);
|
|
||||||
newSet.add(new Skins.Skinset("Site.navigation", ["Site.contribnavigation", "Site.adminnavigation", "Global.nextpagelink", "Global.prevpagelink", "Global.pagenavigation", "Global.pagenavigationitem", "Members.statusloggedin", "Members.statusloggedout"]));
|
|
||||||
newSet.add(new Skins.Skinset("Site.topics", ["TopicMgr.main", "Topic.main"]));
|
|
||||||
newSet.add(new Skins.Skinset("Site.calendar", ["Site.calendar", "Site.calendardayheader", "Site.calendarweek", "Site.calendarday", "Site.calendarselday"]));
|
|
||||||
newSet.add(new Skins.Skinset("Site.rss", ["Site.rss", "Story.rssItem", "Story.rssResource"]));
|
|
||||||
newSet.add(new Skins.Skinset("Site.search", ["Site.searchresult", "Site.searchbox", "Story.searchview"]));
|
|
||||||
newSet.add(new Skins.Skinset("Site.referrers", ["Site.referrers", "Site.referrerItem"]));
|
|
||||||
newSet.add(new Skins.Skinset("Site.mostread", ["Site.mostread", "Story.mostread"]));
|
|
||||||
newSet.add(new Skins.Skinset("Site.mails", ["Members.mailregconfirm", "Members.mailpassword", "Members.mailnewmember", "Membership.mailstatuschange", "Membership.mailmessage", "Site.notificationMail"], "Root"));
|
|
||||||
newSet.add(new Skins.Skinset("Site.preferences", ["Site.edit", "Site.notification"], "Root"));
|
|
||||||
newSet.add(new Skins.Skinset("Site.user", ["Members.login", "Members.register", "Members.sendpwd", "User.edit", "User.sitelist", "User.subscriptions", "Membership.subscriptionlistitem"], "Root"));
|
|
||||||
newSet.add(new Skins.Skinset("Site.members", ["Members.main", "Members.new", "Members.membergroup", "Members.searchresult", "Members.searchresultitem", "Membership.mgrlistitem", "Membership.edit"], "Root"));
|
|
||||||
newSet.add(new Skins.Skinset("Site.various", ["Site.robots"]));
|
|
||||||
Skins.SKINSETS.push(newSet);
|
|
||||||
|
|
||||||
newSet = new Skins.Skinset("Story", ["Story.display", "Story.main", "Story.preview", "Story.comment", "Story.historyview", "Story.embed", "Story.edit"]);
|
|
||||||
newSet.add(new Skins.Skinset("Story.backlinks", ["Story.backlinks", "Story.backlinkItem"]));
|
|
||||||
newSet.add(new Skins.Skinset("Story.list", ["StoryMgr.main", "Story.mgrlistitem"]));
|
|
||||||
Skins.SKINSETS.push(newSet);
|
|
||||||
|
|
||||||
newSet = new Skins.Skinset("Comment", ["Comment.toplevel", "Comment.reply", "Comment.edit"]);
|
|
||||||
Skins.SKINSETS.push(newSet);
|
|
||||||
|
|
||||||
newSet = new Skins.Skinset("Image", ["Image.main", "Image.edit", "ImageMgr.new", "LayoutImage.edit", "ImageMgr.main", "Image.mgrlistitem"]);
|
|
||||||
Skins.SKINSETS.push(newSet);
|
|
||||||
|
|
||||||
newSet = new Skins.Skinset("File", ["File.main", "File.edit", "FileMgr.new", "FileMgr.main", "File.mgrlistitem"]);
|
|
||||||
Skins.SKINSETS.push(newSet);
|
|
||||||
|
|
||||||
newSet = new Skins.Skinset("Poll", ["Poll.main", "Poll.results", "Choice.main", "Choice.result", "Choice.graph"]);
|
|
||||||
newSet.add(new Skins.Skinset("Poll.editor", ["Poll.edit", "Choice.edit"]));
|
|
||||||
newSet.add(new Skins.Skinset("Poll.list", ["PollMgr.main", "Poll.mgrlistitem"]));
|
|
||||||
Skins.SKINSETS.push(newSet);
|
|
||||||
|
|
||||||
newSet = new Skins.Skinset("SysMgr", ["SysMgr.status", "SysMgr.list", "Site.sysmgr_listitem", "Site.sysmgr_edit", "Site.sysmgr_delete", "User.sysmgr_listitem", "User.sysmgr_edit", "SysLog.sysmgr_listitem"], "Root");
|
|
||||||
newSet.add(new Skins.Skinset("SysMgr.forms", ["SysMgr.setup", "SysMgr.sitesearchform", "SysMgr.usersearchform", "SysMgr.syslogsearchform"]));
|
|
||||||
newSet.add(new Skins.Skinset("SysMgr.mails", ["SysMgr.blockwarnmail", "SysMgr.deletewarnmail"]));
|
|
||||||
Skins.SKINSETS.push(newSet);
|
|
||||||
|
|
||||||
newSet = new Skins.Skinset("SkinMgr", ["SkinMgr.main", "SkinMgr.page", "SkinMgr.edit", "SkinMgr.treebranch", "SkinMgr.treeleaf", "Skin.status", "Skin.statuscustom", "SkinMgr.new", "Skin.diff", "Skin.diffline"], "Root");
|
|
||||||
Skins.SKINSETS.push(newSet);
|
|
||||||
|
|
||||||
newSet = new Skins.Skinset("LayoutMgr", ["LayoutMgr.main", "LayoutMgr.new", "LayoutMgr.import"], "Root");
|
|
||||||
newSet.add(new Skins.Skinset("LayoutMgr.layout", ["Layout.mgrlistitem", "Layout.main", "Layout.edit", "Layout.download", "Layout.chooserlistitem", "Layout.testdrive"]));
|
|
||||||
newSet.add(new Skins.Skinset("LayoutMgr.images", ["LayoutImageMgr.main", "LayoutImageMgr.navigation", "LayoutImageMgr.new"]));
|
|
||||||
Skins.SKINSETS.push(newSet);
|
|
||||||
|
|
||||||
newSet = new Skins.Skinset("various", ["HopObject.delete"], "Root");
|
|
||||||
Skins.SKINSETS.push(newSet);
|
|
||||||
}
|
|
||||||
|
|
||||||
Skins.buildMacroHelp = function() {
|
|
||||||
var sorter = function(a, b) {
|
|
||||||
var str1 = a.name.toLowerCase();
|
|
||||||
var str2 = b.name.toLowerCase();
|
|
||||||
if (str1 > str2)
|
|
||||||
return 1;
|
|
||||||
else if (str1 < str2)
|
|
||||||
return -1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
var macroHelp = {};
|
|
||||||
var ref = macroHelp.Global = [];
|
|
||||||
var macrolist = HELP.macros.Global;
|
|
||||||
for (var i in macrolist)
|
|
||||||
ref.push({name: i, storyid: macrolist[i]});
|
|
||||||
ref.sort(sorter);
|
|
||||||
|
|
||||||
var ref = macroHelp.HopObject = [];
|
|
||||||
var macrolist = HELP.macros.HopObject;
|
|
||||||
for (var i in macrolist)
|
|
||||||
ref.push({name: i, storyid: macrolist[i]});
|
|
||||||
ref.sort(sorter);
|
|
||||||
|
|
||||||
for (var proto in HELP.macros) {
|
|
||||||
if (proto.indexOf("_") == 0 || proto == "Global" || proto == "HopObject")
|
|
||||||
continue;
|
|
||||||
var macrolist = HELP.macros[proto];
|
|
||||||
var ref = macroHelp[proto] = [];
|
|
||||||
var keys = "";
|
|
||||||
for (var i in macrolist) {
|
|
||||||
ref.push({name: i, storyid: macrolist[i]});
|
|
||||||
keys += i + ",";
|
|
||||||
}
|
|
||||||
for (var n in macroHelp.HopObject) {
|
|
||||||
var shared = macroHelp.HopObject[n];
|
|
||||||
if (keys.indexOf(shared.name + ",") < 0)
|
|
||||||
ref.push(shared);
|
|
||||||
}
|
|
||||||
ref.sort(sorter);
|
|
||||||
}
|
|
||||||
return macroHelp;
|
|
||||||
}
|
|
||||||
|
|
||||||
Skins.remove = function() {
|
|
||||||
if (this.constructor === Skins) {
|
|
||||||
this.forEach(function() {
|
|
||||||
HopObject.remove(this);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue