├── .env-sample ├── .github └── workflows │ └── test-logic-and-interface.yml ├── .gitignore ├── LICENSE.md ├── README.md ├── mocha-start.js ├── os-app ├── _shared │ ├── KVCNote │ │ ├── main-tests.js │ │ └── main.js │ ├── KVCRootLink │ │ ├── controller.js │ │ ├── main.ejs │ │ ├── ui-assets │ │ │ └── identity.svg │ │ ├── ui-test-_access.js │ │ ├── ui-test-_localize.js │ │ └── ui-test-_misc.js │ ├── KVCSetting │ │ ├── main-tests.js │ │ └── main.js │ ├── KVCTemplate │ │ ├── controller.js │ │ ├── i18n-en.yml │ │ ├── i18n-es.yml │ │ ├── i18n-fr.yml │ │ ├── i18n-pt.yml │ │ ├── main-tests.js │ │ ├── main.js │ │ ├── ui-test-_access.js │ │ ├── ui-test-_localize.js │ │ └── ui-test-_misc.js │ ├── KVCTransport │ │ ├── main-tests.js │ │ └── main.js │ └── common │ │ ├── controller.js │ │ └── ui-style.css ├── open-compare-simplenote │ ├── controller.js │ ├── i18n-en.yml │ ├── i18n-fr.yml │ ├── ui-logic-tests.js │ ├── ui-logic.js │ ├── ui-test-_access.js │ ├── ui-test-_localize.js │ ├── ui-test-_misc.js │ └── ui-view.ejs ├── open-guide │ ├── controller.js │ ├── i18n-en.yml │ ├── i18n-pt.yml │ ├── text-en.md │ ├── ui-style.css │ ├── ui-test-_access.js │ ├── ui-test-_localize.js │ ├── ui-test-_misc.js │ └── ui-view.ejs ├── open-vitrine │ ├── controller.js │ ├── i18n-en.yml │ ├── i18n-es.yml │ ├── i18n-fr.yml │ ├── i18n-pt.yml │ ├── submodules │ │ └── KVCFeatureList │ │ │ ├── controller.js │ │ │ ├── i18n-en.yml │ │ │ ├── i18n-es.yml │ │ │ ├── i18n-fr.yml │ │ │ ├── i18n-pt.yml │ │ │ ├── main.ejs │ │ │ ├── stub-view.ejs │ │ │ ├── ui-test-_access.js │ │ │ ├── ui-test-_localize.js │ │ │ └── ui-test-_misc.js │ ├── ui-style.css │ ├── ui-test-_access.js │ ├── ui-test-_localize.js │ ├── ui-test-_misc.js │ └── ui-view.ejs ├── open-write │ ├── controller.js │ ├── i18n-en.yml │ ├── i18n-es.yml │ ├── i18n-fr.yml │ ├── i18n-pt.yml │ ├── main.svelte │ ├── rollup-start.js │ ├── ui-editor-theme.css │ ├── ui-logic-tests.js │ ├── ui-logic.js │ ├── ui-style.css │ ├── ui-test-_access.js │ ├── ui-test-_localize.js │ ├── ui-test-_misc.js │ ├── ui-test-catalog.js │ ├── ui-test-cloud.js │ ├── ui-test-publish.js │ ├── ui-test-sync.js │ ├── ui-test-transport.js │ ├── ui-test-version.js │ └── ui-view.ejs ├── sub-detail │ ├── controller.js │ ├── i18n-en.yml │ ├── i18n-es.yml │ ├── i18n-fr.yml │ ├── i18n-pt.yml │ ├── main.svelte │ ├── rollup-start.js │ ├── stub-view.ejs │ ├── ui-assets │ │ ├── _KVCWriteArchive.svg │ │ ├── _KVCWriteJump.svg │ │ ├── _KVCWritePublish.svg │ │ ├── _KVCWriteRetract.svg │ │ ├── _KVCWriteUnarchive.svg │ │ └── _KVCWriteVersions.svg │ ├── ui-style.css │ ├── ui-test-_access.js │ ├── ui-test-_localize.js │ └── ui-test-_misc.js ├── sub-input │ ├── controller.js │ ├── main.svelte │ ├── rollup-start.js │ ├── stub-view.ejs │ ├── ui-logic-tests.js │ ├── ui-logic.js │ ├── ui-test-_access.js │ └── ui-test-_misc.js ├── sub-item │ ├── controller.js │ ├── main.svelte │ ├── rollup-start.js │ ├── stub-view.ejs │ ├── ui-test-_access.js │ └── ui-test-_misc.js ├── sub-template │ ├── controller.js │ ├── i18n-en.yml │ ├── i18n-es.yml │ ├── i18n-fr.yml │ ├── i18n-pt.yml │ ├── main.svelte │ ├── rollup-start.js │ ├── stub-view.ejs │ ├── ui-test-_access.js │ ├── ui-test-_localize.js │ └── ui-test-_misc.js ├── tech-manifest │ ├── controller.js │ └── ui-test-_misc.js ├── tech-robots │ ├── controller.js │ └── ui-test-_misc.js └── tech-serviceworker │ └── controller.js ├── package-postinstall.js ├── package.json └── rollup-config.js /.env-sample: -------------------------------------------------------------------------------- 1 | # Copy this file to '.env' if not created by `npm run setup` 2 | 3 | KVC_VITRINE_GLOSSARY_WRITING_USING_URL="XXXXX" 4 | KVC_VITRINE_GLOSSARY_WRITING_ANSWER_URL="XXXXX" 5 | KVC_VITRINE_GLOSSARY_WRITING_LISTS_URL="XXXXX" 6 | KVC_VITRINE_GLOSSARY_WRITING_DISCUSSION_URL="XXXXX" 7 | KVC_VITRINE_GLOSSARY_WRITING_MAGIC_URL="XXXXX" 8 | KVC_VITRINE_GLOSSARY_PUBLIC_REF_URL="XXXXX" 9 | KVC_VITRINE_GLOSSARY_PUBLIC_GARDENS_URL="XXXXX" 10 | KVC_VITRINE_GLOSSARY_PUBLIC_DIGITAL_URL="XXXXX" 11 | KVC_VITRINE_VIDEO_URL_1="https://www.youtube-nocookie.com/embed/t4C8dsAJvJU" 12 | KVC_VITRINE_VIDEO_URL_2="https://www.youtube-nocookie.com/embed/Xm8hjnaB_Uo" 13 | 14 | SWAR_LINK_URL=https://ring.0data.app/#random 15 | 16 | OLSK_REPO_URL=https://github.com/rosano/hyperdraft 17 | 18 | OLSK_APROPOS_FEEDBACK_EMAIL="XXXXX" 19 | 20 | OLSK_VERSION_LIMIT=50 21 | 22 | KVC_TEMPLATE_NORMALIZE_URL=https://cdn.jsdelivr.net/npm/normalize.css/normalize.css 23 | KVC_TEMPLATE_DECOR_URL=https://cdn.jsdelivr.net/gh/olsk/OLSKDecor/ui-style.css 24 | 25 | OLSK_LAYOUT_TOUCH_ICON_URL=https://static.rosano.ca/wikiavec/touch.png 26 | 27 | ROCO_SHARED_PROJECT_ID=RP_003 28 | 29 | # optionally in .env-crypto 30 | OLSK_CRYPTO_PAIR_RECEIVER_PRIVATE="XXXXX" 31 | OLSK_CRYPTO_PAIR_SENDER_PUBLIC="XXXXX" 32 | -------------------------------------------------------------------------------- /.github/workflows/test-logic-and-interface.yml: -------------------------------------------------------------------------------- 1 | name: Test logic and interface 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | test-logic-and-interface: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - name: Configure Node.js 11 | uses: actions/setup-node@v1 12 | with: 13 | node-version: '14.x' 14 | - name: Install dependencies 15 | run: npm run setup 16 | - name: Build project 17 | run: npm run build --ci 18 | - name: Test logic 19 | run: npm run test -- --ci 20 | - name: Test interface 21 | run: npx start-server-and-test start 3000 'olsk-spec-ui --ci' 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # NODE 2 | node_modules 3 | 4 | # BUILD 5 | **/__*/* 6 | .static 7 | 8 | # LOCAL 9 | .env* 10 | !.env-sample 11 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (2020) (Rosano Coutinho) 2 | 3 | Hippocratic License Version Number: 2.1. 4 | 5 | * Purpose. The purpose of this License is for the Licensor named above to permit the Licensee (as defined below) broad permission, if consistent with Human Rights Laws and Human Rights Principles (as each is defined below), to use and work with the Software (as defined below) within the full scope of Licensor's copyright and patent rights, if any, in the Software, while ensuring attribution and protecting the Licensor from liability. 6 | 7 | * Permission and Conditions. The Licensor grants permission by this license ("License"), free of charge, to the extent of Licensor's rights under applicable copyright and patent law, to any person or entity (the "Licensee") obtaining a copy of this software and associated documentation files (the "Software"), to do everything with the Software that would otherwise infringe (i) the Licensor's copyright in the Software or (ii) any patent claims to the Software that the Licensor can license or becomes able to license, subject to all of the following terms and conditions: 8 | 9 | * Acceptance. This License is automatically offered to every person and entity subject to its terms and conditions. Licensee accepts this License and agrees to its terms and conditions by taking any action with the Software that, absent this License, would infringe any intellectual property right held by Licensor. 10 | 11 | * Notice. Licensee must ensure that everyone who gets a copy of any part of this Software from Licensee, with or without changes, also receives the License and the above copyright notice (and if included by the Licensor, patent, trademark and attribution notice). Licensee must cause any modified versions of the Software to carry prominent notices stating that Licensee changed the Software. For clarity, although Licensee is free to create modifications of the Software and distribute only the modified portion created by Licensee with additional or different terms, the portion of the Software not modified must be distributed pursuant to this License. If anyone notifies Licensee in writing that Licensee has not complied with this Notice section, Licensee can keep this License by taking all practical steps to comply within 30 days after the notice. If Licensee does not do so, Licensee's License (and all rights licensed hereunder) shall end immediately. 12 | 13 | * Compliance. 14 | 15 | 1. Human Rights Principles. 16 | 17 | (a) Licensee is advised to consult the articles of the United Nations Universal Declaration of Human Rights and the United Nations Global Compact that define recognized principles of international human rights (the "Human Rights Principles"). Licensee shall use the Software in a manner consistent with Human Rights Principles. 18 | 19 | (b) Unless the Licensor and Licensee agree otherwise, any dispute, controversy, or claim arising out of or relating to (i) Section 1(a) regarding Human Rights Principles, including the breach of Section 1(a), termination of this License for breach of the Human Rights Principles, or invalidity of Section 1(a) or (ii) a determination of whether any Law is consistent or in conflict with Human Rights Principles pursuant to Section 2, below, shall be settled by arbitration in accordance with the Hague Rules on Business and Human Rights Arbitration (the "Rules"); provided, however, that Licensee may elect not to participate in such arbitration, in which event this License (and all rights licensed hereunder) shall end immediately. The number of arbitrators shall be one unless the Rules require otherwise. 20 | 21 | Unless both the Licensor and Licensee agree to the contrary: (1) All documents and information concerning the arbitration shall be public and may be disclosed by any party; (2) The repository referred to under Article 43 of the Rules shall make available to the public in a timely manner all documents concerning the arbitration which are communicated to it, including all submissions of the parties, all evidence admitted into the record of the proceedings, all transcripts or other recordings of hearings and all orders, decisions and awards of the arbitral tribunal, subject only to the arbitral tribunal's powers to take such measures as may be necessary to safeguard the integrity of the arbitral process pursuant to Articles 18, 33, 41 and 42 of the Rules; and (3) Article 26(6) of the Rules shall not apply. 22 | 23 | 2. Human Rights Laws. The Software shall not be used by any person or entity for any systems, activities, or other uses that violate any Human Rights Laws. "Human Rights Laws" means any applicable laws, regulations, or rules (collectively, "Laws") that protect human, civil, labor, privacy, political, environmental, security, economic, due process, or similar rights; provided, however, that such Laws are consistent and not in conflict with Human Rights Principles (a dispute over the consistency or a conflict between Laws and Human Rights Principles shall be determined by arbitration as stated above). Where the Human Rights Laws of more than one jurisdiction are applicable or in conflict with respect to the use of the Software, the Human Rights Laws that are most protective of the individuals or groups harmed shall apply. 24 | 25 | 3. [Surveillance Capitalism](https://en.wikipedia.org/wiki/Surveillance_capitalism). The Software shall not be used by any person or entity for any systems, activities, or other uses that actively and knowingly participate in data gathering for the purpose of advertising or surveillance capitalism. 26 | 27 | 4. Large commercial actors. For-profit entities earning revenues in excess of $1,000,000 USD per year must obtain approval from the copyright holder and purchase a paid licence in order to use the Software in commercial projects. 28 | 29 | 5. Indemnity. Licensee shall hold harmless and indemnify Licensor (and any other contributor) against all losses, damages, liabilities, deficiencies, claims, actions, judgments, settlements, interest, awards, penalties, fines, costs, or expenses of whatever kind, including Licensor's reasonable attorneys' fees, arising out of or relating to Licensee's use of the Software in violation of Human Rights Laws or Human Rights Principles. 30 | 31 | * Failure to Comply. Any failure of Licensee to act according to the terms and conditions of this License is both a breach of the License and an infringement of the intellectual property rights of the Licensor (subject to exceptions under Laws, e.g., fair use). In the event of a breach or infringement, the terms and conditions of this License may be enforced by Licensor under the Laws of any jurisdiction to which Licensee is subject. Licensee also agrees that the Licensor may enforce the terms and conditions of this License against Licensee through specific performance (or similar remedy under Laws) to the extent permitted by Laws. For clarity, except in the event of a breach of this License, infringement, or as otherwise stated in this License, Licensor may not terminate this License with Licensee. 32 | 33 | * Enforceability and Interpretation. If any term or provision of this License is determined to be invalid, illegal, or unenforceable by a court of competent jurisdiction, then such invalidity, illegality, or unenforceability shall not affect any other term or provision of this License or invalidate or render unenforceable such term or provision in any other jurisdiction; provided, however, subject to a court modification pursuant to the immediately following sentence, if any term or provision of this License pertaining to Human Rights Laws or Human Rights Principles is deemed invalid, illegal, or unenforceable against Licensee by a court of competent jurisdiction, all rights in the Software granted to Licensee shall be deemed null and void as between Licensor and Licensee. Upon a determination that any term or provision is invalid, illegal, or unenforceable, to the extent permitted by Laws, the court may modify this License to affect the original purpose that the Software be used in compliance with Human Rights Principles and Human Rights Laws as closely as possible. The language in this License shall be interpreted as to its fair meaning and not strictly for or against any party. 34 | 35 | * Disclaimer. TO THE FULL EXTENT ALLOWED BY LAW, THIS SOFTWARE COMES "AS IS," WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED, AND LICENSOR AND ANY OTHER CONTRIBUTOR SHALL NOT BE LIABLE TO ANYONE FOR ANY DAMAGES OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THIS LICENSE, UNDER ANY KIND OF LEGAL CLAIM. 36 | 37 | This Hippocratic License is an Ethical Source license (https://ethicalsource.dev) and is offered for use by licensors and licensees at their own risk, on an "AS IS" basis, and with no warranties express or implied, to the maximum extent permitted by Laws. 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Project logo 2 | 3 | # [Hyperdraft](https://hyperdraft.rosano.ca) 4 | 5 | _Turn your text notes into a website_ 6 | 7 | Hyperdraft helps you organize your thinking with text notes, and makes it simple to turn them into a website. Inspired by modeless and keyboard-centric [Notational Velocity](http://notational.net/) it lets you quickly and easily network your ideas via a simple double-bracket syntax. Use it for ideas, todo lists, brainstorming, recipes, reading notes, journaling, or anything involving writing. Read the guide for more details. 8 | 9 | Open app 10 | 11 | ## Architecture 12 | 13 | The project follows a [Universal folder structure](https://rosano.hmm.garden/01f71kp52knc5nnv08qr9kzj3m) and is a large collection of mostly small modules or functions that are put together using [Svelte](https://svelte.dev) and [Rollup](https://rollupjs.org). With the exception of a few 'global' or 'magic' things such as the localization function `OLSKLocalized`, most resources used by a module should be in the same folder or referenced by path name. 14 | 15 | Routing, rendering markdown content, and serving pages is done via a Node.js server (usually configured in the *controller.js* files). 16 | 17 | ## Development Setup 18 | 19 | (For a deeper dive, watch [the tutorial](https://rosano.hmm.garden/01f62t5yseb053m024v1mczbzy)). 20 | 21 | Install [Node.js and npm](https://nodejs.org/en/download/), then: 22 | 23 | ``` 24 | npm run setup 25 | ``` 26 | 27 | This should create an `.env` file if there is none. If you encounter errors referring to this file, you can find missing variables in `.env-sample`. 28 | 29 | ## Running 30 | 31 | ### Start the Rollup process to build and reload automatically 32 | 33 | ``` 34 | npm run watch 35 | ``` 36 | 37 | ### Start the Node.js server to view in the browser 38 | 39 | ``` 40 | npm start 41 | ``` 42 | 43 | It should be accessible at http://localhost:3000. 44 | 45 | ## Testing 46 | 47 | See [Testing logic and interfaces](https://rosano.hmm.garden/01f7v3hk3txz5d0v9ms467x8bz) for a tutorial. 48 | 49 | ### Run logic tests 50 | 51 | ``` 52 | npm test 53 | ``` 54 | 55 | ### Run interface tests 56 | 57 | ``` 58 | npm test ui 59 | ``` 60 | 61 | To filter interface test paths by string: 62 | 63 | ``` 64 | npm test ui match=write 65 | ``` 66 | 67 | To filter interface test paths by JavaScript regular expressions: 68 | 69 | ``` 70 | npm test ui match='/(detail|vitrine)/' 71 | ``` 72 | 73 | ## ❤️ 74 | 75 | Help me keep creating projects that are public, accessible for free, and open-source. 76 | 77 | Become a backer 78 | 79 | ## License 80 | 81 | The code is released under a [Hippocratic License](https://firstdonoharm.dev), modified to exclude its use for surveillance capitalism and also to require large for-profit entities to purchase a paid license. 82 | 83 | ## Questions 84 | 85 | Feel free to reach out on [Mastodon](https://rosano.ca/mastodon) or [Twitter](https://rosano.ca/twitter). 86 | -------------------------------------------------------------------------------- /mocha-start.js: -------------------------------------------------------------------------------- 1 | (function KVCMochaWrap() { 2 | if (process.env.OLSK_SPEC_MOCHA_INTERFACE === 'true') { 3 | return; 4 | } 5 | 6 | before(async function() { 7 | global.ZDRTestingWrap = await require('zerodatawrap').ZDRWrap({ 8 | ZDRParamLibrary: require('remotestoragejs'), 9 | ZDRParamScopes: [{ 10 | ZDRScopeKey: 'App', 11 | ZDRScopeDirectory: 'wikiavec', 12 | ZDRScopeSchemas: [ 13 | require('./os-app/_shared/KVCNote/main.js').default, 14 | require('./os-app/_shared/KVCSetting/main.js').default, 15 | require('./os-app/_shared/KVCTransport/main.js').default, 16 | ], 17 | }, { 18 | ZDRScopeKey: 'Public', 19 | ZDRScopeDirectory: 'wikiavec', 20 | ZDRScopeIsPublic: true, 21 | }], 22 | }); 23 | }); 24 | 25 | beforeEach(function() { 26 | return ZDRTestingWrap.App.ZDRStorageDeleteFolderRecursive(''); 27 | }); 28 | 29 | beforeEach(function() { 30 | return ZDRTestingWrap.Public.ZDRStorageDeleteFolderRecursive(''); 31 | }); 32 | })(); 33 | 34 | (function KVCMochaStubs() { 35 | Object.entries({ 36 | 37 | StubNoteObject(inputData) { 38 | return Object.assign({ 39 | KVCNoteBody: Math.random().toString(), 40 | }, inputData); 41 | }, 42 | 43 | StubNoteObjectValid(inputData) { 44 | return Object.assign({ 45 | KVCNoteID: Math.random().toString(), 46 | KVCNoteBody: Math.random().toString(), 47 | KVCNoteCreationDate: new Date(), 48 | KVCNoteModificationDate: new Date(), 49 | }, inputData); 50 | }, 51 | 52 | StubNoteObjectPublic(inputData = {}) { 53 | return Object.assign(StubNoteObjectValid({ 54 | KVCNoteIsPublic: true, 55 | KVCNotePublishDate: new Date(), 56 | KVCNotePublicID: Math.random().toString(), 57 | }), inputData); 58 | }, 59 | 60 | StubSettingObjectValid (inputData = {}) { 61 | return Object.assign({ 62 | KVCSettingKey: Math.random().toString(), 63 | KVCSettingValue: Math.random().toString(), 64 | }, inputData); 65 | }, 66 | 67 | uSerial (inputData) { 68 | return inputData.reduce(async function (coll, e) { 69 | return e.then(Array.prototype.concat.bind(await coll)); 70 | }, Promise.resolve([])); 71 | }, 72 | 73 | uSleep (inputData) { 74 | let endTime = new Date().getTime(); 75 | while (new Date().getTime() < endTime + inputData) {} 76 | }, 77 | }).map(function (e) { 78 | return global[e.shift()] = e.pop(); 79 | }); 80 | })(); 81 | -------------------------------------------------------------------------------- /os-app/_shared/KVCRootLink/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/KVCRootLink', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteFunction (req, res, next) { 6 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'main')); 7 | }, 8 | OLSKRouteSignature: 'KVCRootLinkStubRoute', 9 | OLSKRouteLanguageCodes: ['en'], 10 | OLSKRouteIsHidden: process.env.NODE_ENV === 'production', 11 | }]; 12 | }; 13 | -------------------------------------------------------------------------------- /os-app/_shared/KVCRootLink/main.ejs: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /os-app/_shared/KVCRootLink/ui-assets/identity.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /os-app/_shared/KVCRootLink/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | KVCRootLink: '.KVCRootLink', 5 | }).map(function (e) { 6 | return global[e.shift()] = e.pop(); 7 | }); 8 | 9 | describe('KVCRootLink_Access', function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute); 13 | }); 14 | 15 | it('shows KVCRootLink', function() { 16 | browser.assert.elements(KVCRootLink, 1); 17 | }); 18 | 19 | it('shows OLSKRootLink', function() { 20 | browser.assert.elements('.OLSKRootLink', 1); 21 | }) 22 | 23 | }); 24 | -------------------------------------------------------------------------------- /os-app/_shared/KVCRootLink/ui-test-_localize.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | kDefaultRoute.OLSKRouteLanguageCodes.forEach(function (OLSKRoutingLanguage) { 4 | 5 | const uLocalized = function (inputData) { 6 | return OLSKTestingLocalized(inputData, OLSKRoutingLanguage); 7 | }; 8 | 9 | describe(`KVCRootLink_Localize-${ kDefaultRoute.OLSKRouteSignature }-${ OLSKRoutingLanguage }`, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | }); 15 | }); 16 | 17 | it('localizes OLSKRootLink', function() { 18 | browser.assert.attribute('.OLSKRootLink', 'href', OLSKTestingCanonical(require('../../open-vitrine/controller.js').OLSKControllerRoutes().shift(), { 19 | OLSKRoutingLanguage, 20 | })); 21 | }); 22 | 23 | }); 24 | 25 | }); 26 | -------------------------------------------------------------------------------- /os-app/_shared/KVCRootLink/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('KVCRootLink_Misc', function () { 4 | 5 | before(function () { 6 | return browser.OLSKVisit(kDefaultRoute); 7 | }); 8 | 9 | describe('OLSKRootLink', function () { 10 | 11 | it('sets OLSKRootLinkImageURL', function () { 12 | browser.assert.attribute('.OLSKRootLinkImage', 'src', process.env.OLSK_LAYOUT_TOUCH_ICON_URL); 13 | }); 14 | 15 | }); 16 | 17 | }); 18 | -------------------------------------------------------------------------------- /os-app/_shared/KVCSetting/main-tests.js: -------------------------------------------------------------------------------- 1 | const { rejects, throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js').default; 4 | 5 | describe('KVCSettingErrors', function test_KVCSettingErrors() { 6 | 7 | it('throws error if not object', function() { 8 | throws(function() { 9 | mod.KVCSettingErrors(null); 10 | }, /KVCErrorInputNotValid/); 11 | }); 12 | 13 | it('returns object if KVCSettingKey not string', function() { 14 | deepEqual(mod.KVCSettingErrors(StubSettingObjectValid({ 15 | KVCSettingKey: null, 16 | })), { 17 | KVCSettingKey: [ 18 | 'KVCErrorNotString', 19 | ], 20 | }); 21 | }); 22 | 23 | it('returns object if KVCSettingKey not filled', function() { 24 | deepEqual(mod.KVCSettingErrors(StubSettingObjectValid({ 25 | KVCSettingKey: ' ', 26 | })), { 27 | KVCSettingKey: [ 28 | 'KVCErrorNotFilled', 29 | ], 30 | }); 31 | }); 32 | 33 | it('returns object if KVCSettingValue not string', function() { 34 | deepEqual(mod.KVCSettingErrors(StubSettingObjectValid({ 35 | KVCSettingValue: null, 36 | })), { 37 | KVCSettingValue: [ 38 | 'KVCErrorNotString', 39 | ], 40 | }); 41 | }); 42 | 43 | it('returns null', function() { 44 | deepEqual(mod.KVCSettingErrors(StubSettingObjectValid()), null); 45 | }); 46 | 47 | }); 48 | 49 | describe('KVCSettingDirectory', function test_KVCSettingDirectory() { 50 | 51 | it('returns string', function() { 52 | deepEqual(mod.KVCSettingDirectory(), 'kvc_settings'); 53 | }); 54 | 55 | }); 56 | 57 | describe('KVCSettingPath', function test_KVCSettingPath() { 58 | 59 | it('returns string', function() { 60 | const KVCSettingKey = Math.random().toString(); 61 | deepEqual(mod.KVCSettingPath({ 62 | KVCSettingKey, 63 | }), mod.KVCSettingDirectory() + '/' + KVCSettingKey); 64 | }); 65 | 66 | }); 67 | 68 | describe('KVCSettingStub', function test_KVCSettingStub() { 69 | 70 | it('returns string', function() { 71 | const KVCSettingKey = Math.random().toString(); 72 | deepEqual(mod.KVCSettingStub(`${ mod.KVCSettingDirectory() }/${ KVCSettingKey }`), { 73 | KVCSettingKey, 74 | }); 75 | }); 76 | 77 | }); 78 | 79 | describe('KVCSettingList', function test_KVCSettingActList() { 80 | 81 | it('returns array', async function() { 82 | deepEqual(await ZDRTestingWrap.App.KVCSetting.KVCSettingList(), []); 83 | }); 84 | 85 | it('returns array with existing items', async function() { 86 | 87 | const item = await ZDRTestingWrap.App.KVCSetting.ZDRModelWriteObject(StubSettingObjectValid()); 88 | deepEqual(await ZDRTestingWrap.App.KVCSetting.KVCSettingList(), [item]); 89 | }); 90 | 91 | }); 92 | 93 | describe('ZDRSchemaDispatchValidate', function () { 94 | 95 | it('returns function', function () { 96 | deepEqual(mod.ZDRSchemaDispatchValidate, mod.KVCSettingErrors); 97 | }); 98 | 99 | }); 100 | 101 | describe('ZDRSchemaPath', function () { 102 | 103 | it('returns function', function() { 104 | deepEqual(mod.ZDRSchemaPath, mod.KVCSettingPath); 105 | }); 106 | 107 | }); 108 | 109 | 110 | describe('ZDRSchemaStub', function () { 111 | 112 | it('returns function', function() { 113 | deepEqual(mod.ZDRSchemaStub, mod.KVCSettingStub); 114 | }); 115 | 116 | }); 117 | -------------------------------------------------------------------------------- /os-app/_shared/KVCSetting/main.js: -------------------------------------------------------------------------------- 1 | const mod = { 2 | 3 | KVCSettingErrors (inputData, options = {}) { 4 | if (typeof inputData !== 'object' || inputData === null) { 5 | throw new Error('KVCErrorInputNotValid'); 6 | } 7 | 8 | const errors = {}; 9 | 10 | if (typeof inputData.KVCSettingKey !== 'string') { 11 | errors.KVCSettingKey = [ 12 | 'KVCErrorNotString', 13 | ]; 14 | } else if (!inputData.KVCSettingKey.trim()) { 15 | errors.KVCSettingKey = [ 16 | 'KVCErrorNotFilled', 17 | ]; 18 | } 19 | 20 | if (typeof inputData.KVCSettingValue !== 'string') { 21 | errors.KVCSettingValue = [ 22 | 'KVCErrorNotString', 23 | ]; 24 | } 25 | 26 | return Object.entries(errors).length ? errors : null; 27 | }, 28 | 29 | KVCSettingDirectory () { 30 | return 'kvc_settings'; 31 | }, 32 | 33 | KVCSettingPath (inputData) { 34 | return `${ mod.KVCSettingDirectory() }/${ inputData.KVCSettingKey }`; 35 | }, 36 | 37 | KVCSettingStub (inputData) { 38 | return { 39 | KVCSettingKey: inputData.split('/').pop(), 40 | }; 41 | }, 42 | 43 | }; 44 | 45 | export default Object.assign(mod, { 46 | ZDRSchemaKey: 'KVCSetting', 47 | ZDRSchemaDispatchValidate: mod.KVCSettingErrors, 48 | ZDRSchemaPath: mod.KVCSettingPath, 49 | ZDRSchemaStub: mod.KVCSettingStub, 50 | ZDRSchemaMethods: { 51 | 52 | async KVCSettingList () { 53 | return Object.values(await this.App.KVCSetting.ZDRModelListObjects()); 54 | }, 55 | 56 | }, 57 | }); 58 | -------------------------------------------------------------------------------- /os-app/_shared/KVCTemplate/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/KVCTemplate', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'KVCTemplateStubRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | const filePath = require('path').join(__dirname, '__compiled/main.js'); 8 | require('OLSKDisk').OLSKDiskWriteFile(filePath, Object.entries({ 9 | [`import OLSKString from 'OLSKString'`]: `const OLSKString = require('OLSKString')`, 10 | [`import marked from 'marked'`]: `const marked = require('marked')`, 11 | [`import escapeRegExp from 'escape-string-regexp'`]: `const escapeRegExp = require('escape-string-regexp')`, 12 | 'export default mod;': 'Object.assign(exports, mod);', 13 | }).reduce(function (coll, [search, replace]) { 14 | return require('OLSKString').OLSKStringPatch( 15 | coll, search, replace); 16 | }, require('OLSKDisk').OLSKDiskReadFile(require('path').join(__dirname, 'main.js')))); 17 | return res.send(require(filePath).KVCTemplateViewDefault(res.locals.OLSKLocalized)); 18 | }, 19 | OLSKRouteLanguageCodes: ['en', 'fr', 'es', 'pt'], 20 | }]; 21 | }; 22 | -------------------------------------------------------------------------------- /os-app/_shared/KVCTemplate/i18n-en.yml: -------------------------------------------------------------------------------- 1 | KVCRootLinkText: Home 2 | KVCBacklinksHeadingText: Links to this page 3 | -------------------------------------------------------------------------------- /os-app/_shared/KVCTemplate/i18n-es.yml: -------------------------------------------------------------------------------- 1 | KVCRootLinkText: Início 2 | KVCBacklinksHeadingText: Enlaces a esta página 3 | -------------------------------------------------------------------------------- /os-app/_shared/KVCTemplate/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | KVCRootLinkText: Accueil 2 | KVCBacklinksHeadingText: Liens vers cette page 3 | -------------------------------------------------------------------------------- /os-app/_shared/KVCTemplate/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | KVCRootLinkText: Casa 2 | KVCBacklinksHeadingText: Links para esta página 3 | -------------------------------------------------------------------------------- /os-app/_shared/KVCTemplate/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | KVCTemplate: 'html', 5 | KVCTemplateHead: 'html head', 6 | KVCTemplateHeadTitle: 'html head title', 7 | KVCTemplateHeadMetaDescription: 'html head meta[name="description"]', 8 | KVCTemplateHeadMetaContentType: 'html head meta[http-equiv="Content-Type"]', 9 | KVCTemplateHeadMetaViewport: 'html head meta[name="viewport"]', 10 | KVCTemplateHeadLinkCanonical: 'html head link[rel="canonical"]', 11 | KVCTemplateHeadLinkNormalize: 'html head link[rel="stylesheet"]:nth-of-type(2)', 12 | KVCTemplateHeadLinkDecor: 'html head link[rel="stylesheet"]:nth-of-type(3)', 13 | KVCTemplateHeadMetaPublished: 'html head meta[property="article:published_time"]', 14 | KVCTemplateHeadMetaModified: 'html head meta[property="article:modified_time"]', 15 | KVCTemplateBody: 'html body', 16 | KVCRootLink: '.KVCRootLink', 17 | KVCArticleTitle: '.KVCArticleTitle', 18 | KVCArticleBody: '.KVCArticleBody', 19 | KVCBacklinks: '.KVCBacklinks', 20 | KVCBacklinksHeading: '.KVCBacklinksHeading', 21 | KVCBacklinksLink: '.KVCBacklinksLink', 22 | KVCBacklinksSnippet: '.KVCBacklinksSnippet', 23 | }).map(function (e) { 24 | return global[e.shift()] = e.pop(); 25 | }); 26 | 27 | describe('KVCTemplate_Access', function () { 28 | 29 | before(function() { 30 | return browser.OLSKVisit(kDefaultRoute); 31 | }); 32 | 33 | it('shows KVCTemplate', function() { 34 | browser.assert.elements(KVCTemplate, 1); 35 | }); 36 | 37 | it('shows KVCTemplateHead', function () { 38 | browser.assert.elements(KVCTemplateHead, 1); 39 | }); 40 | 41 | it('shows KVCTemplateHeadTitle', function () { 42 | browser.assert.elements(KVCTemplateHeadTitle, 1); 43 | }); 44 | 45 | it('shows KVCTemplateHeadMetaDescription', function () { 46 | browser.assert.elements(KVCTemplateHeadMetaDescription, 1); 47 | }); 48 | 49 | it('shows KVCTemplateHeadMetaContentType', function () { 50 | browser.assert.elements(KVCTemplateHeadMetaContentType, 1); 51 | }); 52 | 53 | it('shows KVCTemplateHeadMetaViewport', function () { 54 | browser.assert.elements(KVCTemplateHeadMetaViewport, 1); 55 | }); 56 | 57 | it('shows KVCTemplateHeadLinkCanonical', function () { 58 | browser.assert.elements(KVCTemplateHeadLinkCanonical, 1); 59 | }); 60 | 61 | it('shows KVCTemplateHeadLinkNormalize', function () { 62 | browser.assert.elements(KVCTemplateHeadLinkNormalize, 1); 63 | }); 64 | 65 | it('shows KVCTemplateHeadLinkDecor', function () { 66 | browser.assert.elements(KVCTemplateHeadLinkDecor, 1); 67 | }); 68 | 69 | it('shows KVCTemplateHeadMetaPublished', function () { 70 | browser.assert.elements(KVCTemplateHeadMetaPublished, 1); 71 | }); 72 | 73 | it('shows KVCTemplateHeadMetaModified', function () { 74 | browser.assert.elements(KVCTemplateHeadMetaModified, 1); 75 | }); 76 | 77 | it('shows KVCTemplateBody', function () { 78 | browser.assert.elements(KVCTemplateBody, 1); 79 | }); 80 | 81 | it('shows KVCRootLink', function () { 82 | browser.assert.elements(KVCRootLink, 1); 83 | }); 84 | 85 | it('shows KVCArticleTitle', function () { 86 | browser.assert.elements(KVCArticleTitle, 1); 87 | }); 88 | 89 | it('shows KVCArticleBody', function () { 90 | browser.assert.elements(KVCArticleBody, 1); 91 | }); 92 | 93 | it('shows KVCBacklinks', function () { 94 | browser.assert.elements(KVCBacklinks, 1); 95 | }); 96 | 97 | it('shows KVCBacklinksHeading', function () { 98 | browser.assert.elements(KVCBacklinksHeading, 1); 99 | }); 100 | 101 | it('shows KVCBacklinksSnippet', function () { 102 | browser.assert.elements(KVCBacklinksSnippet, 1); 103 | }); 104 | 105 | }); 106 | -------------------------------------------------------------------------------- /os-app/_shared/KVCTemplate/ui-test-_localize.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | kDefaultRoute.OLSKRouteLanguageCodes.forEach(function (OLSKRoutingLanguage) { 4 | 5 | const uLocalized = function (inputData) { 6 | return OLSKTestingLocalized(inputData, OLSKRoutingLanguage); 7 | }; 8 | 9 | describe('KVCTemplate_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | }); 15 | }); 16 | 17 | it('localizes KVCRootLink', function () { 18 | browser.assert.text(KVCRootLink, uLocalized('KVCRootLinkText')); 19 | }); 20 | 21 | it('localizes KVCBacklinksHeading', function () { 22 | browser.assert.text(KVCBacklinksHeading, uLocalized('KVCBacklinksHeadingText')); 23 | }); 24 | 25 | }); 26 | 27 | }); 28 | -------------------------------------------------------------------------------- /os-app/_shared/KVCTemplate/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | const mod = require('./main.js').default; 4 | 5 | const uTokenTag = function (inputData) { 6 | return `{${ mod[inputData]() }}`; 7 | }; 8 | 9 | describe('KVCTemplate_Misc', function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute); 13 | }); 14 | 15 | describe('KVCTemplateHeadTitle', function test_KVCTemplateHeadTitle() { 16 | 17 | it('sets text', function () { 18 | browser.assert.text(KVCTemplateHeadTitle, uTokenTag('KVCTemplateTokenPostTitle')); 19 | }); 20 | 21 | }); 22 | 23 | describe('KVCTemplateHeadMetaDescription', function test_KVCTemplateHeadMetaDescription() { 24 | 25 | it('sets value', function () { 26 | browser.assert.attribute(KVCTemplateHeadMetaDescription, 'content', uTokenTag('KVCTemplateTokenPostBlurb')); 27 | }); 28 | 29 | }); 30 | 31 | describe('KVCTemplateHeadMetaContentType', function test_KVCTemplateHeadMetaContentType() { 32 | 33 | it('sets value', function () { 34 | browser.assert.attribute(KVCTemplateHeadMetaContentType, 'content', 'text/html; charset=utf-8'); 35 | }); 36 | 37 | }); 38 | 39 | describe('KVCTemplateHeadMetaViewport', function test_KVCTemplateHeadMetaViewport() { 40 | 41 | it('sets value', function () { 42 | browser.assert.attribute(KVCTemplateHeadMetaViewport, 'content', 'width=device-width'); 43 | }); 44 | 45 | }); 46 | 47 | describe('KVCTemplateHeadLinkCanonical', function test_KVCTemplateHeadLinkCanonical() { 48 | 49 | it('sets value', function () { 50 | browser.assert.attribute(KVCTemplateHeadLinkCanonical, 'href', uTokenTag('KVCTemplateTokenRootURL') + uTokenTag('KVCTemplateTokenURL')); 51 | }); 52 | 53 | }); 54 | 55 | describe('KVCTemplateHeadLinkNormalize', function test_KVCTemplateHeadLinkNormalize() { 56 | 57 | it('sets href', function () { 58 | browser.assert.attribute(KVCTemplateHeadLinkNormalize, 'href', mod.KVCTemplateNormalizeURL()); 59 | }); 60 | 61 | }); 62 | 63 | describe('KVCTemplateHeadLinkDecor', function test_KVCTemplateHeadLinkDecor() { 64 | 65 | it('sets href', function () { 66 | browser.assert.attribute(KVCTemplateHeadLinkDecor, 'href', mod.KVCTemplateDecorURL()); 67 | }); 68 | 69 | }); 70 | 71 | describe('KVCTemplateHeadMetaPublished', function test_KVCTemplateHeadMetaPublished() { 72 | 73 | it('sets href', function () { 74 | browser.assert.attribute(KVCTemplateHeadMetaPublished, 'content', uTokenTag('KVCTemplateTokenPublishedTime')); 75 | }); 76 | 77 | }); 78 | 79 | describe('KVCTemplateHeadMetaModified', function test_KVCTemplateHeadMetaModified() { 80 | 81 | it('sets href', function () { 82 | browser.assert.attribute(KVCTemplateHeadMetaModified, 'content', uTokenTag('KVCTemplateTokenModifiedTime')); 83 | }); 84 | 85 | }); 86 | 87 | describe('KVCTemplateBody', function test_KVCTemplateBody() { 88 | 89 | it('classes OLSKDecor', function () { 90 | browser.assert.hasClass(KVCTemplateBody, 'OLSKDecor'); 91 | }); 92 | 93 | it('classes OLSKDecorCapped', function () { 94 | browser.assert.hasClass(KVCTemplateBody, 'OLSKDecorCapped'); 95 | }); 96 | 97 | it('classes OLSKDecorX', function () { 98 | browser.assert.hasClass(KVCTemplateBody, 'OLSKDecorX'); 99 | }); 100 | 101 | }); 102 | 103 | describe('KVCRootLink', function test_KVCRootLink() { 104 | 105 | it('sets href', function () { 106 | browser.assert.attribute(KVCRootLink, 'href', uTokenTag('KVCTemplateTokenRootURL')); 107 | }); 108 | 109 | }); 110 | 111 | describe('KVCArticleTitle', function test_KVCArticleTitle() { 112 | 113 | it('sets text', function () { 114 | browser.assert.text(KVCArticleTitle, uTokenTag('KVCTemplateTokenPostTitle')); 115 | }); 116 | 117 | }); 118 | 119 | describe('KVCArticleBody', function test_KVCArticleBody() { 120 | 121 | it('sets text', function () { 122 | browser.assert.text(KVCArticleBody, uTokenTag('KVCTemplateTokenPostBody')); 123 | }); 124 | 125 | }); 126 | 127 | describe('KVCBacklinksLink', function test_KVCBacklinksLink() { 128 | 129 | it('sets href', function () { 130 | browser.assert.attribute(KVCBacklinksLink, 'href', uTokenTag('KVCTemplateTokenURL')); 131 | }); 132 | 133 | it('sets text', function () { 134 | browser.assert.text(KVCBacklinksLink, uTokenTag('KVCTemplateTokenName')); 135 | }); 136 | 137 | }); 138 | 139 | describe('KVCBacklinksSnippet', function test_KVCBacklinksSnippet() { 140 | 141 | it('sets text', function () { 142 | browser.assert.text(KVCBacklinksSnippet, uTokenTag('KVCTemplateTokenDescription')); 143 | }); 144 | 145 | }); 146 | 147 | }); 148 | -------------------------------------------------------------------------------- /os-app/_shared/KVCTransport/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, rejects, deepEqual, strictEqual, notStrictEqual } = require('assert'); 2 | 3 | const mod = require('./main.js').default; 4 | 5 | const KVCNote = require('../KVCNote/main.js').default; 6 | 7 | describe('KVCTransportImport', function test_KVCTransportImport() { 8 | 9 | it('rejects if not object', async function () { 10 | await rejects(ZDRTestingWrap.App.KVCTransport.KVCTransportImport(null), /KVCErrorInputNotValid/); 11 | }); 12 | 13 | it('returns object', async function () { 14 | deepEqual(await ZDRTestingWrap.App.KVCTransport.KVCTransportImport({}), {}); 15 | }); 16 | 17 | context('KVCNote', function () { 18 | 19 | it('rejects if not array', async function () { 20 | await rejects(ZDRTestingWrap.App.KVCTransport.KVCTransportImport({ 21 | KVCNote: null, 22 | }), /KVCErrorInputNotValid/); 23 | }); 24 | 25 | it('rejects if not valid', async function () { 26 | await rejects(ZDRTestingWrap.App.KVCTransport.KVCTransportImport({ 27 | KVCNote: [StubNoteObjectValid({ 28 | KVCNoteBody: null, 29 | })], 30 | }), /KVCErrorInputNotValid/); 31 | }); 32 | 33 | it('passes input', async function () { 34 | const item = StubNoteObjectValid() 35 | strictEqual((await ZDRTestingWrap.App.KVCTransport.KVCTransportImport({ 36 | KVCNote: [item], 37 | })).KVCNote.shift(), item); 38 | }); 39 | 40 | it('writes objects', async function () { 41 | const item = StubNoteObjectValid(); 42 | 43 | await ZDRTestingWrap.App.KVCTransport.KVCTransportImport({ 44 | KVCNote: [item], 45 | }); 46 | 47 | deepEqual(await ZDRTestingWrap.App.KVCNote.KVCNoteList(), [item]); 48 | }); 49 | 50 | }); 51 | 52 | context('KVCSetting', function () { 53 | 54 | it('rejects if not array', async function () { 55 | await rejects(ZDRTestingWrap.App.KVCTransport.KVCTransportImport({ 56 | KVCSetting: null, 57 | }), /KVCErrorInputNotValid/); 58 | }); 59 | 60 | it('rejects if not valid', async function () { 61 | await rejects(ZDRTestingWrap.App.KVCTransport.KVCTransportImport({ 62 | KVCSetting: [StubSettingObjectValid({ 63 | KVCSettingKey: null, 64 | })], 65 | }), /KVCErrorInputNotValid/); 66 | }); 67 | 68 | it('passes input', async function () { 69 | const item = StubSettingObjectValid() 70 | strictEqual((await ZDRTestingWrap.App.KVCTransport.KVCTransportImport({ 71 | KVCSetting: [item], 72 | })).KVCSetting.shift(), item); 73 | }); 74 | 75 | it('writes objects', async function () { 76 | const item = StubSettingObjectValid(); 77 | 78 | await ZDRTestingWrap.App.KVCTransport.KVCTransportImport({ 79 | KVCSetting: [item], 80 | }); 81 | 82 | deepEqual(await ZDRTestingWrap.App.KVCSetting.KVCSettingList(), [item]); 83 | }); 84 | 85 | }); 86 | 87 | }); 88 | 89 | describe('KVCTransportExport', function test_KVCTransportExport() { 90 | 91 | it('throws if not object', function () { 92 | throws(function () { 93 | ZDRTestingWrap.App.KVCTransport.KVCTransportExport(null); 94 | }, /KVCErrorInputNotValid/); 95 | }); 96 | 97 | it('returns object', function () { 98 | deepEqual(ZDRTestingWrap.App.KVCTransport.KVCTransportExport({}), {}); 99 | }); 100 | 101 | context('KVCNote', function () { 102 | 103 | it('throws if not array', function () { 104 | throws(function () { 105 | ZDRTestingWrap.App.KVCTransport.KVCTransportExport({ 106 | KVCNote: null, 107 | }); 108 | }, /KVCErrorInputNotValid/); 109 | }); 110 | 111 | it('copies input', function () { 112 | const item = StubNoteObjectValid(); 113 | notStrictEqual((ZDRTestingWrap.App.KVCTransport.KVCTransportExport({ 114 | KVCNote: [item], 115 | })).KVCNote.shift(), item); 116 | }); 117 | 118 | it('strips dynamic attributes', function () { 119 | const item = StubNoteObjectValid({ 120 | $alfa: Math.random().toString(), 121 | }); 122 | deepEqual((ZDRTestingWrap.App.KVCTransport.KVCTransportExport({ 123 | KVCNote: [item], 124 | })).KVCNote.shift().$alfa, undefined); 125 | }); 126 | 127 | }); 128 | 129 | context('KVCSetting', function () { 130 | 131 | it('throws if not array', function () { 132 | throws(function () { 133 | ZDRTestingWrap.App.KVCTransport.KVCTransportExport({ 134 | KVCSetting: null, 135 | }); 136 | }, /KVCErrorInputNotValid/); 137 | }); 138 | 139 | it('copies input', function () { 140 | const item = StubSettingObjectValid(); 141 | notStrictEqual((ZDRTestingWrap.App.KVCTransport.KVCTransportExport({ 142 | KVCSetting: [item], 143 | })).KVCSetting.shift(), item); 144 | }); 145 | 146 | it('strips dynamic attributes', function () { 147 | const item = StubSettingObjectValid({ 148 | $alfa: Math.random().toString(), 149 | }); 150 | deepEqual((ZDRTestingWrap.App.KVCTransport.KVCTransportExport({ 151 | KVCSetting: [item], 152 | })).KVCSetting.shift().$alfa, undefined); 153 | }); 154 | 155 | }); 156 | 157 | }); 158 | -------------------------------------------------------------------------------- /os-app/_shared/KVCTransport/main.js: -------------------------------------------------------------------------------- 1 | import OLSKRemoteStorage from 'OLSKRemoteStorage'; 2 | 3 | export default { 4 | ZDRSchemaKey: 'KVCTransport', 5 | ZDRSchemaDispatchValidate: (function () {}), 6 | ZDRSchemaPath: (function () {}), 7 | ZDRSchemaStub: (function () {}), 8 | ZDRSchemaMethods: { 9 | 10 | async KVCTransportImport (inputData) { 11 | if (typeof inputData !== 'object' || inputData === null) { 12 | throw new Error('KVCErrorInputNotValid'); 13 | } 14 | 15 | const _this = this; 16 | 17 | return Object.fromEntries(await Promise.all(Object.entries(inputData).map(async function ([key, value]) { 18 | if (!Array.isArray(value)) { 19 | throw new Error('KVCErrorInputNotValid'); 20 | } 21 | 22 | return [key, await ({ 23 | KVCNote: (function () { 24 | return Promise.all(value.map(function (e) { 25 | return _this.App.KVCNote.KVCNoteCreate(e).catch(function () { 26 | throw new Error('KVCErrorInputNotValid'); 27 | }); 28 | })); 29 | }), 30 | KVCSetting: (function () { 31 | return Promise.all(value.map(function (e) { 32 | return _this.App.KVCSetting.ZDRModelWriteObject(e).catch(function () { 33 | throw new Error('KVCErrorInputNotValid'); 34 | }); 35 | })); 36 | }), 37 | }[key]())]; 38 | }))); 39 | }, 40 | 41 | KVCTransportExport (inputData) { 42 | if (typeof inputData !== 'object' || inputData === null) { 43 | throw new Error('KVCErrorInputNotValid'); 44 | } 45 | 46 | return Object.entries(inputData).reduce(function (coll, [key, value]) { 47 | if (!Array.isArray(value)) { 48 | throw new Error('KVCErrorInputNotValid'); 49 | } 50 | 51 | if (!value.length) { 52 | return coll; 53 | } 54 | 55 | return Object.assign(coll, { 56 | [key]: value.map(OLSKRemoteStorage.OLSKRemoteStorageSafeCopy), 57 | }); 58 | }, {}); 59 | }, 60 | 61 | }, 62 | }; 63 | -------------------------------------------------------------------------------- /os-app/_shared/common/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerSharedStaticAssetFolders = function() { 2 | return [ 3 | '_shared/__external', 4 | ]; 5 | }; 6 | -------------------------------------------------------------------------------- /os-app/_shared/common/ui-style.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --KVCCommonBackground: hsl(0, 0%, 100%); 3 | --KVCCommonForeground: hsl(0, 0%, 0%); 4 | } 5 | 6 | .KVCSharedHidden { 7 | display: none !important; 8 | } 9 | -------------------------------------------------------------------------------- /os-app/open-compare-simplenote/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/compare-simplenote', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'KVCCompareSimplenoteRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'ui-view'), { 8 | KVCCompareSimplenoteLogic: require('./ui-logic.js'), 9 | }); 10 | }, 11 | OLSKRouteLanguageCodes: ['en', 'fr'], 12 | }]; 13 | }; 14 | -------------------------------------------------------------------------------- /os-app/open-compare-simplenote/i18n-en.yml: -------------------------------------------------------------------------------- 1 | KVCCompareSimplenoteTitle: Hyperdraft and Simplenote 2 | KVCCompareSimplenoteDescription: A scrappy alternative more focused on making websites. 3 | KVCCompareSimplenoteIntroText: 'Simplenote has been around for a long time. The app''s accessible and inviting aesthetic enables many people to take notes. Over time it has shifted focus from plaintext editing to checklists and richer text, and favours a proprietary link format over the comon double-bracket syntax.' 4 | KVCCompareSimplenoteContrastText: Hyperdraft is for people who want to use their note-taking tool to make websites while keeping their hands on the keyboard. It speeds up the workflow with shortcuts and adds more advanced web publishing features. Plus you can own 100% of your data by storing notes in a place you control. 5 | KVCCompareSimplenoteTableHeadingFeatureText: Feature 6 | KVCCompareSimplenoteFeatureList: 7 | KVCCompareSimplenoteFeaturePlaintext: plaintext editor 8 | KVCCompareSimplenoteFeatureFirstLink: first line is the title 9 | KVCCompareSimplenoteFeatureMarkdown: markdown support 10 | KVCCompareSimplenoteFeatureSync: sync across multiple devices 11 | KVCCompareSimplenoteFeatureOpenSource: open-source 12 | KVCCompareSimplenoteFeatureOffline: works offline 13 | KVCCompareSimplenoteFeatureMobile: works on mobile 14 | KVCCompareSimplenoteFeatureShortcuts: keyboard shortcuts 15 | KVCCompareSimplenoteFeatureClick: click links to go between notes 16 | KVCCompareSimplenoteFeaturePublish: publish notes to the Internet 17 | KVCCompareSimplenoteFeatureCollaborate: collaborate with other people 18 | KVCCompareSimplenoteFeatureHomepage: set homepage 19 | KVCCompareSimplenoteFeatureDomain: connect a custom domain 20 | KVCCompareSimplenoteFeatureDoorless: use without account 21 | KVCCompareSimplenoteFeatureNotational: import from Notational Velocity 22 | KVCCompareSimplenoteFeatureSyntax: double-bracket syntax 23 | KVCCompareSimplenoteFeatureArchive: archive notes 24 | KVCCompareSimplenoteFeatureZeroData: own your data 25 | KVCCompareSimplenoteFeatureListCaption: 26 | KVCCompareSimplenoteFeatureShortcuts: 27 | - 'Sublime Text keyboard shortcuts, launcher commands, tab between list and current notes' 28 | - basic shortcuts 29 | KVCCompareSimplenoteFeatureHomepage: 30 | - build a website from your notes 31 | KVCCompareSimplenoteFeatureDomain: 32 | - add your own flair when publishing 33 | KVCCompareSimplenoteFeatureDoorless: 34 | - just open and start using it 35 | KVCCompareSimplenoteFeatureSyntax: 36 | - compatible with Notational Velocity and other apps 37 | - proprietary format 38 | KVCCompareSimplenoteFeatureArchive: 39 | - hide notes you don't use often to tidy search results 40 | KVCCompareSimplenoteFeatureZeroData: 41 | - your data is 100% yours 42 | KVCCompareSimplenoteActionHeadingText: Try writing with Hyperdraft 43 | -------------------------------------------------------------------------------- /os-app/open-compare-simplenote/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | KVCCompareSimplenoteTitle: Hyperdraft et Simplenote 2 | KVCCompareSimplenoteDescription: Une alternative pour la création de sites web. 3 | KVCCompareSimplenoteIntroText: 'Simplenote existe depuis longtemps. L''esthétique accessible et conviviale de l''application permet à de nombreuses personnes de prendre des notes. Au fil du temps, elle a délaissé l''édition en texte brut au profit de listes de contrôle et de textes plus riches, et elle privilégie un format de lien propriétaire à la syntaxe à double crochet habituelle.' 4 | KVCCompareSimplenoteContrastText: 'Hyperdraft est destiné aux personnes qui souhaitent utiliser leur outil de prise de notes pour créer des sites Web tout en gardant les mains sur le clavier. Il accélère le flux de travail grâce à des raccourcis et ajoute des fonctions de publication Web plus avancées. De plus, vous pouvez être propriétaire de 100 % de vos données en stockant vos notes dans un endroit que vous contrôlez.' 5 | KVCCompareSimplenoteTableHeadingFeatureText: Fonctionnalité 6 | KVCCompareSimplenoteFeatureList: 7 | KVCCompareSimplenoteFeaturePlaintext: éditeur de texte en clair 8 | KVCCompareSimplenoteFeatureFirstLink: la première ligne est le titre 9 | KVCCompareSimplenoteFeatureMarkdown: prise en charge de Markdown 10 | KVCCompareSimplenoteFeatureSync: synchronisation sur plusieurs appareils 11 | KVCCompareSimplenoteFeatureOpenSource: open-source 12 | KVCCompareSimplenoteFeatureOffline: fonctionne hors ligne 13 | KVCCompareSimplenoteFeatureMobile: fonctionne sur mobile 14 | KVCCompareSimplenoteFeatureShortcuts: raccourcis clavier 15 | KVCCompareSimplenoteFeatureClick: cliquer sur les liens pour aller entre les notes 16 | KVCCompareSimplenoteFeaturePublish: publiquer de notes sur l'Internet 17 | KVCCompareSimplenoteFeatureCollaborate: collaborer avec d'autres personnes 18 | KVCCompareSimplenoteFeatureHomepage: définir la page d'accueil 19 | KVCCompareSimplenoteFeatureDomain: ajouter d'un nom de domaine personnalisé 20 | KVCCompareSimplenoteFeatureDoorless: utiliser sans compte 21 | KVCCompareSimplenoteFeatureNotational: importer de Notational Velocity 22 | KVCCompareSimplenoteFeatureSyntax: syntaxe à double crochet 23 | KVCCompareSimplenoteFeatureArchive: archiver des notes 24 | KVCCompareSimplenoteFeatureZeroData: être propriétaire de vos données 25 | KVCCompareSimplenoteFeatureListCaption: 26 | KVCCompareSimplenoteFeatureShortcuts: 27 | - 'raccourcis clavier de Sublime Text, commandes du lanceur, changer rapidement entre la liste et la note actuelle' 28 | - raccourcis de base 29 | KVCCompareSimplenoteFeatureHomepage: 30 | - faire un siteweb à partir de vos notes 31 | KVCCompareSimplenoteFeatureDomain: 32 | - ajoutez votre propre style lors de la publication 33 | KVCCompareSimplenoteFeatureDoorless: 34 | - ouvrez-le et commencez à l'utiliser 35 | KVCCompareSimplenoteFeatureSyntax: 36 | - compatible avec Notational Velocity et d'autres applications 37 | - format propriétaire 38 | KVCCompareSimplenoteFeatureArchive: 39 | - cacher les notes que vous n'utilisez pas souvent pour ordonner les résultats de recherche 40 | KVCCompareSimplenoteFeatureZeroData: 41 | - vos données vous appartiennent à 100% 42 | KVCCompareSimplenoteActionHeadingText: Essayez d'écrire avec Hyperdraft 43 | -------------------------------------------------------------------------------- /os-app/open-compare-simplenote/ui-logic-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./ui-logic.js'); 4 | 5 | describe('KVCCompareSimplenoteFeatures', function test_KVCCompareSimplenoteFeatures() { 6 | 7 | it('returns object', function() { 8 | deepEqual(mod.KVCCompareSimplenoteFeatures(), { 9 | KVCCompareSimplenoteFeaturePlaintext: [true, true], 10 | KVCCompareSimplenoteFeatureFirstLink: [true, true], 11 | KVCCompareSimplenoteFeatureMarkdown: [true, true], 12 | KVCCompareSimplenoteFeatureSync: [true, true], 13 | KVCCompareSimplenoteFeatureOpenSource: [true, true], 14 | KVCCompareSimplenoteFeatureOffline: [true, true], 15 | KVCCompareSimplenoteFeatureMobile: [true, true], 16 | KVCCompareSimplenoteFeatureShortcuts: [true, true], 17 | KVCCompareSimplenoteFeatureCollaborate: [false, true], 18 | KVCCompareSimplenoteFeatureClick: [true, true], 19 | KVCCompareSimplenoteFeaturePublish: [true, true], 20 | KVCCompareSimplenoteFeatureHomepage: [true, false], 21 | KVCCompareSimplenoteFeatureDomain: [true, false], 22 | KVCCompareSimplenoteFeatureDoorless: [true, false], 23 | KVCCompareSimplenoteFeatureNotational: [true, false], 24 | KVCCompareSimplenoteFeatureSyntax: [true, false], 25 | KVCCompareSimplenoteFeatureArchive: [true, false], 26 | KVCCompareSimplenoteFeatureZeroData: [true, false], 27 | }); 28 | }); 29 | 30 | }); 31 | -------------------------------------------------------------------------------- /os-app/open-compare-simplenote/ui-logic.js: -------------------------------------------------------------------------------- 1 | const mod = { 2 | 3 | KVCCompareSimplenoteFeatures () { 4 | return { 5 | KVCCompareSimplenoteFeaturePlaintext: [true, true], 6 | KVCCompareSimplenoteFeatureFirstLink: [true, true], 7 | KVCCompareSimplenoteFeatureMarkdown: [true, true], 8 | KVCCompareSimplenoteFeatureSync: [true, true], 9 | KVCCompareSimplenoteFeatureOpenSource: [true, true], 10 | KVCCompareSimplenoteFeatureOffline: [true, true], 11 | KVCCompareSimplenoteFeatureMobile: [true, true], 12 | KVCCompareSimplenoteFeatureShortcuts: [true, true], 13 | KVCCompareSimplenoteFeatureCollaborate: [false, true], 14 | KVCCompareSimplenoteFeatureClick: [true, true], 15 | KVCCompareSimplenoteFeaturePublish: [true, true], 16 | KVCCompareSimplenoteFeatureHomepage: [true, false], 17 | KVCCompareSimplenoteFeatureDomain: [true, false], 18 | KVCCompareSimplenoteFeatureDoorless: [true, false], 19 | KVCCompareSimplenoteFeatureNotational: [true, false], 20 | KVCCompareSimplenoteFeatureSyntax: [true, false], 21 | KVCCompareSimplenoteFeatureArchive: [true, false], 22 | KVCCompareSimplenoteFeatureZeroData: [true, false], 23 | }; 24 | }, 25 | 26 | }; 27 | 28 | Object.assign(exports, mod) 29 | -------------------------------------------------------------------------------- /os-app/open-compare-simplenote/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | KVCCompareSimplenote: '.KVCCompareSimplenote', 5 | 6 | KVCCompareSimplenoteHeading: '.KVCCompareSimplenoteHeading', 7 | 8 | KVCCompareSimplenoteIntro: '.KVCCompareSimplenoteIntro', 9 | KVCCompareSimplenoteContrast: '.KVCCompareSimplenoteContrast', 10 | 11 | KVCCompareSimplenoteTable: '.KVCCompareSimplenoteTable', 12 | KVCCompareSimplenoteTableHeadingFeature: '.KVCCompareSimplenoteTableHeadingFeature', 13 | KVCCompareSimplenoteTableHeadingHyperdraft: '.KVCCompareSimplenoteTableHeadingHyperdraft', 14 | KVCCompareSimplenoteTableHeadingSimplenote: '.KVCCompareSimplenoteTableHeadingSimplenote', 15 | KVCCompareSimplenoteTableRowFeature: '.KVCCompareSimplenoteTableRow td:nth-child(1)', 16 | KVCCompareSimplenoteTableRowHyperdraft: '.KVCCompareSimplenoteTableRow td:nth-child(2) span', 17 | KVCCompareSimplenoteTableRowHyperdraftCaption: '.KVCCompareSimplenoteTableRow td:nth-child(2) small', 18 | KVCCompareSimplenoteTableRowSimplenote: '.KVCCompareSimplenoteTableRow td:nth-child(3) span', 19 | KVCCompareSimplenoteTableRowSimplenoteCaption: '.KVCCompareSimplenoteTableRow td:nth-child(3) small', 20 | 21 | KVCCompareSimplenoteAction: '.KVCCompareSimplenoteAction', 22 | KVCCompareSimplenoteActionHeading: '.KVCCompareSimplenoteActionHeading', 23 | KVCCompareSimplenoteActionButton: '.KVCCompareSimplenoteActionButton', 24 | }).map(function (e) { 25 | return global[e.shift()] = e.pop(); 26 | }); 27 | 28 | describe('KVCCompareSimplenote_Access', function () { 29 | 30 | before(function() { 31 | return browser.OLSKVisit(kDefaultRoute); 32 | }); 33 | 34 | it('shows KVCCompareSimplenote', function() { 35 | browser.assert.elements(KVCCompareSimplenote, 1); 36 | }); 37 | 38 | it('shows OLSKLanguageSwitcher', function() { 39 | browser.assert.elements('.OLSKLanguageSwitcher', 1); 40 | }); 41 | 42 | it('shows KVCCompareSimplenoteHeading', function () { 43 | browser.assert.elements(KVCCompareSimplenoteHeading, 1); 44 | }); 45 | 46 | it('shows KVCCompareSimplenoteIntro', function () { 47 | browser.assert.elements(KVCCompareSimplenoteIntro, 1); 48 | }); 49 | 50 | it('shows KVCCompareSimplenoteContrast', function () { 51 | browser.assert.elements(KVCCompareSimplenoteContrast, 1); 52 | }); 53 | 54 | it('shows KVCCompareSimplenoteTable', function () { 55 | browser.assert.elements(KVCCompareSimplenoteTable, 1); 56 | }); 57 | 58 | it('shows KVCCompareSimplenoteTableHeadingFeature', function () { 59 | browser.assert.elements(KVCCompareSimplenoteTableHeadingFeature, 1); 60 | }); 61 | 62 | it('shows KVCCompareSimplenoteTableHeadingHyperdraft', function () { 63 | browser.assert.elements(KVCCompareSimplenoteTableHeadingHyperdraft, 1); 64 | }); 65 | 66 | it('shows KVCCompareSimplenoteTableHeadingSimplenote', function () { 67 | browser.assert.elements(KVCCompareSimplenoteTableHeadingSimplenote, 1); 68 | }); 69 | 70 | it('shows KVCCompareSimplenoteTableRowFeature', function () { 71 | browser.assert.elements(KVCCompareSimplenoteTableRowFeature); 72 | }); 73 | 74 | it('shows KVCCompareSimplenoteTableRowHyperdraft', function () { 75 | browser.assert.elements(KVCCompareSimplenoteTableRowHyperdraft); 76 | }); 77 | 78 | it('shows KVCCompareSimplenoteTableRowHyperdraftCaption', function () { 79 | browser.assert.elements(KVCCompareSimplenoteTableRowHyperdraftCaption); 80 | }); 81 | 82 | it('shows KVCCompareSimplenoteTableRowSimplenote', function () { 83 | browser.assert.elements(KVCCompareSimplenoteTableRowSimplenote); 84 | }); 85 | 86 | it('shows KVCCompareSimplenoteTableRowSimplenoteCaption', function () { 87 | browser.assert.elements(KVCCompareSimplenoteTableRowSimplenoteCaption); 88 | }); 89 | 90 | it('shows KVCCompareSimplenoteAction', function () { 91 | browser.assert.elements(KVCCompareSimplenoteAction, 1); 92 | }); 93 | 94 | it('shows KVCCompareSimplenoteActionHeading', function () { 95 | browser.assert.elements(KVCCompareSimplenoteActionHeading, 1); 96 | }); 97 | 98 | it('shows KVCCompareSimplenoteActionButton', function () { 99 | browser.assert.elements(KVCCompareSimplenoteActionButton, 1); 100 | }); 101 | 102 | it('shows KVCRootLink', function () { 103 | browser.assert.elements('.KVCRootLink', 1); 104 | }); 105 | 106 | }); 107 | -------------------------------------------------------------------------------- /os-app/open-compare-simplenote/ui-test-_localize.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | kDefaultRoute.OLSKRouteLanguageCodes.forEach(function (OLSKRoutingLanguage) { 4 | 5 | const uLocalized = function (inputData) { 6 | return OLSKTestingLocalized(inputData, OLSKRoutingLanguage); 7 | }; 8 | 9 | describe('KVCCompareSimplenote_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | }); 15 | }); 16 | 17 | it('localizes title', function() { 18 | browser.assert.text('title', uLocalized('KVCCompareSimplenoteTitle')); 19 | }); 20 | 21 | it('localizes meta[description]', function() { 22 | browser.assert.attribute('meta[name=description]', 'content', uLocalized('KVCCompareSimplenoteDescription')); 23 | }); 24 | 25 | it('localizes KVCCompareSimplenoteHeading', function () { 26 | browser.assert.text(KVCCompareSimplenoteHeading, uLocalized('KVCCompareSimplenoteTitle')); 27 | }); 28 | 29 | it('localizes KVCCompareSimplenoteIntro', function () { 30 | browser.assert.text(KVCCompareSimplenoteIntro, uLocalized('KVCCompareSimplenoteIntroText')); 31 | }); 32 | 33 | it('localizes KVCCompareSimplenoteContrast', function () { 34 | browser.assert.text(KVCCompareSimplenoteContrast, uLocalized('KVCCompareSimplenoteContrastText')); 35 | }); 36 | 37 | it('localizes KVCCompareSimplenoteTableHeadingFeature', function () { 38 | browser.assert.text(KVCCompareSimplenoteTableHeadingFeature, uLocalized('KVCCompareSimplenoteTableHeadingFeatureText')); 39 | }); 40 | 41 | describe('KVCCompareSimplenoteTableRowFeature', function test_KVCCompareSimplenoteTableRowFeature () { 42 | 43 | it('localizes KVCCompareSimplenoteTableRowFeature', function () { 44 | browser.assert.text(KVCCompareSimplenoteTableRowFeature, Object.values(uLocalized('KVCCompareSimplenoteFeatureList')).join('')); 45 | }); 46 | 47 | }); 48 | 49 | describe('KVCCompareSimplenoteTableRowHyperdraftCaption', function test_KVCCompareSimplenoteTableRowHyperdraftCaption () { 50 | 51 | it('localizes KVCCompareSimplenoteTableRowHyperdraftCaption', function () { 52 | browser.assert.text(KVCCompareSimplenoteTableRowHyperdraftCaption, Object.values(uLocalized('KVCCompareSimplenoteFeatureListCaption')).reduce(function (coll, item) { 53 | return coll.concat(item[0] ? item[0] : []); 54 | }, []).join('')); 55 | }); 56 | 57 | }); 58 | 59 | describe('KVCCompareSimplenoteTableRowSimplenoteCaption', function test_KVCCompareSimplenoteTableRowSimplenoteCaption () { 60 | 61 | it('localizes KVCCompareSimplenoteTableRowSimplenoteCaption', function () { 62 | browser.assert.text(KVCCompareSimplenoteTableRowSimplenoteCaption, Object.values(uLocalized('KVCCompareSimplenoteFeatureListCaption')).reduce(function (coll, item) { 63 | return coll.concat(item[1] ? item[1] : []); 64 | }, []).join('')); 65 | }); 66 | 67 | }); 68 | 69 | it('localizes KVCCompareSimplenoteActionHeading', function () { 70 | browser.assert.text(KVCCompareSimplenoteActionHeading, uLocalized('KVCCompareSimplenoteActionHeadingText')); 71 | }); 72 | 73 | it('localizes KVCCompareSimplenoteActionButton', function () { 74 | browser.assert.text(KVCCompareSimplenoteActionButton, uLocalized('OLSKWordingOpenApp')); 75 | }); 76 | 77 | }); 78 | 79 | }); 80 | -------------------------------------------------------------------------------- /os-app/open-compare-simplenote/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | const KVCCompareSimplenoteLogic = require('./ui-logic.js'); 4 | 5 | describe('KVCCompareSimplenote_Misc', function () { 6 | 7 | before(function () { 8 | return browser.OLSKVisit(kDefaultRoute); 9 | }); 10 | 11 | describe('KVCCompareSimplenote', function () { 12 | 13 | it('classes OLSKDecor', function () { 14 | browser.assert.hasClass(KVCCompareSimplenote, 'OLSKDecor'); 15 | }); 16 | 17 | it('classes OLSKDecorCapped', function () { 18 | browser.assert.hasClass(KVCCompareSimplenote, 'OLSKDecorCapped'); 19 | }); 20 | 21 | }); 22 | 23 | describe('KVCCompareSimplenoteHeading', function test_KVCCompareSimplenoteHeading () { 24 | 25 | it('classes OLSKDecorTitle', function () { 26 | browser.assert.hasClass(KVCCompareSimplenoteHeading, 'OLSKDecorTitle'); 27 | }); 28 | 29 | }); 30 | 31 | describe('KVCCompareSimplenoteTable', function test_KVCCompareSimplenoteTable () { 32 | 33 | it('classes OLSKDecorCompareTable', function () { 34 | browser.assert.hasClass(KVCCompareSimplenoteTable, 'OLSKDecorCompareTable'); 35 | }); 36 | 37 | }); 38 | 39 | describe('KVCCompareSimplenoteTableHeadingHyperdraft', function test_KVCCompareSimplenoteTableHeadingHyperdraft () { 40 | 41 | it('sets text', function () { 42 | browser.assert.text(KVCCompareSimplenoteTableHeadingHyperdraft, 'Hyperdraft'); 43 | }); 44 | 45 | }); 46 | 47 | describe('KVCCompareSimplenoteTableHeadingSimplenote', function test_KVCCompareSimplenoteTableHeadingSimplenote () { 48 | 49 | it('sets text', function () { 50 | browser.assert.text(KVCCompareSimplenoteTableHeadingSimplenote, 'Simplenote'); 51 | }); 52 | 53 | }); 54 | 55 | Object.entries(KVCCompareSimplenoteLogic.KVCCompareSimplenoteFeatures()).forEach(function ([key, value], i) { 56 | 57 | describe('KVCCompareSimplenoteTableRowHyperdraft ' + key, function test_KVCCompareSimplenoteTableRowHyperdraft () { 58 | 59 | it('sets text', function () { 60 | browser.assert.text(`.${ key } td:nth-child(2) span`, value[0] ? '☑️' : ''); 61 | }); 62 | 63 | }); 64 | 65 | describe('KVCCompareSimplenoteTableRowSimplenote ' + key, function test_KVCCompareSimplenoteTableRowSimplenote () { 66 | 67 | it('sets text', function () { 68 | browser.assert.text(`.${ key } td:nth-child(3) span`, value[1] ? '☑️' : ''); 69 | }); 70 | 71 | }); 72 | 73 | }); 74 | 75 | context('KVCCompareSimplenoteAction', function test_KVCCompareSimplenoteAction () { 76 | 77 | it('classes OLSKDecorAction', function () { 78 | browser.assert.hasClass(KVCCompareSimplenoteAction, 'OLSKDecorAction'); 79 | }); 80 | 81 | }); 82 | 83 | context('KVCCompareSimplenoteActionButton', function test_KVCCompareSimplenoteActionButton () { 84 | 85 | it('classes OLSKDecorPress', function () { 86 | browser.assert.hasClass(KVCCompareSimplenoteActionButton, 'OLSKDecorPress'); 87 | }); 88 | 89 | it('classes OLSKDecorPressCall', function () { 90 | browser.assert.hasClass(KVCCompareSimplenoteActionButton, 'OLSKDecorPressCall'); 91 | }); 92 | 93 | it('sets href', function () { 94 | browser.assert.attribute(KVCCompareSimplenoteActionButton, 'href', OLSKTestingCanonical(require('../open-write/controller.js').OLSKControllerRoutes().shift())); 95 | }); 96 | 97 | }); 98 | 99 | }); 100 | -------------------------------------------------------------------------------- /os-app/open-compare-simplenote/ui-view.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | locals.OLSKPageTitle = OLSKLocalized('KVCCompareSimplenoteTitle'); 3 | locals.OLSKPageDescription = OLSKLocalized('KVCCompareSimplenoteDescription'); 4 | locals.OLSKPageManifest = OLSKCanonical('WKCManifestRoute'); 5 | locals.OLSKPageAssets = [ 6 | '/_shared/__external/normalize.css/normalize.css', 7 | '/_shared/__external/OLSKDecor/ui-style.css', 8 | '/_shared/common/ui-style.css', 9 | ]; 10 | %> 11 | 12 |
13 | 14 | <%- include('../_shared/__external/OLSKLanguageSwitcher/main.ejs') %> 15 | 16 |

