Browse Source

修改图片

dgf 8 years ago
parent
commit
da7bc86723

+ 6 - 4
talkview/src/js/directive/currentmessage.js

@@ -68,8 +68,8 @@
                         scope.imgWidth = 715;
                         scope.imgHeight = 395;
                         var html = '<a class="thumbnail"' + '>' +
-                            // '<img img-load="gotoBottom(item)" img-error="errorImg()" onclick="javascript:window.open(this.src,\'\',\'height=' + scope.imgHeight + ',width=' + scope.imgWidth + ',top=200,left=200,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no\')" style="max-width:270px;max-height:250px;" src="local://' + scope.appContent.directory.received + g[1] + '.JPG' + '" onError= "this.src = \'../img/loading.gif\'" alt="截图缩略图" >' +
-                            '<img ng-click="gotoBottom()" onclick="javascript:window.open(this.src,\'\',\'height=600,width=800,top=200,left=200\')" class="lazy" style="max-width:270px;max-height:250px;" src="../img/loading.gif" data-original="local://' + scope.appContent.directory.received + g[1] + '.JPG' + '" alt="截图缩略图" >' +
+                            // '<img img-load="gotoBottom()" img-error="errorImg()" onclick="javascript:window.open(this.src,\'\',\'height=' + scope.imgHeight + ',width=' + scope.imgWidth + ',top=200,left=200\')" style="max-width:270px;max-height:250px;" src="local://' + scope.appContent.directory.received + g[1] + '.JPG' + '" onError= "this.src = \'../img/loading.gif\'" alt="截图缩略图" >' +
+                            '<img ng-load="gotoBottom()" ng-error="gotoBottom()" onclick="javascript:window.open(this.src,\'\',\'height=600,width=800,top=200,left=200\')" class="lazy" style="max-width:300px;max-height:250px;" src="../img/loading.gif" data-original="local://' + scope.appContent.directory.received + g[1] + '.JPG' + '" alt="截图缩略图" >' +
                             '</a>';
                         // '<div class="bigImg">' +
                         // '<img ng-click="hover = false" ng-show="hover" src="local://' + scope.appContent.directory.received + g[1] + '.JPG' + '" alt="" >' +
@@ -236,7 +236,7 @@
         }
     };
     /* @ngInject */
-    function ControllerController($scope, $timeout) {
+    function ControllerController($scope, $timeout, $location, $anchorScroll) {
         $scope.OpenFile = function(item) {
             var file = JSON.parse(item);
             return lxtalkClient.Invoke('{15180DEF-D508-45F7-BAEB-6486CD8752C8}', 'OpenFile', JSON.stringify(file), $scope);
@@ -249,7 +249,9 @@
         };
         $scope.gotoBottom = function() {
             console.log("11111111111111");
-            $scope.$apply();
+            // $scope.$apply();
+            $location.hash("bottom");
+            $anchorScroll();
         };
     }
 })();

+ 1 - 1
talkview/src/js/directive/historymessages.js

