├── .env-sample ├── .github └── workflows │ └── test-logic-and-interface.yml ├── .gitignore ├── LICENSE.md ├── README.md ├── mocha-start.js ├── os-app ├── _shared │ ├── LCHBuild │ │ ├── main-tests.js │ │ └── main.js │ ├── LCHDocument │ │ ├── main-tests.js │ │ └── main.js │ ├── LCHFlags │ │ ├── main-tests.js │ │ └── main.js │ ├── LCHFormula │ │ ├── main-tests.js │ │ └── main.js │ ├── LCHRootLink │ │ ├── controller.js │ │ ├── main.ejs │ │ ├── ui-assets │ │ │ └── identity.svg │ │ ├── ui-test-_access.js │ │ ├── ui-test-_localize.js │ │ └── ui-test-_misc.js │ ├── LCHRuntime │ │ ├── main-tests.js │ │ └── main.js │ ├── LCHSetting │ │ ├── main-tests.js │ │ └── main.js │ ├── LCHTransport │ │ ├── main-tests.js │ │ └── main.js │ └── common │ │ ├── controller.js │ │ └── ui-style.css ├── dev-launcher │ ├── api-tests.js │ ├── api.js │ ├── controller.js │ ├── i18n-en.yml │ ├── i18n-es.yml │ ├── i18n-fr.yml │ ├── i18n-pt.yml │ ├── main.svelte │ ├── recipes │ │ ├── _aggregate-tests.js │ │ ├── _aggregate.js │ │ ├── _components.js │ │ ├── actions │ │ │ ├── LCHCopyToClipboard │ │ │ │ ├── i18n-en.yml │ │ │ │ ├── i18n-es.yml │ │ │ │ ├── i18n-fr.yml │ │ │ │ ├── i18n-pt.yml │ │ │ │ ├── main-tests.js │ │ │ │ ├── main.js │ │ │ │ ├── main.svelte │ │ │ │ ├── ui-test-_access.js │ │ │ │ ├── ui-test-_localize.js │ │ │ │ └── ui-test-_misc.js │ │ │ ├── LCHDOMElementFocus │ │ │ │ ├── main-tests.js │ │ │ │ ├── main.js │ │ │ │ └── ui-test-_localize.js │ │ │ ├── LCHFlip │ │ │ │ ├── main-tests.js │ │ │ │ └── main.js │ │ │ ├── LCHLargeText │ │ │ │ ├── main-tests.js │ │ │ │ ├── main.js │ │ │ │ ├── ui-test-_access.js │ │ │ │ ├── ui-test-_localize.js │ │ │ │ └── ui-test-_misc.js │ │ │ ├── LCHRunCommand │ │ │ │ ├── main-tests.js │ │ │ │ ├── main.js │ │ │ │ └── ui-test-_localize.js │ │ │ ├── LCHSearchAction │ │ │ │ ├── main-tests.js │ │ │ │ ├── main.js │ │ │ │ └── ui-test-_localize.js │ │ │ ├── LCHServiceSearchWikipedia │ │ │ │ ├── main-tests.js │ │ │ │ └── main.js │ │ │ ├── LCHSubjectContainerShowContents │ │ │ │ ├── main-tests.js │ │ │ │ ├── main.js │ │ │ │ └── ui-test-_localize.js │ │ │ └── LCHURLOpen │ │ │ │ ├── main-tests.js │ │ │ │ ├── main.js │ │ │ │ └── ui-test-_localize.js │ │ ├── functions │ │ │ ├── LCHDateLocalOffsetSubtracted │ │ │ │ ├── main-tests.js │ │ │ │ └── main.js │ │ │ ├── LCHReadTextFile │ │ │ │ ├── main-tests.js │ │ │ │ └── main.js │ │ │ ├── LCHReadTextFileObjects │ │ │ │ ├── main-tests.js │ │ │ │ └── main.js │ │ │ └── LCHSaveFile │ │ │ │ ├── main-tests.js │ │ │ │ └── main.js │ │ ├── i18n-en.yml │ │ ├── i18n-es.yml │ │ ├── i18n-fr.yml │ │ ├── i18n-pt.yml │ │ ├── primitives │ │ │ ├── Bool │ │ │ │ ├── main-tests.js │ │ │ │ └── main.js │ │ │ ├── Date │ │ │ │ ├── main-tests.js │ │ │ │ ├── main.js │ │ │ │ └── ui-test-_localize.js │ │ │ ├── LCHPrimitiveDOMElement │ │ │ │ ├── main-tests.js │ │ │ │ ├── main.js │ │ │ │ └── ui-test-_localize.js │ │ │ ├── ServiceSearchURLTemplate │ │ │ │ ├── main-tests.js │ │ │ │ ├── main.js │ │ │ │ └── ui-test-_localize.js │ │ │ ├── String │ │ │ │ ├── main-tests.js │ │ │ │ ├── main.js │ │ │ │ └── ui-test-_localize.js │ │ │ └── URL │ │ │ │ ├── main-tests.js │ │ │ │ ├── main.js │ │ │ │ └── ui-test-_localize.js │ │ ├── subjects │ │ │ └── LCHActiveDocumentFocusElements │ │ │ │ ├── main-tests.js │ │ │ │ ├── main.js │ │ │ │ └── ui-test-_localize.js │ │ └── types │ │ │ ├── LCHTypeCommand │ │ │ ├── main-tests.js │ │ │ └── main.js │ │ │ ├── ServiceSearch │ │ │ ├── main-tests.js │ │ │ └── main.js │ │ │ └── SubjectContainer │ │ │ ├── main-tests.js │ │ │ ├── main.js │ │ │ └── ui-test-_localize.js │ ├── rollup-config-custom-tests.js │ ├── rollup-config-custom.js │ ├── rollup-start.js │ ├── submodules │ │ ├── LCHLauncherPipeItem │ │ │ ├── controller.js │ │ │ ├── main.svelte │ │ │ ├── rollup-start.js │ │ │ ├── stub-view.ejs │ │ │ ├── ui-style.css │ │ │ ├── ui-test-_access.js │ │ │ └── ui-test-_misc.js │ │ └── LCHLauncherPrompt │ │ │ ├── controller.js │ │ │ ├── main.svelte │ │ │ ├── rollup-start.js │ │ │ ├── stub-view.ejs │ │ │ ├── stub-view.svelte │ │ │ ├── ui-style.css │ │ │ ├── ui-test-_access.js │ │ │ └── ui-test-_misc.js │ ├── ui-behaviour.js │ ├── ui-logic-tests.js │ ├── ui-logic.js │ ├── ui-style-tests.js │ ├── ui-style.css │ ├── ui-test-_access.js │ ├── ui-test-_localize.js │ ├── ui-test-_misc-commit.js │ ├── ui-test-_misc-pipe.js │ ├── ui-test-_misc-preview.js │ ├── ui-test-backspace.js │ ├── ui-test-dot-mode.js │ ├── ui-test-object-prompt.js │ ├── ui-test-page.js │ ├── ui-test-pendext.js │ ├── ui-test-prompt.js │ ├── ui-test-recipes.js │ ├── ui-test-result-list.js │ ├── ui-test-safety.js │ ├── ui-test-tasks.js │ ├── ui-test-throttle.js │ └── ui-view.ejs ├── dev-launchxr │ ├── controller.js │ ├── logic-tests.js │ ├── logic.js │ ├── main.svelte │ ├── package-tests.js │ ├── package.js │ ├── rollup-config-custo.js │ ├── rollup-config-custom-tests.js │ ├── rollup-start.js │ ├── stub-behaviour.js │ ├── stub-view.ejs │ ├── submodules │ │ ├── LCHLaunchxrPrompt │ │ │ ├── controller.js │ │ │ ├── main.svelte │ │ │ ├── rollup-start.js │ │ │ ├── stub-view.ejs │ │ │ ├── ui-test-_access.js │ │ │ ├── ui-test-_misc.js │ │ │ ├── ui-test-filter.js │ │ │ └── ui-test-shortcuts.js │ │ ├── LCHLaunchxrResultItem │ │ │ ├── controller.js │ │ │ ├── main.svelte │ │ │ ├── rollup-start.js │ │ │ ├── stub-view.ejs │ │ │ ├── ui-test-_access.js │ │ │ └── ui-test-_misc.js │ │ ├── sub-command │ │ │ ├── i18n-en.yml │ │ │ ├── i18n-es.yml │ │ │ ├── i18n-fr.yml │ │ │ ├── i18n-pt.yml │ │ │ ├── main.svelte │ │ │ ├── ui-test-_access.js │ │ │ ├── ui-test-_localize.js │ │ │ ├── ui-test-_misc.js │ │ │ ├── ui-test-filter.js │ │ │ └── ui-test-shortcuts.js │ │ └── sub-pipe │ │ │ ├── i18n-en.yml │ │ │ ├── i18n-es.yml │ │ │ ├── i18n-fr.yml │ │ │ ├── i18n-pt.yml │ │ │ ├── main.svelte │ │ │ ├── ui-test-_access.js │ │ │ ├── ui-test-_localize.js │ │ │ └── ui-test-_misc.js │ ├── ui-test-_access.js │ └── ui-test-_misc.js ├── dev-package │ ├── README.md │ ├── controller.js │ ├── main-tests.js │ ├── main.js │ ├── package.json │ ├── rollup-config-custom-tests.js │ ├── rollup-config-custom.js │ ├── rollup-start.js │ ├── ui-behaviour.js │ ├── ui-style-tests.js │ ├── ui-test-_access.js │ └── ui-view.ejs ├── open-compose │ ├── controller.js │ ├── i18n-en.yml │ ├── i18n-es.yml │ ├── i18n-fr.yml │ ├── i18n-pt.yml │ ├── main.svelte │ ├── rollup-start.js │ ├── submodules │ │ ├── LCHComposeBuild │ │ │ ├── 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 │ │ ├── LCHComposeDetail │ │ │ ├── controller.js │ │ │ ├── i18n-en.yml │ │ │ ├── i18n-es.yml │ │ │ ├── i18n-fr.yml │ │ │ ├── i18n-pt.yml │ │ │ ├── main.svelte │ │ │ ├── rollup-start.js │ │ │ ├── stub-view.ejs │ │ │ ├── ui-style.css │ │ │ ├── ui-test-_access.js │ │ │ ├── ui-test-_localize.js │ │ │ └── ui-test-_misc.js │ │ ├── LCHComposeInput │ │ │ ├── controller.js │ │ │ ├── main.svelte │ │ │ ├── rollup-start.js │ │ │ ├── stub-view.ejs │ │ │ ├── ui-test-_access.js │ │ │ └── ui-test-_misc.js │ │ ├── LCHComposeListItem │ │ │ ├── controller.js │ │ │ ├── i18n-en.yml │ │ │ ├── i18n-es.yml │ │ │ ├── i18n-fr.yml │ │ │ ├── i18n-pt.yml │ │ │ ├── main.svelte │ │ │ ├── rollup-start.js │ │ │ ├── stub-view.ejs │ │ │ ├── ui-logic-tests.js │ │ │ ├── ui-logic.js │ │ │ ├── ui-test-_access.js │ │ │ ├── ui-test-_localize.js │ │ │ └── ui-test-_misc.js │ │ └── LCHComposePair │ │ │ ├── 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 │ ├── 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-pair.js │ ├── ui-test-safety.js │ ├── ui-test-sync.js │ ├── ui-test-transport.js │ └── ui-view.ejs ├── open-guide │ ├── controller.js │ ├── i18n-en.yml │ ├── i18n-pt.yml │ ├── text-en.md │ ├── ui-logic-tests.js │ ├── ui-logic.js │ ├── 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 │ ├── main.js │ ├── recipes-tests.js │ ├── recipes.js │ ├── rollup-config-custom-tests.js │ ├── rollup-config-custom.js │ ├── rollup-start.js │ ├── submodules │ │ └── LCHFeatureList │ │ │ ├── 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 │ ├── text-en.md │ ├── text-es.md │ ├── text-fr.md │ ├── text-pt.md │ ├── ui-style.css │ ├── ui-test-_access.js │ ├── ui-test-_localize.js │ ├── ui-test-_misc.js │ ├── ui-test-demo-commit.js │ ├── ui-test-demo-pipe.js │ ├── ui-test-demo-preview.js │ └── ui-view.ejs ├── 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 | LCH_SHARED_EXTENSION_DOCS_URL=https://github.com/rosano/launchlet-extension 2 | LCH_SHARED_PACKAGE_DOCS_URL=https://github.com/rosano/launchlet/blob/master/os-app/dev-package/README.md 3 | 4 | LCH_VITRINE_VIDEO_URL_1="https://www.youtube-nocookie.com/embed/JOrt_zgKtgY" 5 | LCH_VITRINE_VIDEO_URL_2="https://www.youtube-nocookie.com/embed/-G0GswR1diA" 6 | LCH_VITRINE_VIDEO_URL_3="https://www.youtube-nocookie.com/embed/eKFfzGlEmos?start=2m23s" 7 | LCH_VITRINE_VIDEO_URL_4="https://www.youtube-nocookie.com/embed/4pH6tS7x_nA" 8 | LCH_VITRINE_TUTORIALS_URL="https://rosano.hmm.garden/01f1ghgrgxq5adk0sdck3csghh" 9 | 10 | LCH_SHARED_BRUEGHEL_URL=https://static.rosano.ca/launchlet/brueghel.jpg 11 | 12 | SWAR_LINK_URL=https://ring.0data.app/#random 13 | 14 | OLSK_REPO_URL=https://github.com/rosano/launchlet 15 | 16 | OLSK_APROPOS_FEEDBACK_EMAIL="XXXXX" 17 | 18 | OLSK_LAYOUT_TOUCH_ICON_URL=https://static.rosano.ca/launchlet/touch.png 19 | 20 | ROCO_SHARED_PROJECT_ID=RP_001 21 | 22 | # optionally in .env-crypto 23 | OLSK_CRYPTO_PAIR_RECEIVER_PRIVATE="XXXXX" 24 | OLSK_CRYPTO_PAIR_SENDER_PUBLIC="XXXXX" 25 | -------------------------------------------------------------------------------- /.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 -os-skip=launchxr --ci' 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # NODE 2 | node_modules 3 | package-lock.json 4 | 5 | # BUILD 6 | **/__*/* 7 | .static 8 | 9 | # LOCAL 10 | .env* 11 | !.env-sample 12 | -------------------------------------------------------------------------------- /os-app/_shared/LCHFlags/main.js: -------------------------------------------------------------------------------- 1 | import { parse } from 'acorn'; 2 | import { simple } from 'acorn-walk'; 3 | 4 | const mod = { 5 | 6 | _LCHFlags (inputData) { 7 | if (typeof inputData !== 'string') { 8 | throw new Error('LCHErrorInputNotValid'); 9 | } 10 | 11 | let ast = parse(inputData); 12 | 13 | if (!ast.body.length) { 14 | return []; 15 | } 16 | 17 | if (ast.body.length > 1) { 18 | return ['LCHFlagMultipleExpressions']; 19 | } 20 | 21 | if (ast.body[0].type === 'ExpressionStatement' && ast.body[0].expression.type === 'SequenceExpression' && ast.body[0].expression.expressions.length > 1) { 22 | return ['LCHFlagMultipleExpressions']; 23 | } 24 | 25 | let outputData = []; 26 | 27 | function flagIdentifier(inputData) { 28 | if (['eval', 'Function'].includes(inputData)) { 29 | outputData.push('LCHFlagEval'); 30 | } 31 | 32 | if (['cookie', 'localStorage', 'sessionStorage', 'indexedDB', 'Cache'].includes(inputData)) { 33 | outputData.push('LCHFlagStateful'); 34 | } 35 | 36 | if (['XMLHttpRequest', '$', 'fetch'].includes(inputData)) { 37 | outputData.push('LCHFlagStateful'); 38 | } 39 | } 40 | 41 | simple(ast, { 42 | Identifier(node) { 43 | flagIdentifier(node.name); 44 | }, 45 | MemberExpression(node) { 46 | flagIdentifier(node.property.name); 47 | }, 48 | }); 49 | 50 | return outputData; 51 | }, 52 | 53 | LCHFlags (inputData) { 54 | if (typeof inputData !== 'object' || inputData === null) { 55 | throw new Error('LCHErrorInputNotValid'); 56 | } 57 | 58 | return Object.entries(inputData).reduce(function (coll, item) { 59 | const flags = typeof item[1] === 'string' ? mod._LCHFlags(item[1]) : []; 60 | 61 | if (flags.length) { 62 | (coll = coll || {})[item[0]] = flags; 63 | } 64 | 65 | return coll; 66 | }, null); 67 | }, 68 | 69 | }; 70 | 71 | export default mod; 72 | -------------------------------------------------------------------------------- /os-app/_shared/LCHRootLink/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/LCHRootLink', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteFunction (req, res, next) { 6 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'main')); 7 | }, 8 | OLSKRouteSignature: 'LCHRootLinkStubRoute', 9 | OLSKRouteLanguageCodes: ['en'], 10 | OLSKRouteIsHidden: process.env.NODE_ENV === 'production', 11 | }]; 12 | }; 13 | -------------------------------------------------------------------------------- /os-app/_shared/LCHRootLink/main.ejs: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /os-app/_shared/LCHRootLink/ui-assets/identity.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /os-app/_shared/LCHRootLink/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | LCHRootLink: '.LCHRootLink', 5 | }).map(function (e) { 6 | return global[e.shift()] = e.pop(); 7 | }); 8 | 9 | describe('LCHRootLink_Access', function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute); 13 | }); 14 | 15 | it('shows LCHRootLink', function() { 16 | browser.assert.elements(LCHRootLink, 1); 17 | }); 18 | 19 | it('shows OLSKRootLink', function() { 20 | browser.assert.elements('.OLSKRootLink', 1); 21 | }) 22 | 23 | }); 24 | -------------------------------------------------------------------------------- /os-app/_shared/LCHRootLink/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(`LCHRootLink_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/LCHRootLink/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('LCHRootLink_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/LCHSetting/main.js: -------------------------------------------------------------------------------- 1 | const mod = { 2 | 3 | LCHSettingErrors (inputData, options = {}) { 4 | if (typeof inputData !== 'object' || inputData === null) { 5 | throw new Error('LCHErrorInputNotValid'); 6 | } 7 | 8 | const errors = {}; 9 | 10 | if (typeof inputData.LCHSettingKey !== 'string') { 11 | errors.LCHSettingKey = [ 12 | 'LCHErrorNotString', 13 | ]; 14 | } else if (!inputData.LCHSettingKey.trim()) { 15 | errors.LCHSettingKey = [ 16 | 'LCHErrorNotFilled', 17 | ]; 18 | } 19 | 20 | if (typeof inputData.LCHSettingValue !== 'string') { 21 | errors.LCHSettingValue = [ 22 | 'LCHErrorNotString', 23 | ]; 24 | } 25 | 26 | return Object.entries(errors).length ? errors : null; 27 | }, 28 | 29 | LCHSettingDirectory () { 30 | return 'lch_settings'; 31 | }, 32 | 33 | LCHSettingObjectPath (inputData) { 34 | return `${ mod.LCHSettingDirectory() }/${ inputData.LCHSettingKey }`; 35 | }, 36 | 37 | LCHSettingStub (inputData) { 38 | return { 39 | LCHSettingKey: inputData.split('/').pop(), 40 | }; 41 | }, 42 | 43 | }; 44 | 45 | export default Object.assign(mod, { 46 | ZDRSchemaKey: 'LCHSetting', 47 | ZDRSchemaDispatchValidate: mod.LCHSettingErrors, 48 | ZDRSchemaPath: mod.LCHSettingObjectPath, 49 | ZDRSchemaStub: mod.LCHSettingStub, 50 | ZDRSchemaMethods: { 51 | 52 | async LCHSettingList () { 53 | return Object.values(await this.App.LCHSetting.ZDRModelListObjects()); 54 | }, 55 | 56 | }, 57 | }); 58 | 59 | -------------------------------------------------------------------------------- /os-app/_shared/LCHTransport/main.js: -------------------------------------------------------------------------------- 1 | import OLSKRemoteStorage from 'OLSKRemoteStorage'; 2 | 3 | export default { 4 | ZDRSchemaKey: 'LCHTransport', 5 | ZDRSchemaDispatchValidate: (function () {}), 6 | ZDRSchemaPath: (function () {}), 7 | ZDRSchemaStub: (function () {}), 8 | ZDRSchemaMethods: { 9 | 10 | async LCHTransportImport (inputData) { 11 | if (typeof inputData !== 'object' || inputData === null) { 12 | throw new Error('LCHErrorInputNotValid'); 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('LCHErrorInputNotValid'); 20 | } 21 | 22 | return [key, await ({ 23 | LCHDocument: (function () { 24 | return Promise.all(value.map(function (e) { 25 | return _this.App.LCHDocument.LCHDocumentCreate(e).catch(function () { 26 | throw new Error('LCHErrorInputNotValid'); 27 | }); 28 | })); 29 | }), 30 | LCHSetting: (function () { 31 | return Promise.all(value.map(function (e) { 32 | return _this.App.LCHSetting.ZDRModelWriteObject(e).catch(function () { 33 | throw new Error('LCHErrorInputNotValid'); 34 | }); 35 | })); 36 | }), 37 | }[key]())]; 38 | }))); 39 | }, 40 | 41 | LCHTransportExport (inputData) { 42 | if (typeof inputData !== 'object' || inputData === null) { 43 | throw new Error('LCHErrorInputNotValid'); 44 | } 45 | 46 | return Object.entries(inputData).reduce(function (coll, [key, value]) { 47 | if (!Array.isArray(value)) { 48 | throw new Error('LCHErrorInputNotValid'); 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 | --OLSKCommonBackground: hsl(0, 0%, 98%); 3 | --OLSKCommonForeground: hsl(0, 0%, 0%); 4 | } 5 | 6 | .OLSKDecor li code { 7 | margin: 2px 0; 8 | } 9 | -------------------------------------------------------------------------------- /os-app/dev-launcher/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/launcher', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'LCHLauncherRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'ui-view')); 8 | }, 9 | OLSKRouteLanguageCodes: ['en', 'fr', 'es', 'pt'], 10 | OLSKRouteIsHidden: process.env.NODE_ENV === 'production', 11 | }]; 12 | }; 13 | -------------------------------------------------------------------------------- /os-app/dev-launcher/i18n-en.yml: -------------------------------------------------------------------------------- 1 | LCHLauncherInputPlaceholderDefault: Type to search 2 | LCHLauncherInputPlaceholderPreview: Type to filter 3 | LCHLauncherSubjectPromptPlaceholderText: Type to search 4 | LCHLauncherSubjectPromptHeadingText: Subject 5 | LCHLauncherActionPromptHeadingText: Action 6 | LCHLauncherObjectPromptHeadingText: Object 7 | -------------------------------------------------------------------------------- /os-app/dev-launcher/i18n-es.yml: -------------------------------------------------------------------------------- 1 | LCHLauncherInputPlaceholderDefault: Escribir para buscar 2 | LCHLauncherInputPlaceholderPreview: Escribir para filtrar 3 | LCHLauncherSubjectPromptPlaceholderText: Escribir para buscar 4 | LCHLauncherSubjectPromptHeadingText: Sujeto 5 | LCHLauncherActionPromptHeadingText: Acto 6 | LCHLauncherObjectPromptHeadingText: Objeto 7 | -------------------------------------------------------------------------------- /os-app/dev-launcher/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | LCHLauncherInputPlaceholderDefault: Taper pour chercher 2 | LCHLauncherInputPlaceholderPreview: Taper pour filtrer 3 | LCHLauncherSubjectPromptPlaceholderText: Taper pour chercher 4 | LCHLauncherSubjectPromptHeadingText: Sujet 5 | LCHLauncherActionPromptHeadingText: Action 6 | LCHLauncherObjectPromptHeadingText: Objet 7 | -------------------------------------------------------------------------------- /os-app/dev-launcher/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | LCHLauncherInputPlaceholderDefault: Digitar para pesquisar 2 | LCHLauncherInputPlaceholderPreview: Digitar para filtrar 3 | LCHLauncherSubjectPromptPlaceholderText: Digitar para pesquisar 4 | LCHLauncherSubjectPromptHeadingText: Sujeito 5 | LCHLauncherActionPromptHeadingText: Ação 6 | LCHLauncherObjectPromptHeadingText: Objeto 7 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/_aggregate-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./_aggregate.js'); 4 | 5 | describe('LCHLauncherStandardRecipes', function test_LCHLauncherStandardRecipes() { 6 | 7 | it('returns LCHRecipe for each folder', function() { 8 | const item = [].concat.apply([], require('glob').globSync('*/**/main.js', { 9 | matchBase: true, 10 | cwd: __dirname, 11 | }).map(function (e) { 12 | return Object.entries(require(`./${ e }`)).filter(function (e) { 13 | return e.shift().includes('Recipe'); 14 | }).map(function (e) { 15 | return e.pop()(); 16 | }); 17 | })); 18 | 19 | deepEqual(item.filter(function (e) { 20 | return !mod.LCHLauncherStandardRecipes().filter(function (e2) { 21 | return e2.LCHRecipeCallback === e.LCHRecipeCallback; 22 | }).length; 23 | }), []); 24 | }); 25 | 26 | }); 27 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/_components.js: -------------------------------------------------------------------------------- 1 | import _LCHCopyToClipboard from './actions/LCHCopyToClipboard/main.svelte'; 2 | export const LCHCopyToClipboard = _LCHCopyToClipboard; 3 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHCopyToClipboard/i18n-en.yml: -------------------------------------------------------------------------------- 1 | LCHCopyToClipboardButtonText: Copy to clipboard 2 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHCopyToClipboard/i18n-es.yml: -------------------------------------------------------------------------------- 1 | LCHCopyToClipboardButtonText: Copiar al portapapeles 2 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHCopyToClipboard/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | LCHCopyToClipboardButtonText: Copier dans le presse-papier 2 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHCopyToClipboard/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | LCHCopyToClipboardButtonText: Cópia na área de transferência 2 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHCopyToClipboard/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHCopyToClipboardCallback', function test_LCHCopyToClipboardCallback() { 6 | 7 | it('throws error if not string', function() { 8 | throws(function() { 9 | mod.LCHCopyToClipboardCallback(null); 10 | }, /LCHErrorInputNotValid/); 11 | }); 12 | 13 | it('throws error if empty', function() { 14 | throws(function() { 15 | mod.LCHCopyToClipboardCallback(''); 16 | }, /LCHErrorInputNotValid/); 17 | }); 18 | 19 | it('throws error if only whitespace', function() { 20 | throws(function() { 21 | mod.LCHCopyToClipboardCallback(' '); 22 | }, /LCHErrorInputNotValid/); 23 | }); 24 | 25 | it('returns LCHComponentDescriptor', function() { 26 | deepEqual(mod.LCHCopyToClipboardCallback('alfa'), { 27 | LCHComponentDescriptorName: 'LCHCopyToClipboard', 28 | LCHComponentDescriptorCompletionHandlerSignature: 'LCHCopyToClipboardCompletionHandler', 29 | LCHComponentDescriptorProps: { 30 | inputData: 'alfa', 31 | }, 32 | LCHComponentDescriptorOLSKLocalized: true, 33 | }); 34 | }); 35 | 36 | }); 37 | 38 | describe('LCHCopyToClipboardRecipe', function test_LCHCopyToClipboardRecipe() { 39 | 40 | it('returns LCHRecipe', function() { 41 | deepEqual(mod.LCHCopyToClipboardRecipe(), { 42 | LCHRecipeSignature: 'LCHCopyToClipboard', 43 | LCHRecipeInputTypes: 'String', 44 | LCHRecipeCallback: mod.LCHCopyToClipboardCallback, 45 | }); 46 | }); 47 | 48 | }); 49 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHCopyToClipboard/main.js: -------------------------------------------------------------------------------- 1 | export const LCHCopyToClipboardCallback = function(inputData) { 2 | if (typeof inputData !== 'string') { 3 | throw new Error('LCHErrorInputNotValid'); 4 | } 5 | 6 | if (!inputData.trim().length) { 7 | throw new Error('LCHErrorInputNotValid'); 8 | } 9 | 10 | // if (typeof navigator !== 'undefined' && navigator.clipboard) { 11 | // return Promise.resolve((async function () { 12 | // return await navigator.clipboard.writeText(inputData); 13 | // })()); 14 | // } 15 | 16 | // if (typeof document !== 'undefined') { 17 | // (function () { 18 | // const el = document.createElement('textarea'); 19 | 20 | // el.value = inputData; 21 | 22 | // el.setAttribute('readonly', ''); 23 | // el.style.position = 'fixed'; 24 | // el.style.top = 0; 25 | 26 | // document.body.appendChild(el); 27 | // el.select(); 28 | // document.execCommand('copy'); 29 | 30 | // el.remove(); 31 | // })(); 32 | // } 33 | 34 | return { 35 | LCHComponentDescriptorName: 'LCHCopyToClipboard', 36 | LCHComponentDescriptorProps: { 37 | inputData: inputData, 38 | }, 39 | LCHComponentDescriptorCompletionHandlerSignature: 'LCHCopyToClipboardCompletionHandler', 40 | LCHComponentDescriptorOLSKLocalized: true, 41 | }; 42 | }; 43 | 44 | export const LCHCopyToClipboardRecipe = function() { 45 | return { 46 | LCHRecipeSignature: 'LCHCopyToClipboard', 47 | LCHRecipeInputTypes: 'String', 48 | LCHRecipeCallback: LCHCopyToClipboardCallback, 49 | }; 50 | }; 51 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHCopyToClipboard/main.svelte: -------------------------------------------------------------------------------- 1 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHCopyToClipboard/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('../../../controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | LCHCopyToClipboardButton: '.LCHCopyToClipboardButton', 5 | }).map(function (e) { 6 | return global[e.shift()] = e.pop(); 7 | }); 8 | 9 | describe('LCHCopyToClipboard_Access', function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | LCHOptionMode: 'LCHModePipe', 14 | }); 15 | }); 16 | 17 | before(function() { 18 | return browser.OLSKFireKeyboardEvent(browser.window, '.'); 19 | }); 20 | 21 | before(function() { 22 | browser.fill('.LCHLauncherPromptDotModeInput', 'alfa'); 23 | 24 | browser.OLSKFireKeyboardEvent(browser.window, 'Enter'); 25 | }); 26 | 27 | it('shows LCHCopyToClipboardButton', function() { 28 | browser.assert.elements(LCHCopyToClipboardButton, 1); 29 | }); 30 | 31 | context('click', function () { 32 | 33 | before(function () { 34 | return browser.pressButton(LCHCopyToClipboardButton); 35 | }); 36 | 37 | it('hides LCHCopyToClipboardButton', function() { 38 | browser.assert.elements(LCHCopyToClipboardButton, 0); 39 | }); 40 | 41 | }); 42 | 43 | }); 44 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHCopyToClipboard/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('LCHCopyToClipboard_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | LCHOptionMode: 'LCHModePipe', 15 | }); 16 | }); 17 | 18 | before(function() { 19 | return browser.OLSKFireKeyboardEvent(browser.window, '.'); 20 | }); 21 | 22 | before(function() { 23 | return browser.fill('.LCHLauncherPromptDotModeInput', 'alfa'); 24 | }); 25 | 26 | it('localizes LCHLauncherPipeItemTitle', function() { 27 | browser.assert.text('.LCHLauncherPipeItemTitle', uLocalized('LCHStandardRecipeNames').LCHCopyToClipboard); 28 | }); 29 | 30 | context('callback', function () { 31 | 32 | before(function() { 33 | browser.OLSKFireKeyboardEvent(browser.window, 'Enter'); 34 | }); 35 | 36 | it('localizes LCHCopyToClipboardButton', function() { 37 | browser.assert.text(LCHCopyToClipboardButton, uLocalized('LCHCopyToClipboardButtonText')); 38 | }); 39 | 40 | }); 41 | 42 | }); 43 | 44 | }); 45 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHCopyToClipboard/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('../../../controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | LCHCopyToClipboardButton: '.LCHCopyToClipboardButton', 5 | }).map(function (e) { 6 | return global[e.shift()] = e.pop(); 7 | }); 8 | 9 | describe('LCHCopyToClipboard_Misc', function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | StubRecipes: uStubStringify([{ 14 | LCHRecipeName: 'alfa', 15 | LCHRecipeCallback: function () { 16 | return this.api.LCHCopyToClipboard('bravo'); 17 | }, 18 | }]), 19 | }); 20 | }); 21 | 22 | before(function() { 23 | browser.assert.elements(LCHCopyToClipboardButton, 0); 24 | }); 25 | 26 | before(function() { 27 | return browser.fill('.LCHLauncherFilterInput', 'alfa'); 28 | }); 29 | 30 | before(function() { 31 | return browser.click('.LCHLauncherPipeItem'); 32 | }); 33 | 34 | it('focuses LCHCopyToClipboardButton', function() { 35 | browser.assert.hasFocus(LCHCopyToClipboardButton); 36 | }); 37 | 38 | context('click', function () { 39 | 40 | before(function () { 41 | return browser.pressButton(LCHCopyToClipboardButton); 42 | }); 43 | 44 | it('hides LCHLauncher', function() { 45 | browser.assert.elements('.LCHLauncher', 0); 46 | }); 47 | 48 | }); 49 | 50 | }); 51 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHDOMElementFocus/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHDOMElementFocusCallback', function test_LCHDOMElementFocusCallback() { 6 | 7 | it('returns undefined', function() { 8 | deepEqual(mod.LCHDOMElementFocusCallback(), undefined); 9 | }); 10 | 11 | }); 12 | 13 | describe('LCHDOMElementFocusRecipe', function test_LCHDOMElementFocusRecipe() { 14 | 15 | it('returns LCHRecipe', function() { 16 | deepEqual(mod.LCHDOMElementFocusRecipe(), { 17 | LCHRecipeSignature: 'LCHDOMElementFocus', 18 | LCHRecipeInputTypes: 'DOMElement', 19 | LCHRecipeCallback: mod.LCHDOMElementFocusCallback, 20 | }); 21 | }); 22 | 23 | }); 24 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHDOMElementFocus/main.js: -------------------------------------------------------------------------------- 1 | export const LCHDOMElementFocusCallback = function(inputData) { 2 | if (!inputData) { 3 | return; 4 | } 5 | 6 | inputData.focus(); 7 | }; 8 | 9 | export const LCHDOMElementFocusRecipe = function() { 10 | return { 11 | LCHRecipeSignature: 'LCHDOMElementFocus', 12 | LCHRecipeInputTypes: 'DOMElement', 13 | LCHRecipeCallback: LCHDOMElementFocusCallback, 14 | }; 15 | }; 16 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHDOMElementFocus/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('LCHDOMElementFocus_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | LCHOptionMode: 'LCHModePipe', 15 | }); 16 | }); 17 | 18 | before(function() { 19 | browser.OLSKFireKeyboardEvent(browser.window, 'LCHActiveDocumentFocusElements'); 20 | return browser.OLSKFireKeyboardEvent(browser.window, 'Enter'); 21 | }); 22 | 23 | it('localizes LCHLauncherPipeItemTitle', function() { 24 | browser.assert.text(`${ LCHLauncherActionPromptItemSelected } ${ LCHLauncherPipeItemTitle }`, uLocalized('LCHStandardRecipeNames').LCHDOMElementFocus); 25 | }); 26 | 27 | }); 28 | 29 | }); 30 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHFlip/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHFlip', function test_LCHFlip() { 6 | 7 | it('throws error if not function', function() { 8 | throws(function() { 9 | mod.LCHFlip(null); 10 | }, /LCHErrorInputNotValid/); 11 | }); 12 | 13 | it('returns function', function() { 14 | deepEqual(typeof mod.LCHFlip(function() {}, []), 'function'); 15 | }); 16 | 17 | it('passes param2 to this', function() { 18 | deepEqual(mod.LCHFlip(function() { 19 | return this.alfa; 20 | }, { 21 | alfa: 'bravo', 22 | })(), 'bravo'); 23 | }); 24 | 25 | context('function', function () { 26 | 27 | it('reverses parameters', function () { 28 | deepEqual(mod.LCHFlip(function() { 29 | return [...arguments]; 30 | })('alfa', 'bravo'), ['bravo', 'alfa']); 31 | }); 32 | 33 | }); 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHFlip/main.js: -------------------------------------------------------------------------------- 1 | export const LCHFlip = function(param1, param2) { 2 | if (typeof param1 !== 'function') { 3 | throw new Error('LCHErrorInputNotValid'); 4 | } 5 | 6 | return function() { 7 | return param1.apply(param2, [...arguments].reverse()); 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHLargeText/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHLargeTextCallback', function test_LCHLargeTextCallback() { 6 | 7 | it('returns undefined', function() { 8 | deepEqual(mod.LCHLargeTextCallback('alfa'), undefined); 9 | }); 10 | 11 | }); 12 | 13 | describe('LCHLargeTextRecipe', function test_LCHLargeTextRecipe() { 14 | 15 | it('returns LCHRecipe', function() { 16 | deepEqual(mod.LCHLargeTextRecipe(), { 17 | LCHRecipeSignature: 'LCHLargeText', 18 | LCHRecipeInputTypes: 'String', 19 | LCHRecipeCallback: mod.LCHLargeTextCallback, 20 | }); 21 | }); 22 | 23 | }); 24 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHLargeText/main.js: -------------------------------------------------------------------------------- 1 | export const LCHLargeTextCallback = function(inputData) { 2 | if (typeof document === 'undefined') { 3 | return; 4 | } 5 | 6 | const rootElement = document.createElement('div'); 7 | rootElement.className = 'LCHLargeTextContainer'; 8 | 9 | for (let [key, value] of Object.entries({ 10 | width: '100%', 11 | 12 | position: 'fixed', 13 | top: '45%', 14 | left: '0', 15 | 16 | textAlign: 'center', 17 | 18 | cursor: 'default', 19 | })) { 20 | rootElement.style[key] = value; 21 | } 22 | 23 | const span = document.createElement('span'); 24 | span.textContent = inputData; 25 | rootElement.appendChild(span); 26 | 27 | for (let [key, value] of Object.entries({ 28 | display: 'block-inline', 29 | borderRadius: '20px', 30 | boxShadow: '0 0 10px 0px hsla(0, 0%, 0%, 0.1)', 31 | padding: '20px', 32 | 33 | background: 'hsla(0, 0%, 0%, 0.8)', 34 | color: 'white', 35 | fontFamily: 'Arial', 36 | fontSize: '72pt', 37 | fontWeight: 'bold', 38 | textAlign: 'center', 39 | textShadow: '5px 5px 10px hsla(0, 0%, 0%, 0.5)', 40 | overflowWrap: 'break-word', 41 | })) { 42 | span.style[key] = value; 43 | } 44 | 45 | document.body.appendChild(rootElement); 46 | 47 | let handler = function (event) { 48 | event.preventDefault(); 49 | 50 | if (!event.key && rootElement.contains(event.target)) { 51 | return; 52 | } 53 | 54 | window.removeEventListener('click', handler); 55 | window.removeEventListener('keydown', handler); 56 | 57 | rootElement.remove(); 58 | }; 59 | 60 | setTimeout(function () { 61 | window.addEventListener('click', handler); 62 | window.addEventListener('keydown', handler); 63 | }); 64 | }; 65 | 66 | export const LCHLargeTextRecipe = function() { 67 | return { 68 | LCHRecipeSignature: 'LCHLargeText', 69 | LCHRecipeInputTypes: 'String', 70 | LCHRecipeCallback: LCHLargeTextCallback, 71 | }; 72 | }; 73 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHLargeText/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('../../../controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | LCHLargeTextContainer: '.LCHLargeTextContainer', 5 | }).map(function (e) { 6 | return global[e.shift()] = e.pop(); 7 | }); 8 | 9 | describe('LCHLargeText_Access', function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | StubRecipes: uStubStringify([{ 14 | LCHRecipeName: 'alfa', 15 | LCHRecipeCallback: function () { 16 | return this.api.LCHLargeText('bravo'); 17 | }, 18 | }]), 19 | }); 20 | }); 21 | 22 | before(function() { 23 | browser.assert.elements(LCHLargeTextContainer, 0); 24 | }); 25 | 26 | before(function() { 27 | return browser.fill(LCHLauncherFilterInput, 'alfa'); 28 | }); 29 | 30 | before(function() { 31 | browser.click(LCHLauncherListItem); 32 | }); 33 | 34 | it('on run', function() { 35 | browser.assert.elements(LCHLargeTextContainer, 1); 36 | }); 37 | 38 | }); 39 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHLargeText/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('LCHLargeText_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | LCHOptionMode: 'LCHModePipe', 15 | }); 16 | }); 17 | 18 | before(function() { 19 | return browser.OLSKFireKeyboardEvent(browser.window, '.'); 20 | }); 21 | 22 | before(function() { 23 | browser.fill(LCHLauncherPromptDotModeInput, 'alfa'); 24 | 25 | browser.OLSKFireKeyboardEvent(browser.window, 'Tab'); 26 | 27 | return browser.OLSKFireKeyboardEvent(browser.window, 'LCHLargeText'); 28 | }); 29 | 30 | it('localizes LCHLauncherPipeItemTitle', function() { 31 | browser.assert.text(`${ LCHLauncherActionPromptItemSelected } ${ LCHLauncherPipeItemTitle }`, uLocalized('LCHStandardRecipeNames').LCHLargeText); 32 | }); 33 | 34 | }); 35 | 36 | }); 37 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHRunCommand/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHRunCommandCallback', function test_LCHRunCommandCallback() { 6 | 7 | it('returns inputData', function() { 8 | const item = function () {}; 9 | deepEqual(mod.LCHRunCommandCallback(item), item); 10 | }); 11 | 12 | }); 13 | 14 | describe('LCHRunCommandRecipe', function test_LCHRunCommandRecipe() { 15 | 16 | it('returns LCHRecipe', function() { 17 | deepEqual(mod.LCHRunCommandRecipe(), { 18 | LCHRecipeSignature: 'LCHRunCommand', 19 | LCHRecipeInputTypes: 'Command', 20 | LCHRecipeCallback: mod.LCHRunCommandCallback, 21 | }); 22 | }); 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHRunCommand/main.js: -------------------------------------------------------------------------------- 1 | export const LCHRunCommandCallback = function(inputData) { 2 | return inputData; 3 | }; 4 | 5 | export const LCHRunCommandRecipe = function() { 6 | return { 7 | LCHRecipeSignature: 'LCHRunCommand', 8 | LCHRecipeInputTypes: 'Command', 9 | LCHRecipeCallback: LCHRunCommandCallback, 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHRunCommand/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('LCHRunCommand_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | StubRecipes: uStubStringify(uStubTwoItems()), 15 | LCHOptionMode: 'LCHModePipe', 16 | }); 17 | }); 18 | 19 | before(function() { 20 | browser.OLSKFireKeyboardEvent(browser.window, 'alfa'); 21 | }); 22 | 23 | it('localizes LCHLauncherPipeItemTitle', function() { 24 | browser.assert.text(`${ LCHLauncherActionPromptItemSelected } ${ LCHLauncherPipeItemTitle }`, uLocalized('LCHStandardRecipeNames').LCHRunCommand); 25 | }); 26 | 27 | }); 28 | 29 | }); 30 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHSearchAction/main.js: -------------------------------------------------------------------------------- 1 | export const LCHSearchActionURLFrom = function(param1, param2) { 2 | if (typeof param1 !== 'string') { 3 | throw new Error('LCHErrorInputNotValid'); 4 | } 5 | 6 | if (typeof param2 !== 'string') { 7 | throw new Error('LCHErrorInputNotValid'); 8 | } 9 | 10 | if (!param1.match(/LCHSEARCHTOKEN/i)) { 11 | return param1; 12 | } 13 | 14 | return param1.replace(/LCHSEARCHTOKEN/i, param2.split(' ').map(function (e) { 15 | return encodeURIComponent(e); 16 | }).join('+')); 17 | }; 18 | 19 | export const LCHSearchWithCallback = function(param1, param2) { 20 | return this.api.fn('LCHURLOpen')(LCHSearchActionURLFrom(param2, param1)); 21 | }; 22 | 23 | export const LCHSearchWithRecipe = function() { 24 | return { 25 | LCHRecipeSignature: 'LCHSearchWith', 26 | LCHRecipeInputTypes: 'String,ServiceSearchURLTemplate', 27 | LCHRecipeCallback: LCHSearchWithCallback, 28 | }; 29 | }; 30 | 31 | import { LCHFlip } from '../LCHFlip/main.js'; 32 | export const LCHSearchForCallback = function() { 33 | return LCHFlip(LCHSearchWithCallback, this)(...arguments); 34 | }; 35 | 36 | export const LCHSearchForRecipe = function() { 37 | return { 38 | LCHRecipeSignature: 'LCHSearchFor', 39 | LCHRecipeInputTypes: 'ServiceSearchURLTemplate,String', 40 | LCHRecipeCallback: LCHSearchForCallback, 41 | }; 42 | }; 43 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHSearchAction/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('LCHSearch_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | LCHOptionMode: 'LCHModePipe', 15 | }); 16 | }); 17 | 18 | context('LCHSearchWith', function () { 19 | 20 | before(function () { 21 | return browser.OLSKFireKeyboardEvent(browser.window, 'Wikipedia'); 22 | }); 23 | 24 | it('localizes LCHLauncherPipeItemTitle', function() { 25 | browser.assert.text(`${ LCHLauncherActionPromptItemSelected } ${ LCHLauncherPipeItemTitle }`, uLocalized('LCHStandardRecipeNames').LCHSearchFor); 26 | }); 27 | 28 | }); 29 | 30 | context('LCHSearchWith', function () { 31 | 32 | before(function () { 33 | return browser.OLSKFireKeyboardEvent(browser.window, '.'); 34 | }); 35 | 36 | before(function () { 37 | browser.fill(LCHLauncherPromptDotModeInput, 'alfa'); 38 | 39 | browser.OLSKFireKeyboardEvent(browser.window, 'Tab'); 40 | 41 | return browser.OLSKFireKeyboardEvent(browser.window, 'LCHSearchWith'); 42 | }); 43 | 44 | it('localizes LCHLauncherPipeItemTitle', function() { 45 | browser.assert.text(`${ LCHLauncherActionPromptItemSelected } ${ LCHLauncherPipeItemTitle }`, uLocalized('LCHStandardRecipeNames').LCHSearchWith); 46 | }); 47 | 48 | }); 49 | 50 | }); 51 | 52 | }); 53 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHServiceSearchWikipedia/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHServiceSearchWikipediaCallback', function test_LCHServiceSearchWikipediaCallback() { 6 | 7 | it('returns string', function() { 8 | deepEqual(mod.LCHServiceSearchWikipediaCallback(), 'https://wikipedia.org/w/index.php?search=LCHSEARCHTOKEN'); 9 | }); 10 | 11 | }); 12 | 13 | describe('LCHServiceSearchWikipediaRecipe', function test_LCHServiceSearchWikipediaRecipe() { 14 | 15 | it('returns LCHRecipe', function() { 16 | deepEqual(mod.LCHServiceSearchWikipediaRecipe(), { 17 | LCHRecipeName: 'Wikipedia', 18 | LCHRecipeCallback: mod.LCHServiceSearchWikipediaCallback, 19 | LCHRecipeOutputType: 'ServiceSearchURLTemplate', 20 | LCHRecipeSignature: 'LCHServiceSearchWikipedia', 21 | }); 22 | }); 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHServiceSearchWikipedia/main.js: -------------------------------------------------------------------------------- 1 | export const LCHServiceSearchWikipediaCallback = function() { 2 | return 'https://wikipedia.org/w/index.php?search=LCHSEARCHTOKEN'; 3 | }; 4 | 5 | export const LCHServiceSearchWikipediaRecipe = function() { 6 | return { 7 | LCHRecipeName: 'Wikipedia', 8 | LCHRecipeOutputType: 'ServiceSearchURLTemplate', 9 | LCHRecipeCallback: LCHServiceSearchWikipediaCallback, 10 | LCHRecipeSignature: 'LCHServiceSearchWikipedia', 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHSubjectContainerShowContents/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHSubjectContainerShowContentsCallback', function test_LCHSubjectContainerShowContentsCallback(inputData) { 6 | 7 | it('returns inputData', function() { 8 | const item = function () {}; 9 | deepEqual(mod.LCHSubjectContainerShowContentsCallback(item), item); 10 | }); 11 | 12 | }); 13 | 14 | describe('LCHSubjectContainerShowContentsRecipe', function test_LCHSubjectContainerShowContentsRecipe() { 15 | 16 | it('returns LCHRecipe', function() { 17 | deepEqual(mod.LCHSubjectContainerShowContentsRecipe(), { 18 | LCHRecipeSignature: 'LCHSubjectContainerShowContents', 19 | LCHRecipeInputTypes: 'SubjectContainer', 20 | LCHRecipeCallback: mod.LCHSubjectContainerShowContentsCallback, 21 | }); 22 | }); 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHSubjectContainerShowContents/main.js: -------------------------------------------------------------------------------- 1 | export const LCHSubjectContainerShowContentsCallback = function(inputData) { 2 | return inputData; 3 | }; 4 | 5 | export const LCHSubjectContainerShowContentsRecipe = function() { 6 | return { 7 | LCHRecipeSignature: 'LCHSubjectContainerShowContents', 8 | LCHRecipeInputTypes: 'SubjectContainer', 9 | LCHRecipeCallback: LCHSubjectContainerShowContentsCallback, 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHSubjectContainerShowContents/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('LCHSubjectContainerShowContents_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | LCHOptionMode: 'LCHModePipe', 15 | }); 16 | }); 17 | 18 | before(function() { 19 | browser.OLSKFireKeyboardEvent(browser.window, 'LCHActiveDocumentFocusElements'); 20 | }); 21 | 22 | it('localizes LCHLauncherPipeItemTitle', function() { 23 | browser.assert.text(`${ LCHLauncherActionPromptItemSelected } ${ LCHLauncherPipeItemTitle }`, uLocalized('LCHStandardRecipeNames').LCHSubjectContainerShowContents); 24 | }); 25 | 26 | }); 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHURLOpen/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHURLOpenCallback', function test_LCHURLOpenCallback() { 6 | 7 | it('returns undefined', function() { 8 | deepEqual(mod.LCHURLOpenCallback(), undefined); 9 | }); 10 | 11 | }); 12 | 13 | describe('LCHURLOpenRecipe', function test_LCHURLOpenRecipe() { 14 | 15 | it('returns LCHRecipe', function() { 16 | deepEqual(mod.LCHURLOpenRecipe(), { 17 | LCHRecipeSignature: 'LCHURLOpen', 18 | LCHRecipeInputTypes: 'URL', 19 | LCHRecipeCallback: mod.LCHURLOpenCallback, 20 | }); 21 | }); 22 | 23 | }); 24 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHURLOpen/main.js: -------------------------------------------------------------------------------- 1 | export const LCHURLOpenCallback = function(inputData) { 2 | if (!inputData) { 3 | return; 4 | } 5 | 6 | window.open(inputData, '_blank').focus(); 7 | }; 8 | 9 | export const LCHURLOpenRecipe = function() { 10 | return { 11 | LCHRecipeSignature: 'LCHURLOpen', 12 | LCHRecipeInputTypes: 'URL', 13 | LCHRecipeCallback: LCHURLOpenCallback, 14 | }; 15 | }; 16 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/actions/LCHURLOpen/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('LCHURLOpen_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | LCHOptionMode: 'LCHModePipe', 15 | }); 16 | }); 17 | 18 | before(function() { 19 | return browser.OLSKFireKeyboardEvent(browser.window, '.'); 20 | }); 21 | 22 | before(function() { 23 | browser.fill(LCHLauncherPromptDotModeInput, 'https://example.com'); 24 | }); 25 | 26 | it('localizes LCHLauncherPipeItemTitle', function() { 27 | browser.assert.text(`${ LCHLauncherActionPromptItemSelected } ${ LCHLauncherPipeItemTitle }`, uLocalized('LCHStandardRecipeNames').LCHURLOpen); 28 | }); 29 | 30 | }); 31 | 32 | }); 33 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/functions/LCHDateLocalOffsetSubtracted/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHDateLocalOffsetSubtractedCallback', function test_LCHDateLocalOffsetSubtractedCallback() { 6 | 7 | it('returns date', function() { 8 | deepEqual(mod.LCHDateLocalOffsetSubtractedCallback(new Date()) instanceof Date, true); 9 | }); 10 | 11 | it('subtracts local offset', function() { 12 | let item = new Date(); 13 | deepEqual(mod.LCHDateLocalOffsetSubtractedCallback(item), (new Date(Date.parse(item) - item.getTimezoneOffset() * 1000 * 60))); 14 | }); 15 | 16 | }); 17 | 18 | describe('LCHDateLocalOffsetSubtractedRecipe', function test_LCHDateLocalOffsetSubtractedRecipe() { 19 | 20 | it('returns LCHRecipe', function() { 21 | deepEqual(mod.LCHDateLocalOffsetSubtractedRecipe(), { 22 | LCHRecipeSignature: 'LCHDateLocalOffsetSubtracted', 23 | LCHRecipeInputTypes: 'Date', 24 | LCHRecipeCallback: mod.LCHDateLocalOffsetSubtractedCallback, 25 | }); 26 | }); 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/functions/LCHDateLocalOffsetSubtracted/main.js: -------------------------------------------------------------------------------- 1 | export const LCHDateLocalOffsetSubtractedCallback = function(inputData) { 2 | return new Date(Date.parse(inputData) - inputData.getTimezoneOffset() * 1000 * 60); 3 | }; 4 | 5 | export const LCHDateLocalOffsetSubtractedRecipe = function() { 6 | return { 7 | LCHRecipeSignature: 'LCHDateLocalOffsetSubtracted', 8 | LCHRecipeInputTypes: 'Date', 9 | LCHRecipeCallback: LCHDateLocalOffsetSubtractedCallback, 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/functions/LCHReadTextFile/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHReadTextFileRecipe', function test_LCHReadTextFileRecipe() { 6 | 7 | it('returns LCHRecipe', function() { 8 | deepEqual(mod.LCHReadTextFileRecipe(), { 9 | LCHRecipeSignature: 'LCHReadTextFile', 10 | LCHRecipeCallback: mod.LCHReadTextFileCallback, 11 | }); 12 | }); 13 | 14 | }); 15 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/functions/LCHReadTextFile/main.js: -------------------------------------------------------------------------------- 1 | export const LCHReadTextFileCallback = async function(inputData = {}) { 2 | return new Promise(function (res, rej) { 3 | return Object.assign(document.createElement('input'), inputData, { 4 | type: 'file', 5 | onchange (event) { 6 | return Object.assign(new FileReader(), { 7 | onload (event) { 8 | return res(event.target.result); 9 | }, 10 | }).readAsText(event.target.files[0]); 11 | }, 12 | }).click(); 13 | }); 14 | }; 15 | 16 | export const LCHReadTextFileRecipe = function() { 17 | return { 18 | LCHRecipeSignature: 'LCHReadTextFile', 19 | LCHRecipeCallback: LCHReadTextFileCallback, 20 | }; 21 | }; 22 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/functions/LCHReadTextFileObjects/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHReadTextFileObjectsRecipe', function test_LCHReadTextFileObjectsRecipe() { 6 | 7 | it('returns LCHRecipe', function() { 8 | deepEqual(mod.LCHReadTextFileObjectsRecipe(), { 9 | LCHRecipeSignature: 'LCHReadTextFileObjects', 10 | LCHRecipeCallback: mod.LCHReadTextFileObjectsCallback, 11 | }); 12 | }); 13 | 14 | }); 15 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/functions/LCHReadTextFileObjects/main.js: -------------------------------------------------------------------------------- 1 | export const LCHReadTextFileObjectsCallback = async function(inputData = {}) { 2 | return new Promise(function (res, rej) { 3 | return Object.assign(document.createElement('input'), inputData, { 4 | type: 'file', 5 | onchange (event) { 6 | return res(Promise.all([...event.target.files].map(function (e) { 7 | return new Promise(function (res, rej) { 8 | return Object.assign(new FileReader(), { 9 | onload (event) { 10 | return res(Object.assign(e, { 11 | _LCHReadTextFileObjectContent: event.target.result, 12 | })); 13 | }, 14 | }).readAsText(e); 15 | }); 16 | }))); 17 | }, 18 | }).click(); 19 | }); 20 | }; 21 | 22 | export const LCHReadTextFileObjectsRecipe = function() { 23 | return { 24 | LCHRecipeSignature: 'LCHReadTextFileObjects', 25 | LCHRecipeCallback: LCHReadTextFileObjectsCallback, 26 | }; 27 | }; 28 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/functions/LCHSaveFile/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHSaveFileCallback', function test_LCHSaveFileCallback() { 6 | 7 | it('throws if param1 not string', function () { 8 | throws(function () { 9 | mod.LCHSaveFileCallback(null, 'alfa'); 10 | }, /LCHErrorInputNotValid/); 11 | }); 12 | 13 | it('throws if param2 not string', function () { 14 | throws(function () { 15 | mod.LCHSaveFileCallback('', null); 16 | }, /LCHErrorInputNotValid/); 17 | }); 18 | 19 | it('throws if param2 not filled', function () { 20 | throws(function () { 21 | mod.LCHSaveFileCallback('', ' '); 22 | }, /LCHErrorInputNotValid/); 23 | }); 24 | 25 | }); 26 | 27 | describe('LCHSaveFileRecipe', function test_LCHSaveFileRecipe() { 28 | 29 | it('returns LCHRecipe', function() { 30 | deepEqual(mod.LCHSaveFileRecipe(), { 31 | LCHRecipeSignature: 'LCHSaveFile', 32 | LCHRecipeCallback: mod.LCHSaveFileCallback, 33 | }); 34 | }); 35 | 36 | }); 37 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/functions/LCHSaveFile/main.js: -------------------------------------------------------------------------------- 1 | import FileSaver from 'file-saver'; 2 | 3 | export const LCHSaveFileCallback = function(param1, param2) { 4 | if (typeof param1 !== 'string') { 5 | throw new Error('LCHErrorInputNotValid'); 6 | } 7 | 8 | if (typeof param2 !== 'string') { 9 | throw new Error('LCHErrorInputNotValid'); 10 | } 11 | 12 | if (!param2.trim()) { 13 | throw new Error('LCHErrorInputNotValid'); 14 | } 15 | 16 | return FileSaver.saveAs(new Blob([param1], {type: 'text/plain;charset=utf-8'}), param2); 17 | }; 18 | 19 | export const LCHSaveFileRecipe = function() { 20 | return { 21 | LCHRecipeSignature: 'LCHSaveFile', 22 | LCHRecipeCallback: LCHSaveFileCallback, 23 | }; 24 | }; 25 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/i18n-en.yml: -------------------------------------------------------------------------------- 1 | LCHStandardRecipeNames: 2 | LCHActiveDocumentFocusElements: Active Document Focus Elements 3 | LCHCopyToClipboard: Copy to clipboard 4 | LCHLargeText: Large text 5 | LCHDOMElementFocus: Focus 6 | LCHRunCommand: Run Command 7 | LCHSearchWith: Search With 8 | LCHSearchFor: Search For 9 | LCHSubjectContainerShowContents: Show Contents 10 | LCHURLOpen: Open URL 11 | SubjectContainer: Subject Container 12 | String: String 13 | Date: Date 14 | URL: URL 15 | ServiceSearchURLTemplate: Search Service URL Template 16 | DOMElement: DOM Element 17 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/i18n-es.yml: -------------------------------------------------------------------------------- 1 | LCHStandardRecipeNames: 2 | LCHActiveDocumentFocusElements: Elementos enfocados del documento activo 3 | LCHCopyToClipboard: Copiar al portapapeles 4 | LCHLargeText: Texto aumentado 5 | LCHDOMElementFocus: Enfocar 6 | LCHRunCommand: Ejecutar comando 7 | LCHSearchWith: Buscar con 8 | LCHSearchFor: Buscar para 9 | LCHSubjectContainerShowContents: Mostrar contenidos 10 | LCHURLOpen: Abrir URL 11 | SubjectContainer: Contenido de sujetos 12 | String: String 13 | Date: Date 14 | URL: URL 15 | ServiceSearchURLTemplate: Plantilla URL de servicio de búsqueda 16 | DOMElement: Elemento DOM 17 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | LCHStandardRecipeNames: 2 | LCHActiveDocumentFocusElements: Éléments au points du document active 3 | LCHCopyToClipboard: Copier dans le presse-papier 4 | LCHLargeText: Texte élargi 5 | LCHDOMElementFocus: Faire le point 6 | LCHRunCommand: Exécuter la commande 7 | LCHSearchWith: Chercher avec 8 | LCHSearchFor: Chercher pour 9 | LCHSubjectContainerShowContents: Montrer le contenu 10 | LCHURLOpen: Ouvrir l'URL 11 | SubjectContainer: Contenant des sujets 12 | String: String 13 | Date: Date 14 | URL: URL 15 | ServiceSearchURLTemplate: Modèle URL de service de recherche 16 | DOMElement: Élément DOM 17 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | LCHStandardRecipeNames: 2 | LCHActiveDocumentFocusElements: Elementos de foco no documento ativo 3 | LCHCopyToClipboard: Cópia na área de transferência 4 | LCHLargeText: Texto grande 5 | LCHDOMElementFocus: Foco 6 | LCHRunCommand: Executar Comando 7 | LCHSearchWith: Buscar com 8 | LCHSearchFor: Buscar por 9 | LCHSubjectContainerShowContents: Mostrar conteúdo 10 | LCHURLOpen: Abrir URL 11 | SubjectContainer: Contêiner do Sujeito 12 | String: Sequência 13 | Date: Data 14 | URL: URL 15 | ServiceSearchURLTemplate: Modelo de URL do serviço de pesquisa 16 | DOMElement: Elemento do DOM 17 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/primitives/Bool/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHPrimitiveBoolCallback', function test_LCHPrimitiveBoolCallback() { 6 | 7 | it('returns false if not present', function() { 8 | deepEqual(mod.LCHPrimitiveBoolCallback(), false); 9 | }); 10 | 11 | it('returns false if undefined', function() { 12 | deepEqual(mod.LCHPrimitiveBoolCallback(undefined), false); 13 | }); 14 | 15 | it('returns false if null', function() { 16 | deepEqual(mod.LCHPrimitiveBoolCallback(null), false); 17 | }); 18 | 19 | it('returns false if empty string', function() { 20 | deepEqual(mod.LCHPrimitiveBoolCallback(''), false); 21 | }); 22 | 23 | it('returns true if true', function() { 24 | deepEqual(mod.LCHPrimitiveBoolCallback(true), true); 25 | }); 26 | 27 | it('returns true if filled string', function() { 28 | deepEqual(mod.LCHPrimitiveBoolCallback('alfa'), true); 29 | }); 30 | 31 | }); 32 | 33 | describe('LCHPrimitiveBoolRecipe', function test_LCHPrimitiveBoolRecipe() { 34 | 35 | it('returns LCHRecipe', function() { 36 | deepEqual(mod.LCHPrimitiveBoolRecipe(), { 37 | LCHRecipeSignature: 'Bool', 38 | LCHRecipeCallback: mod.LCHPrimitiveBoolCallback, 39 | }); 40 | }); 41 | 42 | }); 43 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/primitives/Bool/main.js: -------------------------------------------------------------------------------- 1 | export const LCHPrimitiveBoolCallback = function(inputData) { 2 | return !!inputData; 3 | }; 4 | 5 | export const LCHPrimitiveBoolRecipe = function() { 6 | return { 7 | LCHRecipeSignature: 'Bool', 8 | LCHRecipeCallback: LCHPrimitiveBoolCallback, 9 | }; 10 | }; 11 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/primitives/Date/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHPrimitiveDateCallback', function test_LCHPrimitiveDateCallback() { 6 | 7 | it('returns false if not date', function() { 8 | deepEqual(mod.LCHPrimitiveDateCallback(null), false); 9 | }); 10 | 11 | it('returns false if not valid', function() { 12 | deepEqual(mod.LCHPrimitiveDateCallback(new Date('alfa')), false); 13 | }); 14 | 15 | it('returns true', function() { 16 | deepEqual(mod.LCHPrimitiveDateCallback(new Date()), true); 17 | }); 18 | 19 | }); 20 | 21 | describe('LCHPrimitiveDateCanonicalExampleCallback', function test_LCHPrimitiveDateCanonicalExampleCallback() { 22 | 23 | it('returns Date', function() { 24 | deepEqual(mod.LCHPrimitiveDateCanonicalExampleCallback(), new Date(0)); 25 | }); 26 | 27 | }); 28 | 29 | describe('LCHPrimitiveDateRecipe', function test_LCHPrimitiveDateRecipe() { 30 | 31 | it('returns LCHRecipe', function() { 32 | deepEqual(mod.LCHPrimitiveDateRecipe(), { 33 | LCHRecipeSignature: 'Date', 34 | LCHRecipeCallback: mod.LCHPrimitiveDateCallback, 35 | LCHRecipeOutputType: 'Bool', 36 | LCHRecipeCanonicalExampleCallback: mod.LCHPrimitiveDateCanonicalExampleCallback, 37 | }); 38 | }); 39 | 40 | }); 41 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/primitives/Date/main.js: -------------------------------------------------------------------------------- 1 | export const LCHPrimitiveDateCallback = function(inputData) { 2 | if (!(inputData instanceof Date)) { 3 | return false; 4 | } 5 | 6 | if (Number.isNaN(inputData.getTime())) { 7 | return false; 8 | } 9 | 10 | return true; 11 | }; 12 | 13 | export const LCHPrimitiveDateCanonicalExampleCallback = function() { 14 | return new Date(0); 15 | }; 16 | 17 | export const LCHPrimitiveDateRecipe = function() { 18 | return { 19 | LCHRecipeSignature: 'Date', 20 | LCHRecipeCallback: LCHPrimitiveDateCallback, 21 | LCHRecipeOutputType: 'Bool', 22 | LCHRecipeCanonicalExampleCallback: LCHPrimitiveDateCanonicalExampleCallback, 23 | }; 24 | }; 25 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/primitives/Date/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.skip('Date_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | LCHOptionMode: 'LCHModePipe', 15 | StubRecipes: uStubStringify([{ 16 | LCHRecipeName: 'alfa', 17 | LCHRecipeCallback: function () {}, 18 | LCHRecipeOutputType: 'Date', 19 | }]), 20 | }); 21 | }); 22 | 23 | before(function() { 24 | browser.OLSKFireKeyboardEvent(browser.window, 'alfa'); 25 | }); 26 | 27 | it('localizes LCHLauncherPipeItemTitle', function() { 28 | browser.assert.text(`${ LCHLauncherSubjectPromptItemSelected } ${ LCHLauncherPipeItemSubtitle }`, uLocalized('LCHStandardRecipeNames').Date); 29 | }); 30 | 31 | }); 32 | 33 | }); 34 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/primitives/LCHPrimitiveDOMElement/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHPrimitiveDOMElementCallback', function test_LCHPrimitiveDOMElementCallback() { 6 | 7 | it('returns false if not object', function() { 8 | deepEqual(mod.LCHPrimitiveDOMElementCallback(null), false); 9 | }); 10 | 11 | it('returns false if focus not function', function() { 12 | deepEqual(mod.LCHPrimitiveDOMElementCallback({}), false); 13 | }); 14 | 15 | it('returns true', function() { 16 | deepEqual(mod.LCHPrimitiveDOMElementCallback(mod.LCHPrimitiveDOMElementCanonicalExampleCallback()), true); 17 | }); 18 | 19 | }); 20 | 21 | describe('LCHPrimitiveDOMElementCanonicalExampleCallback', function test_LCHPrimitiveDOMElementCanonicalExampleCallback() { 22 | 23 | it('returns object', function() { 24 | deepEqual(typeof mod.LCHPrimitiveDOMElementCanonicalExampleCallback(), 'object'); 25 | }); 26 | 27 | context('focus', function () { 28 | 29 | it('assigns function', function() { 30 | deepEqual(typeof mod.LCHPrimitiveDOMElementCanonicalExampleCallback().focus, 'function'); 31 | }); 32 | 33 | }); 34 | 35 | }); 36 | 37 | describe('LCHPrimitiveDOMElementRecipe', function test_LCHPrimitiveDOMElementRecipe() { 38 | 39 | it('returns LCHRecipe', function() { 40 | deepEqual(mod.LCHPrimitiveDOMElementRecipe(), { 41 | LCHRecipeSignature: 'DOMElement', 42 | LCHRecipeCallback: mod.LCHPrimitiveDOMElementCallback, 43 | LCHRecipeOutputType: 'Bool', 44 | LCHRecipeCanonicalExampleCallback: mod.LCHPrimitiveDOMElementCanonicalExampleCallback, 45 | _LCHRecipeTypeIsExclusive: true, 46 | }); 47 | }); 48 | 49 | }); 50 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/primitives/LCHPrimitiveDOMElement/main.js: -------------------------------------------------------------------------------- 1 | export const LCHPrimitiveDOMElementCallback = function(inputData) { 2 | if (typeof inputData !== 'object' || inputData === null) { 3 | return false; 4 | } 5 | 6 | if (typeof inputData.focus !== 'function') { 7 | return false; 8 | } 9 | 10 | return true; 11 | }; 12 | 13 | export const LCHPrimitiveDOMElementCanonicalExampleCallback = function() { 14 | return { 15 | focus () {}, 16 | }; 17 | }; 18 | 19 | export const LCHPrimitiveDOMElementRecipe = function() { 20 | return { 21 | LCHRecipeCallback: LCHPrimitiveDOMElementCallback, 22 | LCHRecipeOutputType: 'Bool', 23 | LCHRecipeCanonicalExampleCallback: LCHPrimitiveDOMElementCanonicalExampleCallback, 24 | LCHRecipeSignature: 'DOMElement', 25 | _LCHRecipeTypeIsExclusive: true, 26 | }; 27 | }; 28 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/primitives/LCHPrimitiveDOMElement/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('DOMElement_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | LCHOptionMode: 'LCHModePipe', 15 | StubRecipes: uStubStringify([{ 16 | LCHRecipeName: 'alfa', 17 | LCHRecipeCallback: function () {}, 18 | LCHRecipeOutputType: 'DOMElement', 19 | }]), 20 | }); 21 | }); 22 | 23 | before(function() { 24 | browser.OLSKFireKeyboardEvent(browser.window, 'alfa'); 25 | }); 26 | 27 | it('localizes LCHLauncherPipeItemTitle', function() { 28 | browser.assert.text(`${ LCHLauncherSubjectPromptItemSelected } ${ LCHLauncherPipeItemSubtitle }`, uLocalized('LCHStandardRecipeNames').DOMElement); 29 | }); 30 | 31 | }); 32 | 33 | }); 34 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/primitives/ServiceSearchURLTemplate/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHPrimitiveServiceSearchURLTemplateCallback', function test_LCHPrimitiveServiceSearchURLTemplateCallback() { 6 | 7 | it('returns false if not URL', function() { 8 | deepEqual(mod.LCHPrimitiveServiceSearchURLTemplateCallback('://example'), false); 9 | }); 10 | 11 | it('returns false if no token match', function() { 12 | deepEqual(mod.LCHPrimitiveServiceSearchURLTemplateCallback('https://example.com?q=LCHSEARCHTOKE'), false); 13 | }); 14 | 15 | it('returns true', function() { 16 | deepEqual(mod.LCHPrimitiveServiceSearchURLTemplateCallback('https://example.com?q=LCHSEARCHTOKEN1'), true); 17 | }); 18 | 19 | it('matches lowercase', function() { 20 | deepEqual(mod.LCHPrimitiveServiceSearchURLTemplateCallback('https://example.com?q=lchsearchtoken'), true); 21 | }); 22 | 23 | }); 24 | 25 | describe('LCHPrimitiveServiceSearchURLTemplateCanonicalExampleCallback', function test_LCHPrimitiveServiceSearchURLTemplateCanonicalExampleCallback() { 26 | 27 | it('returns string', function() { 28 | deepEqual(mod.LCHPrimitiveServiceSearchURLTemplateCanonicalExampleCallback(), 'https://example.com?q=LCHSEARCHTOKEN'); 29 | }); 30 | 31 | }); 32 | 33 | describe('LCHPrimitiveServiceSearchURLTemplateRecipe', function test_LCHPrimitiveServiceSearchURLTemplateRecipe() { 34 | 35 | it('returns LCHRecipe', function() { 36 | deepEqual(mod.LCHPrimitiveServiceSearchURLTemplateRecipe(), { 37 | LCHRecipeSignature: 'ServiceSearchURLTemplate', 38 | LCHRecipeCallback: mod.LCHPrimitiveServiceSearchURLTemplateCallback, 39 | LCHRecipeOutputType: 'Bool', 40 | LCHRecipeCanonicalExampleCallback: mod.LCHPrimitiveServiceSearchURLTemplateCanonicalExampleCallback, 41 | _LCHRecipeTypeIsExclusive: true, 42 | }); 43 | }); 44 | 45 | }); 46 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/primitives/ServiceSearchURLTemplate/main.js: -------------------------------------------------------------------------------- 1 | import { LCHPrimitiveURLCallback } from '../URL/main.js'; 2 | 3 | export const LCHPrimitiveServiceSearchURLTemplateCallback = function(inputData) { 4 | if (!LCHPrimitiveURLCallback(inputData)) { 5 | return false; 6 | } 7 | 8 | if (!inputData.match(/LCHSEARCHTOKEN/i)) { 9 | return false; 10 | } 11 | 12 | return true; 13 | }; 14 | 15 | export const LCHPrimitiveServiceSearchURLTemplateCanonicalExampleCallback = function() { 16 | return 'https://example.com?q=LCHSEARCHTOKEN'; 17 | }; 18 | 19 | export const LCHPrimitiveServiceSearchURLTemplateRecipe = function() { 20 | return { 21 | LCHRecipeCallback: LCHPrimitiveServiceSearchURLTemplateCallback, 22 | LCHRecipeOutputType: 'Bool', 23 | LCHRecipeCanonicalExampleCallback: LCHPrimitiveServiceSearchURLTemplateCanonicalExampleCallback, 24 | LCHRecipeSignature: 'ServiceSearchURLTemplate', 25 | _LCHRecipeTypeIsExclusive: true, 26 | }; 27 | }; 28 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/primitives/ServiceSearchURLTemplate/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('ServiceSearchURLTemplate_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | LCHOptionMode: 'LCHModePipe', 15 | StubRecipes: uStubStringify([{ 16 | LCHRecipeName: 'alfa', 17 | LCHRecipeCallback: function () {}, 18 | LCHRecipeOutputType: 'ServiceSearchURLTemplate', 19 | }]), 20 | }); 21 | }); 22 | 23 | before(function() { 24 | browser.OLSKFireKeyboardEvent(browser.window, 'alfa'); 25 | }); 26 | 27 | it('localizes LCHLauncherPipeItemTitle', function() { 28 | browser.assert.text(`${ LCHLauncherSubjectPromptItemSelected } ${ LCHLauncherPipeItemSubtitle }`, uLocalized('LCHStandardRecipeNames').ServiceSearchURLTemplate); 29 | }); 30 | 31 | }); 32 | 33 | }); 34 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/primitives/String/main-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./main.js'); 4 | 5 | describe('LCHPrimitiveStringCallback', function test_LCHPrimitiveStringCallback() { 6 | 7 | it('returns false if not string', function() { 8 | deepEqual(mod.LCHPrimitiveStringCallback(null), false); 9 | }); 10 | 11 | it('returns true', function() { 12 | deepEqual(mod.LCHPrimitiveStringCallback(''), true); 13 | }); 14 | 15 | }); 16 | 17 | describe('LCHPrimitiveStringCanonicalExampleCallback', function test_LCHPrimitiveStringCanonicalExampleCallback() { 18 | 19 | it('returns string', function() { 20 | deepEqual(mod.LCHPrimitiveStringCanonicalExampleCallback(), ''); 21 | }); 22 | 23 | }); 24 | 25 | describe('LCHPrimitiveStringRecipe', function test_LCHPrimitiveStringRecipe() { 26 | 27 | it('returns LCHRecipe', function() { 28 | deepEqual(mod.LCHPrimitiveStringRecipe(), { 29 | LCHRecipeSignature: 'String', 30 | LCHRecipeCallback: mod.LCHPrimitiveStringCallback, 31 | LCHRecipeOutputType: 'Bool', 32 | LCHRecipeCanonicalExampleCallback: mod.LCHPrimitiveStringCanonicalExampleCallback, 33 | }); 34 | }); 35 | 36 | }); 37 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/primitives/String/main.js: -------------------------------------------------------------------------------- 1 | export const LCHPrimitiveStringCallback = function(inputData) { 2 | return typeof inputData === 'string'; 3 | }; 4 | 5 | export const LCHPrimitiveStringCanonicalExampleCallback = function() { 6 | return ''; 7 | }; 8 | 9 | export const LCHPrimitiveStringRecipe = function() { 10 | return { 11 | LCHRecipeSignature: 'String', 12 | LCHRecipeCallback: LCHPrimitiveStringCallback, 13 | LCHRecipeOutputType: 'Bool', 14 | LCHRecipeCanonicalExampleCallback: LCHPrimitiveStringCanonicalExampleCallback, 15 | }; 16 | }; 17 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/primitives/String/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('String_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | LCHOptionMode: 'LCHModePipe', 15 | StubRecipes: uStubStringify([{ 16 | LCHRecipeName: 'alfa', 17 | LCHRecipeCallback: function () {}, 18 | LCHRecipeOutputType: 'String', 19 | }]), 20 | }); 21 | }); 22 | 23 | before(function() { 24 | browser.OLSKFireKeyboardEvent(browser.window, 'alfa'); 25 | }); 26 | 27 | it('localizes LCHLauncherPipeItemTitle', function() { 28 | browser.assert.text(`${ LCHLauncherSubjectPromptItemSelected } ${ LCHLauncherPipeItemSubtitle }`, uLocalized('LCHStandardRecipeNames').String); 29 | }); 30 | 31 | }); 32 | 33 | }); 34 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/primitives/URL/main.js: -------------------------------------------------------------------------------- 1 | import * as _URLParser from 'url-parse'; 2 | const URLParser = typeof _URLParser === 'function' ? _URLParser : _URLParser.default; 3 | 4 | export const LCHPrimitiveURLCallback = function(inputData) { 5 | if (typeof inputData !== 'string') { 6 | // throw new Error('LCHErrorInputNotValid'); 7 | return false; 8 | } 9 | 10 | if (!(new URLParser(inputData, {})).hostname) { // To parse an input independently of the browser's current URL (e.g. for functionality parity with the library in a Node environment), pass an empty location object as the second parameter 11 | return false; 12 | } 13 | 14 | return true; 15 | }; 16 | 17 | export const LCHPrimitiveStringCanonicalExampleCallback = function() { 18 | return 'https://example.com'; 19 | }; 20 | 21 | export const LCHPrimitiveURLRecipe = function() { 22 | return { 23 | LCHRecipeSignature: 'URL', 24 | LCHRecipeCallback: LCHPrimitiveURLCallback, 25 | LCHRecipeOutputType: 'Bool', 26 | LCHRecipeCanonicalExampleCallback: LCHPrimitiveStringCanonicalExampleCallback, 27 | }; 28 | }; 29 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/primitives/URL/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('URL_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | LCHOptionMode: 'LCHModePipe', 15 | StubRecipes: uStubStringify([{ 16 | LCHRecipeName: 'alfa', 17 | LCHRecipeCallback: function () {}, 18 | LCHRecipeOutputType: 'URL', 19 | }]), 20 | }); 21 | }); 22 | 23 | before(function() { 24 | browser.OLSKFireKeyboardEvent(browser.window, 'alfa'); 25 | }); 26 | 27 | it('localizes LCHLauncherPipeItemTitle', function() { 28 | browser.assert.text(`${ LCHLauncherSubjectPromptItemSelected } ${ LCHLauncherPipeItemSubtitle }`, uLocalized('LCHStandardRecipeNames').URL); 29 | }); 30 | 31 | }); 32 | 33 | }); 34 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/subjects/LCHActiveDocumentFocusElements/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('LCHActiveDocumentFocusElements_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | LCHOptionMode: 'LCHModePipe', 15 | }); 16 | }); 17 | 18 | before(function() { 19 | browser.OLSKFireKeyboardEvent(browser.window, 'LCHActiveDocumentFocusElements'); 20 | }); 21 | 22 | it('localizes LCHLauncherPipeItemTitle', function() { 23 | browser.assert.text(`${ LCHLauncherSubjectPromptItemSelected } ${ LCHLauncherPipeItemTitle }`, uLocalized('LCHStandardRecipeNames').LCHActiveDocumentFocusElements); 24 | }); 25 | 26 | }); 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/types/LCHTypeCommand/main.js: -------------------------------------------------------------------------------- 1 | export const LCHTypeCommandCallback = function(inputData) { 2 | // if (LCHRecipesErrors(inputData)) { 3 | // throw new Error('LCHErrorInputNotValid'); 4 | // } 5 | 6 | if (!inputData.LCHRecipeName) { 7 | return false; 8 | } 9 | 10 | if (inputData.LCHRecipeCallback.length) { 11 | return false; 12 | } 13 | 14 | return true; 15 | }; 16 | 17 | export const LCHTypeStringCanonicalExampleCallback = function() { 18 | return { 19 | LCHRecipeName: 'alfa', 20 | LCHRecipeCallback () {}, 21 | }; 22 | }; 23 | 24 | export const LCHTypeCommandRecipe = function() { 25 | return { 26 | LCHRecipeSignature: 'Command', 27 | LCHRecipeCallback: LCHTypeCommandCallback, 28 | LCHRecipeOutputType: 'Bool', 29 | LCHRecipeCanonicalExampleCallback: LCHTypeStringCanonicalExampleCallback, 30 | }; 31 | }; 32 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/types/ServiceSearch/main.js: -------------------------------------------------------------------------------- 1 | export const LCHTypeServiceSearchCallback = function(inputData) { 2 | if (!inputData.LCHRecipeName) { 3 | return false; 4 | } 5 | 6 | if (inputData.LCHRecipeCallback.length) { 7 | return false; 8 | } 9 | 10 | if (inputData.LCHRecipeOutputType !== 'ServiceSearchURLTemplate') { 11 | return false; 12 | } 13 | 14 | return true; 15 | }; 16 | 17 | export const LCHTypeServiceSearchCanonicalExampleCallback = function() { 18 | return { 19 | LCHRecipeName: 'alfa', 20 | LCHRecipeCallback () { 21 | return 'https://example.com?q=LCHSEARCHTOKEN'; 22 | }, 23 | LCHRecipeOutputType: 'ServiceSearchURLTemplate', 24 | }; 25 | }; 26 | 27 | export const LCHTypeServiceSearchRecipe = function() { 28 | return { 29 | LCHRecipeSignature: 'ServiceSearch', 30 | LCHRecipeCallback: LCHTypeServiceSearchCallback, 31 | LCHRecipeOutputType: 'Bool', 32 | LCHRecipeCanonicalExampleCallback: LCHTypeServiceSearchCanonicalExampleCallback, 33 | }; 34 | }; 35 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/types/SubjectContainer/main.js: -------------------------------------------------------------------------------- 1 | export const LCHTypeSubjectContainerCallback = function(inputData) { 2 | if (!inputData.LCHRecipeName) { 3 | return false; 4 | } 5 | 6 | if (inputData.LCHRecipeOutputType !== 'SubjectContainer') { 7 | return false; 8 | } 9 | 10 | return true; 11 | }; 12 | 13 | export const LCHTypeSubjectContainerCanonicalExampleCallback = function() { 14 | return { 15 | LCHRecipeName: 'alfa', 16 | LCHRecipeCallback () {}, 17 | LCHRecipeOutputType: 'SubjectContainer', 18 | }; 19 | }; 20 | 21 | export const LCHTypeSubjectContainerRecipe = function() { 22 | return { 23 | LCHRecipeSignature: 'SubjectContainer', 24 | LCHRecipeCallback: LCHTypeSubjectContainerCallback, 25 | LCHRecipeOutputType: 'Bool', 26 | LCHRecipeCanonicalExampleCallback: LCHTypeSubjectContainerCanonicalExampleCallback, 27 | _LCHRecipeTypeIsExclusive: true, 28 | }; 29 | }; 30 | -------------------------------------------------------------------------------- /os-app/dev-launcher/recipes/types/SubjectContainer/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('SubjectContainer_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | LCHOptionMode: 'LCHModePipe', 15 | }); 16 | }); 17 | 18 | before(function() { 19 | browser.OLSKFireKeyboardEvent(browser.window, 'LCHActiveDocumentFocusElements'); 20 | }); 21 | 22 | it('localizes LCHLauncherPipeItemSubtitle', function() { 23 | browser.assert.text(`${ LCHLauncherSubjectPromptItemSelected } ${ LCHLauncherPipeItemSubtitle }`, uLocalized('LCHStandardRecipeNames').SubjectContainer); 24 | }); 25 | 26 | }); 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /os-app/dev-launcher/rollup-start.js: -------------------------------------------------------------------------------- 1 | import RollupStart from './main.svelte'; 2 | 3 | export default RollupStart; 4 | -------------------------------------------------------------------------------- /os-app/dev-launcher/submodules/LCHLauncherPipeItem/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/LCHLauncherPipeItem', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'LCHLauncherPipeItemStubRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'stub-view')); 8 | }, 9 | OLSKRouteIsHidden: process.env.NODE_ENV === 'production', 10 | }]; 11 | }; 12 | -------------------------------------------------------------------------------- /os-app/dev-launcher/submodules/LCHLauncherPipeItem/main.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 | { PipeItemTitle } 9 | 10 | {#if PipeItemSubtitle} 11 |
12 | { PipeItemSubtitle } 13 | {/if} 14 | 15 | {#if PipeItemSource} 16 |
17 | { PipeItemSource } 18 | {/if} 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /os-app/dev-launcher/submodules/LCHLauncherPipeItem/rollup-start.js: -------------------------------------------------------------------------------- 1 | import RollupStart from './main.svelte'; 2 | 3 | const LCHLauncherPipeItem = new RollupStart({ 4 | target: document.body, 5 | props: Object.fromEntries((new window.URLSearchParams(window.location.search)).entries()), 6 | }); 7 | 8 | export default LCHLauncherPipeItem; 9 | -------------------------------------------------------------------------------- /os-app/dev-launcher/submodules/LCHLauncherPipeItem/stub-view.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | locals.OLSKPageAssets = [ 3 | '/_shared/__external/normalize.css/normalize.css', 4 | '__compiled/ui-style.css', 5 | ]; 6 | %> 7 | 8 | 9 | -------------------------------------------------------------------------------- /os-app/dev-launcher/submodules/LCHLauncherPipeItem/ui-style.css: -------------------------------------------------------------------------------- 1 | .LCHLauncherPipeItem { 2 | padding: 4px; 3 | 4 | font-size: 8pt; 5 | color: hsl(0, 0%, 0%); 6 | } 7 | 8 | .LCHLauncherPipeItemSubtitle, .LCHLauncherPipeItemSource { 9 | font-size: 7.5pt; 10 | opacity: 0.4; 11 | } 12 | 13 | @media screen and (max-width: 760px) { 14 | 15 | .LCHLauncherPipeItem { 16 | padding: 10px; 17 | 18 | font-family: 'Helvetica Neue', 'Helvetica', sans-serif; 19 | font-weight: bold; 20 | font-size: 13.5pt; 21 | color: hsl(0, 0%, 0%); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /os-app/dev-launcher/submodules/LCHLauncherPipeItem/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | LCHLauncherPipeItem: '.LCHLauncherPipeItem', 5 | LCHLauncherPipeItemTitle: '.LCHLauncherPipeItemTitle', 6 | LCHLauncherPipeItemSubtitle: '.LCHLauncherPipeItemSubtitle', 7 | LCHLauncherPipeItemSource: '.LCHLauncherPipeItemSource', 8 | }).map(function (e) { 9 | return global[e.shift()] = e.pop(); 10 | }); 11 | 12 | describe('LCHLauncherPipeItem_Access', function () { 13 | 14 | const uStubProps = function () { 15 | return { 16 | PipeItemTitle: 'alfa', 17 | PipeItemSubtitle: 'bravo', 18 | PipeItemSource: 'charlie', 19 | }; 20 | }; 21 | 22 | before(function() { 23 | return browser.OLSKVisit(kDefaultRoute, uStubProps()) 24 | }); 25 | 26 | it('shows LCHLauncherPipeItem', function () { 27 | browser.assert.element(LCHLauncherPipeItem); 28 | }); 29 | 30 | it('shows LCHLauncherPipeItemTitle', function () { 31 | browser.assert.element(LCHLauncherPipeItemTitle); 32 | }); 33 | 34 | it('shows LCHLauncherPipeItemSubtitle', function () { 35 | browser.assert.element(LCHLauncherPipeItemSubtitle); 36 | }); 37 | 38 | it('shows LCHLauncherPipeItemSource', function () { 39 | browser.assert.element(LCHLauncherPipeItemSource); 40 | }); 41 | 42 | }); 43 | -------------------------------------------------------------------------------- /os-app/dev-launcher/submodules/LCHLauncherPipeItem/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('LCHLauncherPipeItem_Misc', function () { 4 | 5 | const uStubProps = function () { 6 | return { 7 | PipeItemTitle: 'alfa', 8 | PipeItemSubtitle: 'bravo', 9 | PipeItemSource: 'charlie', 10 | }; 11 | }; 12 | 13 | before(function() { 14 | return browser.OLSKVisit(kDefaultRoute, uStubProps()) 15 | }); 16 | 17 | it('binds PipeItemTitle', function() { 18 | browser.assert.text(LCHLauncherPipeItemTitle, uStubProps().PipeItemTitle); 19 | }); 20 | 21 | it('binds PipeItemSubtitle', function() { 22 | browser.assert.text(LCHLauncherPipeItemSubtitle, uStubProps().PipeItemSubtitle); 23 | }); 24 | 25 | it('binds PipeItemSource', function() { 26 | browser.assert.text(LCHLauncherPipeItemSource, uStubProps().PipeItemSource); 27 | }); 28 | 29 | }); 30 | -------------------------------------------------------------------------------- /os-app/dev-launcher/submodules/LCHLauncherPrompt/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/LCHLauncherPrompt', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'LCHLauncherPromptStubRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'stub-view')); 8 | }, 9 | OLSKRouteIsHidden: process.env.NODE_ENV === 'production', 10 | }]; 11 | }; 12 | -------------------------------------------------------------------------------- /os-app/dev-launcher/submodules/LCHLauncherPrompt/main.svelte: -------------------------------------------------------------------------------- 1 | 21 | 22 |
23 | 24 |
25 |
26 | {#if !ItemSelected || ItemSelectedHidden} 27 | 28 | {:else} 29 | 30 | {/if} 31 |
32 |
33 | 34 | {#if !ResultsHidden} 35 | 43 | 48 | 49 | {/if} 50 | 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /os-app/dev-launcher/submodules/LCHLauncherPrompt/rollup-start.js: -------------------------------------------------------------------------------- 1 | import RollupStart from './stub-view.svelte'; 2 | 3 | const LCHLauncherPrompt = new RollupStart({ 4 | target: document.body, 5 | }); 6 | 7 | export default LCHLauncherPrompt; 8 | -------------------------------------------------------------------------------- /os-app/dev-launcher/submodules/LCHLauncherPrompt/stub-view.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | locals.OLSKPageAssets = [ 3 | '/_shared/__external/normalize.css/normalize.css', 4 | '__compiled/ui-style.css', 5 | ]; 6 | %> 7 | 8 | 9 | 10 |
11 | 12 |

13 | ResultsHidden 14 | 15 |

16 | 17 |

18 | PromptItems 19 | 20 | 23 | 30 |

31 | -------------------------------------------------------------------------------- /os-app/dev-launcher/submodules/LCHLauncherPrompt/ui-style.css: -------------------------------------------------------------------------------- 1 | @media screen and (min-width: 760px) { 2 | 3 | .LCHLauncherZoneInput { 4 | padding: 3px; 5 | border: solid 1px hsl(0, 0%, 90%); 6 | border-radius: 6px; 7 | 8 | background: hsl(0, 0%, 95%); 9 | 10 | /* LCHLauncherZoneInputFlexbox:Parent */ 11 | display: flex; 12 | justify-content: center; 13 | } 14 | 15 | .LCHLauncherZoneInputBezel { 16 | height: 20px; 17 | 18 | padding: 4px; 19 | border-radius: 4px; 20 | 21 | /* LCHLauncherZoneInputFlexbox:Child */ 22 | flex-grow: 1; 23 | 24 | /* LCHLauncherZoneInputBezelFlexbox:Parent */ 25 | display: flex; 26 | flex-direction: column; 27 | justify-content: center; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /os-app/dev-launcher/submodules/LCHLauncherPrompt/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('LCHLauncherPrompt_Misc', function () { 4 | 5 | before(function() { 6 | return browser.OLSKVisit(kDefaultRoute); 7 | }); 8 | 9 | before(function () { 10 | browser.assert.text('#LCHLauncherPromptStubItemSelected', 'undefined'); 11 | }); 12 | 13 | context('set PromptItems', function() { 14 | 15 | before(function () { 16 | return browser.pressButton('#LCHLauncherPromptTestSetPromptItemsMultiple'); 17 | }); 18 | 19 | it('sets ResultItems', function() { 20 | browser.assert.elements('.OLSKResultsListItem', 3); 21 | }); 22 | 23 | }); 24 | 25 | context('set ItemSelected', function() { 26 | 27 | before(function () { 28 | return browser.pressButton('#LCHLauncherPromptTestSetStubItemSelected'); 29 | }); 30 | 31 | it('sets ItemSelected', function() { 32 | browser.assert.text('.OLSKResultsListItemSelected', 'bravo'); 33 | }); 34 | 35 | }); 36 | 37 | context('ArrowDown', function() { 38 | 39 | before(function () { 40 | return browser.OLSKFireKeyboardEvent(browser.window, 'ArrowDown'); 41 | }); 42 | 43 | it('sends ResultListDispatchArrrow', function() { 44 | browser.assert.text('#OLSKResultsListTestResultListDispatchArrow', '1'); 45 | }); 46 | 47 | }); 48 | 49 | context('ArrowUp', function() { 50 | 51 | before(function () { 52 | return browser.OLSKFireKeyboardEvent(browser.window, 'ArrowUp'); 53 | }); 54 | 55 | it('sends ResultListDispatchArrrow', function() { 56 | browser.assert.text('#OLSKResultsListTestResultListDispatchArrow', '2'); 57 | }); 58 | 59 | }); 60 | 61 | context('click', function() { 62 | 63 | before(function () { 64 | return browser.click('.OLSKResultsListItem'); 65 | }); 66 | 67 | it('sends ResultListDispatchClick', function() { 68 | browser.assert.text('#OLSKResultsListTestResultListDispatchClick', '1'); 69 | }); 70 | 71 | }); 72 | 73 | }); 74 | 75 | -------------------------------------------------------------------------------- /os-app/dev-launcher/ui-behaviour.js: -------------------------------------------------------------------------------- 1 | const params = Object.fromEntries((new window.URLSearchParams(window.location.search)).entries()); 2 | 3 | function StubRecipesParse(inputData) { 4 | if (!inputData) { 5 | return null; 6 | }; 7 | 8 | return JSON.parse(inputData).map(function (e) { 9 | return Object.assign(e, { 10 | LCHRecipeCallback: eval(e.LCHRecipeCallback), 11 | LCHRecipeIsExcluded: eval(e.LCHRecipeIsExcluded), 12 | }); 13 | }); 14 | } 15 | 16 | const mod = { 17 | 18 | // INTERFACE 19 | 20 | InterfaceButtonDidClick() { 21 | setTimeout(function () { 22 | mod.ControlLaunch(); 23 | }) 24 | }, 25 | 26 | // CONTROL 27 | 28 | ControlLaunch() { 29 | let app = new Main({ 30 | target: document.getElementById('LCHLauncherTarget'), 31 | props: { 32 | LRTOptions: { 33 | LCHOptionRecipes: StubRecipesParse(params.StubRecipes) || [], 34 | LCHOptionMode: Launchlet[params.LCHOptionMode || 'LCHModeCommit'], 35 | LCHOptionLanguage: window.OLSKPublicConstants('OLSKSharedPageCurrentLanguage'), 36 | LCHOptionIncludePageRecipes: !!params.LCHOptionIncludePageRecipes || false, 37 | LCHOptionRunAutomaticRecipes: !!params.LCHOptionRunAutomaticRecipes || false, 38 | }, 39 | LRTDidFinish () { 40 | let span = document.createElement('span'); 41 | span.classList.add('TestLauncherDidFinish'); 42 | document.body.appendChild(span); 43 | 44 | app.$destroy(); 45 | app = null; 46 | }, 47 | }, 48 | }); 49 | }, 50 | 51 | // SETUP 52 | 53 | SetupEverything() { 54 | if (params.LCHTestSkipAutomaticLaunch) { 55 | return; 56 | }; 57 | 58 | mod.ControlLaunch() 59 | }, 60 | 61 | // LIFECYCLE 62 | 63 | LifecyclePageWillLoad () { 64 | mod.SetupEverything(); 65 | }, 66 | }; 67 | 68 | window.LCHLauncherBehaviour = mod 69 | -------------------------------------------------------------------------------- /os-app/dev-launcher/ui-style-tests.js: -------------------------------------------------------------------------------- 1 | const { deepEqual } = require('assert'); 2 | 3 | const inputData = require('fs').readFileSync(require('path').join(__dirname, '__compiled/ui-style.css'), 'utf8'); 4 | 5 | describe('LCHLauncherStyle', function test_LCHLauncherStyle() { 6 | 7 | it('contains normalize', function() { 8 | deepEqual(inputData.match(/\{(.*00%)\}/)[1], 'line-height:1.15;-webkit-text-size-adjust:100%'); 9 | }); 10 | 11 | it('prefixes normalize', function() { 12 | deepEqual(typeof inputData.match(/\.Container\.svelte-\w+\{line-height:1\.15/).pop(), 'string'); 13 | }); 14 | 15 | }); 16 | -------------------------------------------------------------------------------- /os-app/dev-launcher/ui-test-pendext.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | // #purge 4 | // describe('LCHLauncherTestConvertTypeServiceSearch', function () { 5 | 6 | // before(function() { 7 | // return browser.OLSKVisit(kDefaultRoute, { 8 | // LCHLauncherTestConvertTypeServiceSearch: 'alfa', 9 | // }); 10 | // }); 11 | 12 | // it('shows one item', async function() { 13 | // browser.fill(LCHLauncherFilterInput, 'LCHLauncherTestConvertTypeServiceSearch'); 14 | // await browser.wait({element: LCHLauncherListItem}); 15 | 16 | // browser.assert.elements(LCHLauncherListItem, 1); 17 | // }); 18 | 19 | // }); 20 | 21 | // #purge 22 | // context('LCHLauncherTestConvertTypeServiceSearch', function () { 23 | 24 | // before(function() { 25 | // return browser.visit(`${ kDefaultRoute.OLSKRoutePath }?LCHLauncherTestConvertTypeServiceSearch`); 26 | // }); 27 | 28 | // it('converts recipe', async function() { 29 | // browser.fill(LCHLauncherFilterInput, 'LCHLauncherTestConvertTypeServiceSearch'); 30 | // await browser.wait({element: LCHLauncherListItem}); 31 | 32 | // browser.assert.text(LCHLauncherListItem, OLSKTestingFormatted(uLocalized('LCHLauncherTestConvertTypeServiceSearchTextFormat'), 'LCHLauncherTestConvertTypeServiceSearch')); 33 | // }); 34 | 35 | // }); 36 | -------------------------------------------------------------------------------- /os-app/dev-launcher/ui-test-safety.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('LCHLauncherSafety', function () { 4 | 5 | describe('AutomaticRunningOfPageRecipes', function test_AutomaticRunningOfPageRecipes () { 6 | 7 | before(function() { 8 | return browser.OLSKVisit(kDefaultRoute, { 9 | LCHOptionIncludePageRecipes: true, 10 | LCHTestSkipAutomaticLaunch: true, 11 | }); 12 | }); 13 | 14 | before(function () { 15 | browser.assert.elements(LCHLauncher, 0) 16 | browser.assert.input('#TestRecipeOutput', '') 17 | }); 18 | 19 | before(function () { 20 | browser.evaluate(`window.LCHPageRecipes = [{ 21 | LCHRecipeName: 'alfa', 22 | LCHRecipeCallback: function () { 23 | document.querySelector('#TestRecipeOutput').value = 'bravo'; 24 | }, 25 | LCHRecipeURLFilter: '*', 26 | LCHRecipeIsAutomatic: true, 27 | }]`) 28 | }); 29 | 30 | before(function () { 31 | return browser.pressButton('.TestLauncherInvoke'); 32 | }); 33 | 34 | before(function () { 35 | return browser.assert.input('#TestRecipeOutput', '') 36 | }); 37 | 38 | it('strips LCHRecipeIsAutomatic from LCHPageRecipes', function() { 39 | browser.assert.input('#TestRecipeOutput', '') 40 | }); 41 | 42 | context('filter', function () { 43 | 44 | before( function () { 45 | return browser.fill(LCHLauncherFilterInput, 'alfa'); 46 | }); 47 | 48 | before( function() { 49 | return browser.click(LCHLauncherListItem); 50 | }); 51 | 52 | it('runs item', function() { 53 | browser.assert.input('#TestRecipeOutput', 'bravo') 54 | }); 55 | 56 | }); 57 | 58 | }); 59 | 60 | }); 61 | -------------------------------------------------------------------------------- /os-app/dev-launcher/ui-test-tasks.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('LCHOptionRunAutomaticRecipes', function test_LCHOptionRunAutomaticRecipes () { 4 | 5 | const uStubItem = function () { 6 | return { 7 | LCHRecipeCallback: function () { 8 | return document.querySelector('#TestRecipeOutput').value = 'alfa'; 9 | }, 10 | LCHRecipeURLFilter: '*', 11 | LCHRecipeIsAutomatic: true, 12 | }; 13 | }; 14 | 15 | context('not enabled', function () { 16 | 17 | before(function() { 18 | return browser.OLSKVisit(kDefaultRoute, { 19 | StubRecipes: uStubStringify([uStubItem()]), 20 | }); 21 | }); 22 | 23 | it('runs no callback', function () { 24 | browser.assert.input('#TestRecipeOutput', ''); 25 | }); 26 | 27 | }); 28 | 29 | context('enabled', function () { 30 | 31 | before(function() { 32 | return browser.OLSKVisit(kDefaultRoute, { 33 | StubRecipes: uStubStringify([uStubItem()]), 34 | LCHOptionRunAutomaticRecipes: true, 35 | }); 36 | }); 37 | 38 | it('runs callback', function () { 39 | browser.assert.input('#TestRecipeOutput', 'alfa'); 40 | }); 41 | 42 | }); 43 | 44 | }); 45 | -------------------------------------------------------------------------------- /os-app/dev-launcher/ui-view.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | locals.OLSKPageAssets = [ 3 | '__compiled/ui-behaviour.js', 4 | '__compiled/ui-style.css', 5 | '../dev-package/__compiled/launchlet.js', 6 | 'ui-behaviour.js', 7 | ]; 8 | locals.OLSKPagePublicConstants = { 9 | OLSKSharedPageCurrentLanguage: OLSKSharedPageCurrentLanguage, 10 | }; 11 | %> 12 | 13 |

Output

14 | 15 |

16 | 17 |

18 | 19 |
20 | 21 |

22 | 23 |

24 | 25 |
26 | 27 | 30 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/launchxr', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'LCHLaunchxrRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'stub-view')); 8 | }, 9 | OLSKRouteLanguageCodes: ['en', 'fr', 'es', 'pt'], 10 | OLSKRouteIsHidden: process.env.NODE_ENV === 'production', 11 | }]; 12 | }; 13 | 14 | exports.OLSKControllerStaticAssetFiles = function () { 15 | return [ 16 | 'stub-behaviour.js', 17 | ]; 18 | }; 19 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/logic.js: -------------------------------------------------------------------------------- 1 | const mod = { 2 | 3 | LCHLauncherModeCommand () { 4 | return 'kLCHLauncherModeCommand'; 5 | }, 6 | 7 | LCHLauncherModePreview () { 8 | return 'kLCHLauncherModePreview'; 9 | }, 10 | 11 | LCHLauncherModePipe () { 12 | return 'kLCHLauncherModePipe'; 13 | }, 14 | 15 | LCHLauncherModeTask () { 16 | return 'kLCHLauncherModeTask'; 17 | }, 18 | 19 | LCHLauncherModes () { 20 | return [ 21 | mod.LCHLauncherModeCommand(), 22 | mod.LCHLauncherModePreview(), 23 | mod.LCHLauncherModePipe(), 24 | mod.LCHLauncherModeTask(), 25 | ]; 26 | }, 27 | 28 | LCHLauncherFilterFunction (fuzzysortPackage, param1, param2) { 29 | if (typeof fuzzysortPackage.go !== 'function') { 30 | throw new Error('LCHErrorInputNotValid'); 31 | } 32 | 33 | if (typeof param1 !== 'string') { 34 | throw new Error('LCHErrorInputNotValid'); 35 | } 36 | 37 | if (!Array.isArray(param2)) { 38 | throw new Error('LCHErrorInputNotValid'); 39 | } 40 | 41 | return fuzzysortPackage.go(param1, param2, { 42 | key: 'LCHRecipeName', 43 | }).sort(function (a, b) { 44 | return a.score < b.score ? 1 : (a.score > b.score ? -1 : 0); 45 | }).map(function (e) { 46 | return e.obj; 47 | }); 48 | }, 49 | 50 | }; 51 | 52 | export default mod; 53 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/main.svelte: -------------------------------------------------------------------------------- 1 | 33 | 34 | {#if LRTOptions.LCHOptionMode === LCHLauncherLogic.LCHLauncherModeCommand() } 35 | 36 | {/if} 37 | 38 | {#if LRTOptions.LCHOptionMode === LCHLauncherLogic.LCHLauncherModePipe() } 39 | 40 | {/if} 41 | 42 | {#if OLSK_SPEC_UI() } 43 | 44 | {/if} 45 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/package.js: -------------------------------------------------------------------------------- 1 | export const mod = { 2 | 3 | // DATA 4 | 5 | DataSingletonExists () { 6 | return !!mod._ValueSingleton; 7 | }, 8 | 9 | // VALUE 10 | 11 | _ValueClass: undefined, 12 | 13 | _ValueTarget: undefined, 14 | 15 | _ValueSingleton: undefined, 16 | 17 | // LIFECYCLE 18 | 19 | LifecycleSingletonCreate (inputData = {}) { 20 | if (mod._ValueSingleton) { 21 | mod.LifecycleSingletonDestroy(); 22 | } 23 | 24 | if (typeof document !== 'undefined') { 25 | document.body.appendChild(mod._ValueTarget = document.createElement('div')); 26 | } 27 | 28 | mod._ValueSingleton = new mod._ValueClass({ 29 | target: mod._ValueTarget, 30 | props: { 31 | LRTOptions: inputData, 32 | LRTDidFinish () { 33 | mod.LifecycleSingletonDestroy(); 34 | 35 | if (typeof inputData.LCHOptionCompletionHandler !== 'function') { 36 | return; 37 | } 38 | 39 | inputData.LCHOptionCompletionHandler(); 40 | }, 41 | }, 42 | }); 43 | }, 44 | 45 | LifecycleSingletonDestroy () { 46 | mod._ValueSingleton.$destroy(); 47 | 48 | delete mod._ValueSingleton; 49 | 50 | if (typeof document === 'undefined') { 51 | return; 52 | } 53 | 54 | mod._ValueTarget.remove(); 55 | 56 | delete mod._ValueTarget; 57 | }, 58 | 59 | }; 60 | 61 | export const LCHPackage = function () { 62 | const outputData = { 63 | LCHSingletonCreate: mod.LifecycleSingletonCreate, 64 | LCHSingletonExists: mod.DataSingletonExists, 65 | LCHSingletonDestroy: mod.LifecycleSingletonDestroy, 66 | }; 67 | 68 | Object.freeze(outputData); 69 | 70 | return outputData; 71 | }; 72 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/rollup-start.js: -------------------------------------------------------------------------------- 1 | import RollupStart from './main.svelte'; 2 | 3 | import * as LCHPackage from './package.js'; 4 | 5 | LCHPackage.mod._ValueClass = RollupStart; 6 | 7 | export default LCHPackage.LCHPackage(); 8 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/stub-behaviour.js: -------------------------------------------------------------------------------- 1 | const params = Object.fromEntries(Array.from((new window.URLSearchParams(window.location.search)).entries()).map(function (e) { 2 | if (['TestLauncherInput'].includes(e[0])) { 3 | e[1] = JSON.parse(e[1]); 4 | } 5 | 6 | (e[1].LCHOptionRecipes || []).forEach(function (e) { 7 | return Object.assign(e, { 8 | LCHRecipeCallback: eval(e.LCHRecipeCallback), 9 | LCHRecipeIsExcluded: eval(e.LCHRecipeIsExcluded), 10 | }); 11 | }); 12 | 13 | return e; 14 | })); 15 | 16 | const mod = { 17 | 18 | // INTERFACE 19 | 20 | InterfaceButtonDidClick() { 21 | setTimeout(function () { 22 | mod.ControlLaunch(); 23 | }); 24 | }, 25 | 26 | // CONTROL 27 | 28 | ControlLaunch() { 29 | Main.LCHSingletonCreate(Object.assign({ 30 | LCHOptionMode: 'kLCHLauncherModeCommand', 31 | LCHOptionLanguage: window.OLSKPublicConstants('OLSKSharedPageCurrentLanguage'), 32 | // LCHOptionIncludePageRecipes: !!params.LCHOptionIncludePageRecipes || false, 33 | // LCHOptionRunAutomaticRecipes: !!params.LCHOptionRunAutomaticRecipes || false, 34 | // }, 35 | // LRTDidFinish () { 36 | // let span = document.createElement('span'); 37 | // span.classList.add('TestLauncherDidFinish'); 38 | // document.body.appendChild(span); 39 | 40 | // app.$destroy(); 41 | // app = null; 42 | }, params.TestLauncherInput)); 43 | }, 44 | 45 | // SETUP 46 | 47 | SetupEverything() { 48 | if (params.LCHTestSkipAutomaticLaunch) { 49 | return; 50 | } 51 | 52 | mod.ControlLaunch(); 53 | }, 54 | 55 | // LIFECYCLE 56 | 57 | LifecyclePageWillLoad () { 58 | mod.SetupEverything(); 59 | }, 60 | 61 | }; 62 | 63 | window.LCHLauncherBehaviour = mod 64 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/stub-view.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | locals.OLSKPageAssets = [ 3 | '__compiled/ui-behaviour.js', 4 | '__compiled/ui-style.css', 5 | 'stub-behaviour.js', 6 | ]; 7 | locals.OLSKPagePublicConstants = { 8 | OLSKSharedPageCurrentLanguage: OLSKSharedPageCurrentLanguage, 9 | }; 10 | %> 11 | 12 |

13 | Output
14 | 15 |

16 | 17 |
18 | 19 |

20 | 21 |

22 | 23 |
24 | 25 | 28 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/LCHLaunchxrPrompt/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/LCHLaunchxrPrompt', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'LCHLaunchxrPromptStubRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'stub-view')); 8 | }, 9 | }]; 10 | }; 11 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/LCHLaunchxrPrompt/rollup-start.js: -------------------------------------------------------------------------------- 1 | import RollupStart from './main.svelte'; 2 | 3 | const LCHLaunchxrPrompt = new RollupStart({ 4 | target: document.body, 5 | props: Object.assign({ 6 | LCHLaunchxrPromptFilterInputPlaceholderText: '', 7 | LCHLaunchxrPromptDispatchSelect: (function (inputData) { 8 | window.TestLCHLaunchxrPromptDispatchSelect.innerHTML = parseInt(window.TestLCHLaunchxrPromptDispatchSelect.innerHTML) + 1; 9 | window.TestLCHLaunchxrPromptDispatchSelectData.innerHTML = JSON.stringify(inputData); 10 | }), 11 | LCHLaunchxrPromptDispatchEscape: (function () { 12 | window.TestLCHLaunchxrPromptDispatchEscape.innerHTML = parseInt(window.TestLCHLaunchxrPromptDispatchEscape.innerHTML) + 1; 13 | }), 14 | }, Object.fromEntries(Array.from((new window.URLSearchParams(window.location.search)).entries()).map(function (e) { 15 | if (['LCHLaunchxrPromptItems'].includes(e[0])) { 16 | e[1] = JSON.parse(e[1]); 17 | } 18 | 19 | if (['LCHLaunchxrPromptItems'].includes(e[0])) { 20 | (e[1] || []).forEach(function (e) { 21 | return Object.assign(e, { 22 | LCHRecipeCallback: eval(e.LCHRecipeCallback), 23 | LCHRecipeIsExcluded: eval(e.LCHRecipeIsExcluded), 24 | }); 25 | }); 26 | } 27 | 28 | return e; 29 | }))), 30 | }); 31 | 32 | export default LCHLaunchxrPrompt; 33 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/LCHLaunchxrPrompt/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 | LCHLaunchxrPromptDispatchSelect 15 | 0 16 | undefined 17 |