<%= OLSKLocalized('KVCCompareSimplenoteTitle') %>

17 | 18 |

<%= OLSKLocalized('KVCCompareSimplenoteIntroText') %>

19 | 20 |

<%= OLSKLocalized('KVCCompareSimplenoteContrastText') %>

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | <% Object.entries(OLSKLocalized('KVCCompareSimplenoteFeatureList')).forEach(function ([key, value]) { -%> 29 | 30 | 31 | 39 | 47 | 48 | <% }) -%> 49 |
<%= OLSKLocalized('KVCCompareSimplenoteTableHeadingFeatureText') %>HyperdraftSimplenote
<%= value %> 32 | 33 | <%= KVCCompareSimplenoteLogic.KVCCompareSimplenoteFeatures()[key][0] ? '☑️' : '' %> 34 | 35 | <% if ((OLSKLocalized('KVCCompareSimplenoteFeatureListCaption')[key] || [])[0]) { -%> 36 | <%= OLSKLocalized('KVCCompareSimplenoteFeatureListCaption')[key][0] %> 37 | <% } -%> 38 | 40 | 41 | <%= KVCCompareSimplenoteLogic.KVCCompareSimplenoteFeatures()[key][1] ? '☑️' : '' %> 42 | 43 | <% if ((OLSKLocalized('KVCCompareSimplenoteFeatureListCaption')[key] || [])[1]) { -%> 44 | <%= OLSKLocalized('KVCCompareSimplenoteFeatureListCaption')[key][1] %> 45 | <% } -%> 46 |
50 | 51 |
52 | <%= OLSKLocalized('KVCCompareSimplenoteActionHeadingText') %> 53 | 54 | <%= OLSKLocalized('OLSKWordingOpenApp') %> 55 |
56 | 57 |
58 | 59 | <%- include('../_shared/KVCRootLink/main.ejs') %> 60 | 61 |
62 | -------------------------------------------------------------------------------- /os-app/open-guide/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function () { 2 | return [{ 3 | OLSKRoutePath: '/guide', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'KVCGuideRoute', 6 | OLSKRouteFunction(req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'ui-view'), { 8 | KVCGuideContent: res.OLSKMarkdownContent(require('path').join(__dirname, `text-${ res.locals.OLSKSharedPageCurrentLanguage }.md`), { 9 | KVCWriteRoute: res.locals.OLSKCanonical('KVCWriteRoute'), 10 | }), 11 | }); 12 | }, 13 | _OLSKRouteLanguageCodes: ['en'], 14 | }]; 15 | }; 16 | -------------------------------------------------------------------------------- /os-app/open-guide/i18n-en.yml: -------------------------------------------------------------------------------- 1 | KVCGuideTitle: Hyperdraft Guide 2 | KVCGuideDescription: Documentation for project 3 | -------------------------------------------------------------------------------- /os-app/open-guide/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | KVCGuideTitle: Guia de Hyperdraft 2 | KVCGuideDescription: Documentação do projeto 3 | -------------------------------------------------------------------------------- /os-app/open-guide/ui-style.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --OLSKCommonBackground: var(--KVCCommonBackground); 3 | --OLSKCommonForeground: var(--KVCCommonForeground); 4 | } 5 | 6 | body { 7 | background: var(--KVCCommonBackground); 8 | color: var(--KVCCommonForeground); 9 | } 10 | 11 | .KVCGuide table:first-of-type h1 { 12 | border: none; 13 | } 14 | 15 | .KVCGuide table:not(:first-of-type) td:first-child { 16 | width: 50%; 17 | } 18 | -------------------------------------------------------------------------------- /os-app/open-guide/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | KVCGuide: '.KVCGuide', 5 | 6 | KVCGuideCrown: '.KVCGuideCrown', 7 | KVCGuideCrownName: '.KVCGuideCrownName', 8 | 9 | KVCGuideContent: '.KVCGuideContent', 10 | }).map(function (e) { 11 | return global[e.shift()] = e.pop(); 12 | }); 13 | 14 | describe('KVCGuide_Access', function () { 15 | 16 | before(function() { 17 | return browser.OLSKVisit(kDefaultRoute); 18 | }); 19 | 20 | it('shows KVCGuide', function () { 21 | browser.assert.elements(KVCGuide, 1); 22 | }); 23 | 24 | it('shows KVCGuideCrown', function () { 25 | browser.assert.elements(KVCGuideCrown, 1); 26 | }); 27 | 28 | it('shows KVCGuideCrownName', function () { 29 | browser.assert.elements(KVCGuideCrownName, 1); 30 | }); 31 | 32 | it('shows KVCGuideContent', function () { 33 | browser.assert.elements(KVCGuideContent, 1); 34 | }); 35 | 36 | it('shows KVCRootLink', function () { 37 | browser.assert.elements('.KVCRootLink', 1); 38 | }); 39 | 40 | }); 41 | -------------------------------------------------------------------------------- /os-app/open-guide/ui-test-_localize.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | kDefaultRoute._OLSKRouteLanguageCodes.forEach(function (OLSKRoutingLanguage) { 4 | 5 | const uLocalized = function (inputData) { 6 | return OLSKTestingLocalized(inputData, OLSKRoutingLanguage); 7 | }; 8 | 9 | describe('KVCGuide_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute); 13 | }); 14 | 15 | it('localizes title', function() { 16 | browser.assert.text('title', uLocalized('KVCGuideTitle')); 17 | }); 18 | 19 | it('localizes meta[description]', function() { 20 | browser.assert.attribute('meta[name=description]', 'content', uLocalized('KVCGuideDescription')); 21 | }); 22 | 23 | it('localizes KVCGuideCrownName', function () { 24 | browser.assert.text(KVCGuideCrownName, uLocalized('KVCGuideTitle')); 25 | }); 26 | 27 | }); 28 | 29 | }); 30 | -------------------------------------------------------------------------------- /os-app/open-guide/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('KVCGuide_Misc', function () { 4 | 5 | before(function () { 6 | return browser.OLSKVisit(kDefaultRoute); 7 | }); 8 | 9 | context('KVCGuide', function () { 10 | 11 | it('classes OLSKDecor', function () { 12 | browser.assert.hasClass(KVCGuide, 'OLSKDecor'); 13 | }); 14 | 15 | it('classes OLSKDecorCapped', function () { 16 | browser.assert.hasClass(KVCGuide, 'OLSKDecorCapped'); 17 | }); 18 | 19 | }); 20 | 21 | describe('KVCGuideCrown', function test_KVCGuideCrown() { 22 | 23 | it('classes OLSKCommonCard', function () { 24 | browser.assert.hasClass(KVCGuideCrown, 'OLSKCommonCard'); 25 | }); 26 | 27 | it('classes OLSKCommonCrownCard', function () { 28 | browser.assert.hasClass(KVCGuideCrown, 'OLSKCommonCrownCard'); 29 | }); 30 | 31 | }); 32 | 33 | }); 34 | -------------------------------------------------------------------------------- /os-app/open-guide/ui-view.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | locals.OLSKPageTitle = OLSKLocalized('KVCGuideTitle'); 3 | locals.OLSKPageDescription = OLSKLocalized('KVCGuideDescription'); 4 | locals.OLSKPageAssets = [ 5 | '/_shared/__external/normalize.css/normalize.css', 6 | '/_shared/__external/OLSKDecor/ui-style.css', 7 | '/_shared/common/ui-style.css', 8 | 'ui-style.css', 9 | ]; 10 | %> 11 | 12 |
13 | 14 |
15 |
16 | <%= OLSKLocalized('KVCGuideTitle') %> 17 |
18 |
19 | 20 |
21 | <%- KVCGuideContent %> 22 |
23 | 24 |
25 | 26 | <%- include('../_shared/KVCRootLink/main.ejs') %> 27 | 28 |
29 | -------------------------------------------------------------------------------- /os-app/open-vitrine/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'KVCVitrineRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'ui-view')); 8 | }, 9 | OLSKRouteLanguageCodes: ['en', 'fr', 'es', 'pt'], 10 | }]; 11 | }; 12 | -------------------------------------------------------------------------------- /os-app/open-vitrine/i18n-en.yml: -------------------------------------------------------------------------------- 1 | KVCVitrineTitle: Hyperdraft 2 | KVCVitrineDescription: Turn your text notes into a website. 3 | OLSKLandingBlurbText: A simple app for writing and publishing that's always with you. 4 | KVCVitrineGlossaryWritingHeadingText: Writing 5 | KVCVitrineGlossaryWritingUsingLinkText: How I use Hyperdraft for reference, writing, and publishing 6 | KVCVitrineGlossaryWritingAnswerLinkText: "Writing creates a space for 'the answer to go'" 7 | KVCVitrineGlossaryWritingListsLinkText: Lists are not synthesis 8 | KVCVitrineGlossaryWritingDiscussionLinkText: Discussion is ephemeral 9 | KVCVitrineGlossaryWritingMagicLinkText: Writing without magic 10 | KVCVitrineGlossaryPublicHeadingText: Open to the public 11 | KVCVitrineGlossaryPublicRefLinkText: My public notes 12 | KVCVitrineGlossaryPublicRefBlurbText: A space to write, collect, revise, and share. 13 | KVCVitrineGlossaryPublicGardensLinkText: Gardens made with Hyperdraft 14 | KVCVitrineGlossaryPublicGardensBlurbText: From friends and strangers. 15 | KVCVitrineGlossaryPublicDigitalLinkText: What is a digital garden? 16 | KVCVitrineGlossaryPublicDigitalBlurbText: Learn about a new form of non-chronological writing and publishing. 17 | KVCVitrineGlossaryCompareHeadingText: Compare 18 | KVCVitrineGlossaryCompareSimplenoteLinkText: Hyperdraft and Simplenote 19 | -------------------------------------------------------------------------------- /os-app/open-vitrine/i18n-es.yml: -------------------------------------------------------------------------------- 1 | KVCVitrineTitle: Hyperdraft 2 | KVCVitrineDescription: Transformar tus notas de texto en un sitio web. 3 | OLSKLandingBlurbText: Una sencilla aplicación para escribir y publicar que está siempre contigo. 4 | KVCVitrineGlossaryWritingHeadingText: La escritura 5 | KVCVitrineGlossaryWritingUsingLinkText: Cómo utilizo Hyperdraft para referencia, escribir y publicar 6 | KVCVitrineGlossaryWritingAnswerLinkText: "La escritura crea un espacio para 'la respuesta llegar'" 7 | KVCVitrineGlossaryWritingListsLinkText: Las listas no son síntesis 8 | KVCVitrineGlossaryWritingDiscussionLinkText: La discusión es efímera 9 | KVCVitrineGlossaryWritingMagicLinkText: Escribir sin magia 10 | KVCVitrineGlossaryPublicHeadingText: Abierto al público 11 | KVCVitrineGlossaryPublicRefLinkText: Mis notas públicas 12 | KVCVitrineGlossaryPublicRefBlurbText: Un espacio para escribir, coleccionar, revisar y compartir. 13 | KVCVitrineGlossaryPublicGardensLinkText: Jardines hechos con Hyperdraft 14 | KVCVitrineGlossaryPublicGardensBlurbText: De amigos y extraños. 15 | KVCVitrineGlossaryPublicDigitalLinkText: ¿Qué es un jardín digital? 16 | KVCVitrineGlossaryPublicDigitalBlurbText: Conozca una nueva forma de escritura y publicación no cronológica. 17 | KVCVitrineGlossaryCompareHeadingText: Comparar 18 | KVCVitrineGlossaryCompareSimplenoteLinkText: Hyperdraft y Simplenote 19 | -------------------------------------------------------------------------------- /os-app/open-vitrine/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | KVCVitrineTitle: Hyperdraft 2 | KVCVitrineDescription: Transformer vos notes de texte en un site Web. 3 | OLSKLandingBlurbText: 'Une application simple pour écrire et publier, toujours avec vous.' 4 | KVCVitrineGlossaryWritingHeadingText: L'écriture 5 | KVCVitrineGlossaryWritingUsingLinkText: Comment j'utilise Hyperdraft pour la référence, l'écriture et la publication. 6 | KVCVitrineGlossaryWritingAnswerLinkText: "L'écriture crée un espace pour « la réponse à arriver »" 7 | KVCVitrineGlossaryWritingListsLinkText: La liste n'est pas un synthèse. 8 | KVCVitrineGlossaryWritingDiscussionLinkText: La discussion est éphémère. 9 | KVCVitrineGlossaryWritingMagicLinkText: Écrire sans magie 10 | KVCVitrineGlossaryPublicHeadingText: Ouvert au public 11 | KVCVitrineGlossaryPublicRefLinkText: Mes notes publiques 12 | KVCVitrineGlossaryPublicRefBlurbText: Un espace pour écrire, rassembler, réviser et partager. 13 | KVCVitrineGlossaryPublicGardensLinkText: Jardins réalisés avec Hyperdraft 14 | KVCVitrineGlossaryPublicGardensBlurbText: D'amis et d'inconnus. 15 | KVCVitrineGlossaryPublicDigitalLinkText: Qu'est-ce qu'un jardin numérique ? 16 | KVCVitrineGlossaryPublicDigitalBlurbText: Découvrez une nouvelle forme d'écriture et de publication non chronologique. 17 | KVCVitrineGlossaryCompareHeadingText: Comparer 18 | KVCVitrineGlossaryCompareSimplenoteLinkText: Hyperdraft et Simplenote 19 | -------------------------------------------------------------------------------- /os-app/open-vitrine/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | KVCVitrineTitle: Hyperdraft 2 | KVCVitrineDescription: Transformar suas notas de texto em um website. 3 | OLSKLandingBlurbText: Um aplicativo simples para escrever e publicar que fica sempre com você. 4 | KVCVitrineGlossaryWritingHeadingText: A escrita 5 | KVCVitrineGlossaryWritingUsingLinkText: Como uso o Hyperdraft para referência, escrita e publicação 6 | KVCVitrineGlossaryWritingAnswerLinkText: "A escrita cria um espaço para 'a resposta chegar'" 7 | KVCVitrineGlossaryWritingListsLinkText: As listas não são síntese 8 | KVCVitrineGlossaryWritingDiscussionLinkText: Discussão é efêmera. 9 | KVCVitrineGlossaryWritingMagicLinkText: Escrever sem magia 10 | KVCVitrineGlossaryPublicHeadingText: Aberto ao publico 11 | KVCVitrineGlossaryPublicRefLinkText: Minhas notas públicas 12 | KVCVitrineGlossaryPublicRefBlurbText: Um espaço para escrever, coletar, revisar e compartilhar. 13 | KVCVitrineGlossaryPublicGardensLinkText: Jardins feitos com Hyperdraft 14 | KVCVitrineGlossaryPublicGardensBlurbText: De amigos e estranhos. 15 | KVCVitrineGlossaryPublicDigitalLinkText: O que é um jardim digital? 16 | KVCVitrineGlossaryPublicDigitalBlurbText: Aprenda sobre uma nova forma de escrita e publicação não cronológica. 17 | KVCVitrineGlossaryCompareHeadingText: Comparar 18 | KVCVitrineGlossaryCompareSimplenoteLinkText: Hyperdraft e Simplenote 19 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/KVCFeatureList/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/KVCFeatureList', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteFunction (req, res, next) { 6 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'stub-view')); 7 | }, 8 | OLSKRouteSignature: 'KVCFeatureListStubRoute', 9 | OLSKRouteLanguageCodes: ['en', 'fr', 'es', 'pt'], 10 | }]; 11 | }; 12 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/KVCFeatureList/i18n-en.yml: -------------------------------------------------------------------------------- 1 | KVCFeatureListArray: 2 | - - Network your ideas. 3 | - 'Link between notes via [[wiki]] syntax.' 4 | - - Make a website. 5 | - Publish notes to the Internet with remoteStorage or Fission. 6 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/KVCFeatureList/i18n-es.yml: -------------------------------------------------------------------------------- 1 | KVCFeatureListArray: 2 | - - Poner en red tus ideas. 3 | - 'Hacer enlazos entre tus notas con la sintaxis [[wiki]].' 4 | - - Hacer un sitio web. 5 | - Publicar notas en Internet con remoteStorage o Fission. 6 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/KVCFeatureList/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | KVCFeatureListArray: 2 | - - Mettre vos idées en réseau. 3 | - 'Créer des liens entre vos notes par la syntaxe [[wiki]].' 4 | - - Faire un site web. 5 | - Publier des notes sur l'Internet avec remoteStorage ou Fission. 6 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/KVCFeatureList/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | KVCFeatureListArray: 2 | - - Interligar suas idéias. 3 | - 'Fazer links entre notas com o sintaxe [[wiki]].' 4 | - - Fazer um website. 5 | - Publicar notas na Internet com o remoteStorage ou o Fission. 6 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/KVCFeatureList/main.ejs: -------------------------------------------------------------------------------- 1 |
2 | 3 | <%- include('../../../../node_modules/OLSKFeatureList/main.ejs', { 4 | OLSKFeatureListData: OLSKLocalized('KVCFeatureListArray').map(function (e, i) { 5 | return e.concat([ 6 | '/_shared/__external/OLSKUIAssets/_OLSKSharedFeatureBrackets.svg', 7 | '/_shared/__external/OLSKUIAssets/_OLSKSharedFeaturePublish.svg', 8 | ][i]); 9 | }), 10 | }) %> 11 | 12 |
13 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/KVCFeatureList/stub-view.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | locals.OLSKPageAssets = [ 3 | '/_shared/__external/normalize.css/normalize.css', 4 | '/_shared/__external/OLSKDecor/ui-style.css', 5 | ]; 6 | %> 7 | 8 |
9 | <%- include('main.ejs') %> 10 |
11 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/KVCFeatureList/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | KVCFeatureList: '.KVCFeatureList', 5 | }).map(function (e) { 6 | return global[e.shift()] = e.pop(); 7 | }); 8 | 9 | describe('KVCFeatureList_Access', function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute); 13 | }); 14 | 15 | it('shows KVCFeatureList', function() { 16 | browser.assert.elements(KVCFeatureList, 1); 17 | }); 18 | 19 | it('shows OLSKFeatureList', function() { 20 | browser.assert.elements('.OLSKFeatureList', 1); 21 | }); 22 | 23 | }); 24 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/KVCFeatureList/ui-test-_localize.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | kDefaultRoute.OLSKRouteLanguageCodes.forEach(function (OLSKRoutingLanguage) { 4 | 5 | const uLocalized = function (inputData) { 6 | return OLSKTestingLocalized(inputData, OLSKRoutingLanguage); 7 | }; 8 | 9 | describe('KVCFeatureList_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | }); 15 | }); 16 | 17 | uLocalized('KVCFeatureListArray').forEach(function ([name, blurb], i) { 18 | 19 | it('localizes KVCVitrineStandardFeaturesItem', function () { 20 | browser.assert.text(`.OLSKFeatureListItem:nth-child(${ i + 1 }) .OLSKFeatureListItemName`, name); 21 | }); 22 | 23 | it('localizes KVCVitrineStandardFeaturesBlurb', function () { 24 | browser.assert.text(`.OLSKFeatureListItem:nth-child(${ i + 1 }) .OLSKFeatureListItemBlurb`, blurb); 25 | }); 26 | 27 | }); 28 | 29 | }); 30 | 31 | }); 32 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/KVCFeatureList/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | const uLocalized = function (inputData) { 4 | return OLSKTestingLocalized(inputData, 'en'); 5 | }; 6 | 7 | describe('KVCFeatureList_Misc', function () { 8 | 9 | before(function () { 10 | return browser.OLSKVisit(kDefaultRoute); 11 | }); 12 | 13 | uLocalized('KVCFeatureListArray').forEach(function (e, i) { 14 | 15 | describe('KVCFeatureListItemIdentity', function test_KVCFeatureListItemIdentity () { 16 | 17 | it('sets src', function () { 18 | browser.assert.attribute(`.OLSKFeatureListItem:nth-child(${ i + 1 }) .OLSKFeatureListItemIcon`, 'src', [ 19 | '/_shared/__external/OLSKUIAssets/_OLSKSharedFeatureBrackets.svg', 20 | '/_shared/__external/OLSKUIAssets/_OLSKSharedFeaturePublish.svg', 21 | ][i]); 22 | }); 23 | 24 | it('sets role', function () { 25 | browser.assert.attribute(`.OLSKFeatureListItem:nth-child(${ i + 1 }) .OLSKFeatureListItemIcon`, 'role', 'presentation'); 26 | }); 27 | 28 | }); 29 | 30 | }); 31 | 32 | }); 33 | -------------------------------------------------------------------------------- /os-app/open-vitrine/ui-style.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --OLSKCommonBackground: var(--KVCCommonBackground); 3 | --OLSKCommonForeground: var(--KVCCommonForeground); 4 | } 5 | 6 | body { 7 | background: var(--KVCCommonBackground); 8 | color: var(--KVCCommonForeground); 9 | } 10 | 11 | .KVCVitrineVideo2 { 12 | --OLSKCommonVideoWide: 750; 13 | --OLSKCommonVideoHigh: 320; 14 | } 15 | 16 | .OLSKDecorGlossary { 17 | margin: unset; 18 | } 19 | 20 | .OLSKDecorGlossary h2 { 21 | margin-bottom: 6px; 22 | } 23 | 24 | .OLSKDecorGlossary ul { 25 | padding: 0; 26 | 27 | list-style: none; 28 | font-weight: bold; 29 | } 30 | 31 | .OLSKDecorGlossary ul li { 32 | margin: 10px 0; 33 | } 34 | 35 | .OLSKDecorGlossary a { 36 | font-weight: normal; 37 | } 38 | 39 | .OLSKDecorGlossary dd { 40 | margin: 1px 0 15px 0; 41 | } 42 | 43 | .ROCOGlossary { 44 | margin-top: 10px; 45 | } 46 | -------------------------------------------------------------------------------- /os-app/open-vitrine/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | KVCVitrine: '.KVCVitrine', 5 | 6 | KVCVitrineFeaturesHeading: '.KVCVitrineFeaturesHeading', 7 | 8 | KVCVitrineGuideButton: '.KVCVitrineGuideButton', 9 | 10 | KVCVitrineDeeperHeading: '.KVCVitrineDeeperHeading', 11 | KVCVitrineGlossary: '.KVCVitrineGlossary', 12 | KVCVitrineGlossaryWritingHeading: '.KVCVitrineGlossaryWritingHeading', 13 | KVCVitrineGlossaryWritingUsingLink: '.KVCVitrineGlossaryWritingUsingLink', 14 | KVCVitrineGlossaryWritingAnswerLink: '.KVCVitrineGlossaryWritingAnswerLink', 15 | KVCVitrineGlossaryWritingListsLink: '.KVCVitrineGlossaryWritingListsLink', 16 | KVCVitrineGlossaryWritingDiscussionLink: '.KVCVitrineGlossaryWritingDiscussionLink', 17 | KVCVitrineGlossaryWritingMagicLink: '.KVCVitrineGlossaryWritingMagicLink', 18 | KVCVitrineGlossaryPublicHeading: '.KVCVitrineGlossaryPublicHeading', 19 | KVCVitrineGlossaryPublicRefLink: '.KVCVitrineGlossaryPublicRefLink', 20 | KVCVitrineGlossaryPublicRefBlurb: '.KVCVitrineGlossaryPublicRefBlurb', 21 | KVCVitrineGlossaryPublicGardensLink: '.KVCVitrineGlossaryPublicGardensLink', 22 | KVCVitrineGlossaryPublicGardensBlurb: '.KVCVitrineGlossaryPublicGardensBlurb', 23 | KVCVitrineGlossaryPublicDigitalLink: '.KVCVitrineGlossaryPublicDigitalLink', 24 | KVCVitrineGlossaryPublicDigitalBlurb: '.KVCVitrineGlossaryPublicDigitalBlurb', 25 | KVCVitrineGlossaryCompareHeading: '.KVCVitrineGlossaryCompareHeading', 26 | KVCVitrineGlossaryCompareSimplenoteLink: '.KVCVitrineGlossaryCompareSimplenoteLink', 27 | 28 | KVCVitrineVideoHeading: '.KVCVitrineVideoHeading', 29 | KVCVitrineVideo1: '.OLSKCommonVideoList .OLSKCommonVideoListItem.KVCVitrineVideo1 iframe', 30 | KVCVitrineVideo2: '.OLSKCommonVideoList .OLSKCommonVideoListItem.KVCVitrineVideo2 iframe', 31 | 32 | KVCVitrineSupportHeading: '.KVCVitrineSupportHeading', 33 | KVCVitrineSupportBlurb: '.KVCVitrineSupportBlurb', 34 | }).map(function (e) { 35 | return global[e.shift()] = e.pop(); 36 | }); 37 | 38 | describe('KVCVitrine_Access', function () { 39 | 40 | before(function() { 41 | return browser.OLSKVisit(kDefaultRoute); 42 | }); 43 | 44 | it('shows KVCVitrine', function() { 45 | browser.assert.elements(KVCVitrine, 1); 46 | }); 47 | 48 | it('shows OLSKCrown', function() { 49 | browser.assert.elements('.OLSKCrown', 1); 50 | }); 51 | 52 | it('shows OLSKLanding', function() { 53 | browser.assert.elements('.OLSKLanding', 1); 54 | }); 55 | 56 | it('shows KVCVitrineFeaturesHeading', function () { 57 | browser.assert.elements(KVCVitrineFeaturesHeading, 1); 58 | }); 59 | 60 | it('shows KVCFeatureList', function () { 61 | browser.assert.elements('.KVCFeatureList', 1); 62 | }); 63 | 64 | it('shows OLSKAppFeatureList', function () { 65 | browser.assert.elements('.OLSKAppFeatureList', 1); 66 | }); 67 | 68 | it('shows OLSKAppFeatureOpenSource', function () { 69 | browser.assert.elements('.OLSKAppFeatureListItemOpenSource', 1); 70 | }); 71 | 72 | it('shows KVCVitrineGuideButton', function () { 73 | browser.assert.elements(KVCVitrineGuideButton, 1); 74 | }); 75 | 76 | it('shows KVCVitrineDeeperHeading', function () { 77 | browser.assert.elements(KVCVitrineDeeperHeading, 1); 78 | }); 79 | 80 | it('shows KVCVitrineGlossary', function () { 81 | browser.assert.elements(KVCVitrineGlossary, 1); 82 | }); 83 | 84 | it('shows KVCVitrineGlossaryWritingHeading', function () { 85 | browser.assert.elements(KVCVitrineGlossaryWritingHeading, 1); 86 | }); 87 | 88 | it('shows KVCVitrineGlossaryWritingUsingLink', function () { 89 | browser.assert.elements(KVCVitrineGlossaryWritingUsingLink, 1); 90 | }); 91 | 92 | it('shows KVCVitrineGlossaryWritingAnswerLink', function () { 93 | browser.assert.elements(KVCVitrineGlossaryWritingAnswerLink, 1); 94 | }); 95 | 96 | it('shows KVCVitrineGlossaryWritingListsLink', function () { 97 | browser.assert.elements(KVCVitrineGlossaryWritingListsLink, 1); 98 | }); 99 | 100 | it('shows KVCVitrineGlossaryWritingDiscussionLink', function () { 101 | browser.assert.elements(KVCVitrineGlossaryWritingDiscussionLink, 1); 102 | }); 103 | 104 | it('shows KVCVitrineGlossaryWritingMagicLink', function () { 105 | browser.assert.elements(KVCVitrineGlossaryWritingMagicLink, 1); 106 | }); 107 | 108 | it('shows KVCVitrineGlossaryPublicHeading', function () { 109 | browser.assert.elements(KVCVitrineGlossaryPublicHeading, 1); 110 | }); 111 | 112 | it('shows KVCVitrineGlossaryPublicRefLink', function () { 113 | browser.assert.elements(KVCVitrineGlossaryPublicRefLink, 1); 114 | }); 115 | 116 | it('shows KVCVitrineGlossaryPublicRefBlurb', function () { 117 | browser.assert.elements(KVCVitrineGlossaryPublicRefBlurb, 1); 118 | }); 119 | 120 | it('shows KVCVitrineGlossaryPublicGardensLink', function () { 121 | browser.assert.elements(KVCVitrineGlossaryPublicGardensLink, 1); 122 | }); 123 | 124 | it('shows KVCVitrineGlossaryPublicGardensBlurb', function () { 125 | browser.assert.elements(KVCVitrineGlossaryPublicGardensBlurb, 1); 126 | }); 127 | 128 | it('shows KVCVitrineGlossaryPublicDigitalLink', function () { 129 | browser.assert.elements(KVCVitrineGlossaryPublicDigitalLink, 1); 130 | }); 131 | 132 | it('shows KVCVitrineGlossaryPublicDigitalBlurb', function () { 133 | browser.assert.elements(KVCVitrineGlossaryPublicDigitalBlurb, 1); 134 | }); 135 | 136 | it('shows KVCVitrineGlossaryCompareSimplenoteLink', function () { 137 | browser.assert.elements(KVCVitrineGlossaryCompareSimplenoteLink, 1); 138 | }); 139 | 140 | it('shows ROCOGlossary', function () { 141 | browser.assert.elements('.ROCOGlossary', 1); 142 | }); 143 | 144 | it('shows ROCOGlossaryHeading', function () { 145 | browser.assert.elements('.ROCOGlossaryHeading', 1); 146 | }); 147 | 148 | it('shows KVCVitrineVideoHeading', function () { 149 | browser.assert.elements(KVCVitrineVideoHeading, 1); 150 | }); 151 | 152 | it('shows KVCVitrineVideo1', function () { 153 | browser.assert.elements(KVCVitrineVideo1, 1); 154 | }); 155 | 156 | it('shows KVCVitrineVideo2', function () { 157 | browser.assert.elements(KVCVitrineVideo2, 1); 158 | }); 159 | 160 | it('shows ROCOGazette', function () { 161 | browser.assert.elements('.ROCOGazette', 1); 162 | }); 163 | 164 | it('shows OLSKEdit', function () { 165 | browser.assert.elements('.OLSKEdit', 1); 166 | }); 167 | 168 | it('shows KVCVitrineSupportHeading', function () { 169 | browser.assert.elements(KVCVitrineSupportHeading, 1); 170 | }); 171 | 172 | it('shows KVCVitrineSupportBlurb', function () { 173 | browser.assert.elements(KVCVitrineSupportBlurb, 1); 174 | }); 175 | 176 | it('shows SWARLink', function() { 177 | browser.assert.elements('.SWARLink', 1); 178 | }); 179 | 180 | it('shows ROCORootLink', function() { 181 | browser.assert.elements('.ROCORootLink', 1); 182 | }); 183 | 184 | }); 185 | -------------------------------------------------------------------------------- /os-app/open-vitrine/ui-test-_localize.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | kDefaultRoute.OLSKRouteLanguageCodes.forEach(function (OLSKRoutingLanguage) { 4 | 5 | const uLocalized = function (inputData) { 6 | return OLSKTestingLocalized(inputData, OLSKRoutingLanguage); 7 | }; 8 | 9 | describe('KVCVitrine_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | }); 15 | }); 16 | 17 | it('localizes title', function() { 18 | browser.assert.text('title', uLocalized('KVCVitrineTitle')); 19 | }); 20 | 21 | it('localizes meta[description]', function() { 22 | browser.assert.attribute('meta[name=description]', 'content', uLocalized('KVCVitrineDescription')); 23 | }); 24 | 25 | it('localizes KVCVitrineFeaturesHeading', function () { 26 | browser.assert.text(KVCVitrineFeaturesHeading, uLocalized('OLSKWordingFeatures')); 27 | }); 28 | 29 | it('localizes KVCVitrineGuideButton', function () { 30 | browser.assert.text(KVCVitrineGuideButton, uLocalized('OLSKWordingOpenGuide')); 31 | }); 32 | 33 | it('localizes KVCVitrineDeeperHeading', function () { 34 | browser.assert.text(KVCVitrineDeeperHeading, uLocalized('OLSKWordingDeeperHeading')); 35 | }); 36 | 37 | it('localizes KVCVitrineGlossaryWritingHeading', function () { 38 | browser.assert.text(KVCVitrineGlossaryWritingHeading, uLocalized('KVCVitrineGlossaryWritingHeadingText')); 39 | }); 40 | 41 | it('localizes KVCVitrineGlossaryWritingUsingLink', function () { 42 | browser.assert.text(KVCVitrineGlossaryWritingUsingLink, uLocalized('KVCVitrineGlossaryWritingUsingLinkText')); 43 | }); 44 | 45 | it('localizes KVCVitrineGlossaryWritingAnswerLink', function () { 46 | browser.assert.text(KVCVitrineGlossaryWritingAnswerLink, uLocalized('KVCVitrineGlossaryWritingAnswerLinkText')); 47 | }); 48 | 49 | it('localizes KVCVitrineGlossaryWritingListsLink', function () { 50 | browser.assert.text(KVCVitrineGlossaryWritingListsLink, uLocalized('KVCVitrineGlossaryWritingListsLinkText')); 51 | }); 52 | 53 | it('localizes KVCVitrineGlossaryWritingDiscussionLink', function () { 54 | browser.assert.text(KVCVitrineGlossaryWritingDiscussionLink, uLocalized('KVCVitrineGlossaryWritingDiscussionLinkText')); 55 | }); 56 | 57 | it('localizes KVCVitrineGlossaryWritingMagicLink', function () { 58 | browser.assert.text(KVCVitrineGlossaryWritingMagicLink, uLocalized('KVCVitrineGlossaryWritingMagicLinkText')); 59 | }); 60 | 61 | it('localizes KVCVitrineGlossaryPublicHeading', function () { 62 | browser.assert.text(KVCVitrineGlossaryPublicHeading, uLocalized('KVCVitrineGlossaryPublicHeadingText')); 63 | }); 64 | 65 | it('localizes KVCVitrineGlossaryPublicRefLink', function () { 66 | browser.assert.text(KVCVitrineGlossaryPublicRefLink, uLocalized('KVCVitrineGlossaryPublicRefLinkText')); 67 | }); 68 | 69 | it('localizes KVCVitrineGlossaryPublicRefBlurb', function () { 70 | browser.assert.text(KVCVitrineGlossaryPublicRefBlurb, uLocalized('KVCVitrineGlossaryPublicRefBlurbText')); 71 | }); 72 | 73 | it('localizes KVCVitrineGlossaryPublicGardensLink', function () { 74 | browser.assert.text(KVCVitrineGlossaryPublicGardensLink, uLocalized('KVCVitrineGlossaryPublicGardensLinkText')); 75 | }); 76 | 77 | it('localizes KVCVitrineGlossaryPublicGardensBlurb', function () { 78 | browser.assert.text(KVCVitrineGlossaryPublicGardensBlurb, uLocalized('KVCVitrineGlossaryPublicGardensBlurbText')); 79 | }); 80 | 81 | it('localizes KVCVitrineGlossaryPublicDigitalLink', function () { 82 | browser.assert.text(KVCVitrineGlossaryPublicDigitalLink, uLocalized('KVCVitrineGlossaryPublicDigitalLinkText')); 83 | }); 84 | 85 | it('localizes KVCVitrineGlossaryPublicDigitalBlurb', function () { 86 | browser.assert.text(KVCVitrineGlossaryPublicDigitalBlurb, uLocalized('KVCVitrineGlossaryPublicDigitalBlurbText')); 87 | }); 88 | 89 | it('localizes KVCVitrineGlossaryCompareHeading', function () { 90 | browser.assert.text(KVCVitrineGlossaryCompareHeading, uLocalized('KVCVitrineGlossaryCompareHeadingText')); 91 | }); 92 | 93 | it('localizes KVCVitrineGlossaryCompareSimplenoteLink', function () { 94 | browser.assert.text(KVCVitrineGlossaryCompareSimplenoteLink, uLocalized('KVCVitrineGlossaryCompareSimplenoteLinkText')); 95 | }); 96 | 97 | it('localizes KVCVitrineVideoHeading', function () { 98 | browser.assert.text(KVCVitrineVideoHeading, uLocalized('OLSKWordingVideo')); 99 | }); 100 | 101 | it('localizes KVCVitrineSupportHeading', function () { 102 | browser.assert.text(KVCVitrineSupportHeading, uLocalized('OLSKWordingFeedbackHeading')); 103 | }); 104 | 105 | it('localizes KVCVitrineSupportBlurb', function () { 106 | browser.assert.text(KVCVitrineSupportBlurb, uLocalized('OLSKWordingFeedbackBlurb')); 107 | }); 108 | 109 | context('OLSKCrown', function test_OLSKCrown () { 110 | 111 | it('localizes OLSKCrownCardName', function () { 112 | browser.assert.text('.OLSKCrownCardName', uLocalized('KVCVitrineTitle')); 113 | }); 114 | 115 | }); 116 | 117 | context('OLSKLanding', function test_OLSKLanding () { 118 | 119 | it('localizes OLSKLandingHeadingText', function () { 120 | browser.assert.text('.OLSKLandingHeading', uLocalized('KVCVitrineDescription')); 121 | }); 122 | 123 | it('localizes OLSKLandingBlurbText', function () { 124 | browser.assert.text('.OLSKLandingBlurb', uLocalized('OLSKLandingBlurbText')); 125 | }); 126 | 127 | it('localizes OLSKLandingActionText', function () { 128 | browser.assert.text('.OLSKLandingAction', uLocalized('OLSKWordingOpenApp')); 129 | }); 130 | 131 | it('localizes OLSKLandingActionHref', function () { 132 | browser.assert.attribute('.OLSKLandingAction', 'href', OLSKTestingCanonical(require('../open-write/controller.js').OLSKControllerRoutes().shift(), { 133 | OLSKRoutingLanguage, 134 | })); 135 | }); 136 | 137 | }); 138 | 139 | context('KVCVitrineGlossaryCompareSimplenoteLink', function test_KVCVitrineGlossaryCompareSimplenoteLink () { 140 | 141 | it('localizes href', function () { 142 | browser.assert.attribute(KVCVitrineGlossaryCompareSimplenoteLink, 'href', OLSKTestingCanonical(require('../open-compare-simplenote/controller.js').OLSKControllerRoutes().shift(), { 143 | })); 144 | }); 145 | 146 | }); 147 | 148 | }); 149 | 150 | }); 151 | -------------------------------------------------------------------------------- /os-app/open-vitrine/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('KVCVitrine_Misc', function () { 4 | 5 | before(function () { 6 | return browser.visit(kDefaultRoute.OLSKRoutePath); 7 | }); 8 | 9 | it('sets manifest', function () { 10 | browser.assert.attribute('link[rel="manifest"]', 'href', require('../tech-manifest/controller.js').OLSKControllerRoutes().shift().OLSKRoutePath); 11 | }); 12 | 13 | describe('KVCVitrine', function () { 14 | 15 | it('classes OLSKDecor', function () { 16 | browser.assert.hasClass(KVCVitrine, 'OLSKDecor'); 17 | }); 18 | 19 | it('classes OLSKDecorCapped', function () { 20 | browser.assert.hasClass(KVCVitrine, 'OLSKDecorCapped'); 21 | }); 22 | 23 | it('classes OLSKDecorNoTopPad', function () { 24 | browser.assert.hasClass(KVCVitrine, 'OLSKDecorNoTopPad'); 25 | }); 26 | 27 | }); 28 | 29 | describe('OLSKCrown', function test_OLSKCrown () { 30 | 31 | it('sets OLSKCrownCardImageURL', function () { 32 | browser.assert.attribute('.OLSKCrownCardImage', 'src', '/_shared/KVCRootLink/ui-assets/identity.svg'); 33 | }); 34 | 35 | }); 36 | 37 | context('OLSKAppFeaturesList', function test_OLSKAppFeaturesList () { 38 | 39 | it('shows OLSKAppFeatureOpenSource', function () { 40 | browser.assert.attribute('.OLSKAppFeatureListItemOpenSource a', 'href', process.env.OLSK_REPO_URL); 41 | }); 42 | 43 | }); 44 | 45 | context('KVCVitrineGuideButton', function test_KVCVitrineGuideButton () { 46 | 47 | it('classes OLSKDecorPress', function () { 48 | browser.assert.hasClass(KVCVitrineGuideButton, 'OLSKDecorPress'); 49 | }); 50 | 51 | it('classes OLSKDecorPressCall', function () { 52 | browser.assert.hasClass(KVCVitrineGuideButton, 'OLSKDecorPressCall'); 53 | }); 54 | 55 | it('sets href', function () { 56 | browser.assert.attribute(KVCVitrineGuideButton, 'href', OLSKTestingCanonical(require('../open-guide/controller.js').OLSKControllerRoutes().shift())); 57 | }); 58 | 59 | }); 60 | 61 | describe('KVCVitrineGlossary', function test_KVCVitrineGlossary () { 62 | 63 | it('classes OLSKDecorGlossary', function () { 64 | browser.assert.hasClass(KVCVitrineGlossary, 'OLSKDecorGlossary'); 65 | }); 66 | 67 | }); 68 | 69 | describe('KVCVitrineGlossaryWritingUsingLink', function test_KVCVitrineGlossaryWritingUsingLink () { 70 | 71 | it('sets href', function () { 72 | browser.assert.attribute(KVCVitrineGlossaryWritingUsingLink, 'href', process.env.KVC_VITRINE_GLOSSARY_WRITING_USING_URL); 73 | }); 74 | 75 | }); 76 | 77 | describe('KVCVitrineGlossaryWritingAnswerLink', function test_KVCVitrineGlossaryWritingAnswerLink () { 78 | 79 | it('sets href', function () { 80 | browser.assert.attribute(KVCVitrineGlossaryWritingAnswerLink, 'href', process.env.KVC_VITRINE_GLOSSARY_WRITING_ANSWER_URL); 81 | }); 82 | 83 | }); 84 | 85 | describe('KVCVitrineGlossaryWritingListsLink', function test_KVCVitrineGlossaryWritingListsLink () { 86 | 87 | it('sets href', function () { 88 | browser.assert.attribute(KVCVitrineGlossaryWritingListsLink, 'href', process.env.KVC_VITRINE_GLOSSARY_WRITING_LISTS_URL); 89 | }); 90 | 91 | }); 92 | 93 | describe('KVCVitrineGlossaryWritingDiscussionLink', function test_KVCVitrineGlossaryWritingDiscussionLink () { 94 | 95 | it('sets href', function () { 96 | browser.assert.attribute(KVCVitrineGlossaryWritingDiscussionLink, 'href', process.env.KVC_VITRINE_GLOSSARY_WRITING_DISCUSSION_URL); 97 | }); 98 | 99 | }); 100 | 101 | describe('KVCVitrineGlossaryWritingMagicLink', function test_KVCVitrineGlossaryWritingMagicLink () { 102 | 103 | it('sets href', function () { 104 | browser.assert.attribute(KVCVitrineGlossaryWritingMagicLink, 'href', process.env.KVC_VITRINE_GLOSSARY_WRITING_MAGIC_URL); 105 | }); 106 | 107 | }); 108 | 109 | describe('KVCVitrineGlossaryPublicRefLink', function test_KVCVitrineGlossaryPublicRefLink () { 110 | 111 | it('sets href', function () { 112 | browser.assert.attribute(KVCVitrineGlossaryPublicRefLink, 'href', process.env.KVC_VITRINE_GLOSSARY_PUBLIC_REF_URL); 113 | }); 114 | 115 | }); 116 | 117 | describe('KVCVitrineGlossaryPublicGardensLink', function test_KVCVitrineGlossaryPublicGardensLink () { 118 | 119 | it('sets href', function () { 120 | browser.assert.attribute(KVCVitrineGlossaryPublicGardensLink, 'href', process.env.KVC_VITRINE_GLOSSARY_PUBLIC_GARDENS_URL); 121 | }); 122 | 123 | }); 124 | 125 | describe('KVCVitrineGlossaryPublicDigitalLink', function test_KVCVitrineGlossaryPublicDigitalLink () { 126 | 127 | it('sets href', function () { 128 | browser.assert.attribute(KVCVitrineGlossaryPublicDigitalLink, 'href', process.env.KVC_VITRINE_GLOSSARY_PUBLIC_DIGITAL_URL); 129 | }); 130 | 131 | }); 132 | 133 | describe('KVCVitrineVideo1', function test_KVCVitrineVideo () { 134 | 135 | it('classes OLSKCommonVideoListItemMobile', function () { 136 | browser.assert.hasClass('.KVCVitrineVideo1', 'OLSKCommonVideoListItemMobile'); 137 | }); 138 | 139 | it('sets src', function () { 140 | browser.assert.attribute(KVCVitrineVideo1, 'src', process.env.KVC_VITRINE_VIDEO_URL_1); 141 | }); 142 | 143 | it('sets allow', function () { 144 | browser.assert.attribute(KVCVitrineVideo1, 'allow', 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture'); 145 | }); 146 | 147 | it('sets allowfullscreen', function () { 148 | browser.assert.attribute(KVCVitrineVideo1, 'allowfullscreen', ''); 149 | }); 150 | 151 | }); 152 | 153 | describe('KVCVitrineVideo2', function test_KVCVitrineVideo () { 154 | 155 | it('sets src', function () { 156 | browser.assert.attribute(KVCVitrineVideo2, 'src', process.env.KVC_VITRINE_VIDEO_URL_2); 157 | }); 158 | 159 | it('sets allow', function () { 160 | browser.assert.attribute(KVCVitrineVideo1, 'allow', 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture'); 161 | }); 162 | 163 | it('sets allowfullscreen', function () { 164 | browser.assert.attribute(KVCVitrineVideo1, 'allowfullscreen', ''); 165 | }); 166 | 167 | }); 168 | 169 | describe('ROCOGazette', function test_ROCOGazette () { 170 | 171 | it('sets ROCOBulletinProject', function () { 172 | browser.assert.attribute('.ROCOBulletinProjectField', 'value', 'Hyperdraft'); 173 | }); 174 | 175 | }); 176 | 177 | describe('OLSKEdit', function test_OLSKEdit () { 178 | 179 | it('sets OLSKEditURL', function () { 180 | browser.assert.attribute('.OLSKEdit', 'href', process.env.OLSK_REPO_URL); 181 | }); 182 | 183 | }); 184 | 185 | }); 186 | -------------------------------------------------------------------------------- /os-app/open-vitrine/ui-view.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | locals.OLSKPageTitle = OLSKLocalized('KVCVitrineTitle'); 3 | locals.OLSKPageDescription = OLSKLocalized('KVCVitrineDescription'); 4 | locals.OLSKPageManifest = OLSKCanonical('WKCManifestRoute'); 5 | locals.OLSKPageAssets = [ 6 | '/_shared/__external/normalize.css/normalize.css', 7 | '/_shared/__external/OLSKDecor/ui-style.css', 8 | '/_shared/common/ui-style.css', 9 | 'ui-style.css', 10 | ]; 11 | %> 12 | 13 |
14 | 15 | <%- include('../../node_modules/OLSKCrown/main.ejs', { 16 | OLSKCrownCardImageURL: '/_shared/KVCRootLink/ui-assets/identity.svg', 17 | OLSKCrownCardNameText: OLSKLocalized('KVCVitrineTitle'), 18 | }) %> 19 | 20 | <%- include('../../node_modules/OLSKLanding/main.ejs', { 21 | OLSKLandingHeadingText: OLSKLocalized('KVCVitrineDescription'), 22 | OLSKLandingBlurbText: OLSKLocalized('OLSKLandingBlurbText'), 23 | OLSKLandingActionText: OLSKLocalized('OLSKWordingOpenApp'), 24 | OLSKLandingActionHref: OLSKCanonicalLocalized('KVCWriteRoute'), 25 | }) %> 26 | 27 |

