* Fixed reference to parent site in Archive
* Fixed _children.filter in Archive * Added missing permission checks * Modified global defineConstants() method to return the getter function instead of automatically defining it with given argument * Added HopObject.macro_macro() method to display userland macro code * Removed colorpicker (will be replaced by third-party library) * Removed obsolete global constants and functions * Overhauled and tested global userland macros like story_macro(), image_macro() etc. * Implemented global list_macro() to replace any special listFoobar_macro() methods * Moved global autoLogin() method into User prototype * Overhauled global randomize_macro() * Renamed global evalURL() method to validateUrl() as well as evalEmail() to validateEmail() * Re-added accidentally removed subskins to Members.skin * Fixed some skin names which were changed recently * Remove delete_action() from Membership * Fixed foreign key of images collection in Membership * Removed global username_macro() and replaced it with appropriate membership macros * Moved contents of systemscripts.skin into javascript.skin in Root prototype * Removed main_css_action(), main_js_action() and sitecounter_macro() methods from Root * Added accessname to sites collection in Root * Upgraded jQuery to version 1.2.1 * Replaced call for global history_macro() with corresponding list_macro() call * Renamed "public" collection of Stories prototype to "featured" * Moved a lot of styles from Root's style.skin to the one in Site * Added comments collection to Site * Moved embed.skin as subskin #embed into Site.skin * Fixed some minor issues in Story.js (removed check for creator before setting the story's mode) * Defined cookie names as constants of User which can be overriden via app.properties userCookie and hashCookie * Moved a lot of code into compatibility module
This commit is contained in:
parent
ded7f5fcea
commit
df9017ab77
38 changed files with 1154 additions and 1736 deletions
|
@ -22,10 +22,11 @@
|
|||
// $URL$
|
||||
//
|
||||
|
||||
defineConstants(Story, "getStatus", "closed", "public", "shared", "open");
|
||||
defineConstants(Story, "getModes", "hidden", "featured");
|
||||
defineConstants(Story, "getCommentsModes", "closed",
|
||||
Story.getStatus = defineConstants(Story, "closed", "public", "shared", "open");
|
||||
Story.getModes = defineConstants(Story, "hidden", "featured");
|
||||
Story.getCommentsModes = defineConstants(Story, "closed",
|
||||
"readonly", "moderated", "open");
|
||||
|
||||
this.handleMetadata("title");
|
||||
this.handleMetadata("text");
|
||||
|
||||
|
@ -182,9 +183,7 @@ Story.prototype.update = function(data) {
|
|||
this.setContent(data);
|
||||
//this.setTags(data.tags || data.tag_array)
|
||||
this.commentsMode = data.commentsMode;
|
||||
if (this.creator === session.user) {
|
||||
this.mode = data.mode;
|
||||
}
|
||||
this.mode = data.mode;
|
||||
if (this.status === Story.PRIVATE && data.status !== Story.PRIVATE) {
|
||||
if (delta > 50) {
|
||||
site.lastUpdate = new Date;
|
||||
|
@ -238,7 +237,7 @@ Story.prototype.rotate_action = function() {
|
|||
this.mode = Story.FEATURED;
|
||||
this.status = Story.CLOSED;
|
||||
}
|
||||
return res.redirect(this._parent.href());
|
||||
return res.redirect(req.data.http_referer || this._parent.href());
|
||||
};
|
||||
|
||||
Story.prototype.comment_action = function() {
|
||||
|
@ -301,7 +300,7 @@ Story.prototype.summary_macro = function(param) {
|
|||
|
||||
Story.prototype.comments_macro = function(param, mode) {
|
||||
var story = this.story || this;
|
||||
if (story.site.commentsMode === Site.CLOSED ||
|
||||
if (story.site.commentsMode === Site.DISABLED ||
|
||||
story.commentsMode === Site.CLOSED) {
|
||||
return;
|
||||
} else if (mode) {
|
||||
|
|
|
@ -33,6 +33,31 @@
|
|||
</p>
|
||||
<br />
|
||||
|
||||
<% #embed %>
|
||||
<% story.title prefix='<div class="storyTitle">'suffix="</div>" %>
|
||||
<% story.text | clip %>
|
||||
<span class="small">
|
||||
<% story.link . "[read more]" %>
|
||||
<% story.link edit prefix=" ... " %>
|
||||
</span><br />
|
||||
|
||||
<% #history %>
|
||||
<div class="historyItem">
|
||||
<% story.summary %>
|
||||
<div class="small">
|
||||
by <% story.creator %> (<% story.modified short %>)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% #top %>
|
||||
<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"><% story.title | story.link %></td>
|
||||
<td valign="baseline"><% story.creator %></td>
|
||||
</tr>
|
||||
|
||||
<% #comment %>
|
||||
<% story.skin Story#day %>
|
||||
<% story.skin Story#content %>
|
||||
|
@ -51,7 +76,7 @@ else <% if <% story.mode %> is hidden then
|
|||
<td rowspan="2" width="5" nowrap="nowrap"></td>' %>
|
||||
%>
|
||||
<td colspan="3" class="small">
|
||||
<strong>Macro:</strong> <% story <% story.id %> %><br />
|
||||
<strong>Macro:</strong> <% story.macro %><br />
|
||||
<div class="ample"><strong>Status: </strong><% story.status %><!--
|
||||
--><% story.tags link prefix=" in " %>,
|
||||
<% story.comments link %></div>
|
||||
|
@ -138,23 +163,6 @@ for (var i in referrers) {
|
|||
</noscript>
|
||||
</table>
|
||||
|
||||
<% #history %>
|
||||
<div class="historyItem">
|
||||
<% story.summary %>
|
||||
<div class="small">
|
||||
by <% story.creator %> (<% story.modified short %>)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% #top %>
|
||||
<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"><% story.title | story.link %></td>
|
||||
<td valign="baseline"><% story.creator %></td>
|
||||
</tr>
|
||||
|
||||
<% #edit %>
|
||||
<form method="post" action="<% response.action %>">
|
||||
<p>
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
<span class="storyTitle"><% story.content part="title" suffix="<br />" %></span>
|
||||
<% story.content part="text" limit="20" delimiter="\\s" clipping=" ..." %><span class="small"><% story.link text="[read more]" prefix=" " to="main" %><% story.editlink prefix=" ... " %></span><br />
|
Loading…
Add table
Add a link
Reference in a new issue