Compare commits
42 commits
release-1.
...
release-1.
Author | SHA1 | Date | |
---|---|---|---|
6a5a389d01 | |||
573e90b732 | |||
cba12bbae7 | |||
bd96bf8388 | |||
900470348b | |||
4486f2d238 | |||
31f249fc79 | |||
ff62e260cf | |||
347cb98020 | |||
516babe96f | |||
bc98042790 | |||
a5e6c8b596 | |||
791e099ade | |||
0af26a4e7b | |||
c0adce4ea8 | |||
20f0be8868 | |||
94ac026e76 | |||
ca2f3a87b5 | |||
6584f1dd7d | |||
6c80b3f2e9 | |||
828b85ba4c | |||
4a16d91deb | |||
d221466d4a | |||
f2db3263d9 | |||
b8791d0887 | |||
df20ca2efc | |||
57c6322c1e | |||
1f16ce5377 | |||
cd50b46cba | |||
69ff389353 | |||
192f133ba6 | |||
a0c7ee608e | |||
5b0ba00ba9 | |||
3b7d2e577b | |||
1d27d412c8 | |||
9410d97946 | |||
2b35e1ddf4 | |||
3f602c6d5b | |||
5a1b4cf2e3 | |||
4db44c389b | |||
|
9776619fb4 | ||
47deac6732 |
32 changed files with 248 additions and 228 deletions
|
@ -23,10 +23,10 @@
|
|||
<target name="init">
|
||||
<property name="name" value="antville" />
|
||||
<property name="year" value="1998-${year}" />
|
||||
<property name="version" value="1.2" />
|
||||
<property name="version" value="1.2.1" />
|
||||
<property name="package.name" value="${name}-${version}" />
|
||||
|
||||
<property name="antville.src" value="http://antville.googlecode.com/svn/trunk" />
|
||||
<property name="antville.src" value="http://antville.googlecode.com/svn/branches/release_1_2_1" />
|
||||
<property name="helma.src" value="http://dev.helma.org/svn/helma/helma/trunk" />
|
||||
<property name="apps.src" value="http://dev.helma.org/svn/apps" />
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@ PoParser.prototype.writeToFile = function(output) {
|
|||
buf.append(' * Messages for locale "' + this.localeKey + '"\n');
|
||||
buf.append(' */\n');
|
||||
var fname = objPath + "." + this.localeKey + ".js";
|
||||
objPath += "xxx['" + this.localeKey + "']";
|
||||
objPath += "['" + this.localeKey + "']";
|
||||
buf.append('global.' + objPath + ' = {\n');
|
||||
// write messages
|
||||
for (var i=0;i<this.messages.length; i++) {
|
||||
|
|
|
@ -363,7 +363,7 @@ Admin.updateHealth = function() {
|
|||
Admin.updateDomains = function() {
|
||||
res.push();
|
||||
for (var key in app.properties) {
|
||||
if (key.startsWith("domain.")) {
|
||||
if (key.startsWith("domain.") && !key.endsWith("*")) {
|
||||
res.writeln(getProperty(key) + "\t\t" + key.substr(7));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,6 +57,7 @@ Api.getUser = function(name, password) {
|
|||
} else if (user.status === User.BLOCKED) {
|
||||
throw Error("The user account " + name + " is currently blocked");
|
||||
}
|
||||
session.login(user);
|
||||
return user;
|
||||
}
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ function scheduler() {
|
|||
Admin.commitEntries();
|
||||
Admin.commitRequests();
|
||||
Admin.invokeCallbacks();
|
||||
//Admin.updateDomains();
|
||||
Admin.updateDomains();
|
||||
Admin.updateHealth();
|
||||
return 5000;
|
||||
}
|
||||
|
@ -785,7 +785,7 @@ function sendMail(recipient, subject, body, options) {
|
|||
}
|
||||
var mail = new helma.Mail(getProperty("smtp", "localhost"),
|
||||
getProperty("smtp.port", "25"));
|
||||
mail.setFrom(root.replyTo);
|
||||
mail.setFrom(root.replyTo || "root@localhost");
|
||||
if (recipient instanceof Array) {
|
||||
for (var i in recipient) {
|
||||
mail.addBCC(recipient[i]);
|
||||
|
@ -817,16 +817,16 @@ function getLocale(language) {
|
|||
* @returns {Object[]} A sorted array containing the corresponding locales
|
||||
*/
|
||||
function getLocales(language) {
|
||||
var result = [], locale;
|
||||
var displayLocale = getLocale(language);
|
||||
var result = [], locale, localeString;
|
||||
var locales = java.util.Locale.getAvailableLocales();
|
||||
for (var i in locales) {
|
||||
locale = locales[i].toString();
|
||||
if (!locale.toString().contains("_")) {
|
||||
locale = locales[i];
|
||||
localeString = locale.toString();
|
||||
if (!localeString.contains("_")) {
|
||||
result.push({
|
||||
value: locale,
|
||||
display: locales[i].getDisplayName(displayLocale),
|
||||
"class": jala.i18n.getCatalog(jala.i18n.getLocale(locale)) ? "translated" : ""
|
||||
value: localeString,
|
||||
display: locale.getDisplayName(locale),
|
||||
"class": jala.i18n.getCatalog(jala.i18n.getLocale(localeString)) ? "translated" : ""
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -851,8 +851,8 @@ function getTimeZones(language) {
|
|||
offset = timeZone.getRawOffset();
|
||||
result.push({
|
||||
value: zone,
|
||||
display: /* timeZone.getDisplayName(timeZone.inDaylightTime(now),
|
||||
java.util.TimeZone.LONG, locale) */ " (UTC" + (offset /
|
||||
display: timeZone.getDisplayName(timeZone.inDaylightTime(now),
|
||||
java.util.TimeZone.LONG, locale) + " (UTC" + (offset /
|
||||
Date.ONEHOUR).format("+00;-00") + ":" + (Math.abs(offset %
|
||||
Date.ONEHOUR) / Date.ONEMINUTE).format("00") + ")"
|
||||
});
|
||||
|
@ -1202,3 +1202,24 @@ var wait = function(millis) {
|
|||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Object} param
|
||||
* @param {String} type
|
||||
*/
|
||||
function version_macro(param, type) {
|
||||
var version = Root.VERSION.split("-");
|
||||
var number = version[0];
|
||||
switch (type) {
|
||||
case "major":
|
||||
res.write(number.split(".")[0]);
|
||||
break;
|
||||
case "minor":
|
||||
res.write(number);
|
||||
break;
|
||||
default:
|
||||
res.write(Root.VERSION);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -95,8 +95,8 @@ function gettext_macro(param, text /*, value1, value2, ...*/) {
|
|||
if (!text) {
|
||||
return;
|
||||
}
|
||||
var re = /(\s*)(?:\r|\n)\s*/g;
|
||||
var args = [text.replace(re, "$1")];
|
||||
var re = /\s+/g;
|
||||
var args = [text.replace(re, String.SPACE)];
|
||||
for (var i=2; i<arguments.length; i+=1) {
|
||||
args.push(arguments[i]);
|
||||
}
|
||||
|
@ -118,8 +118,8 @@ function ngettext_macro(param, singular, plural /*, value1, value2, ...*/) {
|
|||
if (!singular || !plural) {
|
||||
return;
|
||||
}
|
||||
var re = /(\s*)(?:\r|\n)\s*/g;
|
||||
var args = [singular.replace(re, "$1"), plural.replace(re, "$1")];
|
||||
var re = /\s+/g;
|
||||
var args = [singular.replace(re, String.SPACE), plural.replace(re, String.SPACE)];
|
||||
for (var i=3; i<arguments.length; i+=1) {
|
||||
args.push(arguments[i]);
|
||||
}
|
||||
|
|
|
@ -229,7 +229,7 @@ Layout.prototype.reset_action = function() {
|
|||
Layout.prototype.export_action = function() {
|
||||
res.contentType = "application/zip";
|
||||
var zip = this.getArchive(res.skinpath);
|
||||
res.setHeader("Content-Disposition",
|
||||
res.setHeader("Content-Disposition",
|
||||
"attachment; filename=" + this.site.name + "-layout.zip");
|
||||
res.writeBinary(zip.getData());
|
||||
return;
|
||||
|
@ -268,7 +268,7 @@ Layout.prototype.import_action = function() {
|
|||
} catch (ex) {
|
||||
res.message = ex;
|
||||
app.log(ex);
|
||||
temp.removeDirectory();
|
||||
temp && temp.removeDirectory();
|
||||
res.redirect(this.href(req.action));
|
||||
}
|
||||
res.redirect(this.href());
|
||||
|
@ -326,17 +326,26 @@ Layout.prototype.getSkinPath = function() {
|
|||
*/
|
||||
Layout.prototype.reset = function() {
|
||||
var skinFiles = app.getSkinfilesInPath([app.dir]);
|
||||
var content, file;
|
||||
var content, dir, 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 = this.getFile(name);
|
||||
file = new helma.File(dir, name + ".skin");
|
||||
dir.makeDirectory();
|
||||
file.open();
|
||||
file.write(content);
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: Reset the Site skin of root separately
|
||||
content = skinFiles.Root.Site;
|
||||
file = new helma.File(this.getFile("Root"), "Site.skin");
|
||||
dir.makeDirectory();
|
||||
file.open();
|
||||
file.write(content);
|
||||
file.close()
|
||||
|
||||
this.touch();
|
||||
return;
|
||||
}
|
||||
|
@ -358,6 +367,10 @@ Layout.prototype.getArchive = function(skinPath) {
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME: Add the Site skin of root separately
|
||||
file = new helma.File(this.getFile("Root"), "Site.skin");
|
||||
file.exists() && zip.add(file, "Root");
|
||||
|
||||
var data = new HopObject;
|
||||
data.images = new HopObject;
|
||||
this.images.forEach(function() {
|
||||
|
|
|
@ -40,12 +40,6 @@ $(function() {
|
|||
<input type="hidden" name="digest" id="digest" />
|
||||
<table border="0" cellspacing="0" cellpadding="3">
|
||||
<tr>
|
||||
<td class="small"><% gettext "Activation Code" suffix=":" %></td>
|
||||
<td><input type="text" name="activation" id="activation"
|
||||
value="<% request.activation encoding="form" %>" /></td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="small"><% gettext "Username" suffix=":" %></td>
|
||||
<td><input type="text" name="name" id="name" tabindex="1" size="20"
|
||||
value="<% request.name encoding="form" %>" /></td>
|
||||
|
@ -104,11 +98,6 @@ $(function() {
|
|||
<input type="hidden" name="hash" id="hash" />
|
||||
<table border="0" cellspacing="0" cellpadding="3">
|
||||
<tr>
|
||||
<td class="small"><% gettext "Activation Code" suffix=":" %></td>
|
||||
<td><input type="text" name="activation" id="activation"
|
||||
value="<% request.activation encoding="form" %>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="small"><% gettext Username suffix=: %></td>
|
||||
<td><input type="text" name="name" size="30"
|
||||
value="<% request.name encoding="form" %>" /></td>
|
||||
|
|
|
@ -92,10 +92,6 @@ Members.prototype.main_action = function() {
|
|||
|
||||
Members.prototype.register_action = function() {
|
||||
if (req.postParams.register) {
|
||||
if (req.postParams.activation) {
|
||||
app.log("Detected form submit with completed honeypot field: " + req.data);
|
||||
res.redirect(root.href());
|
||||
}
|
||||
try {
|
||||
var title = res.handlers.site.title;
|
||||
var user = User.register(req.postParams);
|
||||
|
@ -178,10 +174,6 @@ Members.prototype.reset_action = function() {
|
|||
|
||||
Members.prototype.login_action = function() {
|
||||
if (req.postParams.login) {
|
||||
if (req.postParams.activation) {
|
||||
app.log("Detected form submit with completed honeypot field: " + req.data);
|
||||
res.redirect(root.href());
|
||||
}
|
||||
try {
|
||||
var user = User.login(req.postParams);
|
||||
res.message = gettext('Welcome to {0}, {1}. Have fun!',
|
||||
|
@ -339,7 +331,6 @@ Members.prototype.add_action = function() {
|
|||
}
|
||||
} else if (req.postParams.add) {
|
||||
try {
|
||||
res.handlers.sender = User.getMembership();
|
||||
var membership = this.addMembership(req.postParams);
|
||||
membership.notify(req.action, membership.creator.email,
|
||||
gettext('[{0}] Notification of membership change', root.title));
|
||||
|
@ -404,65 +395,3 @@ Members.prototype.addMembership = function(data) {
|
|||
this.add(membership);
|
||||
return membership;
|
||||
}
|
||||
|
||||
Members.prototype.modSorua_action = function() {
|
||||
if (!app.data.modSorua) app.data.modSorua = new Array();
|
||||
var returnUrl = req.data["sorua-return-url"];
|
||||
var failUrl = req.data["sorua-fail-url"];
|
||||
var userID = req.data["sorua-user"];
|
||||
var action = req.data["sorua-action"];
|
||||
if (action == "authenticate") { // authenticate-action
|
||||
if (session.user && (userID == null || userID == "" || session.user.name == userID)) {
|
||||
// store returnUrl + timestamp + userID
|
||||
app.data.modSorua[returnUrl] = {time: new Date(), userID: session.user.name};
|
||||
res.redirect(returnUrl);
|
||||
} else if (failUrl) {
|
||||
res.redirect(failUrl);
|
||||
} else {
|
||||
session.data.modSorua = {returnUrl: returnUrl,
|
||||
userID: userID};
|
||||
res.redirect(this.href("modSoruaLoginForm"));
|
||||
}
|
||||
|
||||
} else if (action == "verify") {
|
||||
// first remove outdated entries
|
||||
var now = new Date();
|
||||
var arr = new Array();
|
||||
for (var i in app.data.modSorua) {
|
||||
if (app.data.modSorua[i] && app.data.modSorua[i].time &&
|
||||
now.valueOf() - app.data.modSorua[i].time.valueOf() < 1000 * 60)
|
||||
arr[i] = app.data.modSorua[i];
|
||||
}
|
||||
app.data.modSorua = arr;
|
||||
// now check whether returnUrl has been used recently
|
||||
if (app.data.modSorua[returnUrl]) {
|
||||
res.status = 200;
|
||||
res.write("user:" + app.data.modSorua[returnUrl].userID);
|
||||
return;
|
||||
} else {
|
||||
res.status = 403;
|
||||
return;
|
||||
}
|
||||
|
||||
} else { // handle wrong call of AuthURI
|
||||
res.redirect(root.href("main"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Members.prototype.modSoruaLoginForm_action = function() {
|
||||
if (!session.data.modSorua || !session.data.modSorua.returnUrl)
|
||||
res.redirect(root.href()); // should not happen anyways
|
||||
if (req.data.login) {
|
||||
try {
|
||||
res.message = this.evalLogin(req.data.name, req.data.password);
|
||||
var returnUrl = session.data.modSorua.returnUrl;
|
||||
app.data.modSorua[returnUrl] = {time: new Date(), userID: req.data.name};
|
||||
res.redirect(returnUrl);
|
||||
} catch (err) {
|
||||
res.message = err.toString();
|
||||
}
|
||||
}
|
||||
res.data.action = this.href("modSoruaLoginForm");
|
||||
this.renderSkin("modSorua");
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
</p>
|
||||
|
||||
<% #main %>
|
||||
<% if <% param.header %> is true then <% poll.skin #header suffix=<br /> %> else
|
||||
<% if <% param.header %> is true then <% poll.skin #header suffix="<br />" %> else
|
||||
<% poll.question prefix='<div class="pollTitle">' suffix="</div> %> %>
|
||||
<form method="post" action="<% poll.href %>">
|
||||
<table border="0" cellspacing="2" cellpadding="2">
|
||||
|
|
|
@ -1,22 +1,3 @@
|
|||
<% #main %>
|
||||
<p><% gettext 'Antville is an open source project aimed at the development of a
|
||||
simple site hosting system with many advanced
|
||||
<a href="http://code.google.com/p/antville/wiki/AntvilleFeatures">features</a>.' %></p>
|
||||
<p><% gettext 'One Antville installation can easily host up to several thousands
|
||||
of <a href="{0}">sites</a>.' <% site.href sites %> %></p>
|
||||
<p><% site.link create <% gettext "Create a site. It only takes a few clicks." %> %></p>
|
||||
<p>
|
||||
<% gettext "Total sites hosted here" suffix=: %> <% root.size %><br />
|
||||
<% gettext "Number of public sites" suffix=: %> <% root.sites.size %>
|
||||
</p>
|
||||
<table border="0" cellpadding="1" cellspacing="0">
|
||||
<colgroup>
|
||||
<col width="150" />
|
||||
<col width="*" />
|
||||
</colgroup>
|
||||
<% root.loop updates skin=$Site#listItem limit=25 %>
|
||||
</table>
|
||||
|
||||
<% #create %>
|
||||
<p class="storyTitle"><% response.title %></p>
|
||||
<div>
|
||||
|
@ -150,6 +131,10 @@ alphabetical order." %></p>
|
|||
<td class="small"><% gettext 'Queued Callbacks' %>:</td>
|
||||
<td><% param.callbacks %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="small"><% gettext Version %>:</td>
|
||||
<td><% version %></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<% #stylesheet %>
|
||||
|
@ -183,7 +168,7 @@ ul.skinmgrTree a.selected {
|
|||
}
|
||||
|
||||
ul.skinmgrTree li div {
|
||||
font-family:<% value "base font size" %>;
|
||||
font-family:<% value "small font" %>;
|
||||
font-size:<% value "small font size" %>;
|
||||
color:<% value "base font color" %>;
|
||||
}
|
||||
|
@ -208,10 +193,6 @@ div.skin div.title {
|
|||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.activation {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.translated {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
|
||||
/** @constant */
|
||||
Root.VERSION = "1.2";
|
||||
Root.VERSION = "1.2.1";
|
||||
|
||||
this.handleMetadata("creationDelay");
|
||||
this.handleMetadata("creationScope");
|
||||
|
|
|
@ -1,7 +1,21 @@
|
|||
<% #main %>
|
||||
<% root.skin Root#welcome %>
|
||||
<% // Render the list of updated sites %>
|
||||
<% root.skin $Root#main %>
|
||||
<p><% gettext 'Antville is an open source project aimed at the development of a
|
||||
simple site hosting system with many advanced
|
||||
<a href="http://code.google.com/p/antville/wiki/AntvilleFeatures">features</a>.' %></p>
|
||||
<p><% gettext 'One Antville installation can easily host up to several thousands
|
||||
of <a href="{0}">sites</a>.' <% site.href sites %> %></p>
|
||||
<p><% site.link create <% gettext "Create a site. It only takes a few clicks." %> %></p>
|
||||
<p>
|
||||
<% gettext "Total sites hosted here" suffix=: %> <% root.size %><br />
|
||||
<% gettext "Number of public sites" suffix=: %> <% root.sites.size %>
|
||||
</p>
|
||||
<table border="0" cellpadding="1" cellspacing="0">
|
||||
<colgroup>
|
||||
<col width="150" />
|
||||
<col width="*" />
|
||||
</colgroup>
|
||||
<% list updates 25 skin=$Site#listItem %>
|
||||
</table>
|
||||
|
||||
<% #navigation %>
|
||||
<div class="navigation">
|
||||
|
|
|
@ -186,7 +186,7 @@ referrers.push(new Antville.Referrer("<% param.referrer %>",
|
|||
<tr>
|
||||
<td class="small"><% gettext Paging suffix=: %></td>
|
||||
<td><% site.input pageSize size="5" maxlength="2" %>
|
||||
<% gettext "{0} per page" <% gettext "days" %> %></td>
|
||||
<% gettext "{0} per page" <% gettext "stories" %> %></td>
|
||||
<% // site.select pageMode %>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -233,7 +233,6 @@ Site.prototype.getPermission = function(action) {
|
|||
case "error":
|
||||
case "notfound":
|
||||
case "robots.txt":
|
||||
case "search":
|
||||
case "search.xml":
|
||||
case "user.js":
|
||||
return true;
|
||||
|
@ -243,6 +242,7 @@ Site.prototype.getPermission = function(action) {
|
|||
case "comments.xml":
|
||||
case "rss.xml":
|
||||
case "rss.xsl":
|
||||
case "search":
|
||||
case "stories.xml":
|
||||
return Site.require(Site.PUBLIC) ||
|
||||
(Site.require(Site.RESTRICTED) &&
|
||||
|
@ -259,6 +259,7 @@ Site.prototype.getPermission = function(action) {
|
|||
|
||||
case "subscribe":
|
||||
return Site.require(Site.PUBLIC) &&
|
||||
User.require(User.REGULAR) &&
|
||||
!Membership.require(Membership.SUBSCRIBER);
|
||||
|
||||
case "unsubscribe":
|
||||
|
@ -914,12 +915,15 @@ Site.prototype.getDiskSpace = function(quota) {
|
|||
* @param {String} href
|
||||
*/
|
||||
Site.prototype.processHref = function(href) {
|
||||
var scheme = req.servletRequest ? req.servletRequest.scheme : "http";
|
||||
var domain = getProperty("domain." + this.name);
|
||||
if (domain) {
|
||||
href = [scheme, "://", domain, href].join(String.EMPTY);
|
||||
} else if (domain = getProperty("domain.www")) {
|
||||
href = [scheme, "://", domain, "/", this.name, href].join(String.EMPTY);
|
||||
if (["localhost", "127.0.0.1"].indexOf(req.data.http_host) > -1) {
|
||||
var site = app.properties.hrefRootPrototype ? this.name : String.EMPTY;
|
||||
return [app.appsProperties.mountPoint, "/", site, href].join(String.EMPTY);
|
||||
}
|
||||
var domain, scheme = req.servletRequest ? req.servletRequest.scheme : "http";
|
||||
if (domain = getProperty("domain." + this.name)) {
|
||||
return [scheme, "://", domain, href].join(String.EMPTY);
|
||||
} else if (domain = getProperty("domain.*")) {
|
||||
return [scheme, "://", this.name, ".", domain, href].join(String.EMPTY);
|
||||
}
|
||||
return href;
|
||||
}
|
||||
|
|
|
@ -281,7 +281,7 @@ a:hover {text-decoration: underline;}
|
|||
}
|
||||
|
||||
.dayHeader {
|
||||
font-family: <% value "small font size" %>;
|
||||
font-family: <% value "small font" %>;
|
||||
font-size: <% value "small font size" %>;
|
||||
color: <% value "small font color" %>;
|
||||
font-weight: bold;
|
||||
|
|
|
@ -275,25 +275,29 @@ Skin.prototype.getFormValue = function(name) {
|
|||
* @returns {String}
|
||||
*/
|
||||
Skin.prototype.getSource = function() {
|
||||
var skinSet = app.getSkinfilesInPath(res.skinpath)[this.prototype];
|
||||
if (skinSet) {
|
||||
var mainSkin = skinSet[this.prototype];
|
||||
if (mainSkin) {
|
||||
var skin = createSkin(mainSkin).getSubskin(this.name);
|
||||
if (skin) {
|
||||
return skin.getSource();
|
||||
}
|
||||
var skin;
|
||||
// FIXME: Maintain skin inheritance by checking if we target the Site skin of root
|
||||
if (res.handlers.site === root && this.prototype === "Site") {
|
||||
skin = this.getSubskin("Root");
|
||||
if (skin) {
|
||||
return skin.getSource();
|
||||
}
|
||||
}
|
||||
return null; //String.EMPTY;
|
||||
skin = this.getSubskin();
|
||||
if (skin) {
|
||||
return skin.getSource();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {String} source
|
||||
*/
|
||||
Skin.prototype.setSource = function(source) {
|
||||
var skin = this.getMainSkin();
|
||||
// FIXME: Maintain skin inheritance by checking if we target the Site skin of root
|
||||
var prototype = (res.handlers.site === root && this.prototype === "Site") ? "Root" : this.prototype;
|
||||
var skin = this.getMainSkin(prototype);
|
||||
if (!skin) {
|
||||
return;
|
||||
}
|
||||
|
@ -335,17 +339,36 @@ Skin.prototype.setSource = function(source) {
|
|||
* @returns {java.io.File}
|
||||
*/
|
||||
Skin.prototype.getStaticFile = function() {
|
||||
return new java.io.File(res.skinpath[0], this.prototype + "/" +
|
||||
this.prototype + ".skin");
|
||||
// FIXME: Maintain skin inheritance by checking if we target the Site skin of root
|
||||
var prototype = (res.handlers.site === root && this.prototype === "Site") ? "Root" : this.prototype;
|
||||
return new java.io.File(res.skinpath[0], prototype + "/" + this.prototype + ".skin");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {String} prototype
|
||||
* @returns {Skin}
|
||||
*/
|
||||
Skin.prototype.getMainSkin = function() {
|
||||
var skinSet = app.getSkinfilesInPath(res.skinpath)[this.prototype];
|
||||
if (skinSet && skinSet[this.prototype]) {
|
||||
return createSkin(skinSet[this.prototype]);
|
||||
Skin.prototype.getMainSkin = function(prototype) {
|
||||
var source, skinSet = app.getSkinfilesInPath(res.skinpath)[prototype || this.prototype];
|
||||
if (skinSet) {
|
||||
source = skinSet[this.prototype];
|
||||
if (source !== null) {
|
||||
return createSkin(source);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param prototype
|
||||
* @param name
|
||||
* @returns {Skin}
|
||||
*/
|
||||
Skin.prototype.getSubskin = function(prototype, name) {
|
||||
var mainSkin = this.getMainSkin(prototype);
|
||||
if (mainSkin) {
|
||||
return mainSkin.getSubskin(name || this.name);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -169,32 +169,20 @@ Skins.prototype.getSkin = function(group, name) {
|
|||
|
||||
/**
|
||||
*
|
||||
* @param {String} type
|
||||
* @returns {String}
|
||||
*/
|
||||
Skins.prototype.getOutline = function(type) {
|
||||
var key = "outline:" + type;
|
||||
var outline = this.cache[key];
|
||||
if (outline) {
|
||||
return outline;
|
||||
}
|
||||
|
||||
var prototype, skin, subskins, names, skins = [];
|
||||
Skins.prototype.getOutline = function() {
|
||||
var skinfiles, prototype, skin, subskins, names, skins = [];
|
||||
var options = Skin.getPrototypeOptions();
|
||||
|
||||
for each (var option in options) {
|
||||
prototype = option.value;
|
||||
names = [];
|
||||
for (var name in app.skinfiles[prototype]) {
|
||||
if (name === prototype && type !== "custom") {
|
||||
skin = createSkin(app.skinfiles[prototype][name]);
|
||||
subskins = skin.getSubskinNames();
|
||||
for each (var subskin in subskins) {
|
||||
names.push(subskin);
|
||||
}
|
||||
} else if (name !== prototype && type === "custom") {
|
||||
names.push(name);
|
||||
}
|
||||
prototype = option.value;
|
||||
skinfiles = app.getSkinfilesInPath(res.skinpath);
|
||||
skin = createSkin(skinfiles[prototype][prototype]);
|
||||
subskins = skin.getSubskinNames();
|
||||
for each (var subskin in subskins) {
|
||||
names.push(subskin);
|
||||
}
|
||||
names.sort();
|
||||
skins.push([prototype, names]);
|
||||
|
@ -221,5 +209,5 @@ Skins.prototype.getOutline = function(type) {
|
|||
html.closeTag("li");
|
||||
}
|
||||
}
|
||||
return this.cache[key] = res.pop();
|
||||
return res.pop();
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ comments = collection(Comment)
|
|||
comments.local = id
|
||||
comments.foreign = site_id
|
||||
comments.filter = story.id = content.story_id and story.status <> 'closed' and \
|
||||
story.comment_mode <> 'disabled'
|
||||
story.comment_mode <> 'disabled' and content.status <> 'deleted'
|
||||
comments.filter.additionalTables = content as story
|
||||
comments.order = content.modified desc
|
||||
comments.maxSize = 100
|
||||
|
@ -67,7 +67,7 @@ comments.maxSize = 100
|
|||
union = collection(Story)
|
||||
union.local = id
|
||||
union.foreign = site_id
|
||||
union.filter = status <> 'closed' and status <> 'pending'
|
||||
union.filter = status <> 'closed' and status <> 'pending' and status <> 'deleted'
|
||||
union.order = modified desc
|
||||
union.maxSize = 100
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<tr>
|
||||
<td align="right" valign="baseline" class="small"><% param.position %></td>
|
||||
<td align="right" valign="baseline"><% story.requests %></td>
|
||||
<td valign="baseline"><% story.created "yyyy-MM-dd" %></td>
|
||||
<td valign="baseline" style="white-space: nowrap"><% story.created "yyyy-MM-dd" %></td>
|
||||
<td valign="baseline"><% story.title | default <% story.text | clip 5 %> | story.link %></td>
|
||||
<td valign="baseline"><% story.creator %></td>
|
||||
</tr>
|
||||
|
|
|
@ -64,7 +64,7 @@ User.getStatus = defineConstants(User, markgettext("Blocked"),
|
|||
* @returns {String}
|
||||
*/
|
||||
User.getSalt = function() {
|
||||
var salt = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 8);;
|
||||
var salt = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 8);
|
||||
var random = java.security.SecureRandom.getInstance("SHA1PRNG");
|
||||
random.nextBytes(salt);
|
||||
return Packages.sun.misc.BASE64Encoder().encode(salt);
|
||||
|
@ -241,6 +241,22 @@ User.getLocation = function() {
|
|||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename a user account.
|
||||
* @param {String} currentName The current name of the user account.
|
||||
* @param {String} newName The desired name of the user account.
|
||||
*/
|
||||
User.rename = function(currentName, newName) {
|
||||
var user = User.getByName(currentName);
|
||||
if (user) {
|
||||
user.forEach(function() {
|
||||
this.name = newName;
|
||||
});
|
||||
user.name = newName;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* A User object represents a login to Antville.
|
||||
* @name User
|
||||
|
|
|
@ -50,11 +50,13 @@ cron.nightly.minute = 0
|
|||
#sessionTimeout = 30
|
||||
#requestTimeout = 10
|
||||
|
||||
## Options for rewriting URL output
|
||||
## Options for rewriting URL output;
|
||||
## enable the first three when mapping individual domains (see below)
|
||||
#baseUri = /
|
||||
#hrefSkin = $Site#href
|
||||
#hrefFunction = processHref
|
||||
#hrefRootPrototype = Site
|
||||
#hrefSkin = $Site#href
|
||||
|
||||
## List of individual domain mappings
|
||||
## List of default and individual domain mappings
|
||||
#domain.* = antville.org
|
||||
#domain.foo = bar.foo.org
|
||||
|
|
|
@ -209,8 +209,6 @@ function imageoftheday_macro(param) {
|
|||
return image_macro(param);
|
||||
}
|
||||
|
||||
var support_macro = new Function;
|
||||
|
||||
function renderColorAsString(c) {
|
||||
return c && c.isHexColor() ? "#" + c : c;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// $URL$
|
||||
//
|
||||
|
||||
Root.VERSION = "1.2-compatible";
|
||||
Root.VERSION += "-compatible";
|
||||
|
||||
Root.prototype.rss_action = function() {
|
||||
return res.redirect(root.href("rss.xml"));
|
||||
|
|
|
@ -57,7 +57,7 @@ Root.prototype.updater_action = function() {
|
|||
}
|
||||
return;
|
||||
}, [], -1);
|
||||
this.renderSkin("Root");
|
||||
this.renderSkin("~Root");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ Root.prototype.nonames_action = function() {
|
|||
});
|
||||
status("finished");
|
||||
}, [], -1);
|
||||
this.renderSkin("Root");
|
||||
this.renderSkin("~Root");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ Root.prototype.galleries_action = function() {
|
|||
});
|
||||
status("finished");
|
||||
}, [], -1);
|
||||
this.renderSkin("Root");
|
||||
this.renderSkin("~Root");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
// Apply with enabled updater repository via ant patch -Dpatch.id=20100401
|
||||
|
||||
var sql = new Sql;
|
||||
|
||||
// Correct Image.contentLength property for some images
|
||||
sql.retrieve("select id from image");
|
||||
sql.traverse(function() {
|
||||
var image = Image.getById(this.id);
|
||||
|
|
|
@ -28,6 +28,10 @@ var sql = new Sql;
|
|||
var template;
|
||||
|
||||
// Remove MySQL-specific constraints (enum types)
|
||||
// The database user needs ÒalterÓ permission for this patch:
|
||||
// mysql -e "grant all on antville.* to 'antville'@'localhost'"
|
||||
// Afterwards user permissions should be restored:
|
||||
// mysql -e "grant select, insert, update, delete on antville.* to 'antville'@'localhost'"
|
||||
if (app.getDbSource("antville").isMySQL()) {
|
||||
template = "alter table $0 modify column $1 varchar(20) default null";
|
||||
sql.execute(template, "account", "status");
|
||||
|
@ -56,3 +60,10 @@ sql.execute(template, "subscriber", "Subscriber");
|
|||
sql.execute(template, 'contributor', 'Contributor');
|
||||
sql.execute(template, 'manager', 'Manager');
|
||||
sql.execute(template, 'owner', 'Owner');
|
||||
|
||||
// Convert notification modes to lowercase
|
||||
root.forEach(function() {
|
||||
if (this.notificationMode !== null) {
|
||||
this.notificationMode = this.notificationMode.toLowerCase()
|
||||
}
|
||||
});
|
||||
|
|
44
extra/updater/patch-20101209.js
Normal file
44
extra/updater/patch-20101209.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
//
|
||||
// The Antville Project
|
||||
// http://code.google.com/p/antville
|
||||
//
|
||||
// Copyright 2001-2007 by The Antville People
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the ``License'');
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an ``AS IS'' BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// $Revision$
|
||||
// $LastChangedBy$
|
||||
// $LastChangedDate$
|
||||
// $URL$
|
||||
//
|
||||
|
||||
// Apply with enabled updater repository via ant patch -Dpatch.id=20101209
|
||||
|
||||
root.forEach(function() {
|
||||
var site = this;
|
||||
var locale = site.locale;
|
||||
// Update locales to new format
|
||||
if (locale.contains("_")) {
|
||||
site.locale = locale.substr(0, locale.lastIndexOf("_"));
|
||||
}
|
||||
// Update time zones to new format
|
||||
var timeZone = site.timeZone;
|
||||
switch (timeZone) {
|
||||
case "CET":
|
||||
site.timeZone = "Europe/Vienna";
|
||||
break;
|
||||
case "GMT":
|
||||
site.timeZone = "Europe/London";
|
||||
break;
|
||||
}
|
||||
});
|
|
@ -26,7 +26,7 @@ msgstr ""
|
|||
"Project-Id-Version: Antville-1.2-compatible\n"
|
||||
"Report-Msgid-Bugs-To: mail@antville.org\n"
|
||||
"POT-Creation-Date: 2010-06-05 09:16+0200\n"
|
||||
"PO-Revision-Date: 2010-06-05 09:19+0100\n"
|
||||
"PO-Revision-Date: 2011-01-06 18:15+0100\n"
|
||||
"Last-Translator: Tobi Schäfer <interface@p3k.org>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -700,7 +700,7 @@ msgstr "Hauptseite"
|
|||
#: /Users/tobi/Projects/helma/apps/antville/code/Root/Site.skin:10
|
||||
#: /Users/tobi/Projects/helma/apps/antville/code/Site/Site.skin:17
|
||||
msgid "Galleries"
|
||||
msgstr "Gallerien"
|
||||
msgstr "Galerien"
|
||||
|
||||
#: /Users/tobi/Projects/helma/apps/antville/code/Admin/$Admin.skin:269
|
||||
#: /Users/tobi/Projects/helma/apps/antville/code/Site/$Site.skin:171
|
||||
|
@ -1703,7 +1703,7 @@ msgstr "Website {0} wurde erfolgreich abonniert."
|
|||
#: /Users/tobi/Projects/helma/apps/antville/code/Site/Site.js:629
|
||||
#, java-format
|
||||
msgid "Successfully unsubscribed from site {0}."
|
||||
msgstr "Das Abonnement von Website {0} wurde erfolgreich storniert."
|
||||
msgstr "Das Abonnement der Website {0} wurde erfolgreich storniert."
|
||||
|
||||
#: /Users/tobi/Projects/helma/apps/antville/code/Layout/Layout.js:151
|
||||
msgid "Successfully updated the layout."
|
||||
|
|
|
@ -145,7 +145,7 @@ global.messages['de'] = {
|
|||
"Free Memory": "Freier Speicher",
|
||||
"Free Threads": "Freie Prozesse",
|
||||
"Frontpage": "Hauptseite",
|
||||
"Galleries": "Gallerien",
|
||||
"Galleries": "Galerien",
|
||||
"General": "Allgemein",
|
||||
"Good bye, {0}! Looking forward to seeing you again!": "Auf Wiedersehen, {0}! Schauen Sie bald wieder vorbei!",
|
||||
"Grace Period": "Gnadenfrist",
|
||||
|
|
|
@ -11,7 +11,7 @@ $(function() {
|
|||
var zone = $(item);
|
||||
var parts = zone.val().split("/");
|
||||
if (parts.length > 1) {
|
||||
if (parts[0].indexOf("Etc") === 0 ||
|
||||
if (/* parts[0].indexOf("Etc") === 0 || */
|
||||
parts[0].indexOf("SystemV") === 0) {
|
||||
zone.remove();
|
||||
return;
|
||||
|
@ -68,22 +68,22 @@ jQuery.md5 = function (string) {
|
|||
function FF(a,b,c,d,x,s,ac) {
|
||||
a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
|
||||
return AddUnsigned(RotateLeft(a, s), b);
|
||||
};
|
||||
}
|
||||
|
||||
function GG(a,b,c,d,x,s,ac) {
|
||||
a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
|
||||
return AddUnsigned(RotateLeft(a, s), b);
|
||||
};
|
||||
}
|
||||
|
||||
function HH(a,b,c,d,x,s,ac) {
|
||||
a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
|
||||
return AddUnsigned(RotateLeft(a, s), b);
|
||||
};
|
||||
}
|
||||
|
||||
function II(a,b,c,d,x,s,ac) {
|
||||
a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
|
||||
return AddUnsigned(RotateLeft(a, s), b);
|
||||
};
|
||||
}
|
||||
|
||||
function ConvertToWordArray(string) {
|
||||
var lWordCount;
|
||||
|
@ -106,7 +106,7 @@ jQuery.md5 = function (string) {
|
|||
lWordArray[lNumberOfWords-2] = lMessageLength<<3;
|
||||
lWordArray[lNumberOfWords-1] = lMessageLength>>>29;
|
||||
return lWordArray;
|
||||
};
|
||||
}
|
||||
|
||||
function WordToHex(lValue) {
|
||||
var WordToHexValue="",WordToHexValue_temp="",lByte,lCount;
|
||||
|
@ -116,7 +116,7 @@ jQuery.md5 = function (string) {
|
|||
WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);
|
||||
}
|
||||
return WordToHexValue;
|
||||
};
|
||||
}
|
||||
|
||||
function Utf8Encode(string) {
|
||||
string = string.replace(/\r\n/g,"\n");
|
||||
|
@ -142,7 +142,7 @@ jQuery.md5 = function (string) {
|
|||
}
|
||||
|
||||
return utftext;
|
||||
};
|
||||
}
|
||||
|
||||
var x=Array();
|
||||
var k,AA,BB,CC,DD,a,b,c,d;
|
||||
|
@ -230,7 +230,7 @@ jQuery.md5 = function (string) {
|
|||
}
|
||||
var temp = WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d);
|
||||
return temp.toLowerCase();
|
||||
};
|
||||
}
|
||||
|
||||
Antville = {};
|
||||
Antville.prefix = "Antville_";
|
||||
|
@ -243,11 +243,11 @@ Antville.encode = function(str) {
|
|||
str = str.replace(re, "&#" + c.charCodeAt() + ";");
|
||||
}
|
||||
return str;
|
||||
};
|
||||
}
|
||||
|
||||
Antville.decode = function(str) {
|
||||
return str.replace(/&/g, "&");
|
||||
};
|
||||
}
|
||||
|
||||
Antville.Referrer = function(url, text, count) {
|
||||
this.url = url;
|
||||
|
@ -263,7 +263,7 @@ Antville.Referrer = function(url, text, count) {
|
|||
return this.text;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
}
|
||||
|
||||
Antville.Query = function(str) {
|
||||
if (str == undefined)
|
||||
|
@ -285,7 +285,7 @@ Antville.Query = function(str) {
|
|||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
}
|
||||
|
||||
Antville.Filter = function(def, key) {
|
||||
this.key = key;
|
||||
|
@ -307,20 +307,4 @@ Antville.Filter = function(def, key) {
|
|||
return false;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
var app = {
|
||||
clearCache: function() {
|
||||
$.ajax({
|
||||
async: true,
|
||||
type: "POST",
|
||||
url: '/helma/antville/debug',
|
||||
data: "action=clearCache",
|
||||
cache: false,
|
||||
error: function() { /* ... */ },
|
||||
success: function(str) {
|
||||
console.log(str);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue