diff --git a/Gemfile.lock b/Gemfile.lock index e5b097a5..8be43645 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - narou (3.9.1) + narou (3.9.1.mod.R1) activesupport (~> 8.0, >= 8.1.0) bootsnap (~> 1.18, >= 1.18.6) csv (~> 3.3) diff --git a/LICENSE.txt b/LICENSE.txt index daf79ca3..eb1ca36c 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -26,7 +26,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ---------------------------------------------------------------------- /** - * bootbox.js v4.3.0 + * bootbox.js v4.4.0 * * The MIT License * @@ -53,32 +53,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ---------------------------------------------------------------------- -dataTables.colVis.js - -MIT license -Copyright (C) 2008-2014, SpryMedia Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ----------------------------------------------------------------------- - -perfect-scrollbar - -The MIT License (MIT) -Copyright (c) 2012, 2014 Hyunje Alex Jun and other contributors. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ----------------------------------------------------------------------- - CSS Toggle Switch This is free and unencumbered software released into the public domain. diff --git a/README.md b/README.md index 2b19a0ea..684c7b0b 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,16 @@ -Narou.rb - 小説家になろうのダウンローダ&縦書き整形&管理アプリ。Kindle(などの電子書籍端末)でなろうを読む場合に超便利です! -=================================================================================== +# Narou.rb_MOD - 小説家になろうのダウンローダ&縦書き整形&管理アプリ。 -[](http://badge.fury.io/rb/narou) -[](https://gitter.im/whiteleaf7/narou?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +このプロジェクトは下記プロジェクトの派生です。 + +- Original Project : [whiteleaf7/narou](https://github.com/whiteleaf7/narou) + +- Forked from : [Rumia-Channel/narou](https://github.com/Rumia-Channel/narou) + +素晴らしいプロジェクトを作成していただいた、[whiteleaf7](https://github.com/whiteleaf7) さん、[Rumia-Channel](https://github.com/Rumia-Channel) さんに多大なる感謝を。 + + +## 概要 - Summary -概要 - Summary --------------- このアプリは[小説家になろう](http://syosetu.com/)などで公開されている小説の管理、 及び電子書籍データへの変換を支援します。縦書き用に特化されており、 横書きに最適化されたWEB小説を違和感なく縦書きで読むことが出来るようになります。 @@ -21,24 +26,50 @@ Narou.rb - 小説家になろうのダウンローダ&縦書き整形&管理 + 暁 http://www.akatsuki-novels.com/ (※300話以上ある作品は未対応) + カクヨム https://kakuyomu.jp/ -コンソールで操作するアプリケーションですが、ブラウザを使って直感的に操作することができる WEB UI も搭載!([デモページ](http://whiteleaf7.github.io/narou/demo/)) - 主な機能は小説家になろうの小説のダウンロード、更新管理、テキスト整形、AozoraEpub3・kindlegen連携によるEPUB/MOBI出力です。 その他にも変換したデータを直接電子書籍端末へ送信する機能は、メールで送信する機能などもあります。 -詳細な説明やインストール方法は **[Narou.rb 説明書](https://github.com/whiteleaf7/narou/wiki)** を御覧ください。 +詳細な説明やインストール方法は **[Narou.rb_MOD説明書](https://github.com/ponponusa/narou/wiki)** を御覧ください。 + +## 動作要件 - Requirements + +- Ruby 3.4以上(※元プロジェクトから変更されています) + +## 更新履歴 - ChangeLog + +### > 3.9.1.mod.R1 : 2025-10-28 + +#### <更新内容> ※[Rumia-Channel/narou](https://github.com/Rumia-Channel/narou)からの更新点を記載しています - - +```md +- テキスト/EPUB変換処理の高速化 + - 主に話数の多い(1000話オーバーなど)小説で顕著に効果があります + - ※小説掲載サイトからの取得ロジックに変更はないため、取得速度は変化はありません(変更予定もなし) +- JavaScriptライブラリの更新、変更 + - update jQuery 1.11.1 -> 3.7.1 + - update datatables.js 1.10.10 -> 2.3.4 + - update bootstrap 3.3.5 -> 3.4.1 + - and more... +- Rubyパッケージの更新、変更 + - supported Ruby version 2.3.0~ -> 3.4.0~ + - add puma/bootsnap/and more... + - update sinatra/ActiveSuport/tilt/and more... +- Digest認証からBasic認証に変更 + - Rack3.1から[Digest認証が非対応](https://github.com/ruby-grape/grape/issues/2294)となったため +- その他、細かな修正 +``` -更新履歴 - ChangeLog --------------------- +## TODO -3.9.1: 2024-09-19 ------------------ -#### 修正内容 -- 小説家になろうの目次修正に対応 #432 @etg-lt +- 外部Webサーバを利用しない形でのHTTPS対応 +- bootstrap5への移行 + - bootstrap3系では、jQuery3系に対応していないため + - jQuery migrateを削除したい +- 小説タイトルの自動整形 +- セキュリティリスクのある実装の修正 +- 変換処理の並列化による高速化 + - 今後の最適化のためにもスレッドセーフにする ---- -「小説家になろう」は株式会社ヒナプロジェクトの登録商標です +「小説家になろう」は株式会社ヒナプロジェクトの登録商標です。 diff --git a/lib/version.rb b/lib/version.rb index f8f519e0..39284b15 100644 --- a/lib/version.rb +++ b/lib/version.rb @@ -5,5 +5,5 @@ # module Narou - VERSION = "3.9.1" + VERSION = "3.9.1.mod.R1" end diff --git a/lib/web/public/resources/default-style.css b/lib/web/public/resources/css/default-style.css similarity index 100% rename from lib/web/public/resources/default-style.css rename to lib/web/public/resources/css/default-style.css diff --git a/lib/web/public/resources/toggle-switch.css b/lib/web/public/resources/css/toggle-switch.css similarity index 100% rename from lib/web/public/resources/toggle-switch.css rename to lib/web/public/resources/css/toggle-switch.css diff --git a/lib/web/public/resources/dataTables.colVis.js b/lib/web/public/resources/dataTables.colVis.js deleted file mode 100644 index 03f09f40..00000000 --- a/lib/web/public/resources/dataTables.colVis.js +++ /dev/null @@ -1,1113 +0,0 @@ -/*! ColVis 1.1.2-dev - * ©2010-2014 SpryMedia Ltd - datatables.net/license - */ - -/** - * @summary ColVis - * @description Controls for column visibility in DataTables - * @version 1.1.2-dev - * @file dataTables.colReorder.js - * @author SpryMedia Ltd (www.sprymedia.co.uk) - * @contact www.sprymedia.co.uk/contact - * @copyright Copyright 2010-2014 SpryMedia Ltd. - * - * This source file is free software, available under the following license: - * MIT license - http://datatables.net/license/mit - * - * This source file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. - * - * For details please refer to: http://www.datatables.net - */ - -(function(window, document, undefined) { - - -var factory = function( $, DataTable ) { -"use strict"; - -/** - * ColVis provides column visibility control for DataTables - * - * @class ColVis - * @constructor - * @param {object} DataTables settings object. With DataTables 1.10 this can - * also be and API instance, table node, jQuery collection or jQuery selector. - * @param {object} ColVis configuration options - */ -var ColVis = function( oDTSettings, oInit ) -{ - /* Santiy check that we are a new instance */ - if ( !this.CLASS || this.CLASS != "ColVis" ) - { - alert( "Warning: ColVis must be initialised with the keyword 'new'" ); - } - - if ( typeof oInit == 'undefined' ) - { - oInit = {}; - } - - var camelToHungarian = $.fn.dataTable.camelToHungarian; - if ( camelToHungarian ) { - camelToHungarian( ColVis.defaults, ColVis.defaults, true ); - camelToHungarian( ColVis.defaults, oInit ); - } - - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Public class variables - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - /** - * @namespace Settings object which contains customisable information for - * ColVis instance. Augmented by ColVis.defaults - */ - this.s = { - /** - * DataTables settings object - * @property dt - * @type Object - * @default null - */ - "dt": null, - - /** - * Customisation object - * @property oInit - * @type Object - * @default passed in - */ - "oInit": oInit, - - /** - * Flag to say if the collection is hidden - * @property hidden - * @type boolean - * @default true - */ - "hidden": true, - - /** - * Store the original visibility settings so they could be restored - * @property abOriginal - * @type Array - * @default [] - */ - "abOriginal": [] - }; - - - /** - * @namespace Common and useful DOM elements for the class instance - */ - this.dom = { - /** - * Wrapper for the button - given back to DataTables as the node to insert - * @property wrapper - * @type Node - * @default null - */ - "wrapper": null, - - /** - * Activation button - * @property button - * @type Node - * @default null - */ - "button": null, - - /** - * Collection list node - * @property collection - * @type Node - * @default null - */ - "collection": null, - - /** - * Background node used for shading the display and event capturing - * @property background - * @type Node - * @default null - */ - "background": null, - - /** - * Element to position over the activation button to catch mouse events when using mouseover - * @property catcher - * @type Node - * @default null - */ - "catcher": null, - - /** - * List of button elements - * @property buttons - * @type Array - * @default [] - */ - "buttons": [], - - /** - * List of group button elements - * @property groupButtons - * @type Array - * @default [] - */ - "groupButtons": [], - - /** - * Restore button - * @property restore - * @type Node - * @default null - */ - "restore": null - }; - - /* Store global reference */ - ColVis.aInstances.push( this ); - - /* Constructor logic */ - this.s.dt = $.fn.dataTable.Api ? - new $.fn.dataTable.Api( oDTSettings ).settings()[0] : - oDTSettings; - - this._fnConstruct( oInit ); - return this; -}; - - - -ColVis.prototype = { - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Public methods - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - /** - * Get the ColVis instance's control button so it can be injected into the - * DOM - * @method button - * @returns {node} ColVis button - */ - button: function () - { - return this.dom.wrapper; - }, - - /** - * Alias of `rebuild` for backwards compatibility - * @method fnRebuild - */ - "fnRebuild": function () - { - this.rebuild(); - }, - - /** - * Rebuild the list of buttons for this instance (i.e. if there is a column - * header update) - * @method fnRebuild - */ - rebuild: function () - { - /* Remove the old buttons */ - for ( var i=this.dom.buttons.length-1 ; i>=0 ; i-- ) { - this.dom.collection.removeChild( this.dom.buttons[i] ); - } - this.dom.buttons.splice( 0, this.dom.buttons.length ); - - if ( this.dom.restore ) { - this.dom.restore.parentNode( this.dom.restore ); - } - - /* Re-add them (this is not the optimal way of doing this, it is fast and effective) */ - this._fnAddGroups(); - this._fnAddButtons(); - - /* Update the checkboxes */ - this._fnDrawCallback(); - }, - - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Private methods (they are of course public in JS, but recommended as private) - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - /** - * Constructor logic - * @method _fnConstruct - * @returns void - * @private - */ - "_fnConstruct": function ( init ) - { - this._fnApplyCustomisation( init ); - - var that = this; - var i, iLen; - this.dom.wrapper = document.createElement('div'); - this.dom.wrapper.className = "ColVis"; - - this.dom.button = $( '', { - 'class': !this.s.dt.bJUI ? - "ColVis_Button ColVis_MasterButton" : - "ColVis_Button ColVis_MasterButton ui-button ui-state-default" - } ) - .append( ''+this.s.buttonText+'' ) - .bind( this.s.activate=="mouseover" ? "mouseover" : "click", function (e) { - e.preventDefault(); - that._fnCollectionShow(); - } ) - .appendTo( this.dom.wrapper )[0]; - - this.dom.catcher = this._fnDomCatcher(); - this.dom.collection = this._fnDomCollection(); - this.dom.background = this._fnDomBackground(); - - this._fnAddGroups(); - this._fnAddButtons(); - - /* Store the original visibility information */ - for ( i=0, iLen=this.s.dt.aoColumns.length ; i'+ - this.s.restore+ - '' - ) - .click( function (e) { - for ( var i=0, iLen=that.s.abOriginal.length ; i'+ - str+ - '' - ) - .click( function (e) { - for ( var i=0, iLen=that.s.abOriginal.length ; i'+ - ''+ - ''+ - ''+oGroup.sTitle+''+ - ''+ - '' - ) - .click( function (e) { - var showHide = !$('input', this).is(":checked"); - if ( e.target.nodeName.toLowerCase() !== "li" ) - { - showHide = ! showHide; - } - - for ( var j=0 ; j < oGroup.aiColumns.length ; j++ ) - { - that.s.dt.oInstance.fnSetColumnVis( oGroup.aiColumns[j], showHide ); - } - } )[0]; - }, - - - /** - * Create the DOM for a show / hide button - * @method _fnDomColumnButton - * @param {int} i Column in question - * @returns {Node} Created button - * @private - */ - "_fnDomColumnButton": function ( i ) - { - var - that = this, - column = this.s.dt.aoColumns[i], - dt = this.s.dt; - - var title = this.s.fnLabel===null ? - column.sTitle : - this.s.fnLabel( i, column.sTitle, column.nTh ); - - return $( - ''+ - ''+ - ''+ - ''+title.replace("", "")+''+ - ''+ - '' - ) - .click( function (e) { - var showHide = !$('input', this).is(":checked"); - if ( e.target.nodeName.toLowerCase() !== "li" ) - { - showHide = ! showHide; - } - - /* Need to consider the case where the initialiser created more than one table - change the - * API index that DataTables is using - */ - var oldIndex = $.fn.dataTableExt.iApiIndex; - $.fn.dataTableExt.iApiIndex = that._fnDataTablesApiIndex.call(that); - - // Optimisation for server-side processing when scrolling - don't do a full redraw - if ( dt.oFeatures.bServerSide ) - { - that.s.dt.oInstance.fnSetColumnVis( i, showHide, false ); - that.s.dt.oInstance.fnAdjustColumnSizing( false ); - if (dt.oScroll.sX !== "" || dt.oScroll.sY !== "" ) - { - that.s.dt.oInstance.oApi._fnScrollDraw( that.s.dt ); - } - that._fnDrawCallback(); - } - else - { - that.s.dt.oInstance.fnSetColumnVis( i, showHide ); - } - - $.fn.dataTableExt.iApiIndex = oldIndex; /* Restore */ - - if ( e.target.nodeName.toLowerCase() === 'input' && that.s.fnStateChange !== null ) - { - that.s.fnStateChange.call( that, i, showHide ); - } - } )[0]; - }, - - - /** - * Get the position in the DataTables instance array of the table for this - * instance of ColVis - * @method _fnDataTablesApiIndex - * @returns {int} Index - * @private - */ - "_fnDataTablesApiIndex": function () - { - for ( var i=0, iLen=this.s.dt.oInstance.length ; i', { - 'class': !this.s.dt.bJUI ? - "ColVis_collection" : - "ColVis_collection ui-buttonset ui-buttonset-multi" - } ) - .css( { - 'display': 'none', - 'opacity': 0, - 'position': ! this.s.bCssPosition ? - 'absolute' : - '' - } )[0]; - }, - - - /** - * An element to be placed on top of the activate button to catch events - * @method _fnDomCatcher - * @returns {Node} div container for the collection - * @private - */ - "_fnDomCatcher": function () - { - var - that = this, - nCatcher = document.createElement('div'); - nCatcher.className = "ColVis_catcher"; - - $(nCatcher).click( function () { - that._fnCollectionHide.call( that, null, null ); - } ); - - return nCatcher; - }, - - - /** - * Create the element used to shade the background, and capture hide events (it is shown and - * hidden as needed) - * @method _fnDomBackground - * @returns {Node} div container for the background - * @private - */ - "_fnDomBackground": function () - { - var that = this; - - var background = $('') - .addClass( 'ColVis_collectionBackground' ) - .css( 'opacity', 0 ) - .click( function () { - that._fnCollectionHide.call( that, null, null ); - } ); - - /* When considering a mouse over action for the activation, we also consider a mouse out - * which is the same as a mouse over the background - without all the messing around of - * bubbling events. Use the catcher element to avoid messing around with bubbling - */ - if ( this.s.activate == "mouseover" ) - { - background.mouseover( function () { - that.s.overcollection = false; - that._fnCollectionHide.call( that, null, null ); - } ); - } - - return background[0]; - }, - - - /** - * Show the show / hide list and the background - * @method _fnCollectionShow - * @returns void - * @private - */ - "_fnCollectionShow": function () - { - var that = this, i, iLen, iLeft; - var oPos = $(this.dom.button).offset(); - var nHidden = this.dom.collection; - var nBackground = this.dom.background; - var iDivX = parseInt(oPos.left, 10); - var iDivY = parseInt(oPos.top + $(this.dom.button).outerHeight(), 10); - - if ( ! this.s.bCssPosition ) - { - nHidden.style.top = iDivY+"px"; - nHidden.style.left = iDivX+"px"; - } - - $(nHidden).css( { - 'display': 'block', - 'opacity': 0 - } ); - - nBackground.style.bottom ='0px'; - nBackground.style.right = '0px'; - - var oStyle = this.dom.catcher.style; - oStyle.height = $(this.dom.button).outerHeight()+"px"; - oStyle.width = $(this.dom.button).outerWidth()+"px"; - oStyle.top = oPos.top+"px"; - oStyle.left = iDivX+"px"; - - document.body.appendChild( nBackground ); - document.body.appendChild( nHidden ); - document.body.appendChild( this.dom.catcher ); - - /* This results in a very small delay for the end user but it allows the animation to be - * much smoother. If you don't want the animation, then the setTimeout can be removed - */ - $(nHidden).animate({"opacity": 1}, that.s.iOverlayFade); - $(nBackground).animate({"opacity": 0.45}, that.s.iOverlayFade, 'linear', function () { - /* In IE6 if you set the checked attribute of a hidden checkbox, then this is not visually - * reflected. As such, we need to do it here, once it is visible. Unbelievable. - */ - if ( $.browser && $.browser.msie && $.browser.version == "6.0" ) - { - that._fnDrawCallback(); - } - }); - - /* Visual corrections to try and keep the collection visible */ - if ( !this.s.bCssPosition ) - { - iLeft = ( this.s.sAlign=="left" ) ? - iDivX : - iDivX - $(nHidden).outerWidth() + $(this.dom.button).outerWidth(); - - nHidden.style.left = iLeft+"px"; - - var iDivWidth = $(nHidden).outerWidth(); - var iDivHeight = $(nHidden).outerHeight(); - var iDocWidth = $(document).width(); - - if ( iLeft + iDivWidth > iDocWidth ) - { - nHidden.style.left = (iDocWidth-iDivWidth)+"px"; - } - } - - this.s.hidden = false; - }, - - - /** - * Hide the show / hide list and the background - * @method _fnCollectionHide - * @returns void - * @private - */ - "_fnCollectionHide": function ( ) - { - var that = this; - - if ( !this.s.hidden && this.dom.collection !== null ) - { - this.s.hidden = true; - - $(this.dom.collection).animate({"opacity": 0}, that.s.iOverlayFade, function (e) { - this.style.display = "none"; - } ); - - $(this.dom.background).animate({"opacity": 0}, that.s.iOverlayFade, function (e) { - document.body.removeChild( that.dom.background ); - document.body.removeChild( that.dom.catcher ); - } ); - } - }, - - - /** - * Alter the colspan on any fnOpen rows - */ - "_fnAdjustOpenRows": function () - { - var aoOpen = this.s.dt.aoOpenRows; - var iVisible = this.s.dt.oApi._fnVisbleColumns( this.s.dt ); - - for ( var i=0, iLen=aoOpen.length ; i.ps-scrollbar-x-rail,.ps-container.ps-active-y>.ps-scrollbar-y-rail{display:block}.ps-container>.ps-scrollbar-x-rail{display:none;position:absolute;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;border-radius:4px;opacity:0;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);-webkit-transition:background-color .2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;-o-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear;bottom:3px;height:8px}.ps-container>.ps-scrollbar-x-rail>.ps-scrollbar-x{position:absolute;background-color:#aaa;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;border-radius:4px;-webkit-transition:background-color .2s linear;-moz-transition:background-color .2s linear;-o-transition:background-color .2s linear;transition:background-color .2s linear;bottom:0;height:8px}.ps-container>.ps-scrollbar-x-rail.in-scrolling{background-color:#eee;opacity:.9;-ms-filter:"alpha(Opacity=90)";filter:alpha(opacity=90)}.ps-container>.ps-scrollbar-y-rail{display:none;position:absolute;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;border-radius:4px;opacity:0;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);-webkit-transition:background-color .2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;-o-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear;right:3px;width:8px}.ps-container>.ps-scrollbar-y-rail>.ps-scrollbar-y{position:absolute;background-color:#aaa;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;border-radius:4px;-webkit-transition:background-color .2s linear;-moz-transition:background-color .2s linear;-o-transition:background-color .2s linear;transition:background-color .2s linear;right:0;width:8px}.ps-container>.ps-scrollbar-y-rail.in-scrolling{background-color:#eee;opacity:.9;-ms-filter:"alpha(Opacity=90)";filter:alpha(opacity=90)}.ps-container:hover>.ps-scrollbar-x-rail,.ps-container:hover>.ps-scrollbar-y-rail{opacity:.6;-ms-filter:"alpha(Opacity=60)";filter:alpha(opacity=60)}.ps-container:hover>.ps-scrollbar-x-rail.in-scrolling,.ps-container:hover>.ps-scrollbar-y-rail.in-scrolling{background-color:#eee;opacity:.9;-ms-filter:"alpha(Opacity=90)";filter:alpha(opacity=90)}.ps-container:hover>.ps-scrollbar-x-rail:hover{background-color:#eee;opacity:.9;-ms-filter:"alpha(Opacity=90)";filter:alpha(opacity=90)}.ps-container:hover>.ps-scrollbar-x-rail:hover>.ps-scrollbar-x{background-color:#999}.ps-container:hover>.ps-scrollbar-y-rail:hover{background-color:#eee;opacity:.9;-ms-filter:"alpha(Opacity=90)";filter:alpha(opacity=90)}.ps-container:hover>.ps-scrollbar-y-rail:hover>.ps-scrollbar-y{background-color:#999} \ No newline at end of file diff --git a/lib/web/public/resources/perfect-scrollbar.min.js b/lib/web/public/resources/perfect-scrollbar.min.js deleted file mode 100644 index ea0340ea..00000000 --- a/lib/web/public/resources/perfect-scrollbar.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! perfect-scrollbar - v0.5.8 -* http://noraesae.github.com/perfect-scrollbar/ -* Copyright (c) 2014 Hyunje Alex Jun; Licensed MIT */ -(function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)})(function(e){"use strict";function t(e){return"string"==typeof e?parseInt(e,10):~~e}var o={wheelSpeed:1,wheelPropagation:!1,swipePropagation:!0,minScrollbarLength:null,maxScrollbarLength:null,useBothWheelAxes:!1,useKeyboard:!0,suppressScrollX:!1,suppressScrollY:!1,scrollXMarginOffset:0,scrollYMarginOffset:0,includePadding:!1},n=0,r=function(){var e=n++;return function(t){var o=".perfect-scrollbar-"+e;return t===void 0?o:t+o}},l="WebkitAppearance"in document.documentElement.style;e.fn.perfectScrollbar=function(n,i){return this.each(function(){function a(e,o){var n=e+o,r=D-R;j=0>n?0:n>r?r:n;var l=t(j*(Y-D)/(D-R));M.scrollTop(l)}function s(e,o){var n=e+o,r=E-k;W=0>n?0:n>r?r:n;var l=t(W*(C-E)/(E-k));M.scrollLeft(l)}function c(e){return P.minScrollbarLength&&(e=Math.max(e,P.minScrollbarLength)),P.maxScrollbarLength&&(e=Math.min(e,P.maxScrollbarLength)),e}function u(){var e={width:I};e.left=B?M.scrollLeft()+E-C:M.scrollLeft(),N?e.bottom=_-M.scrollTop():e.top=Q+M.scrollTop(),H.css(e);var t={top:M.scrollTop(),height:A};Z?t.right=B?C-M.scrollLeft()-V-J.outerWidth():V-M.scrollLeft():t.left=B?M.scrollLeft()+2*E-C-$-J.outerWidth():$+M.scrollLeft(),G.css(t),U.css({left:W,width:k-z}),J.css({top:j,height:R-et})}function d(){M.removeClass("ps-active-x"),M.removeClass("ps-active-y"),E=P.includePadding?M.innerWidth():M.width(),D=P.includePadding?M.innerHeight():M.height(),C=M.prop("scrollWidth"),Y=M.prop("scrollHeight"),!P.suppressScrollX&&C>E+P.scrollXMarginOffset?(X=!0,I=E-F,k=c(t(I*E/C)),W=t(M.scrollLeft()*(I-k)/(C-E))):(X=!1,k=0,W=0,M.scrollLeft(0)),!P.suppressScrollY&&Y>D+P.scrollYMarginOffset?(O=!0,A=D-tt,R=c(t(A*D/Y)),j=t(M.scrollTop()*(A-R)/(Y-D))):(O=!1,R=0,j=0,M.scrollTop(0)),W>=I-k&&(W=I-k),j>=A-R&&(j=A-R),u(),X&&M.addClass("ps-active-x"),O&&M.addClass("ps-active-y")}function p(){var t,o,n=function(e){s(t,e.pageX-o),d(),e.stopPropagation(),e.preventDefault()},r=function(){H.removeClass("in-scrolling"),e(q).unbind(K("mousemove"),n)};U.bind(K("mousedown"),function(l){o=l.pageX,t=U.position().left,H.addClass("in-scrolling"),e(q).bind(K("mousemove"),n),e(q).one(K("mouseup"),r),l.stopPropagation(),l.preventDefault()}),t=o=null}function f(){var t,o,n=function(e){a(t,e.pageY-o),d(),e.stopPropagation(),e.preventDefault()},r=function(){G.removeClass("in-scrolling"),e(q).unbind(K("mousemove"),n)};J.bind(K("mousedown"),function(l){o=l.pageY,t=J.position().top,G.addClass("in-scrolling"),e(q).bind(K("mousemove"),n),e(q).one(K("mouseup"),r),l.stopPropagation(),l.preventDefault()}),t=o=null}function v(e,t){var o=M.scrollTop();if(0===e){if(!O)return!1;if(0===o&&t>0||o>=Y-D&&0>t)return!P.wheelPropagation}var n=M.scrollLeft();if(0===t){if(!X)return!1;if(0===n&&0>e||n>=C-E&&e>0)return!P.wheelPropagation}return!0}function g(e,t){var o=M.scrollTop(),n=M.scrollLeft(),r=Math.abs(e),l=Math.abs(t);if(l>r){if(0>t&&o===Y-D||t>0&&0===o)return!P.swipePropagation}else if(r>l&&(0>e&&n===C-E||e>0&&0===n))return!P.swipePropagation;return!0}function b(){function e(e){var t=e.originalEvent.deltaX,o=-1*e.originalEvent.deltaY;return(t===void 0||o===void 0)&&(t=-1*e.originalEvent.wheelDeltaX/6,o=e.originalEvent.wheelDeltaY/6),e.originalEvent.deltaMode&&1===e.originalEvent.deltaMode&&(t*=10,o*=10),t!==t&&o!==o&&(t=0,o=e.originalEvent.wheelDelta),[t,o]}function t(t){if(l||!(M.find("select:focus").length>0)){var n=e(t),r=n[0],i=n[1];o=!1,P.useBothWheelAxes?O&&!X?(i?M.scrollTop(M.scrollTop()-i*P.wheelSpeed):M.scrollTop(M.scrollTop()+r*P.wheelSpeed),o=!0):X&&!O&&(r?M.scrollLeft(M.scrollLeft()+r*P.wheelSpeed):M.scrollLeft(M.scrollLeft()-i*P.wheelSpeed),o=!0):(M.scrollTop(M.scrollTop()-i*P.wheelSpeed),M.scrollLeft(M.scrollLeft()+r*P.wheelSpeed)),d(),o=o||v(r,i),o&&(t.stopPropagation(),t.preventDefault())}}var o=!1;window.onwheel!==void 0?M.bind(K("wheel"),t):window.onmousewheel!==void 0&&M.bind(K("mousewheel"),t)}function h(){var t=!1;M.bind(K("mouseenter"),function(){t=!0}),M.bind(K("mouseleave"),function(){t=!1});var o=!1;e(q).bind(K("keydown"),function(n){if((!n.isDefaultPrevented||!n.isDefaultPrevented())&&t){for(var r=document.activeElement?document.activeElement:q.activeElement;r.shadowRoot;)r=r.shadowRoot.activeElement;if(!e(r).is(":input,[contenteditable]")){var l=0,i=0;switch(n.which){case 37:l=-30;break;case 38:i=30;break;case 39:l=30;break;case 40:i=-30;break;case 33:i=90;break;case 32:case 34:i=-90;break;case 35:i=n.ctrlKey?-Y:-D;break;case 36:i=n.ctrlKey?M.scrollTop():D;break;default:return}M.scrollTop(M.scrollTop()-i),M.scrollLeft(M.scrollLeft()+l),o=v(l,i),o&&n.preventDefault()}}})}function w(){function e(e){e.stopPropagation()}J.bind(K("click"),e),G.bind(K("click"),function(e){var o=t(R/2),n=e.pageY-G.offset().top-o,r=D-R,l=n/r;0>l?l=0:l>1&&(l=1),M.scrollTop((Y-D)*l)}),U.bind(K("click"),e),H.bind(K("click"),function(e){var o=t(k/2),n=e.pageX-H.offset().left-o,r=E-k,l=n/r;0>l?l=0:l>1&&(l=1),M.scrollLeft((C-E)*l)})}function m(){function t(){var e=window.getSelection?window.getSelection():document.getSlection?document.getSlection():{rangeCount:0};return 0===e.rangeCount?null:e.getRangeAt(0).commonAncestorContainer}function o(){r||(r=setInterval(function(){return x()?(M.scrollTop(M.scrollTop()+l.top),M.scrollLeft(M.scrollLeft()+l.left),d(),void 0):(clearInterval(r),void 0)},50))}function n(){r&&(clearInterval(r),r=null),H.removeClass("in-scrolling"),G.removeClass("in-scrolling")}var r=null,l={top:0,left:0},i=!1;e(q).bind(K("selectionchange"),function(){e.contains(M[0],t())?i=!0:(i=!1,n())}),e(window).bind(K("mouseup"),function(){i&&(i=!1,n())}),e(window).bind(K("mousemove"),function(e){if(i){var t={x:e.pageX,y:e.pageY},r=M.offset(),a={left:r.left,right:r.left+M.outerWidth(),top:r.top,bottom:r.top+M.outerHeight()};t.xa.right-3?(l.left=5,H.addClass("in-scrolling")):l.left=0,t.ya.top+3-t.y?-5:-20,G.addClass("in-scrolling")):t.y>a.bottom-3?(l.top=5>t.y-a.bottom+3?5:20,G.addClass("in-scrolling")):l.top=0,0===l.top&&0===l.left?n():o()}})}function T(t,o){function n(e,t){M.scrollTop(M.scrollTop()-t),M.scrollLeft(M.scrollLeft()-e),d()}function r(){h=!0}function l(){h=!1}function i(e){return e.originalEvent.targetTouches?e.originalEvent.targetTouches[0]:e.originalEvent}function a(e){var t=e.originalEvent;return t.targetTouches&&1===t.targetTouches.length?!0:t.pointerType&&"mouse"!==t.pointerType&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE?!0:!1}function s(e){if(a(e)){w=!0;var t=i(e);p.pageX=t.pageX,p.pageY=t.pageY,f=(new Date).getTime(),null!==b&&clearInterval(b),e.stopPropagation()}}function c(e){if(!h&&w&&a(e)){var t=i(e),o={pageX:t.pageX,pageY:t.pageY},r=o.pageX-p.pageX,l=o.pageY-p.pageY;n(r,l),p=o;var s=(new Date).getTime(),c=s-f;c>0&&(v.x=r/c,v.y=l/c,f=s),g(r,l)&&(e.stopPropagation(),e.preventDefault())}}function u(){!h&&w&&(w=!1,clearInterval(b),b=setInterval(function(){return x()?.01>Math.abs(v.x)&&.01>Math.abs(v.y)?(clearInterval(b),void 0):(n(30*v.x,30*v.y),v.x*=.8,v.y*=.8,void 0):(clearInterval(b),void 0)},10))}var p={},f=0,v={},b=null,h=!1,w=!1;t&&(e(window).bind(K("touchstart"),r),e(window).bind(K("touchend"),l),M.bind(K("touchstart"),s),M.bind(K("touchmove"),c),M.bind(K("touchend"),u)),o&&(window.PointerEvent?(e(window).bind(K("pointerdown"),r),e(window).bind(K("pointerup"),l),M.bind(K("pointerdown"),s),M.bind(K("pointermove"),c),M.bind(K("pointerup"),u)):window.MSPointerEvent&&(e(window).bind(K("MSPointerDown"),r),e(window).bind(K("MSPointerUp"),l),M.bind(K("MSPointerDown"),s),M.bind(K("MSPointerMove"),c),M.bind(K("MSPointerUp"),u)))}function y(){M.bind(K("scroll"),function(){d()})}function L(){M.unbind(K()),e(window).unbind(K()),e(q).unbind(K()),M.data("perfect-scrollbar",null),M.data("perfect-scrollbar-update",null),M.data("perfect-scrollbar-destroy",null),U.remove(),J.remove(),H.remove(),G.remove(),M=H=G=U=J=X=O=E=D=C=Y=k=W=_=N=Q=R=j=V=Z=$=B=K=null}function S(){d(),y(),p(),f(),w(),m(),b(),(ot||nt)&&T(ot,nt),P.useKeyboard&&h(),M.data("perfect-scrollbar",M),M.data("perfect-scrollbar-update",d),M.data("perfect-scrollbar-destroy",L)}var P=e.extend(!0,{},o),M=e(this),x=function(){return!!M};if("object"==typeof n?e.extend(!0,P,n):i=n,"update"===i)return M.data("perfect-scrollbar-update")&&M.data("perfect-scrollbar-update")(),M;if("destroy"===i)return M.data("perfect-scrollbar-destroy")&&M.data("perfect-scrollbar-destroy")(),M;if(M.data("perfect-scrollbar"))return M.data("perfect-scrollbar");M.addClass("ps-container");var E,D,C,Y,X,k,W,I,O,R,j,A,B="rtl"===M.css("direction"),K=r(),q=this.ownerDocument||document,H=e("").appendTo(M),U=e("").appendTo(H),_=t(H.css("bottom")),N=_===_,Q=N?null:t(H.css("top")),z=t(H.css("borderLeftWidth"))+t(H.css("borderRightWidth")),F=t(H.css("marginLeft"))+t(H.css("marginRight")),G=e("").appendTo(M),J=e("").appendTo(G),V=t(G.css("right")),Z=V===V,$=Z?null:t(G.css("left")),et=t(G.css("borderTopWidth"))+t(G.css("borderBottomWidth")),tt=t(G.css("marginTop"))+t(G.css("marginBottom")),ot="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,nt=null!==window.navigator.msMaxTouchPoints;return S(),M})}}); \ No newline at end of file diff --git a/lib/web/views/layout.haml b/lib/web/views/layout.haml index 9295dd2d..9e80d0d4 100644 --- a/lib/web/views/layout.haml +++ b/lib/web/views/layout.haml @@ -14,14 +14,14 @@ %link{:href => "/theme/#{@bootstrap_theme}/style.css", :rel => "stylesheet"}/ - else %link{:href => "//cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/css/bootstrap.min.css", :rel => "stylesheet"}/ - %link{:href => "/resources/default-style.css?_=#{Narou::VERSION}", :rel => "stylesheet"}/ + %link{:href => "/resources/css/default-style.css?_=#{Narou::VERSION}", :rel => "stylesheet"}/ %link{:href => "//cdn.datatables.net/2.3.4/css/dataTables.bootstrap.min.css", :rel => "stylesheet"}/ %link{:href => "//cdn.datatables.net/colreorder/2.1.2/css/colReorder.bootstrap.min.css", :rel => "stylesheet"}/ %link{:href => "//cdn.datatables.net/buttons/3.2.5/css/buttons.bootstrap.min.css", :rel => "stylesheet"} %link{:href => "//cdn.datatables.net/colvis/1.1.1/css/dataTables.colVis.css", :rel => "stylesheet"}/ %link{:href => "//cdn.jsdelivr.net/npm/bootstrap-select@1.13.18/dist/css/bootstrap-select.min.css", :rel => "stylesheet"}/ %link{:href => "//cdn.jsdelivr.net/npm/perfect-scrollbar@1.5.6/css/perfect-scrollbar.min.css", :rel => "stylesheet"}/ - %link{:href => "/resources/toggle-switch.css", :rel => "stylesheet"}/ + %link{:href => "/resources/css/toggle-switch.css", :rel => "stylesheet"}/ %link{:href => "/style.css?_=#{Narou::VERSION}", :rel => "stylesheet"}/ :javascript var local_initialize_functions = []; @@ -50,15 +50,15 @@ %script{:src => "//cdn.jsdelivr.net/npm/bootstrap-select@1.13.18/js/bootstrap-select.min.js"} %script{:src => "//cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"} %script{:src => "//cdn.jsdelivr.net/npm/perfect-scrollbar@0.8.1/dist/js/perfect-scrollbar.jquery.min.js"} - %script{:src => "/resources/bootbox.js"} - %script{:src => "/resources/sprintf.js"} - %script{:src => "/resources/shortcut.js"} - %script{:src => "/resources/jquery.outerclick.js"} - %script{:src => "/resources/jquery.slidenavbar.js"} - %script{:src => "/resources/jquery.moveto.js"} - %script{:src => "/resources/narou.library.js?_=#{Narou::VERSION}"} - %script{:src => "/resources/narou.queue.js?_=#{Narou::VERSION}"} - %script{:src => "/resources/common.ui.js?_=#{Narou::VERSION}"} + %script{:src => "/resources/js/bootbox.js"} + %script{:src => "/resources/js/sprintf.js"} + %script{:src => "/resources/js/shortcut.js"} + %script{:src => "/resources/js/jquery.outerclick.js"} + %script{:src => "/resources/js/jquery.slidenavbar.js"} + %script{:src => "/resources/js/jquery.moveto.js"} + %script{:src => "/resources/js/narou.library.js?_=#{Narou::VERSION}"} + %script{:src => "/resources/js/narou.queue.js?_=#{Narou::VERSION}"} + %script{:src => "/resources/js/common.ui.js?_=#{Narou::VERSION}"} :javascript $(document).ready(function($) { slideNavbar = $(".navbar-collapse").slideNavbar(); @@ -67,5 +67,5 @@ }); }); - if env["PATH_INFO"] == "/" - %script{:src => "/resources/narou.ui.js?_=#{Narou::VERSION}"} + %script{:src => "/resources/js/narou.ui.js?_=#{Narou::VERSION}"} diff --git a/lib/web/views/style.scss b/lib/web/views/style.scss index 70034a02..98c34bc8 100644 --- a/lib/web/views/style.scss +++ b/lib/web/views/style.scss @@ -203,10 +203,10 @@ table#novel-list { } thead { .sorting_asc { - @include dataTableSortingHeader("/resources/sort_asc.png"); + @include dataTableSortingHeader("/resources/images/sort_asc.png"); } .sorting_desc { - @include dataTableSortingHeader("/resources/sort_desc.png"); + @include dataTableSortingHeader("/resources/images/sort_desc.png"); } } /*