<%= OLSKLocalized('OLSKWordingFeatures') %>

28 | 29 | <%- include('./submodules/KVCFeatureList/main.ejs') %> 30 | 31 | <%- include('../../node_modules/OLSKAppFeatureList/main.ejs', { 32 | OLSKAppFeatureListRepoURL: process.env.OLSK_REPO_URL, 33 | }).replace(/node_modules/g, '_shared/__external') %> 34 | 35 | <%= OLSKLocalized('OLSKWordingOpenGuide') %> 36 | 37 |

<%= OLSKLocalized('OLSKWordingDeeperHeading') %>

38 | 39 |
40 |

41 | 42 |

43 |
44 | 45 |
46 |

<%= OLSKLocalized('KVCVitrineGlossaryWritingHeadingText') %>

47 | 48 | 65 | 66 |

<%= OLSKLocalized('KVCVitrineGlossaryPublicHeadingText') %>

67 | 68 |
<%= OLSKLocalized('KVCVitrineGlossaryPublicRefLinkText') %>
69 |
<%= OLSKLocalized('KVCVitrineGlossaryPublicRefBlurbText') %>
70 | 71 |
<%= OLSKLocalized('KVCVitrineGlossaryPublicGardensLinkText') %>
72 |
<%= OLSKLocalized('KVCVitrineGlossaryPublicGardensBlurbText') %>
73 | 74 |
<%= OLSKLocalized('KVCVitrineGlossaryPublicDigitalLinkText') %>
75 |
<%= OLSKLocalized('KVCVitrineGlossaryPublicDigitalBlurbText') %>
76 | 77 |

