Commit f914d975 by Masaru Abe

テスト対応

parent 317690b8
...@@ -13,6 +13,9 @@ BOOKMARK.bookmark_errorContent = []; ...@@ -13,6 +13,9 @@ BOOKMARK.bookmark_errorContent = [];
// Contain contents // Contain contents
BOOKMARK.collection_contents = []; BOOKMARK.collection_contents = [];
BOOKMARK.searchDivision = 1;
BOOKMARK.sortType = 2;
// Init function of page // Init function of page
$(document).ready(function () { $(document).ready(function () {
...@@ -68,8 +71,8 @@ $(document).ready(function () { ...@@ -68,8 +71,8 @@ $(document).ready(function () {
BOOKMARK.HideSorting(); BOOKMARK.HideSorting();
// Default sort is タイトル名, default is asc // Default sort is タイトル名, default is asc
ClientData.sortOpt_searchDivision(1); ClientData.sortOpt_searchDivision(BOOKMARK.searchDivision);
ClientData.sortOpt_sortType(2); ClientData.sortOpt_sortType(BOOKMARK.sortType);
BOOKMARK.dspTitleNm_Click(); BOOKMARK.dspTitleNm_Click();
} }
else { else {
...@@ -104,6 +107,50 @@ $(document).ready(function () { ...@@ -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] Event groups [start]
...@@ -116,18 +163,20 @@ BOOKMARK.dspTitleNm_Click = function() { ...@@ -116,18 +163,20 @@ BOOKMARK.dspTitleNm_Click = function() {
if (ClientData.sortOpt_searchDivision() == 1) { // Name if (ClientData.sortOpt_searchDivision() == 1) { // Name
if (ClientData.sortOpt_sortType() == 1) { // ASC if (ClientData.sortOpt_sortType() == 1) { // ASC
isAsc = false; isAsc = false;
ClientData.sortOpt_sortType(2); BOOKMARK.sortType = 2;
} }
else { else {
isAsc = true; isAsc = true;
ClientData.sortOpt_sortType(1); BOOKMARK.sortType = 1;
} }
} }
else { else {
BOOKMARK.searchDivision = 1;
BOOKMARK.sortType = 1;
ClientData.sortOpt_searchDivision(1); ClientData.sortOpt_searchDivision(1);
ClientData.sortOpt_sortType(1); // default is asc
isAsc = true; isAsc = true;
} }
ClientData.sortOpt_sortType(BOOKMARK.sortType);
BOOKMARK.SortTitleName(isAsc); BOOKMARK.SortTitleName(isAsc);
...@@ -140,19 +189,21 @@ BOOKMARK.dspTitleNmKn_Click = function() { ...@@ -140,19 +189,21 @@ BOOKMARK.dspTitleNmKn_Click = function() {
if (ClientData.sortOpt_searchDivision() == 2) { // Kana if (ClientData.sortOpt_searchDivision() == 2) { // Kana
if (ClientData.sortOpt_sortType() == 1) { // ASC if (ClientData.sortOpt_sortType() == 1) { // ASC
isAsc = false; isAsc = false;
ClientData.sortOpt_sortType(2); BOOKMARK.sortType = 2;
} }
else { else {
isAsc = true; isAsc = true;
ClientData.sortOpt_sortType(1); BOOKMARK.sortType = 1;
} }
} }
else { else {
BOOKMARK.searchDivision = 2;
BOOKMARK.sortType = 1;
ClientData.sortOpt_searchDivision(2); // Kana ClientData.sortOpt_searchDivision(2); // Kana
ClientData.sortOpt_sortType(1); // default is asc
isAsc = true; isAsc = true;
} }
ClientData.sortOpt_sortType(BOOKMARK.sortType);
BOOKMARK.SortTitleNameKana(isAsc); BOOKMARK.SortTitleNameKana(isAsc);
//changeStatusSort(this, isAsc); //changeStatusSort(this, isAsc);
...@@ -164,18 +215,19 @@ BOOKMARK.dspPubDt_Click = function() { ...@@ -164,18 +215,19 @@ BOOKMARK.dspPubDt_Click = function() {
if (ClientData.sortOpt_searchDivision() == 3) { // Publish date if (ClientData.sortOpt_searchDivision() == 3) { // Publish date
if (ClientData.sortOpt_sortType() == 1) { // ASC if (ClientData.sortOpt_sortType() == 1) { // ASC
isAsc = false; isAsc = false;
ClientData.sortOpt_sortType(2); BOOKMARK.sortType = 2;
} }
else { else {
isAsc = true; isAsc = true;
ClientData.sortOpt_sortType(1); BOOKMARK.sortType = 1;
} }
} }
else { else {
BOOKMARK.sortType = 1;
ClientData.sortOpt_searchDivision(3); // Kana ClientData.sortOpt_searchDivision(3); // Kana
ClientData.sortOpt_sortType(1); // default is asc
isAsc = true; isAsc = true;
} }
ClientData.sortOpt_sortType(BOOKMARK.sortType);
BOOKMARK.SortPubDate(isAsc); BOOKMARK.SortPubDate(isAsc);
...@@ -659,17 +711,17 @@ BOOKMARK.insertRow = function(contentid, pageThumbnail, pageTitle, pageText, pag ...@@ -659,17 +711,17 @@ BOOKMARK.insertRow = function(contentid, pageThumbnail, pageTitle, pageText, pag
imgTemp.src = pageThumbnail; imgTemp.src = pageThumbnail;
if (hasMemo) { if (hasMemo) {
newRow += '<li><a href="#">' + imgMemo + '</a></li>'; newRow += '<li><a href="#" style="cursor: default;">' + imgMemo + '</a></li>';
} }
else { else {
newRow += '<li><a href="#">' + imgMemoHide + '</a></li>'; newRow += '<li><a href="#" style="cursor: default;">' + imgMemoHide + '</a></li>';
} }
if (hasMarking) { if (hasMarking) {
newRow += '<li><a href="#">' + imgMarking + '</a></li>'; newRow += '<li><a href="#" style="cursor: default;">' + imgMarking + '</a></li>';
} }
else { else {
newRow += '<li><a href="#">' + imgMarkingHide + '</a></li>'; newRow += '<li><a href="#" style="cursor: default;">' + imgMarkingHide + '</a></li>';
} }
......
...@@ -974,7 +974,10 @@ CONTENTVIEW.changePage = function(page_index) { ...@@ -974,7 +974,10 @@ CONTENTVIEW.changePage = function(page_index) {
// Make sure page_index is number // Make sure page_index is number
page_index = Number(page_index); page_index = Number(page_index);
if( page_index < 0 ){
page_index = 0;
}
if (page_index != CONTENTVIEW_GETDATA.getContent().pageIndex) { if (page_index != CONTENTVIEW_GETDATA.getContent().pageIndex) {
CONTENTVIEW.playBGMOfContent(); CONTENTVIEW.playBGMOfContent();
...@@ -1827,16 +1830,26 @@ CONTENTVIEW.handleSliderBar = function() { ...@@ -1827,16 +1830,26 @@ CONTENTVIEW.handleSliderBar = function() {
/* event change txtProcess */ /* event change txtProcess */
$('#txtSlider').keydown(function (event) { $('#txtSlider').keydown(function (event) {
if (event.keyCode == 13) { 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'); $('#txtSlider').val('1');
} else if (parseInt($('#txtSlider').val()) > CONTENTVIEW_GENERAL.totalPage) { } else if (pageNo > CONTENTVIEW_GENERAL.totalPage) {
$('#txtSlider').val(CONTENTVIEW_GENERAL.totalPage); $('#txtSlider').val(CONTENTVIEW_GENERAL.totalPage);
} else if (/\D/g.test($('#txtSlider').val())) { } else if (/\D/g.test($('#txtSlider').val())) {
$('#txtSlider').val('1'); $('#txtSlider').val('1');
} else {
$('#txtSlider').val(pageNo);
} }
if (parseInt($('#txtSlider').val()) - 1 != CONTENTVIEW_GETDATA.getPageIndex()) { if (parseInt($('#txtSlider').val()) - 1 != CONTENTVIEW_GETDATA.getPageIndex()) {
$("#slider_page").slider("value", $('#txtSlider').val()); $("#slider_page").slider("value", $('#txtSlider').val());
CONTENTVIEW.changePage($('#txtSlider').val() - 1); CONTENTVIEW.changePage($('#txtSlider').val() - 1);
} }
...@@ -1925,7 +1938,7 @@ CONTENTVIEW.resizeScreen = function() { ...@@ -1925,7 +1938,7 @@ CONTENTVIEW.resizeScreen = function() {
CONTENTVIEW.changePageWithoutSlide = function(pageMove) { CONTENTVIEW.changePageWithoutSlide = function(pageMove) {
//abe コンテンツリンクで移動時 //abe コンテンツリンクで移動時
//console.log("changePageWithoutSlide:" + pageMove); //console.log("changePageWithoutSlide:" + pageMove);
//ページ閲覧ログセット //ページ閲覧ログセット
...@@ -5536,7 +5549,10 @@ CONTENTVIEW.screenBack = function(){ ...@@ -5536,7 +5549,10 @@ CONTENTVIEW.screenBack = function(){
$("#header-ws").show(); $("#header-ws").show();
$("#ws-body").show(); $("#ws-body").show();
$("#topcontrol").show(); $("#topcontrol").show();
document.title = I18N.i18nText('dspShiori') + ' | ' + I18N.i18nText('sysAppTitle'); document.title = I18N.i18nText('dspShiori') + ' | ' + I18N.i18nText('sysAppTitle');
BOOKMARK.refreshView();
} else if( $('#history').length ){ } else if( $('#history').length ){
HISTORY.cssInit(); HISTORY.cssInit();
$("#header-ws").show(); $("#header-ws").show();
...@@ -5579,6 +5595,7 @@ CONTENTVIEW.initScreen = function(){ ...@@ -5579,6 +5595,7 @@ CONTENTVIEW.initScreen = function(){
$('#divCacheLoading').hide(); $('#divCacheLoading').hide();
$('#overlay').hide(); $('#overlay').hide();
$('#dialogPopUp').hide(); $('#dialogPopUp').hide();
$('#arrow').hide();
$("#wrapper *").unbind("click"); $("#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