Commit 83f6eaec by Takuya Ogawa

Merge branch 'topic/1.9.2.6_TEC_3_33783_ha' into 'feature/1.9.2.6_TEC_3'

#33783(コンテンツタイトル表示カスタマイズ) + 詳細画面(コンテンツリスト、コンテンツ検索リスト、閲覧履歴)

See merge request abook_web/web-viewer!37
parents 0ef45c62 c2ed17b5
...@@ -3306,3 +3306,43 @@ COMMON.isAuthoringPreview = function() { ...@@ -3306,3 +3306,43 @@ COMMON.isAuthoringPreview = function() {
} }
}; };
/*
* TECカスタマイズ(2行表示、3点リーダー、font-size設定)
*
*/
COMMON.fixTitleToDottedLine = function(titleEle, fontSize, height) {
// 表示用タイトルのスタイル設定
titleEle.css({
"white-space": "unset",
"text-overflow": "unset",
"overflow": "hidden",
"word-break": "break-all",
"height": height + "px",
"font-size": fontSize + "px",
});
// コンテンツリストサムネール表示の場合、widthをautoに設定
if (titleEle.hasClass("content-title")) titleEle.css("width", "100%");
// オリジナルの文章を取得する
var html = titleEle.html();
// 対象の要素を、高さにautoを指定し非表示で複製する
var cloneEle = titleEle.clone();
cloneEle.css({
display: 'none',
position: 'absolute',
overflow: 'visible'
}).width(titleEle.width()).height("auto");
// 一旦追加
titleEle.after(cloneEle);
// 指定した高さになるまで、1文字ずつ消去していく
while((html.length > 0) && (cloneEle.height() > titleEle.height())) {
html = html.substr(0, html.length - 1);
cloneEle.html(html + '...');
}
// 文章を入れ替えて、複製した要素を削除する
titleEle.html(cloneEle.html());
cloneEle.remove();
}
...@@ -55,12 +55,12 @@ ...@@ -55,12 +55,12 @@
.sectiondetail #book_data ul { .sectiondetail #book_data ul {
list-style:none; list-style:none;
line-height:1em; line-height:1em;
/*margin:0 0 0 42px;*/
margin:0 0 0 52px;
padding:0; padding:0;
} }
.sectiondetail #book_data ul li { .sectiondetail #book_data ul li {
display:block; display:block;
margin: 0 auto;
text-align: center;
} }
.sectiondetail #book_data ul .title { .sectiondetail #book_data ul .title {
margin-bottom:19px; margin-bottom:19px;
...@@ -197,13 +197,13 @@ ...@@ -197,13 +197,13 @@
text-align: center; text-align: center;
} }
.sectiondetailnopdf #book_data ul .date { .sectiondetailnopdf #book_data ul .date {
margin-bottom: 20px; margin: 0 auto 32px auto;
margin-left: 10px; text-align: center;
} }
.sectiondetailnopdf #book_data ul .explain { .sectiondetailnopdf #book_data ul .explain {
margin-bottom: 32px; margin: 0 auto 32px auto;
text-align: center;
line-height: 1.3em; line-height: 1.3em;
margin-left: 10px;
} }
.sectiondetailnopdf #book_data .read_btn a.read { .sectiondetailnopdf #book_data .read_btn a.read {
...@@ -212,7 +212,6 @@ ...@@ -212,7 +212,6 @@
border-radius: 6px; border-radius: 6px;
display: inline-block; display: inline-block;
padding: 2px 27px; padding: 2px 27px;
margin-left: 45px;
text-decoration: none; text-decoration: none;
} }
.sectiondetailnopdf #book_data .read_btn a.read:hover { .sectiondetailnopdf #book_data .read_btn a.read:hover {
...@@ -468,4 +467,5 @@ ...@@ -468,4 +467,5 @@
.sectiondetailnopdf #book_list ul+ul { border-top:1px dotted #CCC; } .sectiondetailnopdf #book_list ul+ul { border-top:1px dotted #CCC; }
.sectiondetailnopdf #book_data .read_btn { .sectiondetailnopdf #book_data .read_btn {
/*margin:30px 0 0 80px;*/ /*margin:30px 0 0 80px;*/
text-align: center;
} }
...@@ -285,6 +285,9 @@ DETAIL.showContentNotPDF = function(displayData) { ...@@ -285,6 +285,9 @@ DETAIL.showContentNotPDF = function(displayData) {
}; };
imgTemp.src = displayData.contentThumbnail; imgTemp.src = displayData.contentThumbnail;
// TECカスタマイズ(2行表示、3点リーダー、font-size設定)
COMMON.fixTitleToDottedLine($('#txtContentTitle'), 11, 30);
}; };
//End Function : No.12 -- Editor : Viet Nguyen -- Date : 08/01/2013 -- Summary : Create new function to return content type of content. //End Function : No.12 -- Editor : Viet Nguyen -- Date : 08/01/2013 -- Summary : Create new function to return content type of content.
...@@ -336,6 +339,9 @@ DETAIL.showContent = function(displayData) { ...@@ -336,6 +339,9 @@ DETAIL.showContent = function(displayData) {
//insertRow(imgSample, pages[nIndex].pageText, pages[nIndex].pageNo); //insertRow(imgSample, pages[nIndex].pageText, pages[nIndex].pageNo);
DETAIL.insertRow(displayData.pages[nIndex].pageThumbnail, COMMON.truncate(COMMON.getLines(displayData.pages[nIndex].pageText, 3), 45), displayData.pages[nIndex].pageNo); //55 DETAIL.insertRow(displayData.pages[nIndex].pageThumbnail, COMMON.truncate(COMMON.getLines(displayData.pages[nIndex].pageText, 3), 45), displayData.pages[nIndex].pageNo); //55
} }
// TECカスタマイズ(2行表示、3点リーダー、font-size設定)
COMMON.fixTitleToDottedLine($('#txtContentTitle'), 11, 30);
}; };
DETAIL.insertRow = function(pageThumbnail, pageText, pageNo) { DETAIL.insertRow = function(pageThumbnail, pageText, pageNo) {
......
...@@ -1692,6 +1692,12 @@ HOME.renderContent = function(id, text, division, type, order, offset, limit, ca ...@@ -1692,6 +1692,12 @@ HOME.renderContent = function(id, text, division, type, order, offset, limit, ca
// I18N.changeLanguage(ClientData.userInfo_language()); // I18N.changeLanguage(ClientData.userInfo_language());
I18N.i18nReplaceText(); I18N.i18nReplaceText();
// TECカスタマイズ(2行表示、3点リーダー、font-sizeを設定)
var className = HOME.isShowBookShelf ? ".content-title:visible" : ".content-list:visible";
$(className).each(function() {
COMMON.fixTitleToDottedLine($(this), 11, 24);
});
}); });
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment