Commit f914d975 by Masaru Abe

テスト対応

parent 317690b8
......@@ -13,6 +13,9 @@ BOOKMARK.bookmark_errorContent = [];
// Contain contents
BOOKMARK.collection_contents = [];
BOOKMARK.searchDivision = 1;
BOOKMARK.sortType = 2;
// Init function of page
$(document).ready(function () {
......@@ -68,8 +71,8 @@ $(document).ready(function () {
BOOKMARK.HideSorting();
// Default sort is タイトル名, default is asc
ClientData.sortOpt_searchDivision(1);
ClientData.sortOpt_sortType(2);
ClientData.sortOpt_searchDivision(BOOKMARK.searchDivision);
ClientData.sortOpt_sortType(BOOKMARK.sortType);
BOOKMARK.dspTitleNm_Click();
}
else {
......@@ -104,6 +107,50 @@ $(document).ready(function () {
});
BOOKMARK.refreshView = function() {
// Synchronize bookmarks with server
BOOKMARK.SyncContent();
// Collection all detail of pages
BOOKMARK.bookmark_collectAllPages();
BOOKMARK.ClearGrid();
//if (ClientData.BookMarkData().length == 0) {
if(BOOKMARK.collection_contents.length == 0){
// Show error
$("#msgShioriNotExists").show();
$("#dspDelete").hide();
$("#dspDelete1").hide();
}
else {
$("#msgShioriNotExists").hide();
$("#dspDelete").show();
$("#dspDelete1").show();
}
// Default sort is タイトル名, default is asc
ClientData.sortOpt_searchDivision(BOOKMARK.searchDivision);
//前と同じ状態にするので逆転させる
if( BOOKMARK.sortType == 1 ){
BOOKMARK.sortType = 2;
} else {
BOOKMARK.sortType = 1;
}
ClientData.sortOpt_sortType(BOOKMARK.sortType);
if( BOOKMARK.searchDivision == 1 ){
BOOKMARK.dspTitleNm_Click();
} else if( BOOKMARK.searchDivision == 2 ){
BOOKMARK.dspTitleNmKn_Click();
} else {
BOOKMARK.dspPubDt_Click();
}
};
/*
----------------------------------------------------------------------------
Event groups [start]
......@@ -116,18 +163,20 @@ BOOKMARK.dspTitleNm_Click = function() {
if (ClientData.sortOpt_searchDivision() == 1) { // Name
if (ClientData.sortOpt_sortType() == 1) { // ASC
isAsc = false;
ClientData.sortOpt_sortType(2);
BOOKMARK.sortType = 2;
}
else {
isAsc = true;
ClientData.sortOpt_sortType(1);
BOOKMARK.sortType = 1;
}
}
else {
BOOKMARK.searchDivision = 1;
BOOKMARK.sortType = 1;
ClientData.sortOpt_searchDivision(1);
ClientData.sortOpt_sortType(1); // default is asc
isAsc = true;
}
ClientData.sortOpt_sortType(BOOKMARK.sortType);
BOOKMARK.SortTitleName(isAsc);
......@@ -140,18 +189,20 @@ BOOKMARK.dspTitleNmKn_Click = function() {
if (ClientData.sortOpt_searchDivision() == 2) { // Kana
if (ClientData.sortOpt_sortType() == 1) { // ASC
isAsc = false;
ClientData.sortOpt_sortType(2);
BOOKMARK.sortType = 2;
}
else {
isAsc = true;
ClientData.sortOpt_sortType(1);
BOOKMARK.sortType = 1;
}
}
else {
BOOKMARK.searchDivision = 2;
BOOKMARK.sortType = 1;
ClientData.sortOpt_searchDivision(2); // Kana
ClientData.sortOpt_sortType(1); // default is asc
isAsc = true;
}
ClientData.sortOpt_sortType(BOOKMARK.sortType);
BOOKMARK.SortTitleNameKana(isAsc);
......@@ -164,18 +215,19 @@ BOOKMARK.dspPubDt_Click = function() {
if (ClientData.sortOpt_searchDivision() == 3) { // Publish date
if (ClientData.sortOpt_sortType() == 1) { // ASC
isAsc = false;
ClientData.sortOpt_sortType(2);
BOOKMARK.sortType = 2;
}
else {
isAsc = true;
ClientData.sortOpt_sortType(1);
BOOKMARK.sortType = 1;
}
}
else {
BOOKMARK.sortType = 1;
ClientData.sortOpt_searchDivision(3); // Kana
ClientData.sortOpt_sortType(1); // default is asc
isAsc = true;
}
ClientData.sortOpt_sortType(BOOKMARK.sortType);
BOOKMARK.SortPubDate(isAsc);
......@@ -659,17 +711,17 @@ BOOKMARK.insertRow = function(contentid, pageThumbnail, pageTitle, pageText, pag
imgTemp.src = pageThumbnail;
if (hasMemo) {
newRow += '<li><a href="#">' + imgMemo + '</a></li>';
newRow += '<li><a href="#" style="cursor: default;">' + imgMemo + '</a></li>';
}
else {
newRow += '<li><a href="#">' + imgMemoHide + '</a></li>';
newRow += '<li><a href="#" style="cursor: default;">' + imgMemoHide + '</a></li>';
}
if (hasMarking) {
newRow += '<li><a href="#">' + imgMarking + '</a></li>';
newRow += '<li><a href="#" style="cursor: default;">' + imgMarking + '</a></li>';
}
else {
newRow += '<li><a href="#">' + imgMarkingHide + '</a></li>';
newRow += '<li><a href="#" style="cursor: default;">' + imgMarkingHide + '</a></li>';
}
......
......@@ -974,6 +974,9 @@ CONTENTVIEW.changePage = function(page_index) {
// Make sure page_index is number
page_index = Number(page_index);
if( page_index < 0 ){
page_index = 0;
}
if (page_index != CONTENTVIEW_GETDATA.getContent().pageIndex) {
......@@ -1827,16 +1830,26 @@ CONTENTVIEW.handleSliderBar = function() {
/* event change txtProcess */
$('#txtSlider').keydown(function (event) {
if (event.keyCode == 13) {
if (parseInt($('#txtSlider').val()) <= 0) {
var pageNo = parseInt($('#txtSlider').val());
if(isNaN(pageNo)){
pageNo = 1;
}
if(pageNo == 0){
pageNo = 1;
}
if (pageNo <= 0) {
$('#txtSlider').val('1');
} else if (parseInt($('#txtSlider').val()) > CONTENTVIEW_GENERAL.totalPage) {
} else if (pageNo > CONTENTVIEW_GENERAL.totalPage) {
$('#txtSlider').val(CONTENTVIEW_GENERAL.totalPage);
} else if (/\D/g.test($('#txtSlider').val())) {
$('#txtSlider').val('1');
} else {
$('#txtSlider').val(pageNo);
}
if (parseInt($('#txtSlider').val()) - 1 != CONTENTVIEW_GETDATA.getPageIndex()) {
$("#slider_page").slider("value", $('#txtSlider').val());
CONTENTVIEW.changePage($('#txtSlider').val() - 1);
}
......@@ -5537,6 +5550,9 @@ CONTENTVIEW.screenBack = function(){
$("#ws-body").show();
$("#topcontrol").show();
document.title = I18N.i18nText('dspShiori') + ' | ' + I18N.i18nText('sysAppTitle');
BOOKMARK.refreshView();
} else if( $('#history').length ){
HISTORY.cssInit();
$("#header-ws").show();
......@@ -5579,6 +5595,7 @@ CONTENTVIEW.initScreen = function(){
$('#divCacheLoading').hide();
$('#overlay').hide();
$('#dialogPopUp').hide();
$('#arrow').hide();
$("#wrapper *").unbind("click");
......
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