Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

This commit is contained in:
cxt 2016-04-21 11:30:07 +08:00
commit e6916f356a
4 changed files with 34 additions and 3 deletions

View File

@ -13,7 +13,13 @@
</head>
<body>
<div ng-view></div>
<div ng-view>
<div class="loading-modal loading-bg" ng-if="loading">
<div class="loading-box">
<img src="/images/wechat/loading.gif" alt=""/><span>加载中...</span>
</div>
</div>
</div>
<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.js"></script>

BIN
public/images/wechat/loading.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -394,11 +394,12 @@ app.directive('textAutoHeight', function($timeout){
});
}
}, false);
}
}
});
app.config(['$routeProvider',function ($routeProvider) {
app.config(['$routeProvider',"$httpProvider",function ($routeProvider, $httpProvider) {
$routeProvider
.when('/activities', {
templateUrl: 'activities.html',
@ -435,4 +436,22 @@ app.config(['$routeProvider',function ($routeProvider) {
.otherwise({
redirectTo: '/activities'
});
$httpProvider.interceptors.push('timestampMarker');
}]);
//loading
app.factory('timestampMarker', ["$rootScope", function ($rootScope) {
var timestampMarker = {
request: function (config) {
$rootScope.loading = true;
config.requestTimestamp = new Date().getTime();
return config;
},
response: function (response) {
// $rootScope.loading = false;
response.config.responseTimestamp = new Date().getTime();
return response;
}
};
return timestampMarker;
}]);

View File

@ -70,4 +70,10 @@ a.underline {text-decoration:underline;}
.post-reply-submit {font-size:13px; padding:3px 8px; color:#fff; background-color:#269ac9; outline:none; border:none; display:inline-block;}
.reply-icon {background:url(/images/wechat/wechat_icon.png) -100px 1px no-repeat; width:20px; height:18px; display:inline-block; vertical-align:middle;}
.praise-icon {background:url(/images/wechat/wechat_icon.png) -100px -38px no-repeat; width:20px; height:18px; display:inline-block; vertical-align:middle;}
.praised-icon {background:url(/images/wechat/wechat_icon.png) -100px -76px no-repeat; width:20px; height:18px; display:inline-block; vertical-align:middle;}
.praised-icon {background:url(/images/wechat/wechat_icon.png) -100px -76px no-repeat; width:20px; height:18px; display:inline-block; vertical-align:middle;}
/* loading 弹框*/
.loading-bg {position:fixed; width:100%; height:100%; left:0; top:0; z-index:99; background:rgba(206, 206, 206, 0.3); overflow:hidden;}
.loading-box {position:absolute; top:50%; background:white; width:160px; height:72px; left:50%; margin-top:-36px; margin-left:-80px; text-align:center;}
.loading-box img {margin-top: 3px; text-align: center;}
.loading-box span {display: block;}