<%= OLSKLocalized('KVCVitrineGlossaryCompareHeadingText') %>

78 | 79 | 84 | 85 | <%- include('../../node_modules/ROCOGlossary/main.ejs', { 86 | ROCOGlossaryHeadingEnabled: true 87 | }) %> 88 |
89 | 90 |

<%= OLSKLocalized('OLSKWordingVideo') %>

91 | 92 |
93 |

94 | 95 |

96 | 97 |

98 | 99 |

100 |
101 | 102 | <%- include('../../node_modules/ROCOGazette/main.ejs', { 103 | _OLSKModulesDirPrefix: '../.', 104 | ROCOBulletinProject: 'Hyperdraft', 105 | }) %> 106 | 107 | 108 | 109 |
110 | 117 | 118 | <%- include('../../node_modules/OLSKEdit/main.ejs', { 119 | OLSKEditURL: process.env.OLSK_REPO_URL, 120 | }) %> 121 | 122 |

<%= OLSKLocalized('OLSKWordingFeedbackHeading') %>

123 |

<%= OLSKLocalized('OLSKWordingFeedbackBlurb') %>

124 | 125 |
126 | 127 | <%- include('../../node_modules/SWARLink/main.ejs') %> 128 | 129 |
130 | 131 | <%- include('../_shared/__external/ROCORootLink/main.ejs') %> 132 | 133 |
134 | -------------------------------------------------------------------------------- /os-app/open-write/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/write', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'KVCWriteRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'ui-view.ejs')); 8 | }, 9 | OLSKRouteLanguageCodes: ['en', 'fr', 'es', 'pt'], 10 | _OLSKRouteSkipLanguageRedirect: true, 11 | }, { 12 | OLSKRoutePath: '/panel/write', 13 | OLSKRouteMethod: 'get', 14 | OLSKRouteSignature: 'KVCWriteLegacyRoute', 15 | OLSKRouteRedirect: '/write', 16 | }]; 17 | }; 18 | -------------------------------------------------------------------------------- /os-app/open-write/i18n-en.yml: -------------------------------------------------------------------------------- 1 | KVCWriteTitle: Write 2 | KVCWriteFilterFieldText: Filter or create 3 | KVCWriteCreateButtonText: Create 4 | KVCWriteEmptyNoteText: Blank note 5 | KVCWriteUntitledNoteText: Untitled note 6 | KVCWriteRevealArchiveButtonText: Reveal archive 7 | KVCWriteLauncherItemImportTXTText: Import TXT (beta) 8 | KVCWriteLauncherItemImportNVText: Import Notational Velocity (beta) 9 | KVCWriteLauncherItemExportZIPText: Export ZIP (beta) 10 | KVCWriteLauncherItemJournalText: Journal 11 | KVCWriteLauncherItemBacklinksText: Backlinks 12 | KVCWriteVersionsWord: versions 13 | KVCWriteLauncherItemShowPublicNotesText: Show public notes 14 | KVCWriteLauncherItemPublishAllText: Publish all previously published notes 15 | KVCWriteLauncherItemRetractAllText: Retract all public notes 16 | KVCWriteLauncherItemConfigureCustomDomainText: Configure custom domain name 17 | KVCWriteLauncherItemConfigureCustomDomainPrompt1QuestionText: Copy the following root URL and paste it in your host configuration. 18 | KVCWriteLauncherItemConfigureCustomDomainPrompt2QuestionText: What is your custom domain name? 19 | KVCWriteLauncherItemConfigureCustomDomainConfirmQuestionText: The domain name does not seem to be present. Would you like to try again? 20 | KVCWriteLauncherItemRemoveCustomDomainText: Remove custom domain name 21 | KVCWriteLauncherItemConfigureCustomTemplateText: Configure custom template 22 | KVCWriteTemplateModalTitleText: Custom template 23 | KVCWriteLauncherItemRemoveCustomTemplateText: Remove custom template 24 | -------------------------------------------------------------------------------- /os-app/open-write/i18n-es.yml: -------------------------------------------------------------------------------- 1 | KVCWriteTitle: Escribir 2 | KVCWriteFilterFieldText: Filtrar o crear 3 | KVCWriteCreateButtonText: Crear 4 | KVCWriteEmptyNoteText: Nota en blanco 5 | KVCWriteUntitledNoteText: Nota sin título 6 | KVCWriteRevealArchiveButtonText: Mostrar archivo 7 | KVCWriteLauncherItemImportTXTText: Importar TXT (beta) 8 | KVCWriteLauncherItemImportNVText: Importar Notational Velocity (beta) 9 | KVCWriteLauncherItemExportZIPText: Exportar ZIP (beta) 10 | KVCWriteLauncherItemJournalText: Diario 11 | KVCWriteLauncherItemBacklinksText: Backlinks 12 | KVCWriteVersionsWord: versiones 13 | KVCWriteLauncherItemShowPublicNotesText: Mostrar notas públicas 14 | KVCWriteLauncherItemPublishAllText: Publicar todas las notas anteriormente publicadas 15 | KVCWriteLauncherItemRetractAllText: Retractarse todas las notas publicadas 16 | KVCWriteLauncherItemConfigureCustomDomainText: Configurar dominio de Internet de encargo 17 | KVCWriteLauncherItemConfigureCustomDomainPrompt1QuestionText: 'Por favor, copia el texto siguiente y pegalo en tu host configuration.' 18 | KVCWriteLauncherItemConfigureCustomDomainPrompt2QuestionText: ¿Qué es tu dominio de Internet de encargo? 19 | KVCWriteLauncherItemConfigureCustomDomainConfirmQuestionText: El dominio de Internet no parece estar presente. ¿Te gustaría intentar de nuevo? 20 | KVCWriteLauncherItemRemoveCustomDomainText: Quitar dominio de Internet de encargo 21 | KVCWriteLauncherItemConfigureCustomTemplateText: Configurar plantilla personalizada 22 | KVCWriteTemplateModalTitleText: Plantilla personalizada 23 | KVCWriteLauncherItemRemoveCustomTemplateText: Eliminar plantilla personalizada 24 | -------------------------------------------------------------------------------- /os-app/open-write/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | KVCWriteTitle: Écrire 2 | KVCWriteFilterFieldText: Filtrer or créer 3 | KVCWriteCreateButtonText: Créer 4 | KVCWriteEmptyNoteText: Note blanche 5 | KVCWriteUntitledNoteText: Nota sans titre 6 | KVCWriteRevealArchiveButtonText: Montrer archive 7 | KVCWriteLauncherItemImportTXTText: Importer TXT (béta) 8 | KVCWriteLauncherItemImportNVText: Importer Notational Velocity (béta) 9 | KVCWriteLauncherItemExportZIPText: Exporter ZIP (béta) 10 | KVCWriteLauncherItemJournalText: Journal 11 | KVCWriteLauncherItemBacklinksText: Liens retours 12 | KVCWriteVersionsWord: versions 13 | KVCWriteLauncherItemShowPublicNotesText: Montrere les notes publiques 14 | KVCWriteLauncherItemPublishAllText: Publiquer toutes les notes antérieurement publiquées 15 | KVCWriteLauncherItemRetractAllText: Retracter toutes les notes publiquées 16 | KVCWriteLauncherItemConfigureCustomDomainText: Configurer nom de domaine personalisé 17 | KVCWriteLauncherItemConfigureCustomDomainPrompt1QuestionText: Veuillez copier le texte suivant et le coller dedans votre host configuration. 18 | KVCWriteLauncherItemConfigureCustomDomainPrompt2QuestionText: Quel est votre nom de domaine personalisé ? 19 | KVCWriteLauncherItemConfigureCustomDomainConfirmQuestionText: Le nom de domaine ne semble pas d'être présent. Souhaitez-vous essayer de nouveau ? 20 | KVCWriteLauncherItemRemoveCustomDomainText: Enlever nom de domaine personalisé 21 | KVCWriteLauncherItemConfigureCustomTemplateText: Configurer gabarit personalisé 22 | KVCWriteTemplateModalTitleText: Gabarit personalisé 23 | KVCWriteLauncherItemRemoveCustomTemplateText: Eliminer gabarit personalisé 24 | -------------------------------------------------------------------------------- /os-app/open-write/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | KVCWriteTitle: Escrever 2 | KVCWriteFilterFieldText: Filtrar ou criar 3 | KVCWriteCreateButtonText: Criar 4 | KVCWriteEmptyNoteText: Nota em branco 5 | KVCWriteUntitledNoteText: Nota sem título 6 | KVCWriteRevealArchiveButtonText: Revelar o arquivo 7 | KVCWriteLauncherItemImportTXTText: Importar TXT (beta) 8 | KVCWriteLauncherItemImportNVText: Importar Notational Velocity (beta) 9 | KVCWriteLauncherItemExportZIPText: Exportar ZIP (beta) 10 | KVCWriteLauncherItemJournalText: Diário 11 | KVCWriteLauncherItemBacklinksText: Backlinks 12 | KVCWriteVersionsWord: versions 13 | KVCWriteLauncherItemShowPublicNotesText: Mostrar notas públicas 14 | KVCWriteLauncherItemPublishAllText: Publicar todas as notas anteriormente publicadas 15 | KVCWriteLauncherItemRetractAllText: Retirar todas as notas publicadas 16 | KVCWriteLauncherItemConfigureCustomDomainText: Configurar o nome de domínio personalizado 17 | KVCWriteLauncherItemConfigureCustomDomainPrompt1QuestionText: Copie a seguinte URL do raiz e cole-a na configuração do seu host. 18 | KVCWriteLauncherItemConfigureCustomDomainPrompt2QuestionText: Qual é seu nome de domínio? 19 | KVCWriteLauncherItemConfigureCustomDomainConfirmQuestionText: O nome de domínio não parece estar presente. Você gostaria de tentar novamente? 20 | KVCWriteLauncherItemRemoveCustomDomainText: Eliminar o nome de domínio personalizado 21 | KVCWriteLauncherItemConfigureCustomTemplateText: Configurar template personalizado 22 | KVCWriteTemplateModalTitleText: Template personalizado 23 | KVCWriteLauncherItemRemoveCustomTemplateText: Eliminar template personalizado 24 | -------------------------------------------------------------------------------- /os-app/open-write/rollup-start.js: -------------------------------------------------------------------------------- 1 | import RollupStart from './main.svelte'; 2 | 3 | const KVCWrite = new RollupStart({ 4 | target: document.body, 5 | }); 6 | 7 | export default KVCWrite; 8 | -------------------------------------------------------------------------------- /os-app/open-write/ui-editor-theme.css: -------------------------------------------------------------------------------- 1 | .cm-s-wkc .cm-header { 2 | font-weight: normal; 3 | } 4 | 5 | .cm-s-wkc .cm-em { 6 | font-style: normal; 7 | } 8 | 9 | .cm-s-wkc .cm-strong { 10 | font-weight: normal; 11 | } 12 | -------------------------------------------------------------------------------- /os-app/open-write/ui-style.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --OLSKDecorBackgroundDeep: #eee; 3 | --OLSKDecorBackgroundDeepEdge: var(--OLSKDecorForegroundLight); 4 | } 5 | 6 | :global(body) { 7 | font-family: 'Helvetica Neue', 'Helvetica', sans-serif; 8 | font-size: 9pt; 9 | 10 | color: var(--KVCCommonForeground); 11 | } 12 | 13 | .OLSKNarrowBodyTail { 14 | padding: 10px; 15 | 16 | /* @OLSKNarrowBodyTailFlexbox:Parent */ 17 | display: flex; 18 | flex-direction: column; 19 | align-items: center; 20 | } 21 | 22 | .KVCWriteDetailContainer { 23 | display: flex; 24 | height: 100%; 25 | } 26 | 27 | .KVCWriteCloudToolbar { 28 | /* AppContainerFlexbox:Child */ 29 | flex-shrink: 0; 30 | } 31 | 32 | @media screen and (max-width: 760px) { 33 | 34 | .KVCWriteViewportFooter { 35 | /* browser quirks */ 36 | z-index: 999; 37 | } 38 | 39 | } 40 | 41 | :global(.OLSKIsDemoing .CodeMirror-cursors) { 42 | opacity: 0; 43 | } 44 | 45 | :global(.OLSKBanner) { 46 | display: none; 47 | } 48 | -------------------------------------------------------------------------------- /os-app/open-write/ui-test-catalog.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('KVCWrite_Catalog', function () { 4 | 5 | before(function() { 6 | return browser.OLSKVisit(kDefaultRoute); 7 | }); 8 | 9 | context('create', function test_create () { 10 | 11 | before(function () { 12 | return browser.pressButton('.KVCWriteCreateButton'); 13 | }); 14 | 15 | it('adds item', function () { 16 | browser.assert.elements('.KVCWriteListItem', 1); 17 | }); 18 | 19 | }); 20 | 21 | context('OLSKCollectionDispatchClick', function test_OLSKCollectionDispatchClick () { 22 | 23 | before(function () { 24 | return browser.OLSKFireKeyboardEvent(browser.window, 'Escape'); 25 | }); 26 | 27 | before(function () { 28 | browser.assert.elements('.KVCWriteDetail', 0); 29 | }); 30 | 31 | before(function () { 32 | return browser.click('.KVCWriteListItem'); 33 | }); 34 | 35 | it('selects item', function () { 36 | browser.assert.elements('.KVCWriteDetail', 1); 37 | }); 38 | 39 | }); 40 | 41 | context('back', function test_back () { 42 | 43 | before(function () { 44 | return browser.pressButton('.KVCWriteDetailToolbarBackButton'); 45 | }); 46 | 47 | it('sets focus', function () { 48 | browser.assert.hasClass('.OLSKCatalogDetail', 'OLSKMobileViewInactive'); 49 | }); 50 | 51 | }); 52 | 53 | context('discard', function test_discard () { 54 | 55 | context('cancel', function () { 56 | 57 | before(async function () { 58 | return browser.OLSKConfirm(function () { 59 | browser.pressButton('.KVCWriteDetailToolbarDiscardButton'); 60 | }, function (dialog) { 61 | dialog.response = false; 62 | 63 | return dialog; 64 | }); 65 | }); 66 | 67 | it('does nothing', function () { 68 | browser.assert.elements('.KVCWriteDetail', 1); 69 | }); 70 | 71 | }); 72 | 73 | context('confirm', function () { 74 | 75 | before(async function () { 76 | return browser.OLSKConfirm(function () { 77 | return browser.pressButton('.KVCWriteDetailToolbarDiscardButton'); 78 | }); 79 | }); 80 | 81 | it('removes item', function () { 82 | browser.assert.elements('.KVCWriteListItem', 0); 83 | }); 84 | 85 | }); 86 | 87 | }); 88 | 89 | context('OLSKCollectionDispatchArrow', function test_OLSKCollectionDispatchArrow () { 90 | 91 | before(function () { 92 | return browser.pressButton('.KVCWriteCreateButton'); 93 | }); 94 | 95 | before(function () { 96 | return browser.pressButton('.KVCWriteCreateButton'); 97 | }); 98 | 99 | before(function () { 100 | return browser.focus('.OLSKNarrowFilterField'); 101 | }); 102 | 103 | before(function () { 104 | return browser.OLSKFireKeyboardEvent(browser.window, 'ArrowDown'); 105 | }); 106 | 107 | it('binds OLSKCollectionItemsLocus', function () { 108 | browser.assert.hasClass('.OLSKCollectionItem:nth-child(2)', 'OLSKCollectionItemLocus'); 109 | }); 110 | 111 | }); 112 | 113 | context('OLSKCatalogDispatchFilterSubmit', function test_OLSKCatalogDispatchFilterSubmit () { 114 | 115 | const item = Math.random().toString(); 116 | 117 | before(function () { 118 | return browser.fill('.OLSKNarrowFilterField', item); 119 | }); 120 | 121 | before(function () { 122 | return browser.fire('.OLSKNarrowForm', 'submit'); 123 | }); 124 | 125 | it('creates item', function () { 126 | browser.assert.text('.OLSKCollectionItem:nth-child(1)', item) 127 | }); 128 | 129 | }); 130 | 131 | }); 132 | -------------------------------------------------------------------------------- /os-app/open-write/ui-test-cloud.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | const uLocalized = function (inputData) { 4 | return OLSKTestingLocalized(inputData, 'en'); 5 | }; 6 | 7 | describe('KVCWrite_Cloud', function () { 8 | 9 | describe('OLSKAppToolbar', function test_OLSKAppToolbar() { 10 | 11 | before(function () { 12 | return browser.OLSKVisit(kDefaultRoute); 13 | }); 14 | 15 | before(function () { 16 | return browser.OLSKLauncherRun('ZDRLauncherItemFakeDispatchConnected'); 17 | }); 18 | 19 | before(function () { 20 | return browser.OLSKLauncherRun('ZDRLauncherItemFakeDispatchOnline'); 21 | }); 22 | 23 | it('sets OLSKAppToolbarCloudOffline', function () { 24 | browser.assert.text('.OLSKAppToolbarCloudStatus', uLocalized('OLSKAppToolbarCloudStatusOnline')); 25 | }); 26 | 27 | context('offline', function () { 28 | 29 | before(function () { 30 | return browser.OLSKLauncherRun('ZDRLauncherItemFakeDispatchOffline'); 31 | }); 32 | 33 | it('sets OLSKAppToolbarCloudOffline', function () { 34 | browser.assert.text('.OLSKAppToolbarCloudStatus', uLocalized('OLSKAppToolbarCloudStatusOffline')); 35 | }); 36 | 37 | }); 38 | 39 | context('error', function () { 40 | 41 | before(function () { 42 | return browser.OLSKLauncherRun('ZDRLauncherItemFakeDispatchError'); 43 | }); 44 | 45 | it('sets OLSKAppToolbarCloudError', function () { 46 | browser.assert.text('.OLSKAppToolbarCloudStatus', uLocalized('OLSKAppToolbarCloudStatusError')); 47 | }); 48 | 49 | }); 50 | 51 | }); 52 | 53 | describe('OLSKCloud', function test_OLSKCloud() { 54 | 55 | before(function () { 56 | return browser.OLSKVisit(kDefaultRoute); 57 | }); 58 | 59 | before(function () { 60 | return browser.OLSKLauncherRun('ZDRLauncherItemFakeDispatchConnected'); 61 | }); 62 | 63 | before(function () { 64 | return browser.OLSKLauncherRun('ZDRLauncherItemFakeDispatchOnline'); 65 | }); 66 | 67 | before(function () { 68 | return browser.pressButton('.OLSKAppToolbarCloudButton'); 69 | }); 70 | 71 | it('sets OLSKCloudStatusIdentityText', function () { 72 | browser.assert.text('.OLSKCloudStatusIdentity', 'ZDR_FAKE_CLOUD_IDENTITY'); 73 | }); 74 | 75 | context('sync start', function () { 76 | 77 | before(function () { 78 | browser.assert.elements('.OLSKCloudStatusSyncStartButton', 1); 79 | browser.assert.elements('.OLSKCloudStatusSyncStopButton', 0); 80 | }); 81 | 82 | before(function () { 83 | return browser.OLSKLauncherRun('ZDRLauncherItemFakeDispatchSyncDidStart'); 84 | }); 85 | 86 | it('sets OLSKCloudStatusIsSyncing', function () { 87 | browser.assert.elements('.OLSKCloudStatusSyncStartButton', 0); 88 | browser.assert.elements('.OLSKCloudStatusSyncStopButton', 1); 89 | }); 90 | 91 | }); 92 | 93 | context('sync stop', function () { 94 | 95 | before(function () { 96 | return browser.OLSKLauncherRun('ZDRLauncherItemFakeDispatchSyncDidStop'); 97 | }); 98 | 99 | it('sets OLSKCloudStatusIsSyncing', function () { 100 | browser.assert.elements('.OLSKCloudStatusSyncStartButton', 1); 101 | browser.assert.elements('.OLSKCloudStatusSyncStopButton', 0); 102 | }); 103 | 104 | }); 105 | 106 | context('error', function () { 107 | 108 | before(function () { 109 | return browser.OLSKLauncherRun('ZDRLauncherItemFakeDispatchError'); 110 | }); 111 | 112 | it('sets OLSKCloudErrorText', function () { 113 | browser.assert.text('.OLSKCloudError', 'ZDR_FAKE_CLOUD_ERROR'); 114 | }); 115 | 116 | }); 117 | 118 | context('write error', function () { 119 | 120 | before(function () { 121 | return browser.OLSKLauncherRun('ZDRLauncherItemFakeDispatchWriteError'); 122 | }); 123 | 124 | it('sets OLSKCloudErrorText', function () { 125 | browser.assert.text('.OLSKCloudError', 'ZDR_FAKE_WRITE_ERROR'); 126 | }); 127 | 128 | }); 129 | 130 | context('disconnect', function () { 131 | 132 | before(function () { 133 | browser.assert.elements('.OLSKCloudForm', 0); 134 | browser.assert.elements('.OLSKCloudStatus', 1); 135 | }); 136 | 137 | before(function () { 138 | return browser.pressButton('.OLSKCloudStatusDisconnectButton'); 139 | }); 140 | 141 | it('sets OLSKCloudErrorText', function () { 142 | browser.assert.elements('.OLSKCloudForm', 1); 143 | browser.assert.elements('.OLSKCloudStatus', 0); 144 | }); 145 | 146 | }); 147 | 148 | }); 149 | 150 | }); 151 | -------------------------------------------------------------------------------- /os-app/open-write/ui-test-publish.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('KVCWrite_Publish', function () { 4 | 5 | before(function() { 6 | return browser.OLSKVisit(kDefaultRoute); 7 | }); 8 | 9 | before(function () { 10 | return browser.OLSKLauncherRun('ZDRLauncherItemFakeDispatchConnected'); 11 | }); 12 | 13 | describe('template', function test_template () { 14 | 15 | before(function () { 16 | return browser.pressButton('.KVCWriteCreateButton'); 17 | }); 18 | 19 | before(function () { 20 | return browser.fill('.KVCWriteInputFieldDebug', 'alfa\n[[bravo]]'); 21 | }); 22 | 23 | before(function () { 24 | return browser.pressButton('.KVCWriteDetailToolbarPublishButton'); 25 | }); 26 | 27 | it('publishes with template', function () { 28 | browser.assert.text('#TestPublishContent .KVCArticleTitle', 'alfa'); 29 | }); 30 | 31 | }); 32 | 33 | describe('backlinks', function test_backlinks () { 34 | 35 | before(function () { 36 | browser.assert.elements('#TestPublishContent .KVCBacklinks', 0); 37 | }); 38 | 39 | before(function () { 40 | return browser.pressButton('.KVCWriteCreateButton'); 41 | }); 42 | 43 | before(function () { 44 | return browser.fill('.KVCWriteInputFieldDebug', 'bravo'); 45 | }); 46 | 47 | before(function () { 48 | return browser.pressButton('.KVCWriteDetailToolbarPublishButton'); 49 | }); 50 | 51 | it.skip('sets KVCOptionBacklinks', function () { 52 | browser.assert.elements('#TestPublishContent .KVCBacklinks', 1); 53 | }); 54 | 55 | }); 56 | 57 | describe('root_page', function test_root_page () { 58 | 59 | before(function () { 60 | return browser.OLSKLauncherRun('KVCWriteDetailLauncherItemSetAsRootPage'); 61 | }); 62 | 63 | before(function () { 64 | return browser.pressButton('.KVCWriteCreateButton'); 65 | }); 66 | 67 | before(function () { 68 | return browser.fill('.KVCWriteInputFieldDebug', 'charlie\n[[bravo]]'); 69 | }); 70 | 71 | before(function () { 72 | browser.assert.elements('#TestPublishContent .KVCRootLink', 0); 73 | }); 74 | 75 | before(function () { 76 | // return browser.OLSKLauncherRun('FakeConfigureCustomDomain'); 77 | }); 78 | 79 | before(function () { 80 | return browser.pressButton('.KVCWriteDetailToolbarPublishButton'); 81 | }); 82 | 83 | it('sets KVCOptionIsRoot', function () { 84 | browser.assert.elements('#TestPublishContent .KVCRootLink', 1); 85 | }); 86 | 87 | it.skip('sets KVCOptionRootURL', function () { 88 | browser.assert.attribute('#TestPublishContent .KVCRootLink', 'href', 'FakeCustomDomainBaseURL'); 89 | }); 90 | 91 | }); 92 | 93 | }); 94 | -------------------------------------------------------------------------------- /os-app/open-write/ui-test-sync.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('KVCWrite_Sync', function () { 4 | 5 | before(function() { 6 | return browser.OLSKVisit(kDefaultRoute); 7 | }); 8 | 9 | describe('ZDRSchemaDispatchSyncCreateNote', function test_ZDRSchemaDispatchSyncCreateNote () { 10 | 11 | before(function () { 12 | browser.assert.elements('.OLSKCollectionItem', 0); 13 | }); 14 | 15 | before(function () { 16 | return browser.OLSKLauncherRun('FakeZDRSchemaDispatchSyncCreateNote'); 17 | }); 18 | 19 | it('adds item', function () { 20 | browser.assert.elements('.OLSKCollectionItem', 1); 21 | }); 22 | 23 | }); 24 | 25 | describe('ZDRSchemaDispatchSyncUpdateNote', function test_ZDRSchemaDispatchSyncUpdateNote () { 26 | 27 | before(function () { 28 | browser.assert.text('.OLSKCollectionItem', 'FakeZDRSchemaDispatchSyncCreateNote'); 29 | }); 30 | 31 | before(function () { 32 | return browser.OLSKLauncherRun('FakeZDRSchemaDispatchSyncUpdateNote'); 33 | }); 34 | 35 | it('updates item', function () { 36 | browser.assert.text('.OLSKCollectionItem', 'FakeZDRSchemaDispatchSyncUpdateNote'); 37 | }); 38 | 39 | context('selected same', function () { 40 | 41 | before(function () { 42 | return browser.click('.OLSKCollectionItem'); 43 | }); 44 | 45 | before(function () { 46 | return browser.fill('.KVCWriteInputFieldDebug', 'FakeZDRSchemaDispatchSyncCreateNote'); 47 | }); 48 | 49 | before(function () { 50 | return browser.OLSKLauncherRun('FakeZDRSchemaDispatchSyncUpdateNote'); 51 | }); 52 | 53 | it('updates detail', function () { 54 | browser.assert.input('.KVCWriteInputFieldDebug', 'FakeZDRSchemaDispatchSyncUpdateNote'); 55 | }); 56 | 57 | }); 58 | 59 | }); 60 | 61 | describe('ZDRSchemaDispatchSyncDeleteNote', function test_ZDRSchemaDispatchSyncDeleteNote () { 62 | 63 | before(function () { 64 | return browser.OLSKLauncherRun('FakeZDRSchemaDispatchSyncDeleteNote'); 65 | }); 66 | 67 | it('removes item', function () { 68 | browser.assert.elements('.OLSKCollectionItem', 0); 69 | }); 70 | 71 | context('selected same', function () { 72 | 73 | before(function () { 74 | return browser.OLSKLauncherRun('FakeZDRSchemaDispatchSyncCreateNote'); 75 | }); 76 | 77 | before(function () { 78 | return browser.click('.OLSKCollectionItem'); 79 | }); 80 | 81 | before(function () { 82 | return browser.OLSKLauncherRun('FakeZDRSchemaDispatchSyncDeleteNote'); 83 | }); 84 | 85 | it('clears detail', function () { 86 | browser.assert.elements('.KVCWriteDetail', 0); 87 | }); 88 | 89 | }); 90 | 91 | }); 92 | 93 | describe('ZDRSchemaDispatchSyncConflictNote', function test_ZDRSchemaDispatchSyncConflictNote () { 94 | 95 | before(function () { 96 | return browser.pressButton('.KVCWriteCreateButton'); 97 | }); 98 | 99 | before(function () { 100 | return browser.fill('.KVCWriteInputFieldDebug', 'FakeZDRSchemaDispatchSyncConflictNote'); 101 | }); 102 | 103 | before(function () { 104 | return browser.OLSKLauncherRun('FakeZDRSchemaDispatchSyncConflictNote'); 105 | }); 106 | 107 | it('selects local', function () { 108 | browser.assert.text('.OLSKCollectionItem', 'FakeZDRSchemaDispatchSyncConflictNote-local'); 109 | }); 110 | 111 | }); 112 | 113 | }); 114 | -------------------------------------------------------------------------------- /os-app/open-write/ui-test-transport.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('KVCWrite_Transport', function () { 4 | 5 | const json = {}; 6 | 7 | describe('OLSKTransportDispatchImportJSON', function test_OLSKTransportDispatchImportJSON() { 8 | 9 | const KVCNoteBody = Math.random().toString(); 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute); 13 | }); 14 | 15 | before(function () { 16 | return browser.pressButton('.OLSKAppToolbarLauncherButton'); 17 | }); 18 | 19 | before(function () { 20 | return browser.fill('.LCHLauncherFilterInput', 'OLSKTransportLauncherFakeItemImportSerialized'); 21 | }); 22 | 23 | before(function () { 24 | return browser.OLSKPrompt(function () { 25 | return browser.click('.LCHLauncherPipeItem'); 26 | }, function (dialog) { 27 | dialog.response = JSON.stringify({ 28 | KVCNote: [StubNoteObjectValid({ 29 | KVCNoteBody, 30 | })], 31 | KVCSetting: [StubSettingObjectValid()], 32 | }); 33 | 34 | Object.assign(json, JSON.parse(dialog.response)); 35 | 36 | return dialog; 37 | }); 38 | }); 39 | 40 | it('creates note', function () { 41 | browser.assert.text('.KVCWriteListItemTitle', KVCNoteBody); 42 | }); 43 | 44 | }); 45 | 46 | describe('OLSKTransportDispatchExportInput', function test_OLSKTransportDispatchExportInput() { 47 | 48 | before(function () { 49 | return browser.pressButton('.OLSKAppToolbarLauncherButton'); 50 | }); 51 | 52 | before(function () { 53 | return browser.fill('.LCHLauncherFilterInput', 'OLSKTransportLauncherFakeItemExportSerialized'); 54 | }); 55 | 56 | it('exports file', async function() { 57 | const response = JSON.parse(await browser.OLSKAlertAsync(function () { 58 | return browser.click('.LCHLauncherPipeItem'); 59 | })); 60 | 61 | const date = response.OLSKDownloadName.split('-').pop().split('.').shift(); 62 | 63 | browser.assert.deepEqual(Object.assign(response, { 64 | OLSKDownloadData: JSON.parse(response.OLSKDownloadData), 65 | }), { 66 | OLSKDownloadName: `${ browser.window.location.hostname }-${ date }.json`, 67 | OLSKDownloadData: json, 68 | }); 69 | }); 70 | 71 | }); 72 | 73 | describe('ImportTXT', function test_ImportTXT() { 74 | 75 | const _LCHReadTextFileObjectContent = Math.random().toString(); 76 | 77 | before(function() { 78 | return browser.OLSKVisit(kDefaultRoute); 79 | }); 80 | 81 | before(function () { 82 | return browser.pressButton('.OLSKAppToolbarLauncherButton'); 83 | }); 84 | 85 | before(function () { 86 | return browser.fill('.LCHLauncherFilterInput', 'KVCWriteLauncherItemDebug_PromptFakeImportPlain'); 87 | }); 88 | 89 | before(function () { 90 | return browser.OLSKPrompt(function () { 91 | return browser.click('.LCHLauncherPipeItem'); 92 | }, function (dialog) { 93 | dialog.response = JSON.stringify({ 94 | _LCHReadTextFileObjectContent, 95 | }); 96 | 97 | return dialog; 98 | }); 99 | }); 100 | 101 | it('creates item', function () { 102 | browser.assert.text('.KVCWriteListItemTitle', _LCHReadTextFileObjectContent); 103 | }); 104 | 105 | }); 106 | 107 | describe('ImportNV', function test_ImportNV() { 108 | 109 | const title = Math.random().toString(); 110 | 111 | before(function() { 112 | return browser.OLSKVisit(kDefaultRoute); 113 | }); 114 | 115 | before(function () { 116 | return browser.pressButton('.OLSKAppToolbarLauncherButton'); 117 | }); 118 | 119 | before(function () { 120 | return browser.fill('.LCHLauncherFilterInput', 'KVCWriteLauncherItemDebug_PromptFakeImportComplex'); 121 | }); 122 | 123 | before(function () { 124 | return browser.OLSKPrompt(function () { 125 | return browser.click('.LCHLauncherPipeItem'); 126 | }, function (dialog) { 127 | dialog.response = JSON.stringify({ 128 | name: title + '.' + Date.now().toString(), 129 | _LCHReadTextFileObjectContent: Math.random().toString(), 130 | }); 131 | 132 | return dialog; 133 | }); 134 | }); 135 | 136 | it('creates item', function () { 137 | browser.assert.text('.KVCWriteListItemTitle', title); 138 | }); 139 | 140 | }); 141 | 142 | describe('ExportZIP', function test_ExportZIP() { 143 | 144 | const KVCNoteBody = Math.random().toString(); 145 | 146 | before(function() { 147 | return browser.OLSKVisit(kDefaultRoute); 148 | }); 149 | 150 | before(function () { 151 | return browser.pressButton('.KVCWriteCreateButton'); 152 | }); 153 | 154 | before(function () { 155 | browser.fill('.KVCWriteInputFieldDebug', KVCNoteBody); 156 | }); 157 | 158 | before(function () { 159 | return browser.pressButton('.OLSKAppToolbarLauncherButton'); 160 | }); 161 | 162 | before(function () { 163 | return browser.fill('.LCHLauncherFilterInput', 'KVCWriteLauncherItemDebug_AlertFakeExportCompressed'); 164 | }); 165 | 166 | it('exports file', function() { 167 | const response = JSON.parse(browser.OLSKAlert(function () { 168 | return browser.click('.LCHLauncherPipeItem'); 169 | })); 170 | 171 | const date = response.OLSKDownloadName.split('-').pop().split('.').shift(); 172 | 173 | browser.assert.deepEqual(response, { 174 | OLSKDownloadName: `${ browser.window.location.hostname }-${ date }.zip`, 175 | }); 176 | }); 177 | 178 | }); 179 | 180 | }); -------------------------------------------------------------------------------- /os-app/open-write/ui-test-version.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe.skip('KVCWrite_Version', function () { 4 | 5 | before(function() { 6 | return browser.OLSKVisit(kDefaultRoute); 7 | }); 8 | 9 | const createCount = Math.max(3, Date.now() % 10); 10 | const discardCount = Math.max(1, Date.now() % createCount); 11 | 12 | context('create', function test_create () { 13 | 14 | before(function () { 15 | browser.assert.evaluate(`localStorage.getItem('KVC_VERSION_MAP')`, null); 16 | }); 17 | 18 | Array.from(Array(createCount)).forEach(function () { 19 | 20 | before(function () { 21 | return browser.pressButton('.KVCWriteCreateButton'); 22 | }); 23 | 24 | before(function () { 25 | browser.fill('.KVCWriteInputFieldDebug', Math.random().toString()); 26 | }); 27 | 28 | }); 29 | 30 | it('calls OLSKVersionAdd', function () { 31 | browser.assert.evaluate(`Object.keys(JSON.parse(localStorage.getItem('KVC_VERSION_MAP'))).length`, createCount); 32 | }); 33 | 34 | }); 35 | 36 | context('discard', function test_discard () { 37 | 38 | Array.from(Array(discardCount)).forEach(function () { 39 | 40 | before(function () { 41 | return browser.click('.KVCWriteListItem'); 42 | }); 43 | 44 | before(function () { 45 | return browser.OLSKConfirm(function () { 46 | return browser.pressButton('.KVCWriteDetailToolbarDiscardButton'); 47 | }); 48 | }); 49 | 50 | }); 51 | 52 | it('calls OLSKVersionClear', function () { 53 | browser.assert.evaluate(`Object.keys(JSON.parse(localStorage.getItem('KVC_VERSION_MAP'))).length`, createCount - discardCount); 54 | }); 55 | 56 | }); 57 | 58 | context('sync', function test_sync () { 59 | 60 | before(function () { 61 | return browser.OLSKLauncherRun('FakeZDRSchemaDispatchSyncCreateNote'); 62 | }); 63 | 64 | before(function () { 65 | return browser.click('.KVCWriteListItem'); 66 | }); 67 | 68 | before(function () { 69 | return browser.fill('.KVCWriteInputFieldDebug', 'FakeZDRSchemaDispatchSyncCreateNote'); 70 | }); 71 | 72 | before(function () { 73 | browser.assert.evaluate(`Object.keys(JSON.parse(localStorage.getItem('KVC_VERSION_MAP'))).length`, createCount - discardCount + 1); 74 | }); 75 | 76 | before(function () { 77 | return browser.OLSKLauncherRun('FakeZDRSchemaDispatchSyncDeleteNote'); 78 | }); 79 | 80 | it('calls OLSKVersionClear', function () { 81 | browser.assert.evaluate(`Object.keys(JSON.parse(localStorage.getItem('KVC_VERSION_MAP'))).length`, createCount - discardCount); 82 | }); 83 | 84 | }); 85 | 86 | context('limit', function test_limit () { 87 | 88 | // before(function() { 89 | // return browser.OLSKVisit(kDefaultRoute); 90 | // }); 91 | 92 | before(function () { 93 | return browser.pressButton('.KVCWriteCreateButton'); 94 | }); 95 | 96 | before(function () { 97 | return browser.fill('.KVCWriteInputFieldDebug', Math.random().toString()); 98 | }); 99 | 100 | before(function () { 101 | browser.assert.evaluate(`JSON.parse(localStorage.getItem('KVC_VERSION_MAP'))[Object.keys(JSON.parse(localStorage.getItem('KVC_VERSION_MAP'))).shift()].length`, 1); 102 | }); 103 | 104 | Array.from(Array(parseInt(process.env.OLSK_VERSION_LIMIT))).forEach(function () { 105 | 106 | before(function () { 107 | return browser.fill('.KVCWriteInputFieldDebug', Math.random().toString()); 108 | }); 109 | 110 | }); 111 | 112 | it('sets ParamLimit', function () { 113 | browser.assert.evaluate(`JSON.parse(localStorage.getItem('KVC_VERSION_MAP'))[Object.keys(JSON.parse(localStorage.getItem('KVC_VERSION_MAP'))).shift()].length`, process.env.OLSK_VERSION_LIMIT); 114 | }); 115 | 116 | }); 117 | 118 | }); 119 | -------------------------------------------------------------------------------- /os-app/open-write/ui-view.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | locals.OLSKPageTitle = OLSKLocalized('KVCWriteTitle'); 3 | locals.OLSKPageAssets = [ 4 | '/_shared/__external/normalize.css/normalize.css', 5 | '/_shared/__external/OLSKDecor/ui-style.css', 6 | 7 | '/_shared/__external/codemirror/lib/codemirror.css', 8 | '/_shared/__external/codemirror/lib/codemirror.js', 9 | 10 | '/_shared/__external/codemirror/addon/edit/continuelist.js', 11 | 12 | '/_shared/__external/codemirror/addon/mode/overlay.js', 13 | 14 | '/_shared/__external/codemirror/mode/markdown/markdown.js', 15 | '/_shared/__external/codemirror/mode/gfm/gfm.js', 16 | 17 | '/_shared/__external/codemirror/addon/search/search.js', 18 | '/_shared/__external/codemirror/addon/search/searchcursor.js', 19 | '/_shared/__external/codemirror/addon/search/jump-to-line.js', 20 | '/_shared/__external/codemirror/addon/dialog/dialog.css', 21 | '/_shared/__external/codemirror/addon/dialog/dialog.js', 22 | 23 | '/_shared/__external/codemirror/keymap/sublime.js', 24 | 25 | '/_shared/__external/jszip/dist/jszip.min.js', 26 | 27 | '/_shared/__external/launchlet/__compiled/launchlet.css', 28 | '/_shared/__external/launchlet/__compiled/launchlet.js', 29 | 30 | OLSK_SPEC_UI() ? '' : '/_shared/__external/webnative/dist/index.umd.min.js', 31 | 32 | '/_shared/common/ui-style.css', 33 | 34 | '__compiled/ui-style.css', 35 | 'ui-editor-theme.css', 36 | 'ui-style.css', 37 | ]; 38 | locals.OLSKPagePublicRouteKeys = [ 39 | OLSKSharedActiveRouteConstant, 40 | 'KVCGuideRoute', 41 | 'WKCServiceWorkerRoute', 42 | ]; 43 | 44 | locals.OLSKPagePublicConstants = { 45 | OLSKSharedActiveRouteConstant, 46 | OLSKSharedPageLanguagesAvailable, 47 | OLSKSharedPageCurrentLanguage, 48 | }; 49 | locals.OLSKPageMetaViewport = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0'; 50 | locals.OLSKPageMetaTags = { 51 | 'mobile-web-app-capable': 'yes', 52 | 'apple-mobile-web-app-capable': 'yes', 53 | }; 54 | %> 55 | 56 | 57 | -------------------------------------------------------------------------------- /os-app/sub-detail/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/KVCWriteDetail', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'KVCWriteDetailStubRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'stub-view')); 8 | }, 9 | OLSKRouteLanguageCodes: ['en', 'fr', 'es', 'pt'], 10 | }]; 11 | }; 12 | -------------------------------------------------------------------------------- /os-app/sub-detail/i18n-en.yml: -------------------------------------------------------------------------------- 1 | KVCWriteDetailToolbarBackButtonText: Back 2 | KVCWriteDetailToolbarJumpButtonText: Jump 3 | KVCWriteDetailToolbarArchiveButtonText: Archive 4 | KVCWriteDetailToolbarUnarchiveButtonText: Unarchive 5 | KVCWriteDetailToolbarIsRootPageText: (homepage) 6 | KVCWriteDetailToolbarPublishButtonText: Publish 7 | KVCWriteDetailToolbarPublicLinkText: Public 8 | KVCWriteDetailToolbarRetractButtonText: Retract 9 | KVCWriteDetailToolbarDiscardButtonText: Discard 10 | KVCWriteDetailLauncherItemShowLocalVersionsText: Show local versions 11 | KVCWriteDetailLauncherItemCloneText: Clone 12 | KVCWriteDetailLauncherItemExportText: Export note 13 | KVCWriteDetailLauncherItemDebugText: Debug note 14 | KVCWriteDetailLauncherItemOpenPublicLinkText: Open public link 15 | KVCWriteDetailLauncherItemSetAsRootPageText: Set as homepage 16 | -------------------------------------------------------------------------------- /os-app/sub-detail/i18n-es.yml: -------------------------------------------------------------------------------- 1 | KVCWriteDetailToolbarBackButtonText: Back 2 | KVCWriteDetailToolbarJumpButtonText: Saltar 3 | KVCWriteDetailToolbarArchiveButtonText: Archivar 4 | KVCWriteDetailToolbarUnarchiveButtonText: Desarchivar 5 | KVCWriteDetailToolbarIsRootPageText: (Página de raíz) 6 | KVCWriteDetailToolbarPublishButtonText: Publicar 7 | KVCWriteDetailToolbarPublicLinkText: Public 8 | KVCWriteDetailToolbarRetractButtonText: Retractarse 9 | KVCWriteDetailToolbarDiscardButtonText: Eliminar 10 | KVCWriteDetailLauncherItemShowLocalVersionsText: Mostrar versiones locales 11 | KVCWriteDetailLauncherItemCloneText: Clonar 12 | KVCWriteDetailLauncherItemExportText: Exportar note 13 | KVCWriteDetailLauncherItemDebugText: Debug nota 14 | KVCWriteDetailLauncherItemOpenPublicLinkText: Abrir enlace público 15 | KVCWriteDetailLauncherItemSetAsRootPageText: Fijar como página de raíz 16 | -------------------------------------------------------------------------------- /os-app/sub-detail/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | KVCWriteDetailToolbarBackButtonText: Back 2 | KVCWriteDetailToolbarJumpButtonText: Sauter 3 | KVCWriteDetailToolbarArchiveButtonText: Archiver 4 | KVCWriteDetailToolbarUnarchiveButtonText: Désarchiver 5 | KVCWriteDetailToolbarIsRootPageText: (Page de racine) 6 | KVCWriteDetailToolbarPublishButtonText: Publier 7 | KVCWriteDetailToolbarPublicLinkText: Public 8 | KVCWriteDetailToolbarRetractButtonText: Rétracter 9 | KVCWriteDetailToolbarDiscardButtonText: Supprimer 10 | KVCWriteDetailLauncherItemShowLocalVersionsText: Montrer des versions locales 11 | KVCWriteDetailLauncherItemCloneText: Cloner 12 | KVCWriteDetailLauncherItemExportText: Exporter note 13 | KVCWriteDetailLauncherItemDebugText: Déboguer note 14 | KVCWriteDetailLauncherItemOpenPublicLinkText: Ouvrir le lien publique 15 | KVCWriteDetailLauncherItemSetAsRootPageText: Fixer comme page de racine 16 | -------------------------------------------------------------------------------- /os-app/sub-detail/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | KVCWriteDetailToolbarBackButtonText: Voltar 2 | KVCWriteDetailToolbarJumpButtonText: Saltar 3 | KVCWriteDetailToolbarArchiveButtonText: Arquivar 4 | KVCWriteDetailToolbarUnarchiveButtonText: Desarquivar 5 | KVCWriteDetailToolbarIsRootPageText: (página inicial) 6 | KVCWriteDetailToolbarPublishButtonText: Publicar 7 | KVCWriteDetailToolbarPublicLinkText: Público 8 | KVCWriteDetailToolbarRetractButtonText: Retirar 9 | KVCWriteDetailToolbarDiscardButtonText: Descartar 10 | KVCWriteDetailLauncherItemShowLocalVersionsText: Mostrar versões locais 11 | KVCWriteDetailLauncherItemCloneText: Clonar 12 | KVCWriteDetailLauncherItemExportText: Exportar nota 13 | KVCWriteDetailLauncherItemDebugText: Debug nota 14 | KVCWriteDetailLauncherItemOpenPublicLinkText: Abrir link público 15 | KVCWriteDetailLauncherItemSetAsRootPageText: Definir como página inicial 16 | -------------------------------------------------------------------------------- /os-app/sub-detail/rollup-start.js: -------------------------------------------------------------------------------- 1 | import RollupStart from './main.svelte'; 2 | 3 | import OLSKRemoteStorage from 'OLSKRemoteStorage'; 4 | 5 | const params = Object.fromEntries(Array.from((new window.URLSearchParams(window.location.search)).entries()).map(function (e) { 6 | if (['KVCWriteDetailItem', 'KVCWriteDetailConnected', 'KVCWriteDetailItemIsRootPage'].includes(e[0])) { 7 | e[1] = JSON.parse(e[1]); 8 | } 9 | 10 | if (e[0] === 'KVCWriteDetailItem') { 11 | e[1] = OLSKRemoteStorage.OLSKRemoteStoragePostJSONParse(e[1]); 12 | } 13 | 14 | return e; 15 | })); 16 | 17 | const mod = { 18 | 19 | // INTERFACE 20 | 21 | InterfaceTestKVCWriteDetailEditorFocusButtonDidClick () { 22 | KVCWriteDetail.modPublic.KVCWriteDetailEditorFocus(); 23 | }, 24 | 25 | // REACT 26 | 27 | ReactDetailItem (inputData) { 28 | window.TestKVCWriteDetailItem.innerHTML = JSON.stringify(inputData); 29 | }, 30 | 31 | // SETUP 32 | 33 | SetupEverything() { 34 | if (!params.KVCWriteDetailItem) { 35 | return; 36 | } 37 | 38 | mod.ReactDetailItem(params.KVCWriteDetailItem); 39 | }, 40 | 41 | // LIFECYCLE 42 | 43 | LifecycleModuleDidLoad() { 44 | mod.SetupEverything(); 45 | }, 46 | 47 | }; 48 | 49 | mod.LifecycleModuleDidLoad(); 50 | 51 | const KVCWriteDetail = new RollupStart({ 52 | target: document.body, 53 | props: Object.assign({ 54 | KVCWriteDetailPublicURLFor: (function (inputData) { 55 | return '[public]/' + inputData.KVCNotePublicID; 56 | }), 57 | KVCWriteDetailDispatchBack: (function () { 58 | window.TestKVCWriteDetailDispatchBack.innerHTML = parseInt(window.TestKVCWriteDetailDispatchBack.innerHTML) + 1; 59 | }), 60 | KVCWriteDetailDispatchJump: (function () { 61 | window.TestKVCWriteDetailDispatchJump.innerHTML = parseInt(window.TestKVCWriteDetailDispatchJump.innerHTML) + 1; 62 | }), 63 | KVCWriteDetailDispatchArchive: (function () { 64 | window.TestKVCWriteDetailDispatchArchive.innerHTML = parseInt(window.TestKVCWriteDetailDispatchArchive.innerHTML) + 1; 65 | }), 66 | KVCWriteDetailDispatchUnarchive: (function () { 67 | window.TestKVCWriteDetailDispatchUnarchive.innerHTML = parseInt(window.TestKVCWriteDetailDispatchUnarchive.innerHTML) + 1; 68 | }), 69 | KVCWriteDetailDispatchConnect: (function () { 70 | window.TestKVCWriteDetailDispatchConnect.innerHTML = parseInt(window.TestKVCWriteDetailDispatchConnect.innerHTML) + 1; 71 | }), 72 | KVCWriteDetailDispatchPublish: (function () { 73 | window.TestKVCWriteDetailDispatchPublish.innerHTML = parseInt(window.TestKVCWriteDetailDispatchPublish.innerHTML) + 1; 74 | }), 75 | KVCWriteDetailDispatchRetract: (function () { 76 | window.TestKVCWriteDetailDispatchRetract.innerHTML = parseInt(window.TestKVCWriteDetailDispatchRetract.innerHTML) + 1; 77 | }), 78 | KVCWriteDetailDispatchVersions: (function () { 79 | window.TestKVCWriteDetailDispatchVersions.innerHTML = parseInt(window.TestKVCWriteDetailDispatchVersions.innerHTML) + 1; 80 | }), 81 | KVCWriteDetailDispatchClone: (function () { 82 | window.TestKVCWriteDetailDispatchClone.innerHTML = parseInt(window.TestKVCWriteDetailDispatchClone.innerHTML) + 1; 83 | }), 84 | KVCWriteDetailDispatchExport: (function () { 85 | window.TestKVCWriteDetailDispatchExport.innerHTML = parseInt(window.TestKVCWriteDetailDispatchExport.innerHTML) + 1; 86 | }), 87 | KVCWriteDetailDispatchDebug: (function () { 88 | window.TestKVCWriteDetailDispatchDebug.innerHTML = parseInt(window.TestKVCWriteDetailDispatchDebug.innerHTML) + 1; 89 | }), 90 | KVCWriteDetailDispatchDiscard: (function () { 91 | window.TestKVCWriteDetailDispatchDiscard.innerHTML = parseInt(window.TestKVCWriteDetailDispatchDiscard.innerHTML) + 1; 92 | }), 93 | KVCWriteDetailDispatchUpdate: (function () { 94 | window.TestKVCWriteDetailDispatchUpdate.innerHTML = parseInt(window.TestKVCWriteDetailDispatchUpdate.innerHTML) + 1; 95 | 96 | mod.ReactDetailItem(params.KVCWriteDetailItem); 97 | }), 98 | KVCWriteDetailDispatchSetAsRootPage: (function (inputData) { 99 | window.TestKVCWriteDetailDispatchSetAsRootPage.innerHTML = parseInt(window.TestKVCWriteDetailDispatchSetAsRootPage.innerHTML) + 1; 100 | window.TestKVCWriteDetailDispatchSetAsRootPageData.innerHTML = inputData; 101 | }), 102 | KVCWriteDetailDispatchOpen: (function () {}), 103 | _DebugLauncher: true, 104 | }, params), 105 | }); 106 | 107 | KVCWriteDetail.modPublic.KVCWriteDetailSetItem(params.KVCWriteDetailItem); 108 | 109 | window.KVCWriteDetailBehaviour = mod; 110 | 111 | export default KVCWriteDetail; 112 | -------------------------------------------------------------------------------- /os-app/sub-detail/stub-view.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | locals.OLSKPageAssets = [ 3 | '/_shared/__external/normalize.css/normalize.css', 4 | '__compiled/ui-style.css', 5 | 6 | '/_shared/__external/codemirror/lib/codemirror.css', 7 | '/_shared/__external/codemirror/lib/codemirror.js', 8 | 9 | '/_shared/__external/codemirror/mode/javascript/javascript.js', 10 | '/_shared/__external/codemirror/mode/css/css.js', 11 | 12 | '/_shared/__external/codemirror/addon/edit/continuelist.js', 13 | 14 | '/_shared/__external/codemirror/addon/mode/overlay.js', 15 | 16 | '/_shared/__external/codemirror/mode/markdown/markdown.js', 17 | '/_shared/__external/codemirror/mode/gfm/gfm.js', 18 | 19 | '/_shared/__external/codemirror/addon/search/search.js', 20 | '/_shared/__external/codemirror/addon/search/searchcursor.js', 21 | '/_shared/__external/codemirror/addon/search/jump-to-line.js', 22 | '/_shared/__external/codemirror/addon/dialog/dialog.css', 23 | '/_shared/__external/codemirror/addon/dialog/dialog.js', 24 | '/_shared/__external/codemirror/keymap/sublime.js', 25 | 26 | '/_shared/__external/launchlet/__compiled/launchlet.js', 27 | '/_shared/__external/launchlet/__compiled/launchlet.css', 28 | ]; 29 | locals.OLSKPagePublicConstants = { 30 | OLSKSharedPageCurrentLanguage, 31 | }; 32 | %> 33 | 34 | 35 | 36 |

