-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
98 additions
and
77 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { rollup } from 'rollup' | ||
import nodeResolve from 'rollup-plugin-node-resolve' | ||
import commonjs from 'rollup-plugin-commonjs' | ||
import json from 'rollup-plugin-json' | ||
import buble from 'rollup-plugin-buble' | ||
import postcss from 'rollup-plugin-postcss' | ||
|
||
const banner = `var global = this | ||
var process = { env: {}}; | ||
` | ||
|
||
export default { | ||
entry: './html5/render/browser/index.js', | ||
dest: './dist/browser.js', | ||
banner, | ||
format: 'umd', | ||
moduleName: 'weex', | ||
plugins: [ | ||
postcss(), | ||
nodeResolve({ | ||
jsnext: true, | ||
main: true, | ||
browser: true | ||
}), | ||
commonjs(), | ||
json(), | ||
buble() | ||
] | ||
} |
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,4 +51,4 @@ export default { | |
this.node.style.justifyContent = value | ||
} | ||
} | ||
} | ||
}; |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
'use strict' | ||
|
||
require('lazyimg') | ||
import 'lazyimg' | ||
|
||
let lazyloadTimer | ||
|
||
|
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,31 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
|
||
/** | ||
* config: | ||
* - styles | ||
* - duration [Number] milliseconds(ms) | ||
* - timingFunction [string] | ||
* - dealy [Number] milliseconds(ms) | ||
*/ | ||
transitionOnce: function (comp, config, callback) { | ||
const styles = config.styles || {} | ||
const duration = config.duration || 1000 // ms | ||
const timingFunction = config.timingFunction || 'ease' | ||
const delay = config.delay || 0 // ms | ||
const transitionValue = 'all ' + duration + 'ms ' | ||
+ timingFunction + ' ' + delay + 'ms' | ||
const dom = comp.node | ||
const transitionEndHandler = function (e) { | ||
e.stopPropagation() | ||
dom.removeEventListener('webkitTransitionEnd', transitionEndHandler) | ||
dom.removeEventListener('transitionend', transitionEndHandler) | ||
dom.style.transition = '' | ||
dom.style.webkitTransition = '' | ||
callback() | ||
} | ||
dom.style.transition = transitionValue | ||
dom.style.webkitTransition = transitionValue | ||
dom.addEventListener('webkitTransitionEnd', transitionEndHandler) | ||
dom.addEventListener('transitionend', transitionEndHandler) | ||
comp.updateStyle(styles) | ||
/** | ||
* config: | ||
* - styles | ||
* - duration [Number] milliseconds(ms) | ||
* - timingFunction [string] | ||
* - dealy [Number] milliseconds(ms) | ||
*/ | ||
export function transitionOnce (comp, config, callback) { | ||
const styles = config.styles || {} | ||
const duration = config.duration || 1000 // ms | ||
const timingFunction = config.timingFunction || 'ease' | ||
const delay = config.delay || 0 // ms | ||
const transitionValue = 'all ' + duration + 'ms ' | ||
+ timingFunction + ' ' + delay + 'ms' | ||
const dom = comp.node | ||
const transitionEndHandler = function (e) { | ||
e.stopPropagation() | ||
dom.removeEventListener('webkitTransitionEnd', transitionEndHandler) | ||
dom.removeEventListener('transitionend', transitionEndHandler) | ||
dom.style.transition = '' | ||
dom.style.webkitTransition = '' | ||
callback() | ||
} | ||
|
||
dom.style.transition = transitionValue | ||
dom.style.webkitTransition = transitionValue | ||
dom.addEventListener('webkitTransitionEnd', transitionEndHandler) | ||
dom.addEventListener('transitionend', transitionEndHandler) | ||
comp.updateStyle(styles) | ||
} |
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ export default { | |
Weex.install(refresh) | ||
Weex.install(loading) | ||
} | ||
} | ||
}; |
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
'use strict' | ||
|
||
require('./spinner.css') | ||
import './spinner.css' | ||
|
||
let loopArray, getRgb | ||
|
||
|
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
'use strict' | ||
|
||
require('./switch.css') | ||
import './switch.css' | ||
|
||
const defaults = { | ||
color: '#64bd63', | ||
|
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
'use strict' | ||
|
||
require('./video.css') | ||
import './video.css' | ||
|
||
function getProto (Weex) { | ||
const Atomic = Weex.Atomic | ||
|
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
'use strict' | ||
|
||
import Weex from './render' | ||
import Weex from './render/index' | ||
|
||
/** | ||
* install components and APIs | ||
|
This file contains 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 characters