18 | 19 |

20 | LCHLaunchxrPromptDispatchEscape 21 | 0 22 |

23 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/LCHLaunchxrResultItem/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/LCHLaunchxrResultItem', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'LCHLaunchxrResultItemStubRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'stub-view')); 8 | }, 9 | }]; 10 | }; 11 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/LCHLaunchxrResultItem/main.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 |
6 | 7 | 8 | 9 |
10 | 11 | 13 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/LCHLaunchxrResultItem/rollup-start.js: -------------------------------------------------------------------------------- 1 | import RollupStart from './main.svelte'; 2 | 3 | const LCHLaunchxrResultItem = new RollupStart({ 4 | target: document.body, 5 | props: Object.fromEntries(Array.from((new window.URLSearchParams(window.location.search)).entries()).map(function (e) { 6 | if (['LCHLaunchxrResultItemObject'].includes(e[0])) { 7 | e[1] = JSON.parse(e[1]); 8 | } 9 | 10 | return e; 11 | })), 12 | }); 13 | 14 | export default LCHLaunchxrResultItem; 15 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/LCHLaunchxrResultItem/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 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/LCHLaunchxrResultItem/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | LCHLaunchxrResultItem: '.LCHLaunchxrResultItem', 5 | 6 | LCHLaunchxrResultItemTitle: '.LCHLaunchxrResultItemTitle', 7 | }).map(function (e) { 8 | return global[e.shift()] = e.pop(); 9 | }); 10 | 11 | describe('LCHLaunchxrResultItem_Access', function () { 12 | 13 | before(function() { 14 | return browser.OLSKVisit(kDefaultRoute, { 15 | LCHLaunchxrResultItemObject: JSON.stringify({}), 16 | }); 17 | }); 18 | 19 | it('shows LCHLaunchxrResultItem', function () { 20 | browser.assert.elements(LCHLaunchxrResultItem, 1); 21 | }); 22 | 23 | it('shows LCHLaunchxrResultItemTitle', function () { 24 | browser.assert.elements(LCHLaunchxrResultItemTitle, 1); 25 | }); 26 | 27 | }); 28 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/LCHLaunchxrResultItem/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('LCHLaunchxrResultItem_Misc', function () { 4 | 5 | before(function() { 6 | return browser.OLSKVisit(kDefaultRoute, { 7 | LCHLaunchxrResultItemObject: JSON.stringify({ 8 | LCHRecipeName: 'alfa', 9 | }), 10 | }); 11 | }); 12 | 13 | describe('LCHLaunchxrResultItemTitle', function test_LCHLaunchxrResultItemTitle () { 14 | 15 | it('sets aria-hidden', function () { 16 | browser.assert.attribute(LCHLaunchxrResultItemTitle, 'aria-hidden', 'true'); 17 | }); 18 | 19 | it('sets text', function () { 20 | browser.assert.text(LCHLaunchxrResultItemTitle, 'alfa'); 21 | }); 22 | 23 | }); 24 | 25 | }); 26 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/sub-command/i18n-en.yml: -------------------------------------------------------------------------------- 1 | LCHLauncherFilterInputText: Type to search 2 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/sub-command/i18n-es.yml: -------------------------------------------------------------------------------- 1 | LCHLauncherFilterInputText: Escribir para buscar 2 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/sub-command/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | LCHLauncherFilterInputText: Taper pour chercher 2 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/sub-command/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | LCHLauncherFilterInputText: Digitar para pesquisar 2 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/sub-command/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('../../controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | LCHLauncherCommand: '.LCHLauncherCommand', 5 | 6 | LCHLauncherFilterInput: '.LCHLauncherFilterInput', 7 | 8 | LCHLauncherResultItem: '.LCHLauncherResultItem', 9 | }).map(function (e) { 10 | return global[e.shift()] = e.pop(); 11 | }); 12 | 13 | describe('LCHLauncherCommand_Access', function () { 14 | 15 | before(function () { 16 | return browser.OLSKVisit(kDefaultRoute, { 17 | TestLauncherInput: uStubStringifyAll({ 18 | LCHOptionRecipes: uStubTwoItems(), 19 | }), 20 | }); 21 | }); 22 | 23 | it('shows LCHLauncherCommand', function () { 24 | browser.assert.elements(LCHLauncherCommand, 1); 25 | }); 26 | 27 | it('shows LCHLauncherFilterInput', function () { 28 | browser.assert.elements(LCHLauncherFilterInput, 1); 29 | }); 30 | 31 | it('shows OLSKNarrow', function () { 32 | browser.assert.elements('.OLSKNarrow', 1); 33 | }); 34 | 35 | it('hides LCHLauncherResultItem', function () { 36 | browser.assert.elements(LCHLauncherResultItem, 0); 37 | }); 38 | 39 | context('filter', function () { 40 | 41 | before(function () { 42 | return browser.fill(LCHLauncherFilterInput, 'alfa'); 43 | }); 44 | 45 | it('shows LCHLauncherResultItem', function () { 46 | browser.assert.elements(LCHLauncherResultItem, 1); 47 | }); 48 | 49 | }); 50 | 51 | context('select', function () { 52 | 53 | before(function () { 54 | return browser.click(LCHLauncherResultItem); 55 | }); 56 | 57 | it('hides LCHLauncherCommand', function () { 58 | browser.assert.elements(LCHLauncherCommand, 0); 59 | }); 60 | 61 | }); 62 | 63 | }); 64 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/sub-command/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('LCHLauncherCommand_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function () { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | }); 15 | }); 16 | 17 | it('localizes LCHLauncherFilterInput', function () { 18 | browser.assert.attribute(LCHLauncherFilterInput, 'placeholder', uLocalized('LCHLauncherFilterInputText')); 19 | }); 20 | 21 | }); 22 | 23 | }); 24 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/sub-command/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('../../controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('LCHLauncherCommand_Misc', function () { 4 | 5 | before(function () { 6 | return browser.OLSKVisit(kDefaultRoute, { 7 | TestLauncherInput: uStubStringifyAll({ 8 | LCHOptionRecipes: uStubTwoItems(), 9 | }), 10 | }); 11 | }); 12 | 13 | it('classes LCHLauncher', function () { 14 | browser.assert.hasClass(LCHLauncherCommand, 'LCHLauncher'); 15 | }); 16 | 17 | describe('LCHLauncherFilterInput', function test_LCHLauncherFilterInput () { 18 | 19 | it('sets autofocus', function () { 20 | browser.assert.attribute(LCHLauncherFilterInput, 'autofocus', ''); 21 | }); 22 | 23 | }); 24 | 25 | describe('LCHLauncherResultItem', function test_LCHLauncherResultItem () { 26 | 27 | before(function () { 28 | return browser.fill(LCHLauncherFilterInput, 'alfa'); 29 | }); 30 | 31 | context('click', function () { 32 | 33 | before(function () { 34 | browser.assert.input('#TestRecipeOutput', ''); 35 | }); 36 | 37 | before(function () { 38 | return browser.click(LCHLauncherResultItem); 39 | }); 40 | 41 | it('runs callback', function () { 42 | browser.assert.input('#TestRecipeOutput', 'alfa'); 43 | }); 44 | 45 | }); 46 | 47 | }); 48 | 49 | }); 50 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/sub-command/ui-test-filter.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('../../controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('LCHLauncherCommand_Filter', function () { 4 | 5 | before(function () { 6 | return browser.OLSKVisit(kDefaultRoute, { 7 | TestLauncherInput: uStubStringifyAll({ 8 | LCHOptionRecipes: uStubTwoItems(), 9 | }), 10 | }); 11 | }); 12 | 13 | context('no match', function () { 14 | 15 | before(function () { 16 | browser.fill(LCHLauncherFilterInput, 'charlie'); 17 | }); 18 | 19 | it('filters all', function() { 20 | browser.assert.elements(LCHLauncherResultItem, 0); 21 | }); 22 | 23 | }); 24 | 25 | context('partial match', function () { 26 | 27 | before(function () { 28 | browser.fill(LCHLauncherFilterInput, 'a'); 29 | }); 30 | 31 | it('filters partial', function() { 32 | browser.assert.elements(LCHLauncherResultItem, 2); 33 | }); 34 | 35 | it('sets OLSKCollectionItemsLocus', function () { 36 | browser.assert.elements('.OLSKCollectionItemLocus', 1); 37 | }); 38 | 39 | }); 40 | 41 | context('exact match', function () { 42 | 43 | before(function () { 44 | browser.fill(LCHLauncherFilterInput, 'bravo'); 45 | }); 46 | 47 | it('filters exact', function() { 48 | browser.assert.elements(LCHLauncherResultItem, 1); 49 | }); 50 | 51 | it('sets OLSKCollectionItemsLocus', function () { 52 | browser.assert.elements('.OLSKCollectionItemLocus', 1); 53 | }); 54 | 55 | }); 56 | 57 | }); 58 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/sub-pipe/i18n-en.yml: -------------------------------------------------------------------------------- 1 | LCHLauncherPipeSubjectPromptFilterInputPlaceholderText: Subject 2 | LCHLauncherPipeSubjectPromptPlaceholderText: Type to search 3 | LCHLauncherPipeActionPromptFilterInputPlaceholderText: Action 4 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/sub-pipe/i18n-es.yml: -------------------------------------------------------------------------------- 1 | LCHLauncherPipeSubjectPromptFilterInputPlaceholderText: Sujeto 2 | LCHLauncherPipeSubjectPromptPlaceholderText: Escribir para buscar 3 | LCHLauncherPipeActionPromptFilterInputPlaceholderText: Acción 4 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/sub-pipe/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | LCHLauncherPipeSubjectPromptFilterInputPlaceholderText: Sujet 2 | LCHLauncherPipeSubjectPromptPlaceholderText: Taper pour chercher 3 | LCHLauncherPipeActionPromptFilterInputPlaceholderText: Action 4 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/sub-pipe/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | LCHLauncherPipeSubjectPromptFilterInputPlaceholderText: Sujeito 2 | LCHLauncherPipeSubjectPromptPlaceholderText: Digitar para pesquisar 3 | LCHLauncherPipeActionPromptFilterInputPlaceholderText: Ação 4 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/sub-pipe/main.svelte: -------------------------------------------------------------------------------- 1 | 37 | 38 | 39 |
40 | 41 |
42 | 49 |
50 | 51 |
52 | 58 |
59 | 60 |
61 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/sub-pipe/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('../../controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | LCHLauncherPipe: '.LCHLauncherPipe', 5 | 6 | LCHLauncherPipeSubjectPrompt: '.LCHLauncherPipeSubject .LCHLauncherPrompt', 7 | 8 | LCHLauncherPipeActionPrompt: '.LCHLauncherPipeAction .LCHLauncherPrompt', 9 | }).map(function (e) { 10 | return global[e.shift()] = e.pop(); 11 | }); 12 | 13 | describe('LCHLauncherPipe_Access', function () { 14 | 15 | before(function () { 16 | return browser.OLSKVisit(kDefaultRoute, { 17 | TestLauncherInput: uStubStringifyAll({ 18 | LCHOptionMode: 'kLCHLauncherModePipe', 19 | }), 20 | }); 21 | }); 22 | 23 | it('shows LCHLauncherPipe', function () { 24 | browser.assert.elements(LCHLauncherPipe, 1); 25 | }); 26 | 27 | it('shows LCHLauncherPipeSubjectPrompt', function () { 28 | browser.assert.elements(LCHLauncherPipeSubjectPrompt, 1); 29 | }); 30 | 31 | it('shows LCHLauncherPipeActionPrompt', function () { 32 | browser.assert.elements(LCHLauncherPipeActionPrompt, 1); 33 | }); 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/sub-pipe/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('LCHLauncherPipe_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function () { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | TestLauncherInput: uStubStringifyAll({ 15 | LCHOptionMode: 'kLCHLauncherModePipe', 16 | }), 17 | }); 18 | }); 19 | 20 | it('localizes LCHLauncherPipeSubjectPromptFilterInputPlaceholderText', function () { 21 | browser.assert.attribute(`${ LCHLauncherPipeSubjectPrompt } .LCHLauncherFilterInput`, 'placeholder', uLocalized('LCHLauncherPipeSubjectPromptFilterInputPlaceholderText')); 22 | }); 23 | 24 | it('localizes LCHLauncherPipeSubjectPromptPlaceholderText', function () { 25 | browser.assert.text(`${ LCHLauncherPipeSubjectPrompt } .LCHLauncherPromptPlaceholder`, uLocalized('LCHLauncherPipeSubjectPromptPlaceholderText')); 26 | }); 27 | 28 | it('localizes LCHLauncherPipeActionPromptFilterInputPlaceholderText', function () { 29 | browser.assert.attribute(`${ LCHLauncherPipeActionPrompt } .LCHLauncherFilterInput`, 'placeholder', uLocalized('LCHLauncherPipeActionPromptFilterInputPlaceholderText')); 30 | }); 31 | 32 | }); 33 | 34 | }); 35 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/submodules/sub-pipe/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('../../controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('LCHLauncherPipe_Misc', function () { 4 | 5 | before(function () { 6 | return browser.OLSKVisit(kDefaultRoute, { 7 | TestLauncherInput: uStubStringifyAll({ 8 | LCHOptionMode: 'kLCHLauncherModePipe', 9 | }), 10 | }); 11 | }); 12 | 13 | it('classes LCHLauncher', function () { 14 | browser.assert.hasClass(LCHLauncherPipe, 'LCHLauncher'); 15 | }); 16 | 17 | }); 18 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | const LCHLauncherLogic = require('./logic.js').default; 4 | 5 | Object.entries({ 6 | LCHLauncher: '.LCHLauncher', 7 | }).map(function (e) { 8 | return global[e.shift()] = e.pop(); 9 | }); 10 | 11 | describe('LCHLauncher_Access', function () { 12 | 13 | before(function() { 14 | return browser.OLSKVisit(kDefaultRoute); 15 | }); 16 | 17 | it('shows LCHLauncher', function() { 18 | browser.assert.elements(LCHLauncher, 1) 19 | }); 20 | 21 | it('shows LCHLauncherCommand', function() { 22 | browser.assert.elements('.LCHLauncherCommand', 1) 23 | }); 24 | 25 | context('mode_command', function test_mode_command () { 26 | 27 | before(function() { 28 | return browser.OLSKVisit(kDefaultRoute, { 29 | TestLauncherInput: JSON.stringify({ 30 | LCHOptionMode: LCHLauncherLogic.LCHLauncherModeCommand(), 31 | }), 32 | }); 33 | }); 34 | 35 | it('shows LCHLauncher', function() { 36 | browser.assert.elements(LCHLauncher, 1) 37 | }); 38 | 39 | it('shows LCHLauncherCommand', function() { 40 | browser.assert.elements('.LCHLauncherCommand', 1) 41 | }); 42 | 43 | }); 44 | 45 | context('mode_pipe', function test_mode_pipe () { 46 | 47 | before(function() { 48 | return browser.OLSKVisit(kDefaultRoute, { 49 | TestLauncherInput: JSON.stringify({ 50 | LCHOptionMode: LCHLauncherLogic.LCHLauncherModePipe(), 51 | }), 52 | }); 53 | }); 54 | 55 | it('shows LCHLauncher', function() { 56 | browser.assert.elements(LCHLauncher, 1) 57 | }); 58 | 59 | it('shows LCHLauncherPipe', function() { 60 | browser.assert.elements('.LCHLauncherPipe', 1) 61 | }); 62 | 63 | }); 64 | 65 | }); 66 | -------------------------------------------------------------------------------- /os-app/dev-launchxr/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('LCHLauncher_Misc', function () { 4 | 5 | before(function() { 6 | return browser.OLSKVisit(kDefaultRoute); 7 | }); 8 | 9 | }); 10 | -------------------------------------------------------------------------------- /os-app/dev-package/controller.js: -------------------------------------------------------------------------------- 1 | const pathPackage = require('path'); 2 | 3 | exports.OLSKControllerRoutes = function() { 4 | return { 5 | LCHPackageRoute: { 6 | OLSKRoutePath: '/package', 7 | OLSKRouteMethod: 'get', 8 | OLSKRouteFunction (req, res, next) { 9 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'ui-view')); 10 | }, 11 | OLSKRouteLanguageCodes: ['en'], 12 | OLSKRouteIsHidden: process.env.NODE_ENV === 'production', 13 | }, 14 | LCHPackageCompiledScriptRedirect: { 15 | OLSKRoutePath: '/launchlet.js', 16 | OLSKRouteMethod: 'get', 17 | OLSKRouteRedirect: require('path').join('/', require('path').basename(__dirname), '__compiled/launchlet.js'), 18 | }, 19 | LCHPackageCompiledStyleRedirect: { 20 | OLSKRoutePath: '/launchlet.css', 21 | OLSKRouteMethod: 'get', 22 | OLSKRouteRedirect: require('path').join('/', require('path').basename(__dirname), '__compiled/launchlet.css'), 23 | }, 24 | }; 25 | }; 26 | 27 | //_ OLSKControllerSharedStaticAssetFolders 28 | 29 | exports.OLSKControllerSharedStaticAssetFolders = function() { 30 | return [ 31 | '__compiled', 32 | ]; 33 | }; 34 | 35 | -------------------------------------------------------------------------------- /os-app/dev-package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "launchlet", 3 | "files": [ 4 | "__compiled/launchlet*" 5 | ], 6 | "repository": { 7 | "type" : "git", 8 | "url" : "https://github.com/rosano/launchlet.git" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /os-app/dev-package/rollup-config-custom-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./rollup-config-custom.js'); 4 | 5 | describe('LCHPackageRollupConfigCustom', function test_LCHPackageRollupConfigCustom() { 6 | 7 | it('throws error if not object', function() { 8 | throws(function() { 9 | mod.LCHPackageRollupConfigCustom(null); 10 | }, /LCHErrorInputNotValid/); 11 | }); 12 | 13 | it('sets output.name', function() { 14 | deepEqual(mod.LCHPackageRollupConfigCustom({ 15 | output: {}, 16 | plugins: [], 17 | }).output.name, 'Launchlet'); 18 | }); 19 | 20 | it('sets output.file', function() { 21 | deepEqual(mod.LCHPackageRollupConfigCustom({ 22 | output: {}, 23 | plugins: [], 24 | }).output.file, require('path').join(__dirname, '__compiled/launchlet.js')); 25 | }); 26 | 27 | }); 28 | -------------------------------------------------------------------------------- /os-app/dev-package/rollup-config-custom.js: -------------------------------------------------------------------------------- 1 | const pathPackage = require('path'); 2 | 3 | module.exports = { 4 | LCHPackageRollupConfigCustom (inputData, options) { 5 | if (typeof inputData !== 'object' || inputData === null) { 6 | throw new Error('LCHErrorInputNotValid'); 7 | } 8 | 9 | inputData.output.name = 'Launchlet'; 10 | 11 | inputData.output.file = pathPackage.join(__dirname, '__compiled/launchlet.js'); 12 | 13 | if (!inputData.plugins.length) { 14 | return inputData; 15 | } 16 | 17 | inputData.plugins.splice(inputData.plugins.indexOf(inputData.plugins.filter(function (e) { 18 | if (typeof e !== 'object') { 19 | return false; 20 | } 21 | 22 | return e.name === 'svelte'; 23 | }).pop()), 1, require('rollup-plugin-svelte')(Object.assign(require('OLSKRollupScaffold').OLSKRollupScaffoldSvelteConfig(options), { 24 | css (css) { 25 | css.code = require('fs').readFileSync(pathPackage.join(__dirname, '../dev-launcher/__compiled/ui-style.css'), 'utf8').replace('ui-style', 'launchlet'); 26 | 27 | return css.write('launchlet.css'); 28 | }, 29 | }))); 30 | 31 | return inputData; 32 | }, 33 | OLSKRollupConfigCustom (inputData, options) { 34 | return module.exports.LCHPackageRollupConfigCustom(inputData, options); 35 | }, 36 | }; 37 | -------------------------------------------------------------------------------- /os-app/dev-package/rollup-start.js: -------------------------------------------------------------------------------- 1 | import * as mod from './main.js'; 2 | 3 | import Main from '../dev-launcher/__compiled/ui-behaviour.js'; 4 | mod.mod._ValueClass = Main; 5 | 6 | export default mod.LCHPackage(); 7 | -------------------------------------------------------------------------------- /os-app/dev-package/ui-behaviour.js: -------------------------------------------------------------------------------- 1 | const mod = { 2 | 3 | // SETUP 4 | 5 | SetupEverything() { 6 | Launchlet.LCHSingletonCreate({ 7 | LCHOptionRecipes: [ 8 | { 9 | LCHRecipeName: 'Alfa', 10 | LCHRecipeCallback () { 11 | alert('Alfa'); 12 | }, 13 | }, 14 | ], 15 | }); 16 | }, 17 | 18 | // LIFECYCLE 19 | 20 | LifecyclePageWillLoad () { 21 | mod.SetupEverything(); 22 | }, 23 | 24 | }; 25 | 26 | window.LCHPackageBehaviour = mod; 27 | -------------------------------------------------------------------------------- /os-app/dev-package/ui-style-tests.js: -------------------------------------------------------------------------------- 1 | const { deepEqual } = require('assert'); 2 | 3 | describe('LCHPackageStyle', function test_LCHPackageStyle() { 4 | 5 | it('contains launcher style', function() { 6 | deepEqual(require('fs').readFileSync(require('path').join(__dirname, '__compiled/launchlet.css'), 'utf8').slice(0, 100), require('fs').readFileSync(require('path').join(__dirname, '../dev-launcher/__compiled/ui-style.css'), 'utf8').slice(0, 100)); 7 | }); 8 | 9 | }); 10 | -------------------------------------------------------------------------------- /os-app/dev-package/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const routes = require('./controller.js').OLSKControllerRoutes(); 2 | 3 | describe('LCHPackage_Access', function test_LCHPackage_AccessPipe () { 4 | 5 | it('redirects to script', async function() { 6 | browser.assert.deepEqual((await (await browser.fetch('http://localhost' + OLSKTestingCanonical(routes.LCHPackageCompiledScriptRedirect))).text()).slice(0, 13), 'var Launchlet'); 7 | }); 8 | 9 | it('redirects to style', async function() { 10 | browser.assert.deepEqual((await (await browser.fetch('http://localhost' + OLSKTestingCanonical(routes.LCHPackageCompiledStyleRedirect))).text()).slice(0, 10), '.OLSKResul'); 11 | }); 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /os-app/dev-package/ui-view.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | locals.OLSKPageAssets = [ 3 | '__compiled/launchlet.css', 4 | '__compiled/launchlet.js', 5 | 'ui-behaviour.js', 6 | ]; 7 | locals.OLSKPagePublicConstants = { 8 | OLSKSharedPageCurrentLanguage: OLSKSharedPageCurrentLanguage, 9 | }; 10 | %> 11 | 12 |

Package

13 | 14 | 17 | -------------------------------------------------------------------------------- /os-app/open-compose/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/compose', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'LCHComposeRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'ui-view.ejs'), { 8 | LCHComposeBuildPackageStyle: require('fs').readFileSync(require('path').join(__dirname, '../dev-package/__compiled/launchlet.css'), 'utf8'), 9 | LCHComposeBuildPackageScript: require('fs').readFileSync(require('path').join(__dirname, '../dev-package/__compiled/launchlet.js'), 'utf8'), 10 | }); 11 | }, 12 | OLSKRouteLanguageCodes: ['en', 'fr', 'es', 'pt'], 13 | _OLSKRouteSkipLanguageRedirect: true, 14 | }]; 15 | }; 16 | -------------------------------------------------------------------------------- /os-app/open-compose/i18n-en.yml: -------------------------------------------------------------------------------- 1 | LCHComposeTitle: Compose 2 | LCHComposeCreateButtonText: Create 3 | LCHComposeListItemUntitledText: Untitled 4 | LCHComposeToolsPairButtonText: Pair extension 5 | LCHComposePublicKeyNotValidAlertText: Input not valid 6 | LCHComposeToolsPairStatusWaitingText: Waiting 7 | LCHComposeToolsPairStatusFailedText: Failed 8 | LCHComposeLauncherItemCloneText: Clone recipe 9 | -------------------------------------------------------------------------------- /os-app/open-compose/i18n-es.yml: -------------------------------------------------------------------------------- 1 | LCHComposeTitle: Componer 2 | LCHComposeCreateButtonText: Crear 3 | LCHComposeListItemUntitledText: Sin título 4 | LCHComposeToolsPairButtonText: Emparejar extensión 5 | LCHComposePublicKeyNotValidAlertText: Entrada no válido 6 | LCHComposeToolsPairStatusWaitingText: Esperando 7 | LCHComposeToolsPairStatusFailedText: Falló 8 | LCHComposeLauncherItemCloneText: Clonar receta 9 | -------------------------------------------------------------------------------- /os-app/open-compose/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | LCHComposeTitle: Composer 2 | LCHComposeCreateButtonText: Créer 3 | LCHComposeListItemUntitledText: Sans titre 4 | LCHComposeToolsPairButtonText: Associer l'extension 5 | LCHComposePublicKeyNotValidAlertText: Entrée non valide 6 | LCHComposeToolsPairStatusWaitingText: En attente 7 | LCHComposeToolsPairStatusFailedText: Échoué 8 | LCHComposeLauncherItemCloneText: Cloner recette 9 | -------------------------------------------------------------------------------- /os-app/open-compose/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | LCHComposeTitle: Compor 2 | LCHComposeCreateButtonText: Criar 3 | LCHComposeListItemUntitledText: Sem título 4 | LCHComposeToolsPairButtonText: Extensão do par 5 | LCHComposePublicKeyNotValidAlertText: Entrada não válida 6 | LCHComposeToolsPairStatusWaitingText: Esperando 7 | LCHComposeToolsPairStatusFailedText: Falhado 8 | LCHComposeLauncherItemCloneText: Clonar a receita 9 | -------------------------------------------------------------------------------- /os-app/open-compose/rollup-start.js: -------------------------------------------------------------------------------- 1 | import RollupStart from './main.svelte'; 2 | 3 | import { OLSK_SPEC_UI } from 'OLSKSpec'; 4 | 5 | const LCHCompose = new RollupStart({ 6 | target: document.body, 7 | }); 8 | 9 | export default LCHCompose; 10 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeBuild/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/LCHComposeBuild', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'LCHComposeBuildStubRoute', 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/open-compose/submodules/LCHComposeBuild/i18n-en.yml: -------------------------------------------------------------------------------- 1 | LCHComposeBuildRunLinkText: Run 2 | LCHComposeBuildPipeModeEnabledFieldLabelText: Pipe mode 3 | LCHComposeBuildPageRecipesEnabledFieldLabelText: Include page recipes 4 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeBuild/i18n-es.yml: -------------------------------------------------------------------------------- 1 | LCHComposeBuildRunLinkText: Ejecutar 2 | LCHComposeBuildPipeModeEnabledFieldLabelText: Modo de 'Pipe' 3 | LCHComposeBuildPageRecipesEnabledFieldLabelText: Incluir recetas de página 4 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeBuild/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | LCHComposeBuildRunLinkText: Exécuter 2 | LCHComposeBuildPipeModeEnabledFieldLabelText: Mode Pipe 3 | LCHComposeBuildPageRecipesEnabledFieldLabelText: Inclure les recettes de la page 4 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeBuild/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | LCHComposeBuildRunLinkText: Executar 2 | LCHComposeBuildPipeModeEnabledFieldLabelText: Modo Encanado 3 | LCHComposeBuildPageRecipesEnabledFieldLabelText: Incluir receitas da página 4 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeBuild/main.svelte: -------------------------------------------------------------------------------- 1 | 23 | 24 |
25 | 26 | { OLSKLocalized('LCHComposeBuildRunLinkText') } 27 | 28 | 32 | 33 | 37 | 38 |
39 | 40 | 51 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeBuild/rollup-start.js: -------------------------------------------------------------------------------- 1 | import RollupStart from './main.svelte'; 2 | 3 | const LCHComposeBuild = new RollupStart({ 4 | target: document.body, 5 | props: Object.assign({ 6 | LCHComposeBuildPipeModeEnabled: false, 7 | LCHComposeBuildPageRecipesEnabled: false, 8 | LCHComposeBuildDispatchRun: (function () { 9 | window.TestLCHComposeBuildDispatchRun.innerHTML = parseInt(window.TestLCHComposeBuildDispatchRun.innerHTML) + 1; 10 | }), 11 | LCHComposeBuildDispatchPipeModeEnabled: (function (inputData) { 12 | window.TestLCHComposeBuildDispatchPipeModeEnabled.innerHTML = parseInt(window.TestLCHComposeBuildDispatchPipeModeEnabled.innerHTML) + 1; 13 | window.TestLCHComposeBuildDispatchPipeModeEnabledData.innerHTML = inputData; 14 | }), 15 | LCHComposeBuildDispatchPageRecipesEnabled: (function (inputData) { 16 | window.TestLCHComposeBuildDispatchPageRecipesEnabled.innerHTML = parseInt(window.TestLCHComposeBuildDispatchPageRecipesEnabled.innerHTML) + 1; 17 | window.TestLCHComposeBuildDispatchPageRecipesEnabledData.innerHTML = inputData; 18 | }), 19 | }, Object.fromEntries(Array.from((new window.URLSearchParams(window.location.search)).entries()))), 20 | }); 21 | 22 | export default LCHComposeBuild; 23 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeBuild/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 | LCHComposeBuildDispatchRun 15 | 0 16 |

