modifyHead.js
1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* [个人中心]个人设置-编辑头像中flash相关操作
* @author: jiangmin
* @date: 2016/07/14
*/
/**
* 设置flash样式,并返回html
* @param id
* @param width
* @param height
* @param url
* @returns {string}
*/
function swfobject(id, width, height, url) {
var _html = '<object id="' + id + '" width="' + width + '" height="' + height + '" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">' +
'<param value="' + url + '" name="movie"> ' +
'<param value="high" name="quality"> ' +
'<param value="#E0E0E0" name="bgcolor"> ' +
'<param name="allowFullScreen" value="true"> ' +
'<param value="always" name="allowScriptAccess"> ' +
'<param value="transparent" name="wmode"> ' +
'<embed width="' + width + '" height="' + height + '" name="' + id + '" align="middle" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" loop="false" play="true" bgcolor="#E0E0E0" quality="high" wmode="transparent" name="vMessage" src="' + url + '"> ' +
'</object>';
return _html;
}
function getFlashMovieObject(movieName) {
if (window.document[movieName]) {
return window.document[movieName];
}
if (navigator.appName.indexOf('Microsoft Internet') === -1) {
if (document.embeds && document.embeds[movieName]) {
return document.embeds[movieName];
}
} else { // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
return document.getElementById(movieName);
}
}
/**
* 上传图片,点击确定时调用
*/
function uploadImage() {
var viFlash = getFlashMovieObject('head');
viFlash.upload_image();
}
module.exports = {
swfobject: swfobject,
uploadImage: uploadImage
};