37 | KVCWriteDetailItem 38 | undefined 39 |

40 | 41 |

42 | KVCWriteDetailDispatchBack 43 | 0 44 |

45 | 46 |

47 | KVCWriteDetailDispatchJump 48 | 0 49 |

50 | 51 |

52 | KVCWriteDetailDispatchArchive 53 | 0 54 |

55 | 56 |

57 | KVCWriteDetailDispatchUnarchive 58 | 0 59 |

60 | 61 |

62 | KVCWriteDetailDispatchConnect 63 | 0 64 |

65 | 66 |

67 | KVCWriteDetailDispatchPublish 68 | 0 69 |

70 | 71 |

72 | KVCWriteDetailDispatchRetract 73 | 0 74 |

75 | 76 |

77 | KVCWriteDetailDispatchVersions 78 | 0 79 |

80 | 81 |

82 | KVCWriteDetailDispatchClone 83 | 0 84 |

85 | 86 |

87 | KVCWriteDetailDispatchExport 88 | 0 89 |

90 | 91 |

92 | KVCWriteDetailDispatchDebug 93 | 0 94 |

95 | 96 |

97 | KVCWriteDetailDispatchDiscard 98 | 0 99 |

100 | 101 |

102 | KVCWriteDetailDispatchUpdate 103 | 0 104 |