17 | 18 |

19 | LCHComposeBuildDispatchPipeModeEnabled 20 | 0 21 | undefined 22 |

23 | 24 |

25 | LCHComposeBuildDispatchPageRecipesEnabled 26 | 0 27 | undefined 28 |

29 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeBuild/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | LCHComposeBuild: '.LCHComposeBuild', 5 | 6 | LCHComposeBuildRunLink: '.LCHComposeBuildRunLink', 7 | 8 | LCHComposeBuildPipeModeEnabledField: '.LCHComposeBuildPipeModeEnabledField', 9 | LCHComposeBuildPipeModeEnabledFieldLabel: '.LCHComposeBuildPipeModeEnabledFieldLabel', 10 | 11 | LCHComposeBuildPageRecipesEnabledField: '.LCHComposeBuildPageRecipesEnabledField', 12 | LCHComposeBuildPageRecipesEnabledFieldLabel: '.LCHComposeBuildPageRecipesEnabledFieldLabel', 13 | }).map(function (e) { 14 | return global[e.shift()] = e.pop(); 15 | }); 16 | 17 | describe('LCHComposeBuild_Access', function () { 18 | 19 | before(function() { 20 | return browser.OLSKVisit(kDefaultRoute, { 21 | LCHComposeBuildRunLink: 'alfa', 22 | }); 23 | }); 24 | 25 | it('shows LCHComposeBuild', function () { 26 | browser.assert.elements(LCHComposeBuild, 1); 27 | }); 28 | 29 | it('shows LCHComposeBuildRunLink', function () { 30 | browser.assert.elements(LCHComposeBuildRunLink, 1); 31 | }); 32 | 33 | it('shows LCHComposeBuildPipeModeEnabledField', function () { 34 | browser.assert.elements(LCHComposeBuildPipeModeEnabledField, 1); 35 | }); 36 | 37 | it('shows LCHComposeBuildPipeModeEnabledFieldLabel', function () { 38 | browser.assert.elements(LCHComposeBuildPipeModeEnabledFieldLabel, 1); 39 | }); 40 | 41 | it('shows LCHComposeBuildPageRecipesEnabledField', function () { 42 | browser.assert.elements(LCHComposeBuildPageRecipesEnabledField, 1); 43 | }); 44 | 45 | it('shows LCHComposeBuildPageRecipesEnabledFieldLabel', function () { 46 | browser.assert.elements(LCHComposeBuildPageRecipesEnabledFieldLabel, 1); 47 | }); 48 | 49 | }); 50 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeBuild/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('LCHComposeBuild_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | LCHComposeBuildRunLink: 'alfa', 15 | }); 16 | }); 17 | 18 | it('localizes LCHComposeBuildRunLink', function() { 19 | browser.assert.text(LCHComposeBuildRunLink, uLocalized('LCHComposeBuildRunLinkText')); 20 | }); 21 | 22 | it('localizes LCHComposeBuildPipeModeEnabledFieldLabel', function () { 23 | browser.assert.text(LCHComposeBuildPipeModeEnabledFieldLabel, uLocalized('LCHComposeBuildPipeModeEnabledFieldLabelText')); 24 | }); 25 | 26 | it('localizes LCHComposeBuildPageRecipesEnabledFieldLabel', function () { 27 | browser.assert.text(LCHComposeBuildPageRecipesEnabledFieldLabel, uLocalized('LCHComposeBuildPageRecipesEnabledFieldLabelText')); 28 | }); 29 | 30 | }); 31 | 32 | }); 33 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeDetail/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/LCHComposeDetail', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'LCHComposeDetailStubRoute', 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/open-compose/submodules/LCHComposeDetail/i18n-en.yml: -------------------------------------------------------------------------------- 1 | LCHComposeDetailToolbarBackButtonText: Back 2 | LCHComposeDetailToolbarCloneButtonText: Clone 3 | LCHComposeDetailToolbarDiscardButtonText: Discard 4 | LCHComposeDetailFlagAlertText: This recipe will be ignored because it contains potentially unsafe code. 5 | LCHComposeDetailFormNameFieldText: Name (e.g. Say Hello) 6 | LCHComposeDetailFormSignatureFieldText: Signature (e.g. XYZGreet) 7 | LCHComposeDetailFormInputTypesFieldText: 'Input Types (e.g. String, Bool)' 8 | LCHComposeDetailFormCallbackArgsFieldText: arguments 9 | LCHComposeDetailFormCallbackBodyFieldText: Function Body (e.g. window.alert('Hello');) 10 | LCHComposeDetailFormOutputTypeFieldText: Output Type (e.g. String) 11 | LCHComposeDetailFormCanonicalExampleCallbackBodyFieldText: Canonical Example Body 12 | LCHComposeDetailFormStyleFieldText: 'CSS (e.g. body { background: red; })' 13 | LCHComposeDetailFormURLFilterFieldText: 'URL Filter (e.g. example.com or /https?://(.*\\.)?example\\.com/i)' 14 | LCHComposeDetailFormIsAutomaticFieldLabelText: Run automatically 15 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeDetail/i18n-es.yml: -------------------------------------------------------------------------------- 1 | LCHComposeDetailToolbarBackButtonText: Back 2 | LCHComposeDetailToolbarCloneButtonText: Clonar 3 | LCHComposeDetailToolbarDiscardButtonText: Eliminar 4 | LCHComposeDetailFlagAlertText: Esta receta sera ignorada porque tiene código potencialmente inseguro. 5 | LCHComposeDetailFormNameFieldText: Nombre (e.g. Decir hola) 6 | LCHComposeDetailFormSignatureFieldText: Firma (e.g. XYZDarLaBienvenida) 7 | LCHComposeDetailFormInputTypesFieldText: 'Tipos de entrada (e.g. String, Bool)' 8 | LCHComposeDetailFormCallbackArgsFieldText: argumentos 9 | LCHComposeDetailFormCallbackBodyFieldText: Cuerpo de función (e.g. window.alert('Hola');) 10 | LCHComposeDetailFormOutputTypeFieldText: Tipo de salida (e.g. String) 11 | LCHComposeDetailFormCanonicalExampleCallbackBodyFieldText: Cuerpo del ejemplo canónico 12 | LCHComposeDetailFormStyleFieldText: 'CSS (e.g. body { background: red; })' 13 | LCHComposeDetailFormURLFilterFieldText: 'URL Filter (e.g. example.com o /https?://(.*\\.)?example\\.com/i)' 14 | LCHComposeDetailFormIsAutomaticFieldLabelText: Ejecutar automáticamente 15 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeDetail/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | LCHComposeDetailToolbarBackButtonText: Back 2 | LCHComposeDetailToolbarCloneButtonText: Cloner 3 | LCHComposeDetailToolbarDiscardButtonText: Supprimer 4 | LCHComposeDetailFlagAlertText: Cette recette va être ignorée parce qu'elle contient du code potentiellement non-sécurisé. 5 | LCHComposeDetailFormNameFieldText: Nom (e.g. Dire bonjour) 6 | LCHComposeDetailFormSignatureFieldText: Signature (e.g. XYZAccueillir) 7 | LCHComposeDetailFormInputTypesFieldText: 'Types de saisie (e.g. String, Bool)' 8 | LCHComposeDetailFormCallbackArgsFieldText: arguments 9 | LCHComposeDetailFormCallbackBodyFieldText: Corps de fonction (e.g. window.alert('Bonjour');) 10 | LCHComposeDetailFormOutputTypeFieldText: Type de sortie (e.g. String) 11 | LCHComposeDetailFormCanonicalExampleCallbackBodyFieldText: Corps de l'exemple canonique 12 | LCHComposeDetailFormStyleFieldText: 'CSS (e.g. body { background: red; })' 13 | LCHComposeDetailFormURLFilterFieldText: 'URL Filter (e.g. example.com ou /https ?://(.*\\.) ?example\\.com/i)' 14 | LCHComposeDetailFormIsAutomaticFieldLabelText: Exécuter automatiquement 15 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeDetail/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | LCHComposeDetailToolbarBackButtonText: Voltar 2 | LCHComposeDetailToolbarCloneButtonText: Clonar 3 | LCHComposeDetailToolbarDiscardButtonText: Eliminar 4 | LCHComposeDetailFlagAlertText: Essa receita será ignorada porque contém um código potencialmente inseguro. 5 | LCHComposeDetailFormNameFieldText: 'Nome (por exemplo: Dizer Olá)' 6 | LCHComposeDetailFormSignatureFieldText: 'Assinatura (por exemplo, XYZCumprimentar)' 7 | LCHComposeDetailFormInputTypesFieldText: 'Tipos de entrada (por exemplo, String, Bool)' 8 | LCHComposeDetailFormCallbackArgsFieldText: argumentos 9 | LCHComposeDetailFormCallbackBodyFieldText: 'Corpo da Função (por exemplo, window.alert(''Olá'');)' 10 | LCHComposeDetailFormOutputTypeFieldText: 'Tipo de saída (por exemplo, String)' 11 | LCHComposeDetailFormCanonicalExampleCallbackBodyFieldText: Corpo do Exemplo Canônico 12 | LCHComposeDetailFormStyleFieldText: 'CSS (por exemplo, body { background: red; })' 13 | LCHComposeDetailFormURLFilterFieldText: 'Filtro do URL (por exemplo, example.com ou /https?://(.*\\.)?example\\.com/i)''' 14 | LCHComposeDetailFormIsAutomaticFieldLabelText: É automatico 15 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeDetail/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 (['LCHComposeDetailItem'].includes(e[0])) { 5 | e[1] = JSON.parse(e[1]); 6 | } 7 | 8 | return e; 9 | })); 10 | 11 | const mod = { 12 | 13 | // REACT 14 | 15 | ReactDetailItem (inputData) { 16 | window.TestLCHComposeDetailItem.innerHTML = JSON.stringify(inputData); 17 | }, 18 | 19 | // SETUP 20 | 21 | SetupEverything() { 22 | mod.ReactDetailItem(params.LCHComposeDetailItem); 23 | }, 24 | 25 | // LIFECYCLE 26 | 27 | LifecycleModuleDidLoad() { 28 | mod.SetupEverything(); 29 | }, 30 | 31 | }; 32 | 33 | mod.LifecycleModuleDidLoad(); 34 | 35 | const LCHComposeDetail = new RollupStart({ 36 | target: document.body, 37 | props: Object.assign({ 38 | LCHComposeDetailDispatchBack: (function () { 39 | window.TestLCHComposeDetailDispatchBack.innerHTML = parseInt(window.TestLCHComposeDetailDispatchBack.innerHTML) + 1; 40 | }), 41 | LCHComposeDetailDispatchClone: (function () { 42 | window.TestLCHComposeDetailDispatchClone.innerHTML = parseInt(window.TestLCHComposeDetailDispatchClone.innerHTML) + 1; 43 | }), 44 | LCHComposeDetailDispatchDiscard: (function (inputData) { 45 | window.TestLCHComposeDetailDispatchDiscard.innerHTML = parseInt(window.TestLCHComposeDetailDispatchDiscard.innerHTML) + 1; 46 | }), 47 | LCHComposeDetailDispatchUpdate: (function () { 48 | window.TestLCHComposeDetailDispatchUpdate.innerHTML = parseInt(window.TestLCHComposeDetailDispatchUpdate.innerHTML) + 1; 49 | 50 | mod.ReactDetailItem(params.LCHComposeDetailItem); 51 | }), 52 | }, params), 53 | }); 54 | 55 | export default LCHComposeDetail; 56 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeDetail/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/addon/edit/continuelist.js', 10 | 11 | '/_shared/__external/codemirror/addon/mode/overlay.js', 12 | 13 | '/_shared/__external/codemirror/addon/search/search.js', 14 | '/_shared/__external/codemirror/addon/search/searchcursor.js', 15 | '/_shared/__external/codemirror/addon/search/jump-to-line.js', 16 | '/_shared/__external/codemirror/addon/dialog/dialog.css', 17 | '/_shared/__external/codemirror/addon/dialog/dialog.js', 18 | 19 | '/_shared/__external/codemirror/keymap/sublime.js', 20 | ]; 21 | locals.OLSKPagePublicConstants = { 22 | OLSKSharedPageCurrentLanguage, 23 | }; 24 | %> 25 | 26 |

27 | LCHComposeDetailItem 28 | undefined 29 |

30 | 31 | 32 | 33 |

34 | LCHComposeDetailDispatchBack 35 | 0 36 |

37 | 38 |

39 | LCHComposeDetailDispatchClone 40 | 0 41 |

42 | 43 |

44 | LCHComposeDetailDispatchDiscard 45 | 0 46 |

47 | 48 |

49 | LCHComposeDetailDispatchUpdate 50 | 0 51 |

52 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeDetail/ui-style.css: -------------------------------------------------------------------------------- 1 | .LCHComposeDetail { 2 | /* LCHComposeDetailFlexbox:Parent */ 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | @media screen and (max-width: 760px) { 8 | 9 | .LCHComposeDetail { 10 | min-height: 100%; 11 | } 12 | 13 | } 14 | 15 | .LCHComposeDetailToolbar { 16 | /* LCHComposeDetailFlexbox:Child */ 17 | flex-shrink: 0; 18 | } 19 | 20 | @media screen and (max-width: 760px) { 21 | 22 | .LCHComposeDetailToolbar { 23 | /* browser quirks */ 24 | z-index: 999; 25 | } 26 | 27 | } 28 | 29 | .LCHComposeDetailFlagAlert { 30 | display: inline-block; 31 | padding: 5px; 32 | border: 1px solid #808003; 33 | 34 | background: #ffff66; 35 | } 36 | 37 | .LCHComposeDetailForm { 38 | --OLSKCommonFontSize: 9pt; 39 | } 40 | 41 | .LCHComposeDetailForm p { 42 | margin: 5px; 43 | } 44 | 45 | .LCHComposeDetailFormInputTypesField { 46 | max-width: 120px; 47 | } 48 | 49 | .LCHComposeDetailFormCallbackArgsField { 50 | max-width: 60px; 51 | } 52 | 53 | .LCHComposeDetailFormOutputTypeField { 54 | max-width: 140px; 55 | } 56 | 57 | /* CodeMirror */ 58 | 59 | .LCHComposeDetail :global(.CodeMirror) { 60 | margin: 10px 0; 61 | 62 | /* CodeMirrorResizeToContent */ 63 | height: auto; 64 | } 65 | 66 | .LCHComposeDetail :global(.CodeMirror-empty) { 67 | /* CodeMirrorPlaceholderText */ 68 | color: #999999; 69 | } 70 | 71 | .LCHComposeDetail :global(.CodeMirror-scroll) { 72 | /* CodeMirrorResizeToContent */ 73 | max-height: 350px; 74 | } 75 | 76 | .LCHComposeDetail :global(.CodeMirror-scroll) { 77 | /* CodeMirrorResizeToContent */ 78 | min-height: 100px; 79 | } 80 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeInput/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/LCHComposeInput', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'LCHComposeInputStubRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'stub-view')); 8 | }, 9 | }]; 10 | }; 11 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeInput/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 (['LCHComposeInputItem'].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 | InterfaceTestLCHComposeInputFocusButtonDidClick() { 16 | LCHComposeInput.modPublic.LCHComposeInputFocus(); 17 | }, 18 | 19 | InterfaceTestLCHComposeInputPropDataSendButtonDidClick() { 20 | LCHComposeInput.LCHComposeInputItem = JSON.parse(window.TestLCHComposeInputPropData.value); 21 | }, 22 | 23 | }; 24 | 25 | const LCHComposeInput = new RollupStart({ 26 | target: document.body, 27 | props: Object.assign({ 28 | LCHComposeInputItem: {}, 29 | LCHComposeInputOptions: {}, 30 | LCHComposeInputDispatchUpdate: (function (inputData) { 31 | window.TestLCHComposeInputDispatchUpdate.innerHTML = parseInt(window.TestLCHComposeInputDispatchUpdate.innerHTML) + 1; 32 | }), 33 | }, params), 34 | }); 35 | 36 | window.LCHComposeInputBehaviour = mod; 37 | 38 | export default LCHComposeInput; 39 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeInput/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/addon/edit/continuelist.js', 10 | 11 | '/_shared/__external/codemirror/addon/mode/overlay.js', 12 | 13 | '/_shared/__external/codemirror/addon/search/search.js', 14 | '/_shared/__external/codemirror/addon/search/searchcursor.js', 15 | '/_shared/__external/codemirror/addon/search/jump-to-line.js', 16 | '/_shared/__external/codemirror/addon/dialog/dialog.css', 17 | '/_shared/__external/codemirror/addon/dialog/dialog.js', 18 | 19 | '/_shared/__external/codemirror/keymap/sublime.js', 20 | ]; 21 | locals.OLSKPagePublicConstants = { 22 | OLSKSharedPageCurrentLanguage, 23 | }; 24 | %> 25 | 26 |

27 | LCHComposeInputDispatchUpdate 28 | 0 29 |

30 | 31 |

32 | 33 |

34 | 35 |

36 | 37 | 38 |

39 | 40 | 41 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeInput/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | LCHComposeInput: '.LCHComposeInput', 5 | 6 | LCHComposeInputFieldDebug: '.LCHComposeInputFieldDebug', 7 | }).map(function (e) { 8 | return global[e.shift()] = e.pop(); 9 | }); 10 | 11 | describe('LCHComposeInput_Access', function () { 12 | 13 | before(function() { 14 | return browser.OLSKVisit(kDefaultRoute, { 15 | LCHComposeInputItem: JSON.stringify({ 16 | alfa: 'bravo', 17 | }), 18 | LCHComposeInputKey: 'alfa', 19 | }); 20 | }); 21 | 22 | it('shows LCHComposeInput', function () { 23 | browser.assert.elements(LCHComposeInput, 1); 24 | }); 25 | 26 | it.skip('shows CodeMirror', function () { 27 | browser.assert.elements('.CodeMirror', 1); 28 | }); 29 | 30 | it('shows LCHComposeInputFieldDebug', function () { 31 | browser.assert.elements(LCHComposeInputFieldDebug, 1); 32 | }); 33 | 34 | }); 35 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeListItem/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/LCHComposeListItem', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'LCHComposeListItemStubRoute', 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/open-compose/submodules/LCHComposeListItem/i18n-en.yml: -------------------------------------------------------------------------------- 1 | LCHComposeListItemFlaggedAlertText: '[Flagged]' 2 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeListItem/i18n-es.yml: -------------------------------------------------------------------------------- 1 | LCHComposeListItemFlaggedAlertText: '[Señalado]' 2 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeListItem/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | LCHComposeListItemFlaggedAlertText: '[Marqué]' 2 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeListItem/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | LCHComposeListItemFlaggedAlertText: '[Bandeirado]' 2 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeListItem/main.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 | 9 | {#if LCHComposeListItem.LCHDocumentIsFlagged } 10 | ⚠️ 11 | {/if} 12 | 13 | { LCHComposeLogic.LCHComposeListItemTitle(LCHComposeListItem) } 14 | 15 |
16 | 17 | 40 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeListItem/rollup-start.js: -------------------------------------------------------------------------------- 1 | import RollupStart from './main.svelte'; 2 | 3 | const LCHComposeListItem = new RollupStart({ 4 | target: document.body, 5 | props: Object.fromEntries(Array.from((new window.URLSearchParams(window.location.search)).entries()).map(function ([key, value]) { 6 | return [key, (function() { 7 | if (key === 'LCHComposeListItem') { 8 | return JSON.parse(value); 9 | } 10 | 11 | return value; 12 | })()] 13 | })), 14 | }); 15 | 16 | export default LCHComposeListItem; 17 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeListItem/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 | LCHComposeListItemDispatchCreate 15 | 0 16 | undefined 17 |

18 | 19 |

20 | LCHComposeListItemDispatchClick 21 | 0 22 | undefined 23 |

24 | 25 |

26 | LCHComposeListItemDispatchArrow 27 | 0 28 | undefined 29 |

30 | 31 |

32 | LCHComposeListItemDispatchFilter 33 | 0 34 | undefined 35 |

36 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeListItem/ui-logic-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./ui-logic.js').default; 4 | 5 | describe('LCHComposeListItemTitle', function test_LCHComposeListItemTitle() { 6 | 7 | it('throws if not object', function () { 8 | throws(function () { 9 | mod.LCHComposeListItemTitle(null); 10 | }, /LCHErrorInputNotValid/); 11 | }); 12 | 13 | it('returns LCHDocumentName', function() { 14 | const LCHDocumentName = Math.random().toString(); 15 | deepEqual(mod.LCHComposeListItemTitle({ 16 | LCHDocumentName, 17 | }), LCHDocumentName); 18 | }); 19 | 20 | it('returns LCHDocumentSignature if no LCHDocumentName', function() { 21 | const LCHDocumentSignature = Math.random().toString(); 22 | deepEqual(mod.LCHComposeListItemTitle({ 23 | LCHDocumentSignature, 24 | }), LCHDocumentSignature); 25 | }); 26 | 27 | it('returns LCHDocumentID if no LCHDocumentSignature', function() { 28 | const LCHDocumentID = Math.random().toString(); 29 | deepEqual(mod.LCHComposeListItemTitle({ 30 | LCHDocumentID, 31 | }), LCHDocumentID); 32 | }); 33 | 34 | }); 35 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeListItem/ui-logic.js: -------------------------------------------------------------------------------- 1 | const mod = { 2 | 3 | LCHComposeListItemTitle (inputData) { 4 | if (typeof inputData !== 'object' || inputData === null) { 5 | throw new Error('LCHErrorInputNotValid'); 6 | } 7 | 8 | return inputData.LCHDocumentName || inputData.LCHDocumentSignature || inputData.LCHDocumentID; 9 | }, 10 | 11 | }; 12 | 13 | export default mod; 14 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeListItem/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | LCHComposeListItem: '.LCHComposeListItem', 5 | 6 | LCHComposeListItemFlaggedAlert: '.LCHComposeListItemFlaggedAlert', 7 | 8 | LCHComposeListItemTitle: '.LCHComposeListItemTitle', 9 | }).map(function (e) { 10 | return global[e.shift()] = e.pop(); 11 | }); 12 | 13 | describe('LCHComposeListItem_Access', function () { 14 | 15 | before(function() { 16 | return browser.OLSKVisit(kDefaultRoute, { 17 | LCHComposeListItem: JSON.stringify(StubDocumentObjectValid()), 18 | }); 19 | }); 20 | 21 | it('shows LCHComposeListItem', function () { 22 | browser.assert.elements(LCHComposeListItem, 1); 23 | }); 24 | 25 | it('hides LCHComposeListItemFlaggedAlert', function () { 26 | browser.assert.elements(LCHComposeListItemFlaggedAlert, 0); 27 | }); 28 | 29 | it('shows LCHComposeListItemTitle', function () { 30 | browser.assert.elements(LCHComposeListItemTitle, 1); 31 | }); 32 | 33 | context('LCHComposeListItemFlagged', function () { 34 | 35 | before(function() { 36 | return browser.OLSKVisit(kDefaultRoute, { 37 | LCHComposeListItem: JSON.stringify(StubDocumentObjectValid({ 38 | LCHDocumentIsFlagged: true, 39 | })), 40 | }); 41 | }); 42 | 43 | it('shows LCHComposeListItemFlaggedAlert', function () { 44 | browser.assert.elements(LCHComposeListItemFlaggedAlert, 1); 45 | }); 46 | 47 | }); 48 | 49 | }); 50 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeListItem/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('LCHComposeListItem_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | LCHComposeListItem: JSON.stringify(StubDocumentObjectValid({ 15 | LCHDocumentIsFlagged: true, 16 | })), 17 | }); 18 | }); 19 | 20 | it('localizes LCHComposeListItemFlaggedAlert', function() { 21 | browser.assert.text(LCHComposeListItemFlaggedAlert, '⚠️'); 22 | }); 23 | 24 | }); 25 | 26 | }); 27 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposeListItem/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | const LCHComposeLogic = require('./ui-logic.js').default; 4 | 5 | describe('LCHComposeListItem_Misc', function () { 6 | 7 | const item = { 8 | [uRandomElement('LCHDocumentName', 'LCHDocumentSignature', 'LCHDocumentID')]: Math.random().toString(), 9 | }; 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | LCHComposeListItem: JSON.stringify(item), 14 | }); 15 | }); 16 | 17 | describe('LCHComposeListItemTitle', function test_LCHComposeListItemTitle () { 18 | 19 | it('binds LCHComposeListItemTitle', function () { 20 | browser.assert.text(LCHComposeListItemTitle, LCHComposeLogic.LCHComposeListItemTitle(item)); 21 | }); 22 | 23 | }); 24 | 25 | context('LCHComposeListItemFlagged', function () { 26 | 27 | before(function () { 28 | browser.assert.hasNoClass(LCHComposeListItem, 'LCHComposeListItemFlagged'); 29 | }); 30 | 31 | before(function() { 32 | return browser.OLSKVisit(kDefaultRoute, { 33 | LCHComposeListItem: JSON.stringify(StubDocumentObjectValid({ 34 | LCHDocumentIsFlagged: true, 35 | })), 36 | }); 37 | }); 38 | 39 | it('classes LCHComposeListItemFlagged', function () { 40 | browser.assert.hasClass(LCHComposeListItem, 'LCHComposeListItemFlagged'); 41 | }); 42 | 43 | }); 44 | 45 | }); 46 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposePair/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/LCHComposePair', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'LCHComposePairStubRoute', 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/open-compose/submodules/LCHComposePair/i18n-en.yml: -------------------------------------------------------------------------------- 1 | LCHComposePairKeyFieldText: Key 2 | LCHComposePairSubmitButtonText: Submit 3 | LCHComposePairClearButtonText: Delete key 4 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposePair/i18n-es.yml: -------------------------------------------------------------------------------- 1 | LCHComposePairKeyFieldText: Clave 2 | LCHComposePairSubmitButtonText: Someter 3 | LCHComposePairClearButtonText: Eliminar clave 4 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposePair/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | LCHComposePairKeyFieldText: Clé 2 | LCHComposePairSubmitButtonText: Soumettre 3 | LCHComposePairClearButtonText: Supprimer la clé 4 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposePair/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | LCHComposePairKeyFieldText: Chave 2 | LCHComposePairSubmitButtonText: Submeter 3 | LCHComposePairClearButtonText: Apagar chave 4 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposePair/main.svelte: -------------------------------------------------------------------------------- 1 | 22 | 23 |
24 | 25 | {#if !LCHComposePairClearIsVisible} 26 |
27 | 28 | 29 | 30 |
31 | {/if} 32 | 33 | {#if LCHComposePairClearIsVisible} 34 | 35 | {/if} 36 | 37 |
38 | 39 | 53 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposePair/rollup-start.js: -------------------------------------------------------------------------------- 1 | import RollupStart from './main.svelte'; 2 | 3 | const LCHComposePair = new RollupStart({ 4 | target: document.body, 5 | props: Object.assign({ 6 | LCHComposePairClearIsVisible: false, 7 | LCHComposePairDispatchSubmit: (function (inputData) { 8 | window.TestLCHComposePairDispatchSubmit.innerHTML = parseInt(window.TestLCHComposePairDispatchSubmit.innerHTML) + 1; 9 | window.TestLCHComposePairDispatchSubmitData.innerHTML = inputData; 10 | }), 11 | LCHComposePairDispatchClear: (function () { 12 | window.TestLCHComposePairDispatchClear.innerHTML = parseInt(window.TestLCHComposePairDispatchClear.innerHTML) + 1; 13 | }), 14 | }, Object.fromEntries(Array.from((new window.URLSearchParams(window.location.search)).entries()))), 15 | }); 16 | 17 | export default LCHComposePair; 18 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposePair/stub-view.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | locals.OLSKPageAssets = [ 3 | '/_shared/__external/normalize.css/normalize.css', 4 | ]; 5 | locals.OLSKPagePublicConstants = { 6 | OLSKSharedPageCurrentLanguage, 7 | }; 8 | %> 9 | 10 | 11 | 12 |

13 | LCHComposePairDispatchSubmit 14 | 0 15 | undefined 16 |

17 | 18 |

19 | LCHComposePairDispatchClear 20 | 0 21 |

22 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposePair/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | LCHComposePair: '.LCHComposePair', 5 | 6 | LCHComposePairKeyField: '.LCHComposePairKeyField', 7 | LCHComposePairSubmitButton: '.LCHComposePairSubmitButton', 8 | 9 | LCHComposePairClearButton: '.LCHComposePairClearButton', 10 | }).map(function (e) { 11 | return global[e.shift()] = e.pop(); 12 | }); 13 | 14 | describe('LCHComposePair_Access', function () { 15 | 16 | before(function() { 17 | return browser.OLSKVisit(kDefaultRoute); 18 | }); 19 | 20 | it('shows LCHComposePairKeyField', function() { 21 | browser.assert.elements(LCHComposePairKeyField, 1); 22 | }); 23 | 24 | it('shows LCHComposePairSubmitButton', function() { 25 | browser.assert.elements(LCHComposePairSubmitButton, 1); 26 | }); 27 | 28 | it('hides LCHComposePairClearButton', function() { 29 | browser.assert.elements(LCHComposePairClearButton, 0); 30 | }); 31 | 32 | context('LCHComposePairClearIsVisible', function () { 33 | 34 | before(function() { 35 | return browser.OLSKVisit(kDefaultRoute, { 36 | LCHComposePairClearIsVisible: true, 37 | }); 38 | }); 39 | 40 | it('hides LCHComposePairKeyField', function () { 41 | browser.assert.elements(LCHComposePairKeyField, 0); 42 | }); 43 | 44 | it('hides LCHComposePairSubmitButton', function () { 45 | browser.assert.elements(LCHComposePairSubmitButton, 0); 46 | }); 47 | 48 | it('shows LCHComposePairClearButton', function() { 49 | browser.assert.elements(LCHComposePairClearButton, 1); 50 | }); 51 | 52 | }); 53 | 54 | }); 55 | -------------------------------------------------------------------------------- /os-app/open-compose/submodules/LCHComposePair/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('LCHComposePair_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | }); 15 | }); 16 | 17 | it('localizes LCHComposePairKeyField', function () { 18 | browser.assert.attribute(LCHComposePairKeyField, 'placeholder', uLocalized('LCHComposePairKeyFieldText')); 19 | }); 20 | 21 | it('localizes LCHComposePairSubmitButton', function () { 22 | browser.assert.text(LCHComposePairSubmitButton, uLocalized('LCHComposePairSubmitButtonText')); 23 | }); 24 | 25 | context('LCHComposePairClearIsVisible', function () { 26 | 27 | before(function() { 28 | return browser.OLSKVisit(kDefaultRoute, { 29 | OLSKRoutingLanguage, 30 | LCHComposePairClearIsVisible: true, 31 | }); 32 | }); 33 | 34 | it('localizes LCHComposePairClearButton', function() { 35 | browser.assert.text(LCHComposePairClearButton, uLocalized('LCHComposePairClearButtonText')); 36 | }); 37 | 38 | }); 39 | 40 | }); 41 | 42 | }); 43 | -------------------------------------------------------------------------------- /os-app/open-compose/ui-style.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --OLSKDecorBackgroundDeep: #eee; 3 | --OLSKDecorBackgroundDeepEdge: var(--OLSKDecorForegroundLight); 4 | } 5 | 6 | .LCHCompose { 7 | font-family: 'Helvetica Neue', 'Helvetica', sans-serif; 8 | font-size: 9pt; 9 | } 10 | 11 | .OLSKCollectionChunkItems > .OLSKCollectionItem :first-child { 12 | width: 100%; 13 | } 14 | 15 | :global(.OLSKBanner) { 16 | display: none; 17 | } 18 | -------------------------------------------------------------------------------- /os-app/open-compose/ui-test-pair.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('LCHCompose_Pair', function () { 4 | 5 | before(function() { 6 | return browser.OLSKVisit(kDefaultRoute); 7 | }); 8 | 9 | context('LCHComposePairDispatchSubmit', function () { 10 | 11 | before(function () { 12 | return browser.pressButton('.LCHComposeToolsPairButton'); 13 | }); 14 | 15 | before(function () { 16 | browser.fill('.LCHComposePairKeyField', '{}'); 17 | }); 18 | 19 | it('posts message', async function() { 20 | browser.assert.deepEqual(await browser.OLSKMessageAsync(function () { 21 | browser.pressButton('.LCHComposePairSubmitButton'); 22 | }), { 23 | LBXRequestName: 'DispatchRequestStorePayload', 24 | LBXRequestEncryptedData: 'LBX_TESTING_REQUEST_DATA', 25 | }); 26 | }); 27 | 28 | it('sets LCHComposePairClearIsVisible', function () { 29 | browser.assert.elements('.LCHComposePairClearButton', 1); 30 | }); 31 | 32 | }); 33 | 34 | context('ReactDocuments', function () { 35 | 36 | it('posts message', async function() { 37 | browser.assert.deepEqual(await browser.OLSKMessageAsync(function () { 38 | return browser.check('.LCHComposeBuildPipeModeEnabledField'); 39 | }), { 40 | LBXRequestName: 'DispatchRequestStorePayload', 41 | LBXRequestEncryptedData: 'LBX_TESTING_REQUEST_DATA', 42 | }); 43 | }); 44 | 45 | }); 46 | 47 | context('LCHComposePairDispatchClear', function () { 48 | 49 | it('posts no message', async function() { 50 | browser.assert.deepEqual(await browser.OLSKMessageAsync(function () { 51 | return browser.pressButton('.LCHComposePairClearButton'); 52 | }), undefined); 53 | }); 54 | 55 | it('sets LCHComposePairClearIsVisible', function () { 56 | browser.assert.elements('.LCHComposePairClearButton', 0); 57 | }); 58 | 59 | }); 60 | 61 | }); 62 | -------------------------------------------------------------------------------- /os-app/open-guide/i18n-en.yml: -------------------------------------------------------------------------------- 1 | LCHGuideTitle: Launchlet Guide 2 | LCHGuideDescription: Documentation for project 3 | LCHGuideDocumentFields: 4 | LCHDocumentName: Name 5 | LCHDocumentCallbackBody: Callback 6 | LCHDocumentSignature: Signature 7 | LCHDocumentInputTypes: Input Types 8 | LCHDocumentCallbackArgs: Arguments 9 | LCHDocumentOutputType: Output Type 10 | -------------------------------------------------------------------------------- /os-app/open-guide/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | LCHGuideTitle: Guia de Launchlet 2 | LCHGuideDescription: Documentação pelo projeto 3 | LCHGuideDocumentFields: 4 | LCHDocumentName: Nome 5 | LCHDocumentCallbackBody: Callback 6 | LCHDocumentSignature: Assinatura 7 | LCHDocumentInputTypes: Tipos de entrada 8 | LCHDocumentCallbackArgs: Argumentos 9 | LCHDocumentOutputType: Tipo de saída 10 | -------------------------------------------------------------------------------- /os-app/open-guide/ui-logic.js: -------------------------------------------------------------------------------- 1 | exports.LCHGuideExampleFormatted = function (inputData) { 2 | if (typeof inputData !== 'object' || inputData === null) { 3 | throw new Error('LCHErrorInputNotValid'); 4 | } 5 | 6 | let outputData = Object.assign({}, inputData); 7 | 8 | for (let key in outputData) { 9 | if (key === 'LCHDocumentCallbackBody') { 10 | outputData[key] = '' + outputData[key] + '' 11 | }; 12 | } 13 | 14 | return outputData 15 | }; 16 | 17 | exports.LCHGuideExampleQuoted = function (inputData, OLSKLocalized = function (inputData) { 18 | return inputData 19 | }) { 20 | if (typeof inputData !== 'object' || inputData === null) { 21 | throw new Error('LCHErrorInputNotValid'); 22 | } 23 | 24 | return Object.entries(inputData).map(function (e) { 25 | return `
${ OLSKLocalized(e[0]) }
${ e[1] }
`; 26 | }); 27 | }; 28 | 29 | exports.LCHGuideExampleTemplate = function (inputData) { 30 | if (!Array.isArray(inputData)) { 31 | throw new Error('LCHErrorInputNotValid'); 32 | } 33 | 34 | return `
\n\n${ inputData.join('\n\n') }\n\n
`; 35 | }; 36 | 37 | exports.LCHGuideStringify = function (inputData) { 38 | if (typeof inputData !== 'object' || inputData === null) { 39 | throw new Error('LCHErrorInputNotValid'); 40 | } 41 | 42 | return JSON.stringify(inputData, null, ' ').replace(/"(\w+)":/g, "$1:") 43 | }; 44 | -------------------------------------------------------------------------------- /os-app/open-guide/ui-style.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --OLSKCommonFontSize: 11pt; 3 | } 4 | 5 | .LCHGuide { 6 | overflow: hidden; 7 | } 8 | 9 | .OLSKDecorGlossary { 10 | padding: 20px; 11 | 12 | margin: 0; 13 | 14 | background: hsl(0, 0%, 94%); 15 | } 16 | 17 | .OLSKDecorGlossary dd { 18 | margin: 10px 20px; 19 | } 20 | 21 | .OLSKDecorGlossary dd code { 22 | padding: 10px; 23 | background: #ddd; 24 | color: #333; 25 | word-wrap: break-word; 26 | } 27 | 28 | .OLSKRootLink { 29 | width: 48px; 30 | } 31 | -------------------------------------------------------------------------------- /os-app/open-guide/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | LCHGuide: '.LCHGuide', 5 | 6 | LCHGuideCrown: '.LCHGuideCrown', 7 | LCHGuideCrownName: '.LCHGuideCrownName', 8 | }).map(function (e) { 9 | return global[e.shift()] = e.pop(); 10 | }); 11 | 12 | describe('LCHGuide_Access', function () { 13 | 14 | before(function() { 15 | return browser.OLSKVisit(kDefaultRoute); 16 | }); 17 | 18 | it('shows LCHGuide', function () { 19 | browser.assert.elements(LCHGuide, 1); 20 | }); 21 | 22 | it('shows LCHGuideCrown', function () { 23 | browser.assert.elements(LCHGuideCrown, 1); 24 | }); 25 | 26 | it('shows LCHGuideCrownName', function () { 27 | browser.assert.elements(LCHGuideCrownName, 1); 28 | }); 29 | 30 | it('shows LCHRootLink', function () { 31 | browser.assert.elements('.LCHRootLink', 1); 32 | }); 33 | 34 | }); 35 | -------------------------------------------------------------------------------- /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('LCHGuide_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('LCHGuideTitle')) 17 | }); 18 | 19 | it('localizes meta[description]', function() { 20 | browser.assert.attribute('meta[name=description]', 'content', uLocalized('LCHGuideDescription')) 21 | }); 22 | 23 | it('localizes LCHGuideCrownName', function () { 24 | browser.assert.text(LCHGuideCrownName, uLocalized('LCHGuideTitle')); 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('LCHGuide_Misc', function () { 4 | 5 | before(function () { 6 | return browser.OLSKVisit(kDefaultRoute) 7 | }); 8 | 9 | context('LCHGuide', function () { 10 | 11 | it('classes OLSKDecor', function () { 12 | browser.assert.hasClass(LCHGuide, 'OLSKDecor') 13 | }); 14 | 15 | it('classes OLSKDecorCapped', function () { 16 | browser.assert.hasClass(LCHGuide, 'OLSKDecorCapped') 17 | }); 18 | 19 | }); 20 | 21 | describe('LCHGuideCrown', function test_LCHGuideCrown() { 22 | 23 | it('classes OLSKCommonCard', function () { 24 | browser.assert.hasClass(LCHGuideCrown, 'OLSKCommonCard'); 25 | }); 26 | 27 | it('classes OLSKCommonCrownCard', function () { 28 | browser.assert.hasClass(LCHGuideCrown, 'OLSKCommonCrownCard'); 29 | }); 30 | 31 | }); 32 | 33 | }); 34 | -------------------------------------------------------------------------------- /os-app/open-guide/ui-view.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | locals.OLSKPageTitle = OLSKLocalized('LCHGuideTitle'); 3 | locals.OLSKPageDescription = OLSKLocalized('LCHGuideDescription'); 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('LCHGuideTitle') %> 17 |
18 |
19 | 20 | <%- OLSKStringReplaceTokens(LCHGuideContent, { 21 | }) %> 22 | 23 |
24 | 25 | <%- include('../_shared/LCHRootLink/main.ejs') %> 26 | 27 |
28 | -------------------------------------------------------------------------------- /os-app/open-vitrine/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'LCHVitrineRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'ui-view'), { 8 | LCHVitrineContent: res.OLSKMarkdownContent(require('path').join(__dirname, `text-${ res.locals.OLSKSharedPageCurrentLanguage }.md`), Object.assign({ 9 | LCH_SHARED_EXTENSION_DOCS_URL: process.env.LCH_SHARED_EXTENSION_DOCS_URL, 10 | LCH_SHARED_PACKAGE_DOCS_URL: process.env.LCH_SHARED_PACKAGE_DOCS_URL, 11 | }, res.locals.OLSKLocalized('LCHVitrineDemoRecipeNames'), res.locals.OLSKLocalized('LCHStandardRecipeNames'))), 12 | OLSKStringReplaceTokens: require('OLSKString').OLSKStringReplaceTokens, 13 | }); 14 | }, 15 | OLSKRouteLanguageCodes: ['en', 'fr', 'es', 'pt'], 16 | }, { 17 | OLSKRoutePath: '/brueghel.jpg', 18 | OLSKRouteMethod: 'get', 19 | OLSKRouteSignature: 'LCHBrueghelRedirect', 20 | OLSKRouteRedirect: process.env.LCH_SHARED_BRUEGHEL_URL, 21 | }]; 22 | }; 23 | -------------------------------------------------------------------------------- /os-app/open-vitrine/i18n-en.yml: -------------------------------------------------------------------------------- 1 | LCHVitrineTitle: Launchlet 2 | LCHVitrineDescription: Make the web yours. 3 | LCHVitrineVideo1HeadingText: Search recipes. 4 | LCHVitrineVideo2HeadingText: Tutorial. 5 | LCHVitrineVideo3HeadingText: Sync with the browser extension. 6 | LCHVitrineVideo4HeadingText: Pipe mode. 7 | LCHVitrineTutorialsButtonText: Watch more tutorials 8 | OLSKLandingBlurbText: Customize any website with JavaScript or CSS. 9 | LCHVitrineDemoButtonCommitText: Demo Commit mode 10 | LCHVitrineDemoButtonPreviewText: Demo Preview mode 11 | LCHVitrineDemoButtonPipeText: Demo Pipe mode 12 | LCHVitrineBrueghelText: 'A photo of a postcard containing Pieter Bruegel''s painting: The Fall of the Rebel Angels' 13 | LCHVitrineDemoRecipeNames: 14 | LCHVitrinePageColoursRandomize: Randomize page colours 15 | LCHVitrinePageColoursRestore: Restore page colours 16 | LCHVitrineCopyPageInfo: Copy page info 17 | LCHVitrineSendEmail: Send email 18 | LCHVitrinePageLinksHighlightAdd: Highlight page links 19 | LCHVitrinePageLinksHighlightRemove: Remove page links highlight 20 | LCHVitrineMinimalistDateString: Minimalist Date String 21 | LCHVitrineCopyPageInfoAlertText: Copied to clipboard 22 | -------------------------------------------------------------------------------- /os-app/open-vitrine/i18n-es.yml: -------------------------------------------------------------------------------- 1 | LCHVitrineTitle: Launchlet 2 | LCHVitrineDescription: Hazlo tuyo el web. 3 | LCHVitrineVideo1HeadingText: Buscar recetas. 4 | LCHVitrineVideo2HeadingText: Tutorial. 5 | LCHVitrineVideo3HeadingText: Sincronizar con el extensión del navigador. 6 | LCHVitrineVideo4HeadingText: Modo de Pipe. 7 | LCHVitrineTutorialsButtonText: Ver más tutoriales. 8 | OLSKLandingBlurbText: Personalizar qualquier sitio web con JavaScript o CSS. 9 | LCHVitrineDemoButtonCommitText: Demo modo de Commit 10 | LCHVitrineDemoButtonPreviewText: Demo modo de Preview 11 | LCHVitrineDemoButtonPipeText: Demo modo de Pipe 12 | LCHVitrineBrueghelText: 'Una foto de una tarjeta postal que contiene una pintura de Pieter Bruegel : La caída de los ángeles rebeldes' 13 | LCHVitrineDemoRecipeNames: 14 | LCHVitrinePageColoursRandomize: Aleatorizar los colores de la página 15 | LCHVitrinePageColoursRestore: Restablecer los colores de la página 16 | LCHVitrineCopyPageInfo: Copiar información de la página 17 | LCHVitrineSendEmail: Enviar correo 18 | LCHVitrinePageLinksHighlightAdd: Marcar los enlaces de la página 19 | LCHVitrinePageLinksHighlightRemove: Quitar las marcas enlace de la página 20 | LCHVitrineMinimalistDateString: Frase del dato minimalista 21 | LCHVitrineCopyPageInfoAlertText: Copiado al portapapeles 22 | -------------------------------------------------------------------------------- /os-app/open-vitrine/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | LCHVitrineTitle: Launchlet 2 | LCHVitrineDescription: Faites-en le vôtre le web. 3 | LCHVitrineVideo1HeadingText: Chercher des recettes. 4 | LCHVitrineVideo2HeadingText: Tutoriel. 5 | LCHVitrineVideo3HeadingText: Synchroniser avec l'extension du navigateur. 6 | LCHVitrineVideo4HeadingText: Mode Pipe. 7 | LCHVitrineTutorialsButtonText: Regarder plus des tutorials 8 | OLSKLandingBlurbText: Personnaliser de n'importe quel site web avec JavaScript ou CSS. 9 | LCHVitrineDemoButtonCommitText: Démo mode Commit 10 | LCHVitrineDemoButtonPreviewText: Démo mode Preview 11 | LCHVitrineDemoButtonPipeText: Démo mode Pipe 12 | LCHVitrineBrueghelText: 'Une photo d''une carte postale qui contient une peinture de Pieter Bruegel : La Chute des anges rebelles' 13 | LCHVitrineDemoRecipeNames: 14 | LCHVitrinePageColoursRandomize: Randomiser les couleurs de la page 15 | LCHVitrinePageColoursRestore: Rétablir les couleurs de la page 16 | LCHVitrineCopyPageInfo: Copier les informations de la page 17 | LCHVitrineSendEmail: Envoyer email 18 | LCHVitrinePageLinksHighlightAdd: Surligner des liens de la page 19 | LCHVitrinePageLinksHighlightRemove: Enlever le surlignage des liens de la page 20 | LCHVitrineMinimalistDateString: Chaîne de date minimaliste 21 | LCHVitrineCopyPageInfoAlertText: Copié dans le presse-papier 22 | -------------------------------------------------------------------------------- /os-app/open-vitrine/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | LCHVitrineTitle: Launchlet 2 | LCHVitrineDescription: Faça sua o web. 3 | LCHVitrineVideo1HeadingText: Pesquisar receitas. 4 | LCHVitrineVideo2HeadingText: Tutorial. 5 | LCHVitrineVideo3HeadingText: Sincronizar com a extensão do navegador. 6 | LCHVitrineVideo4HeadingText: Modo Encanado. 7 | LCHVitrineTutorialsButtonText: Assistir mais tutoriais 8 | OLSKLandingBlurbText: Personalizar qualquer website com JavaScript ou CSS. 9 | LCHVitrineDemoButtonCommitText: Modo Commit de demonstração. 10 | LCHVitrineDemoButtonPreviewText: Modo de Preview de demonstração 11 | LCHVitrineDemoButtonPipeText: Modo Encanado de demonstração 12 | LCHVitrineBrueghelText: 'Uma foto de um cartão postal contendo a pintura de Pieter Bruegel: A Queda dos Condenados' 13 | LCHVitrineDemoRecipeNames: 14 | LCHVitrinePageColoursRandomize: Randomizar as cores das páginas 15 | LCHVitrinePageColoursRestore: Restaurar as cores das páginas 16 | LCHVitrineCopyPageInfo: Copiar informação da página 17 | LCHVitrineSendEmail: Enviar e-mail 18 | LCHVitrinePageLinksHighlightAdd: Destacar links da página 19 | LCHVitrinePageLinksHighlightRemove: Remover a destaca doos links da página 20 | LCHVitrineMinimalistDateString: Sequência minimalista da data 21 | LCHVitrineCopyPageInfoAlertText: Copiado para área de transferência 22 | -------------------------------------------------------------------------------- /os-app/open-vitrine/rollup-config-custom-tests.js: -------------------------------------------------------------------------------- 1 | const { throws, deepEqual } = require('assert'); 2 | 3 | const mod = require('./rollup-config-custom.js'); 4 | 5 | describe('LCHVitrineRollupConfigCustom', function test_LCHVitrineRollupConfigCustom() { 6 | 7 | it('throws error if not object', function() { 8 | throws(function() { 9 | mod.LCHVitrineRollupConfigCustom(null); 10 | }, /LCHErrorInputNotValid/); 11 | }) 12 | 13 | it('sets output.name', function() { 14 | deepEqual(mod.LCHVitrineRollupConfigCustom({ 15 | output: {}, 16 | plugins: [], 17 | }).output.name, 'LCHVitrineBehaviour'); 18 | }); 19 | 20 | }); 21 | -------------------------------------------------------------------------------- /os-app/open-vitrine/rollup-config-custom.js: -------------------------------------------------------------------------------- 1 | const pathPackage = require('path'); 2 | 3 | module.exports = { 4 | LCHVitrineRollupConfigCustom (inputData, options) { 5 | if (typeof inputData !== 'object' || inputData === null) { 6 | throw new Error('LCHErrorInputNotValid'); 7 | } 8 | 9 | inputData.output.name = 'LCHVitrineBehaviour'; 10 | 11 | return inputData; 12 | }, 13 | OLSKRollupConfigCustom (inputData, options) { 14 | return module.exports.LCHVitrineRollupConfigCustom(inputData, options); 15 | }, 16 | }; 17 | -------------------------------------------------------------------------------- /os-app/open-vitrine/rollup-start.js: -------------------------------------------------------------------------------- 1 | import RollupStart from './main.js'; 2 | 3 | export default RollupStart; 4 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/LCHFeatureList/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/stub/LCHFeatureList', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteFunction (req, res, next) { 6 | return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'stub-view')); 7 | }, 8 | OLSKRouteSignature: 'LCHFeatureListStubRoute', 9 | OLSKRouteLanguageCodes: ['en', 'fr', 'es', 'pt'], 10 | }]; 11 | }; 12 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/LCHFeatureList/i18n-en.yml: -------------------------------------------------------------------------------- 1 | LCHFeatureListArray: 2 | - - Add scripts or styles. 3 | - Create Recipes with JavaScript or CSS. 4 | - - General or specific. 5 | - Trigger some Recipes based on the URL. 6 | - - Power up your browser. 7 | - The extension can run Recipes automatically on page load. 8 | - - Save it to go. 9 | - Export all Recipes as a bookmarklet. 10 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/LCHFeatureList/i18n-es.yml: -------------------------------------------------------------------------------- 1 | LCHFeatureListArray: 2 | - - Adicionar scripts o estilos. 3 | - Crear Recetas con JavaScript o CSS. 4 | - - General o específica. 5 | - Activar algunas Recetas basadas en la URL. 6 | - - Augmenta tu navegador. 7 | - La extensión puede ejecutar Recetas automáticamente al cargar de la página. 8 | - - Tomarla para llevar. 9 | - Exportar todas las Recetas como un bookmarklet. 10 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/LCHFeatureList/i18n-fr.yml: -------------------------------------------------------------------------------- 1 | LCHFeatureListArray: 2 | - - Ajouter du code ou du style. 3 | - Créer des Recettes avec JavaScript ou CSS. 4 | - - Général ou spécifique. 5 | - Activer certaines Recettes basé sur l'URL. 6 | - - Augmentez votre navigateur. 7 | - L'extension peut exécuter des Recettes automatiquement lors du chargement de la page. 8 | - - Avoir ça pour emporter. 9 | - Exporter toutes les Recettes sous forme de bookmarklet. 10 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/LCHFeatureList/i18n-pt.yml: -------------------------------------------------------------------------------- 1 | LCHFeatureListArray: 2 | - - Adicionar scripts ou estilos. 3 | - Criar receitas com JavaScript ou CSS. 4 | - - Geral ou específica. 5 | - Acione algumas receitas com base na URL. 6 | - - Acione seu navegador. 7 | - A extensão pode executar Recipes automaticamente no carregamento da página. 8 | - - Tomar para levar. 9 | - Exportar todas as Receitas num bookmarklet. 10 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/LCHFeatureList/main.ejs: -------------------------------------------------------------------------------- 1 |
2 | 3 | <%- include('../../../../node_modules/OLSKFeatureList/main.ejs', { 4 | OLSKFeatureListData: OLSKLocalized('LCHFeatureListArray').map(function (e, i) { 5 | return e.concat([ 6 | '/_shared/__external/OLSKUIAssets/_OLSKSharedFeatureCode.svg', 7 | '/_shared/__external/OLSKUIAssets/_OLSKSharedFeatureURL.svg', 8 | '/_shared/__external/OLSKUIAssets/_OLSKSharedFeatureExtension.svg', 9 | '/_shared/__external/OLSKUIAssets/_OLSKSharedFeatureBookmarklet.svg', 10 | ][i]); 11 | }), 12 | }) %> 13 | 14 |
15 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/LCHFeatureList/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/LCHFeatureList/ui-test-_access.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | Object.entries({ 4 | LCHFeatureList: '.LCHFeatureList', 5 | }).map(function (e) { 6 | return global[e.shift()] = e.pop(); 7 | }); 8 | 9 | describe('LCHFeatureList_Access', function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute); 13 | }); 14 | 15 | it('shows LCHFeatureList', function() { 16 | browser.assert.elements(LCHFeatureList, 1); 17 | }); 18 | 19 | it('shows OLSKFeatureList', function() { 20 | browser.assert.elements('.OLSKFeatureList', 1); 21 | }); 22 | 23 | }); 24 | -------------------------------------------------------------------------------- /os-app/open-vitrine/submodules/LCHFeatureList/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('LCHFeatureList_Localize-' + OLSKRoutingLanguage, function () { 10 | 11 | before(function() { 12 | return browser.OLSKVisit(kDefaultRoute, { 13 | OLSKRoutingLanguage, 14 | }); 15 | }); 16 | 17 | uLocalized('LCHFeatureListArray').forEach(function ([name, blurb], i) { 18 | 19 | it('localizes LCHVitrineStandardFeaturesItem', function () { 20 | browser.assert.text(`.OLSKFeatureListItem:nth-child(${ i + 1 }) .OLSKFeatureListItemName`, name); 21 | }); 22 | 23 | it('localizes LCHVitrineStandardFeaturesBlurb', 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/LCHFeatureList/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('LCHFeatureList_Misc', function () { 8 | 9 | before(function () { 10 | return browser.OLSKVisit(kDefaultRoute); 11 | }); 12 | 13 | uLocalized('LCHFeatureListArray').forEach(function (e, i) { 14 | 15 | describe('LCHFeatureListItemIdentity', function test_LCHFeatureListItemIdentity () { 16 | 17 | it('sets src', function () { 18 | browser.assert.attribute(`.OLSKFeatureListItem:nth-child(${ i + 1 }) .OLSKFeatureListItemIcon`, 'src', [ 19 | '/_shared/__external/OLSKUIAssets/_OLSKSharedFeatureCode.svg', 20 | '/_shared/__external/OLSKUIAssets/_OLSKSharedFeatureURL.svg', 21 | '/_shared/__external/OLSKUIAssets/_OLSKSharedFeatureExtension.svg', 22 | '/_shared/__external/OLSKUIAssets/_OLSKSharedFeatureBookmarklet.svg', 23 | ][i]); 24 | }); 25 | 26 | it('sets role', function () { 27 | browser.assert.attribute(`.OLSKFeatureListItem:nth-child(${ i + 1 }) .OLSKFeatureListItemIcon`, 'role', 'presentation'); 28 | }); 29 | 30 | }); 31 | 32 | }); 33 | 34 | }); 35 | -------------------------------------------------------------------------------- /os-app/open-vitrine/text-en.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # Demos 4 | 5 | ## Commit mode 6 | 7 | Presents a list of options and runs on `Enter`. Try any of the following options: 8 | - `LCHVitrinePageColoursRandomize` 9 | - `LCHVitrineCopyPageInfo` 10 | - `LCHVitrineSendEmail` 11 | 12 | LCHVitrineDemoButtonCommitToken 13 | 14 | ## Preview mode 15 | 16 | Presents a list of options and runs on select. Try jumping through the headings in this document: 17 | 18 | LCHVitrineDemoButtonPreviewToken 19 | 20 | ## Pipe mode 21 | 22 | Organizes items into subjects and actions. Try 23 | - `LCHVitrinePageLinksHighlightAdd` and `LCHRunCommand` 24 | - `LCHVitrineMinimalistDateString` and `LCHLargeText` 25 | - `Wikipedia` and `LCHSearchFor` 26 | 27 | LCHVitrineDemoButtonPipeToken 28 | 29 |
30 | -------------------------------------------------------------------------------- /os-app/open-vitrine/text-es.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # Demostraciones 4 | 5 | ## Modo de 'Commit' 6 | 7 | Mostrar una lista de opciónes y ejecutar al `Enter`. Intenta cualquier de las opciones siguientes: 8 | - `LCHVitrinePageColoursRandomize` 9 | - `LCHVitrineCopyPageInfo` 10 | - `LCHVitrineSendEmail` 11 | 12 | LCHVitrineDemoButtonCommitToken 13 | 14 | ## Modo de 'Preview' 15 | 16 | Mostrar una lista de opciónes y ejecutar a la selección. Intenta de saltar a través los títulos en este documento: 17 | 18 | LCHVitrineDemoButtonPreviewToken 19 | 20 | ## Modo de 'Pipe' 21 | 22 | Organizar los artículos en sujetos y actos. Intenta 23 | - `LCHVitrinePageLinksHighlightAdd` y `LCHRunCommand` 24 | - `LCHVitrineMinimalistDateString` y `LCHLargeText` 25 | - `Wikipedia` y `LCHSearchFor` 26 | 27 | LCHVitrineDemoButtonPipeToken 28 | 29 |
30 | -------------------------------------------------------------------------------- /os-app/open-vitrine/text-fr.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # Démonstrations 4 | 5 | ## Mode Commit 6 | 7 | Présente une liste d'options qui s'exécute sur `Entrée`. Essayez n'importe quelle option parmi les suivantes : 8 | - `LCHVitrinePageColoursRandomize` 9 | - `LCHVitrineCopyPageInfo` 10 | - `LCHVitrineSendEmail` 11 | 12 | LCHVitrineDemoButtonCommitToken 13 | 14 | ## Mode de ‹Preview› 15 | 16 | Présente une liste d'options qui s'exécute en sélectionnant. Essayez de naviguer à travers les titres de ce document : 17 | 18 | LCHVitrineDemoButtonPreviewToken 19 | 20 | ## Mode de ‹Pipe› 21 | 22 | Organise les éléments en sujets et actions. Essayez 23 | - `LCHVitrinePageLinksHighlightAdd` et `LCHRunCommand` 24 | - `LCHVitrineMinimalistDateString` et `LCHLargeText` 25 | - `Wikipedia` et `LCHSearchFor` 26 | 27 | LCHVitrineDemoButtonPipeToken 28 | 29 |
30 | -------------------------------------------------------------------------------- /os-app/open-vitrine/text-pt.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # Demos 4 | 5 | ## Commit mode 6 | 7 | Presents a list of options and runs on `Enter`. Try any of the following options: 8 | - `LCHVitrinePageColoursRandomize` 9 | - `LCHVitrineCopyPageInfo` 10 | - `LCHVitrineSendEmail` 11 | 12 | LCHVitrineDemoButtonCommitToken 13 | 14 | ## Preview mode 15 | 16 | Presents a list of options and runs on select. Try jumping through the headings in this document: 17 | 18 | LCHVitrineDemoButtonPreviewToken 19 | 20 | ## Pipe mode 21 | 22 | Organizes items into subjects and actions. Try 23 | - `LCHVitrinePageLinksHighlightAdd` and `LCHRunCommand` 24 | - `LCHVitrineMinimalistDateString` and `LCHLargeText` 25 | - `Wikipedia` and `LCHSearchFor` 26 | 27 | LCHVitrineDemoButtonPipeToken 28 | 29 |
30 | -------------------------------------------------------------------------------- /os-app/open-vitrine/ui-style.css: -------------------------------------------------------------------------------- 1 | .LCHVitrineBrueghel { 2 | max-width: 100%; 3 | margin: 10px 0; 4 | } 5 | 6 | .OLSKDecorGlossary { 7 | margin: unset; 8 | } 9 | -------------------------------------------------------------------------------- /os-app/open-vitrine/ui-test-demo-preview.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('LCHVitrineDemoPreview', function () { 4 | 5 | before(function () { 6 | return browser.OLSKVisit(kDefaultRoute); 7 | }); 8 | 9 | before(function () { 10 | return browser.click(LCHVitrineDemoButtonPreview); 11 | }); 12 | 13 | it('shows headings', function () { 14 | browser.assert.deepEqual(browser.queryAll('h1,h2').map(function (e) { 15 | return e.textContent; 16 | }), browser.queryAll('.OLSKResultsListItem').map(function (e) { 17 | return e.textContent.trim(); 18 | })); 19 | }); 20 | 21 | it('selects one', function () { 22 | browser.assert.elements('.OLSKResultsListItemSelected', 1); 23 | }); 24 | 25 | }); 26 | -------------------------------------------------------------------------------- /os-app/tech-manifest/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/manifest.json', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'LCHManifestRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.json({ 8 | name: 'Launchlet', 9 | short_name: 'Launchlet', 10 | start_url: res.locals.OLSKCanonical('LCHComposeRoute'), 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-manifest/ui-test-_misc.js: -------------------------------------------------------------------------------- 1 | const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); 2 | 3 | describe('LCHManifest_Misc', function () { 4 | 5 | it('sends json', async function () { 6 | browser.assert.deepEqual(await (await browser.fetch('http://localhost' + kDefaultRoute.OLSKRoutePath)).json(), { 7 | name: 'Launchlet', 8 | short_name: 'Launchlet', 9 | start_url: require('../open-compose/controller.js').OLSKControllerRoutes().shift().OLSKRoutePath, 10 | background_color: 'white', 11 | theme_color: 'white', 12 | icons: [{ 13 | src: process.env.OLSK_LAYOUT_TOUCH_ICON_URL, 14 | sizes: '600x600', 15 | type: 'image/png', 16 | purpose: 'any maskable', 17 | }], 18 | }); 19 | }); 20 | 21 | }); 22 | -------------------------------------------------------------------------------- /os-app/tech-robots/controller.js: -------------------------------------------------------------------------------- 1 | exports.OLSKControllerRoutes = function() { 2 | return [{ 3 | OLSKRoutePath: '/robots.txt', 4 | OLSKRouteMethod: 'get', 5 | OLSKRouteSignature: 'LCHRobotsRoute', 6 | OLSKRouteFunction (req, res, next) { 7 | return res.send(require('OLSKRobots').OLSKRobotsTXT([ 8 | 'LCHVitrineRoute', 9 | 'LCHGuideRoute', 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('LCHRobots_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 kLCHServiceWorkerVersionID = Date.now().toString(); 2 | 3 | const OLSKServiceWorker = require('../_shared/__external/OLSKServiceWorker/main.js'); 4 | 5 | exports.OLSKControllerRoutes = function() { 6 | return { 7 | LCHServiceWorkerRoute: { 8 | OLSKRoutePath: '/sw.js', 9 | OLSKRouteMethod: 'get', 10 | OLSKRouteFunction (req, res, next) { 11 | return res.type('js').send(OLSKServiceWorker.OLSKServiceWorkerView({ 12 | VERSION_ID_TOKEN: kLCHServiceWorkerVersionID, 13 | ORIGIN_PAGE_PATH_TOKEN: res.locals.OLSKCanonical('LCHComposeRoute'), 14 | })); 15 | }, 16 | }, 17 | }; 18 | }; 19 | -------------------------------------------------------------------------------- /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 LCHPostinstallPatchOLSKThrottle() { 15 | let filePath = './node_modules/OLSKThrottle/main.js'; 16 | 17 | require('fs').writeFileSync(filePath, require('OLSKString').OLSKStringPatch( 18 | require('fs').readFileSync(filePath, 'utf8'), 19 | 'delete param1[param2];', 20 | '// delete param1[param2]', 21 | )); 22 | })(); 23 | 24 | (function OLSKPostinstallExternalAssets() { 25 | require('./node_modules/OLSKExpress/modules/OLSKAssets/main.js').OLSKAssetsCopyAssetsFromTo([ 26 | 'clipboard', 27 | 'codemirror', 28 | 'file-saver', 29 | 'fuzzysort', 30 | 'normalize.css', 31 | 'OLSKLanguageSwitcher', 32 | 'OLSKDecor', 33 | 'OLSKRootLink', 34 | 'OLSKRouting', 35 | 'OLSKServiceWorker', 36 | 'OLSKUIAssets', 37 | 'ROCORootLink', 38 | 'simplecrypto', 39 | 'webnative', 40 | ], require('path').join(__dirname, 'node_modules'), require('path').join(__dirname, 'os-app/_shared/__external')); 41 | })(); 42 | -------------------------------------------------------------------------------- /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 | "url-parse": "latest", 16 | 17 | "file-saver": "latest", 18 | 19 | "fuzzysort": "latest", 20 | 21 | "clipboard": "latest", 22 | 23 | "url-parse": "latest", 24 | 25 | "acorn": "7.x", 26 | 27 | "OLSKPithVitrine": "olsk/OLSKPithVitrine", 28 | 29 | "OLSKPithGuide": "olsk/OLSKPithGuide", 30 | 31 | "OLSKPithApp": "olsk/OLSKPithApp", 32 | "OLSKCatalog": "olsk/OLSKCatalog", 33 | "codemirror": "rosano/CodeMirror#add-distribution", 34 | "simplecrypto": "encryb/simplecrypto", 35 | 36 | "OLSKNarrow": "olsk/OLSKNarrow", 37 | "OLSKResults": "olsk/OLSKResults", 38 | 39 | "OLSKRobots": "olsk/OLSKRobots", 40 | 41 | "OLSKServiceWorker": "olsk/OLSKServiceWorker" 42 | }, 43 | "devDependencies": { 44 | "OLSKPithToolchain": "olsk/OLSKPithToolchain", 45 | "OLSKRollupScaffold": "olsk/OLSKRollupScaffold", 46 | "jsdom": "21.x" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /rollup-config.js: -------------------------------------------------------------------------------- 1 | export default require('OLSKRollupScaffold').OLSKRollupScaffoldScanStart(__dirname, { 2 | OLSKRollupPluginSwapTokens: Object.assign(require('OLSKUIAssets').OLSKUIAssetsSwapTokens(), { 3 | OLSK_APROPOS_FEEDBACK_EMAIL_SWAP_TOKEN: Buffer.from(`mailto:${ process.env.OLSK_APROPOS_FEEDBACK_EMAIL }`).toString('base64'), 4 | 5 | OLSK_CRYPTO_PAIR_RECEIVER_PRIVATE_SWAP_TOKEN: process.env.OLSK_CRYPTO_PAIR_RECEIVER_PRIVATE, 6 | OLSK_CRYPTO_PAIR_SENDER_PUBLIC_SWAP_TOKEN: process.env.OLSK_CRYPTO_PAIR_SENDER_PUBLIC, 7 | 8 | ROCO_SHARED_PROJECT_ID_SWAP_TOKEN: process.env.ROCO_SHARED_PROJECT_ID, 9 | }), 10 | }); 11 | --------------------------------------------------------------------------------