1
This commit is contained in:
@@ -502,12 +502,36 @@
|
||||
document.body.removeChild(form);
|
||||
},report: function () {
|
||||
var imgSrc = this.$image[0].currentSrc;
|
||||
var objectId = imgSrc.substring(imgSrc.lastIndexOf("/")+1, imgSrc.lastIndexOf("."));
|
||||
var objectId = this.getPathObjectId(imgSrc);
|
||||
var params = new Array();
|
||||
params.push({'name':'type', 'value':'image'});
|
||||
params.push({'name':'sourceIdstr', 'value': jQuery.md5(objectId)});
|
||||
params.push({'name':'sourceContent', 'value': encodeURIComponent(JSON.stringify({'image':imgSrc}))});
|
||||
this.formutils('https://groupweb.chaoxing.com/pc/report/reportIndex', params, '_blank');
|
||||
}, getPathObjectId: function (path) {
|
||||
if (!path || path.length === 0) {
|
||||
return "";
|
||||
}
|
||||
var arr = path.split("/");
|
||||
if (arr.length < 1) {
|
||||
return "";
|
||||
}
|
||||
var objectId;
|
||||
if (path.indexOf("star4") > -1 && arr.length > 1) {
|
||||
objectId = arr[arr.length - 2];
|
||||
} else {
|
||||
objectId = arr[arr.length - 1];
|
||||
if (objectId.indexOf(".") > -1) {
|
||||
objectId = objectId.split(".")[0];
|
||||
}
|
||||
}
|
||||
if (this.isValidObjectId(objectId)) {
|
||||
return objectId;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}, isValidObjectId: function (objectId) {
|
||||
return typeof objectId != 'undefined' && (objectId.length === 32 || objectId.length === 24);
|
||||
}
|
||||
}, u.DEFAULTS = {
|
||||
inline: !1,
|
||||
|
||||
Reference in New Issue
Block a user