Created
April 2, 2020 12:44
-
-
Save zo0m/0f3eb18f811e56dab277a5a7d69e8f8d to your computer and use it in GitHub Desktop.
Revisions
-
zo0m created this gist
Apr 2, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ Alloy Require(src='components/common/base-window/BaseWindow') Require#loader(src="components/common/horizontal-scroller/LoadingContainer") Require#eventMap(src="components/event/map/EventMap", bind_onLoad="(()=> $.loader.onload())") This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ var sourceMapper = require('./sourceMapper'); var paths = require('global-paths'); var projectDirectory; var logger; function resolver(moduleName) { return require(require('resolve').sync(moduleName, { basedir: projectDirectory, paths: paths(), })); } task('pre:load', (event, alloyLogger) => { logger = alloyLogger; projectDirectory = event.dir.project; sourceMapper.OPTIONS_OUTPUT.presets = sourceMapper.OPTIONS_OUTPUT.presets || []; sourceMapper.OPTIONS_OUTPUT.presets.push(resolver('babel-preset-env')); sourceMapper.OPTIONS_OUTPUT.presets.push({ plugins: [ [resolver('babel-plugin-titanium-controller-args')], [bind_AttributeTransformer], [resolver('babel-plugin-transform-async-generator-functions')] ], }); }); function bind_AttributeTransformer(_ref) { var types = _ref.types; return { pre: function (state) { }, visitor: { Property: function (path, state) { if (types.isStringLiteral(path.node.value)) { // if (path.node.value.value.startsWith('@:')) { var namePrefix = 'bind_'; if (path.node.key.name && path.node.key.name.startsWith(namePrefix)) { path.replaceWith(types.ObjectProperty(types.identifier(path.node.key.name), types.Identifier(path.node.value.value))); path.node.key.name = path.node.key.name.slice(namePrefix.length); } } }, } }; }; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ Alloy Require(src='components/common/base-window/BaseWindow') Require#scroller( src="components/common/horizontal-scroller/HorizontalScroller", module="app/ui/components", bind_startIndex="getCurrentListIndex($.args.event)", bind_createNextView="createNextView", bind_createPrevView="createPrevView", bind_handleScrollend="handleScrollend" )