From e4d6eabc2d9e422bfb29390025c2035a9392bf13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Mon, 22 Jan 2018 02:01:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=96=B0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E7=9A=84=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 0 -> 6148 bytes .gitignore | 4 +- Readme.md | 0 build.dev.js | 13 +- build.prod.js | 23 +- index.js | 0 package-lock.json | 82 +++++++ package.json | 9 +- src/.DS_Store | Bin 0 -> 6148 bytes src/css/basic-elem.scss | 0 src/css/reset.scss | 0 src/css/var.scss | 4 +- src/font/ui-font.eot | Bin 27596 -> 27972 bytes src/font/ui-font.js | 2 +- src/font/ui-font.ttf | Bin 27428 -> 27804 bytes src/js/anot-touch.js | 0 src/js/anot-touch.shim.js | 0 src/js/anot.js | 0 src/js/anot.shim.js | 18 +- src/js/avatar/def.jpg | Bin src/js/avatar/index.js | 0 src/js/codemirror/codemirror.js | 0 src/js/codemirror/htmlmixed.js | 0 src/js/console/index.js | 0 src/js/console/style.scss | 0 src/js/count/doui.count.js | 0 src/js/datepicker/Readme.md | 0 src/js/datepicker/index.js | 365 ++++++++++++++++++++++++++++ src/js/datepicker/main.htm | 101 ++++---- src/js/datepicker/main.js | 392 ------------------------------ src/js/datepicker/style.scss | 142 +++++++---- src/js/drag/doc.md | 0 src/js/drag/main.js | 0 src/js/layer/Release.md | 0 src/js/layer/base.js | 0 src/js/layer/full.js | 0 src/js/layer/mobile.js | 0 src/js/layer/skin/def.scss | 0 src/js/marked/main.js | 0 src/js/marked/theme.scss | 0 src/js/md5/Readme.md | 0 src/js/md5/main.js | 0 src/js/meditor/addon/attach.js | 0 src/js/meditor/addon/attach.scss | 0 src/js/meditor/addon/base.js | 0 src/js/meditor/addon/face/0.gif | Bin src/js/meditor/addon/face/1.gif | Bin src/js/meditor/addon/face/10.gif | Bin src/js/meditor/addon/face/11.gif | Bin src/js/meditor/addon/face/12.gif | Bin src/js/meditor/addon/face/13.gif | Bin src/js/meditor/addon/face/14.gif | Bin src/js/meditor/addon/face/15.gif | Bin src/js/meditor/addon/face/16.gif | Bin src/js/meditor/addon/face/17.gif | Bin src/js/meditor/addon/face/18.gif | Bin src/js/meditor/addon/face/19.gif | Bin src/js/meditor/addon/face/2.gif | Bin src/js/meditor/addon/face/20.gif | Bin src/js/meditor/addon/face/21.gif | Bin src/js/meditor/addon/face/22.gif | Bin src/js/meditor/addon/face/23.gif | Bin src/js/meditor/addon/face/24.gif | Bin src/js/meditor/addon/face/25.gif | Bin src/js/meditor/addon/face/26.gif | Bin src/js/meditor/addon/face/27.gif | Bin src/js/meditor/addon/face/28.gif | Bin src/js/meditor/addon/face/29.gif | Bin src/js/meditor/addon/face/3.gif | Bin src/js/meditor/addon/face/30.gif | Bin src/js/meditor/addon/face/31.gif | Bin src/js/meditor/addon/face/32.gif | Bin src/js/meditor/addon/face/33.gif | Bin src/js/meditor/addon/face/34.gif | Bin src/js/meditor/addon/face/35.gif | Bin src/js/meditor/addon/face/4.gif | Bin src/js/meditor/addon/face/5.gif | Bin src/js/meditor/addon/face/6.gif | Bin src/js/meditor/addon/face/7.gif | Bin src/js/meditor/addon/face/8.gif | Bin src/js/meditor/addon/face/9.gif | Bin src/js/meditor/main.js | 0 src/js/meditor/skin/main.scss | 0 src/js/{pages => pager}/index.js | 6 +- src/js/{pages => pager}/main.scss | 4 +- src/js/prism/base.js | 0 src/js/prism/full.js | 0 src/js/prism/highlight.scss | 0 src/js/promise/index.js | 0 src/js/request/index.js | 0 src/js/request/lib/format.js | 0 src/js/request/lib/json.js | 0 src/js/request/light.js | 0 src/js/router/main.js | 0 src/js/sliders/Readme.md | 0 src/js/sliders/main.htm | 0 src/js/sliders/main.js | 0 src/js/sliders/main.scss | 0 src/js/touch.patch.js | 0 src/js/tree/index.js | 0 src/js/tree/main.scss | 0 src/js/uploader/uploader.js | 0 test.js | 0 103 files changed, 644 insertions(+), 521 deletions(-) create mode 100644 .DS_Store mode change 100644 => 100755 .gitignore mode change 100644 => 100755 Readme.md mode change 100644 => 100755 index.js mode change 100644 => 100755 package-lock.json mode change 100644 => 100755 package.json create mode 100644 src/.DS_Store mode change 100644 => 100755 src/css/basic-elem.scss mode change 100644 => 100755 src/css/reset.scss mode change 100644 => 100755 src/css/var.scss mode change 100644 => 100755 src/js/anot-touch.js mode change 100644 => 100755 src/js/anot-touch.shim.js mode change 100644 => 100755 src/js/anot.js mode change 100644 => 100755 src/js/anot.shim.js mode change 100644 => 100755 src/js/avatar/def.jpg mode change 100644 => 100755 src/js/avatar/index.js mode change 100644 => 100755 src/js/codemirror/codemirror.js mode change 100644 => 100755 src/js/codemirror/htmlmixed.js mode change 100644 => 100755 src/js/console/index.js mode change 100644 => 100755 src/js/console/style.scss mode change 100644 => 100755 src/js/count/doui.count.js mode change 100644 => 100755 src/js/datepicker/Readme.md create mode 100755 src/js/datepicker/index.js mode change 100644 => 100755 src/js/datepicker/main.htm delete mode 100644 src/js/datepicker/main.js mode change 100644 => 100755 src/js/datepicker/style.scss mode change 100644 => 100755 src/js/drag/doc.md mode change 100644 => 100755 src/js/drag/main.js mode change 100644 => 100755 src/js/layer/Release.md mode change 100644 => 100755 src/js/layer/base.js mode change 100644 => 100755 src/js/layer/full.js mode change 100644 => 100755 src/js/layer/mobile.js mode change 100644 => 100755 src/js/layer/skin/def.scss mode change 100644 => 100755 src/js/marked/main.js mode change 100644 => 100755 src/js/marked/theme.scss mode change 100644 => 100755 src/js/md5/Readme.md mode change 100644 => 100755 src/js/md5/main.js mode change 100644 => 100755 src/js/meditor/addon/attach.js mode change 100644 => 100755 src/js/meditor/addon/attach.scss mode change 100644 => 100755 src/js/meditor/addon/base.js mode change 100644 => 100755 src/js/meditor/addon/face/0.gif mode change 100644 => 100755 src/js/meditor/addon/face/1.gif mode change 100644 => 100755 src/js/meditor/addon/face/10.gif mode change 100644 => 100755 src/js/meditor/addon/face/11.gif mode change 100644 => 100755 src/js/meditor/addon/face/12.gif mode change 100644 => 100755 src/js/meditor/addon/face/13.gif mode change 100644 => 100755 src/js/meditor/addon/face/14.gif mode change 100644 => 100755 src/js/meditor/addon/face/15.gif mode change 100644 => 100755 src/js/meditor/addon/face/16.gif mode change 100644 => 100755 src/js/meditor/addon/face/17.gif mode change 100644 => 100755 src/js/meditor/addon/face/18.gif mode change 100644 => 100755 src/js/meditor/addon/face/19.gif mode change 100644 => 100755 src/js/meditor/addon/face/2.gif mode change 100644 => 100755 src/js/meditor/addon/face/20.gif mode change 100644 => 100755 src/js/meditor/addon/face/21.gif mode change 100644 => 100755 src/js/meditor/addon/face/22.gif mode change 100644 => 100755 src/js/meditor/addon/face/23.gif mode change 100644 => 100755 src/js/meditor/addon/face/24.gif mode change 100644 => 100755 src/js/meditor/addon/face/25.gif mode change 100644 => 100755 src/js/meditor/addon/face/26.gif mode change 100644 => 100755 src/js/meditor/addon/face/27.gif mode change 100644 => 100755 src/js/meditor/addon/face/28.gif mode change 100644 => 100755 src/js/meditor/addon/face/29.gif mode change 100644 => 100755 src/js/meditor/addon/face/3.gif mode change 100644 => 100755 src/js/meditor/addon/face/30.gif mode change 100644 => 100755 src/js/meditor/addon/face/31.gif mode change 100644 => 100755 src/js/meditor/addon/face/32.gif mode change 100644 => 100755 src/js/meditor/addon/face/33.gif mode change 100644 => 100755 src/js/meditor/addon/face/34.gif mode change 100644 => 100755 src/js/meditor/addon/face/35.gif mode change 100644 => 100755 src/js/meditor/addon/face/4.gif mode change 100644 => 100755 src/js/meditor/addon/face/5.gif mode change 100644 => 100755 src/js/meditor/addon/face/6.gif mode change 100644 => 100755 src/js/meditor/addon/face/7.gif mode change 100644 => 100755 src/js/meditor/addon/face/8.gif mode change 100644 => 100755 src/js/meditor/addon/face/9.gif mode change 100644 => 100755 src/js/meditor/main.js mode change 100644 => 100755 src/js/meditor/skin/main.scss rename src/js/{pages => pager}/index.js (97%) mode change 100644 => 100755 rename src/js/{pages => pager}/main.scss (96%) mode change 100644 => 100755 mode change 100644 => 100755 src/js/prism/base.js mode change 100644 => 100755 src/js/prism/full.js mode change 100644 => 100755 src/js/prism/highlight.scss mode change 100644 => 100755 src/js/promise/index.js mode change 100644 => 100755 src/js/request/index.js mode change 100644 => 100755 src/js/request/lib/format.js mode change 100644 => 100755 src/js/request/lib/json.js mode change 100644 => 100755 src/js/request/light.js mode change 100644 => 100755 src/js/router/main.js mode change 100644 => 100755 src/js/sliders/Readme.md mode change 100644 => 100755 src/js/sliders/main.htm mode change 100644 => 100755 src/js/sliders/main.js mode change 100644 => 100755 src/js/sliders/main.scss mode change 100644 => 100755 src/js/touch.patch.js mode change 100644 => 100755 src/js/tree/index.js mode change 100644 => 100755 src/js/tree/main.scss mode change 100644 => 100755 src/js/uploader/uploader.js mode change 100644 => 100755 test.js diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..08e49828b08aefe33cb705602cb9733aababa2a6 GIT binary patch literal 6148 zcmeHK%}T>S5Z<*_w-qr5!5(w*) zGrJqH*n=k#I|IAl%+Abi=7a1HV~jh~pv{=U7!%MCIVuYThZnk5bTA^vIg+tIihZ!& z{IT}^b--`0u!K$6jX(SP{i85RTdjA#QmL-4tqV~X_09UVJB(*;>ZQ}f@g|pOoqFle z*ZNr;k3MzJKMx19p0RxtN2wP^gNaNIg8_tGU4&5(&zyJ~1&N%;RSqF)qSiASS=O-* znr3Iu%A00pSuN1_tvs)Zo!$1~N&oKQF?-6NUlhL_=$Epkv4mGpbb0sgBpSuhEsT`W zWfUPXKnxHA#K2N9ppOBuu~b!4vBUr|@Dm1be=wmT+8PUma_fK&ug~bOBBFqfZwW+G zqph(}2p$lwQUO&e*G~+t(qY`xakj=np-N|5t_<_&mCMHqm#f3LDZ?4J6;e+O5CiiJ zRFrAp`F{+*%)&?hdLZ~AKeu04xvJX$= literal 0 HcmV?d00001 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index 2d571c5..1c3b18c --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ node_modules/ dist/ *.sublime-project *.sublime-workspace -package-lock.json \ No newline at end of file +package-lock.json +.DS_Store +**/.DS_Store \ No newline at end of file diff --git a/Readme.md b/Readme.md old mode 100644 new mode 100755 diff --git a/build.dev.js b/build.dev.js index 744163d..4017223 100755 --- a/build.dev.js +++ b/build.dev.js @@ -1,15 +1,22 @@ #! /usr/bin/env node +const log = console.log const fs = require('iofs') const path = require('path') const babel = require('babel-core') const scss = require('node-sass') const chokidar = require('chokidar') -const log = console.log +const postcss = require('postcss') +const autoprefixer = require('autoprefixer') const chalk = require('chalk') const sourceDir = path.resolve(__dirname, 'src') const buildDir = path.resolve(__dirname, 'dist') +const prefixer = postcss().use( + autoprefixer({ + browsers: ['ie > 9', 'iOS > 8', 'Android >= 4.4', 'ff > 38', 'Chrome > 38'] + }) +) const jsOpt = { presets: ['es2015'], plugins: ['transform-es2015-modules-amd'] @@ -42,7 +49,9 @@ const compileCss = (entry, output) => { setTimeout(() => { try { const { css } = scss.renderSync({ ...cssOpt, file: entry }) - fs.echo(css, output) + prefixer.process(css, { from: '', to: '' }).then(result => { + fs.echo(result.css, output) + }) } catch (err) { log(err) } diff --git a/build.prod.js b/build.prod.js index c8319ee..8f79a3a 100755 --- a/build.prod.js +++ b/build.prod.js @@ -1,14 +1,21 @@ #! /usr/bin/env node +const log = console.log const fs = require('iofs') const path = require('path') const babel = require('babel-core') const scss = require('node-sass') -const log = console.log +const postcss = require('postcss') +const autoprefixer = require('autoprefixer') const chalk = require('chalk') const sourceDir = path.resolve(__dirname, 'src') const buildDir = path.resolve(__dirname, 'dist') +const prefixer = postcss().use( + autoprefixer({ + browsers: ['ie > 9', 'iOS > 8', 'Android >= 4.4', 'ff > 38', 'Chrome > 38'] + }) +) const jsOpt = { presets: ['es2015', 'minify'], plugins: ['transform-es2015-modules-amd'] @@ -39,12 +46,14 @@ const compileJs = (entry, output) => { const compileCss = (entry, output) => { let t1 = Date.now() const { css } = scss.renderSync({ ...cssOpt, file: entry }) - log( - '编译scss: %s, 耗时 %s ms', - chalk.green(entry), - chalk.yellow(Date.now() - t1) - ) - fs.echo(css, output) + prefixer.process(css, { from: '', to: '' }).then(result => { + log( + '编译scss: %s, 耗时 %s ms', + chalk.green(entry), + chalk.yellow(Date.now() - t1) + ) + fs.echo(result.css, output) + }) } const compileHtm = (entry, output) => { diff --git a/index.js b/index.js old mode 100644 new mode 100755 diff --git a/package-lock.json b/package-lock.json old mode 100644 new mode 100755 index e9a6606..2b5f5fc --- a/package-lock.json +++ b/package-lock.json @@ -111,6 +111,20 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, + "autoprefixer": { + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-7.2.5.tgz", + "integrity": "sha512-XqHfo8Ht0VU+T5P+eWEVoXza456KJ4l62BPewu3vpNf3LP9s2+zYXkXBznzYby4XeECXgG3N4i+hGvOhXErZmA==", + "dev": true, + "requires": { + "browserslist": "2.11.3", + "caniuse-lite": "1.0.30000792", + "normalize-range": "0.1.2", + "num2fraction": "1.2.2", + "postcss": "6.0.16", + "postcss-value-parser": "3.3.0" + } + }, "aws-sign2": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", @@ -971,6 +985,16 @@ "repeat-element": "1.1.2" } }, + "browserslist": { + "version": "2.11.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.11.3.tgz", + "integrity": "sha512-yWu5cXT7Av6mVwzWc8lMsJMHWn4xyjSuGYi4IozbVTLUOEYPSagUB8kiMDUHA1fS3zjr8nkxkn9jdvug4BBRmA==", + "dev": true, + "requires": { + "caniuse-lite": "1.0.30000792", + "electron-to-chromium": "1.3.31" + } + }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", @@ -993,6 +1017,12 @@ "map-obj": "1.0.1" } }, + "caniuse-lite": { + "version": "1.0.30000792", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000792.tgz", + "integrity": "sha1-0M6pgfgRjzlhRxr7tDyaHlu/AzI=", + "dev": true + }, "caseless": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", @@ -1215,6 +1245,12 @@ "jsbn": "0.1.1" } }, + "electron-to-chromium": { + "version": "1.3.31", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.31.tgz", + "integrity": "sha512-XE4CLbswkZgZFn34cKFy1xaX+F5LHxeDLjY1+rsK9asDzknhbrd9g/n/01/acbU25KTsUSiLKwvlLyA+6XLUOA==", + "dev": true + }, "error-ex": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", @@ -3060,6 +3096,12 @@ "remove-trailing-separator": "1.1.0" } }, + "normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=", + "dev": true + }, "npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", @@ -3072,6 +3114,12 @@ "set-blocking": "2.0.0" } }, + "num2fraction": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", + "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=", + "dev": true + }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", @@ -3208,6 +3256,40 @@ "pinkie": "2.0.4" } }, + "postcss": { + "version": "6.0.16", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.16.tgz", + "integrity": "sha512-m758RWPmSjFH/2MyyG3UOW1fgYbR9rtdzz5UNJnlm7OLtu4B2h9C6gi+bE4qFKghsBRFfZT8NzoQBs6JhLotoA==", + "dev": true, + "requires": { + "chalk": "2.3.0", + "source-map": "0.6.1", + "supports-color": "5.1.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.1.0.tgz", + "integrity": "sha512-Ry0AwkoKjDpVKK4sV4h6o3UJmNRbjYm2uXhwfj3J56lMVdvnUNqzQVRztOOMGQ++w1K/TjNDFvpJk0F/LoeBCQ==", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, + "postcss-value-parser": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz", + "integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=", + "dev": true + }, "preserve": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", diff --git a/package.json b/package.json old mode 100644 new mode 100755 index 3b04c37..8aaf582 --- a/package.json +++ b/package.json @@ -11,16 +11,21 @@ "type": "git", "url": "git+https://github.com/yutent/doui.git" }, - "keywords": ["doui", "yua"], + "keywords": [ + "doui", + "yua" + ], "author": "yutent", "license": "MIT", "devDependencies": { + "autoprefixer": "^7.2.5", "babel-core": "^6.26.0", "babel-preset-es2015": "^6.24.1", "babel-preset-minify": "^0.2.0", "chalk": "^2.3.0", "chokidar": "^1.7.0", "iofs": "^1.0.3", - "node-sass": "^4.7.2" + "node-sass": "^4.7.2", + "postcss": "^6.0.16" } } diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b2c13ecc1f5dbe32960f0e61ef6b6875e1a7d0b1 GIT binary patch literal 6148 zcmeHK!Ab)$5KY=u(~8)Gpx*Z4t%p`Ar3YcD_25ld(Su66%T~KkH>KUW=vvwD&_D7A z{2gbKv{?ZBf){%^2FO0fFl^h0L2)Vilqd+E2IgWynn#a`xLKH-y zUD{34>VBnBwrh>rq->}4dIju*`eafN+k4f+lg{14WBN3Ce$ljY_yd(}8l1u_7_%MT zyThn2qg(Jz>`ErDnobPQ%1VFZNhR6w1|%@c#`bnx3I&M}y2)ai_?m0=#UGB+<2u2u)Xt-=|1 zG*U|p5CiiJJUDzDfS{t+jih^;O##ss& isuV*kmf{^yCE&Nw0CWsy8o>iX7Xd{BHN?QLGVlS{;ZXws literal 0 HcmV?d00001 diff --git a/src/css/basic-elem.scss b/src/css/basic-elem.scss old mode 100644 new mode 100755 diff --git a/src/css/reset.scss b/src/css/reset.scss old mode 100644 new mode 100755 diff --git a/src/css/var.scss b/src/css/var.scss old mode 100644 new mode 100755 index a0df148..93efe1d --- a/src/css/var.scss +++ b/src/css/var.scss @@ -7,6 +7,6 @@ $co: #ff9800 #ffa726 #f57c00; $cp: #e7e8eb #ecf0f1 #bdc3c7; $cgr: #546e7a #607d8b #37474f; -@mixin ts($c: all, $t: .1s, $m: ease-in-out){ - transition:$c $t $m; +@mixin ts($c: all, $t: .2s, $m: ease-in-out){ + transition:$c $t $m; } \ No newline at end of file diff --git a/src/font/ui-font.eot b/src/font/ui-font.eot index b295f75dc6c1b39424874b2815b8fb4cb6c6f810..02b3321ca2c4cd2a67409cd8a7662d063b1cffa2 100644 GIT binary patch delta 1587 zcmY*ZTWl0%6#mY1nfYg?mtEMMr6g`I+wKBgZrxr`V8MdGg9_DZEaB4K?zUUITbf!! zG12XVmp+(KG7q8>C7Ku?s$xqF7!s*5CK#eo2pTkm7l%fX5HATKbn2NMDs^YS`M>j@ zv)}pV?7w^ANBZgt$=mY4@!V0l#gnR{i$}K{E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+uh;53wOqxSMTP233P@6;A@=037%{aCUq9Fj`WW(o72ws%t**mFW!~D0ZkSjWbXA|w zUlwyFSO0FK!I=de`eFU7KBdp-@9LlFd-^^7zWzY3ZDTvOePic$?(&P-<00ng#nV{D zH~*7081k(lLNZ@Ib^(2GV*o)M$0QP%!V?&T14%pvKQidYYltC)6wV{fQ+m*j7Pv5s zHpIo3W|x{p4%5iWG=a4E)fy6mYJlS6oGJ$Y0CpJ2^2&!}fQP}(Urq2> z*x79Yc_G=pcyiVEoNw7z?+f13Mo&t*U0pZYtQ$lRt!=Gc{vSlX|970ss5dVNr_X$oyARH5I@s;1Qa95PZ{iU!e@d|{k_DW)<% zq;du$VV{Lbygi4QkW92`)Yn7wy+Kv)R;XM*Vo=d-4jHK~vnDdhrRtBF4-$F)uzXj(OF@{QT^t!TITIuH4eJFV0z;Mlqc!%To#d68{A#uP(j- diff --git a/src/font/ui-font.js b/src/font/ui-font.js index 39ad8c5..2bb0387 100644 --- a/src/font/ui-font.js +++ b/src/font/ui-font.js @@ -1 +1 @@ -(function(window){var svgSprite='';var script=function(){var scripts=document.getElementsByTagName("script");return scripts[scripts.length-1]}();var shouldInjectCss=script.getAttribute("data-injectcss");var ready=function(fn){if(document.addEventListener){if(~["complete","loaded","interactive"].indexOf(document.readyState)){setTimeout(fn,0)}else{var loadFn=function(){document.removeEventListener("DOMContentLoaded",loadFn,false);fn()};document.addEventListener("DOMContentLoaded",loadFn,false)}}else if(document.attachEvent){IEContentLoaded(window,fn)}function IEContentLoaded(w,fn){var d=w.document,done=false,init=function(){if(!done){done=true;fn()}};var polling=function(){try{d.documentElement.doScroll("left")}catch(e){setTimeout(polling,50);return}init()};polling();d.onreadystatechange=function(){if(d.readyState=="complete"){d.onreadystatechange=null;init()}}}};var before=function(el,target){target.parentNode.insertBefore(el,target)};var prepend=function(el,target){if(target.firstChild){before(el,target.firstChild)}else{target.appendChild(el)}};function appendSvg(){var div,svg;div=document.createElement("div");div.innerHTML=svgSprite;svgSprite=null;svg=div.getElementsByTagName("svg")[0];if(svg){svg.setAttribute("aria-hidden","true");svg.style.position="absolute";svg.style.width=0;svg.style.height=0;svg.style.overflow="hidden";prepend(svg,document.body)}}if(shouldInjectCss&&!window.__iconfont__svg__cssinject__){window.__iconfont__svg__cssinject__=true;try{document.write("")}catch(e){console&&console.log(e)}}ready(appendSvg)})(window) \ No newline at end of file +(function(window){var svgSprite='';var script=function(){var scripts=document.getElementsByTagName("script");return scripts[scripts.length-1]}();var shouldInjectCss=script.getAttribute("data-injectcss");var ready=function(fn){if(document.addEventListener){if(~["complete","loaded","interactive"].indexOf(document.readyState)){setTimeout(fn,0)}else{var loadFn=function(){document.removeEventListener("DOMContentLoaded",loadFn,false);fn()};document.addEventListener("DOMContentLoaded",loadFn,false)}}else if(document.attachEvent){IEContentLoaded(window,fn)}function IEContentLoaded(w,fn){var d=w.document,done=false,init=function(){if(!done){done=true;fn()}};var polling=function(){try{d.documentElement.doScroll("left")}catch(e){setTimeout(polling,50);return}init()};polling();d.onreadystatechange=function(){if(d.readyState=="complete"){d.onreadystatechange=null;init()}}}};var before=function(el,target){target.parentNode.insertBefore(el,target)};var prepend=function(el,target){if(target.firstChild){before(el,target.firstChild)}else{target.appendChild(el)}};function appendSvg(){var div,svg;div=document.createElement("div");div.innerHTML=svgSprite;svgSprite=null;svg=div.getElementsByTagName("svg")[0];if(svg){svg.setAttribute("aria-hidden","true");svg.style.position="absolute";svg.style.width=0;svg.style.height=0;svg.style.overflow="hidden";prepend(svg,document.body)}}if(shouldInjectCss&&!window.__iconfont__svg__cssinject__){window.__iconfont__svg__cssinject__=true;try{document.write("")}catch(e){console&&console.log(e)}}ready(appendSvg)})(window) \ No newline at end of file diff --git a/src/font/ui-font.ttf b/src/font/ui-font.ttf index 49e81a81b41484911c17f80157c429c7c4630bfa..b0dcb34b62e0f77053343c49472c8d99adbd61bb 100644 GIT binary patch delta 1593 zcmZ8hZERCz6h7zPuJ?WKUAq?ATZXZ0>(&D6V63Ah0Xp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.js b/src/js/anot-touch.shim.js old mode 100644 new mode 100755 diff --git a/src/js/anot.js b/src/js/anot.js old mode 100644 new mode 100755 diff --git a/src/js/anot.shim.js b/src/js/anot.shim.js old mode 100644 new mode 100755 index 194a5ac..6fac8b9 --- a/src/js/anot.shim.js +++ b/src/js/anot.shim.js @@ -141,7 +141,7 @@ } if (tickObserver) { - var node = document.createTextNode('any') + var node = document.createTextNode('anot') new tickObserver(callback).observe(node, { characterData: true }) // jshint ignore:line var bool = false return function(fn) { @@ -460,7 +460,7 @@ value: function() { var thisYear = this.getFullYear(), that = new Date(thisYear, 0, 1), - firstDay = that.getDay(), + firstDay = that.getDay() || 1, numsOfToday = (this - that) / 86400000 return Math.ceil((numsOfToday + firstDay) / 7) }, @@ -4182,7 +4182,7 @@ if (!this.init) { for (var i in Anot.vmodels) { var v = Anot.vmodels[i] - v.$fire('any-duplex-init', binding) + v.$fire('anot-duplex-init', binding) } var cpipe = binding.pipe || (binding.pipe = pipe) cpipe(null, binding, 'init') @@ -4265,17 +4265,7 @@ if (-val === -number) { return number } - var arr = /strong|medium|weak/.exec( - binding.element.getAttribute('data-duplex-number') - ) || ['medium'] - switch (arr[0]) { - case 'strong': - return 0 - case 'medium': - return val === '' ? '' : 0 - case 'weak': - return val - } + return 0 }, set: fixNull } diff --git a/src/js/avatar/def.jpg b/src/js/avatar/def.jpg old mode 100644 new mode 100755 diff --git a/src/js/avatar/index.js b/src/js/avatar/index.js old mode 100644 new mode 100755 diff --git a/src/js/codemirror/codemirror.js b/src/js/codemirror/codemirror.js old mode 100644 new mode 100755 diff --git a/src/js/codemirror/htmlmixed.js b/src/js/codemirror/htmlmixed.js old mode 100644 new mode 100755 diff --git a/src/js/console/index.js b/src/js/console/index.js old mode 100644 new mode 100755 diff --git a/src/js/console/style.scss b/src/js/console/style.scss old mode 100644 new mode 100755 diff --git a/src/js/count/doui.count.js b/src/js/count/doui.count.js old mode 100644 new mode 100755 diff --git a/src/js/datepicker/Readme.md b/src/js/datepicker/Readme.md old mode 100644 new mode 100755 diff --git a/src/js/datepicker/index.js b/src/js/datepicker/index.js new file mode 100755 index 0000000..7b14fa4 --- /dev/null +++ b/src/js/datepicker/index.js @@ -0,0 +1,365 @@ +/** + * + * @authors yutent (yutent@doui.cc) + * @date 2016-02-14 13:58:39 + * + */ +'use strict' + +import tpl from './main.htm' +import './style.css' + +/**************** 公共函数 *****************/ +//计算日历数组 +function getCalendarTable({ year, month, max, min }, last) { + let nums = getTotalDays(year, month) + let numsFixed = 1 - getFirstDay(year, month) + let isLimitYM = isLimited({ max, min }, { year, month }) + let list = [] + + for (let i = numsFixed; i <= nums; i++) { + let day = { + weeken: !1, + day: i < 1 ? '' : i, + selected: !1, + disabled: !0 + } + if (i > 0) { + let week = getFirstDay(year, month, i) + day.weeken = week === 0 || week === 6 + day.selected = isSelected({ year, month, day: i }, last) + day.disabled = disabledDay({ max, min }, i, isLimitYM) + } + list.push(day) + } + return list +} + +//判断当前年/月是否超出限制 +function isLimited({ max, min }, { year, month }) { + let result = '' + + if ((!max.year && !min.year) || (!max.month && !min.month) || !year) { + return false + } + + if ((min.year && year < min.year) || (max.year && year > max.year)) { + return true + } + + if (month) { + if (year === min.year) { + if (min.month && month < min.month) { + return true + } + + if (month == min.month) { + result += '-' + } + } + + if (year === max.year) { + if (max.month && month > max.month) { + return true + } + + if (month == max.month) { + result += '+' + } + } + } + return result +} + +//判断指定天数是否有效 +function disabledDay({ max, min }, day, limitedYM) { + if (limitedYM === '-') { + return day < min.day + } + + if (limitedYM === '+') { + return max.day && day > max.day + } + + if (limitedYM === '-+') { + return day < min.day || (max.day && day > max.day) + } + + return limitedYM +} + +//判断指定天数是否被选中 +function isSelected({ year, month, day }, last) { + return !(last.year !== year || last.month !== month || last.day !== day) +} + +//修改当前选中日期的样式 +function changeStyle(calendar, day) { + calendar.list.forEach(function(item) { + if (item.day != day) { + item.selected = !1 + } else { + item.selected = !0 + } + }) +} + +//获取今年的年份/月份,返回的是数组 +function getThisYearMonth() { + var oDate = new Date() + return [oDate.getFullYear(), oDate.getMonth() + 1] +} + +//根据年份获取指定月份天数 +function getTotalDays(year, month) { + return new Date(year, month, 0).getDate() +} + +//判断指定年月第一天是星期几 +function getFirstDay(year, month, day) { + return new Date(year, month - 1, day || 1).getDay() +} + +Anot.ui.datepicker = '1.0.0' + +export default Anot.component('datepicker', { + render: function() { + return tpl + }, + construct: function(props, state) { + if (!props.hasOwnProperty('key')) { + return Anot.error('日历组件必须设置key属性') + } + + // 日期格式化, 不显示时间时, 默认会调用过滤器的格式'Y-m-d H:i:s' + if (!props.showTime && !props.format) { + props.format = 'Y-m-d' + } + + //获取初始值 + let defVal = props.value + if (!defVal) { + if (props.minDate) { + defVal = props.minDate + } else if (props.maxDate) { + defVal = props.maxDate + } + } + // 修正默认值, 如果不是Date对象, 则转为Date对象 + if (defVal && !Date.isDate(defVal)) { + defVal += ' GMT+8000' + defVal = new Date(defVal) + } else { + defVal = new Date() + } + + if (props.minDate) { + if (!Date.isDate(props.minDate)) { + props.minDate += ' GMT+8000' + props.minDate = new Date(props.minDate) + } + if (defVal <= props.minDate) { + defVal = props.minDate + } + state.min.year = props.minDate.getFullYear() + state.min.month = props.minDate.getMonth() + 1 + state.min.day = props.minDate.getDate() + } + + if (props.maxDate) { + if (!Date.isDate(props.maxDate)) { + props.maxDate += ' GMT+8000' + props.maxDate = new Date(props.maxDate) + } + if (defVal >= props.maxDate) { + defVal = props.maxDate + } + state.max.year = props.maxDate.getFullYear() + state.max.month = props.maxDate.getMonth() + 1 + state.max.day = props.maxDate.getDate() + } + if (props.value) { + state.last = { + year: defVal.getFullYear(), + month: defVal.getMonth() + 1, + day: defVal.getDate() + } + state.value = defVal.format(props.format) + } + + state.calendar = { + list: [1], + year: defVal.getFullYear(), + month: defVal.getMonth() + 1, + day: defVal.getDate(), + hour: defVal.getHours(), + minute: defVal.getMinutes(), + second: defVal.getSeconds() + } + state.disabled = !!props.disabled + + //移除部分属性 + delete props.minDate + delete props.maxDate + delete props.value + delete props.disabled + }, + componentWillMount: function() { + this.resetCalendarTable() + }, + componentDidMount: function() { + if (typeof this.props.onCreated === 'function') { + this.props.onCreated.call(null, this) + } + document.addEventListener('click', () => { + this.close() + }) + }, + state: { + showCalendar: false, //显示日历对话框 + disabled: false, //是否禁用 + last: { year: 0, month: 0, day: 1 }, + tips: '', + timer: null, + value: '', // 用于显示在输入框里的日期变量 + max: { year: 0, month: 0, day: 1 }, + min: { year: 0, month: 0, day: 1 }, + calendar: { + // list: [1], + // year: '', + // month: '', + // day: '', + // hour: '', + // minute: '', + // second: '' + } + }, + props: { + showTime: false, //对话框上显示时间 + color: 'grey', + format: '', // 日期显示格式 + onCreated: Anot.PropsTypes.isFunction(), + onDateChange: Anot.PropsTypes.isFunction() + }, + skip: ['max', 'min', 'last', 'timer'], + watch: { + tips: function(val) { + clearTimeout(this.timer) + if (!val) { + return + } + this.timer = setTimeout(() => { + this.tips = '' + }, 1500) + }, + 'calendar.hour': function(val) { + if (val > 23) { + val = 23 + } + this.calendar.hour = val + }, + 'calendar.minute': function(val) { + if (val > 59) { + val = 59 + } + this.calendar.minute = val + }, + 'calendar.second': function(val) { + if (val > 59) { + val = 59 + } + this.calendar.second = val + } + }, + methods: { + // 重置日历表格 + resetCalendarTable: function() { + let { max, min, calendar: { year, month }, last } = this + + this.calendar.list.clear() + this.calendar.list.pushArray( + getCalendarTable({ max, min, year, month }, last) + ) + }, + // 数字前面加0 + numberFormat: function(num) { + num += '' + if (num.length > 1) { + return num + } + while (num.length < 2) { + num = '0' + num + } + return num + }, + // 输入框获取焦点时,显示日历 + onFocus: function() { + this.showCalendar = !0 + }, + // 切换上/下 年/月 + turn: function(isYear, step) { + let { calendar: { year, month }, max, min } = this + + if (isYear === 1) { + year += step + } else { + month += step + if (month < 1) { + month = 12 + year-- + } + if (month > 12) { + month = 1 + year++ + } + } + if (isLimited({ max, min }, { year, month }) === true) { + this.tips = '日期超出限制' + return + } + this.calendar.year = year + this.calendar.month = month + this.resetCalendarTable() + }, + pick: function(item) { + if (item.disabled) { + return + } + + this.calendar.day = item.day + changeStyle(this.calendar, item.day) + }, + updateTime: function() { + let { year, month, day, hour, minute, second } = this.calendar + + this.last = { year, month, day } + + if (!this.props.showTime) { + hour = 0 + minute = 0 + second = 0 + } + this.last.pick = new Date(year, month - 1, day, hour, minute, second) + this.value = this.last.pick.format(this.props.format) + }, + now: function() { + let now = new Date() + this.calendar.hour = now.getHours() + this.calendar.minute = now.getMinutes() + this.calendar.second = now.getSeconds() + }, + cancelBubble: function(ev) { + ;(ev.stopPropagation && ev.stopPropagation()) || (ev.cancelBubble = true) + }, + close: function() { + this.showCalendar = false + }, + onConfirm: function() { + this.updateTime() + this.close() + if (typeof this.props.onDateChange === 'function') { + this.props.onDateChange(this.value, this.last.pick) + } + } + } +}) diff --git a/src/js/datepicker/main.htm b/src/js/datepicker/main.htm old mode 100644 new mode 100755 index 7943c02..9c27451 --- a/src/js/datepicker/main.htm +++ b/src/js/datepicker/main.htm @@ -1,50 +1,57 @@ -
- +
+ -
+
-
请选择日期
-
- - - - - -
-
-
-
- -
-
-
- - - - 现在 -
-
-
+
+ + + + + +
+
+
+ + + + + + + +
+
+ +
+
+
+ + + + 现在 +
+
+ 取消 + 确定 +
+
+
\ No newline at end of file diff --git a/src/js/datepicker/main.js b/src/js/datepicker/main.js deleted file mode 100644 index d222be2..0000000 --- a/src/js/datepicker/main.js +++ /dev/null @@ -1,392 +0,0 @@ -/** - * - * @authors yutent (yutent@doui.cc) - * @date 2016-02-14 13:58:39 - * - */ -"use strict"; - -define([ - 'text!./main.htm', - 'css!./style.css', -], function(tpl){ - - yua.ui.datepicker = '1.0.0' - yua.component('datepicker', { - $template: tpl, - $construct: function(sys, option, attr){ - - // 先合并config的配置及元素的属性 - var opts = Object.assign({}, option, attr), - defVal; - - if(!opts.value){ - return yua.error('日历组件必须设置value属性') - } - - //获取初始值 - defVal = sys.$up[opts.value] - - //日期格式化, 默认会调用过滤器的格式'Y-m-d H:i:s' - if(!opts.showTime && !opts.format){ - opts.format = 'Y-m-d'; - } - - // 修正默认值, 如果不是Date对象, 则转为Date对象 - if(!defVal){ - if(opts.minDate){ - defVal = opts.minDate; - }else if(opts.maxDate){ - defVal = opts.maxDate; - }else{ - defVal = new Date() - } - } - if(!Date.isDate(defVal)){ - defVal = new Date(defVal) - } - - opts.update_value = opts.value - opts.value = defVal.format(opts.format) - - opts.calendar = { - list: [1], - year: defVal.format('Y'), - month: defVal.format('m'), - day: defVal.format('d'), - hour: defVal.format('H'), - minute: defVal.format('i'), - second: defVal.format('s'), - minYear: 0, - minMonth: 0, - minDay: 0, - maxYear: 0, - maxMonth: 0, - maxDay: 0 - } - - if(opts.minDate){ - if(!Date.isDate(opts.minDate)){ - opts.minDate = new Date(opts.minDate) - } - opts.calendar.minYear = opts.minDate.format('Y') - opts.calendar.minMonth = opts.minDate.format('m') - opts.calendar.minDay = opts.minDate.format('d') - } - - if(opts.maxDate){ - if(!Date.isDate(opts.maxDate)){ - opts.maxDate = new Date(opts.maxDate) - } - opts.calendar.maxYear = opts.maxDate.format('Y') - opts.calendar.maxMonth = opts.maxDate.format('m') - opts.calendar.maxDay = opts.maxDate.format('d') - } - - //移除部分属性 - delete opts.minDate; - delete opts.maxDate; - return yua.mix(sys, opts) - }, - $ready: function(vm, ele){ - var last = { - year: +vm.calendar.year, - month: +vm.calendar.month, - day: +vm.calendar.day - }, - timer; - - getCalendar(vm, last) //初始化日历显示 - - //日历按钮,未超出限制时切换日历 - vm.$turn = function(type, step){ - var year = +vm.calendar.year, - month = +vm.calendar.month; - - if(type === 1){ - year += step; - }else{ - month += step; - if(month < 1){ - month = 12; - year-- - } - if(month > 12){ - month = 1; - year++ - } - } - if(isLimited(vm.calendar, year, month) === true){ - vm.tips = '日期超出限制'; - return; - } - vm.calendar.year = year; - vm.calendar.month = numberFormat(month, 2); - } - - //选择日期 - vm.$getDate = function(disabled, day){ - if(disabled) - return; - - vm.calendar.day = day; - - changeStyle(vm.calendar, day); - updateTime(vm, last); - vm.showCalendar = !1; - } - - //输入框获取焦点时,显示日历 - vm.$focus = function(){ - vm.showCalendar = !0; - } - - //获取当前时间 - vm.$now = function(){ - var now = new Date(), - year = now.format('Y'), - month = now.format('m'), - day = now.format('d'); - - var isLimitYM = isLimited(year, month), - disabled = disabledDay(day, isLimitYM); - - if(disabled){ - vm.tips = '今天超出了限制日期'; - return; - } - - vm.calendar.year = year; - vm.calendar.month = month; - vm.calendar.day = day; - vm.calendar.hour = now.format('H'); - vm.calendar.minute = now.format('i'); - vm.calendar.second = now.format('s'); - - changeStyle(vm.calendar, day); - updateTime(vm, last); - - vm.showCalendar = !1; - } - - - /************************************************************/ - - vm.$watch('calendar.year', function(){ - getCalendar(vm, last); - }) - - vm.$watch('calendar.month', function(){ - getCalendar(vm, last); - }) - vm.$watch('calendar.hour', function(v){ - vm.calendar.hour = v - updateTime(vm, last) - }) - vm.$watch('calendar.minute', function(v){ - vm.calendar.minute = v - updateTime(vm, last) - }) - vm.$watch('calendar.second', function(v){ - vm.calendar.second = v - updateTime(vm, last) - }) - - vm.$watch('showCalendar', function(v){ - if(v || !vm.value) - return; - - vm.$up[vm.update_value] = vm.value - vm.$onUpdate(vm.value); - }) - - vm.$watch('tips', function(v){ - if(!v) - return; - clearTimeout(timer); - timer = setTimeout(function(){ - vm.tips = ''; - }, 1500) - }) - - document.addEventListener('click', function(){ - vm.showCalendar = !1; - }) - - }, - showTime: false, //对话框上显示时间 - showCalendar: false, //显示日历对话框 - disabled: false, //是否禁用 - tips: '', - format: '', // 日期显示格式 - value: '', // 用于显示在输入框里的日期变量 - $prevYear: '<<', - $nextYear: '>>', - $prevMonth: '<', - $nextMonth: '>', - $focus: yua.noop, - $turn: yua.noop, - $getDate: yua.noop, - $now: yua.noop, - $cancelBubble: function(event){ - event.stopPropagation && event.stopPropagation() || (event.cancelBubble = true); - }, - $onUpdate: yua.noop, //日期被修改后的回调 - }) - -/**************** 公共函数 *****************/ - //计算日历数组 - function getCalendar(vm, last){ - var year = +vm.calendar.year, - month = +vm.calendar.month, - nums = getTotalDays(year, month), - numsFixed = -getFirstDay(year, month) + 1, - isLimitYM = isLimited(vm.calendar, year, month); - - vm.calendar.list.clear(); - - for(var i = numsFixed; i <= nums; i++){ - - var day = { - weeken: !1, - day: '', - selected: !1, - disable: !0 - } - if(i > 0){ - var d = getFirstDay(year, month, i) - day = { - weeken: d == 0 || d == 6, - day: i, - selected: isSelected(vm.calendar, last, i), - disable: disabledDay(vm.calendar, i, isLimitYM) - } - } - vm.calendar.list.push(day) - } - } - - //判断当前年/月是否超出限制 - function isLimited(calendar, year, month){ - var limit = { - Y: +calendar.minYear, - M: +calendar.minMonth, - mY: +calendar.maxYear, - mM: +calendar.maxMonth, - }, - res = ''; - - if((!limit.Y && !limit.mY) || (!limit.M && !limit.mM) || !year){ - return false - } - - - if((limit.Y && year < limit.Y) || (limit.mY && year > limit.mY)){ - return true - } - - if(month){ - if(year === limit.Y){ - if(limit.M && month < limit.M) - return true - - if(month == limit.M) - res += '-' - } - - if(year === limit.mY){ - if(limit.mM && month > limit.mM) - return true - - if(month == limit.mM) - res += '+' - } - } - return res - } - - //判断指定天数是否有效 - function disabledDay(calendar, day, limitedYM){ - var minD = calendar.minDay, - maxD = calendar.maxDay; - - if(limitedYM === '-') - return day < minD - - if(limitedYM === '+') - return maxD && day > maxD - - if(limitedYM === '-+') - return day < minD || (maxD && day > maxD) - - return limitedYM - } - - //判断指定天数是否被选中 - function isSelected(calendar, last, day){ - var year = +calendar.year, - month = +calendar.month; - - return !(last.year !== year || last.month !== month || last.day !== day) - } - - //修改当前选中日期的样式 - function changeStyle(calendar, day){ - calendar.list.forEach(function(item){ - if(item.day != day){ - item.selected = !1 - }else{ - item.selected = !0 - } - }) - } - - //更新时间 - function updateTime(vm, last){ - var hour = 0, - minute = 0, - second = 0; - - last = { - year: +vm.calendar.year, - month: +vm.calendar.month, - day: +vm.calendar.day - } - - if(vm.showTime){ - hour = vm.calendar.hour - minute = vm.calendar.minute - second = vm.calendar.second - } - vm.value = new Date(last.year, last.month - 1, last.day, hour, minute, second).format(vm.format) - } - - - //获取今年的年份/月份,返回的是数组 - function getThisYearMonth(){ - var oDate = new Date() - return [oDate.getFullYear(), oDate.getMonth() + 1] - } - - //根据年份获取指定月份天数 - function getTotalDays(year, month){ - return new Date(year, month, 0).getDate() - } - - //判断指定年月第一天是星期几 - function getFirstDay(year, month, day){ - return new Date(year, month - 1, day || 1).getDay() - } - //数字长度补全(前面加0) - function numberFormat(num, len){ - num += '' - if(num.length === len) - return num - - while(num.length < len) - num = '0' + num - return num - } - - return yua -}) \ No newline at end of file diff --git a/src/js/datepicker/style.scss b/src/js/datepicker/style.scss old mode 100644 new mode 100755 index 31d4c30..a95d5f8 --- a/src/js/datepicker/style.scss +++ b/src/js/datepicker/style.scss @@ -1,56 +1,102 @@ @charset "UTF-8"; -/** +/** * * @authors yutent (yutent@doui.cc) * @date 2016-02-14 14:00:06 * */ -@import "../../../css/var.scss"; -.do-datepicker {position:relative;z-index:65534;width:100%;height:100%; +@import 'var.scss'; +.do-datepicker { position:relative;width:100%; height:100%;color:nth($cgr, 1);font-size:14px; - a {text-decoration:none;} - .date-input {display:block;width:100%;height:100%;padding:0 5px;line-height:18px;border:1px solid nth($cp, 1);@include ts(); - - &:focus {border-color:nth($ct, 1)} - } - - .calendar-box {position:absolute;left:0;top:100%;width:267px;height:auto;min-height:60px;padding:10px;line-height:35px;border:1px solid #ddd;background:#fff;font-size:14px;color:nth($cgr, 1);text-align:center;box-shadow:0 1px 5px rgba(0,0,0,.1); - - dt.title {width:100%;height:35px;background:#e7e8eb;} - dd.contrl {position:relative;width:90%;height:35px;margin:0 5%; - - a {position:absolute;left:0;top:0;width:35px;height:35px;color:nth($cgr, 1);font-weight:bold;} - a:hover {color:nth($ct, 1)} - a.prev-month {left:35px;} - a.next-month {left:auto;right:35px;} - a.next-year {left:auto;right:0;} - } - - dd.calendar {width:100%;height:auto; - - .week {width:100%;height:35px;margin-bottom:5px;border-bottom:1px solid #eee;} - span.td {float:left;width:35px;} - .list span.td {height:30px;line-height:30px;cursor:pointer;@include ts(); - - &:hover {background:nth($cp, 1);} - &.weeken {color:nth($cr, 1)} - &.selected {background:nth($ct, 2);color:#fff} - &.disabled {color:nth($cp, 3);cursor:default;} - &.disabled:hover {background:none;} - } - } - dd.time {position:relative;width:100%;height:41px;padding:5px 0;margin-top:5px;line-height:30px;border-top:1px solid #eee; - - label {float:left;width:60px;height:30px; - input {width:30px;height:30px;border:1px solid nth($cp, 1);text-align:center;} - } - .now {float:right;width:50px;height:30px;border-radius:3px;background:nth($ct, 1);color:#fff;text-align:center; - - &:hover {background:nth($ct, 2);} - &:active {background:nth($ct, 3);} - } - } - dd.tips {position:absolute;z-index:65535;left:25%;top:40%;width:50%;height:30px;line-height:30px;background:rgba(0,0,0,.7);color:#fff;font-size:12px;text-align:center;} - } + a { text-decoration:none;color:nth($cgr, 1); -} \ No newline at end of file + &:hover {color:nth($cgr, 2);} + &:active {color:nth($cgr, 3);} + } + + .date-input { display:block; width:100%; height:100%; padding:0 5px; line-height:18px; border:1px solid nth($cp, 1); @include ts(); + + &:focus { border-color:nth($ct, 1); } + } + .calendar-box { position:absolute; left:0; top:100%; z-index:65534; width:267px; height:auto; min-height:60px;padding:10px;line-height:35px; border:1px solid #ddd; background:#fff; font-size:14px; color:nth($cgr, 1); text-align:center; box-shadow:0 1px 5px rgba(0, 0, 0, 0.1); + + &::before {position:absolute;left:0;top:0;z-index:-1;width:100%;height:85px;background:nth($ct, 1);content:""} + + dt.contrl {position:relative; width:100%; height:35px; margin:5px 0 0;border-radius:3px;color:#fff; + + a { position:absolute; left:0; top:0; width:35px; height:35px;color:#fff; + + &::before {position:absolute;left:0;top:0;z-index:-1;display:block;width:35px;height:35px;border-radius:50%;background:nth($ct, 3); content:"";opacity:0;transform: scale(0);} + + &:active {font-weight:bold; + &::before {animation:ripple .3s cubic-bezier(0.23, 1, 0.32, 1);} + } + &::after {content:"\e652";} + + &.prev-month {left:35px; + &::after {content:"\e659"} + } + &.next-month {left:auto; right:35px; + &::after {content:"\e658"} + } + &.next-year {left:auto; right:0; + &::after {content:"\e653"} + } + } + + } + dd.table { width:100%; height:auto; + .thead {width:100%; height:35px; margin-bottom:5px;color:#fff;} + span.td {position:relative;float:left; width:33px;margin:1px;border-radius:3px; + + } + + .tr span.td { height:30px; line-height:30px;cursor:pointer; + + &::before {position:absolute;left:1px;top:0;z-index:-1;display:block;width:30px;height:30px;border-radius:50%;background:nth($cp, 1); content:"";opacity:0;transform: scale(0); transition:opacity .45s cubic-bezier(0.23, 1, 0.32, 1),transform .45s cubic-bezier(0.23, 1, 0.32, 1);} + + &:hover,&.selected { + &::before {opacity:1;transform:scale(1);} + } + + &.weeken {color:nth($ct, 3);} + &.selected {color:#fff; + &::before {background:nth($ct, 2);} + } + &.disabled { color:nth($cp, 1); cursor:default; + + &::before {display:none;} + } + } + } + + dd.time { position:relative; width:100%; height:41px; padding:5px 0; margin-top:5px; line-height:30px; border-top:1px solid #eee; + + label { float:left; width:60px; height:30px; + input { width:30px; height:30px; border:1px solid nth($cp, 1); text-align:center; } + } + .now { float:right; width:50px; height:30px; border-radius:3px; background:nth($cp, 1);text-align:center; + } + } + + dt.confirm { position:relative; width:100%; height:41px; padding:10px 0 0;line-height:30px; border-top:1px solid #eee; text-align:right; + + .ok,.cancel {display:inline-block;width:60px; height:30px;margin:0 0 0 10px;border-radius:3px;text-align:center;} + + .ok { background:nth($ct, 1); color:#fff; + &:hover { background:nth($ct, 2); } + &:active { background:nth($ct, 3); } + } + .cancel {background:nth($cp, 1);} + } + + dd.tips { position:absolute; z-index:65535; left:25%; top:40%; width:50%; height:30px; line-height:30px; background:rgba(0, 0, 0, 0.7); color:#fff; font-size:12px; text-align:center; } + } +} + + +@keyframes ripple { + from {transform: scale(0);opacity:0;} + 30% {opacity:.8;} + to {transform: scale(1.2); opacity:0;} +} \ No newline at end of file diff --git a/src/js/drag/doc.md b/src/js/drag/doc.md old mode 100644 new mode 100755 diff --git a/src/js/drag/main.js b/src/js/drag/main.js old mode 100644 new mode 100755 diff --git a/src/js/layer/Release.md b/src/js/layer/Release.md old mode 100644 new mode 100755 diff --git a/src/js/layer/base.js b/src/js/layer/base.js old mode 100644 new mode 100755 diff --git a/src/js/layer/full.js b/src/js/layer/full.js old mode 100644 new mode 100755 diff --git a/src/js/layer/mobile.js b/src/js/layer/mobile.js old mode 100644 new mode 100755 diff --git a/src/js/layer/skin/def.scss b/src/js/layer/skin/def.scss old mode 100644 new mode 100755 diff --git a/src/js/marked/main.js b/src/js/marked/main.js old mode 100644 new mode 100755 diff --git a/src/js/marked/theme.scss b/src/js/marked/theme.scss old mode 100644 new mode 100755 diff --git a/src/js/md5/Readme.md b/src/js/md5/Readme.md old mode 100644 new mode 100755 diff --git a/src/js/md5/main.js b/src/js/md5/main.js old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/attach.js b/src/js/meditor/addon/attach.js old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/attach.scss b/src/js/meditor/addon/attach.scss old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/base.js b/src/js/meditor/addon/base.js old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/0.gif b/src/js/meditor/addon/face/0.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/1.gif b/src/js/meditor/addon/face/1.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/10.gif b/src/js/meditor/addon/face/10.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/11.gif b/src/js/meditor/addon/face/11.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/12.gif b/src/js/meditor/addon/face/12.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/13.gif b/src/js/meditor/addon/face/13.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/14.gif b/src/js/meditor/addon/face/14.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/15.gif b/src/js/meditor/addon/face/15.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/16.gif b/src/js/meditor/addon/face/16.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/17.gif b/src/js/meditor/addon/face/17.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/18.gif b/src/js/meditor/addon/face/18.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/19.gif b/src/js/meditor/addon/face/19.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/2.gif b/src/js/meditor/addon/face/2.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/20.gif b/src/js/meditor/addon/face/20.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/21.gif b/src/js/meditor/addon/face/21.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/22.gif b/src/js/meditor/addon/face/22.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/23.gif b/src/js/meditor/addon/face/23.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/24.gif b/src/js/meditor/addon/face/24.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/25.gif b/src/js/meditor/addon/face/25.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/26.gif b/src/js/meditor/addon/face/26.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/27.gif b/src/js/meditor/addon/face/27.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/28.gif b/src/js/meditor/addon/face/28.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/29.gif b/src/js/meditor/addon/face/29.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/3.gif b/src/js/meditor/addon/face/3.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/30.gif b/src/js/meditor/addon/face/30.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/31.gif b/src/js/meditor/addon/face/31.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/32.gif b/src/js/meditor/addon/face/32.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/33.gif b/src/js/meditor/addon/face/33.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/34.gif b/src/js/meditor/addon/face/34.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/35.gif b/src/js/meditor/addon/face/35.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/4.gif b/src/js/meditor/addon/face/4.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/5.gif b/src/js/meditor/addon/face/5.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/6.gif b/src/js/meditor/addon/face/6.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/7.gif b/src/js/meditor/addon/face/7.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/8.gif b/src/js/meditor/addon/face/8.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/addon/face/9.gif b/src/js/meditor/addon/face/9.gif old mode 100644 new mode 100755 diff --git a/src/js/meditor/main.js b/src/js/meditor/main.js old mode 100644 new mode 100755 diff --git a/src/js/meditor/skin/main.scss b/src/js/meditor/skin/main.scss old mode 100644 new mode 100755 diff --git a/src/js/pages/index.js b/src/js/pager/index.js old mode 100644 new mode 100755 similarity index 97% rename from src/js/pages/index.js rename to src/js/pager/index.js index dc952a0..8cda034 --- a/src/js/pages/index.js +++ b/src/js/pager/index.js @@ -2,7 +2,7 @@ import './main.scss' -Anot.ui.pages = '1.0.0' +Anot.ui.pager = '1.0.0' //计算页码列表 function calculate({ currPage, maxPageShow, totalPages }) { let arr = [] @@ -46,7 +46,7 @@ function update(currPage, vm) { } } -export default Anot.component('pages', { +export default Anot.component('pager', { construct: function(props, state) { props.className = 'skin-' + (props.theme || 1) + ' ' + (props.color || 'plain') @@ -55,7 +55,7 @@ export default Anot.component('pages', { }, render: function() { return ` -
+