105 | 106 |

107 | KVCWriteDetailDispatchSetAsRootPage 108 | 0 109 | undefined 110 |

111 | 112 |

113 | 114 |

115 | -------------------------------------------------------------------------------- /os-app/sub-detail/ui-assets/_KVCWriteArchive.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /os-app/sub-detail/ui-assets/_KVCWriteJump.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /os-app/sub-detail/ui-assets/_KVCWritePublish.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /os-app/sub-detail/ui-assets/_KVCWriteRetract.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /os-app/sub-detail/ui-assets/_KVCWriteUnarchive.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /os-app/sub-detail/ui-assets/_KVCWriteVersions.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /os-app/sub-detail/ui-style.css: -------------------------------------------------------------------------------- 1 | .KVCWriteDetail { 2 | width: 100%; 3 | min-height: 100%; 4 | 5 | /* KVCWriteDetailFlexbox:Parent */ 6 | display: flex; 7 | flex-direction: column; 8 | } 9 | 10 | .KVCWriteDetailToolbar { 11 | /* KVCWriteDetailFlexbox:Child */ 12 | flex-shrink: 0; 13 | } 14 | 15 | .KVCWriteDetailToolbar a { 16 | color: inherit; 17 | } 18 | 19 | .KVCWriteDetailToolbarArchiveButton, .KVCWriteDetailToolbarUnarchiveButton { 20 | display: none; 21 | } 22 | 23 | .KVCWriteDetailToolbarJumpButton { 24 | position: absolute; 25 | z-index: 999; 26 | right: 0; 27 | margin: 16px 13px; 28 | opacity: 0.5; 29 | top: var(--OLSKToolbarMinHeight); 30 | } 31 | 32 | @media screen and (max-width: 760px) { 33 | 34 | .KVCWriteDetailHeader { 35 | /* browser quirks maybe #purge codemirror z-index issue */ 36 | z-index: 999; 37 | } 38 | 39 | } 40 | 41 | .KVCWriteDetail :global(.KVCWriteInput) { 42 | /* KVCWriteDetailFlexbox:Child */ 43 | flex-grow: 1; 44 | } 45 | 46 | @media screen and (min-width: 760px) { 47 | 48 | .KVCWriteDetail :global(.KVCWriteInput) { 49 | /* KVCWriteInputStation:Parent */ 50 | position: relative; 51 | } 52 | 53 | } 54 | 55 | @media screen and (max-width: 760px) { 56 | 57 | .KVCWriteDetail :global(.KVCWriteInput) { 58 | min-height: 100%; 59 | } 60 | 61 | } 62 | 63 | /* CodeMirror */ 64 | 65 | .KVCWriteDetail :global(.CodeMirror) { 66 | font-family: inherit; 67 | font-size: 14px; 68 | } 69 | 70 | @media screen and (min-width: 760px) { 71 | 72 | .KVCWriteDetail :global(.CodeMirror) { 73 | height: 100%; 74 | 75 | /* KVCWriteInputStation:Child */ 76 | position: absolute; 77 | top: 0; 78 | bottom: 0; 79 | left: 0; 80 | right: 0; 81 | } 82 | 83 | } 84 | 85 | @media screen and (max-width: 760px) { 86 | 87 | .KVCWriteDetail :global(.CodeMirror) { 88 | /* CodeMirrorResizeToContent */ 89 | height: auto; 90 | } 91 | 92 | } 93 | 94 | .KVCWriteDetail :global(.CodeMirror-scroll) { 95 | background: #f8f8f8; 96 | } 97 | 98 | @media screen and (max-width: 760px) { 99 | 100 | .KVCWriteDetail :global(.CodeMirror-scroll) { 101 | min-height: calc(100vh - 52px - 52px); 102 | } 103 | 104 | } 105 | 106 | .KVCWriteDetail :global(.CodeMirror-lines) { 107 | /* override defaults */ 108 | padding: 10px; 109 | } 110 | 111 | .KVCWriteDetail :global(.CodeMirror pre) { 112 | /* override defaults */ 113 | padding: 0; 114 | } 115 | 116 | .KVCWriteDetail :global(.CodeMirror-line:nth-child(1)) { 117 | font-weight: bold; 118 | } 119 | 120 | .KVCWriteDetail :global(.cm-link:hover) { 121 | cursor: pointer; 122 | } 123 | -------------------------------------------------------------------------------- /os-app/sub-detail/ui-test-_localize.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | kDefaultRoute.OLSKRouteLanguageCodes.forEach(function (OLSKRoutingLanguage) { 4 | 5 | const uLocalized = function (inputData) { 6 | return OLSKTestingLocalized(inputData, OLSKRoutingLanguage); 7 | }; 8 | 9 | describe('KVCWriteDetail_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | context('KVCWriteDetailItem', function() { 12 | 13 | before(function() { 14 | return browser.OLSKVisit(kDefaultRoute, { 15 | OLSKRoutingLanguage, 16 | KVCWriteDetailItem: JSON.stringify(StubNoteObjectValid()), 17 | }); 18 | }); 19 | 20 | it('localizes KVCWriteDetailToolbarBackButton', function () { 21 | browser.assert.attribute(KVCWriteDetailToolbarBackButton, 'title', uLocalized('KVCWriteDetailToolbarBackButtonText')); 22 | }); 23 | 24 | it('localizes KVCWriteDetailToolbarConnectButton', function () { 25 | browser.assert.attribute(KVCWriteDetailToolbarConnectButton, 'title', uLocalized('KVCWriteDetailToolbarPublishButtonText')); 26 | }); 27 | 28 | it('localizes KVCWriteDetailToolbarArchiveButton', function () { 29 | browser.assert.attribute(KVCWriteDetailToolbarArchiveButton, 'title', uLocalized('KVCWriteDetailToolbarArchiveButtonText')); 30 | }); 31 | 32 | it('localizes KVCWriteDetailToolbarDiscardButton', function () { 33 | browser.assert.attribute(KVCWriteDetailToolbarDiscardButton, 'title', uLocalized('KVCWriteDetailToolbarDiscardButtonText')); 34 | }); 35 | 36 | it('localizes KVCWriteDetailLauncherItemArchive', function () { 37 | return browser.assert.OLSKLauncherItemText('KVCWriteDetailLauncherItemArchive', uLocalized('KVCWriteDetailToolbarArchiveButtonText')); 38 | }); 39 | 40 | it('localizes KVCWriteDetailLauncherItemShowLocalVersions', function () { 41 | return browser.assert.OLSKLauncherItemText('KVCWriteDetailLauncherItemShowLocalVersions', uLocalized('KVCWriteDetailLauncherItemShowLocalVersionsText')); 42 | }); 43 | 44 | it('localizes KVCWriteDetailLauncherItemClone', function () { 45 | return browser.assert.OLSKLauncherItemText('KVCWriteDetailLauncherItemClone', uLocalized('KVCWriteDetailLauncherItemCloneText')); 46 | }); 47 | 48 | it('localizes KVCWriteDetailLauncherItemExport', function () { 49 | return browser.assert.OLSKLauncherItemText('KVCWriteDetailLauncherItemExport', uLocalized('KVCWriteDetailLauncherItemExportText')); 50 | }); 51 | 52 | context('KVCWriteInputDispatchHeaderTokens', function() { 53 | 54 | before(function() { 55 | // browser.fill('CodeMirror', 'bravo'); 56 | browser.fill('.KVCWriteInputFieldDebug', '# bravo'); 57 | }); 58 | 59 | it('localizes KVCWriteDetailToolbarJumpButton', function () { 60 | browser.assert.attribute(KVCWriteDetailToolbarJumpButton, 'title', uLocalized('KVCWriteDetailToolbarJumpButtonText')); 61 | }); 62 | 63 | }); 64 | 65 | context('connect', function () { 66 | 67 | it('localizes KVCWriteDetailConnectConfirm', function() { 68 | browser.assert.OLSKConfirmQuestion(function () { 69 | return browser.pressButton(KVCWriteDetailToolbarConnectButton); 70 | }, uLocalized('OLSKRemoteStorageConnectConfirmText')); 71 | }); 72 | 73 | }); 74 | 75 | context('discard', function () { 76 | 77 | it('localizes KVCWriteDetailDiscardConfirm', function() { 78 | browser.assert.OLSKConfirmQuestion(function () { 79 | return browser.pressButton(KVCWriteDetailToolbarDiscardButton); 80 | }, uLocalized('OLSKWordingConfirmText')); 81 | }); 82 | 83 | }); 84 | 85 | context('KVCNoteIsArchived', function() { 86 | 87 | before(function() { 88 | return browser.OLSKVisit(kDefaultRoute, { 89 | OLSKRoutingLanguage, 90 | KVCWriteDetailItem: JSON.stringify(StubNoteObjectValid({ 91 | KVCNoteIsArchived: true, 92 | })), 93 | }); 94 | }); 95 | 96 | it('localizes KVCWriteDetailToolbarUnarchiveButton', function () { 97 | browser.assert.attribute(KVCWriteDetailToolbarUnarchiveButton, 'title', uLocalized('KVCWriteDetailToolbarUnarchiveButtonText')); 98 | }); 99 | 100 | it('localizes KVCWriteDetailLauncherItemUnarchive', function () { 101 | return browser.assert.OLSKLauncherItemText('KVCWriteDetailLauncherItemUnarchive', uLocalized('KVCWriteDetailToolbarUnarchiveButtonText')); 102 | }); 103 | 104 | }); 105 | 106 | context('KVCWriteDetailConnected', function() { 107 | 108 | before(function() { 109 | return browser.OLSKVisit(kDefaultRoute, { 110 | OLSKRoutingLanguage, 111 | KVCWriteDetailItem: JSON.stringify(StubNoteObjectValid()), 112 | KVCWriteDetailConnected: true, 113 | }); 114 | }); 115 | 116 | it('localizes KVCWriteDetailToolbarPublishButton', function () { 117 | browser.assert.attribute(KVCWriteDetailToolbarPublishButton, 'title', uLocalized('KVCWriteDetailToolbarPublishButtonText')); 118 | }); 119 | 120 | it('localizes KVCWriteDetailLauncherItemPublish', function () { 121 | return browser.assert.OLSKLauncherItemText('KVCWriteDetailLauncherItemPublish', uLocalized('KVCWriteDetailToolbarPublishButtonText')); 122 | }); 123 | 124 | it('localizes KVCWriteDetailLauncherItemDebug', function () { 125 | return browser.assert.OLSKLauncherItemText('KVCWriteDetailLauncherItemDebug', uLocalized('KVCWriteDetailLauncherItemDebugText')); 126 | }); 127 | 128 | context('KVCNoteIsMarkedPublic', function() { 129 | 130 | before(function() { 131 | return browser.OLSKVisit(kDefaultRoute, { 132 | OLSKRoutingLanguage, 133 | KVCWriteDetailItem: JSON.stringify(StubNoteObjectValid({ 134 | KVCNoteIsPublic: true, 135 | KVCNotePublishDate: new Date(), 136 | KVCNotePublicID: 'bravo', 137 | })), 138 | KVCWriteDetailConnected: true, 139 | }); 140 | }); 141 | 142 | it('localizes KVCWriteDetailToolbarPublicLink', function () { 143 | browser.assert.text(KVCWriteDetailToolbarPublicLink, uLocalized('KVCWriteDetailToolbarPublicLinkText')); 144 | }); 145 | 146 | it('localizes KVCWriteDetailToolbarRetractButton', function () { 147 | browser.assert.attribute(KVCWriteDetailToolbarRetractButton, 'title', uLocalized('KVCWriteDetailToolbarRetractButtonText')); 148 | }); 149 | 150 | it('localizes KVCWriteDetailLauncherItemOpenPublicLink', function () { 151 | return browser.assert.OLSKLauncherItemText('KVCWriteDetailLauncherItemOpenPublicLink', uLocalized('KVCWriteDetailLauncherItemOpenPublicLinkText')); 152 | }); 153 | 154 | it('localizes KVCWriteDetailLauncherItemRetract', function () { 155 | return browser.assert.OLSKLauncherItemText('KVCWriteDetailLauncherItemRetract', uLocalized('KVCWriteDetailToolbarRetractButtonText')); 156 | }); 157 | 158 | it('localizes KVCWriteDetailLauncherItemSetAsRootPage', function () { 159 | return browser.assert.OLSKLauncherItemText('KVCWriteDetailLauncherItemSetAsRootPage', uLocalized('KVCWriteDetailLauncherItemSetAsRootPageText')); 160 | }); 161 | 162 | }); 163 | 164 | }); 165 | 166 | context('KVCWriteDetailItemIsRootPage', function() { 167 | 168 | before(function() { 169 | return browser.OLSKVisit(kDefaultRoute, { 170 | OLSKRoutingLanguage, 171 | KVCWriteDetailItem: JSON.stringify(StubNoteObjectValid()), 172 | KVCWriteDetailItemIsRootPage: true, 173 | }); 174 | }); 175 | 176 | it('localizes KVCWriteDetailToolbarIsRootPage', function () { 177 | browser.assert.text(KVCWriteDetailToolbarIsRootPage, uLocalized('KVCWriteDetailToolbarIsRootPageText')); 178 | }); 179 | 180 | }); 181 | 182 | }); 183 | 184 | }); 185 | 186 | }); 187 | -------------------------------------------------------------------------------- /os-app/sub-input/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/KVCWriteInput', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'KVCWriteInputStubRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'stub-view')); 8 | }, 9 | }]; 10 | }; 11 | -------------------------------------------------------------------------------- /os-app/sub-input/main.svelte: -------------------------------------------------------------------------------- 1 | 314 | 315 | 316 |
317 | {#if OLSK_SPEC_UI()} 318 | 319 | {/if} 320 | 321 | {#if !OLSK_SPEC_UI()} 322 | 323 | {/if} 324 |
325 | -------------------------------------------------------------------------------- /os-app/sub-input/rollup-start.js: -------------------------------------------------------------------------------- 1 | import RollupStart from './main.svelte'; 2 | 3 | const params = Object.fromEntries(Array.from((new window.URLSearchParams(window.location.search)).entries()).map(function (e) { 4 | if (['KVCWriteInputItem'].includes(e[0])) { 5 | e[1] = JSON.parse(e[1]); 6 | } 7 | 8 | return e; 9 | })); 10 | 11 | const mod = { 12 | 13 | // INTERFACE 14 | 15 | InterfaceTestKVCWriteInputFocusButtonDidClick() { 16 | KVCWriteInput.modPublic.KVCWriteInputFocus(); 17 | }, 18 | 19 | InterfaceTestKVCWriteInputPropDataSendButtonDidClick() { 20 | KVCWriteInput.KVCWriteInputItem = JSON.parse(window.TestKVCWriteInputPropData.value); 21 | }, 22 | 23 | }; 24 | 25 | const KVCWriteInput = new RollupStart({ 26 | target: document.body, 27 | props: Object.assign({ 28 | KVCWriteInputDispatchHeaderTokens: (function (inputData) { 29 | window.TestKVCWriteInputDispatchHeaderTokens.innerHTML = parseInt(window.TestKVCWriteInputDispatchHeaderTokens.innerHTML) + 1; 30 | window.TestKVCWriteInputDispatchHeaderTokensData.innerHTML = JSON.stringify(inputData); 31 | }), 32 | KVCWriteInputDispatchUpdate: (function (inputData) { 33 | window.TestKVCWriteInputDispatchUpdate.innerHTML = parseInt(window.TestKVCWriteInputDispatchUpdate.innerHTML) + 1; 34 | }), 35 | KVCWriteInputDispatchOpen: (function () {}), 36 | KVCWriteInputDispatchReady: (function () {}), 37 | }, params), 38 | }); 39 | 40 | window.KVCWriteInputBehaviour = mod; 41 | 42 | export default KVCWriteInput; 43 | -------------------------------------------------------------------------------- /os-app/sub-input/stub-view.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | locals.OLSKPageAssets = [ 3 | '/_shared/__external/normalize.css/normalize.css', 4 | '__compiled/ui-style.css', 5 | 6 | '/_shared/__external/codemirror/lib/codemirror.css', 7 | '/_shared/__external/codemirror/lib/codemirror.js', 8 | 9 | '/_shared/__external/codemirror/mode/javascript/javascript.js', 10 | '/_shared/__external/codemirror/mode/css/css.js', 11 | 12 | '/_shared/__external/codemirror/addon/edit/continuelist.js', 13 | 14 | '/_shared/__external/codemirror/addon/mode/overlay.js', 15 | 16 | '/_shared/__external/codemirror/mode/markdown/markdown.js', 17 | '/_shared/__external/codemirror/mode/gfm/gfm.js', 18 | 19 | '/_shared/__external/codemirror/addon/search/search.js', 20 | '/_shared/__external/codemirror/addon/search/searchcursor.js', 21 | '/_shared/__external/codemirror/addon/search/jump-to-line.js', 22 | '/_shared/__external/codemirror/addon/dialog/dialog.css', 23 | '/_shared/__external/codemirror/addon/dialog/dialog.js', 24 | '/_shared/__external/codemirror/keymap/sublime.js', 25 | ]; 26 | locals.OLSKPagePublicConstants = { 27 | OLSKSharedPageCurrentLanguage, 28 | }; 29 | %> 30 | 31 |

32 | KVCWriteInputDispatchHeaderTokens 33 | 0 34 | undefined 35 |

36 | 37 |

38 | KVCWriteInputDispatchUpdate 39 | 0 40 |

41 | 42 |

43 | 44 |

45 | 46 |

47 | 48 | 49 |

50 | 51 | 52 | -------------------------------------------------------------------------------- /os-app/sub-input/ui-logic-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./ui-logic.js'); 4 | 5 | describe('KVCWriteInputLineObjectsFor', function test_KVCWriteInputLineObjectsFor() { 6 | 7 | it('throws error if not array', function() { 8 | throws(function() { 9 | mod.KVCWriteInputLineObjectsFor(null); 10 | }, /KVCErrorInputNotValid/); 11 | }); 12 | 13 | it('returns array', function() { 14 | deepEqual(mod.KVCWriteInputLineObjectsFor([]), []); 15 | }); 16 | 17 | it('converts non-link single', function() { 18 | deepEqual(mod.KVCWriteInputLineObjectsFor(mod.uStubLineTokensFor('alfa')), [{ 19 | start: 0, 20 | end: 4, 21 | string: 'alfa', 22 | type: 'variable-2', 23 | }]); 24 | }); 25 | 26 | it('converts non-link multiple', function() { 27 | deepEqual(mod.KVCWriteInputLineObjectsFor(mod.uStubLineTokensFor('alfa bravo')), [{ 28 | start: 0, 29 | end: 10, 30 | string: 'alfa bravo', 31 | type: 'variable-2', 32 | }]); 33 | }); 34 | 35 | it('converts link single', function() { 36 | deepEqual(mod.KVCWriteInputLineObjectsFor(mod.uStubLineTokensFor('[[alfa]]')), [{ 37 | start: 0, 38 | end: 8, 39 | string: '[[alfa]]', 40 | type: 'variable-2 link', 41 | }]); 42 | }); 43 | 44 | it('converts link multiple', function() { 45 | deepEqual(mod.KVCWriteInputLineObjectsFor(mod.uStubLineTokensFor('[[alfa]] [[bravo]]')), [{ 46 | start: 0, 47 | end: 8, 48 | string: '[[alfa]]', 49 | type: 'variable-2 link', 50 | }, { 51 | start: 8, 52 | end: 9, 53 | string: ' ', 54 | type: 'variable-2', 55 | }, { 56 | start: 9, 57 | end: 18, 58 | string: '[[bravo]]', 59 | type: 'variable-2 link', 60 | }]); 61 | }); 62 | 63 | it('converts header', function() { 64 | deepEqual(mod.KVCWriteInputLineObjectsFor(mod.uStubLineTokensFor('# alfa')), [{ 65 | start: 0, 66 | end: 6, 67 | string: '# alfa', 68 | type: 'header header-1', 69 | }]); 70 | }); 71 | 72 | it('converts multiple header objects', function() { 73 | deepEqual(mod.KVCWriteInputLineObjectsFor(mod.uStubLineTokensFor('# alfa [[bravo]]')), [{ 74 | start: 0, 75 | end: 7, 76 | string: '# alfa ', 77 | type: 'header header-1', 78 | }, { 79 | start: 7, 80 | end: 16, 81 | string: '[[bravo]]', 82 | type: 'header header-1 link', 83 | }]); 84 | }); 85 | 86 | }); 87 | 88 | describe('KVCWriteInputHeaderTokensFrom', function test_KVCWriteInputHeaderTokensFrom() { 89 | 90 | it('throws error if not array', function() { 91 | throws(function() { 92 | mod.KVCWriteInputHeaderTokensFrom(null); 93 | }, /KVCErrorInputNotValid/); 94 | }); 95 | 96 | it('returns array', function() { 97 | deepEqual(mod.KVCWriteInputHeaderTokensFrom([]), []); 98 | }); 99 | 100 | it('excludes if not header', function() { 101 | deepEqual(mod.KVCWriteInputHeaderTokensFrom([ 102 | mod.KVCWriteInputLineObjectsFor(mod.uStubLineTokensFor('alfa')), 103 | mod.KVCWriteInputLineObjectsFor(mod.uStubLineTokensFor('[[bravo]]')), 104 | ]), []); 105 | }); 106 | 107 | it('includes if header', function() { 108 | deepEqual(mod.KVCWriteInputHeaderTokensFrom([ 109 | mod.KVCWriteInputLineObjectsFor(mod.uStubLineTokensFor('# alfa')), 110 | ]), mod.KVCWriteInputLineObjectsFor(mod.uStubLineTokensFor('# alfa')).map(function (e) { 111 | return Object.assign(e, { 112 | line: 0, 113 | }); 114 | })); 115 | }); 116 | 117 | it('excludes if not verbal', function() { 118 | deepEqual(mod.KVCWriteInputHeaderTokensFrom([ 119 | mod.KVCWriteInputLineObjectsFor(mod.uStubLineTokensFor('alfa')), 120 | mod.KVCWriteInputLineObjectsFor(mod.uStubLineTokensFor('====')), 121 | ].map(function (e) { 122 | return e.map(function (e) { 123 | return Object.assign(e, { 124 | type: 'header header-1', 125 | }); 126 | }); 127 | })), [{ 128 | start: 0, 129 | end: 4, 130 | string: 'alfa', 131 | type: 'header header-1', 132 | line: 0, 133 | }]); 134 | }); 135 | 136 | it('merges multiple header objects', function() { 137 | deepEqual(mod.KVCWriteInputHeaderTokensFrom([ 138 | mod.KVCWriteInputLineObjectsFor(mod.uStubLineTokensFor('# PA PARC https://www.supermarchepa.com/pages/weekly-flyer')), 139 | ]), [{ 140 | start: 0, 141 | end: 58, 142 | string: '# PA PARC https://www.supermarchepa.com/pages/weekly-flyer', 143 | type: 'header header-1', 144 | line: 0, 145 | }]); 146 | }); 147 | 148 | }); 149 | -------------------------------------------------------------------------------- /os-app/sub-input/ui-logic.js: -------------------------------------------------------------------------------- 1 | const mod = { 2 | 3 | uStubLineTokensFor (inputData) { 4 | let defaultType = inputData.trim()[0] === '#' ? 'header header-1' : 'variable-2'; 5 | 6 | return inputData.split(' ').map(function (e1, index1) { 7 | return e1.split('').map(function (e2, index2) { 8 | return { 9 | string: e2, 10 | type: e1.match(/(http|\[\[)/) ? `${ defaultType } link` : defaultType, 11 | }; 12 | }); 13 | }).reduce(function (coll, e) { 14 | return coll.concat(coll.length ? [{ 15 | string: ' ', 16 | type: defaultType, 17 | }] : []).concat(e); 18 | }, []).map(function (e, index) { 19 | return Object.assign(e, { 20 | start: index, 21 | end: index + 1, 22 | }); 23 | }); 24 | }, 25 | 26 | KVCWriteInputLineObjectsFor (inputData) { 27 | if (!Array.isArray(inputData)) { 28 | throw new Error('KVCErrorInputNotValid'); 29 | } 30 | 31 | return Object.values(inputData.reduce(function (coll, e) { 32 | let key = (Object.keys(coll).pop() || -1); 33 | 34 | if (!coll[key] || (coll[key].type !== e.type)) { 35 | key += 1; 36 | 37 | coll[key] = { 38 | start: e.start, 39 | type: e.type, 40 | }; 41 | } 42 | 43 | coll[key].end = e.end; 44 | coll[key].string = (coll[key].string || '').concat(e.string); 45 | 46 | return coll; 47 | }, {})); 48 | }, 49 | 50 | KVCWriteInputHeaderTokensFrom (inputData) { 51 | if (!Array.isArray(inputData)) { 52 | throw new Error('KVCErrorInputNotValid'); 53 | } 54 | 55 | return [].concat.apply([], inputData.map(function (e, i) { 56 | let validTokens = e.filter(function (e) { 57 | return e.type && e.type.match('header') && e.string.match(/\w/); 58 | }); 59 | 60 | if (!validTokens.length) { 61 | return []; 62 | } 63 | 64 | return validTokens.reduce(function (coll, e) { 65 | if (typeof coll.start === 'undefined') { 66 | coll.start = e.start; 67 | } 68 | 69 | if (typeof coll.type === 'undefined') { 70 | coll.type = e.type; 71 | } 72 | 73 | coll.string = (coll.string || '').concat(e.string); 74 | coll.end = e.end; 75 | 76 | return coll; 77 | }, { 78 | line: i, 79 | }); 80 | })); 81 | }, 82 | 83 | }; 84 | 85 | Object.assign(exports, mod); 86 | -------------------------------------------------------------------------------- /os-app/sub-input/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | KVCWriteInput: '.KVCWriteInput', 5 | 6 | KVCWriteInputFieldDebug: '.KVCWriteInputFieldDebug', 7 | }).map(function (e) { 8 | return global[e.shift()] = e.pop(); 9 | }); 10 | 11 | describe('KVCWriteInput_Access', function () { 12 | 13 | before(function() { 14 | return browser.OLSKVisit(kDefaultRoute, { 15 | KVCWriteInputItem: JSON.stringify({ 16 | alfa: 'bravo', 17 | }), 18 | KVCWriteInputKey: 'alfa', 19 | }); 20 | }); 21 | 22 | it('shows KVCWriteInput', function () { 23 | browser.assert.elements(KVCWriteInput, 1); 24 | }); 25 | 26 | it.skip('shows CodeMirror', function () { 27 | browser.assert.elements('.CodeMirror', 1); 28 | }); 29 | 30 | it('shows KVCWriteInputFieldDebug', function () { 31 | browser.assert.elements(KVCWriteInputFieldDebug, 1); 32 | }); 33 | 34 | }); 35 | -------------------------------------------------------------------------------- /os-app/sub-input/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('KVCWriteInput_Misc', function () { 4 | 5 | before(function() { 6 | return browser.OLSKVisit(kDefaultRoute, { 7 | KVCWriteInputItem: JSON.stringify({ 8 | alfa: 'bravo', 9 | }), 10 | KVCWriteInputKey: 'alfa', 11 | }); 12 | }); 13 | 14 | it('binds KVCWriteInputKey', function () { 15 | // browser.assert.input('.CodeMirror', 'bravo'); // #skip-codemirror 16 | browser.assert.input(KVCWriteInputFieldDebug, 'bravo'); 17 | }); 18 | 19 | context('init', function () { 20 | 21 | it('sends KVCWriteInputDispatchHeaderTokens', function () { 22 | browser.assert.text('#TestKVCWriteInputDispatchHeaderTokens', '1'); 23 | browser.assert.text('#TestKVCWriteInputDispatchHeaderTokensData', JSON.stringify([])); 24 | }); 25 | 26 | }); 27 | 28 | context('input', function () { 29 | 30 | before(function () { 31 | browser.assert.text('#TestKVCWriteInputDispatchUpdate', '0'); 32 | }); 33 | 34 | before(function () { 35 | // browser.fill('.CodeMirror', 'charlie'); // #skip-codemirror 36 | browser.fill(KVCWriteInputFieldDebug, 'charlie'); 37 | }); 38 | 39 | it('sends KVCWriteInputDispatchUpdate', function () { 40 | browser.assert.text('#TestKVCWriteInputDispatchUpdate', '1'); 41 | }); 42 | 43 | it('sends KVCWriteInputDispatchHeaderTokens', function () { 44 | browser.assert.text('#TestKVCWriteInputDispatchHeaderTokens', '2'); 45 | browser.assert.text('#TestKVCWriteInputDispatchHeaderTokensData', JSON.stringify([])); 46 | }); 47 | 48 | }); 49 | 50 | context('header', function () { 51 | 52 | before(function () { 53 | browser.fill(KVCWriteInputFieldDebug, '# bravo'); 54 | // browser.fill('.CodeMirror', '# bravo'); 55 | }); 56 | 57 | it('sends KVCWriteInputDispatchHeaderTokens', function () { 58 | browser.assert.text('#TestKVCWriteInputDispatchHeaderTokens', '3'); 59 | browser.assert.text('#TestKVCWriteInputDispatchHeaderTokensData', JSON.stringify(require('./ui-logic.js').KVCWriteInputHeaderTokensFrom([require('./ui-logic.js').KVCWriteInputLineObjectsFor(require('./ui-logic.js').uStubLineTokensFor('# bravo'))]))); 60 | }); 61 | 62 | }); 63 | 64 | context.skip('KVCWriteInputFocus', function () { 65 | 66 | before(function () { 67 | browser.assert.hasNoClass('.CodeMirror', 'CodeMirror-focused'); 68 | }); 69 | 70 | before(function () { 71 | browser.pressButton('#TestKVCWriteInputFocus'); 72 | }); 73 | 74 | it('classes CodeMirror-focused', function () { 75 | browser.assert.hasClass('.CodeMirror', 'CodeMirror-focused'); 76 | }); 77 | 78 | }); 79 | 80 | context('prop', function () { 81 | 82 | before(function () { 83 | browser.assert.input('#TestKVCWriteInputPropData', 'undefined'); 84 | }); 85 | 86 | before(function () { 87 | browser.fill('#TestKVCWriteInputPropData', JSON.stringify({ 88 | alfa: 'delta', 89 | })); 90 | browser.pressButton('#TestKVCWriteInputPropDataSend'); 91 | }); 92 | 93 | it('binds KVCWriteInputKey', function () { 94 | // browser.assert.input('.CodeMirror', 'delta'); // #skip-codemirror 95 | browser.assert.input(KVCWriteInputFieldDebug, 'delta'); 96 | }); 97 | 98 | }); 99 | 100 | }); 101 | -------------------------------------------------------------------------------- /os-app/sub-item/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/KVCWriteListItem', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'KVCWriteListItemStubRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'stub-view')); 8 | }, 9 | OLSKRouteLanguageCodes: ['en', 'fr', 'es', 'pt'], 10 | }]; 11 | }; 12 | -------------------------------------------------------------------------------- /os-app/sub-item/main.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 |
10 | 11 | {#if KVCWriteListItemObject.KVCNoteIsPublic } 12 | { KVCWriteLogic.KVCWritePublicSymbol() } 13 | {/if} 14 | 15 | { KVCTemplate.KVCTemplateTruncated(KVCTemplate.KVCTemplatePlaintextTitle(KVCWriteListItemObject.KVCNoteBody)) } 16 | { OLSKString.OLSKStringSnippet(KVCTemplate.KVCTemplatePlaintextBody(KVCWriteListItemObject.KVCNoteBody)) } 17 | 18 |
19 | 20 | 49 | -------------------------------------------------------------------------------- /os-app/sub-item/rollup-start.js: -------------------------------------------------------------------------------- 1 | import RollupStart from './main.svelte'; 2 | 3 | const KVCWriteListItem = new RollupStart({ 4 | target: document.body, 5 | props: Object.assign({}, Object.fromEntries(Array.from((new window.URLSearchParams(window.location.search)).entries()).map(function (e) { 6 | if (['KVCWriteListItemObject'].includes(e[0])) { 7 | e[1] = JSON.parse(e[1]); 8 | } 9 | 10 | return e; 11 | }))), 12 | }); 13 | 14 | export default KVCWriteListItem; 15 | -------------------------------------------------------------------------------- /os-app/sub-item/stub-view.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | locals.OLSKPageAssets = [ 3 | '/_shared/__external/normalize.css/normalize.css', 4 | '__compiled/ui-style.css', 5 | ]; 6 | locals.OLSKPagePublicConstants = { 7 | OLSKSharedPageCurrentLanguage, 8 | }; 9 | %> 10 | 11 | 12 | 13 |

14 | KVCWriteListItemDispatchCreate 15 | 0 16 | undefined 17 |

18 | 19 |

20 | KVCWriteListItemDispatchClick 21 | 0 22 | undefined 23 |

24 | 25 |

26 | KVCWriteListItemDispatchArrow 27 | 0 28 | undefined 29 |

30 | 31 |

32 | KVCWriteListItemDispatchFilter 33 | 0 34 | undefined 35 |

36 | -------------------------------------------------------------------------------- /os-app/sub-item/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | KVCWriteListItem: '.KVCWriteListItem', 5 | 6 | KVCWriteListItemIsPublic: '.KVCWriteListItemIsPublic', 7 | KVCWriteListItemTitle: '.KVCWriteListItemTitle', 8 | KVCWriteListItemSnippet: '.KVCWriteListItemSnippet', 9 | }).map(function (e) { 10 | return global[e.shift()] = e.pop(); 11 | }); 12 | 13 | describe('KVCWriteListItem_Access', function () { 14 | 15 | before(function() { 16 | return browser.OLSKVisit(kDefaultRoute, { 17 | KVCWriteListItemObject: JSON.stringify(StubNoteObjectValid()), 18 | }); 19 | }); 20 | 21 | it('shows KVCWriteListItem', function () { 22 | browser.assert.elements(KVCWriteListItem, 1); 23 | }); 24 | 25 | it('hides KVCWriteListItemIsPublic', function () { 26 | browser.assert.elements(KVCWriteListItemIsPublic, 0); 27 | }); 28 | 29 | it('shows KVCWriteListItemTitle', function () { 30 | browser.assert.elements(KVCWriteListItemTitle, 1); 31 | }); 32 | 33 | it('shows KVCWriteListItemSnippet', function () { 34 | browser.assert.elements(KVCWriteListItemSnippet, 1); 35 | }); 36 | 37 | context('KVCNoteIsPublic', function () { 38 | 39 | before(function() { 40 | return browser.OLSKVisit(kDefaultRoute, { 41 | KVCWriteListItemObject: JSON.stringify(StubNoteObjectValid({ 42 | KVCNoteIsPublic: true, 43 | })), 44 | }); 45 | }); 46 | 47 | it('shows KVCWriteListItemIsPublic', function () { 48 | browser.assert.elements(KVCWriteListItemIsPublic, 1); 49 | }); 50 | 51 | }); 52 | 53 | }); 54 | -------------------------------------------------------------------------------- /os-app/sub-item/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | const KVCTemplate = require('../_shared/KVCTemplate/main.js').default; 4 | 5 | describe('KVCWriteListItem_Misc', function () { 6 | 7 | const title = Array.from(Array(100)).map(Math.random).join(' '); 8 | const body = Array.from(Array(100)).map(Math.random).join(' '); 9 | 10 | before(function() { 11 | return browser.OLSKVisit(kDefaultRoute, { 12 | KVCWriteListItemObject: JSON.stringify(StubNoteObjectValid({ 13 | KVCNoteBody: title + '\n' + body, 14 | KVCNoteIsPublic: true, 15 | })), 16 | }); 17 | }); 18 | 19 | describe('KVCWriteListItemIsPublic', function test_KVCWriteListItemIsPublic () { 20 | 21 | it('sets text', function () { 22 | browser.assert.text(KVCWriteListItemIsPublic, require('../open-write/ui-logic.js').default.KVCWritePublicSymbol()); 23 | }); 24 | 25 | }); 26 | 27 | describe('KVCWriteListItemTitle', function test_KVCWriteListItemTitle () { 28 | 29 | it('sets text', function () { 30 | browser.assert.text(KVCWriteListItemTitle, KVCTemplate.KVCTemplateTruncated(title)); 31 | }); 32 | 33 | }); 34 | 35 | describe('KVCWriteListItemSnippet', function test_KVCWriteListItemSnippet () { 36 | 37 | it('calls KVCWriteListItemDispatchSnippet', function () { 38 | browser.assert.text(KVCWriteListItemSnippet, require('OLSKString').OLSKStringSnippet(body)); 39 | }); 40 | 41 | }); 42 | 43 | context('KVCNoteIsArchived', function () { 44 | 45 | before(function() { 46 | return browser.OLSKVisit(kDefaultRoute, { 47 | KVCWriteListItemObject: JSON.stringify(StubNoteObjectValid({ 48 | KVCNoteIsArchived: true, 49 | })), 50 | }); 51 | }); 52 | 53 | it('classes KVCWriteListItemArchived', function () { 54 | browser.assert.hasClass(KVCWriteListItem, 'KVCWriteListItemArchived'); 55 | }); 56 | 57 | }); 58 | 59 | }); 60 | -------------------------------------------------------------------------------- /os-app/sub-template/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/KVCWriteTemplate', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'KVCWriteTemplateStubRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'stub-view')); 8 | }, 9 | OLSKRouteLanguageCodes: ['en', 'fr', 'es', 'pt'], 10 | }]; 11 | }; 12 | -------------------------------------------------------------------------------- /os-app/sub-template/i18n-en.yml: -------------------------------------------------------------------------------- 1 | KVCWriteTemplateDataFieldText: HTML 2 | KVCWriteTemplateUpdateButtonText: Update 3 | -------------------------------------------------------------------------------- /os-app/sub-template/i18n-es.yml: -------------------------------------------------------------------------------- 1 | KVCWriteTemplateDataFieldText: HTML 2 | KVCWriteTemplateUpdateButtonText: Guardar 3 | -------------------------------------------------------------------------------- /os-app/sub-template/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | KVCWriteTemplateDataFieldText: HTML 2 | KVCWriteTemplateUpdateButtonText: Sauvegarder 3 | -------------------------------------------------------------------------------- /os-app/sub-template/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | KVCWriteTemplateDataFieldText: HTML 2 | KVCWriteTemplateUpdateButtonText: Salvar 3 | -------------------------------------------------------------------------------- /os-app/sub-template/main.svelte: -------------------------------------------------------------------------------- 1 | 17 | 18 |
19 | 20 |

