Reader.vue 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348
  1. <template>
  2. <div class="column no-wrap">
  3. <div ref="header" class="header" v-show="toolBarActive">
  4. <div ref="buttons" class="row justify-between no-wrap">
  5. <div>
  6. <button ref="loader" class="tool-button" :class="buttonActiveClass('loader')" @click="buttonClick('loader')" v-ripple>
  7. <q-icon name="la la-arrow-left" size="32px"/>
  8. <q-tooltip :delay="1500" anchor="bottom right" content-style="font-size: 80%">{{ rstore.readerActions['loader'] }}</q-tooltip>
  9. </button>
  10. </div>
  11. <div>
  12. <button ref="undoAction" v-show="showToolButton['undoAction']" class="tool-button" :class="buttonActiveClass('undoAction')" @click="buttonClick('undoAction')" v-ripple>
  13. <q-icon name="la la-angle-left" size="32px"/>
  14. <q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">{{ rstore.readerActions['undoAction'] }}</q-tooltip>
  15. </button>
  16. <button ref="redoAction" v-show="showToolButton['redoAction']" class="tool-button" :class="buttonActiveClass('redoAction')" @click="buttonClick('redoAction')" v-ripple>
  17. <q-icon name="la la-angle-right" size="32px"/>
  18. <q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">{{ rstore.readerActions['redoAction'] }}</q-tooltip>
  19. </button>
  20. <div class="space"></div>
  21. <button ref="fullScreen" v-show="showToolButton['fullScreen']" class="tool-button" :class="buttonActiveClass('fullScreen')" @click="buttonClick('fullScreen')" v-ripple>
  22. <q-icon :name="(fullScreenActive ? 'la la-compress-arrows-alt': 'la la-expand-arrows-alt')" size="32px"/>
  23. <q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">{{ rstore.readerActions['fullScreen'] }}</q-tooltip>
  24. </button>
  25. <button ref="scrolling" v-show="showToolButton['scrolling']" class="tool-button" :class="buttonActiveClass('scrolling')" @click="buttonClick('scrolling')" v-ripple>
  26. <q-icon name="la la-film" size="32px"/>
  27. <q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">{{ rstore.readerActions['scrolling'] }}</q-tooltip>
  28. </button>
  29. <button ref="setPosition" v-show="showToolButton['setPosition']" class="tool-button" :class="buttonActiveClass('setPosition')" @click="buttonClick('setPosition')" v-ripple>
  30. <q-icon name="la la-angle-double-right" size="32px"/>
  31. <q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">{{ rstore.readerActions['setPosition'] }}</q-tooltip>
  32. </button>
  33. <button ref="search" v-show="showToolButton['search']" class="tool-button" :class="buttonActiveClass('search')" @click="buttonClick('search')" v-ripple>
  34. <q-icon name="la la-search" size="32px"/>
  35. <q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">{{ rstore.readerActions['search'] }}</q-tooltip>
  36. </button>
  37. <button ref="copyText" v-show="showToolButton['copyText']" class="tool-button" :class="buttonActiveClass('copyText')" @click="buttonClick('copyText')" v-ripple>
  38. <q-icon name="la la-copy" size="32px"/>
  39. <q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">{{ rstore.readerActions['copyText'] }}</q-tooltip>
  40. </button>
  41. <button ref="splitToPara" v-show="showToolButton['splitToPara']" class="tool-button" :class="buttonActiveClass('splitToPara')" @click="buttonClick('splitToPara')" v-ripple>
  42. <q-icon name="la la-retweet" size="32px"/>
  43. <q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">{{ rstore.readerActions['splitToPara'] }}</q-tooltip>
  44. </button>
  45. <button ref="refresh" v-show="showToolButton['refresh']" class="tool-button" :class="buttonActiveClass('refresh')" @click="buttonClick('refresh')" v-ripple>
  46. <q-icon name="la la-sync" size="32px" :class="{clear: !showRefreshIcon}"/>
  47. <q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">{{ rstore.readerActions['refresh'] }}</q-tooltip>
  48. </button>
  49. <div class="space"></div>
  50. <button ref="libs" v-show="mode == 'liberama.top' && showToolButton['libs']" class="tool-button" :class="buttonActiveClass('libs')" @click="buttonClick('libs')" v-ripple>
  51. <q-icon name="la la-sitemap" size="32px"/>
  52. <q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">{{ rstore.readerActions['libs'] }}</q-tooltip>
  53. </button>
  54. <button ref="recentBooks" v-show="showToolButton['recentBooks']" class="tool-button" :class="buttonActiveClass('recentBooks')" @click="buttonClick('recentBooks')" v-ripple>
  55. <q-icon name="la la-book-open" size="32px"/>
  56. <q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">{{ rstore.readerActions['recentBooks'] }}</q-tooltip>
  57. </button>
  58. </div>
  59. <div>
  60. <button ref="offlineMode" v-show="showToolButton['offlineMode']" class="tool-button" :class="buttonActiveClass('offlineMode')" @click="buttonClick('offlineMode')" v-ripple>
  61. <q-icon name="la la-unlink" size="32px"/>
  62. <q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">{{ rstore.readerActions['offlineMode'] }}</q-tooltip>
  63. </button>
  64. <button ref="settings" class="tool-button" :class="buttonActiveClass('settings')" @click="buttonClick('settings')" v-ripple>
  65. <q-icon name="la la-cog" size="32px"/>
  66. <q-tooltip :delay="1500" anchor="bottom left" content-style="font-size: 80%">{{ rstore.readerActions['settings'] }}</q-tooltip>
  67. </button>
  68. </div>
  69. </div>
  70. </div>
  71. <div class="main col row relative-position">
  72. <keep-alive>
  73. <component ref="page" class="col" :is="activePage"
  74. @load-book="loadBook"
  75. @load-file="loadFile"
  76. @book-pos-changed="bookPosChanged"
  77. @do-action="doAction"
  78. ></component>
  79. </keep-alive>
  80. <SetPositionPage v-if="setPositionActive" ref="setPositionPage" @set-position-toggle="setPositionToggle" @book-pos-changed="bookPosChanged"></SetPositionPage>
  81. <SearchPage v-show="searchActive" ref="searchPage"
  82. @do-action="doAction"
  83. @book-pos-changed="bookPosChanged"
  84. @start-text-search="startTextSearch"
  85. @stop-text-search="stopTextSearch">
  86. </SearchPage>
  87. <CopyTextPage v-if="copyTextActive" ref="copyTextPage" @do-action="doAction"></CopyTextPage>
  88. <LibsPage v-show="libsActive" ref="libsPage" @load-book="loadBook" @libs-close="libsClose" @do-action="doAction"></LibsPage>
  89. <RecentBooksPage v-show="recentBooksActive" ref="recentBooksPage" @load-book="loadBook" @recent-books-close="recentBooksClose"></RecentBooksPage>
  90. <SettingsPage v-show="settingsActive" ref="settingsPage" @do-action="doAction"></SettingsPage>
  91. <HelpPage v-if="helpActive" ref="helpPage" @do-action="doAction"></HelpPage>
  92. <ClickMapPage v-show="clickMapActive" ref="clickMapPage"></ClickMapPage>
  93. <ServerStorage v-show="hidden" ref="serverStorage"></ServerStorage>
  94. <Dialog ref="dialog1" v-model="whatsNewVisible">
  95. <template slot="header">
  96. Что нового:
  97. </template>
  98. <div style="line-height: 20px" v-html="whatsNewContent"></div>
  99. <span class="clickable" @click="openVersionHistory">Посмотреть историю версий</span>
  100. <span slot="footer">
  101. <q-btn class="q-px-md" dense no-caps @click="whatsNewDisable">Больше не показывать</q-btn>
  102. </span>
  103. </Dialog>
  104. <Dialog ref="dialog2" v-model="donationVisible">
  105. <template slot="header">
  106. Здравствуйте, уважаемые читатели!
  107. </template>
  108. <div style="word-break: normal">
  109. Стартовала ежегодная акция "Оплатим хостинг вместе".<br><br>
  110. Для оплаты годового хостинга читалки, необходимо собрать около 2000 рублей.
  111. В настоящий момент у автора эта сумма есть в наличии. Однако будет справедливо, если каждый
  112. сможет проголосовать рублем за то, чтобы читалка так и оставалась:
  113. <ul>
  114. <li>непрерывно улучшаемой</li>
  115. <li>без рекламы</li>
  116. <li>без регистрации</li>
  117. <li>Open Source</li>
  118. </ul>
  119. Автор также обращается с просьбой о помощи в распространении
  120. <a href="https://omnireader.ru" target="_blank">ссылки</a>
  121. <q-icon class="copy-icon" name="la la-copy" @click="copyLink('https://omnireader.ru')">
  122. <q-tooltip :delay="1000" anchor="top middle" self="center middle" content-style="font-size: 80%">Скопировать</q-tooltip>
  123. </q-icon>
  124. на читалку через тематические форумы, соцсети, мессенджеры и пр.
  125. Чем нас больше, тем легче оставаться на плаву и тем больше мотивации у разработчика, чтобы продолжать работать над проектом.
  126. <br><br>
  127. Если соберется бóльшая сумма, то разработка децентрализованной библиотеки для свободного обмена книгами будет по возможности ускорена.
  128. <br><br>
  129. P.S. При необходимости можно воспользоваться подходящим обменником на <a href="https://www.bestchange.ru" target="_blank">bestchange.ru</a>
  130. <br><br>
  131. <div class="row justify-center">
  132. <q-btn class="q-px-sm" color="primary" dense no-caps rounded @click="openDonate">Помочь проекту</q-btn>
  133. </div>
  134. </div>
  135. <span slot="footer">
  136. <span class="clickable row justify-end" style="font-size: 60%; color: grey" @click="donationDialogDisable">Больше не показывать</span>
  137. <br>
  138. <q-btn class="q-px-sm" dense no-caps @click="donationDialogRemind">Напомнить позже</q-btn>
  139. </span>
  140. </Dialog>
  141. </div>
  142. </div>
  143. </template>
  144. <script>
  145. //-----------------------------------------------------------------------------
  146. import Vue from 'vue';
  147. import Component from 'vue-class-component';
  148. import _ from 'lodash';
  149. import {Buffer} from 'safe-buffer';
  150. import LoaderPage from './LoaderPage/LoaderPage.vue';
  151. import TextPage from './TextPage/TextPage.vue';
  152. import ProgressPage from './ProgressPage/ProgressPage.vue';
  153. import SetPositionPage from './SetPositionPage/SetPositionPage.vue';
  154. import SearchPage from './SearchPage/SearchPage.vue';
  155. import CopyTextPage from './CopyTextPage/CopyTextPage.vue';
  156. import LibsPage from './LibsPage/LibsPage.vue';
  157. import RecentBooksPage from './RecentBooksPage/RecentBooksPage.vue';
  158. import SettingsPage from './SettingsPage/SettingsPage.vue';
  159. import HelpPage from './HelpPage/HelpPage.vue';
  160. import ClickMapPage from './ClickMapPage/ClickMapPage.vue';
  161. import ServerStorage from './ServerStorage/ServerStorage.vue';
  162. import Dialog from '../share/Dialog.vue';
  163. import bookManager from './share/bookManager';
  164. import rstore from '../../store/modules/reader';
  165. import readerApi from '../../api/reader';
  166. import * as utils from '../../share/utils';
  167. import {versionHistory} from './versionHistory';
  168. export default @Component({
  169. components: {
  170. LoaderPage,
  171. TextPage,
  172. ProgressPage,
  173. SetPositionPage,
  174. SearchPage,
  175. CopyTextPage,
  176. LibsPage,
  177. RecentBooksPage,
  178. SettingsPage,
  179. HelpPage,
  180. ClickMapPage,
  181. ServerStorage,
  182. Dialog,
  183. },
  184. watch: {
  185. bookPos: function(newValue) {
  186. if (newValue !== undefined && this.activePage == 'TextPage') {
  187. const textPage = this.$refs.page;
  188. if (textPage.bookPos != newValue) {
  189. textPage.bookPos = newValue;
  190. }
  191. if (!this.scrollingActive)
  192. this.debouncedSetRecentBook(newValue);
  193. else
  194. this.scrollingSetRecentBook(newValue);
  195. }
  196. },
  197. routeParamPos: function(newValue) {
  198. if (!this.paramPosIgnore && newValue !== undefined && newValue != this.bookPos) {
  199. this.bookPos = newValue;
  200. }
  201. },
  202. routeParamUrl: function(newValue) {
  203. if (newValue !== '' && newValue !== this.mostRecentBook().url) {
  204. this.loadBook({url: newValue, bookPos: this.routeParamPos});
  205. }
  206. },
  207. settings: function() {
  208. this.loadSettings();
  209. this.updateRoute();
  210. },
  211. loaderActive: function(newValue) {
  212. (async() => {
  213. const recent = this.mostRecentBook();
  214. if (!newValue && !this.loading && recent && !await bookManager.hasBookParsed(recent)) {
  215. this.loadBook(recent);
  216. }
  217. })();
  218. },
  219. },
  220. })
  221. class Reader extends Vue {
  222. rstore = {};
  223. loaderActive = false;
  224. offlineModeActive = false;
  225. progressActive = false;
  226. fullScreenActive = false;
  227. scrollingActive = false;
  228. setPositionActive = false;
  229. searchActive = false;
  230. copyTextActive = false;
  231. libsActive = false;
  232. recentBooksActive = false;
  233. settingsActive = false;
  234. helpActive = false;
  235. clickMapActive = false;
  236. bookPos = null;
  237. allowUrlParamBookPos = false;
  238. showRefreshIcon = true;
  239. mostRecentBookReactive = null;
  240. showToolButton = {};
  241. actionList = [];
  242. actionCur = -1;
  243. hidden = false;
  244. whatsNewVisible = false;
  245. whatsNewContent = '';
  246. donationVisible = false;
  247. created() {
  248. this.rstore = rstore;
  249. this.loading = true;
  250. this.commit = this.$store.commit;
  251. this.dispatch = this.$store.dispatch;
  252. this.reader = this.$store.state.reader;
  253. this.config = this.$store.state.config;
  254. this.$root.addKeyHook(this.keyHook);
  255. this.lastActivePage = false;
  256. this.debouncedSetRecentBook = _.debounce(async(newValue) => {
  257. const recent = this.mostRecentBook();
  258. if (recent && (recent.bookPos != newValue || recent.bookPosSeen !== this.bookPosSeen)) {
  259. await bookManager.setRecentBook(Object.assign({}, recent, {bookPos: newValue, bookPosSeen: this.bookPosSeen}));
  260. if (this.actionCur < 0 || (this.actionCur >= 0 && this.actionList[this.actionCur] != newValue))
  261. this.addAction(newValue);
  262. this.paramPosIgnore = true;
  263. this.updateRoute();
  264. await this.$nextTick();
  265. this.paramPosIgnore = false;
  266. }
  267. }, 500, {'maxWait':5000});
  268. this.scrollingSetRecentBook = _.debounce((newValue) => {
  269. this.debouncedSetRecentBook(newValue);
  270. }, 15000, {'maxWait':20000});
  271. document.addEventListener('fullscreenchange', () => {
  272. this.fullScreenActive = (document.fullscreenElement !== null);
  273. });
  274. this.loadSettings();
  275. }
  276. mounted() {
  277. this.updateHeaderMinWidth();
  278. (async() => {
  279. await bookManager.init(this.settings);
  280. bookManager.addEventListener(this.bookManagerEvent);
  281. if (this.$root.rootRoute() == '/reader') {
  282. if (this.routeParamUrl) {
  283. await this.loadBook({url: this.routeParamUrl, bookPos: this.routeParamPos, force: this.routeParamRefresh});
  284. } else {
  285. this.loaderActive = true;
  286. }
  287. }
  288. await this.$refs.serverStorage.init();
  289. this.checkSetStorageAccessKey();
  290. this.checkActivateDonateHelpPage();
  291. this.loading = false;
  292. this.updateRoute();
  293. await this.showWhatsNew();
  294. await this.showDonation();
  295. })();
  296. }
  297. loadSettings() {
  298. const settings = this.settings;
  299. this.allowUrlParamBookPos = settings.allowUrlParamBookPos;
  300. this.copyFullText = settings.copyFullText;
  301. this.showClickMapPage = settings.showClickMapPage;
  302. this.clickControl = settings.clickControl;
  303. this.blinkCachedLoad = settings.blinkCachedLoad;
  304. this.showWhatsNewDialog = settings.showWhatsNewDialog;
  305. this.showDonationDialog2020 = settings.showDonationDialog2020;
  306. this.showToolButton = settings.showToolButton;
  307. this.enableSitesFilter = settings.enableSitesFilter;
  308. this.readerActionByKeyCode = utils.userHotKeysObjectSwap(settings.userHotKeys);
  309. this.$root.readerActionByKeyEvent = (event) => {
  310. return this.readerActionByKeyCode[utils.keyEventToCode(event)];
  311. }
  312. this.updateHeaderMinWidth();
  313. }
  314. updateHeaderMinWidth() {
  315. const showButtonCount = Object.values(this.showToolButton).reduce((a, b) => a + (b ? 1 : 0), 0);
  316. if (this.$refs.buttons)
  317. this.$refs.buttons.style.minWidth = 65*showButtonCount + 'px';
  318. (async() => {
  319. await utils.sleep(1000);
  320. if (this.$refs.header)
  321. this.$refs.header.style.overflowX = 'auto';
  322. })();
  323. }
  324. checkSetStorageAccessKey() {
  325. const q = this.$route.query;
  326. if (q['setStorageAccessKey']) {
  327. this.$router.replace(`/reader`);
  328. this.settingsToggle();
  329. this.$nextTick(() => {
  330. this.$refs.settingsPage.enterServerStorageKey(
  331. Buffer.from(utils.fromBase58(q['setStorageAccessKey'])).toString()
  332. );
  333. });
  334. }
  335. }
  336. checkActivateDonateHelpPage() {
  337. const q = this.$route.query;
  338. if (q['donate']) {
  339. this.$router.replace(`/reader`);
  340. this.helpToggle();
  341. this.$nextTick(() => {
  342. this.$refs.helpPage.activateDonateHelpPage();
  343. });
  344. }
  345. }
  346. checkBookPosPercent() {
  347. const q = this.$route.query;
  348. if (q['__pp']) {
  349. let pp = q['__pp'];
  350. if (pp) {
  351. pp = parseFloat(pp) || 0;
  352. const recent = this.mostRecentBook();
  353. (async() => {
  354. await utils.sleep(100);
  355. this.bookPos = Math.floor(recent.textLength*pp/100);
  356. })();
  357. }
  358. }
  359. }
  360. async showWhatsNew() {
  361. await utils.sleep(2000);
  362. const whatsNew = versionHistory[0];
  363. if (this.showWhatsNewDialog &&
  364. whatsNew.showUntil >= utils.formatDate(new Date(), 'coDate') &&
  365. whatsNew.header != this.whatsNewContentHash) {
  366. this.whatsNewContent = 'Версия ' + whatsNew.header + whatsNew.content;
  367. this.whatsNewVisible = true;
  368. }
  369. }
  370. async showDonation() {
  371. await utils.sleep(3000);
  372. const today = utils.formatDate(new Date(), 'coDate');
  373. if ((this.mode == 'omnireader' || this.mode == 'liberama.top') && today < '2020-03-01' && this.showDonationDialog2020 && this.donationRemindDate != today) {
  374. this.donationVisible = true;
  375. }
  376. }
  377. donationDialogDisable() {
  378. this.donationVisible = false;
  379. if (this.showDonationDialog2020) {
  380. const newSettings = Object.assign({}, this.settings, { showDonationDialog2020: false });
  381. this.commit('reader/setSettings', newSettings);
  382. }
  383. }
  384. donationDialogRemind() {
  385. this.donationVisible = false;
  386. this.commit('reader/setDonationRemindDate', utils.formatDate(new Date(), 'coDate'));
  387. }
  388. openDonate() {
  389. this.donationVisible = false;
  390. this.donateToggle();
  391. }
  392. async copyLink(link) {
  393. const result = await utils.copyTextToClipboard(link);
  394. if (result)
  395. this.$root.notify.success(`Ссылка ${link} успешно скопирована в буфер обмена`);
  396. else
  397. this.$root.notify.error('Копирование не удалось');
  398. }
  399. openVersionHistory() {
  400. this.whatsNewVisible = false;
  401. this.versionHistoryToggle();
  402. }
  403. whatsNewDisable() {
  404. this.whatsNewVisible = false;
  405. const whatsNew = versionHistory[0];
  406. this.commit('reader/setWhatsNewContentHash', whatsNew.header);
  407. }
  408. get routeParamPos() {
  409. let result = undefined;
  410. const q = this.$route.query;
  411. if (q['__p']) {
  412. result = q['__p'];
  413. if (Array.isArray(result))
  414. result = result[0];
  415. }
  416. return (result ? parseInt(result, 10) || 0 : result);
  417. }
  418. updateRoute(isNewRoute) {
  419. if (this.loading)
  420. return;
  421. const recent = this.mostRecentBook();
  422. const pos = (recent && recent.bookPos && this.allowUrlParamBookPos ? `__p=${recent.bookPos}&` : '');
  423. const url = (recent ? `url=${recent.url}` : '');
  424. if (isNewRoute)
  425. this.$router.push(`/reader?${pos}${url}`).catch(() => {});
  426. else
  427. this.$router.replace(`/reader?${pos}${url}`).catch(() => {});
  428. }
  429. get mode() {
  430. return this.$store.state.config.mode;
  431. }
  432. get routeParamUrl() {
  433. let result = '';
  434. const path = this.$route.fullPath;
  435. const i = path.indexOf('url=');
  436. if (i >= 0) {
  437. result = path.substr(i + 4);
  438. }
  439. return decodeURIComponent(result);
  440. }
  441. get routeParamRefresh() {
  442. const q = this.$route.query;
  443. return !!q['__refresh'];
  444. }
  445. bookPosChanged(event) {
  446. if (event.bookPosSeen !== undefined)
  447. this.bookPosSeen = event.bookPosSeen;
  448. this.bookPos = event.bookPos;
  449. }
  450. async bookManagerEvent(eventName, value) {
  451. if (eventName == 'set-recent' || eventName == 'recent-deleted') {
  452. const oldBook = (this.textPage ? this.textPage.lastBook : null);
  453. const oldPos = (this.textPage ? this.textPage.bookPos : null);
  454. const newBook = bookManager.mostRecentBook();
  455. if (!(oldBook && newBook && oldBook.key == newBook.key)) {
  456. this.mostRecentBook();
  457. }
  458. if (oldBook && newBook) {
  459. if (oldBook.key != newBook.key || oldBook.path != newBook.path) {
  460. this.loadingBook = true;
  461. try {
  462. await this.loadBook(newBook);
  463. } finally {
  464. this.loadingBook = false;
  465. }
  466. } else if (oldPos != newBook.bookPos) {
  467. while (this.loadingBook) await utils.sleep(100);
  468. this.bookPosChanged({bookPos: newBook.bookPos});
  469. }
  470. }
  471. }
  472. if (eventName == 'recent-changed') {
  473. if (this.recentBooksActive) {
  474. await this.$refs.recentBooksPage.updateTableData();
  475. }
  476. //сохранение в serverStorage
  477. if (value) {
  478. await utils.sleep(500);
  479. await this.$refs.serverStorage.saveRecent(value);
  480. }
  481. }
  482. }
  483. get toolBarActive() {
  484. return this.reader.toolBarActive;
  485. }
  486. mostRecentBook() {
  487. const result = bookManager.mostRecentBook();
  488. this.mostRecentBookReactive = result;
  489. return result;
  490. }
  491. get settings() {
  492. return this.$store.state.reader.settings;
  493. }
  494. get whatsNewContentHash() {
  495. return this.$store.state.reader.whatsNewContentHash;
  496. }
  497. get donationRemindDate() {
  498. return this.$store.state.reader.donationRemindDate;
  499. }
  500. addAction(pos) {
  501. let a = this.actionList;
  502. if (!a.length || a[a.length - 1] != pos) {
  503. a.push(pos);
  504. if (a.length > 20)
  505. a.shift();
  506. this.actionCur = a.length - 1;
  507. }
  508. }
  509. toolBarToggle() {
  510. this.commit('reader/setToolBarActive', !this.toolBarActive);
  511. this.$root.$emit('resize');
  512. }
  513. fullScreenToggle() {
  514. this.fullScreenActive = !this.fullScreenActive;
  515. if (this.fullScreenActive) {
  516. this.$q.fullscreen.request();
  517. } else {
  518. this.$q.fullscreen.exit();
  519. }
  520. }
  521. closeAllWindows() {
  522. this.setPositionActive = false;
  523. this.copyTextActive = false;
  524. this.recentBooksActive = false;
  525. this.settingsActive = false;
  526. this.stopScrolling();
  527. this.stopSearch();
  528. this.helpActive = false;
  529. }
  530. loaderToggle() {
  531. this.loaderActive = !this.loaderActive;
  532. if (this.loaderActive) {
  533. this.closeAllWindows();
  534. }
  535. }
  536. setPositionToggle() {
  537. this.setPositionActive = !this.setPositionActive;
  538. const page = this.$refs.page;
  539. if (this.setPositionActive && this.activePage == 'TextPage' && page.parsed) {
  540. this.closeAllWindows();
  541. this.setPositionActive = true;
  542. this.$nextTick(() => {
  543. const recent = this.mostRecentBook();
  544. this.$refs.setPositionPage.init(recent.bookPos, recent.textLength - 1);
  545. });
  546. } else {
  547. this.setPositionActive = false;
  548. }
  549. }
  550. stopScrolling() {
  551. if (this.scrollingActive)
  552. this.scrollingToggle();
  553. }
  554. scrollingToggle() {
  555. this.scrollingActive = !this.scrollingActive;
  556. if (this.activePage == 'TextPage') {
  557. const page = this.$refs.page;
  558. if (this.scrollingActive) {
  559. page.startTextScrolling();
  560. } else {
  561. page.stopTextScrolling();
  562. }
  563. }
  564. if (!this.scrollingActive) {
  565. this.scrollingSetRecentBook.flush();
  566. }
  567. }
  568. stopSearch() {
  569. if (this.searchActive)
  570. this.searchToggle();
  571. }
  572. startTextSearch(opts) {
  573. if (this.activePage == 'TextPage')
  574. this.$refs.page.startSearch(opts.needle);
  575. }
  576. stopTextSearch() {
  577. if (this.activePage == 'TextPage')
  578. this.$refs.page.stopSearch();
  579. }
  580. searchToggle() {
  581. this.searchActive = !this.searchActive;
  582. const page = this.$refs.page;
  583. if (this.searchActive && this.activePage == 'TextPage' && page.parsed) {
  584. this.closeAllWindows();
  585. this.searchActive = true;
  586. this.$nextTick(() => {
  587. this.$refs.searchPage.init(page.parsed);
  588. });
  589. } else {
  590. this.stopTextSearch();
  591. this.searchActive = false;
  592. }
  593. }
  594. copyTextToggle() {
  595. this.copyTextActive = !this.copyTextActive;
  596. const page = this.$refs.page;
  597. if (this.copyTextActive && this.activePage == 'TextPage' && page.parsed) {
  598. this.closeAllWindows();
  599. this.copyTextActive = true;
  600. this.$nextTick(() => {
  601. this.$refs.copyTextPage.init(this.mostRecentBook().bookPos, page.parsed, this.copyFullText);
  602. });
  603. } else {
  604. this.copyTextActive = false;
  605. }
  606. }
  607. refreshBookSplitToPara() {
  608. if (this.mostRecentBook()) {
  609. this.loadBook({url: this.mostRecentBook().url, skipCheck: true, isText: true, force: true});
  610. }
  611. }
  612. recentBooksClose() {
  613. this.recentBooksActive = false;
  614. }
  615. recentBooksToggle() {
  616. this.recentBooksActive = !this.recentBooksActive;
  617. if (this.recentBooksActive) {
  618. this.closeAllWindows();
  619. this.$refs.recentBooksPage.init();
  620. this.recentBooksActive = true;
  621. } else {
  622. this.recentBooksActive = false;
  623. }
  624. }
  625. libsClose() {
  626. if (this.libsActive)
  627. this.libsToogle();
  628. }
  629. libsToogle() {
  630. this.libsActive = !this.libsActive;
  631. if (this.libsActive) {
  632. this.$refs.libsPage.init();
  633. } else {
  634. this.$refs.libsPage.done();
  635. }
  636. }
  637. offlineModeToggle() {
  638. this.offlineModeActive = !this.offlineModeActive;
  639. this.$refs.serverStorage.offlineModeActive = this.offlineModeActive;
  640. }
  641. settingsToggle() {
  642. this.settingsActive = !this.settingsActive;
  643. if (this.settingsActive) {
  644. this.closeAllWindows();
  645. this.settingsActive = true;
  646. this.$nextTick(() => {
  647. this.$refs.settingsPage.init();
  648. });
  649. } else {
  650. this.settingsActive = false;
  651. }
  652. }
  653. helpToggle() {
  654. this.helpActive = !this.helpActive;
  655. if (this.helpActive) {
  656. this.closeAllWindows();
  657. this.helpActive = true;
  658. }
  659. }
  660. donateToggle() {
  661. this.helpToggle();
  662. if (this.helpActive) {
  663. this.$nextTick(() => {
  664. this.$refs.helpPage.activateDonateHelpPage();
  665. });
  666. }
  667. }
  668. versionHistoryToggle() {
  669. this.helpToggle();
  670. if (this.helpActive) {
  671. this.$nextTick(() => {
  672. this.$refs.helpPage.activateVersionHistoryHelpPage();
  673. });
  674. }
  675. }
  676. refreshBook() {
  677. if (this.mostRecentBook()) {
  678. this.loadBook({url: this.mostRecentBook().url, force: true});
  679. }
  680. }
  681. undoAction() {
  682. if (this.actionCur > 0) {
  683. this.actionCur--;
  684. this.bookPosChanged({bookPos: this.actionList[this.actionCur]});
  685. }
  686. }
  687. redoAction() {
  688. if (this.actionCur < this.actionList.length - 1) {
  689. this.actionCur++;
  690. this.bookPosChanged({bookPos: this.actionList[this.actionCur]});
  691. }
  692. }
  693. buttonClick(action) {
  694. const activeClass = this.buttonActiveClass(action);
  695. this.$refs[action].blur();
  696. if (activeClass['tool-button-disabled'])
  697. return;
  698. this.doAction({action});
  699. }
  700. buttonActiveClass(action) {
  701. const classActive = { 'tool-button-active': true, 'tool-button-active:hover': true };
  702. const classDisabled = { 'tool-button-disabled': true, 'tool-button-disabled:hover': true };
  703. let classResult = {};
  704. switch (action) {
  705. case 'loader':
  706. case 'fullScreen':
  707. case 'setPosition':
  708. case 'scrolling':
  709. case 'search':
  710. case 'copyText':
  711. case 'splitToPara':
  712. case 'refresh':
  713. case 'libs':
  714. case 'recentBooks':
  715. case 'offlineMode':
  716. case 'settings':
  717. if (this.progressActive) {
  718. classResult = classDisabled;
  719. } else if (this[`${action}Active`]) {
  720. classResult = classActive;
  721. }
  722. break;
  723. case 'undoAction':
  724. if (this.actionCur <= 0)
  725. classResult = classDisabled;
  726. break;
  727. case 'redoAction':
  728. if (this.actionCur == this.actionList.length - 1)
  729. classResult = classDisabled;
  730. break;
  731. }
  732. if (this.activePage == 'LoaderPage' || !this.mostRecentBookReactive) {
  733. switch (action) {
  734. case 'undoAction':
  735. case 'redoAction':
  736. case 'setPosition':
  737. case 'scrolling':
  738. case 'search':
  739. case 'copyText':
  740. classResult = classDisabled;
  741. break;
  742. case 'splitToPara':
  743. case 'refresh':
  744. case 'recentBooks':
  745. if (!this.mostRecentBookReactive)
  746. classResult = classDisabled;
  747. break;
  748. }
  749. }
  750. return classResult;
  751. }
  752. async activateClickMapPage() {
  753. if (this.clickControl && this.showClickMapPage && !this.clickMapActive) {
  754. this.clickMapActive = true;
  755. await this.$refs.clickMapPage.slowDisappear();
  756. this.clickMapActive = false;
  757. }
  758. }
  759. get activePage() {
  760. let result = '';
  761. if (this.progressActive)
  762. result = 'ProgressPage';
  763. else if (this.loaderActive)
  764. result = 'LoaderPage';
  765. else if (this.mostRecentBookReactive)
  766. result = 'TextPage';
  767. if (!result && !this.loading) {
  768. this.loaderActive = true;
  769. result = 'LoaderPage';
  770. }
  771. if (result != 'TextPage') {
  772. this.$root.$emit('set-app-title');
  773. }
  774. // на LoaderPage всегда показываем toolBar
  775. if (result == 'LoaderPage' && !this.toolBarActive) {
  776. this.toolBarToggle();
  777. }
  778. if (this.lastActivePage != result && result == 'TextPage') {
  779. //акивируем страницу с текстом
  780. this.$nextTick(async() => {
  781. const last = this.mostRecentBookReactive;
  782. const isParsed = await bookManager.hasBookParsed(last);
  783. if (!isParsed) {
  784. this.$root.$emit('set-app-title');
  785. return;
  786. }
  787. this.updateRoute();
  788. const textPage = this.$refs.page;
  789. if (textPage.showBook) {
  790. this.textPage = textPage;
  791. textPage.lastBook = last;
  792. textPage.bookPos = (last.bookPos !== undefined ? last.bookPos : 0);
  793. textPage.showBook();
  794. }
  795. });
  796. }
  797. this.lastActivePage = result;
  798. return result;
  799. }
  800. async loadBook(opts) {
  801. if (!opts || !opts.url) {
  802. this.mostRecentBook();
  803. return;
  804. }
  805. this.closeAllWindows();
  806. let url = encodeURI(decodeURI(opts.url));
  807. if ((url.indexOf('http://') != 0) && (url.indexOf('https://') != 0) &&
  808. (url.indexOf('file://') != 0))
  809. url = 'http://' + url;
  810. // уже просматривается сейчас
  811. const lastBook = (this.textPage ? this.textPage.lastBook : null);
  812. if (!opts.force && lastBook && lastBook.url == url &&
  813. (!opts.path || opts.path == lastBook.path) &&
  814. await bookManager.hasBookParsed(lastBook)) {
  815. this.loaderActive = false;
  816. return;
  817. }
  818. this.progressActive = true;
  819. await this.$nextTick();
  820. const progress = this.$refs.page;
  821. this.actionList = [];
  822. this.actionCur = -1;
  823. try {
  824. progress.show();
  825. progress.setState({state: 'parse'});
  826. // есть ли среди недавних
  827. const key = bookManager.keyFromUrl(url);
  828. let wasOpened = await bookManager.getRecentBook({key});
  829. wasOpened = (wasOpened ? wasOpened : {});
  830. const bookPos = (opts.bookPos !== undefined ? opts.bookPos : wasOpened.bookPos);
  831. const bookPosSeen = (opts.bookPos !== undefined ? opts.bookPos : wasOpened.bookPosSeen);
  832. let book = null;
  833. if (!opts.force) {
  834. // пытаемся загрузить и распарсить книгу в менеджере из локального кэша
  835. const bookParsed = await bookManager.getBook({url, path: opts.path}, (prog) => {
  836. progress.setState({progress: prog});
  837. });
  838. // если есть в локальном кэше
  839. if (bookParsed) {
  840. await bookManager.setRecentBook(Object.assign({bookPos, bookPosSeen}, bookParsed));
  841. this.mostRecentBook();
  842. this.addAction(bookPos);
  843. this.loaderActive = false;
  844. progress.hide(); this.progressActive = false;
  845. this.blinkCachedLoadMessage();
  846. this.checkBookPosPercent();
  847. await this.activateClickMapPage();
  848. return;
  849. }
  850. // иначе идем на сервер
  851. // пытаемся загрузить готовый файл с сервера
  852. if (wasOpened.path) {
  853. progress.setState({totalSteps: 5});
  854. try {
  855. const resp = await readerApi.loadCachedBook(wasOpened.path, (state) => {
  856. progress.setState(state);
  857. });
  858. book = Object.assign({}, wasOpened, {data: resp.data});
  859. } catch (e) {
  860. //молчим
  861. }
  862. }
  863. }
  864. progress.setState({totalSteps: 5});
  865. // не удалось, скачиваем книгу полностью с конвертацией
  866. let loadCached = true;
  867. if (!book) {
  868. book = await readerApi.loadBook({
  869. url,
  870. skipCheck: (opts.skipCheck ? true : false),
  871. isText: (opts.isText ? true : false),
  872. enableSitesFilter: this.enableSitesFilter
  873. },
  874. (state) => {
  875. progress.setState(state);
  876. }
  877. );
  878. loadCached = false;
  879. }
  880. // добавляем в bookManager
  881. progress.setState({state: 'parse', step: 5});
  882. const addedBook = await bookManager.addBook(book, (prog) => {
  883. progress.setState({progress: prog});
  884. });
  885. // добавляем в историю
  886. await bookManager.setRecentBook(Object.assign({bookPos, bookPosSeen}, addedBook));
  887. this.mostRecentBook();
  888. this.addAction(bookPos);
  889. this.updateRoute(true);
  890. this.loaderActive = false;
  891. progress.hide(); this.progressActive = false;
  892. if (loadCached) {
  893. this.blinkCachedLoadMessage();
  894. } else
  895. this.stopBlink = true;
  896. this.checkBookPosPercent();
  897. await this.activateClickMapPage();
  898. } catch (e) {
  899. progress.hide(); this.progressActive = false;
  900. this.loaderActive = true;
  901. this.$root.stdDialog.alert(e.message, 'Ошибка', {color: 'negative'});
  902. }
  903. }
  904. async loadFile(opts) {
  905. this.progressActive = true;
  906. await this.$nextTick();
  907. const progress = this.$refs.page;
  908. try {
  909. progress.show();
  910. progress.setState({state: 'upload'});
  911. const url = await readerApi.uploadFile(opts.file, this.config.maxUploadFileSize, (state) => {
  912. progress.setState(state);
  913. });
  914. progress.hide(); this.progressActive = false;
  915. await this.loadBook({url});
  916. } catch (e) {
  917. progress.hide(); this.progressActive = false;
  918. this.loaderActive = true;
  919. this.$root.stdDialog.alert(e.message, 'Ошибка', {color: 'negative'});
  920. }
  921. }
  922. blinkCachedLoadMessage() {
  923. if (!this.blinkCachedLoad)
  924. return;
  925. this.blinkCount = 30;
  926. if (!this.inBlink) {
  927. this.inBlink = true;
  928. this.stopBlink = false;
  929. this.$nextTick(async() => {
  930. let page = this.$refs.page;
  931. while (this.blinkCount) {
  932. this.showRefreshIcon = !this.showRefreshIcon;
  933. if (page && page.blinkCachedLoadMessage)
  934. page.blinkCachedLoadMessage(this.showRefreshIcon);
  935. await utils.sleep(500);
  936. if (this.stopBlink)
  937. break;
  938. this.blinkCount--;
  939. page = this.$refs.page;
  940. }
  941. this.showRefreshIcon = true;
  942. this.inBlink = false;
  943. if (page && page.blinkCachedLoadMessage)
  944. page.blinkCachedLoadMessage('finish');
  945. });
  946. }
  947. }
  948. doAction(opts) {
  949. let result = true;
  950. let {action = '', event = false} = opts;
  951. switch (action) {
  952. case 'loader':
  953. this.loaderToggle();
  954. break;
  955. case 'help':
  956. this.helpToggle();
  957. break;
  958. case 'undoAction':
  959. this.undoAction();
  960. break;
  961. case 'redoAction':
  962. this.redoAction();
  963. break;
  964. case 'fullScreen':
  965. this.fullScreenToggle();
  966. break;
  967. case 'scrolling':
  968. this.scrollingToggle();
  969. break;
  970. case 'stopScrolling':
  971. this.stopScrolling();
  972. break;
  973. case 'setPosition':
  974. this.setPositionToggle();
  975. break;
  976. case 'search':
  977. this.searchToggle();
  978. break;
  979. case 'copyText':
  980. this.copyTextToggle();
  981. break;
  982. case 'splitToPara':
  983. this.refreshBookSplitToPara();
  984. break;
  985. case 'refresh':
  986. this.refreshBook();
  987. break;
  988. case 'libs':
  989. this.libsToogle();
  990. break;
  991. case 'recentBooks':
  992. this.recentBooksToggle();
  993. break;
  994. case 'offlineMode':
  995. this.offlineModeToggle();
  996. break;
  997. case 'settings':
  998. this.settingsToggle();
  999. break;
  1000. case 'switchToolbar':
  1001. this.toolBarToggle();
  1002. break;
  1003. case 'donate':
  1004. this.donateToggle();
  1005. break;
  1006. default:
  1007. result = false;
  1008. break;
  1009. }
  1010. if (!result && this.activePage == 'TextPage' && this.$refs.page) {
  1011. result = true;
  1012. const textPage = this.$refs.page;
  1013. switch (action) {
  1014. case 'bookBegin':
  1015. textPage.doHome();
  1016. break;
  1017. case 'bookEnd':
  1018. textPage.doEnd();
  1019. break;
  1020. case 'pageBack':
  1021. textPage.doPageUp();
  1022. break;
  1023. case 'pageForward':
  1024. textPage.doPageDown();
  1025. break;
  1026. case 'lineBack':
  1027. textPage.doUp();
  1028. break;
  1029. case 'lineForward':
  1030. textPage.doDown();
  1031. break;
  1032. case 'incFontSize':
  1033. textPage.doFontSizeInc();
  1034. break;
  1035. case 'decFontSize':
  1036. textPage.doFontSizeDec();
  1037. break;
  1038. case 'scrollingSpeedUp':
  1039. textPage.doScrollingSpeedUp();
  1040. break;
  1041. case 'scrollingSpeedDown':
  1042. textPage.doScrollingSpeedDown();
  1043. break;
  1044. default:
  1045. result = false;
  1046. break;
  1047. }
  1048. }
  1049. if (result && event) {
  1050. event.preventDefault();
  1051. event.stopPropagation();
  1052. }
  1053. return result;
  1054. }
  1055. keyHook(event) {
  1056. let result = false;
  1057. if (this.$root.rootRoute() == '/reader') {
  1058. if (this.$root.stdDialog.active || this.$refs.dialog1.active || this.$refs.dialog2.active)
  1059. return result;
  1060. if (!result && this.helpActive)
  1061. result = this.$refs.helpPage.keyHook(event);
  1062. if (!result && this.settingsActive)
  1063. result = this.$refs.settingsPage.keyHook(event);
  1064. if (!result && this.recentBooksActive)
  1065. result = this.$refs.recentBooksPage.keyHook(event);
  1066. if (!result && this.setPositionActive)
  1067. result = this.$refs.setPositionPage.keyHook(event);
  1068. if (!result && this.searchActive)
  1069. result = this.$refs.searchPage.keyHook(event);
  1070. if (!result && this.copyTextActive)
  1071. result = this.$refs.copyTextPage.keyHook(event);
  1072. if (!result && this.$refs.page && this.$refs.page.keyHook)
  1073. result = this.$refs.page.keyHook(event);
  1074. if (!result && event.type == 'keydown') {
  1075. const action = this.$root.readerActionByKeyEvent(event);
  1076. if (action == 'loader') {
  1077. result = this.doAction({action, event});
  1078. }
  1079. if (!result && this.activePage == 'TextPage') {
  1080. result = this.doAction({action, event});
  1081. }
  1082. }
  1083. }
  1084. return result;
  1085. }
  1086. }
  1087. //-----------------------------------------------------------------------------
  1088. </script>
  1089. <style scoped>
  1090. .header {
  1091. padding-left: 5px;
  1092. padding-right: 5px;
  1093. background-color: #1B695F;
  1094. color: #000;
  1095. overflow: hidden;
  1096. height: 50px;
  1097. }
  1098. .main {
  1099. background-color: #EBE2C9;
  1100. color: #000;
  1101. }
  1102. .tool-button {
  1103. margin: 0px 2px 0 2px;
  1104. padding: 0;
  1105. color: #3E843E;
  1106. background-color: #E6EDF4;
  1107. margin-top: 5px;
  1108. height: 38px;
  1109. width: 38px;
  1110. border: 0;
  1111. border-radius: 6px;
  1112. box-shadow: 3px 3px 5px black;
  1113. outline: 0;
  1114. }
  1115. .tool-button:hover {
  1116. background-color: white;
  1117. cursor: pointer;
  1118. }
  1119. .tool-button-active {
  1120. box-shadow: 0 0 0;
  1121. color: white;
  1122. background-color: #8AB45F;
  1123. position: relative;
  1124. top: 1px;
  1125. left: 1px;
  1126. }
  1127. .tool-button-active:hover {
  1128. color: white;
  1129. background-color: #81C581;
  1130. cursor: pointer;
  1131. }
  1132. .tool-button-disabled {
  1133. color: lightgray;
  1134. background-color: gray;
  1135. cursor: default;
  1136. }
  1137. .tool-button-disabled:hover {
  1138. color: lightgray;
  1139. background-color: gray;
  1140. cursor: default;
  1141. }
  1142. .space {
  1143. width: 10px;
  1144. display: inline-block;
  1145. }
  1146. .clear {
  1147. color: rgba(0,0,0,0);
  1148. }
  1149. .clickable {
  1150. color: blue;
  1151. text-decoration: underline;
  1152. cursor: pointer;
  1153. }
  1154. .copy-icon {
  1155. cursor: pointer;
  1156. font-size: 120%;
  1157. color: blue;
  1158. }
  1159. </style>