Skip to content

Commit

Permalink
add git hash
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Sep 5, 2017
1 parent cbcdda0 commit a6380b7
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 84 deletions.
2 changes: 1 addition & 1 deletion dist/DPlayer.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/DPlayer.min.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/DPlayer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/DPlayer.min.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"exports-loader": "^0.6.4",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^0.11.1",
"git-revision-webpack-plugin": "^2.5.1",
"node-sass": "^4.5.0",
"postcss-loader": "^2.0.5",
"sass-loader": "^6.0.2",
Expand Down
9 changes: 7 additions & 2 deletions src/DPlayer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1033,9 +1033,9 @@

.dplayer-menu {
position: absolute;
width: 150px;
width: 170px;
border-radius: 2px;
background: rgba(28, 28, 28, 0.9);
background: rgba(28, 28, 28, 0.85);
padding: 5px 0;
overflow: hidden;
z-index: 3;
Expand All @@ -1062,6 +1062,11 @@
font-size: 13px;
display: inline-block;
vertical-align: middle;
width: 100%;
box-sizing: border-box;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;

&:hover {
text-decoration: none;
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line
console.log(`${'\n'} %c DPlayer ${DPLAYER_VERSION} %c http://dplayer.js.org ${'\n'}${'\n'}`, 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');
/* global DPLAYER_VERSION GIT_HASH */
console.log(`${'\n'} %c DPlayer ${DPLAYER_VERSION} ${GIT_HASH} %c http://dplayer.js.org ${'\n'}${'\n'}`, 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');

module.exports = require('./DPlayer');
27 changes: 14 additions & 13 deletions src/option.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* global DPLAYER_VERSION GIT_HASH */
const defaultApiBackend = require('./api.js');

module.exports = (option) => {
Expand All @@ -20,16 +21,7 @@ module.exports = (option) => {
volume: '0.7',
apiBackend: defaultApiBackend,
video: {},
contextmenu: [
{
text: 'About author',
link: 'http://diygod.me'
},
{
text: 'DPlayer feedback',
link: 'https://github.com/DIYgod/DPlayer/issues'
}
]
contextmenu: []
};
for (const defaultKey in defaultOption) {
if (defaultOption.hasOwnProperty(defaultKey) && !option.hasOwnProperty(defaultKey)) {
Expand All @@ -51,10 +43,19 @@ module.exports = (option) => {
option.lang.toLowerCase();
}

option.contextmenu.push({
option.contextmenu = option.contextmenu.concat([{
text: 'About author',
link: 'https://www.anotherhome.net/'
}, {
text: 'About DPlayer',
link: 'https://github.com/DIYgod/DPlayer'
});
link: 'https://github.com/MoePlayer/DPlayer'
}, {
text: 'DPlayer feedback',
link: 'https://github.com/DIYgod/DPlayer/issues'
}, {
text: `DPlayer ${DPLAYER_VERSION} ${GIT_HASH}`,
link: 'https://github.com/MoePlayer/DPlayer/commits/master'
}]);

return option;
};
5 changes: 4 additions & 1 deletion webpack/dev.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* eslint-disable no-undef */
const path = require('path');
const webpack = require('webpack');
const GitRevisionPlugin = require('git-revision-webpack-plugin');
const gitRevisionPlugin = new GitRevisionPlugin();

module.exports = {

Expand Down Expand Up @@ -93,7 +95,8 @@ module.exports = {
plugins: [
new webpack.NamedModulesPlugin(),
new webpack.DefinePlugin({
DPLAYER_VERSION: `"${require('../package.json').version}"`
DPLAYER_VERSION: `"${require('../package.json').version}"`,
GIT_HASH: JSON.stringify(gitRevisionPlugin.version())
})
],

Expand Down
5 changes: 4 additions & 1 deletion webpack/prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const GitRevisionPlugin = require('git-revision-webpack-plugin');
const gitRevisionPlugin = new GitRevisionPlugin();

module.exports = {

Expand Down Expand Up @@ -86,7 +88,8 @@ module.exports = {

plugins: [
new webpack.DefinePlugin({
DPLAYER_VERSION: `"${require('../package.json').version}"`
DPLAYER_VERSION: `"${require('../package.json').version}"`,
GIT_HASH: JSON.stringify(gitRevisionPlugin.version())
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
Expand Down
82 changes: 21 additions & 61 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ babel-plugin-transform-es2015-block-scoped-functions@^6.22.0:
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es2015-block-scoping@^6.24.1:
babel-plugin-transform-es2015-block-scoping@^6.23.0:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-block-scoping/download/babel-plugin-transform-es2015-block-scoping-6.24.1.tgz#76c295dc3a4741b1665adfd3167215dcff32a576"
dependencies:
Expand All @@ -439,7 +439,7 @@ babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es20
babel-types "^6.24.1"
lodash "^4.2.0"

babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-classes@^6.24.1:
babel-plugin-transform-es2015-classes@^6.23.0:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-classes/download/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db"
dependencies:
Expand All @@ -453,33 +453,33 @@ babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-cla
babel-traverse "^6.24.1"
babel-types "^6.24.1"

babel-plugin-transform-es2015-computed-properties@^6.22.0, babel-plugin-transform-es2015-computed-properties@^6.24.1:
babel-plugin-transform-es2015-computed-properties@^6.22.0:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-computed-properties/download/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3"
dependencies:
babel-runtime "^6.22.0"
babel-template "^6.24.1"

babel-plugin-transform-es2015-destructuring@^6.22.0, babel-plugin-transform-es2015-destructuring@^6.23.0:
babel-plugin-transform-es2015-destructuring@^6.23.0:
version "6.23.0"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-destructuring/download/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d"
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-duplicate-keys@^6.22.0, babel-plugin-transform-es2015-duplicate-keys@^6.24.1:
babel-plugin-transform-es2015-duplicate-keys@^6.22.0:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-duplicate-keys/download/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e"
dependencies:
babel-runtime "^6.22.0"
babel-types "^6.24.1"

babel-plugin-transform-es2015-for-of@^6.22.0, babel-plugin-transform-es2015-for-of@^6.23.0:
babel-plugin-transform-es2015-for-of@^6.23.0:
version "6.23.0"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-for-of/download/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691"
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es2015-function-name@^6.24.1:
babel-plugin-transform-es2015-function-name@^6.22.0:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-function-name/download/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b"
dependencies:
Expand Down Expand Up @@ -510,30 +510,30 @@ babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-e
babel-template "^6.24.1"
babel-types "^6.24.1"

babel-plugin-transform-es2015-modules-systemjs@^6.23.0, babel-plugin-transform-es2015-modules-systemjs@^6.24.1:
babel-plugin-transform-es2015-modules-systemjs@^6.23.0:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-modules-systemjs/download/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23"
dependencies:
babel-helper-hoist-variables "^6.24.1"
babel-runtime "^6.22.0"
babel-template "^6.24.1"

babel-plugin-transform-es2015-modules-umd@^6.23.0, babel-plugin-transform-es2015-modules-umd@^6.24.1:
babel-plugin-transform-es2015-modules-umd@^6.23.0:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-modules-umd/download/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468"
dependencies:
babel-plugin-transform-es2015-modules-amd "^6.24.1"
babel-runtime "^6.22.0"
babel-template "^6.24.1"

babel-plugin-transform-es2015-object-super@^6.22.0, babel-plugin-transform-es2015-object-super@^6.24.1:
babel-plugin-transform-es2015-object-super@^6.22.0:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-object-super/download/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d"
dependencies:
babel-helper-replace-supers "^6.24.1"
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015-parameters@^6.24.1:
babel-plugin-transform-es2015-parameters@^6.23.0:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-parameters/download/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b"
dependencies:
Expand All @@ -544,7 +544,7 @@ babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015-
babel-traverse "^6.24.1"
babel-types "^6.24.1"

babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transform-es2015-shorthand-properties@^6.24.1:
babel-plugin-transform-es2015-shorthand-properties@^6.22.0:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-shorthand-properties/download/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0"
dependencies:
Expand All @@ -557,7 +557,7 @@ babel-plugin-transform-es2015-spread@^6.22.0:
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es2015-sticky-regex@^6.24.1:
babel-plugin-transform-es2015-sticky-regex@^6.22.0:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-sticky-regex/download/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc"
dependencies:
Expand All @@ -571,13 +571,13 @@ babel-plugin-transform-es2015-template-literals@^6.22.0:
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-typeof-symbol@^6.22.0, babel-plugin-transform-es2015-typeof-symbol@^6.23.0:
babel-plugin-transform-es2015-typeof-symbol@^6.23.0:
version "6.23.0"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-typeof-symbol/download/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372"
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es2015-unicode-regex@^6.24.1:
babel-plugin-transform-es2015-unicode-regex@^6.22.0:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-unicode-regex/download/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9"
dependencies:
Expand All @@ -593,7 +593,7 @@ babel-plugin-transform-exponentiation-operator@^6.22.0:
babel-plugin-syntax-exponentiation-operator "^6.8.0"
babel-runtime "^6.22.0"

babel-plugin-transform-regenerator@^6.22.0, babel-plugin-transform-regenerator@^6.24.1:
babel-plugin-transform-regenerator@^6.22.0:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-regenerator/download/babel-plugin-transform-regenerator-6.24.1.tgz#b8da305ad43c3c99b4848e4fe4037b770d23c418"
dependencies:
Expand Down Expand Up @@ -641,35 +641,6 @@ babel-preset-env@^1.6.0:
invariant "^2.2.2"
semver "^5.3.0"

babel-preset-es2015@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-preset-es2015/download/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939"
dependencies:
babel-plugin-check-es2015-constants "^6.22.0"
babel-plugin-transform-es2015-arrow-functions "^6.22.0"
babel-plugin-transform-es2015-block-scoped-functions "^6.22.0"
babel-plugin-transform-es2015-block-scoping "^6.24.1"
babel-plugin-transform-es2015-classes "^6.24.1"
babel-plugin-transform-es2015-computed-properties "^6.24.1"
babel-plugin-transform-es2015-destructuring "^6.22.0"
babel-plugin-transform-es2015-duplicate-keys "^6.24.1"
babel-plugin-transform-es2015-for-of "^6.22.0"
babel-plugin-transform-es2015-function-name "^6.24.1"
babel-plugin-transform-es2015-literals "^6.22.0"
babel-plugin-transform-es2015-modules-amd "^6.24.1"
babel-plugin-transform-es2015-modules-commonjs "^6.24.1"
babel-plugin-transform-es2015-modules-systemjs "^6.24.1"
babel-plugin-transform-es2015-modules-umd "^6.24.1"
babel-plugin-transform-es2015-object-super "^6.24.1"
babel-plugin-transform-es2015-parameters "^6.24.1"
babel-plugin-transform-es2015-shorthand-properties "^6.24.1"
babel-plugin-transform-es2015-spread "^6.22.0"
babel-plugin-transform-es2015-sticky-regex "^6.24.1"
babel-plugin-transform-es2015-template-literals "^6.22.0"
babel-plugin-transform-es2015-typeof-symbol "^6.22.0"
babel-plugin-transform-es2015-unicode-regex "^6.24.1"
babel-plugin-transform-regenerator "^6.24.1"

babel-register@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-register/download/babel-register-6.24.1.tgz#7e10e13a2f71065bdfad5a1787ba45bca6ded75f"
Expand Down Expand Up @@ -845,14 +816,7 @@ browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6:
caniuse-db "^1.0.30000639"
electron-to-chromium "^1.2.7"

browserslist@^2.1.2:
version "2.2.2"
resolved "http://registry.npm.taobao.org/browserslist/download/browserslist-2.2.2.tgz#e9b4618b8a01c193f9786beea09f6fd10dbe31c3"
dependencies:
caniuse-lite "^1.0.30000704"
electron-to-chromium "^1.3.16"

browserslist@^2.1.3:
browserslist@^2.1.2, browserslist@^2.1.3:
version "2.1.4"
resolved "http://registry.npm.taobao.org/browserslist/download/browserslist-2.1.4.tgz#cc526af4a1312b7d2e05653e56d0c8ab70c0e053"
dependencies:
Expand Down Expand Up @@ -933,10 +897,6 @@ caniuse-lite@^1.0.30000670:
version "1.0.30000671"
resolved "http://registry.npm.taobao.org/caniuse-lite/download/caniuse-lite-1.0.30000671.tgz#c206c2f1a1feb34de46064407c4356818389bf1e"

caniuse-lite@^1.0.30000704:
version "1.0.30000708"
resolved "http://registry.npm.taobao.org/caniuse-lite/download/caniuse-lite-1.0.30000708.tgz#71dbf388c57f379b1bb66c89a890edc04c2509b6"

caseless@~0.12.0:
version "0.12.0"
resolved "http://registry.npm.taobao.org/caseless/download/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
Expand Down Expand Up @@ -1458,10 +1418,6 @@ electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.11:
version "1.3.11"
resolved "http://registry.npm.taobao.org/electron-to-chromium/download/electron-to-chromium-1.3.11.tgz#744761df1d67b492b322ce9aa0aba5393260eb61"

electron-to-chromium@^1.3.16:
version "1.3.16"
resolved "http://registry.npm.taobao.org/electron-to-chromium/download/electron-to-chromium-1.3.16.tgz#d0e026735754770901ae301a21664cba45d92f7d"

elliptic@^6.0.0:
version "6.4.0"
resolved "http://registry.npm.taobao.org/elliptic/download/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df"
Expand Down Expand Up @@ -2016,6 +1972,10 @@ getpass@^0.1.1:
dependencies:
assert-plus "^1.0.0"

git-revision-webpack-plugin@^2.5.1:
version "2.5.1"
resolved "https://registry.npmjs.org/git-revision-webpack-plugin/-/git-revision-webpack-plugin-2.5.1.tgz#3fb4398f376cf27678d6de96ba2669b518645e78"

glob-base@^0.3.0:
version "0.3.0"
resolved "http://registry.npm.taobao.org/glob-base/download/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4"
Expand Down

0 comments on commit a6380b7

Please sign in to comment.