21 | 22 |

23 | 24 |

25 | 26 |

27 | 28 |
29 | 30 | 32 | -------------------------------------------------------------------------------- /os-app/sub-template/rollup-start.js: -------------------------------------------------------------------------------- 1 | import RollupStart from './main.svelte'; 2 | 3 | const KVCWriteTemplate = new RollupStart({ 4 | target: document.body, 5 | props: Object.assign({ 6 | KVCWriteTemplateData: Math.random().toString(), 7 | KVCWriteTemplateDispatchUpdate: (function (inputData) { 8 | window.TestKVCWriteTemplateDispatchUpdate.innerHTML = parseInt(window.TestKVCWriteTemplateDispatchUpdate.innerHTML) + 1; 9 | window.TestKVCWriteTemplateDispatchUpdateData.innerHTML = inputData; 10 | }), 11 | }, Object.fromEntries((new window.URLSearchParams(window.location.search)).entries())), 12 | }); 13 | 14 | export default KVCWriteTemplate; 15 | -------------------------------------------------------------------------------- /os-app/sub-template/stub-view.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | locals.OLSKPagePublicConstants = { 3 | OLSKSharedPageCurrentLanguage, 4 | }; 5 | %> 6 | 7 | 8 | 9 |

10 | KVCWriteTemplateDispatchUpdate 11 | 0 12 | undefined 13 |

