mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 04:54:29 -04:00
Update server code integration for QtWebApp 1.7.11
- Adapt server code for QtWebapp namespace 'stefanfrings' - Implement custom modifications needed by v1 controller via template engine - Unify iphone and ipad templates
This commit is contained in:
@ -14,6 +14,10 @@
|
||||
|
||||
#include <typeinfo>
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
using stefanfrings::HttpSession;
|
||||
|
||||
ComicController::ComicController() { }
|
||||
|
||||
void ComicController::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -9,7 +9,7 @@
|
||||
class Comic;
|
||||
class QString;
|
||||
|
||||
class ComicController : public HttpRequestHandler
|
||||
class ComicController : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(ComicController);
|
||||
@ -19,7 +19,7 @@ public:
|
||||
ComicController();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // COMICCONTROLLER_H
|
||||
|
@ -5,6 +5,9 @@
|
||||
|
||||
#include "comic_db.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
ComicDownloadInfoController::ComicDownloadInfoController() { }
|
||||
|
||||
void ComicDownloadInfoController::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class ComicDownloadInfoController : public HttpRequestHandler
|
||||
class ComicDownloadInfoController : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(ComicDownloadInfoController);
|
||||
@ -15,7 +15,7 @@ public:
|
||||
ComicDownloadInfoController();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // COMICDOWNLOADINFOCONTROLLER_H
|
||||
|
@ -6,6 +6,10 @@
|
||||
#include "template.h"
|
||||
#include "../static.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
using stefanfrings::HttpSession;
|
||||
|
||||
CoverController::CoverController() { }
|
||||
|
||||
void CoverController::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class CoverController : public HttpRequestHandler
|
||||
class CoverController : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(CoverController);
|
||||
@ -15,7 +15,7 @@ public:
|
||||
CoverController();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // COVERCONTROLLER_H
|
||||
|
@ -3,6 +3,9 @@
|
||||
#include "template.h"
|
||||
#include "../static.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
ErrorController::ErrorController(int errorCode)
|
||||
: error(errorCode)
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class ErrorController : public HttpRequestHandler
|
||||
class ErrorController : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(ErrorController);
|
||||
@ -15,7 +15,7 @@ public:
|
||||
ErrorController(int errorCode);
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
|
||||
private:
|
||||
int error;
|
||||
|
@ -16,6 +16,11 @@
|
||||
|
||||
#include "QsLog.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
using stefanfrings::HttpSession;
|
||||
using stefanfrings::Template;
|
||||
|
||||
struct LibraryItemSorter {
|
||||
bool operator()(const LibraryItem *a, const LibraryItem *b) const
|
||||
{
|
||||
@ -41,8 +46,14 @@ void FolderController::service(HttpRequest &request, HttpResponse &response)
|
||||
//QString y = session.get("xxx").toString();
|
||||
//response.writeText(QString("session xxx : %1 <br/>").arg(y));
|
||||
|
||||
Template t = Static::templateLoader->getTemplate("folder_" + ySession->getDeviceType(), request.getHeader("Accept-Language"));
|
||||
Template t = Static::templateLoader->getTemplate("folder", request.getHeader("Accept-Language"));
|
||||
t.enableWarnings();
|
||||
|
||||
// set device type for templates
|
||||
t.setVariable("device", ySession->getDeviceType());
|
||||
t.setVariable("display", ySession->getDisplayType());
|
||||
t.setCondition("device.ipad", ySession->getDeviceType() == "ipad");
|
||||
|
||||
QString path = QUrl::fromPercentEncoding(request.getPath()).toUtf8();
|
||||
QStringList pathElements = path.split('/');
|
||||
int libraryId = pathElements.at(2).toInt();
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class FolderController : public HttpRequestHandler
|
||||
class FolderController : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(FolderController);
|
||||
@ -15,7 +15,7 @@ public:
|
||||
FolderController();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // FOLDERCONTROLLER_H
|
||||
|
@ -7,6 +7,9 @@
|
||||
#include "template.h"
|
||||
#include "../static.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
FolderInfoController::FolderInfoController() { }
|
||||
|
||||
void FolderInfoController::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class FolderInfoController : public HttpRequestHandler
|
||||
class FolderInfoController : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(FolderInfoController);
|
||||
@ -15,10 +15,10 @@ public:
|
||||
FolderInfoController();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
|
||||
private:
|
||||
void serviceComics(const int &library, const qulonglong &folderId, HttpResponse &response);
|
||||
void serviceComics(const int &library, const qulonglong &folderId, stefanfrings::HttpResponse &response);
|
||||
};
|
||||
|
||||
#endif // FOLDERINFOCONTROLLER_H
|
||||
|
@ -8,6 +8,11 @@
|
||||
|
||||
#include "QsLog.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
using stefanfrings::HttpSession;
|
||||
using stefanfrings::Template;
|
||||
|
||||
LibrariesController::LibrariesController() { }
|
||||
|
||||
void LibrariesController::service(HttpRequest &request, HttpResponse &response)
|
||||
@ -20,9 +25,13 @@ void LibrariesController::service(HttpRequest &request, HttpResponse &response)
|
||||
|
||||
ySession->clearNavigationPath();
|
||||
|
||||
Template t = Static::templateLoader->getTemplate("libraries_" + ySession->getDeviceType(), request.getHeader("Accept-Language"));
|
||||
Template t = Static::templateLoader->getTemplate("libraries", request.getHeader("Accept-Language"));
|
||||
t.enableWarnings();
|
||||
|
||||
// set device type and display
|
||||
t.setVariable("device", ySession->getDeviceType());
|
||||
t.setVariable("display", ySession->getDisplayType());
|
||||
|
||||
YACReaderLibraries libraries = DBHelper::getLibraries();
|
||||
QList<QString> names = DBHelper::getLibrariesNames();
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
This controller displays a HTML form and dumps the submitted input.
|
||||
*/
|
||||
|
||||
class LibrariesController : public HttpRequestHandler
|
||||
class LibrariesController : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(LibrariesController);
|
||||
@ -19,7 +19,7 @@ public:
|
||||
LibrariesController();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // LIBRARIESCONTROLLER_H
|
||||
|
@ -13,6 +13,10 @@
|
||||
|
||||
#include "db_helper.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
using stefanfrings::HttpSession;
|
||||
|
||||
PageController::PageController() { }
|
||||
|
||||
void PageController::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class PageController : public HttpRequestHandler
|
||||
class PageController : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(PageController);
|
||||
@ -15,7 +15,7 @@ public:
|
||||
PageController();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // PAGECONTROLLER_H
|
||||
|
@ -8,6 +8,9 @@
|
||||
#include <QVariant>
|
||||
#include <QDateTime>
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
SessionController::SessionController() { }
|
||||
|
||||
void SessionController::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -6,6 +6,9 @@
|
||||
#include "comic_db.h"
|
||||
#include "db_helper.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
SyncController::SyncController()
|
||||
{
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class SyncController : public HttpRequestHandler
|
||||
class SyncController : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(SyncController)
|
||||
@ -16,7 +16,7 @@ public:
|
||||
SyncController();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // SYNCCONTROLLER_H
|
||||
|
@ -11,6 +11,10 @@
|
||||
|
||||
#include "QsLog.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
using stefanfrings::HttpSession;
|
||||
|
||||
UpdateComicController::UpdateComicController() { }
|
||||
|
||||
void UpdateComicController::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class UpdateComicController : public HttpRequestHandler
|
||||
class UpdateComicController : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(UpdateComicController);
|
||||
@ -14,7 +14,7 @@ public:
|
||||
UpdateComicController();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // UPDATECOMICCONTROLLER_H
|
||||
|
@ -14,6 +14,9 @@
|
||||
|
||||
#include <typeinfo>
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
ComicControllerV2::ComicControllerV2() { }
|
||||
|
||||
void ComicControllerV2::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -9,7 +9,7 @@
|
||||
class Comic;
|
||||
class QString;
|
||||
|
||||
class ComicControllerV2 : public HttpRequestHandler
|
||||
class ComicControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(ComicControllerV2)
|
||||
@ -18,7 +18,7 @@ public:
|
||||
ComicControllerV2();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // COMICCONTROLLER_H
|
||||
|
@ -5,6 +5,9 @@
|
||||
|
||||
#include "comic_db.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
ComicDownloadInfoControllerV2::ComicDownloadInfoControllerV2() { }
|
||||
|
||||
void ComicDownloadInfoControllerV2::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class ComicDownloadInfoControllerV2 : public HttpRequestHandler
|
||||
class ComicDownloadInfoControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(ComicDownloadInfoControllerV2)
|
||||
@ -14,7 +14,7 @@ public:
|
||||
ComicDownloadInfoControllerV2();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // COMICDOWNLOADINFOCONTROLLER_H
|
||||
|
@ -11,6 +11,9 @@
|
||||
#include "qnaturalsorting.h"
|
||||
|
||||
#include <ctime>
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
using namespace std;
|
||||
|
||||
ComicFullinfoController_v2::ComicFullinfoController_v2() { }
|
||||
|
@ -5,17 +5,17 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class ComicFullinfoController_v2 : public HttpRequestHandler
|
||||
class ComicFullinfoController_v2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(ComicFullinfoController_v2)
|
||||
public:
|
||||
ComicFullinfoController_v2();
|
||||
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
|
||||
private:
|
||||
void serviceContent(const int &library, const qulonglong &comicId, HttpResponse &response);
|
||||
void serviceContent(const int &library, const qulonglong &comicId, stefanfrings::HttpResponse &response);
|
||||
};
|
||||
|
||||
#endif // COMICFULLINFOCONTROLLER_V2_H
|
||||
|
@ -6,6 +6,9 @@
|
||||
#include "template.h"
|
||||
#include "../static.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
CoverControllerV2::CoverControllerV2() { }
|
||||
|
||||
void CoverControllerV2::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class CoverControllerV2 : public HttpRequestHandler
|
||||
class CoverControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(CoverControllerV2)
|
||||
@ -14,7 +14,7 @@ public:
|
||||
CoverControllerV2();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // COVERCONTROLLER_H
|
||||
|
@ -3,6 +3,9 @@
|
||||
#include "template.h"
|
||||
#include "../static.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
ErrorControllerV2::ErrorControllerV2(int errorCode)
|
||||
: error(errorCode)
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class ErrorControllerV2 : public HttpRequestHandler
|
||||
class ErrorControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(ErrorControllerV2)
|
||||
@ -14,7 +14,7 @@ public:
|
||||
ErrorControllerV2(int errorCode);
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
|
||||
private:
|
||||
int error;
|
||||
|
@ -5,6 +5,9 @@
|
||||
|
||||
#include "yacreader_server_data_helper.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
FavoritesControllerV2::FavoritesControllerV2() { }
|
||||
|
||||
void FavoritesControllerV2::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -5,17 +5,17 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class FavoritesControllerV2 : public HttpRequestHandler
|
||||
class FavoritesControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(FavoritesControllerV2)
|
||||
public:
|
||||
FavoritesControllerV2();
|
||||
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
|
||||
private:
|
||||
void serviceContent(const int library, HttpResponse &response);
|
||||
void serviceContent(const int library, stefanfrings::HttpResponse &response);
|
||||
};
|
||||
|
||||
#endif // FAVORITESCONTROLLER_H
|
||||
|
@ -14,6 +14,9 @@
|
||||
|
||||
#include <chrono>
|
||||
#include <ctime>
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
using namespace std;
|
||||
|
||||
struct LibraryItemSorter {
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class FolderContentControllerV2 : public HttpRequestHandler
|
||||
class FolderContentControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(FolderContentControllerV2)
|
||||
@ -14,10 +14,10 @@ public:
|
||||
FolderContentControllerV2();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
|
||||
private:
|
||||
void serviceContent(const int &library, const qulonglong &folderId, HttpResponse &response);
|
||||
void serviceContent(const int &library, const qulonglong &folderId, stefanfrings::HttpResponse &response);
|
||||
};
|
||||
|
||||
#endif // FOLDERCONTENTCONTROLLER_H
|
||||
|
@ -7,6 +7,9 @@
|
||||
#include "template.h"
|
||||
#include "../static.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
FolderInfoControllerV2::FolderInfoControllerV2() { }
|
||||
|
||||
void FolderInfoControllerV2::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class FolderInfoControllerV2 : public HttpRequestHandler
|
||||
class FolderInfoControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(FolderInfoControllerV2)
|
||||
@ -14,10 +14,10 @@ public:
|
||||
FolderInfoControllerV2();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
|
||||
private:
|
||||
void serviceComics(const int &library, const qulonglong &folderId, HttpResponse &response);
|
||||
void serviceComics(const int &library, const qulonglong &folderId, stefanfrings::HttpResponse &response);
|
||||
};
|
||||
|
||||
#endif // FOLDERINFOCONTROLLER_H
|
||||
|
@ -7,6 +7,9 @@
|
||||
|
||||
#include "QsLog.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
LibrariesControllerV2::LibrariesControllerV2() { }
|
||||
|
||||
void LibrariesControllerV2::service(HttpRequest & /* request */, HttpResponse &response)
|
||||
|
@ -9,7 +9,7 @@
|
||||
This controller displays a HTML form and dumps the submitted input.
|
||||
*/
|
||||
|
||||
class LibrariesControllerV2 : public HttpRequestHandler
|
||||
class LibrariesControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(LibrariesControllerV2)
|
||||
@ -18,7 +18,7 @@ public:
|
||||
LibrariesControllerV2();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // LIBRARIESCONTROLLER_H
|
||||
|
@ -13,6 +13,9 @@
|
||||
|
||||
#include "db_helper.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
PageControllerV2::PageControllerV2() { }
|
||||
|
||||
void PageControllerV2::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class PageControllerV2 : public HttpRequestHandler
|
||||
class PageControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(PageControllerV2)
|
||||
@ -14,7 +14,7 @@ public:
|
||||
PageControllerV2();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // PAGECONTROLLER_H
|
||||
|
@ -5,6 +5,9 @@
|
||||
|
||||
#include "yacreader_server_data_helper.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
ReadingComicsControllerV2::ReadingComicsControllerV2()
|
||||
{
|
||||
}
|
||||
|
@ -5,17 +5,17 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class ReadingComicsControllerV2 : public HttpRequestHandler
|
||||
class ReadingComicsControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(ReadingComicsControllerV2)
|
||||
public:
|
||||
ReadingComicsControllerV2();
|
||||
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
|
||||
private:
|
||||
void serviceContent(const int &library, HttpResponse &response);
|
||||
void serviceContent(const int &library, stefanfrings::HttpResponse &response);
|
||||
};
|
||||
|
||||
#endif // READINGCOMICSCONTROLLER_H
|
||||
|
@ -5,6 +5,9 @@
|
||||
|
||||
#include "yacreader_server_data_helper.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
ReadingListContentControllerV2::ReadingListContentControllerV2()
|
||||
{
|
||||
}
|
||||
|
@ -5,17 +5,17 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class ReadingListContentControllerV2 : public HttpRequestHandler
|
||||
class ReadingListContentControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(ReadingListContentControllerV2)
|
||||
public:
|
||||
ReadingListContentControllerV2();
|
||||
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
|
||||
private:
|
||||
void serviceContent(const int &library, const qulonglong &readingListId, HttpResponse &response);
|
||||
void serviceContent(const int &library, const qulonglong &readingListId, stefanfrings::HttpResponse &response);
|
||||
};
|
||||
|
||||
#endif // READINGLISTCONTENTCONTROLLER_H
|
||||
|
@ -8,6 +8,9 @@
|
||||
#include "template.h"
|
||||
#include "../static.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
ReadingListInfoControllerV2::ReadingListInfoControllerV2() { }
|
||||
|
||||
void ReadingListInfoControllerV2::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -5,17 +5,17 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class ReadingListInfoControllerV2 : public HttpRequestHandler
|
||||
class ReadingListInfoControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(ReadingListInfoControllerV2)
|
||||
public:
|
||||
ReadingListInfoControllerV2();
|
||||
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
|
||||
private:
|
||||
void serviceComics(const int &library, const qulonglong &readingListId, HttpResponse &response);
|
||||
void serviceComics(const int &library, const qulonglong &readingListId, stefanfrings::HttpResponse &response);
|
||||
};
|
||||
|
||||
#endif // READINGLISTINFOCONTROLLER_V2_H
|
||||
|
@ -4,6 +4,9 @@
|
||||
#include "reading_list.h"
|
||||
#include "yacreader_server_data_helper.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
ReadingListsControllerV2::ReadingListsControllerV2()
|
||||
{
|
||||
}
|
||||
|
@ -5,17 +5,17 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class ReadingListsControllerV2 : public HttpRequestHandler
|
||||
class ReadingListsControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(ReadingListsControllerV2)
|
||||
public:
|
||||
ReadingListsControllerV2();
|
||||
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
|
||||
private:
|
||||
void serviceContent(const int library, HttpResponse &response);
|
||||
void serviceContent(const int library, stefanfrings::HttpResponse &response);
|
||||
};
|
||||
|
||||
#endif // READINGLISTSCONTROLLER_H
|
||||
|
@ -6,6 +6,9 @@
|
||||
#include "comic_db.h"
|
||||
#include "db_helper.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
SyncControllerV2::SyncControllerV2()
|
||||
{
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class SyncControllerV2 : public HttpRequestHandler
|
||||
class SyncControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(SyncControllerV2)
|
||||
@ -16,7 +16,7 @@ public:
|
||||
SyncControllerV2();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // SYNCCONTROLLER_H
|
||||
|
@ -7,6 +7,9 @@
|
||||
|
||||
#include <QUrl>
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
TagContentControllerV2::TagContentControllerV2()
|
||||
{
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class TagContentControllerV2 : public HttpRequestHandler
|
||||
class TagContentControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(TagContentControllerV2)
|
||||
@ -14,10 +14,10 @@ public:
|
||||
TagContentControllerV2();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
|
||||
private:
|
||||
void serviceContent(const int &library, const qulonglong &tagId, HttpResponse &response);
|
||||
void serviceContent(const int &library, const qulonglong &tagId, stefanfrings::HttpResponse &response);
|
||||
};
|
||||
|
||||
#endif // TAGCONTENTCONTROLLER_H
|
||||
|
@ -8,6 +8,9 @@
|
||||
#include "template.h"
|
||||
#include "../static.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
TagInfoControllerV2::TagInfoControllerV2() { }
|
||||
|
||||
void TagInfoControllerV2::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -5,17 +5,17 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class TagInfoControllerV2 : public HttpRequestHandler
|
||||
class TagInfoControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(TagInfoControllerV2)
|
||||
public:
|
||||
TagInfoControllerV2();
|
||||
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
|
||||
private:
|
||||
void serviceComics(const int &library, const qulonglong &tagId, HttpResponse &response);
|
||||
void serviceComics(const int &library, const qulonglong &tagId, stefanfrings::HttpResponse &response);
|
||||
};
|
||||
|
||||
#endif // TAGINFOCONTROLLER_V2_H
|
||||
|
@ -11,6 +11,9 @@
|
||||
|
||||
#include "QsLog.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
TagsControllerV2::TagsControllerV2() { }
|
||||
|
||||
void TagsControllerV2::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class TagsControllerV2 : public HttpRequestHandler
|
||||
class TagsControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(TagsControllerV2)
|
||||
@ -14,7 +14,7 @@ public:
|
||||
TagsControllerV2();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // TAGSCONTROLLER_H
|
||||
|
@ -11,6 +11,9 @@
|
||||
|
||||
#include "QsLog.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
UpdateComicControllerV2::UpdateComicControllerV2() { }
|
||||
|
||||
void UpdateComicControllerV2::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "httpresponse.h"
|
||||
#include "httprequesthandler.h"
|
||||
|
||||
class UpdateComicControllerV2 : public HttpRequestHandler
|
||||
class UpdateComicControllerV2 : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(UpdateComicControllerV2)
|
||||
@ -14,7 +14,7 @@ public:
|
||||
UpdateComicControllerV2();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // UPDATECOMICCONTROLLER_H
|
||||
|
@ -1,5 +1,8 @@
|
||||
#include "versioncontroller.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
VersionController::VersionController() { }
|
||||
|
||||
void VersionController::service(HttpRequest &request, HttpResponse &response)
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include <QThread>
|
||||
|
||||
class VersionController : public HttpRequestHandler
|
||||
class VersionController : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(VersionController);
|
||||
@ -17,7 +17,7 @@ public:
|
||||
VersionController();
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
};
|
||||
|
||||
#endif // VERSIONCONTROLLER_H
|
||||
|
@ -47,6 +47,11 @@
|
||||
|
||||
#include "QsLog.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpRequestHandler;
|
||||
using stefanfrings::HttpResponse;
|
||||
using stefanfrings::HttpSession;
|
||||
|
||||
QMutex RequestMapper::mutex;
|
||||
|
||||
RequestMapper::RequestMapper(QObject *parent)
|
||||
|
@ -9,20 +9,20 @@
|
||||
#include "httprequesthandler.h"
|
||||
#include <QMutex>
|
||||
|
||||
class RequestMapper : public HttpRequestHandler
|
||||
class RequestMapper : public stefanfrings::HttpRequestHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(RequestMapper)
|
||||
public:
|
||||
RequestMapper(QObject *parent = nullptr);
|
||||
|
||||
void service(HttpRequest &request, HttpResponse &response) override;
|
||||
void loadSessionV1(HttpRequest &request, HttpResponse &response);
|
||||
void loadSessionV2(HttpRequest &request, HttpResponse &response);
|
||||
void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override;
|
||||
void loadSessionV1(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response);
|
||||
void loadSessionV2(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response);
|
||||
|
||||
private:
|
||||
void serviceV1(HttpRequest &request, HttpResponse &response);
|
||||
void serviceV2(HttpRequest &request, HttpResponse &response);
|
||||
void serviceV1(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response);
|
||||
void serviceV2(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response);
|
||||
|
||||
static QMutex mutex;
|
||||
};
|
||||
|
@ -24,6 +24,14 @@
|
||||
/** Short description of this application */
|
||||
#define DESCRIPTION "Comic reader and organizer"
|
||||
|
||||
using stefanfrings::HttpListener;
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
|
||||
using stefanfrings::HttpSessionStore;
|
||||
using stefanfrings::StaticFileController;
|
||||
using stefanfrings::TemplateCache;
|
||||
|
||||
void Startup::start()
|
||||
{
|
||||
// Initialize the core application
|
||||
@ -126,6 +134,11 @@ void Startup::start()
|
||||
|
||||
listener = new HttpListener(listenerSettings, new RequestMapper(app), app);
|
||||
|
||||
// if the requested port is busy, use random port
|
||||
if (!listener->isListening()) {
|
||||
listener->QTcpServer::listen(QHostAddress::Any, 0);
|
||||
}
|
||||
|
||||
qDebug("ServiceHelper: Service has started");
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,10 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace stefanfrings {
|
||||
class HttpListener;
|
||||
}
|
||||
|
||||
/**
|
||||
Helper class to install and run the application as a windows
|
||||
service.
|
||||
@ -17,7 +20,7 @@ class Startup
|
||||
{
|
||||
private:
|
||||
//QTcpServer
|
||||
HttpListener *listener;
|
||||
stefanfrings::HttpListener *listener;
|
||||
|
||||
public:
|
||||
/** Constructor */
|
||||
|
@ -9,6 +9,11 @@
|
||||
#include <QFile>
|
||||
#include <QString>
|
||||
|
||||
using stefanfrings::HttpResponse;
|
||||
using stefanfrings::HttpSessionStore;
|
||||
using stefanfrings::StaticFileController;
|
||||
using stefanfrings::TemplateLoader;
|
||||
|
||||
QString Static::configDir = nullptr;
|
||||
|
||||
TemplateLoader *Static::templateLoader = nullptr;
|
||||
|
@ -47,15 +47,15 @@ public:
|
||||
static QString getConfigDir();
|
||||
|
||||
/** Cache for template files */
|
||||
static TemplateLoader *templateLoader;
|
||||
static stefanfrings::TemplateLoader *templateLoader;
|
||||
|
||||
/** Storage for session cookies */
|
||||
static HttpSessionStore *sessionStore;
|
||||
static stefanfrings::HttpSessionStore *sessionStore;
|
||||
|
||||
static YACReaderHttpSessionStore *yacreaderSessionStore;
|
||||
|
||||
/** Controller for static files */
|
||||
static StaticFileController *staticFileController;
|
||||
static stefanfrings::StaticFileController *staticFileController;
|
||||
|
||||
private:
|
||||
/** Directory of the main config file */
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
#include "httpsessionstore.h"
|
||||
|
||||
using stefanfrings::HttpSessionStore;
|
||||
|
||||
YACReaderHttpSessionStore::YACReaderHttpSessionStore(HttpSessionStore *sessionStore, QObject *parent)
|
||||
: QObject(parent), sessionStore(sessionStore)
|
||||
{
|
||||
|
@ -4,14 +4,16 @@
|
||||
#include <QObject>
|
||||
#include <QtCore>
|
||||
|
||||
namespace stefanfrings {
|
||||
class HttpSessionStore;
|
||||
}
|
||||
class YACReaderHttpSession;
|
||||
|
||||
class YACReaderHttpSessionStore : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit YACReaderHttpSessionStore(HttpSessionStore *sessionStore, QObject *parent = nullptr);
|
||||
explicit YACReaderHttpSessionStore(stefanfrings::HttpSessionStore *sessionStore, QObject *parent = nullptr);
|
||||
|
||||
void addYACReaderHttpSession(const QByteArray &httpSessionId, YACReaderHttpSession *yacreaderHttpSession);
|
||||
YACReaderHttpSession *getYACReaderSessionHttpSession(const QByteArray &httpSessionId);
|
||||
@ -22,7 +24,7 @@ public slots:
|
||||
|
||||
private:
|
||||
QMap<QByteArray, YACReaderHttpSession *> sessions;
|
||||
HttpSessionStore *sessionStore;
|
||||
stefanfrings::HttpSessionStore *sessionStore;
|
||||
QTimer cleanupTimer;
|
||||
|
||||
QMutex mutex;
|
||||
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" href="/css/reset.css" type="text/css" />
|
||||
<link rel="stylesheet" href="/css/styles.css" type="text/css" />
|
||||
<link rel="stylesheet" href="/css/styles_{device}.css" type="text/css" />
|
||||
<title>Folder</title>
|
||||
</head>
|
||||
<body>
|
||||
@ -15,15 +15,17 @@
|
||||
|
||||
|
||||
<div id="folder-subheader1">
|
||||
{if device.ipad}
|
||||
<h1>{folder.name}</h1>
|
||||
{end device.ipad}
|
||||
</div>
|
||||
|
||||
<div id ="folder-subheader2">
|
||||
<a class="path" href="/">Libraries</a> <img class="indicator" src="/images/indicator.png" style="width: 5px"/> <a class="path" href="{library.url}">{library.name}</a> {loop path} <img class="indicator" src="/images/indicator.png" style="width: 5px"/> <a class="path" href="{path.url}">{path.name}</a> {end path}
|
||||
<a class="pat" href="/">Libraries</a> <img class="indicator" src="/images/indicator{display}.png" style="width: 5px"/> <a class="path" href="{library.url}">{library.name}</a> {loop path} <img class="indicator" src="/images/indicator.png" style="width: 5px"/> <a class="path" href="{path.url}">{path.name}</a> {end path}
|
||||
</div>
|
||||
<div id ="header-combos">
|
||||
{if pageIndex}
|
||||
<img class="comboIndicator" src="/images/combo.png"/>
|
||||
<img class="comboIndicator" src="/images/combo{display}.png"/>
|
||||
<select name="indexnumber" id="indexnumber" onchange="navigateTo(this, 'window', false);">
|
||||
<option value="" disabled selected>{page}/{pages}</option>
|
||||
{loop page}
|
||||
@ -33,7 +35,7 @@
|
||||
{end pageIndex}
|
||||
|
||||
{if alphaIndex}
|
||||
<img class="comboIndicator" src="/images/combo.png"/>
|
||||
<img class="comboIndicator" src="/images/combo{display}.png"/>
|
||||
<select name="indexalpha" id="indexalpha" onchange="navigateTo(this, 'window', false);">
|
||||
<option value="" disabled selected>index</option>
|
||||
{loop index}
|
||||
@ -107,7 +109,7 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
function navigateTo(sel, target) {
|
||||
window[target].location.href = sel.options[sel.selectedIndex].value;
|
||||
window[target].location.href = sel.options[sel.selectedIndex].value;
|
||||
}
|
||||
</script>
|
||||
|
@ -1,114 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" href="/css/reset.css" type="text/css" />
|
||||
<link rel="stylesheet" href="/css/styles.css" type="text/css" />
|
||||
<title>Folder</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content">
|
||||
<div>
|
||||
|
||||
<div id="folder-header">
|
||||
<div id="topIndex"> {if pageIndex} <a class="previous" href="{page.previous}">previous</a> <a class="next" href="{page.next}">next</a> {end pageIndex} <a class="up" href="{upurl}">up</a> </div>
|
||||
|
||||
|
||||
<div id="folder-subheader1">
|
||||
</div>
|
||||
|
||||
<div id ="folder-subheader2">
|
||||
<a class="path" href="/">Libraries</a> <!--<img class="indicator" src="/images/indicator.png" style="width: 5px"/> <a class="path" href="{library.url}">{library.name}</a> -->{loop path} <img class="indicator" src="/images/indicator.png" style="width: 5px"/> <a class="path" href="{path.url}">{path.name}</a> {end path}
|
||||
</div>
|
||||
<div id ="header-combos">
|
||||
{if pageIndex}
|
||||
<img class="comboIndicator" src="/images/combo.png"/>
|
||||
<select name="indexnumber" id="indexnumber" onchange="navigateTo(this, 'window', false);">
|
||||
<option value="" disabled selected>{page}/{pages}</option>
|
||||
{loop page}
|
||||
<option value="{page.url}">{page.number}</option>
|
||||
{end page}
|
||||
</select>
|
||||
{end pageIndex}
|
||||
|
||||
{if alphaIndex}
|
||||
<img class="comboIndicator" src="/images/combo.png"/>
|
||||
<select name="indexalpha" id="indexalpha" onchange="navigateTo(this, 'window', false);">
|
||||
<option value="" disabled selected>index</option>
|
||||
{loop index}
|
||||
<option value="{index.url}">{index.indexname}</option>
|
||||
{end index}
|
||||
</select>
|
||||
{end alphaIndex}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<a href="javascript:javascript:history.go(-1)">up</a>-->
|
||||
<div class="folderContent">
|
||||
<ul id="itemContainer">
|
||||
{loop element}
|
||||
<li>
|
||||
<div class="{element.class}">
|
||||
{element.cover.browse} <img style="width: 80px" src="{element.image.url}"/> {element.cover.browse.end}
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="title"><p>{element.name}</p>
|
||||
</div>
|
||||
<div class="elementInfo"> {element.pages} {element.size}
|
||||
</div>
|
||||
<div class="buttons"> {element.download} {element.read} {element.browse}
|
||||
</div>
|
||||
</div>
|
||||
{element.status}
|
||||
</li>
|
||||
{end element}
|
||||
</ul>
|
||||
<div class="clear"> </div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if index}
|
||||
<div id="indexes">
|
||||
{if alphaIndex}
|
||||
|
||||
<div class="index">
|
||||
<ul id="alphaIndex">
|
||||
{loop index}
|
||||
|
||||
<li> <a href="{index.url}"> {index.indexname} </a> </li>
|
||||
|
||||
{end index}
|
||||
</ul>
|
||||
<div class="clear"> </div>
|
||||
</div>
|
||||
|
||||
{end alphaIndex}
|
||||
|
||||
|
||||
{if pageIndex}
|
||||
|
||||
<div class="index">
|
||||
<ul id="pageIndex">
|
||||
<!-- <li> <a class="first" href="{page.first}">first</a> </li>
|
||||
<li> <a class="previous" href="{page.previous}">previous</a> </li>-->
|
||||
|
||||
{loop page} <li> <a class="{page.current}" href="{page.url}"> {page.number} </a> </li> {end page}
|
||||
|
||||
<!-- <li> <a class="next" href="{page.next}">next</a> </li>
|
||||
<li> <a class="last" href="{page.last}">last</a> </li>-->
|
||||
</ul>
|
||||
<div class="clear"> </div>
|
||||
</div>
|
||||
{end pageIndex}
|
||||
</div>
|
||||
{end index}
|
||||
|
||||
<script type="text/javascript">
|
||||
function navigateTo(sel, target) {
|
||||
window[target].location.href = sel.options[sel.selectedIndex].value;
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" href="/css/reset.css" type="text/css" />
|
||||
<link rel="stylesheet" href="/css/styles.css" type="text/css" />
|
||||
<link rel="stylesheet" href="/css/styles_{device}.css" type="text/css" />
|
||||
<title>Libraries</title>
|
||||
</head>
|
||||
<body>
|
||||
@ -13,9 +13,9 @@
|
||||
<ul id="librariesList">
|
||||
{loop library}
|
||||
<li>
|
||||
<div class="library-icon"> <img width="14px" height="18px" src="../images/library.png" /> </div>
|
||||
<div class="library-icon"> <img width="14px" height="18px" src="../images/library{display}.png" /> </div>
|
||||
<div class="library-link"> {library.label} </div>
|
||||
<div class="library-indicator"> <img width="5px" height="9px" src="../images/indicator.png" /> </div>
|
||||
<div class="library-indicator"> <img width="5px" height="9px" src="../images/indicator{display}.png" /> </div>
|
||||
<a href="/library/{library.name}/folder/1"> </a>
|
||||
<div class="clear"> </div>
|
||||
</li>
|
@ -1,27 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" href="/css/reset.css" type="text/css" />
|
||||
<link rel="stylesheet" href="/css/styles.css" type="text/css" />
|
||||
<title>Libraries</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="contentLibraries">
|
||||
<h1>Libraries</h1>
|
||||
<p>
|
||||
<ul id="librariesList">
|
||||
{loop library}
|
||||
<li>
|
||||
<div class="library-icon"> <img width="14px" height="18px" src="../images/library.png" /> </div>
|
||||
<div class="library-link"> {library.label} </div>
|
||||
<div class="library-indicator"> <img width="5px" height="9px" src="../images/indicator.png" /> </div>
|
||||
<a href="/library/{library.name}/folder/1"> </a>
|
||||
<div class="clear"> </div>
|
||||
</li>
|
||||
{end library}
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user