diff --git a/YACReaderLibrary/server/controllers/foldercontroller.cpp b/YACReaderLibrary/server/controllers/foldercontroller.cpp index 70e0a1c0..b0179dfd 100644 --- a/YACReaderLibrary/server/controllers/foldercontroller.cpp +++ b/YACReaderLibrary/server/controllers/foldercontroller.cpp @@ -61,10 +61,39 @@ void FolderController::service(HttpRequest& request, HttpResponse& response) //QString currentPath = session.get("currentPath").toString(); //QStringList pathSize = currentPath.split("/").last().toInt; + bool fromUp = false; + + QMultiMap map = request.getParameterMap(); + if(map.contains("up")) + fromUp = true; + + int upPage = 0; + if(backId == 1 && parentId == 1) + { + session.pushPage(page); t.setVariable(QString("upurl"),"/?page=0"); + } else - t.setVariable(QString("upurl"),"/library/" + QUrl::toPercentEncoding(libraryName) + "/folder/" +QString("%1").arg(backId));//.arg(upPage)); + { + if(fromUp) + { + session.popPage(); + upPage = session.topPage(); + page = upPage; + } + else //este nivel puede haberse cargado por primera vez ó puede que estemos navegando horizontalmente + if(p.length() == 0) // acabamos de entrar + { + session.pushPage(page); + } + else //navegación horizontal + { + session.popPage(); + session.pushPage(page); + } + t.setVariable(QString("upurl"),"/library/" + QUrl::toPercentEncoding(libraryName) + "/folder/" +QString("%1?page=%2&up=true").arg(backId).arg(upPage)); + } /*if(currentPath.length()>0) { diff --git a/YACReaderLibrary/server/controllers/librariescontroller.cpp b/YACReaderLibrary/server/controllers/librariescontroller.cpp index adf60f06..f171fe66 100644 --- a/YACReaderLibrary/server/controllers/librariescontroller.cpp +++ b/YACReaderLibrary/server/controllers/librariescontroller.cpp @@ -10,7 +10,7 @@ void LibrariesController::service(HttpRequest& request, HttpResponse& response) { HttpSession session=Static::sessionStore->getSession(request,response); session.set("ySession","ok"); - + session.clearNavigationPath(); response.setHeader("Content-Type", "text/html; charset=ISO-8859-1"); response.setHeader("Connection","close"); diff --git a/YACReaderLibrary/server/lib/bfHttpServer/httpsession.cpp b/YACReaderLibrary/server/lib/bfHttpServer/httpsession.cpp index 53a51a20..3a1e4060 100644 --- a/YACReaderLibrary/server/lib/bfHttpServer/httpsession.cpp +++ b/YACReaderLibrary/server/lib/bfHttpServer/httpsession.cpp @@ -280,4 +280,28 @@ void HttpSession::setDisplayType(const QString & display) { dataPtr->yacreaderSessionData.display = display; } +} + +void HttpSession::clearNavigationPath() +{ + if(dataPtr) + dataPtr->yacreaderSessionData.navigationPath.clear(); +} + +int HttpSession::popPage() +{ + if(dataPtr) + return dataPtr->yacreaderSessionData.navigationPath.pop(); +} + +void HttpSession::pushPage(int page) +{ + if(dataPtr) + dataPtr->yacreaderSessionData.navigationPath.push(page); +} + +int HttpSession::topPage() +{ + if(dataPtr) + return dataPtr->yacreaderSessionData.navigationPath.top(); } \ No newline at end of file diff --git a/YACReaderLibrary/server/lib/bfHttpServer/httpsession.h b/YACReaderLibrary/server/lib/bfHttpServer/httpsession.h index 8ffa7b3b..86f71b17 100644 --- a/YACReaderLibrary/server/lib/bfHttpServer/httpsession.h +++ b/YACReaderLibrary/server/lib/bfHttpServer/httpsession.h @@ -114,6 +114,11 @@ public: void setDeviceType(const QString & device); void setDisplayType(const QString & display); + void clearNavigationPath(); + int popPage(); + void pushPage(int page); + int topPage(); + private: struct YACReaderSessionData { @@ -125,6 +130,9 @@ private: QString device; QString display; qulonglong comicId; + + QStack navigationPath; + Comic * comic; }; diff --git a/release/server/docroot/css/styles_ipad.css b/release/server/docroot/css/styles_ipad.css index d42027fb..a127c18c 100644 --- a/release/server/docroot/css/styles_ipad.css +++ b/release/server/docroot/css/styles_ipad.css @@ -54,7 +54,7 @@ padding: 8px 0px 0px 0px; float: left; position: relative; height: 115px; -width: 130px; +width: 135px; } diff --git a/release/server/docroot/css/styles_iphone.css b/release/server/docroot/css/styles_iphone.css index c1cc912a..09fbc471 100644 --- a/release/server/docroot/css/styles_iphone.css +++ b/release/server/docroot/css/styles_iphone.css @@ -38,7 +38,7 @@ padding: 8px 0px 0px 0px; float: left; position: relative; height: 110px; -width: 155px; +width: 160px; } .buttons