14 | -------------------------------------------------------------------------------- /os-app/sub-template/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | KVCWriteTemplate: '.KVCWriteTemplate', 5 | 6 | KVCWriteTemplateDataField: '.KVCWriteTemplateDataField', 7 | KVCWriteTemplateUpdateButton: '.KVCWriteTemplateUpdateButton', 8 | }).map(function (e) { 9 | return global[e.shift()] = e.pop(); 10 | }); 11 | 12 | describe('KVCWriteTemplate_Access', function () { 13 | 14 | before(function() { 15 | return browser.OLSKVisit(kDefaultRoute); 16 | }); 17 | 18 | it('shows KVCWriteTemplate', function () { 19 | browser.assert.elements(KVCWriteTemplate, 1); 20 | }); 21 | 22 | it('shows KVCWriteTemplateDataField', function () { 23 | browser.assert.elements(KVCWriteTemplateDataField, 1); 24 | }); 25 | 26 | it('shows KVCWriteTemplateUpdateButton', function () { 27 | browser.assert.elements(KVCWriteTemplateUpdateButton, 1); 28 | }); 29 | 30 | }); 31 | -------------------------------------------------------------------------------- /os-app/sub-template/ui-test-_localize.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | kDefaultRoute.OLSKRouteLanguageCodes.forEach(function (OLSKRoutingLanguage) { 4 | 5 | const uLocalized = function (inputData) { 6 | return OLSKTestingLocalized(inputData, OLSKRoutingLanguage); 7 | }; 8 | 9 | describe('KVCWriteTemplate_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | }); 15 | }); 16 | 17 | it('localizes KVCWriteTemplateDataField', function () { 18 | browser.assert.attribute(KVCWriteTemplateDataField, 'placeholder', uLocalized('KVCWriteTemplateDataFieldText')); 19 | }); 20 | 21 | it('localizes KVCWriteTemplateUpdateButton', function () { 22 | browser.assert.text(KVCWriteTemplateUpdateButton, uLocalized('KVCWriteTemplateUpdateButtonText')); 23 | }); 24 | 25 | }); 26 | 27 | }); 28 | -------------------------------------------------------------------------------- /os-app/sub-template/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('KVCWriteTemplate_Misc', function () { 4 | 5 | const KVCWriteTemplateData = Math.random().toString(); 6 | 7 | before(function() { 8 | return browser.OLSKVisit(kDefaultRoute, { 9 | KVCWriteTemplateData, 10 | }); 11 | }); 12 | 13 | describe('KVCWriteTemplate', function test_KVCWriteTemplate () { 14 | 15 | it('classes OLSKDecor', function () { 16 | browser.assert.hasClass(KVCWriteTemplate, 'OLSKDecor'); 17 | }); 18 | 19 | it('classes OLSKDecorBigForm', function () { 20 | browser.assert.hasClass(KVCWriteTemplate, 'OLSKDecorBigForm'); 21 | }); 22 | 23 | }); 24 | 25 | describe('KVCWriteTemplateDataField', function test_KVCWriteTemplateDataField () { 26 | 27 | it('binds KVCWriteTemplateData', function () { 28 | browser.assert.input(KVCWriteTemplateDataField, KVCWriteTemplateData); 29 | }); 30 | 31 | }); 32 | 33 | describe('KVCWriteTemplateUpdateButton', function test_KVCWriteTemplateUpdateButton () { 34 | 35 | context('click', function () { 36 | 37 | const item = Math.random().toString(); 38 | 39 | before(function () { 40 | browser.fill(KVCWriteTemplateDataField, item); 41 | }); 42 | 43 | before(function () { 44 | browser.assert.text('#TestKVCWriteTemplateDispatchUpdate', '0'); 45 | browser.assert.text('#TestKVCWriteTemplateDispatchUpdateData', 'undefined'); 46 | }); 47 | 48 | before(function () { 49 | browser.pressButton(KVCWriteTemplateUpdateButton); 50 | }); 51 | 52 | it('sends KVCWriteTemplateDispatchUpdate', function () { 53 | browser.assert.text('#TestKVCWriteTemplateDispatchUpdate', '1'); 54 | browser.assert.text('#TestKVCWriteTemplateDispatchUpdateData', item); 55 | }); 56 | 57 | }); 58 | 59 | }); 60 | 61 | }); 62 | -------------------------------------------------------------------------------- /os-app/tech-manifest/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/manifest.json', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'WKCManifestRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.json({ 8 | name: 'Hyperdraft', 9 | short_name: 'Hyperdraft', 10 | start_url: res.locals.OLSKCanonical('KVCWriteRoute'), 11 | display: 'standalone', 12 | background_color: 'white', 13 | theme_color: 'white', 14 | icons: [{ 15 | src: process.env.OLSK_LAYOUT_TOUCH_ICON_URL, 16 | sizes: '600x600', 17 | type: 'image/png', 18 | purpose: 'any maskable', 19 | }], 20 | }); 21 | }, 22 | }]; 23 | }; 24 | -------------------------------------------------------------------------------- /os-app/tech-manifest/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('WKCManifest_Misc', function () { 4 | 5 | it('sends json', async function () { 6 | browser.assert.deepEqual(await (await browser.fetch('http://localhost' + kDefaultRoute.OLSKRoutePath)).json(), { 7 | name: 'Hyperdraft', 8 | short_name: 'Hyperdraft', 9 | start_url: require('../open-write/controller.js').OLSKControllerRoutes().shift().OLSKRoutePath, 10 | display: 'standalone', 11 | background_color: 'white', 12 | theme_color: 'white', 13 | icons: [{ 14 | src: process.env.OLSK_LAYOUT_TOUCH_ICON_URL, 15 | sizes: '600x600', 16 | type: 'image/png', 17 | purpose: 'any maskable', 18 | }], 19 | }); 20 | }); 21 | 22 | }); 23 | -------------------------------------------------------------------------------- /os-app/tech-robots/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/robots.txt', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'WKCRobotsRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.send(require('OLSKRobots').OLSKRobotsTXT([ 8 | 'KVCVitrineRoute', 9 | 'KVCGuideRoute', 10 | ].reduce(function (coll, item) { 11 | return coll.concat(res.locals.OLSKCanonical(item)).concat((res.locals.OLSKRouteObjectFor(item).OLSKRouteLanguageCodes || []).map(function (e) { 12 | return res.locals.OLSKCanonicalLocalized(item, { 13 | OLSKRoutingLanguage: e, 14 | }); 15 | })); 16 | }, []))); 17 | }, 18 | }]; 19 | }; 20 | -------------------------------------------------------------------------------- /os-app/tech-robots/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('WKCRobots_Misc', function () { 4 | 5 | it('sends text', async function () { 6 | browser.assert.deepEqual(await (await browser.fetch('http://localhost' + kDefaultRoute.OLSKRoutePath)).text(), require('OLSKRobots').OLSKRobotsTXT([ 7 | require('../open-vitrine/controller.js').OLSKControllerRoutes().shift(), 8 | require('../open-guide/controller.js').OLSKControllerRoutes().shift(), 9 | ].reduce(function (coll, item) { 10 | return coll.concat(OLSKTestingCanonical(item)).concat((item.OLSKRouteLanguageCodes || []).map(function (e) { 11 | return OLSKTestingCanonical(item, { 12 | OLSKRoutingLanguage: e, 13 | }); 14 | })); 15 | }, []))); 16 | }); 17 | 18 | }); 19 | -------------------------------------------------------------------------------- /os-app/tech-serviceworker/controller.js: -------------------------------------------------------------------------------- 1 | const kWKCServiceWorkerVersionID = Date.now().toString(); 2 | 3 | exports.OLSKControllerRoutes = function() { 4 | return { 5 | WKCServiceWorkerRoute: { 6 | OLSKRoutePath: '/sw.js', 7 | OLSKRouteMethod: 'get', 8 | OLSKRouteFunction (req, res, next) { 9 | return res.type('js').send(require('OLSKServiceWorker').OLSKServiceWorkerView({ 10 | VERSION_ID_TOKEN: kWKCServiceWorkerVersionID, 11 | ORIGIN_PAGE_PATH_TOKEN: res.locals.OLSKCanonical('KVCWriteRoute'), 12 | })); 13 | }, 14 | }, 15 | }; 16 | }; 17 | -------------------------------------------------------------------------------- /package-postinstall.js: -------------------------------------------------------------------------------- 1 | (function OLSKPostinstallHotfix() { 2 | Object.entries(require('OLSKHotfix').OLSKHotfixPatches(process.env.NODE_ENV)).forEach(function ([path, patches]) { 3 | if (!require('fs').existsSync(path)) { 4 | return; 5 | } 6 | 7 | Object.entries(patches).forEach(function ([search, replace]) { 8 | require('fs').writeFileSync(path, require('OLSKString').OLSKStringPatch( 9 | require('fs').readFileSync(path, 'utf8'), search, replace)); 10 | }); 11 | }); 12 | })(); 13 | 14 | (function OLSKPostinstallExternalAssets() { 15 | require('./node_modules/OLSKExpress/modules/OLSKAssets/main.js').OLSKAssetsCopyAssetsFromTo([ 16 | 'codemirror', 17 | 'jszip', 18 | 'launchlet', 19 | 'normalize.css', 20 | 'OLSKInternational', 21 | 'OLSKLanguageSwitcher', 22 | 'OLSKDecor', 23 | 'OLSKRootLink', 24 | 'OLSKRouting', 25 | 'OLSKServiceWorker', 26 | 'OLSKUIAssets', 27 | 'ROCORootLink', 28 | 'webnative', 29 | ], require('path').join(__dirname, 'node_modules'), require('path').join(__dirname, 'os-app/_shared/__external')); 30 | })(); 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "postinstall": "olsk-bundle tidy && node ./package-postinstall.js", 4 | 5 | "setup": "npm install --no-save && olsk-bundle", 6 | 7 | "start": "olsk-express", 8 | 9 | "test": "olsk-spec", 10 | 11 | "build": "olsk-rollup", 12 | "watch": "olsk-rollup-watch" 13 | }, 14 | "dependencies": { 15 | "OLSKPithVitrine": "olsk/OLSKPithVitrine", 16 | 17 | "OLSKPithGuide": "olsk/OLSKPithGuide", 18 | 19 | "OLSKPithApp": "olsk/OLSKPithApp", 20 | "OLSKCatalog": "olsk/OLSKCatalog", 21 | "marked": "5.x", 22 | "escape-string-regexp": "4.x", 23 | "OLSKVersion": "olsk/OLSKVersion", 24 | "OLSKLocalStorage": "olsk/OLSKLocalStorage", 25 | "jszip": "latest", 26 | 27 | "codemirror": "rosano/CodeMirror#add-distribution", 28 | 29 | "OLSKRobots": "olsk/OLSKRobots", 30 | 31 | "OLSKServiceWorker": "olsk/OLSKServiceWorker" 32 | }, 33 | "devDependencies": { 34 | "OLSKPithToolchain": "olsk/OLSKPithToolchain", 35 | "OLSKRollupScaffold": "olsk/OLSKRollupScaffold" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /rollup-config.js: -------------------------------------------------------------------------------- 1 | export default require('OLSKRollupScaffold').OLSKRollupScaffoldScanStart(__dirname, { 2 | OLSKRollupPluginSwapTokens: Object.assign(require('OLSKUIAssets').OLSKUIAssetsSwapTokens(), { 3 | OLSK_VERSION_LIMIT_SWAP_TOKEN: process.env.OLSK_VERSION_LIMIT, 4 | 5 | OLSK_APROPOS_FEEDBACK_EMAIL_SWAP_TOKEN: Buffer.from(`mailto:${ process.env.OLSK_APROPOS_FEEDBACK_EMAIL }`).toString('base64'), 6 | 7 | KVC_TEMPLATE_NORMALIZE_URL_SWAP_TOKEN: process.env.KVC_TEMPLATE_NORMALIZE_URL, 8 | KVC_TEMPLATE_DECOR_URL_SWAP_TOKEN: process.env.KVC_TEMPLATE_DECOR_URL, 9 | 10 | OLSK_CRYPTO_PAIR_RECEIVER_PRIVATE_SWAP_TOKEN: process.env.OLSK_CRYPTO_PAIR_RECEIVER_PRIVATE, 11 | OLSK_CRYPTO_PAIR_SENDER_PUBLIC_SWAP_TOKEN: process.env.OLSK_CRYPTO_PAIR_SENDER_PUBLIC, 12 | 13 | ROCO_SHARED_PROJECT_ID_SWAP_TOKEN: process.env.ROCO_SHARED_PROJECT_ID, 14 | }), 15 | }); 16 | --------------------------------------------------------------------------------