Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo
Commits
76e018b7
Commit
76e018b7
authored
Jan 22, 2013
by
wmainlove@gmail.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.5.6' of
https://github.com/b3log/b3log-solo.git
into 0.5.6
parents
a7edadae
a72a6a7e
Changes
32
Show whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
459 additions
and
176 deletions
+459
-176
.gitignore
.gitignore
+2
-1
core/src/main/java/org/b3log/solo/api/metaweblog/MetaWeblogAPI.java
...ain/java/org/b3log/solo/api/metaweblog/MetaWeblogAPI.java
+3
-10
core/src/main/java/org/b3log/solo/api/symphony/CommentReceiver.java
...ain/java/org/b3log/solo/api/symphony/CommentReceiver.java
+3
-2
core/src/main/java/org/b3log/solo/model/ArchiveDate.java
core/src/main/java/org/b3log/solo/model/ArchiveDate.java
+1
-10
core/src/main/java/org/b3log/solo/model/Comment.java
core/src/main/java/org/b3log/solo/model/Comment.java
+1
-10
core/src/main/java/org/b3log/solo/processor/ArticleProcessor.java
.../main/java/org/b3log/solo/processor/ArticleProcessor.java
+3
-2
core/src/main/java/org/b3log/solo/processor/LoginProcessor.java
...rc/main/java/org/b3log/solo/processor/LoginProcessor.java
+2
-2
core/src/main/java/org/b3log/solo/processor/SitemapProcessor.java
.../main/java/org/b3log/solo/processor/SitemapProcessor.java
+2
-2
core/src/main/java/org/b3log/solo/processor/util/Filler.java
core/src/main/java/org/b3log/solo/processor/util/Filler.java
+8
-12
core/src/main/java/org/b3log/solo/repository/impl/ArchiveDateRepositoryImpl.java
...b3log/solo/repository/impl/ArchiveDateRepositoryImpl.java
+3
-2
core/src/main/java/org/b3log/solo/service/ArticleMgmtService.java
.../main/java/org/b3log/solo/service/ArticleMgmtService.java
+7
-12
core/src/main/java/org/b3log/solo/service/CommentMgmtService.java
.../main/java/org/b3log/solo/service/CommentMgmtService.java
+4
-3
core/src/main/java/org/b3log/solo/service/InitService.java
core/src/main/java/org/b3log/solo/service/InitService.java
+5
-3
core/src/main/java/org/b3log/solo/util/TimeZones.java
core/src/main/java/org/b3log/solo/util/TimeZones.java
+1
-5
core/src/test/java/org/b3log/solo/repository/impl/ArchiveDateRepositoryImplTestCase.java
...lo/repository/impl/ArchiveDateRepositoryImplTestCase.java
+5
-2
core/src/test/java/org/b3log/solo/service/ArchiveDateQueryServiceTestCase.java
...g/b3log/solo/service/ArchiveDateQueryServiceTestCase.java
+4
-3
war/src/main/webapp/WEB-INF/.gitignore
war/src/main/webapp/WEB-INF/.gitignore
+0
-1
war/src/main/webapp/article-pwd.ftl
war/src/main/webapp/article-pwd.ftl
+1
-1
war/src/main/webapp/init.ftl
war/src/main/webapp/init.ftl
+1
-0
war/src/main/webapp/kill-browser.ftl
war/src/main/webapp/kill-browser.ftl
+1
-1
war/src/main/webapp/login.ftl
war/src/main/webapp/login.ftl
+1
-1
war/src/main/webapp/skins/timeline/article-list.ftl
war/src/main/webapp/skins/timeline/article-list.ftl
+38
-36
war/src/main/webapp/skins/timeline/css/timeline.css
war/src/main/webapp/skins/timeline/css/timeline.css
+244
-3
war/src/main/webapp/skins/timeline/footer.ftl
war/src/main/webapp/skins/timeline/footer.ftl
+2
-2
war/src/main/webapp/skins/timeline/header.ftl
war/src/main/webapp/skins/timeline/header.ftl
+34
-48
war/src/main/webapp/skins/timeline/images/icons.png
war/src/main/webapp/skins/timeline/images/icons.png
+0
-0
war/src/main/webapp/skins/timeline/images/nav-bg.png
war/src/main/webapp/skins/timeline/images/nav-bg.png
+0
-0
war/src/main/webapp/skins/timeline/index.ftl
war/src/main/webapp/skins/timeline/index.ftl
+28
-0
war/src/main/webapp/skins/timeline/js/timeline.js
war/src/main/webapp/skins/timeline/js/timeline.js
+52
-0
war/src/main/webapp/skins/timeline/lang/lang_en_US.properties
...src/main/webapp/skins/timeline/lang/lang_en_US.properties
+1
-0
war/src/main/webapp/skins/timeline/lang/lang_zh_CN.properties
...src/main/webapp/skins/timeline/lang/lang_zh_CN.properties
+2
-1
war/src/main/webapp/top-bar.ftl
war/src/main/webapp/top-bar.ftl
+0
-1
No files found.
.gitignore
View file @
76e018b7
...
...
@@ -5,3 +5,4 @@
/war/target/
/war/mysql/target/
/war/h2/target/
/war/src/main/webapp/WEB-INF/lib/
\ No newline at end of file
core/src/main/java/org/b3log/solo/api/metaweblog/MetaWeblogAPI.java
View file @
76e018b7
...
...
@@ -16,12 +16,9 @@
package
org
.
b3log
.
solo
.
api
.
metaweblog
;
import
java.text.DateFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.TimeZone
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
javax.servlet.ServletInputStream
;
...
...
@@ -30,6 +27,7 @@ import javax.servlet.http.HttpServletResponse;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang.StringEscapeUtils
;
import
org.apache.commons.lang.time.DateFormatUtils
;
import
org.apache.commons.lang.time.DateUtils
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.model.User
;
import
org.b3log.latke.repository.Transaction
;
...
...
@@ -74,7 +72,7 @@ import org.jsoup.Jsoup;
* </p>
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.
7, Aug 29, 2012
* @version 1.0.0.
8, Jan 18, 2013
* @since 0.4.0
*/
@RequestProcessor
...
...
@@ -372,12 +370,7 @@ public final class MetaWeblogAPI {
}
catch
(
final
ParseException
e
)
{
LOGGER
.
log
(
Level
.
WARNING
,
"Parses article create date failed with ISO8601, retry to parse with pattern[yyyy-MM-dd'T'HH:mm:ss]"
);
final
String
timeZoneId
=
preference
.
getString
(
Preference
.
TIME_ZONE_ID
);
final
TimeZone
timeZone
=
TimeZone
.
getTimeZone
(
timeZoneId
);
final
DateFormat
format
=
new
SimpleDateFormat
(
"yyyyMMdd'T'HH:mm:ss"
);
format
.
setTimeZone
(
timeZone
);
date
=
format
.
parse
(
dateString
);
date
=
DateUtils
.
parseDate
(
dateString
,
new
String
[]
{
"yyyyMMdd'T'HH:mm:ss"
});
}
ret
.
put
(
Article
.
ARTICLE_CREATE_DATE
,
date
);
}
else
if
(
"title"
.
equals
(
name
))
{
...
...
core/src/main/java/org/b3log/solo/api/symphony/CommentReceiver.java
View file @
76e018b7
...
...
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.lang.time.DateFormatUtils
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.Latkes
;
import
org.b3log.latke.event.Event
;
...
...
@@ -65,7 +66,7 @@ import org.json.JSONObject;
* Comment receiver (from B3log Symphony).
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.
4, Jan 4
, 2013
* @version 1.0.0.
5, Jan 18
, 2013
* @since 0.5.5
*/
@RequestProcessor
...
...
@@ -206,7 +207,7 @@ public final class CommentReceiver {
final
Date
date
=
TimeZones
.
getTime
(
timeZoneId
);
comment
.
put
(
Comment
.
COMMENT_DATE
,
date
);
ret
.
put
(
Comment
.
COMMENT_DATE
,
Comment
.
DATE_FORMAT
.
format
(
date
));
ret
.
put
(
Comment
.
COMMENT_DATE
,
DateFormatUtils
.
format
(
date
,
"yyyy-MM-dd hh:mm:ss"
));
if
(!
Strings
.
isEmptyOrNull
(
originalCommentId
))
{
originalComment
=
commentRepository
.
get
(
originalCommentId
);
if
(
null
!=
originalComment
)
{
...
...
core/src/main/java/org/b3log/solo/model/ArchiveDate.java
View file @
76e018b7
...
...
@@ -16,15 +16,11 @@
package
org
.
b3log
.
solo
.
model
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
/**
* This class defines all archive date model relevant keys.
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.
3, Jul 2, 2011
* @version 1.0.0.
4, Jan 18, 2013
*/
public
final
class
ArchiveDate
{
...
...
@@ -63,11 +59,6 @@ public final class ArchiveDate {
*/
public
static
final
String
ARCHIVE_DATE_MONTH
=
"archiveDateMonth"
;
/**
* Date format(yyyy/MM).
*/
public
static
final
DateFormat
DATE_FORMAT
=
new
SimpleDateFormat
(
"yyyy/MM"
);
/**
* Private default constructor.
*/
...
...
core/src/main/java/org/b3log/solo/model/Comment.java
View file @
76e018b7
...
...
@@ -16,15 +16,11 @@
package
org
.
b3log
.
solo
.
model
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
/**
* This class defines all comment model relevant keys.
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.
6, Oct 28, 2011
* @version 1.0.0.
7, Jan 18, 2013
* @since 0.3.1
*/
public
final
class
Comment
{
...
...
@@ -99,11 +95,6 @@ public final class Comment {
*/
public
static
final
String
COMMENT_ON_ID
=
"commentOnId"
;
/**
* Date format(yyyy/MM/dd hh:mm:ss).
*/
public
static
final
DateFormat
DATE_FORMAT
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm:ss"
);
/**
* Private default constructor.
*/
...
...
core/src/main/java/org/b3log/solo/processor/ArticleProcessor.java
View file @
76e018b7
...
...
@@ -26,6 +26,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.time.DateFormatUtils
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.Latkes
;
import
org.b3log.latke.cache.PageCaches
;
...
...
@@ -66,7 +67,7 @@ import org.jsoup.Jsoup;
* Article processor.
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.1.2.
6, Jan 7
, 2013
* @version 1.1.2.
7, Jan 18
, 2013
* @since 0.3.1
*/
@RequestProcessor
...
...
@@ -1134,7 +1135,7 @@ public final class ArticleProcessor {
filler
.
fillBlogFooter
(
dataModel
,
preference
);
final
long
time
=
archiveDate
.
getLong
(
ArchiveDate
.
ARCHIVE_TIME
);
final
String
dateString
=
ArchiveDate
.
DATE_FORMAT
.
format
(
time
);
final
String
dateString
=
DateFormatUtils
.
format
(
time
,
"yyyy/MM"
);
final
String
[]
dateStrings
=
dateString
.
split
(
"/"
);
final
String
year
=
dateStrings
[
0
];
final
String
month
=
dateStrings
[
1
];
...
...
core/src/main/java/org/b3log/solo/processor/LoginProcessor.java
View file @
76e018b7
...
...
@@ -55,7 +55,7 @@ import org.json.JSONObject;
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.1.1.
2, Jan 4
, 2013
* @version 1.1.1.
3, Jan 18
, 2013
* @since 0.3.1
*/
@RequestProcessor
...
...
@@ -250,7 +250,7 @@ public final class LoginProcessor {
final
String
userPassword
=
user
.
optString
(
User
.
USER_PASSWORD
);
final
String
hashPassword
=
cookieJSONObject
.
optString
(
User
.
USER_PASSWORD
);
if
(
userPassword
.
equals
(
hashPassword
))
{
if
(
MD5
.
hash
(
userPassword
)
.
equals
(
hashPassword
))
{
Sessions
.
login
(
request
,
response
,
user
);
LOGGER
.
log
(
Level
.
INFO
,
"Logged in with cookie[email={0}]"
,
userEmail
);
}
...
...
core/src/main/java/org/b3log/solo/processor/SitemapProcessor.java
View file @
76e018b7
...
...
@@ -56,7 +56,7 @@ import org.json.JSONObject;
* Site map (sitemap) processor.
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.
4, Jun 11, 2012
* @version 1.0.0.
5, Jan 18, 2013
* @since 0.3.1
*/
@RequestProcessor
...
...
@@ -248,7 +248,7 @@ public final class SitemapProcessor {
for
(
int
i
=
0
;
i
<
archiveDates
.
length
();
i
++)
{
final
JSONObject
archiveDate
=
archiveDates
.
getJSONObject
(
i
);
final
long
time
=
archiveDate
.
getLong
(
ArchiveDate
.
ARCHIVE_TIME
);
final
String
dateString
=
ArchiveDate
.
DATE_FORMAT
.
format
(
time
);
final
String
dateString
=
DateFormatUtils
.
format
(
time
,
"yyyy/MM"
);
final
URL
url
=
new
URL
();
...
...
core/src/main/java/org/b3log/solo/processor/util/Filler.java
View file @
76e018b7
...
...
@@ -25,11 +25,7 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
import
javax.servlet.http.HttpServletRequest
;
import
org.apache.commons.lang.StringEscapeUtils
;
import
org.b3log.latke.repository.RepositoryException
;
import
org.b3log.solo.util.Articles
;
import
org.b3log.solo.model.Article
;
import
org.b3log.solo.repository.ArticleRepository
;
import
org.b3log.solo.repository.TagRepository
;
import
org.apache.commons.lang.time.DateFormatUtils
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.Latkes
;
import
org.b3log.latke.event.Event
;
...
...
@@ -43,15 +39,14 @@ import org.b3log.latke.repository.*;
import
org.b3log.latke.service.ServiceException
;
import
org.b3log.latke.util.*
;
import
org.b3log.latke.util.freemarker.Templates
;
import
org.b3log.solo.model.ArchiveDate
;
import
org.b3log.solo.model.Link
;
import
org.b3log.solo.model.Preference
;
import
org.b3log.solo.repository.CommentRepository
;
import
org.b3log.solo.repository.LinkRepository
;
import
org.b3log.solo.SoloServletListener
;
import
org.b3log.solo.model.*
;
import
org.b3log.solo.repository.ArchiveDateRepository
;
import
org.b3log.solo.repository.ArticleRepository
;
import
org.b3log.solo.repository.CommentRepository
;
import
org.b3log.solo.repository.LinkRepository
;
import
org.b3log.solo.repository.PageRepository
;
import
org.b3log.solo.repository.TagRepository
;
import
org.b3log.solo.repository.UserRepository
;
import
org.b3log.solo.repository.impl.ArchiveDateRepositoryImpl
;
import
org.b3log.solo.repository.impl.ArticleRepositoryImpl
;
...
...
@@ -62,6 +57,7 @@ import org.b3log.solo.repository.impl.TagRepositoryImpl;
import
org.b3log.solo.repository.impl.UserRepositoryImpl
;
import
org.b3log.solo.service.ArticleQueryService
;
import
org.b3log.solo.service.StatisticQueryService
;
import
org.b3log.solo.util.Articles
;
import
org.b3log.solo.util.Tags
;
import
org.b3log.solo.util.Users
;
import
org.json.JSONArray
;
...
...
@@ -73,7 +69,7 @@ import org.json.JSONObject;
* Filler utilities.
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.6.
1, Aug 9, 2012
* @version 1.0.6.
2, Jan 18, 2013
* @since 0.3.1
*/
public
final
class
Filler
{
...
...
@@ -287,7 +283,7 @@ public final class Filler {
for
(
final
JSONObject
archiveDate
:
archiveDates
)
{
final
long
time
=
archiveDate
.
getLong
(
ArchiveDate
.
ARCHIVE_TIME
);
final
String
dateString
=
ArchiveDate
.
DATE_FORMAT
.
format
(
time
);
final
String
dateString
=
DateFormatUtils
.
format
(
time
,
"yyyy/MM"
);
final
String
[]
dateStrings
=
dateString
.
split
(
"/"
);
final
String
year
=
dateStrings
[
0
];
final
String
month
=
dateStrings
[
1
];
...
...
core/src/main/java/org/b3log/solo/repository/impl/ArchiveDateRepositoryImpl.java
View file @
76e018b7
...
...
@@ -21,6 +21,7 @@ import java.util.Iterator;
import
java.util.List
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
org.apache.commons.lang.time.DateUtils
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.repository.*
;
import
org.b3log.latke.util.CollectionUtils
;
...
...
@@ -34,7 +35,7 @@ import org.json.JSONObject;
* Archive date repository.
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.
6, Dec 31, 2011
* @version 1.0.0.
7, Jan 18, 2013
* @since 0.3.1
*/
public
final
class
ArchiveDateRepositoryImpl
extends
AbstractRepository
implements
ArchiveDateRepository
{
...
...
@@ -54,7 +55,7 @@ public final class ArchiveDateRepositoryImpl extends AbstractRepository implemen
long
time
=
0L
;
try
{
time
=
ArchiveDate
.
DATE_FORMAT
.
parse
(
archiveDate
).
getTime
();
time
=
DateUtils
.
parseDate
(
archiveDate
,
new
String
[]
{
"yyyy/MM"
}
).
getTime
();
}
catch
(
final
ParseException
e
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
"Can not parse archive date ["
+
archiveDate
+
"]"
,
e
);
throw
new
RepositoryException
(
"Can not parse archive date ["
+
archiveDate
+
"]"
);
...
...
core/src/main/java/org/b3log/solo/service/ArticleMgmtService.java
View file @
76e018b7
...
...
@@ -16,15 +16,15 @@
package
org
.
b3log
.
solo
.
service
;
import
java.text.DateFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
org.apache.commons.lang.time.DateFormatUtils
;
import
org.apache.commons.lang.time.DateUtils
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.event.Event
;
import
org.b3log.latke.event.EventException
;
...
...
@@ -68,7 +68,7 @@ import org.json.JSONObject;
* Article management service.
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.1.
3, Oct 12, 2012
* @version 1.0.1.
4, Jan 18, 2013
* @since 0.3.5
*/
public
final
class
ArticleMgmtService
{
...
...
@@ -148,11 +148,6 @@ public final class ArticleMgmtService {
*/
private
static
Tags
tagUtils
=
Tags
.
getInstance
();
/**
* Permalink date format(yyyy/MM/dd).
*/
public
static
final
DateFormat
PERMALINK_FORMAT
=
new
SimpleDateFormat
(
"yyyy/MM/dd"
);
/**
* Cancels publish an article by the specified article id.
*
...
...
@@ -990,13 +985,13 @@ public final class ArticleMgmtService {
*/
private
void
archiveDate
(
final
JSONObject
article
)
throws
RepositoryException
{
final
Date
createDate
=
(
Date
)
article
.
opt
(
Article
.
ARTICLE_CREATE_DATE
);
final
String
createDateString
=
ArchiveDate
.
DATE_FORMAT
.
format
(
createDate
);
final
String
createDateString
=
DateFormatUtils
.
format
(
createDate
,
"yyyy/MM"
);
JSONObject
archiveDate
=
archiveDateRepository
.
getByArchiveDate
(
createDateString
);
if
(
null
==
archiveDate
)
{
archiveDate
=
new
JSONObject
();
try
{
archiveDate
.
put
(
ArchiveDate
.
ARCHIVE_TIME
,
ArchiveDate
.
DATE_FORMAT
.
parse
(
createDateString
).
getTime
());
archiveDate
.
put
(
ArchiveDate
.
ARCHIVE_TIME
,
DateUtils
.
parseDate
(
createDateString
,
new
String
[]
{
"yyyy/MM"
}
).
getTime
());
archiveDate
.
put
(
ArchiveDate
.
ARCHIVE_DATE_ARTICLE_COUNT
,
0
);
archiveDate
.
put
(
ArchiveDate
.
ARCHIVE_DATE_PUBLISHED_ARTICLE_COUNT
,
0
);
...
...
@@ -1064,7 +1059,7 @@ public final class ArticleMgmtService {
String
ret
=
article
.
optString
(
Article
.
ARTICLE_PERMALINK
);
if
(
Strings
.
isEmptyOrNull
(
ret
))
{
ret
=
"/articles/"
+
PERMALINK_FORMAT
.
format
(
date
)
+
"/"
+
article
.
optString
(
Keys
.
OBJECT_ID
)
+
".html"
;
ret
=
"/articles/"
+
DateFormatUtils
.
format
(
date
,
"yyyy/MM/dd"
)
+
"/"
+
article
.
optString
(
Keys
.
OBJECT_ID
)
+
".html"
;
}
if
(!
ret
.
startsWith
(
"/"
))
{
...
...
@@ -1102,7 +1097,7 @@ public final class ArticleMgmtService {
if
(!
oldPermalink
.
equals
(
ret
))
{
if
(
Strings
.
isEmptyOrNull
(
ret
))
{
ret
=
"/articles/"
+
PERMALINK_FORMAT
.
format
(
createDate
)
+
"/"
+
articleId
+
".html"
;
ret
=
"/articles/"
+
DateFormatUtils
.
format
(
createDate
,
"yyyy/MM/dd"
)
+
"/"
+
articleId
+
".html"
;
}
if
(!
ret
.
startsWith
(
"/"
))
{
...
...
core/src/main/java/org/b3log/solo/service/CommentMgmtService.java
View file @
76e018b7
...
...
@@ -23,6 +23,7 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.lang.StringEscapeUtils
;
import
org.apache.commons.lang.time.DateFormatUtils
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.Latkes
;
import
org.b3log.latke.event.Event
;
...
...
@@ -55,7 +56,7 @@ import org.json.JSONObject;
* Comment management service.
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.
3, Aug 12, 2012
* @version 1.0.0.
4, Jan 18, 2013
* @since 0.3.5
*/
public
final
class
CommentMgmtService
{
...
...
@@ -168,7 +169,7 @@ public final class CommentMgmtService {
final
Date
date
=
TimeZones
.
getTime
(
timeZoneId
);
comment
.
put
(
Comment
.
COMMENT_DATE
,
date
);
ret
.
put
(
Comment
.
COMMENT_DATE
,
Comment
.
DATE_FORMAT
.
format
(
date
));
ret
.
put
(
Comment
.
COMMENT_DATE
,
DateFormatUtils
.
format
(
date
,
"yyyy-MM-dd hh:mm:ss"
));
if
(!
Strings
.
isEmptyOrNull
(
originalCommentId
))
{
originalComment
=
commentRepository
.
get
(
originalCommentId
);
if
(
null
!=
originalComment
)
{
...
...
@@ -288,7 +289,7 @@ public final class CommentMgmtService {
final
Date
date
=
TimeZones
.
getTime
(
timeZoneId
);
comment
.
put
(
Comment
.
COMMENT_DATE
,
date
);
ret
.
put
(
Comment
.
COMMENT_DATE
,
Comment
.
DATE_FORMAT
.
format
(
date
));
ret
.
put
(
Comment
.
COMMENT_DATE
,
DateFormatUtils
.
format
(
date
,
"yyyy-MM-dd hh:mm:ss"
));
if
(!
Strings
.
isEmptyOrNull
(
originalCommentId
))
{
originalComment
=
commentRepository
.
get
(
originalCommentId
);
...
...
core/src/main/java/org/b3log/solo/service/InitService.java
View file @
76e018b7
...
...
@@ -25,6 +25,8 @@ import java.util.Set;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
org.apache.commons.lang.StringEscapeUtils
;
import
org.apache.commons.lang.time.DateFormatUtils
;
import
org.apache.commons.lang.time.DateUtils
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.Latkes
;
import
org.b3log.latke.RuntimeEnv
;
...
...
@@ -57,7 +59,7 @@ import org.json.JSONObject;
* B3log Solo initialization service.
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.1.
3, Jan 4
, 2013
* @version 1.0.1.
4, Jan 18
, 2013
* @since 0.4.0
*/
public
final
class
InitService
{
...
...
@@ -345,11 +347,11 @@ public final class InitService {
*/
public
void
archiveDate
(
final
JSONObject
article
)
throws
RepositoryException
{
final
Date
createDate
=
(
Date
)
article
.
opt
(
Article
.
ARTICLE_CREATE_DATE
);
final
String
createDateString
=
ArchiveDate
.
DATE_FORMAT
.
format
(
createDate
);
final
String
createDateString
=
DateFormatUtils
.
format
(
createDate
,
"yyyy/MM"
);
final
JSONObject
archiveDate
=
new
JSONObject
();
try
{
archiveDate
.
put
(
ArchiveDate
.
ARCHIVE_TIME
,
ArchiveDate
.
DATE_FORMAT
.
parse
(
createDateString
).
getTime
());
archiveDate
.
put
(
ArchiveDate
.
ARCHIVE_TIME
,
DateUtils
.
parseDate
(
createDateString
,
new
String
[]
{
"yyyy/MM"
}
).
getTime
());
archiveDate
.
put
(
ArchiveDate
.
ARCHIVE_DATE_ARTICLE_COUNT
,
1
);
archiveDate
.
put
(
ArchiveDate
.
ARCHIVE_DATE_PUBLISHED_ARTICLE_COUNT
,
1
);
...
...
core/src/main/java/org/b3log/solo/util/TimeZones.java
View file @
76e018b7
...
...
@@ -19,15 +19,13 @@ package org.b3log.solo.util;
import
java.util.Date
;
import
java.util.TimeZone
;
import
org.b3log.latke.util.freemarker.Templates
;
import
org.b3log.solo.model.ArchiveDate
;
import
org.b3log.solo.model.Comment
;
/**
* Time zone utilities.
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.
3, Dec 29, 2011
* @version 1.0.0.
4, Jan 18, 2013
*/
public
final
class
TimeZones
{
...
...
@@ -64,8 +62,6 @@ public final class TimeZones {
TimeZone
.
setDefault
(
timeZone
);
System
.
setProperty
(
"user.timezone"
,
timeZoneId
);
ArchiveDate
.
DATE_FORMAT
.
setTimeZone
(
timeZone
);
Comment
.
DATE_FORMAT
.
setTimeZone
(
timeZone
);
Templates
.
MAIN_CFG
.
setTimeZone
(
timeZone
);
Templates
.
MOBILE_CFG
.
setTimeZone
(
timeZone
);
}
...
...
core/src/test/java/org/b3log/solo/repository/impl/ArchiveDateRepositoryImplTestCase.java
View file @
76e018b7
...
...
@@ -17,8 +17,10 @@ package org.b3log.solo.repository.impl;
import
java.util.List
;
import
junit.framework.Assert
;
import
org.apache.commons.lang.time.DateUtils
;
import
org.b3log.latke.repository.Transaction
;
import
org.b3log.solo.AbstractTestCase
;
import
org.b3log.solo.SoloServletListener
;
import
org.b3log.solo.model.ArchiveDate
;
import
org.b3log.solo.repository.ArchiveDateRepository
;
import
org.json.JSONObject
;
...
...
@@ -28,7 +30,7 @@ import org.testng.annotations.Test;
* {@link ArchiveDateRepositoryImpl} test case.
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.
0, Dec 31, 2011
* @version 1.0.0.
1, Jan 18, 2013
*/
@Test
(
suiteName
=
"repository"
)
public
class
ArchiveDateRepositoryImplTestCase
extends
AbstractTestCase
{
...
...
@@ -44,7 +46,7 @@ public class ArchiveDateRepositoryImplTestCase extends AbstractTestCase {
final
JSONObject
archiveDate
=
new
JSONObject
();
archiveDate
.
put
(
ArchiveDate
.
ARCHIVE_TIME
,
ArchiveDate
.
DATE_FORMAT
.
parse
(
"2011/12"
).
getTime
());
archiveDate
.
put
(
ArchiveDate
.
ARCHIVE_TIME
,
DateUtils
.
parseDate
(
"2011/12"
,
new
String
[]
{
"yyyy/MM"
}
).
getTime
());
archiveDate
.
put
(
ArchiveDate
.
ARCHIVE_DATE_ARTICLE_COUNT
,
1
);
archiveDate
.
put
(
ArchiveDate
.
ARCHIVE_DATE_PUBLISHED_ARTICLE_COUNT
,
1
);
...
...
@@ -68,5 +70,6 @@ public class ArchiveDateRepositoryImplTestCase extends AbstractTestCase {
final
JSONObject
archiveDate
=
archiveDateRepository
.
getByArchiveDate
(
"2011/12"
);
Assert
.
assertNotNull
(
archiveDate
);
System
.
out
.
println
(
archiveDate
.
toString
(
SoloServletListener
.
JSON_PRINT_INDENT_FACTOR
));
}
}
core/src/test/java/org/b3log/solo/service/ArchiveDateQueryServiceTestCase.java
View file @
76e018b7
...
...
@@ -17,7 +17,8 @@ package org.b3log.solo.service;
import
java.util.Date
;
import
java.util.List
;
import
org.apache.commons.lang.time.DateFormatUtils
;
import
org.apache.commons.lang.time.DateUtils
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.model.User
;
import
org.b3log.solo.AbstractTestCase
;
...
...
@@ -80,10 +81,10 @@ public class ArchiveDateQueryServiceTestCase extends AbstractTestCase {
public
void
getByArchiveDateString
()
throws
Exception
{
final
ArchiveDateQueryService
archiveDateQueryService
=
ArchiveDateQueryService
.
getInstance
();
final
String
archiveDateString
=
ArchiveDate
.
DATE_FORMAT
.
format
(
new
Date
()
);
final
String
archiveDateString
=
DateFormatUtils
.
format
(
new
Date
(),
"yyyy/MM"
);
final
JSONObject
result
=
archiveDateQueryService
.
getByArchiveDateString
(
archiveDateString
);
Assert
.
assertNotNull
(
result
);
Assert
.
assertEquals
(
result
.
getJSONObject
(
ArchiveDate
.
ARCHIVE_DATE
).
getLong
(
ArchiveDate
.
ARCHIVE_TIME
),
ArchiveDate
.
DATE_FORMAT
.
parse
(
archiveDateString
).
getTime
());
DateUtils
.
parseDate
(
archiveDateString
,
new
String
[]
{
"yyyy/MM"
}
).
getTime
());
}
}
war/src/main/webapp/WEB-INF/.gitignore
deleted
100644 → 0
View file @
a7edadae
/lib
war/src/main/webapp/article-pwd.ftl
View file @
76e018b7
...
...
@@ -50,7 +50,7 @@
<div
class=
"footerWrapper"
>
<div
class=
"footer"
>
©
${year} -
<a
href=
"${
blogHost
}"
>
${blogTitle}
</a><br/>
©
${year} -
<a
href=
"${
servePath
}"
>
${blogTitle}
</a><br/>
Powered by
<a
href=
"http://b3log.org"
target=
"_blank"
>
${b3logLabel}
...
...
war/src/main/webapp/init.ftl
View file @
76e018b7
...
...
@@ -241,6 +241,7 @@
(
function
()
{
try
{
$
(
"
#userEmail
"
).
focus
();
$
(
"
input
"
).
keypress
(
function
(
event
)
{
if
(
event
.
keyCode
===
13
)
{
event
.
preventDefault
();
...
...
war/src/main/webapp/kill-browser.ftl
View file @
76e018b7
...
...
@@ -35,7 +35,7 @@
<div
class=
"footerWrapper"
>
<div
class=
"footer"
>
©
${year} -
<a
href=
"${
blogHost
}"
>
${blogTitle}
</a><br/>
©
${year} -
<a
href=
"${
servePath
}"
>
${blogTitle}
</a><br/>
Powered by
<a
href=
"http://b3log.org"
target=
"_blank"
>
${b3logLabel}
...
...
war/src/main/webapp/login.ftl
View file @
76e018b7
...
...
@@ -68,7 +68,7 @@
</div>
<div
class=
"footerWrapper"
>
<div
class=
"footer"
>
©
${year} -
<a
href=
"${
blogHost
}"
>
${blogTitle}
</a><br/>
©
${year} -
<a
href=
"${
servePath
}"
>
${blogTitle}
</a><br/>
Powered by
<a
href=
"http://b3log.org"
target=
"_blank"
>
${b3logLabel}
...
...
war/src/main/webapp/skins/timeline/article-list.ftl
View file @
76e018b7
<ul>
<div class="content articles">
<div class="vertical"></div>
<#list articles as article>
<li class="article<#if !article_has_next> article-last</#if>">
<div class="article-title">
<article<#if !article_has_next> class="last"</#if>>
<div>
<div class="dot"></div>
<div class="arrow"></div>
<time>
<span>
${article.articleCreateDate?string("yy-MM-dd HH:mm")}
</span>
</time>
<h2>
<a rel="bookmark"
class="ft-gray"
href="${servePath}${article.articlePermalink}">
<a rel="bookmark" href="${servePath}${article.articlePermalink}">
${article.articleTitle}
</a>
<#if article.hasUpdated>
...
...
@@ -17,41 +25,35 @@
</sup>
</#if>
</h2>
<div class="right">
<a rel="nofollow" class="ft-gray" href="${servePath}${article.articlePermalink}#comments">
${article.articleCommentCount} ${commentLabel}
</a>
<a rel="nofollow" class="ft-gray" href="${servePath}${article.articlePermalink}">
${article.articleViewCount} ${viewLabel}
</a>
</div>
<div class="clear"></div>
</div>
<div class="article-body">
<div id="abstract${article.oId}">
<p>
${article.articleAbstract}
</div>
<div id="content${article.oId}" class="none"></div>
</div>
<div class="right ft-gray">
<#if article.hasUpdated>
${article.articleUpdateDate?string("yy-MM-dd HH:mm")}
</p>
<span class="ico-tags" title="${tagLabel}">
<#list article.articleTags?split(",") as articleTag><a rel="category tag" href="${servePath}/tags/${articleTag?url('UTF-8')}">${articleTag}</a><#if articleTag_has_next>,</#if></#list>
</span>
<span class="ico-author" title="${authorLabel}">
<a rel="author" href="${servePath}/authors/${article.authorId}">${article.authorName}</a>
</span>
<span class="ico-comment" title="${commentLabel}">
<#if article.articleCommentCount == 0>
<a rel="nofollow" href="${servePath}${article.articlePermalink}#comments">
${noCommentLabel}
</a>
<#else>
${article.articleCreateDate?string("yy-MM-dd HH:mm")}
<a rel="nofollow" href="${servePath}${article.articlePermalink}#comments">
${article.articleCommentCount}
</a>
</#if>
<a rel="nofollow" href="${servePath}/authors/${article.authorId}">${article.authorName}</a>
</div>
<div class="left ft-gray">
${tag1Label}
<#list article.articleTags?split(",") as articleTag>
<a rel="tag" href="${servePath}/tags/${articleTag?url('UTF-8')}">
${articleTag}</a><#if articleTag_has_next>, </#if>
</#list>
</span>
<span class="ico-view" title="${viewLabel}">
<a rel="nofollow" href="${servePath}${article.articlePermalink}">
${article.articleViewCount}
</a>
</span>
</div>
<div class="clear"></div>
</li>
</article>
</#list>
</
ul
>
</
div
>
<#if paginationCurrentPageNum != paginationPageCount && 0 != paginationPageCount>
<div class="article-next ft-gray" onclick="getNextPage()" data-page="${paginationCurrentPageNum}">${moreLabel}</div>
</#if>
\ No newline at end of file
war/src/main/webapp/skins/timeline/css/timeline.css
View file @
76e018b7
...
...
@@ -28,13 +28,11 @@ html, body {
}
body
{
font-family
:
Verdana
,
arial
,
'\5fae\8f6f\96c5\9ed1'
;
font-size
:
14px
;
font
:
0.81em
Verdana
,
arial
,
'\5fae\8f6f\96c5\9ed1'
;
background
:
url("../../timeline/images/bg.png")
repeat
scroll
0
0
#DEE4EA
;
color
:
#666666
;
}
button
,
input
,
select
,
...
...
@@ -46,6 +44,22 @@ textarea {
outline
:
none
;
}
a
{
color
:
#6599C6
;
outline
:
medium
none
;
text-decoration
:
none
;
transition
:
color
1s
ease
0s
;
}
a
:hover
{
color
:
#000
;
}
img
{
max-width
:
100%
;
vertical-align
:
middle
;
}
::selection
{
background-color
:
#D5D5D5
;
color
:
#FCFCFC
;
...
...
@@ -77,6 +91,10 @@ textarea {
overflow
:
hidden
;
}
.none
{
display
:
none
;
}
.fn-clear
:before
,
.fn-clear
:after
{
display
:
table
;
...
...
@@ -201,8 +219,231 @@ textarea {
}
/* end common */
/* start icon */
.articles
.arrow
,
.ico-author
,
.ico-tags
,
.ico-comment
,
.ico-top
,
.ico-view
,
#search
{
background-repeat
:
no-repeat
;
background-image
:
url("../../timeline/images/icons.png")
;
}
.ico-author
,
.ico-tags
,
.ico-comment
,
.ico-view
{
padding-left
:
20px
;
background-position
:
-1px
-63px
;
margin-right
:
10px
;
}
.ico-tags
{
background-position
:
-1px
-83px
;
}
.ico-comment
{
background-position
:
-1px
-41px
;
}
.ico-view
{
background-position
:
0
-122px
;
}
#search
{
background-position
:
5px
-138px
;
border
:
medium
none
;
border-radius
:
12px
12px
12px
12px
;
box-shadow
:
0
1px
0
rgba
(
0
,
0
,
0
,
0.4
)
inset
,
0
1px
0
rgba
(
255
,
255
,
255
,
0.1
);
color
:
#A5A099
;
height
:
22px
;
margin-top
:
14px
;
padding-left
:
25px
;
transition
:
width
0.7s
ease
0s
;
width
:
60px
;
}
#search
:focus
{
color
:
#333
;
width
:
140px
;
}
.ico-top
{
background-color
:
#363A3D
;
background-position
:
4px
-100px
;
border-radius
:
20em
20em
20em
20em
;
bottom
:
60px
;
box-shadow
:
0
-1px
2px
rgba
(
0
,
0
,
0
,
0.3
)
inset
,
0
1px
0
rgba
(
255
,
255
,
255
,
0.15
);
height
:
25px
;
position
:
fixed
;
left
:
90%
;
width
:
25px
;
cursor
:
pointer
;
}
/* end icon */
/* start framework */
.wrapper
{
margin
:
0
auto
;
width
:
80%
;
min-width
:
500px
;
}
.header
{
background-color
:
#BFBFBF
;
background-image
:
url("../../timeline/images/nav-bg.png")
,
linear-gradient
(
to
bottom
,
#CCCCCC
0%
,
#A9A9A9
100%
);
border-bottom
:
1px
solid
#898989
;
box-shadow
:
0
-1px
0
rgba
(
255
,
255
,
255
,
0.3
)
inset
,
0
1px
1px
rgba
(
0
,
0
,
0
,
0.2
);
height
:
50px
;
overflow
:
hidden
;
}
.content
{
margin
:
50px
0
;
}
.footer
{
background-color
:
#363A3D
;
border-top
:
1px
solid
#232323
;
padding
:
20px
0
;
color
:
#ddd
;
font-size
:
80%
;
}
.footer
a
{
color
:
#9CC0DE
;
}
.footer
a
:hover
{
text-decoration
:
underline
;
}
/* end framework */
/* start header */
.header
.title
{
font-size
:
150%
;
margin
:
3px
0
0
;
}
.header
a
{
color
:
#414141
;
text-shadow
:
0
1px
0
rgba
(
255
,
255
,
255
,
0.7
);
}
.header
a
:hover
{
color
:
#000
;
}
.header
li
{
float
:
left
;
list-style-type
:
none
;
margin-right
:
20px
;
}
/* end header */
/* start article list */
.articles
{
position
:
relative
;
}
.articles
>
.vertical
{
background-color
:
#9EB5C6
;
border-radius
:
20em
20em
20em
20em
;
box-shadow
:
0
0
1px
0
rgba
(
0
,
0
,
0
,
0.5
)
inset
,
0
0
1px
0
rgba
(
255
,
255
,
255
,
0.6
);
height
:
100%
;
left
:
50%
;
margin-left
:
-3px
;
position
:
absolute
;
top
:
0
;
width
:
6px
}
.articles
>
article
{
width
:
50%
;
position
:
absolute
;
}
.articles
>
article
>
div
{
background-color
:
#FFFFFF
;
border
:
1px
solid
#BEC3C7
;
border-radius
:
5px
5px
5px
5px
;
margin-bottom
:
20px
;
padding
:
15px
;
box-shadow
:
0
1px
1px
rgba
(
0
,
0
,
0
,
0.1
);
}
.articles
>
article
.l
>
div
{
margin-right
:
30px
;
}
.articles
>
article
.r
>
div
{
margin-left
:
30px
;
position
:
relative
;
}
.articles
.dot
{
background-color
:
#FFFFFF
;
border
:
3px
solid
#60829F
;
border-radius
:
20em
20em
20em
20em
;
height
:
6px
;
position
:
absolute
;
right
:
-6px
;
top
:
22px
;
width
:
6px
;
}
.articles
.r
.dot
{
left
:
-37px
;
right
:
inherit
;
}
.articles
.arrow
{
height
:
15px
;
position
:
absolute
;
right
:
22px
;
top
:
21px
;
width
:
9px
;
}
.articles
.r
.arrow
{
background-position
:
0
-22px
;
left
:
-9px
;
right
:
inherit
}
.articles
>
article
time
{
top
:
-8px
;
left
:
50%
;
position
:
absolute
;
}
.articles
>
article
time
>
span
{
background-color
:
#FFFFFF
;
border
:
1px
solid
#A8A9A9
;
border-radius
:
20em
20em
20em
20em
;
font-size
:
80%
;
margin-left
:
-56px
;
padding
:
5px
10px
;
}
.articles
>
article
>
div
>
h2
{
margin
:
0
;
}
.articles
>
article
>
div
>
h2
>
a
{
color
:
#000
;
text-decoration
:
none
;
}
.articles
>
article
>
div
>
span
>
a
{
color
:
#999999
;
font-size
:
80%
;
text-decoration
:
none
;
}
.articles
>
article
>
div
>
span
>
a
:hover
{
color
:
#000
;
}
/* end article list */
war/src/main/webapp/skins/timeline/footer.ftl
View file @
76e018b7
...
...
@@ -32,7 +32,7 @@
<div class="clear"></div>
</div>
</div>
<div
id="goTop" onclick="Util.goTop()">TOP
</div>
<div
class="ico-top none" onclick="Util.goTop()" title="TOP">
</div>
<script type="text/javascript">
var latkeConfig = {
"servePath": "${servePath}",
...
...
@@ -40,7 +40,7 @@
};
var Label = {
"tag
1Label": "${tag1
Label}",
"tag
Label": "${tag
Label}",
"viewLabel": "${viewLabel}",
"commentLabel": "${commentLabel}",
"topArticleLabel": "${topArticleLabel}",
...
...
war/src/main/webapp/skins/timeline/header.ftl
View file @
76e018b7
<div class="header">
<div class="wrapper
banne
r">
<div class="wrapper
fn-clea
r">
<div class="left">
<h1>
<a
class="title ft-gray"
href="${servePath}">
<h1
class="title"
>
<a href="${servePath}">
${blogTitle}
</a>
</h1>
<span
class="sub-title"
>${blogSubtitle}</span>
<span>${blogSubtitle}</span>
</div>
<#if "" != noticeBoard>
<div class="notice">
${noticeBoard}
</div>
</#if>
<div class="clear"></div>
</div>
<div class="nav">
<div class="wrapper">
<ul>
<li>
<a rel="nofollow" href="${servePath}/">${indexLabel}</a>
</li>
<ul class="left">
<#list pageNavigations as page>
<li>
<a href="${page.pagePermalink}" target="${page.pageOpenTarget}">${page.pageTitle}</a>
...
...
@@ -39,10 +27,10 @@
<a href="${servePath}/links.html">${linkLabel}</a>
</li>
<li>
<a rel="alternate" href="${servePath}/blog-articles-feed.do">Atom
<img src="${staticServePath}/images/feed.png" alt="Atom"/></a>
<a rel="alternate" href="${servePath}/blog-articles-feed.do">Atom
<img src="${staticServePath}/images/feed.png" alt="Atom"/></a>
</li>
</ul>
<form
target="_blank" method="get" action="http://www.google.com/search">
<form class="right"
target="_blank" method="get" action="http://www.google.com/search">
<input id="search" type="text" name="q" />
<input type="submit" name="btnG" value="" class="none" />
<input type="hidden" name="oe" value="UTF-8" />
...
...
@@ -50,7 +38,5 @@
<input type="hidden" name="newwindow" value="0" />
<input type="hidden" name="sitesearch" value="${blogHost}" />
</form>
<div class="clear"></div>
</div>
</div>
</div>
\ No newline at end of file
war/src/main/webapp/skins/timeline/images/icons.png
View replaced file @
a7edadae
View file @
76e018b7
5.77 KB
|
W:
|
H:
2.46 KB
|
W:
|
H:
2-up
Swipe
Onion skin
war/src/main/webapp/skins/timeline/images/nav-bg.png
0 → 100644
View file @
76e018b7
6.56 KB
war/src/main/webapp/skins/timeline/index.ftl
View file @
76e018b7
...
...
@@ -14,5 +14,33 @@
<
#include
"
article-list
.
ftl
"
>
</div>
<
#include
"
footer
.
ftl
"
>
<script>
timeline
.
$articles
=
$
(
"
.articles
"
);
$
(
window
).
resize
(
function
()
{
timeline
.
colH
=
[
0
,
20
];
timeline
.
$articles
.
find
(
"
article
"
).
each
(
function
()
{
var
$it
=
$
(
this
),
isLeft
=
timeline
.
colH
[
1
]
>
timeline
.
colH
[
0
],
left
=
isLeft
?
0
:
Math
.
floor
(
timeline
.
$articles
.
width
()
/
2
),
top
=
isLeft
?
timeline
.
colH
[
0
]
:
timeline
.
colH
[
1
];
$it
.
css
({
"
left
"
:
left
+
"
px
"
,
"
top
"
:
top
+
"
px
"
});
if
(
isLeft
)
{
$it
.
addClass
(
"
l
"
);
}
else
{
$it
.
addClass
(
"
r
"
);
}
timeline
.
colH
[(
isLeft
?
'
0
'
:
'
1
'
)]
+=
parseInt
(
$it
.
outerHeight
(
true
));
});
timeline
.
$articles
.
height
(
timeline
.
colH
[
0
]
>
timeline
.
colH
[
1
]
?
timeline
.
colH
[
0
]
:
timeline
.
colH
[
1
]);
});
$
(
window
).
resize
();
$
(
window
).
resize
();
</script>
</body>
</html>
war/src/main/webapp/skins/timeline/js/timeline.js
View file @
76e018b7
...
...
@@ -20,6 +20,56 @@
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.0.1, Jan 14, 2013
*/
var
timeline
=
{
$articles
:
$
(
"
.articles
"
),
_COLH
:
[
0
,
20
],
_layoutArticleList
:
function
()
{
timeline
.
$articles
.
find
(
"
article
"
).
each
(
function
()
{
var
$it
=
$
(
this
),
isLeft
=
timeline
.
colH
[
1
]
>
timeline
.
colH
[
0
],
left
=
isLeft
?
0
:
Math
.
floor
(
timeline
.
$articles
.
width
()
/
2
),
top
=
isLeft
?
timeline
.
colH
[
0
]
:
timeline
.
colH
[
1
];
$it
.
css
({
"
left
"
:
left
+
"
px
"
,
"
top
"
:
top
+
"
px
"
});
if
(
isLeft
)
{
$it
.
addClass
(
"
l
"
);
}
else
{
$it
.
addClass
(
"
r
"
);
}
timeline
.
colH
[(
isLeft
?
'
0
'
:
'
1
'
)]
+=
parseInt
(
$it
.
outerHeight
(
true
));
});
timeline
.
$articles
.
height
(
timeline
.
colH
[
0
]
>
timeline
.
colH
[
1
]
?
timeline
.
colH
[
0
]
:
timeline
.
colH
[
1
]);
timeline
.
colH
=
timeline
.
_COLH
;
},
_initArticleList
:
function
()
{
$
(
window
).
resize
(
function
()
{
timeline
.
_layoutArticleList
();
});
$
(
window
).
resize
();
$
(
window
).
resize
();
},
init
:
function
()
{
$
(
window
).
scroll
(
function
()
{
if
(
$
(
window
).
scrollTop
()
>
60
)
{
$
(
"
.ico-top
"
).
show
();
}
else
{
$
(
"
.ico-top
"
).
hide
();
}
});
if
(
$
(
"
.articles
"
).
length
===
1
)
{
timeline
.
_initArticleList
();
}
}
};
var
goTranslate
=
function
()
{
window
.
open
(
"
http://translate.google.com/translate?sl=auto&tl=auto&u=
"
+
location
.
href
);
};
...
...
@@ -28,4 +78,6 @@ var goTranslate = function () {
Util
.
init
();
Util
.
replaceSideEm
(
$
(
"
.recent-comments-content
"
));
Util
.
buildTags
(
"
tagsSide
"
);
timeline
.
init
();
})();
\ No newline at end of file
war/src/main/webapp/skins/timeline/lang/lang_en_US.properties
View file @
76e018b7
...
...
@@ -60,6 +60,7 @@ em12Label=Heart
em13Label
=
Heart Broken
em14Label
=
Devil
commentLabel
=
Comment
noCommentLabel
=
No Comment
viewLabel
=
View
authorLabel
=
Author
previousPageLabel
=
Previous Page
...
...
war/src/main/webapp/skins/timeline/lang/lang_zh_CN.properties
View file @
76e018b7
...
...
@@ -62,6 +62,7 @@ em12Label=\u7231\u5fc3
em13Label
=
\u
5fc3
\u
788e
em14Label
=
\u
9b54
\u
9b3c
commentLabel
=
\u
8bc4
\u
8bba
noCommentLabel
=
\u
65e0
\u
8bc4
\u
8bba
viewLabel
=
\u
6d4f
\u
89c8
authorLabel
=
\u
4f5c
\u8005
previousPageLabel=
\u
4e0a
\u
4e00
\u9875
...
...
@@ -70,7 +71,7 @@ firstPageLabel=\u7b2c\u4e00\u9875
lastPageLabel=
\u6700\u
540e
\u
4e00
\u9875
archive1Label=
\u
5b58
\u6863\u
ff1a
author1Label
=
\u
4f5c
\u8005\u
ff1a
tag
1Label
=
\u6807\u
7b7e
\u
ff1a
tag
Label
=
\u6807\u
7b7e
sorryLabel
=
\u
5bf9
\u
4e0d
\u
8d77
\u
ff01
notFoundLabel
=
\u
627e
\u
4e0d
\u5230\u
ff01
returnTo1Label
=
\u
8fd4
\u
56de
\u
ff1a
...
...
war/src/main/webapp/top-bar.ftl
View file @
76e018b7
...
...
@@ -7,7 +7,6 @@
background-image: -webkit-linear-gradient(#FFFFFF,#E5E5E5);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#FFFFFF', endColorstr='#E5E5E5');
border-bottom: 1px solid #E5E5E5;
height: 26px;
line-height: 26px;
display: none;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment