- added localechooser_macro()
- removed dateformat_macro() - added longdateformat_macro() and shortdateformat_macro() - added smallfont_macro(), smallsize_macro(), smallcolor_macro()
This commit is contained in:
parent
4dc1e02b06
commit
62114145cd
1 changed files with 79 additions and 32 deletions
|
@ -188,6 +188,45 @@ function titlecolor_macro(param) {
|
||||||
res.write(param.suffix);
|
res.write(param.suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* macro rendering smallfont of weblog
|
||||||
|
*/
|
||||||
|
|
||||||
|
function smallfont_macro(param) {
|
||||||
|
res.write(param.prefix)
|
||||||
|
if (param.as == "editor")
|
||||||
|
this.renderInputText(this.createInputParam("smallfont",param));
|
||||||
|
else
|
||||||
|
res.write(this.smallfont);
|
||||||
|
res.write(param.suffix);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* macro rendering smallfont-size of weblog
|
||||||
|
*/
|
||||||
|
|
||||||
|
function smallsize_macro(param) {
|
||||||
|
res.write(param.prefix)
|
||||||
|
if (param.as == "editor")
|
||||||
|
this.renderInputText(this.createInputParam("smallsize",param));
|
||||||
|
else
|
||||||
|
res.write(this.smallsize);
|
||||||
|
res.write(param.suffix);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* macro rendering smallfont-color of weblog
|
||||||
|
*/
|
||||||
|
|
||||||
|
function smallcolor_macro(param) {
|
||||||
|
res.write(param.prefix)
|
||||||
|
if (param.as == "editor")
|
||||||
|
this.renderInputText(this.createInputParam("smallcolor",param));
|
||||||
|
else
|
||||||
|
renderColor(this.smallcolor);
|
||||||
|
res.write(param.suffix);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* macro rendering lastupdate of weblog
|
* macro rendering lastupdate of weblog
|
||||||
*/
|
*/
|
||||||
|
@ -312,41 +351,32 @@ function showarchive_macro(param) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* macro rendering language of weblog
|
* macro rendering default longdateformat of weblog
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function language_macro(param) {
|
function longdateformat_macro(param) {
|
||||||
res.write(param.prefix)
|
res.write(param.prefix)
|
||||||
if (param.as == "editor")
|
if (param.as == "chooser")
|
||||||
this.renderInputText(this.createInputParam("language",param));
|
this.renderDateformatChooser("long");
|
||||||
|
else if (param.as == "editor")
|
||||||
|
this.renderInputText(this.createInputParam("longdateformat",param));
|
||||||
else
|
else
|
||||||
res.write(this.language);
|
res.write(this.longdateformat);
|
||||||
res.write(param.suffix);
|
res.write(param.suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* macro rendering country of weblog
|
* macro rendering default shortdateformat of weblog
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function country_macro(param) {
|
function shortdateformat_macro(param) {
|
||||||
res.write(param.prefix)
|
res.write(param.prefix)
|
||||||
if (param.as == "editor")
|
if (param.as == "chooser")
|
||||||
this.renderInputText(this.createInputParam("country",param));
|
this.renderDateformatChooser("short");
|
||||||
|
else if (param.as == "editor")
|
||||||
|
this.renderInputText(this.createInputParam("shortdateformat",param));
|
||||||
else
|
else
|
||||||
res.write(this.country);
|
res.write(this.shortdateformat);
|
||||||
res.write(param.suffix);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* macro rendering default dateformat of weblog
|
|
||||||
*/
|
|
||||||
|
|
||||||
function dateformat_macro(param) {
|
|
||||||
res.write(param.prefix)
|
|
||||||
if (param.as == "editor")
|
|
||||||
this.renderInputText(this.createInputParam("dateformat",param));
|
|
||||||
else
|
|
||||||
res.write(this.dateformat);
|
|
||||||
res.write(param.suffix);
|
res.write(param.suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,12 +400,11 @@ function loginstatus_macro(param) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function navigation_macro(param) {
|
function navigation_macro(param) {
|
||||||
if (this.isUserAdmin())
|
|
||||||
this.renderSkin("adminnavigation");
|
|
||||||
else if (this.isUserContributor())
|
|
||||||
this.renderSkin("contribnavigation");
|
|
||||||
else
|
|
||||||
this.renderSkin("usernavigation");
|
this.renderSkin("usernavigation");
|
||||||
|
if (this.isUserContributor(user) || this.isUserAdmin(user))
|
||||||
|
this.renderSkin("contribnavigation");
|
||||||
|
if (this.isUserAdmin(user))
|
||||||
|
this.renderSkin("adminnavigation");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -384,7 +413,7 @@ function navigation_macro(param) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function storylist_macro() {
|
function storylist_macro() {
|
||||||
if (this.size() > 0) {
|
if (this.allstories.size() > 0) {
|
||||||
var days = parseInt(this.days,10) ? parseInt(this.days,10) : 2;
|
var days = parseInt(this.days,10) ? parseInt(this.days,10) : 2;
|
||||||
if (days > this.size())
|
if (days > this.size())
|
||||||
days = this.size();
|
days = this.size();
|
||||||
|
@ -553,7 +582,6 @@ function memberlist_macro(param) {
|
||||||
|
|
||||||
function history_macro(param) {
|
function history_macro(param) {
|
||||||
res.write(param.prefix);
|
res.write(param.prefix);
|
||||||
var x = new Array(nr);
|
|
||||||
var len1 = this.allstories.count();
|
var len1 = this.allstories.count();
|
||||||
var len2 = this.allcomments.count();
|
var len2 = this.allcomments.count();
|
||||||
var nr = parseInt(param.show,10) ? parseInt(param.show,10) : 5;
|
var nr = parseInt(param.show,10) ? parseInt(param.show,10) : 5;
|
||||||
|
@ -561,6 +589,7 @@ function history_macro(param) {
|
||||||
var c1 = 0;
|
var c1 = 0;
|
||||||
var c2 = 0;
|
var c2 = 0;
|
||||||
var cnt = 0;
|
var cnt = 0;
|
||||||
|
var x = new Array(nr);
|
||||||
while (cnt < nr) {
|
while (cnt < nr) {
|
||||||
if (c1 >= this.allstories.count())
|
if (c1 >= this.allstories.count())
|
||||||
x[cnt] = this.allcomments.get(c2++);
|
x[cnt] = this.allcomments.get(c2++);
|
||||||
|
@ -576,7 +605,6 @@ function history_macro(param) {
|
||||||
else
|
else
|
||||||
x[cnt] = this.allstories.get(c1++);
|
x[cnt] = this.allstories.get(c1++);
|
||||||
}
|
}
|
||||||
if (x[cnt].isOnline())
|
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
for (var j in x)
|
for (var j in x)
|
||||||
|
@ -621,6 +649,25 @@ function membership_macro(param) {
|
||||||
res.write(param.suffix);
|
res.write(param.suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* macro renders a list of available locales as dropdown
|
||||||
|
*/
|
||||||
|
|
||||||
|
function localechooser_macro(param) {
|
||||||
|
res.write(param.prefix);
|
||||||
|
var locs = java.util.Locale.getAvailableLocales();
|
||||||
|
var options = new Array();
|
||||||
|
// get the defined locale of this weblog for comparison
|
||||||
|
var loc = this.getLocale();
|
||||||
|
for (var i in locs) {
|
||||||
|
options[i] = locs[i].getDisplayName();
|
||||||
|
if (locs[i].equals(loc))
|
||||||
|
var selectedIndex = i;
|
||||||
|
}
|
||||||
|
res.write(simpleDropDownBox("locale",options,selectedIndex));
|
||||||
|
res.write(param.suffix);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* renders a list of most read pages, ie. a link
|
* renders a list of most read pages, ie. a link
|
||||||
* to a story followed by the read counter.
|
* to a story followed by the read counter.
|
||||||
|
|
Loading…
Add table
Reference in a new issue