Skip to content

Commit

Permalink
Improve user experience.
Browse files Browse the repository at this point in the history
  • Loading branch information
zackyang000 committed Aug 29, 2013
1 parent a664329 commit da8d9b0
Show file tree
Hide file tree
Showing 30 changed files with 213 additions and 289 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public void Run()
"~/Content/js/buttons.js",
"~/Content/js/md5.js",
"~/Content/js/uuid.js",
"~/Content/plugin/ckeditor_3.6.1/ckeditor.js",
"~/Content/plugin/ckfinder_aspnet_2.0.1/ckfinder.js",
"~/Content/plugin/syntaxhighlighter_3.0.83/scripts/shCore.js",
"~/Content/plugin/syntaxhighlighter_3.0.83/scripts/shBrushCSharp.js",
"~/Content/plugin/syntaxhighlighter_3.0.83/scripts/shBrushCss.js",
Expand Down
12 changes: 10 additions & 2 deletions src/YangKai.BlogEngine.Web.Mvc/Content/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ h6,
.bg-color-yellow {
background-color: #ffc40d !important;
}
.bg-color-pink {
background-color: #c3325f !important;
}
::-moz-selection {
background: #f2dede;
}
Expand Down Expand Up @@ -329,8 +332,13 @@ article .date div:last-child {
color: #FFF;
float: left;
}
.bg-color-pink {
background-color: #c3325f !important;
#archives .group > a,
.group > a:hover {
color: #333333;
}
#archives ul {
padding: 5px;
margin-left: 10px;
}
.intro h5 {
margin: 10px 0 10px 0;
Expand Down
7 changes: 4 additions & 3 deletions src/YangKai.BlogEngine.Web.Mvc/Content/css/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ line-height:1.4
.bg-color-darken {background-color: #1c1c1c !important;}
.bg-color-orange {background-color: #CD4900 !important;}
.bg-color-yellow {background-color: #ffc40d !important;}
.bg-color-pink {background-color: #c3325f !important;}

//文章选中颜色
::-moz-selection {background: #f2dede;}
Expand Down Expand Up @@ -279,11 +280,11 @@ article {
float: left;
}
}
.bg-color-pink {
background-color: #c3325f !important;
}


#archives .group >a,.group >a:hover{color:#333}
#archives ul{ padding: 5px;margin-left: 10px;}

.intro {
h5 {
margin: 10px 0 10px 0;
Expand Down
2 changes: 1 addition & 1 deletion src/YangKai.BlogEngine.Web.Mvc/Content/css/style.min.css

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions src/YangKai.BlogEngine.Web.Mvc/Content/js/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'ArticleServices',
'CommentServices',
'UserServices',
'ChannelServices',
'customDirectives',
'ngProgress',
'ui.utils',
Expand Down Expand Up @@ -92,10 +93,10 @@ angular.module("app-admin",['formatFilters',
templateUrl: "/partials/Admin/board/list.html"
controller: BoardController)
#home
.when("/",
templateUrl: "/partials/Admin/index.html"
controller: HomeController)
.otherwise redirectTo: "/"
#.when("/",
# templateUrl: "/partials/Admin/index.html"
# controller: HomeController)
.otherwise redirectTo: "/article"
]

interceptor = ["$rootScope", "$q", (scope, $q) ->
Expand Down
7 changes: 2 additions & 5 deletions src/YangKai.BlogEngine.Web.Mvc/Content/js/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var interceptor;

angular.module("app", ['formatFilters', 'MessageServices', 'ArticleServices', 'CommentServices', 'UserServices', 'customDirectives', 'ngProgress', 'ui.utils', 'ui.bootstrap', 'ngGrid']).config([
angular.module("app", ['formatFilters', 'MessageServices', 'ArticleServices', 'CommentServices', 'UserServices', 'ChannelServices', 'customDirectives', 'ngProgress', 'ui.utils', 'ui.bootstrap', 'ngGrid']).config([
"$locationProvider", "$routeProvider", "$httpProvider", function($locationProvider, $routeProvider, $httpProvider) {
$httpProvider.responseInterceptors.push(interceptor);
$locationProvider.html5Mode(false).hashPrefix('!');
Expand Down Expand Up @@ -64,11 +64,8 @@ angular.module("app-admin", ['formatFilters', 'MessageServices', 'ArticleService
}).when("/board", {
templateUrl: "/partials/Admin/board/list.html",
controller: BoardController
}).when("/", {
templateUrl: "/partials/Admin/index.html",
controller: HomeController
}).otherwise({
redirectTo: "/"
redirectTo: "/article"
});
}
]);
Expand Down
2 changes: 1 addition & 1 deletion src/YangKai.BlogEngine.Web.Mvc/Content/js/app.min.js

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

Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
ArchivesController=["$scope","$http", ($scope,$http) ->
ArchivesController=["$scope","Channel", ($scope,Channel) ->
$scope.$parent.title='Archives'
$scope.$parent.showBanner=false

$scope.load = ->
$scope.loading=true
Channel.archives (data)->
$scope.list = data
$scope.loading=false

$scope.load()
]
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
var ArchivesController;

ArchivesController = [
"$scope", "$http", function($scope, $http) {
"$scope", "Channel", function($scope, Channel) {
$scope.$parent.title = 'Archives';
return $scope.$parent.showBanner = false;
$scope.$parent.showBanner = false;
$scope.load = function() {
$scope.loading = true;
return Channel.archives(function(data) {
$scope.list = data;
return $scope.loading = false;
});
};
return $scope.load();
}
];

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

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
$scope.User=data

$scope.search = ->
debugger
$window.location.href="/#!/search/#{$scope.key}"
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GlobalController = [
return $scope.User = data;
});
return $scope.search = function() {
return $window.location.href = "/#!/search/" + $scope.key;
debugger; return $window.location.href = "/#!/search/" + $scope.key;
};
}
];
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
$window.location.href='/admin'
,(error)->
$scope.user.Password=''
message.error error.data['odata.error'].innererror.message
$scope.submitting=false

$scope.signout = ->
Expand Down Expand Up @@ -49,6 +48,5 @@ LoginDialogController=["$scope","$window", "dialog","User",($scope,$window, dial
$window.location.href='/'
,(error)->
$scope.user.Password=''
message.error error.data['odata.error'].innererror.message
$scope.submitting=false
]
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ LoginController = [
return $window.location.href = '/admin';
}, function(error) {
$scope.user.Password = '';
message.error(error.data['odata.error'].innererror.message);
return $scope.submitting = false;
});
};
Expand Down Expand Up @@ -59,7 +58,6 @@ LoginDialogController = [
return $window.location.href = '/';
}, function(error) {
$scope.user.Password = '';
message.error(error.data['odata.error'].innererror.message);
return $scope.submitting = false;
});
};
Expand Down

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

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
myDirectives.directive "odataPager", ($compile)->
myDirectives.directive "odataPager", ['$compile',($compile)->

(scope, element, attrs) ->
data=undefined
Expand All @@ -20,4 +20,4 @@
data=value
return if data==null or data==undefined
update()
]
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@

myDirectives.directive("odataPager", function($compile) {
return function(scope, element, attrs) {
var data, update;
data = void 0;
update = function() {
if (scope.currentPage === void 0) {
scope.currentPage = 1;
}
if (scope.numData !== data['odata.count'] && scope.numData) {
scope.currentPage = 1;
}
scope.numData = data['odata.count'];
scope.numPages = Math.ceil(scope.numData / 10);
element.context.innerHTML = '<pagination on-select-page="setPage(page)" num-pages="numPages" current-page="currentPage" max-size="10" boundary-links="true" rotate="false"></pagination>';
if (scope.currentPage < scope.numPages) {
element.context.innerHTML += '<div>{{(currentPage-1)*10+1}} - {{currentPage*10}} of {{numData}}</div>';
} else {
element.context.innerHTML += '<div>{{(currentPage-1)*10+1}} - {{numData}} of {{numData}}</div>';
}
if (scope.numData === '0') {
element.context.innerHTML = '';
}
return $compile(element.contents())(scope);
myDirectives.directive("odataPager", [
'$compile', function($compile) {
return function(scope, element, attrs) {
var data, update;
data = void 0;
update = function() {
if (scope.currentPage === void 0) {
scope.currentPage = 1;
}
if (scope.numData !== data['odata.count'] && scope.numData) {
scope.currentPage = 1;
}
scope.numData = data['odata.count'];
scope.numPages = Math.ceil(scope.numData / 10);
element.context.innerHTML = '<pagination on-select-page="setPage(page)" num-pages="numPages" current-page="currentPage" max-size="10" boundary-links="true" rotate="false"></pagination>';
if (scope.currentPage < scope.numPages) {
element.context.innerHTML += '<div>{{(currentPage-1)*10+1}} - {{currentPage*10}} of {{numData}}</div>';
} else {
element.context.innerHTML += '<div>{{(currentPage-1)*10+1}} - {{numData}} of {{numData}}</div>';
}
if (scope.numData === '0') {
element.context.innerHTML = '';
}
return $compile(element.contents())(scope);
};
return scope.$watch(attrs.odataPager, function(value) {
data = value;
if (data === null || data === void 0) {
return;
}
return update();
});
};
return scope.$watch(attrs.odataPager, function(value) {
data = value;
if (data === null || data === void 0) {
return;
}
return update();
});
};
});
}
]);

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

Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@
]


myDirectives.directive "dynamicUpload", ($compile)->
myDirectives.directive "dynamicUpload", ['$compile',($compile)->
(scope, element, attrs) ->
update =(value) ->
element.context.innerHTML="<input type='file' name='file' data-url='fileupload/upload/#{value}' upload />"
$compile(element.contents())(scope)

scope.$watch attrs.dynamicUpload, (value) ->
update('1')
]


angular.module("FileUpload",[])
.factory "uploadManager", ($rootScope) ->
.factory "uploadManager", ["$rootScope",($rootScope) ->
_files = []
add: (file) ->
_files.push file
Expand Down Expand Up @@ -54,4 +55,5 @@ angular.module("FileUpload",[])
$rootScope.$broadcast "uploadProgress", percentage

setFileStatus: (data) ->
$rootScope.$broadcast "fileUploaded", data
$rootScope.$broadcast "fileUploaded", data
]
Loading

0 comments on commit da8d9b0

Please sign in to comment.