diff --git a/Scripts/Bookmarks.js b/Scripts/Bookmarks.js index 86041d2..938d3f1 100644 --- a/Scripts/Bookmarks.js +++ b/Scripts/Bookmarks.js @@ -1,6 +1,8 @@ "use strict"; function BookmarksPage() { + // If the custom display is disabled, we do nothing + if (Options.get("enhancedDisplay") == false) return; // The data of the images is processed by JQuery Tooltip and removed. So we need to get them before it happens using mutations. var observer = new MutationObserver(function(mutations) { diff --git a/Scripts/Class/Options.js b/Scripts/Class/Options.js index e165e5d..d53d02e 100644 --- a/Scripts/Class/Options.js +++ b/Scripts/Class/Options.js @@ -3,6 +3,8 @@ var Options = { // Default options options: { + frontpageManager: true, + enhancedDisplay: true, maxPageWidth: 800, maxDoublePageWidth: 1800, minPageWidth: 600, diff --git a/Scripts/FreeKiss/Options.js b/Scripts/FreeKiss/Options.js new file mode 100644 index 0000000..fbf09f6 --- /dev/null +++ b/Scripts/FreeKiss/Options.js @@ -0,0 +1,15 @@ +"use strict"; + +function Init() { + $(document).ready(function() { + $("input[name='frontpageManager']").prop("checked", Options.get("frontpageManager")); + $("input[name='enhancedDisplay']").prop("checked", Options.get("enhancedDisplay")); + + $("input[type='checkbox']").change(function() { + Options.set($(this).attr("name"), $(this).prop("checked")); + Options.save(); + }); + }); +} + +Options.init(Init, false); \ No newline at end of file diff --git a/Scripts/FrontPage.js b/Scripts/FrontPage.js index 8ae2a38..d7da465 100644 --- a/Scripts/FrontPage.js +++ b/Scripts/FrontPage.js @@ -1,6 +1,9 @@ "use strict"; function FrontPage() { + // If the frontpage managers are disabled, we do nothing + if (Options.get("frontpageManager") == false) return; + Bookmarks.sync(function() { $(".fk-management").each(function() { UpdateBookmarkManagement(this); @@ -11,6 +14,11 @@ function FrontPage() { var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { + // We add the fk-scrollable class on the scrollbar (not the prettiest way of doing it) + if (mutation.target.className == "scrollable") { + $(mutation.target).addClass("fk-scrollable"); + } + // Add bookmark notifications in the scrollbar if (mutation.target.className == "items") { // Search through all the nodes of the mutation with the class "items" (divs inside the scrollbar) diff --git a/Scripts/Popup.js b/Scripts/Popup.js index 5aeb102..7c2d6be 100644 --- a/Scripts/Popup.js +++ b/Scripts/Popup.js @@ -90,6 +90,10 @@ function Popup() { }); }); + $("#advancedOptions").click(function() { + chrome.tabs.create({'url': chrome.extension.getURL('Views/Options.html')}); + }); + }); } diff --git a/Styles/FreeKiss/Options.css b/Styles/FreeKiss/Options.css new file mode 100644 index 0000000..645e4f9 --- /dev/null +++ b/Styles/FreeKiss/Options.css @@ -0,0 +1,121 @@ +html, body { + width: 100%; + margin: 0; + padding: 0; + background-color: #E8E8E8; +} + +#navigation { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 55px; + z-index: 10; + background-color: #353535; + box-shadow: 0px 1px 3px 0px black, 0px 0px 1px #0d0d0d; +} + +#title { + display: inline-block; + height: 55px; + width: 250px; + text-align: center; + background-color: #161616; +} + +#title img { + margin-top: 5px; +} + +#navigation ul { + vertical-align: top; + display: inline-block; + height: 55px; + margin: 0; + padding: 0; + list-style: none; +} + +#navigation li { + display: inline-block; + height: 55px; + width: 250px; + text-align: center; + background-color: #242424; +} + +#navigation li.selected { + background-color: #424242; +} + +#navigation a { + display: inline-block; + width: 100%; + height: 55px; + line-height: 55px; + + text-decoration: none; + color: white; + font-size: 22px; +} + +#navigation .selected a { + font-style: italic; + cursor: default; +} + +#navigation a:hover { + font-style: italic; +} + +#content { + width: 660px; + background-color: white; + margin: 75px auto 0px auto; + border: 1px solid #DBDBDB; + border-radius: 1px; + padding-left: 20px; + padding-right: 20px; + box-shadow: 2px 2px 4px 0px #4A4A4A, 0px 0px 1px #0d0d0d; +} + +#content h1 { + margin-bottom: 5px; +} + +#options +{ + margin: 15px 0px 15px 20px; + font-size: 14px; +} + +.patch { + margin-left: 20px; +} + +.patch h2 { + margin-bottom: 8px; + font-size: 20px; +} + +.patch h2 a { + text-decoration: none; + color: black; +} + +.patch h2 a:hover { + font-style: italic; +} + +.patch ul { + margin-top: 0px; + margin-bottom: 25px; + font-size: 16px; + color: #333333; +} + +.disabled { + font-style: italic; + color: #696969; +} \ No newline at end of file diff --git a/Styles/FrontPage.css b/Styles/FrontPage.css index ab663fc..d3d4ac4 100644 --- a/Styles/FrontPage.css +++ b/Styles/FrontPage.css @@ -20,7 +20,7 @@ top: -4px; } -.scrollable { +.fk-scrollable { margin-top: -12px; height: 210px !important; } diff --git a/Views/Export.html b/Views/Export.html new file mode 100644 index 0000000..929b29b --- /dev/null +++ b/Views/Export.html @@ -0,0 +1,29 @@ + + +
++ | Add bookmarks management on KissManga frontpage. | +
+ | Enhance bookmarks page display. | +