@@ -72,7 +72,7 @@
                     content = content.replace(g[0],
                         '<a class="thumbnail"' + '>' +
                         // '<img onclick="javascript:window.open(this.src,\'\',\'height=600,width=800,top=200,left=200\')" class="lazy" style="max-width:270px;max-height:250px;" src="../img/loading.gif" data-original="local://' + scope.appContent.directory.received + g[1] + '.JPG' + '" alt="截图缩略图" >' +
-                        '<img onclick="javascript:window.open(this.src,\'\',\'height=600,width=800,top=200,left=200,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no\')" style="max-width:270px;max-height:250px;" src="local://' + scope.appContent.directory.received + g[1] + '.JPG' + '" alt="截图缩略图" >' +
+                        '<img onclick="javascript:window.open(this.src,\'\',\'height=600,width=800,top=200,left=200,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no\')" style="max-width:300px;max-height:250px;" src="local://' + scope.appContent.directory.received + g[1] + '.JPG' + '" alt="截图缩略图" >' +
                         '</a>'
                     );
                     g = (/\[image\-src=\"([\w\W]+?)\"\]/i).exec(content);

+ 53 - 53
talkview/src/js/directive/image.js

@@ -1,60 +1,60 @@
-(function() {
-    angular
-        .module('appMessage')
-        .directive('imgLoad', imgLoad);
-    imgLoad.inject = ['$parse', '$rootScope'];
+// (function() {
+//     angular
+//         .module('appMessage')
+//         .directive('imgLoad', imgLoad);
+//     imgLoad.inject = ['$parse', '$rootScope'];
 
-    function imgLoad($parse, $rootScope) {
-        var directive = {
-            compile: compile,
-            restrict: 'A'
-        };
-        return directive;
+//     function imgLoad($parse, $rootScope) {
+//         var directive = {
+//             compile: compile,
+//             restrict: 'A'
+//         };
+//         return directive;
 
-        function compile($element, attr) {
-            var fn = $parse(attr['img-load'], null, true);
-            return function ngEventHandler(scope, element) {
-                element.on('load', function(event) {
-                    var callback = function() {
-                        console.log('sssssssss');
-                        fn(scope, {
-                            $event: event
-                        });
-                    };
-                    scope.$apply(callback);
-                });
-            };
-        }
-    }
-})();
+//         function compile($element, attr) {
+//             var fn = $parse(attr['img-load'], null, true);
+//             return function ngEventHandler(scope, element) {
+//                 element.on('load', function(event) {
+//                     var callback = function() {
+//                         console.log('sssssssss');
+//                         fn(scope, {
+//                             $event: event
+//                         });
+//                     };
+//                     scope.$apply(callback);
+//                 });
+//             };
+//         }
+//     }
+// })();
 
 
-(function() {
-    angular
-        .module('appMessage')
-        .directive('imgError', imgError);
+// (function() {
+//     angular
+//         .module('appMessage')
+//         .directive('imgError', imgError);
 
-    imgError.inject = ['$parse', '$rootScope'];
+//     imgError.inject = ['$parse', '$rootScope'];
 
-    function imgError($parse, $rootScope) {
-        var directive = {
-            compile: compile,
-            restrict: 'A'
-        };
-        return directive;
+//     function imgError($parse, $rootScope) {
+//         var directive = {
+//             compile: compile,
+//             restrict: 'A'
+//         };
+//         return directive;
 
-        function compile($element, attr) {
-            var fn = $parse(attr['img-error'], null, true);
-            return function ngEventHandler(scope, element) {
-                element.on('error', function(event) {
-                    var callback = function() {
-                        fn(scope, {
-                            $event: event
-                        });
-                    };
-                    scope.$apply(callback);
-                });
-            };
-        }
-    }
-})();
+//         function compile($element, attr) {
+//             var fn = $parse(attr['img-error'], null, true);
+//             return function ngEventHandler(scope, element) {
+//                 element.on('error', function(event) {
+//                     var callback = function() {
+//                         fn(scope, {
+//                             $event: event
+//                         });
+//                     };
+//                     scope.$apply(callback);
+//                 });
+//             };
+//         }
+//     }
+// })();

+ 1 - 1
talkview/src/less/app.main.less

@@ -124,7 +124,7 @@
     .thumbnail {
         margin-top: 5px;
         margin-bottom: 5px;
-        max-width: 300px;
+        max-width: 360px;
         max-height: 300px;
     }
     .bigImg{

+ 1 - 1
talkview/src/templates/messages.html

@@ -1,4 +1,4 @@
-<div class="full-client" ng-click="scrollShow()" ng-cloak>
+<div class="full-client" ng-mouseover="scrollShow()" ng-cloak>
     <div id="getMore"><a role="button"><small ng-click="getMore()">加载更多消息</small></a></div>
     <div class="feed-activity-list p-l-xs p-t-xs p-r-xs" id="loadmore" ng-repeat="item in historymessages track by $index" ng-history-msg="item" ng-app-content="appContent" ng-count="count">
         <!--<div class="feed-element" ng-repeat="item in historymessages track by $index">