Skip to content

Commit

Permalink
0.4.7: imporve compile workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
guo-yu committed Aug 25, 2014
1 parent c31aa2a commit 73a56ec
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "duoshuo",
"version": "0.4.6",
"version": "0.4.7",
"authors": [
"turing <[email protected]>"
],
Expand Down
2 changes: 1 addition & 1 deletion dist/duoshuo.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h3 ng-bind="thread.title" ng-show="thread.title !== ''"></h3>
</script>
<script src="http://static.duoshuo.com/embed.unstable.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../src/duoshuo.js"></script>
<script src="../dist/duoshuo.min.js"></script>
<script src="./example.js"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "angular-duoshuo",
"version": "0.4.6",
"version": "0.4.7",
"description": "a duoshuo SDK for angular.js, pure front-end, cross-domain request supported.",
"main": "dist/duoshuo.min.js",
"scripts": {
"serve": "node_modules/.bin/serve .",
"build": "node_modules/.bin/uglifyjs src/duoshuo.js -o dist/duoshuo.min.js --source-map dist/duoshuo.min.js.map --source-map-url duoshuo.min.js.map --source-map-root ../src/duoshuo.js",
"build": "node_modules/.bin/uglifyjs src/duoshuo.js --mangle --compress -o dist/duoshuo.min.js --source-map dist/duoshuo.min.js.map --source-map-url duoshuo.min.js.map --source-map-root ../src/duoshuo.js",
"dev": "npm run serve",
"start": "npm run serve",
"example": "npm run serve"
Expand Down
12 changes: 8 additions & 4 deletions src/duoshuo.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
var NProgressExist = NProgress && NProgress.start && NProgress.done;

angular.module('duoshuo', [])
.service('$duoshuo', function($rootScope) {
.service('$duoshuo', ['$rootScope', duoshuoService])
.directive('duoshuo', ['$duoshuo', duoshuoDirective]);

function duoshuoService($rootScope) {
var self = this;

// lowlevel api set
Expand Down Expand Up @@ -58,8 +61,9 @@
if (attrs.threadKey) data['thread-key'] = attrs.threadKey;
return window.DUOSHUO.createEmbedThread('div', data);
};
})
.directive('duoshuo', function($duoshuo){
}

function duoshuoDirective($duoshuo) {
return {
restrict: 'AE',
replace: true,
Expand All @@ -73,6 +77,6 @@
});
}
};
});
}

})(window.angular, window.NProgress);

0 comments on commit 73a56ec

Please sign in to comment.