|
@@ -65,10 +65,16 @@
|
|
|
var g = (/\[image\-src=\"([\w\W]+?)\"\]/i).exec(content);
|
|
|
while (g !== null) {
|
|
|
content = content.replace(g[0], function() {
|
|
|
- var html = '<a href="local://' + scope.appContent.directory.received + g[1] + '.JPG' + '" target="_blank" class="thumbnail"' + '>' +
|
|
|
- '<img style="max-width:270px;max-height:250px;" src="local://' + scope.appContent.directory.received + g[1] + '.JPG' + '" alt="" >' +
|
|
|
+ scope.imgWidth = 715;
|
|
|
+ scope.imgHeight = 395;
|
|
|
+ var html = '<a class="thumbnail"' + '>' +
|
|
|
+ '<img 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] + '.png' + '" onError= "this.src = \'../img/loading.gif\'" alt="截图缩略图" >' +
|
|
|
'</a>';
|
|
|
- loadImg("local://" + scope.appContent.directory.received + g[1] + ".JPG", addImg);
|
|
|
+ // '<div class="bigImg">' +
|
|
|
+ // '<img ng-click="hover = false" ng-show="hover" src="local://' + scope.appContent.directory.received + g[1] + '.JPG' + '" alt="" >' +
|
|
|
+ // '</div>';
|
|
|
+
|
|
|
+ loadImg("local://" + scope.appContent.directory.received + g[1] + ".png", addImg, error);
|
|
|
|
|
|
function loadImg(url, callback) {
|
|
|
var img = new Image();
|
|
@@ -76,12 +82,25 @@
|
|
|
img.onload = null;
|
|
|
callback(img);
|
|
|
}
|
|
|
+ img.onerror = function() {
|
|
|
+ //alert("error!");
|
|
|
+ img.onerror = null;
|
|
|
+ error(img);
|
|
|
+ }
|
|
|
img.src = url;
|
|
|
- //img.attr("defaulturl", "../images/img.png");
|
|
|
+ angular.element("img").attr("defaulturl", "../img/loading.jpg");
|
|
|
+ }
|
|
|
+
|
|
|
+ function error(img) {
|
|
|
+ gotoBottom();
|
|
|
}
|
|
|
|
|
|
function addImg(img) {
|
|
|
//$(img).appendTo($(".image"));
|
|
|
+ scope.imgWidth = img.width;
|
|
|
+ scope.imgHeight = img.height;
|
|
|
+ console.log(scope.imgHeight);
|
|
|
+ console.log(scope.imgWidth);
|
|
|
gotoBottom();
|
|
|
}
|
|
|
return html;
|
|
@@ -231,5 +250,11 @@
|
|
|
return lxtalkClient.Invoke('{15180DEF-D508-45F7-BAEB-6486CD8752C8}', 'OpenDirectory', JSON.stringify(file), $scope);
|
|
|
|
|
|
};
|
|
|
+ // $scope.showBigImg = function(str) {
|
|
|
+ // str = "local://E:\ZWT\Users\002682BECE10-kehu01\ReceivedFaces\55d8b2073fb83e2450eff0fccbb85ab4.JPG";
|
|
|
+ // console.log(str);
|
|
|
+ // var newwin = window.open();
|
|
|
+ // newwin.document.write("<img src=" + str + " />");
|
|
|
+ // }
|
|
|
}
|
|
|
})();
|