2023-03-03 合同打印修改,在线编辑文档控件增加
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
@@ -0,0 +1,116 @@
|
||||
var datatochildcmd = "";
|
||||
var ntko;//控件对象
|
||||
var savecode = "save.aspx";//保存文档程序程序
|
||||
document.write("<script src='ntkoofficecontrol.min.js'></script>")
|
||||
window.onbeforeunload = function (e) {
|
||||
/*ntkocloseparentpage();*/
|
||||
}
|
||||
function getQueryString(name) {
|
||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) return unescape(r[2]);
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
function openhtml(url) {
|
||||
intializePage();
|
||||
ntko = document.getElementById("TANGER_OCX");
|
||||
if (window.navigator.platform == "Win32") {
|
||||
ntko.AddDocTypePlugin(".pdf", "PDF.NtkoDocument", "4.0.1.0", "officecontrol/ntkooledocall.cab", 51, true);
|
||||
}
|
||||
if (window.navigator.platform == "Win64") {
|
||||
ntko.AddDocTypePlugin(".pdf", "PDF.NtkoDocument", "4.0.1.0", "officecontrol/ntkooledocallx64.cab", 51, true);
|
||||
}
|
||||
if (url != '') {
|
||||
|
||||
ntko.OpenFromURL(url);
|
||||
|
||||
}
|
||||
/*if (cmd == 1) {
|
||||
ntko.OpenFromURL("ntkocreatnew.docx");
|
||||
}
|
||||
else {
|
||||
ntko.OpenFromURL("aboutus.docx");
|
||||
}*/
|
||||
}
|
||||
//保存office文档
|
||||
function saveFileToUrl(url) {
|
||||
var fileName = url;
|
||||
|
||||
/* if (fileName.length == 0) { alert("请输入文件标题!"); document.all("filetitle").focus(); return false; }//判断文件标题输入域
|
||||
var result, filedot;
|
||||
if (IsFileOpened) {
|
||||
switch (ntko.doctype) {
|
||||
case 1:
|
||||
fileType = "Word.Document";
|
||||
filedot = ".doc";
|
||||
break;
|
||||
case 2:
|
||||
fileType = "Excel.Sheet";
|
||||
filedot = ".xls";
|
||||
break;
|
||||
case 3:
|
||||
fileType = "PowerPoint.Show";
|
||||
filedot = ".ppt";
|
||||
break;
|
||||
case 4:
|
||||
fileType = "Visio.Drawing";
|
||||
filedot = ".vso"
|
||||
break;
|
||||
case 5:
|
||||
fileType = "MSProject.Project";
|
||||
filedot = ".pro";
|
||||
break;
|
||||
case 6:
|
||||
fileType = "WPS Doc";
|
||||
filedot = ".wps";
|
||||
break;
|
||||
case 7:
|
||||
fileType = "Kingsoft Sheet";
|
||||
filedot = ".et";
|
||||
break;
|
||||
default:
|
||||
fileType = "unkownfiletype";
|
||||
filedot = ".doc";
|
||||
}*/
|
||||
retHTML = ntko.saveToURL("save.aspx",//提交到的url地址
|
||||
"EDITFILE",//文件域的id,类似<input type=file id=upLoadFile 中的id
|
||||
"savetype=1&fileType=Word.Document", //与控件一起提交的参数,savetype参数为要保存的文件格式office,html,pdf。filetype参数保存文件类型
|
||||
fileName, //上传文件的名称,类似<input type=file 的value
|
||||
0 //与控件一起提交的表单id,也可以是form的序列号,这里应该是0.
|
||||
);
|
||||
switch (ntko.StatusCode) {
|
||||
case 0:
|
||||
alert("文件保存成功");
|
||||
ntko.ActiveDocument.Saved = true;
|
||||
window.opener.location.reload();
|
||||
var indexa = retHTML.indexOf("ID:");
|
||||
var indexb = retHTML.indexOf("</br>");
|
||||
var locationhref = retHTML.substring(indexa + 3, indexb);
|
||||
window.location.href = editMScode + "?&url=" + locationhref;
|
||||
break;
|
||||
case 1:
|
||||
erropen(retHTML);
|
||||
break;
|
||||
case 2:
|
||||
erropen(retHTML);
|
||||
break;
|
||||
case 3:
|
||||
erropen(retHTML);
|
||||
break;
|
||||
case 4:
|
||||
erropen(retHTML);
|
||||
break;
|
||||
case 5:
|
||||
erropen(retHTML);
|
||||
break;
|
||||
case 6:
|
||||
erropen(retHTML);
|
||||
break;
|
||||
case 100:
|
||||
erropen(retHTML);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,729 @@
|
||||
var ntko;//控件对象
|
||||
var savecode = "save.aspx";//保存文档程序程序
|
||||
window.onbeforeunload=function(e){
|
||||
ntkocloseparentpage();
|
||||
}
|
||||
|
||||
|
||||
//初始化去打开文档
|
||||
function init(cmd) {
|
||||
intializePage();
|
||||
ntko = document.getElementById("TANGER_OCX");
|
||||
if(window.navigator.platform=="Win32"){
|
||||
ntko.AddDocTypePlugin(".pdf","PDF.NtkoDocument","4.0.1.0","officecontrol/ntkooledocall.cab",51,true);
|
||||
}
|
||||
if(window.navigator.platform=="Win64"){
|
||||
ntko.AddDocTypePlugin(".pdf","PDF.NtkoDocument","4.0.1.0","officecontrol/ntkooledocallx64.cab",51,true);
|
||||
}
|
||||
if (cmd != "") {
|
||||
alert(cmd);
|
||||
ntko.OpenFromURL(cmd);
|
||||
}
|
||||
/*if (cmd == 1)
|
||||
{
|
||||
ntko.OpenFromURL("ntkocreatnew.docx");
|
||||
}
|
||||
else
|
||||
{
|
||||
ntko.OpenFromURL("aboutus.docx");
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
//以下变量为JS公共变量
|
||||
var TANGER_OCX_bDocOpen = false;
|
||||
var TANGER_OCX_filename;//文件名称
|
||||
var filetype;//文件类型
|
||||
var savetype;//文件保存类型
|
||||
var TANGER_OCX_actionURL; //For auto generate form fiields
|
||||
var TANGER_OCX_OBJ; //控件对象
|
||||
var TANGER_OCX_Username = "匿名用户";//User Name
|
||||
var TANGER_OCX_key = "";//设置加载印章的key
|
||||
var IsFileOpened; //控件是否打开文档
|
||||
var svisble = true;//印章显示状态
|
||||
var url = "";//初始化URL值
|
||||
var newwin, newdoc;
|
||||
|
||||
//创建新的文档
|
||||
function CreatNew(newofficetype) {
|
||||
//根据传递文档类型参数新建文档
|
||||
switch (newofficetype) {
|
||||
case "1":
|
||||
openoffice(url, newofficetype)
|
||||
break
|
||||
case "2":
|
||||
openoffice(url, newofficetype)
|
||||
break
|
||||
case "3":
|
||||
openoffice(url, newofficetype)
|
||||
break
|
||||
case "4":
|
||||
openoffice(url, newofficetype)
|
||||
break
|
||||
case "5":
|
||||
openoffice(url, newofficetype)
|
||||
break
|
||||
default:
|
||||
openoffice(url, "1")
|
||||
break;
|
||||
}
|
||||
}
|
||||
function openoffice(url, newofficetype) {
|
||||
window.open(editMScode + "?newofficetype=" + newofficetype + "&url=" + url, "editoffice", "top=0,left=0,scrollbars=yes,resizable=yes");
|
||||
}
|
||||
//当前表单不可编辑,当整个表单只读时调用
|
||||
function FormDisabled(bool) {
|
||||
var formid = document.forms.item(0)
|
||||
var elelength = formid.length;
|
||||
for (var i = 0; i < elelength; i++) { formid.elements[i].disabled = bool; }
|
||||
//下面是控件标题栏,状态栏,工具栏,菜单栏不显示
|
||||
TANGER_OCX_OBJ.TitleBar = !bool;
|
||||
TANGER_OCX_OBJ.Statusbar = !bool;
|
||||
TANGER_OCX_OBJ.ToolBars = !bool;
|
||||
TANGER_OCX_OBJ.Menubar = !bool;
|
||||
document.getElementById("editmain_left").style.display = "none";
|
||||
document.getElementById("editmain_right").style.width = "95%";
|
||||
}
|
||||
//示例程序帮助文档
|
||||
function NtkoHelp() {
|
||||
window.open("help.htm", "help");
|
||||
}
|
||||
//编辑文档
|
||||
function editoffice(url, newofficetype) {
|
||||
TANGER_OCX_OBJ = document.all.item("TANGER_OCX");//;初始化控件对象
|
||||
//根据文档URL和newofficetype编辑文档,如果有url是编辑已有文档,如果为空根据newofficetype新建文档
|
||||
if ((typeof (url) != "undefined") && (url != "")) {
|
||||
var filename = document.all("filename").value;
|
||||
// alert(filename);
|
||||
try { TANGER_OCX_OBJ.BeginOpenFromURL("uploadOfficeFile/" + filename); } catch (err) { };
|
||||
}
|
||||
else {
|
||||
switch (newofficetype) {
|
||||
//新建文档
|
||||
case "1":
|
||||
TANGER_OCX_OBJ.CreateNew("word.document");//word文档
|
||||
break
|
||||
case "2":
|
||||
TANGER_OCX_OBJ.CreateNew("excel.sheet");//excel电子表格
|
||||
break
|
||||
case "3":
|
||||
TANGER_OCX_OBJ.CreateNew("PowerPoint.Show");//微软幻灯片
|
||||
break
|
||||
case "4":
|
||||
TANGER_OCX_OBJ.CreateNew("WPS.Document");//金山文档
|
||||
break
|
||||
case "5":
|
||||
TANGER_OCX_OBJ.CreateNew("ET.WorkBook");//金山电子表格
|
||||
break
|
||||
default:
|
||||
alert("文档编辑出错!")
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
function intializePage() {
|
||||
TANGER_OCX_OBJ = document.getElementById("TANGER_OCX");
|
||||
}
|
||||
//文档编辑页面关闭事件
|
||||
function onPageClose() {
|
||||
if (IsFileOpened) {
|
||||
if (!TANGER_OCX_OBJ.ActiveDocument.Saved) {
|
||||
if (confirm("文档修改过,还没有保存,是否需要保存?")) {
|
||||
saveFileToUrl();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
function TANGER_OCX_OpenDoc(fileUrl) {
|
||||
if (fileUrl != null || fileUrl != "") {
|
||||
TANGER_OCX_OBJ.BeginOpenFromURL(fileUrl);
|
||||
}
|
||||
else {
|
||||
alert("dd");
|
||||
TANGER_OCX_OBJ.BegingOpenFromURL("templateFile/newWordTemplate.doc")
|
||||
}
|
||||
}
|
||||
//设置文件是打开还是关闭
|
||||
function setFileOpenedOrClosed(bool) {
|
||||
IsFileOpened = bool;
|
||||
//fileType = TANGER_OCX_OBJ.DocType;
|
||||
}
|
||||
function trim(str) { //删除左右两端的空格
|
||||
return str.replace(/(^\s*)|(\s*$)/g, "");
|
||||
}
|
||||
function erropen(retHTML) {
|
||||
newwin = window.open("", "_blank", "left=200,top=200,width=400,height=300,status=0,toolbar=0,menubar=0,location=0,scrollbars=1,resizable=1", false);
|
||||
newdoc = newwin.document;
|
||||
newdoc.open();
|
||||
newdoc.write("<html><head><title>返回的数据</title></head><body><center><hr>")
|
||||
newdoc.write(retHTML + "kdkd<hr>");
|
||||
newdoc.write("<input type=button VALUE='关闭窗口' onclick='window.close();'>");
|
||||
newdoc.write('</center></body></html>');
|
||||
newdoc.close();
|
||||
}
|
||||
//保存office文档
|
||||
function saveFileToUrl() {
|
||||
var fileName ="ntkocreatnew.docx"
|
||||
/*
|
||||
if (fileName.length == 0) { alert("请输入文件标题!"); document.all("filetitle").focus(); return false; }//判断文件标题输入域
|
||||
var result, filedot;
|
||||
if (IsFileOpened) {
|
||||
switch (ntko.doctype) {
|
||||
case 1:
|
||||
fileType = "Word.Document";
|
||||
filedot = ".doc";
|
||||
break;
|
||||
case 2:
|
||||
fileType = "Excel.Sheet";
|
||||
filedot = ".xls";
|
||||
break;
|
||||
case 3:
|
||||
fileType = "PowerPoint.Show";
|
||||
filedot = ".ppt";
|
||||
break;
|
||||
case 4:
|
||||
fileType = "Visio.Drawing";
|
||||
filedot = ".vso"
|
||||
break;
|
||||
case 5:
|
||||
fileType = "MSProject.Project";
|
||||
filedot = ".pro";
|
||||
break;
|
||||
case 6:
|
||||
fileType = "WPS Doc";
|
||||
filedot = ".wps";
|
||||
break;
|
||||
case 7:
|
||||
fileType = "Kingsoft Sheet";
|
||||
filedot = ".et";
|
||||
break;
|
||||
default:
|
||||
fileType = "unkownfiletype";
|
||||
filedot = ".doc";
|
||||
}*/
|
||||
retHTML = ntko.saveToURL("save.aspx",//提交到的url地址
|
||||
"EDITFILE",//文件域的id,类似<input type=file id=upLoadFile 中的id
|
||||
"savetype=1&fileType=Word.Document", //与控件一起提交的参数,savetype参数为要保存的文件格式office,html,pdf。filetype参数保存文件类型
|
||||
"aboutus.docx", //上传文件的名称,类似<input type=file 的value
|
||||
0 //与控件一起提交的表单id,也可以是form的序列号,这里应该是0.
|
||||
);
|
||||
/*switch (ntko.StatusCode) {
|
||||
case 0:
|
||||
alert("文件保存成功");
|
||||
ntko.ActiveDocument.Saved = true;
|
||||
window.opener.location.reload();
|
||||
var indexa = retHTML.indexOf("ID:");
|
||||
var indexb = retHTML.indexOf("</br>");
|
||||
var locationhref = retHTML.substring(indexa + 3, indexb);
|
||||
window.location.href = editMScode + "?&url=" + locationhref;
|
||||
break;
|
||||
case 1:
|
||||
erropen(retHTML);
|
||||
break;
|
||||
case 2:
|
||||
erropen(retHTML);
|
||||
break;
|
||||
case 3:
|
||||
erropen(retHTML);
|
||||
break;
|
||||
case 4:
|
||||
erropen(retHTML);
|
||||
break;
|
||||
case 5:
|
||||
erropen(retHTML);
|
||||
break;
|
||||
case 6:
|
||||
erropen(retHTML);
|
||||
break;
|
||||
case 100:
|
||||
erropen(retHTML);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert("不能执行保存,没有编辑文档!");
|
||||
}*/
|
||||
}
|
||||
//保存office文档1
|
||||
function saveFileToUrl1() {
|
||||
var fileName = "aboutus.docx";
|
||||
alert(fileName);
|
||||
if (fileName.length == 0) { alert("请输入文件标题!"); return false; } //判断文件标题输入域
|
||||
var result,
|
||||
retHTML = ntko.saveToURL(savecode, //提交到的url地址
|
||||
"EDITFILE", //文件域的id,类似<input type=file id=upLoadFile 中的id
|
||||
"savetype=1&fileType=doc", //与控件一起提交的参数,savetype参数为要保存的文件格式office,html,pdf。filetype参数保存文件类型
|
||||
fileName, //上传文件的名称,类似<input type=file 的value
|
||||
0 //与控件一起提交的表单id,也可以是form的序列号,这里应该是0.
|
||||
);
|
||||
alert(retHTML);
|
||||
newwin = window.open("", "_blank", "left=200,top=200,width=400,height=300,status=0,toolbar=0,menubar=0,location=0,scrollbars=1,resizable=1", false);
|
||||
newdoc = newwin.document;
|
||||
newdoc.open();
|
||||
newdoc.write("<center><hr>" + retHTML + "<hr><input type=button VALUE='关闭窗口' onclick='window.close();if(window.opener){window.opener.location.reload()};'></center>");
|
||||
newdoc.close();
|
||||
window.opener.focus();
|
||||
}
|
||||
//保存office文档1
|
||||
function saveFileToUrl2() {
|
||||
var fileName = "test.doc";
|
||||
if (fileName.length == 0) { alert("请输入文件标题!"); document.all("filetitle").focus(); return false; } //判断文件标题输入域
|
||||
var result,
|
||||
retHTML = ntko.saveToURL(savecode, //提交到的url地址
|
||||
"EDITFILE", //文件域的id,类似<input type=file id=upLoadFile 中的id
|
||||
"savetype=1&fileType=doc", //与控件一起提交的参数,savetype参数为要保存的文件格式office,html,pdf。filetype参数保存文件类型
|
||||
fileName, //上传文件的名称,类似<input type=file 的value
|
||||
0 //与控件一起提交的表单id,也可以是form的序列号,这里应该是0.
|
||||
);
|
||||
newwin = window.open("", "_blank", "left=200,top=200,width=400,height=300,status=0,toolbar=0,menubar=0,location=0,scrollbars=1,resizable=1", false);
|
||||
newdoc = newwin.document;
|
||||
newdoc.open();
|
||||
newdoc.write("<center><hr>" + retHTML + "<hr><input type=button VALUE='关闭窗口' onclick='window.close();if(window.opener){window.opener.location.reload()};'></center>");
|
||||
newdoc.close();
|
||||
window.opener.focus();
|
||||
}
|
||||
//保存文档为html文件到服务器
|
||||
function saveFileAsHtmlToUrl() {
|
||||
var fileName = trim(document.all("filetitle").value);
|
||||
if (fileName.length == 0) { alert("请输入文件标题!"); document.all("filetitle").focus(); return false; }//判断文件标题输入域
|
||||
var result, filedot;
|
||||
if (IsFileOpened) {
|
||||
switch (TANGER_OCX_OBJ.doctype) {
|
||||
case 1:
|
||||
fileType = "Word.Document";
|
||||
filedot = ".doc";
|
||||
break;
|
||||
case 2:
|
||||
fileType = "Excel.Sheet";
|
||||
filedot = ".xls";
|
||||
break;
|
||||
case 3:
|
||||
fileType = "PowerPoint.Show";
|
||||
filedot = ".ppt";
|
||||
break;
|
||||
case 4:
|
||||
fileType = "Visio.Drawing";
|
||||
filedot = ".vso"
|
||||
break;
|
||||
case 5:
|
||||
fileType = "MSProject.Project";
|
||||
filedot = ".pro";
|
||||
break;
|
||||
case 6:
|
||||
fileType = "WPS Doc";
|
||||
filedot = ".wps";
|
||||
break;
|
||||
case 7:
|
||||
fileType = "Kingsoft Sheet";
|
||||
filedot = ".et";
|
||||
break;
|
||||
default:
|
||||
fileType = "unkownfiletype";
|
||||
filedot = ".doc";
|
||||
}
|
||||
retHTML = TANGER_OCX_OBJ.PublishAsHTMLToURL(savecode,//提交到的url地址
|
||||
"EDITFILE",//文件域的id,类似<input type=file id=upLoadFile 中的id
|
||||
"savetype=2&fileType=" + fileType, //与控件一起提交的参数,savetype参数为要保存的文件格式office,html,pdf。filetype参数保存文件类型
|
||||
fileName, //上传文件的名称,类似<input type=file 的value
|
||||
0 //与控件一起提交的表单id,也可以是form的序列号,这里应该是0.
|
||||
);
|
||||
newwin = window.open("", "_blank", "left=200,top=200,width=400,height=300,status=0,toolbar=0,menubar=0,location=0,scrollbars=1,resizable=1", false);
|
||||
newdoc = newwin.document;
|
||||
newdoc.open();
|
||||
newdoc.write("<center><hr>" + retHTML + "<hr><input type=button VALUE='关闭窗口' onclick='window.close();if(window.opener){window.opener.location.reload()};'></center>");
|
||||
newdoc.close();
|
||||
window.opener.focus();
|
||||
}
|
||||
else {
|
||||
alert("不能执行保存,没有编辑文档!");
|
||||
}
|
||||
}
|
||||
//保护文档为pdf格式
|
||||
function saveFileAsPdfToUrl() {
|
||||
var fileName = trim(document.all("filetitle").value);
|
||||
if (fileName.length == 0) { alert("请输入文件标题!"); document.all("filetitle").focus(); return false; }//判断文件标题输入域
|
||||
var result, filedot;
|
||||
if (IsFileOpened && TANGER_OCX_OBJ.IsPDFCreatorInstalled()) {
|
||||
switch (TANGER_OCX_OBJ.doctype) {
|
||||
case 1:
|
||||
fileType = "Word.Document";
|
||||
filedot = ".doc";
|
||||
break;
|
||||
case 2:
|
||||
fileType = "Excel.Sheet";
|
||||
filedot = ".xls";
|
||||
break;
|
||||
case 3:
|
||||
fileType = "PowerPoint.Show";
|
||||
filedot = ".ppt";
|
||||
break;
|
||||
case 4:
|
||||
fileType = "Visio.Drawing";
|
||||
filedot = ".vso"
|
||||
break;
|
||||
case 5:
|
||||
fileType = "MSProject.Project";
|
||||
filedot = ".pro";
|
||||
break;
|
||||
case 6:
|
||||
fileType = "WPS Doc";
|
||||
filedot = ".wps";
|
||||
break;
|
||||
case 7:
|
||||
fileType = "Kingsoft Sheet";
|
||||
filedot = ".et";
|
||||
break;
|
||||
default:
|
||||
fileType = "unkownfiletype";
|
||||
filedot = ".doc";
|
||||
}
|
||||
TANGER_OCX_OBJ.PublishAsPDFToURL(savecode,//提交到的url地址
|
||||
"EDITFILE",//文件域的id,类似<input type=file id=upLoadFile 中的id
|
||||
"savetype=3&fileType=" + fileType, //与控件一起提交的参数,savetype参数为要保存的文件格式office,html,pdf。filetype参数保存文件类型
|
||||
fileName + filedot, //上传文件的名称,类似<input type=file 的value
|
||||
0, //与控件一起提交的表单id,也可以是form的序列号,这里应该是0.
|
||||
null, //sheetname,保存excel的哪个表格
|
||||
true, //IsShowUI,是否显示保存界面
|
||||
false, // IsShowMsg,是否显示保存成功信息
|
||||
false, // IsUseSecurity,是否使用安全特性
|
||||
null, // OwnerPass,安全密码.可直接传值
|
||||
false,//IsPermitPrint,是否允许打印
|
||||
true //IsPermitCopy,是否允许拷贝
|
||||
);
|
||||
}
|
||||
else {
|
||||
alert("不能执行保存,没有编辑文档或者没有安装PDF虚拟打印机!");
|
||||
}
|
||||
}
|
||||
|
||||
function testFunction() {
|
||||
alert(IsFileOpened);
|
||||
}
|
||||
function addServerSecSign() {
|
||||
var signUrl = document.all("secSignFileUrl").options[document.all("secSignFileUrl").selectedIndex].value;
|
||||
if (IsFileOpened) {
|
||||
if (TANGER_OCX_OBJ.doctype == 1 || TANGER_OCX_OBJ.doctype == 2) {
|
||||
try {
|
||||
alert("正式版本用户请插入EKEY!\r\n\r\n此为电子印章系统演示功能,请购买正式版本!");
|
||||
TANGER_OCX_OBJ.AddSecSignFromURL("ntko", signUrl);
|
||||
}
|
||||
catch (error) { }
|
||||
}
|
||||
else { alert("不能在该类型文档中使用安全签名印章."); }
|
||||
}
|
||||
}
|
||||
function addLocalSecSign() {
|
||||
if (IsFileOpened) {
|
||||
if (TANGER_OCX_OBJ.doctype == 1 || TANGER_OCX_OBJ.doctype == 2) {
|
||||
try { TANGER_OCX_OBJ.AddSecSignFromLocal("ntko", ""); }
|
||||
catch (error) { }
|
||||
}
|
||||
else { alert("不能在该类型文档中使用安全签名印章."); }
|
||||
}
|
||||
}
|
||||
function addEkeySecSign() {
|
||||
if (IsFileOpened) {
|
||||
if (TANGER_OCX_OBJ.doctype == 1 || TANGER_OCX_OBJ.doctype == 2) {
|
||||
try { TANGER_OCX_OBJ.AddSecSignFromEkey("ntko"); }
|
||||
catch (error) { }
|
||||
}
|
||||
else { alert("不能在该类型文档中使用安全签名印章."); }
|
||||
}
|
||||
}
|
||||
function addHandSecSign() {
|
||||
if (IsFileOpened) {
|
||||
if (TANGER_OCX_OBJ.doctype == 1 || TANGER_OCX_OBJ.doctype == 2) {
|
||||
try { TANGER_OCX_OBJ.AddSecHandSign("ntko"); }
|
||||
catch (error) { }
|
||||
}
|
||||
else { alert("不能在该类型文档中使用安全签名印章."); }
|
||||
}
|
||||
}
|
||||
|
||||
function addServerSign(signUrl) {
|
||||
if (IsFileOpened) {
|
||||
try {
|
||||
TANGER_OCX_OBJ.AddSignFromURL("ntko",//印章的用户名
|
||||
signUrl,//印章所在服务器相对url
|
||||
100,//左边距
|
||||
100,//上边距 根据Relative的设定选择不同参照对象
|
||||
"ntko",//调用DoCheckSign函数签名印章信息,用来验证印章的字符串
|
||||
3, //Relative,取值1-4。设置左边距和上边距相对以下对象所在的位置 1:光标位置;2:页边距;3:页面距离 4:默认设置栏,段落
|
||||
100,//缩放印章,默认100%
|
||||
1); //0印章位于文字下方,1位于上方
|
||||
|
||||
}
|
||||
catch (error) { }
|
||||
}
|
||||
}
|
||||
|
||||
function addLocalSign() {
|
||||
if (IsFileOpened) {
|
||||
try {
|
||||
TANGER_OCX_OBJ.AddSignFromLocal("ntko",//印章的用户名
|
||||
"",//缺省文件名
|
||||
true,//是否提示选择
|
||||
100,//左边距
|
||||
100,//上边距 根据Relative的设定选择不同参照对象
|
||||
"ntko",//调用DoCheckSign函数签名印章信息,用来验证印章的字符串
|
||||
3, //Relative,取值1-4。设置左边距和上边距相对以下对象所在的位置 1:光标位置;2:页边距;3:页面距离 4:默认设置栏,段落
|
||||
100,//缩放印章,默认100%
|
||||
1); //0印章位于文字下方,1位于上方
|
||||
}
|
||||
catch (error) { }
|
||||
}
|
||||
}
|
||||
function addPicFromUrl(picURL) {
|
||||
if (IsFileOpened) {
|
||||
if (TANGER_OCX_OBJ.doctype == 1 || TANGER_OCX_OBJ.doctype == 2) {
|
||||
try {
|
||||
TANGER_OCX_OBJ.AddPicFromURL(picURL,//图片的url地址可以时相对或者绝对地址
|
||||
false,//是否浮动,此参数设置为false时,top和left无效
|
||||
100,//left 左边距
|
||||
100,//top 上边距 根据Relative的设定选择不同参照对象
|
||||
1, //Relative,取值1-4。设置左边距和上边距相对以下对象所在的位置 1:光标位置;2:页边距;3:页面距离 4:默认设置栏,段落
|
||||
100,//缩放印章,默认100%
|
||||
1); //0印章位于文字下方,1位于上方
|
||||
|
||||
}
|
||||
catch (error) { }
|
||||
}
|
||||
else { alert("不能在该类型文档中使用安全签名印章."); }
|
||||
}
|
||||
}
|
||||
function addPicFromLocal() {
|
||||
if (IsFileOpened) {
|
||||
try {
|
||||
TANGER_OCX_OBJ.AddPicFromLocal("",//印章的用户名
|
||||
true,//缺省文件名
|
||||
false,//是否提示选择
|
||||
100,//左边距
|
||||
100,//上边距 根据Relative的设定选择不同参照对象
|
||||
1, //Relative,取值1-4。设置左边距和上边距相对以下对象所在的位置 1:光标位置;2:页边距;3:页面距离 4:默认设置栏,段落
|
||||
100,//缩放印章,默认100%
|
||||
1); //0印章位于文字下方,1位于上方
|
||||
}
|
||||
catch (error) { }
|
||||
}
|
||||
}
|
||||
|
||||
function TANGER_OCX_AddDocHeader(strHeader) {
|
||||
if (!IsFileOpened) { return; }
|
||||
var i, cNum = 30;
|
||||
var lineStr = "";
|
||||
try {
|
||||
for (i = 0; i < cNum; i++) lineStr += "_"; //生成下划线
|
||||
with (TANGER_OCX_OBJ.ActiveDocument.Application) {
|
||||
Selection.HomeKey(6, 0); // go home
|
||||
Selection.TypeText(strHeader);
|
||||
Selection.TypeParagraph(); //换行
|
||||
Selection.TypeText(lineStr); //插入下划线
|
||||
// Selection.InsertSymbol(95,"",true); //插入下划线
|
||||
Selection.TypeText("★");
|
||||
Selection.TypeText(lineStr); //插入下划线
|
||||
Selection.TypeParagraph();
|
||||
//Selection.MoveUp(5, 2, 1); //上移两行,且按住Shift键,相当于选择两行
|
||||
Selection.HomeKey(6, 1); //选择到文件头部所有文本
|
||||
Selection.ParagraphFormat.Alignment = 1; //居中对齐
|
||||
with (Selection.Font) {
|
||||
NameFarEast = "宋体";
|
||||
Name = "宋体";
|
||||
Size = 12;
|
||||
Bold = false;
|
||||
Italic = false;
|
||||
Underline = 0;
|
||||
UnderlineColor = 0;
|
||||
StrikeThrough = false;
|
||||
DoubleStrikeThrough = false;
|
||||
Outline = false;
|
||||
Emboss = false;
|
||||
Shadow = false;
|
||||
Hidden = false;
|
||||
SmallCaps = false;
|
||||
AllCaps = false;
|
||||
Color = 255;
|
||||
Engrave = false;
|
||||
Superscript = false;
|
||||
Subscript = false;
|
||||
Spacing = 0;
|
||||
Scaling = 100;
|
||||
Position = 0;
|
||||
Kerning = 0;
|
||||
Animation = 0;
|
||||
DisableCharacterSpaceGrid = false;
|
||||
EmphasisMark = 0;
|
||||
}
|
||||
Selection.MoveDown(5, 3, 0); //下移3行
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
alert("错误:" + err.number + ":" + err.description);
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
|
||||
function insertRedHeadFromUrl(headFileURL) {
|
||||
if (TANGER_OCX_OBJ.doctype != 1)//TANGER_OCX_OBJ.doctype=1为word文档
|
||||
{ return; }
|
||||
TANGER_OCX_OBJ.ActiveDocument.Application.Selection.HomeKey(6, 0);//光标移动到文档开头
|
||||
TANGER_OCX_OBJ.addtemplatefromurl(headFileURL);//在光标位置插入红头文档
|
||||
}
|
||||
function insertRedButtomFromUrl(headFileURL) {
|
||||
if (TANGER_OCX_OBJ.doctype != 1)//TANGER_OCX_OBJ.doctype=1为word文档
|
||||
{ return; }
|
||||
TANGER_OCX_OBJ.ActiveDocument.Application.Selection.EndKey(6, 0);
|
||||
TANGER_OCX_OBJ.ActiveDocument.Application.Selection.TypeParagraph();
|
||||
TANGER_OCX_OBJ.addtemplatefromurl(headFileURL);//在光标位置插入红头文档
|
||||
}
|
||||
function openTemplateFileFromUrl(templateUrl) {
|
||||
TANGER_OCX_OBJ.openFromUrl(templateUrl);
|
||||
}
|
||||
function doHandSign() {
|
||||
/*if(TANGER_OCX_OBJ.doctype==1||TANGER_OCX_OBJ.doctype==2)//此处设置只允许在word和excel中盖章.doctype=1是"word"文档,doctype=2是"excel"文档
|
||||
{*/
|
||||
TANGER_OCX_OBJ.DoHandSign2(
|
||||
"ntko",//手写签名用户名称
|
||||
"ntko",//signkey,DoCheckSign(检查印章函数)需要的验证密钥。
|
||||
0,//left
|
||||
0,//top
|
||||
1,//relative,设定签名位置的参照对象.0:表示按照屏幕位置插入,此时,Left,Top属性不起作用。1:光标位置;2:页边距;3:页面距离 4:默认设置栏,段落(为兼容以前版本默认方式)
|
||||
100);
|
||||
//}
|
||||
}
|
||||
function SetReviewMode(boolvalue) {
|
||||
if (TANGER_OCX_OBJ.doctype == 1) {
|
||||
TANGER_OCX_OBJ.ActiveDocument.TrackRevisions = boolvalue;//设置是否保留痕迹
|
||||
}
|
||||
}
|
||||
|
||||
function setShowRevisions(boolevalue) {
|
||||
if (TANGER_OCX_OBJ.doctype == 1) {
|
||||
TANGER_OCX_OBJ.ActiveDocument.ShowRevisions = boolevalue;//设置是否显示痕迹
|
||||
}
|
||||
}
|
||||
//接受或者取消所有修订
|
||||
function TANGER_OCX_AllRevisions(bool) {
|
||||
if (bool) {
|
||||
TANGER_OCX_OBJ.ActiveDocument.AcceptAllRevisions();//接受所有的痕迹修订
|
||||
}
|
||||
else {
|
||||
TANGER_OCX_OBJ.ActiveDocument.Application.WordBasic.RejectAllChangesInDoc();//拒绝所有的痕迹修订
|
||||
}
|
||||
}
|
||||
function setFilePrint(boolvalue) {
|
||||
TANGER_OCX_OBJ.fileprint = boolvalue;//是否允许打印
|
||||
}
|
||||
function setFileNew(boolvalue) {
|
||||
TANGER_OCX_OBJ.FileNew = boolvalue;//是否允许新建
|
||||
}
|
||||
function setFileSaveAs(boolvalue) {
|
||||
TANGER_OCX_OBJ.FileSaveAs = boolvalue;//是否允许另存为
|
||||
}
|
||||
|
||||
function setIsNoCopy(boolvalue) {
|
||||
TANGER_OCX_OBJ.IsNoCopy = boolvalue;//是否禁止粘贴
|
||||
}
|
||||
function DoCheckSign() {
|
||||
if (IsFileOpened) {
|
||||
var ret = TANGER_OCX_OBJ.DoCheckSign
|
||||
(
|
||||
false,/*可选参数 IsSilent 缺省为FAlSE,表示弹出验证对话框,否则,只是返回验证结果到返回值*/
|
||||
"ntko"//使用盖章时的signkey,这里为"ntko"
|
||||
);//返回值,验证结果字符串
|
||||
//alert(ret);
|
||||
}
|
||||
}
|
||||
function setToolBar() {
|
||||
TANGER_OCX_OBJ.ToolBars = !TANGER_OCX_OBJ.ToolBars;
|
||||
}
|
||||
function setMenubar() {
|
||||
TANGER_OCX_OBJ.Menubar = !TANGER_OCX_OBJ.Menubar;
|
||||
}
|
||||
function setInsertMemu() {
|
||||
TANGER_OCX_OBJ.IsShowInsertMenu = !TANGER_OCX_OBJ.IsShowInsertMenu;
|
||||
}
|
||||
function setEditMenu() {
|
||||
TANGER_OCX_OBJ.IsShowEditMenu = !TANGER_OCX_OBJ.IsShowEditMenu;
|
||||
}
|
||||
function setToolMenu() {
|
||||
TANGER_OCX_OBJ.IsShowToolMenu = !TANGER_OCX_OBJ.IsShowToolMenu;
|
||||
}
|
||||
|
||||
//增加自定义菜单
|
||||
function initCustomMenus1() {
|
||||
var myobj = TANGER_OCX_OBJ;
|
||||
for (var menuPos = 0; menuPos < 1; menuPos++) {
|
||||
myobj.AddCustomMenu2(menuPos, "常用功能" + "(&" + menuPos + ")");
|
||||
for (var submenuPos = 0; submenuPos < 1; submenuPos++) {
|
||||
myobj.AddCustomMenuItem2(menuPos, submenuPos, -1, true, "打印设置", false);
|
||||
//增加子菜单项目
|
||||
for (var subsubmenuPos = 0; subsubmenuPos < 3; subsubmenuPos++) {
|
||||
if (0 == subsubmenuPos)//增加子菜单项目
|
||||
{
|
||||
myobj.AddCustomMenuItem2(menuPos, submenuPos, subsubmenuPos, false,
|
||||
"设置打印区域", false, menuPos * 100 + submenuPos * 20 + subsubmenuPos);
|
||||
}
|
||||
if (1 == subsubmenuPos)//增加子菜单项目
|
||||
{
|
||||
myobj.AddCustomMenuItem2(menuPos, submenuPos, subsubmenuPos, false,
|
||||
"取消打印区域", false, menuPos * 100 + submenuPos * 20 + subsubmenuPos);
|
||||
}
|
||||
if (2 == subsubmenuPos) {
|
||||
myobj.AddCustomMenuItem2(menuPos, submenuPos, subsubmenuPos, false,
|
||||
"手写批注", false, menuPos * 100 + submenuPos * 20 + subsubmenuPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//控件控制
|
||||
function controlStyle() {
|
||||
var myobj = TANGER_OCX_OBJ;
|
||||
for (var menuPos = 0; menuPos < 1; menuPos++) {
|
||||
myobj.AddCustomMenu2(menuPos, "控件样式" + "(&" + menuPos + ")");
|
||||
for (var submenuPos = 0; submenuPos < 1; submenuPos++) {
|
||||
myobj.AddCustomMenuItem2(menuPos, submenuPos, -1, true, "改变大小", false);
|
||||
//增加子菜单项目
|
||||
for (var subsubmenuPos = 0; subsubmenuPos < 2; subsubmenuPos++) {
|
||||
if (0 == subsubmenuPos)//增加子菜单项目
|
||||
{
|
||||
myobj.AddCustomMenuItem2(menuPos, submenuPos, subsubmenuPos, false,
|
||||
"全网页查看", false, menuPos * 100 + submenuPos * 20 + subsubmenuPos);
|
||||
}
|
||||
if (1 == subsubmenuPos)//增加子菜单项目
|
||||
{
|
||||
myobj.AddCustomMenuItem2(menuPos, submenuPos, subsubmenuPos, false,
|
||||
"恢复原大小", false, menuPos * 100 + submenuPos * 20 + subsubmenuPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//改变控件大小为当前网页可见区域
|
||||
function objside() {
|
||||
document.all.officecontrol.style.position = "absolute";
|
||||
document.all.officecontrol.style.left = "0px";
|
||||
document.all.officecontrol.style.top = "0px";
|
||||
document.all.officecontrol.style.width = document.body.clientWidth;//网页可见区域宽
|
||||
document.all.officecontrol.style.height = document.body.clientHeight;//网页可见区域高
|
||||
}
|
||||
//恢复控件显示大小
|
||||
function objside2() {
|
||||
document.all.officecontrol.style.position = "relative";
|
||||
document.all.officecontrol.style.left = "0px";
|
||||
document.all.officecontrol.style.top = "0px";
|
||||
document.all.officecontrol.style.width = "100%";
|
||||
document.all.officecontrol.style.height = "980px";
|
||||
}
|
||||
//显示或隐藏文档控件对象
|
||||
function ObjectDisplay(boolvalue) {
|
||||
var obj = document.getElementById("objside");
|
||||
if (!boolvalue) {
|
||||
obj.style.display = "none";
|
||||
}
|
||||
else {
|
||||
obj.style.display = "block";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
body{
|
||||
text-align:center;
|
||||
font-family:"微软雅黑";
|
||||
letter-spacing:0.05em;
|
||||
color:#575757;
|
||||
font-size:16px;
|
||||
margin:0px;
|
||||
}
|
||||
a{
|
||||
text-decoration:none;
|
||||
cursor:pointer;
|
||||
color:#299ceb;
|
||||
}
|
||||
a:hover{
|
||||
text-decoration:underline;
|
||||
color:#c60000;
|
||||
}
|
||||
hr{
|
||||
border:0px;
|
||||
border-bottom:1px #b0b0b0 solid;
|
||||
margin:50px 0px 30px 0px;
|
||||
}
|
||||
p{
|
||||
text-align:left;
|
||||
line-height:1.6;
|
||||
text-indent:2em;
|
||||
}
|
||||
|
||||
.divTop{
|
||||
width:100%;
|
||||
height:70px;
|
||||
text-align:center;
|
||||
background-color:#000000;
|
||||
top:0;
|
||||
}
|
||||
.divTopInner{
|
||||
width:1200px;
|
||||
text-align:left;
|
||||
color:#ffffff;
|
||||
line-height:70px;
|
||||
margin:auto;
|
||||
}
|
||||
.divTopInnerCaption{
|
||||
width:1150px;
|
||||
font-size:20px;
|
||||
float:left;
|
||||
}
|
||||
.divTopInnerNtko{
|
||||
width:50px;
|
||||
font-size:14px;
|
||||
text-align:center;
|
||||
float:left;
|
||||
cursor:pointer;
|
||||
}
|
||||
.divTopInnerNtko:hover{
|
||||
background-color:#c60000;
|
||||
}
|
||||
.divTopInner a{
|
||||
color:#ffffff;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
.divTitle{
|
||||
width:100%;
|
||||
height:80px;
|
||||
line-height:80px;
|
||||
border-bottom:1px #bababa solid;
|
||||
margin-bottom:10px;
|
||||
}
|
||||
.divTitle_body{
|
||||
width:1200px;
|
||||
text-align:left;
|
||||
margin:auto;
|
||||
}
|
||||
.divTitle_caption{
|
||||
width:100%;
|
||||
float:left;
|
||||
color:#c60000;
|
||||
font-size:36px;
|
||||
font-weight:bold;
|
||||
|
||||
}
|
||||
.divTitle_caption_small{
|
||||
width:100%;
|
||||
float:left;
|
||||
color:#c60000;
|
||||
font-size:24px;
|
||||
font-weight:bold;
|
||||
height:50px;
|
||||
line-height:50px;
|
||||
}
|
||||
.divTitle_Information{
|
||||
width:100%;
|
||||
float:left;
|
||||
color:#999999;
|
||||
font-size:14px;
|
||||
height:auto;
|
||||
line-height:24px;
|
||||
margin:20px 0px 30px 0px;
|
||||
}
|
||||
.divTitle_Information_Left{
|
||||
width:40px;
|
||||
height:40px;
|
||||
line-height:40px;
|
||||
background-color:#ffde00;
|
||||
float:left;
|
||||
text-align:center;
|
||||
font-size:20px;
|
||||
font-weight:bolder;
|
||||
color:#ffffff;
|
||||
margin:auto 20px auto auto;
|
||||
}
|
||||
.divTitle_Information_Right{
|
||||
width:1140px;
|
||||
height:40px;
|
||||
line-height:40px;
|
||||
float:left;
|
||||
font-size:16px;
|
||||
}
|
||||
.divTitle_introduction{
|
||||
width:100%;
|
||||
float:left;
|
||||
color:#999999;
|
||||
font-size:14px;
|
||||
height:auto;
|
||||
line-height:24px;
|
||||
}
|
||||
|
||||
.divBody{
|
||||
width:1200px;
|
||||
margin:10px auto;
|
||||
text-align:left;
|
||||
}
|
||||
.divBody_Title{
|
||||
width:100%;
|
||||
height:40px;
|
||||
font-size:16px;
|
||||
margin:40px 0px 0px 0px;
|
||||
}
|
||||
.divBody_Title_Flag{
|
||||
width:5px;
|
||||
height:40px;
|
||||
font-size:16px;
|
||||
float:left;
|
||||
background-color:#a10000;
|
||||
margin:0px 20px 10px 0px;
|
||||
}
|
||||
.divBody_Table_Caption{
|
||||
width:1175px;
|
||||
height:40px;
|
||||
line-height:40px;
|
||||
font-size:24px;
|
||||
font-weight:bolder;
|
||||
color:#999999;
|
||||
float:left;
|
||||
}
|
||||
table{
|
||||
border-collapse:collapse;
|
||||
width:100%;
|
||||
}
|
||||
td{
|
||||
border:1px #e0e0e0 solid;
|
||||
height:60px;
|
||||
text-align:center;
|
||||
color:#999999;
|
||||
font-size:14px;
|
||||
padding:20px;
|
||||
}
|
||||
.divBody_Table_RowTitle{
|
||||
font-size:18px;
|
||||
font-weight:bolder;
|
||||
color:#ffffff;
|
||||
background-color:#e0e0e0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,690 @@
|
||||
/**
|
||||
* version: 3.6.3
|
||||
*
|
||||
* 2022.04.11版本 跟随 上海市教育考试院20221130 产品发送
|
||||
*/
|
||||
"use strict";
|
||||
var varNtkoGUID = Math.random().toString(36);
|
||||
var ntkoWinOpen;
|
||||
var ntkoJsonIe;
|
||||
var timer;
|
||||
var ntkoSendDataToChildStrUrl;
|
||||
var ntkoSendDataToChildSData;
|
||||
var ntkowin;
|
||||
var ntkoextensionmainifest;
|
||||
var strURL1;
|
||||
var userAgent = navigator.userAgent,
|
||||
rMsie = /(msie\s|trident.*rv:)([\w.]+)/,
|
||||
rFirefox = /(firefox)\/([\w.]+)/,
|
||||
rOpera = /(opera).+versi1on\/([\w.]+)/,
|
||||
rChrome = /(chrome)\/([\w.]+)/,
|
||||
rEdge = /(edg)\/([\w.]+)/,
|
||||
rSafari = /version\/([\w.]+).*(safari)/;
|
||||
var browser;
|
||||
var version;
|
||||
var ua = userAgent.toLowerCase();
|
||||
function uaMatch(ua) {
|
||||
var match = rMsie.exec(ua);
|
||||
if (match != null) {
|
||||
return { browser : "IE", version : match[2] || "0" };
|
||||
}
|
||||
var match = rFirefox.exec(ua);
|
||||
if (match != null) {
|
||||
return { browser : match[1] || "", version : match[2] || "0" };
|
||||
}
|
||||
var match = rOpera.exec(ua);
|
||||
if (match != null) {
|
||||
return { browser : match[1] || "", version : match[2] || "0" };
|
||||
}
|
||||
var match = rChrome.exec(ua);
|
||||
if (match != null) {
|
||||
var matchedge= rEdge.exec(ua);
|
||||
if(matchedge!=null){
|
||||
return { browser : matchedge[1] || "", version : matchedge[2] || "0" };
|
||||
}else{
|
||||
return { browser : match[1] || "", version : match[2] || "0" };
|
||||
}
|
||||
}
|
||||
var match = rSafari.exec(ua);
|
||||
if (match != null) {
|
||||
return { browser : match[2] || "", version : match[1] || "0" };
|
||||
}
|
||||
if (match != null) {
|
||||
return { browser : "", version : "0" };
|
||||
}
|
||||
}
|
||||
var browserMatch = uaMatch(userAgent.toLowerCase());
|
||||
if (browserMatch.browser) {
|
||||
browser = browserMatch.browser;
|
||||
version = browserMatch.version;
|
||||
}
|
||||
var mimeTypes = navigator.mimeTypes;
|
||||
var bChromeExtensionInstalled = false;
|
||||
version=parseInt(version);
|
||||
if( "chrome" === browserMatch.browser && version>=45)
|
||||
{
|
||||
|
||||
var img;
|
||||
img = new Image();
|
||||
img.src = "chrome-extension://lppkeogbkjlmmbjenbogdndlgmpiddda/icons/ntko.png";
|
||||
img.onload = function() {
|
||||
bChromeExtensionInstalled = true;
|
||||
};
|
||||
img.onerror = function() {
|
||||
bChromeExtensionInstalled = false;
|
||||
};
|
||||
}
|
||||
if("edg"===browserMatch.browser){
|
||||
|
||||
var img;
|
||||
img = new Image();
|
||||
img.src = "chrome-extension://miogdolpaknhgnfoghcmnooafkiafkcc/icons/ntko.png";
|
||||
img.onload = function() {
|
||||
bChromeExtensionInstalled = true;
|
||||
};
|
||||
img.onload = function() {
|
||||
bChromeExtensionInstalled = true;
|
||||
};
|
||||
}
|
||||
|
||||
var ntkoBrowser = {
|
||||
ntkoSendDataToChild:function( strURL, data)
|
||||
{
|
||||
//console.log(strURL);
|
||||
if ( typeof data === 'undefined' ){
|
||||
return;
|
||||
}
|
||||
var strURL=ntkoBrowser.NtkoStrURL(strURL);
|
||||
var jsonValue = '{"SendDataToChild":1,"GUID":"';
|
||||
jsonValue += varNtkoGUID;
|
||||
jsonValue += '","URLMD5":"';
|
||||
jsonValue += b64_md5(strURL);
|
||||
jsonValue += '","ChildValue":"';
|
||||
jsonValue += data;
|
||||
jsonValue += '"}';
|
||||
var ntkobr=ntkoBrowser.NtkoBrower();
|
||||
if(ntkobr){
|
||||
window.postMessage({ type: "FROM_NTKO_PAGE", text: jsonValue }, "*");
|
||||
}else{
|
||||
ntkoWinOpen.ntkoGetParentData(data);
|
||||
}
|
||||
},
|
||||
ExtensionInstalled:function()
|
||||
{
|
||||
var ntkobr=ntkoBrowser.NtkoBrower();
|
||||
if(!ntkobr){
|
||||
if(browser=="IE"){
|
||||
return true;
|
||||
}else{
|
||||
var mimetype=navigator.mimeTypes["application/ntko-plug"];
|
||||
if(mimetype){
|
||||
var plugin=mimetype.enabledPlugin;
|
||||
if(plugin){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( "firefox" === browserMatch.browser )
|
||||
{
|
||||
if(( typeof ntkoextensionmainifest != 'undefined' ) && ( ( null != ntkoextensionmainifest ) && ( "" != ntkoextensionmainifest ))){
|
||||
|
||||
return true;
|
||||
}else{
|
||||
var bInstalled = false;
|
||||
if( "undefined" === typeof FirefoxInstalled )
|
||||
return ( bInstalled );
|
||||
else
|
||||
return( window.FirefoxInstalled());
|
||||
}
|
||||
}
|
||||
else if( "chrome" === browserMatch.browser )
|
||||
{
|
||||
|
||||
if(( typeof ntkoextensionmainifest != 'undefined' ) && ( ( null != ntkoextensionmainifest ) && ( "" != ntkoextensionmainifest ))){
|
||||
|
||||
return true;
|
||||
}else{
|
||||
return (bChromeExtensionInstalled);
|
||||
}
|
||||
} else if("edg" === browserMatch.browser){
|
||||
if(( typeof ntkoextensionmainifest != 'undefined' ) && ( ( null != ntkoextensionmainifest ) && ( "" != ntkoextensionmainifest ))){
|
||||
return true;
|
||||
}else{
|
||||
return( bChromeExtensionInstalled );
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ntkoClose:function( strURL )
|
||||
{
|
||||
var strURL=ntkoBrowser.NtkoStrURL(strURL);
|
||||
var jsonValue = '{"Close":1,"GUID":"';
|
||||
jsonValue += varNtkoGUID;
|
||||
jsonValue += '","URLMD5":"';
|
||||
jsonValue += b64_md5(strURL);
|
||||
jsonValue += '"}';
|
||||
var ntkobr=ntkoBrowser.NtkoBrower();
|
||||
if(ntkobr){
|
||||
window.postMessage({ type: "FROM_NTKO_PAGE", text: jsonValue }, "*");
|
||||
}else{
|
||||
ntkoWinOpen.close();
|
||||
}
|
||||
},
|
||||
openWindow:function( strURL,IsShowOnExtendMonitor,ProductCaption, ntkoBrowserProductKey, ntkoBrowserNoExpireKey, ntkoBrowserOptions,varUrlData,ntkowidth,ntkoheight,cookiesDomainPath )
|
||||
{
|
||||
|
||||
if(varUrlData!=null&&varUrlData!=""){
|
||||
ntkoSendDataToChildSData=varUrlData;
|
||||
}
|
||||
var ntkowinscr= ntkoBrowser.NtkoWidthAndHeightWinScr(ntkowidth,ntkoheight);
|
||||
if(!ntkowinscr){
|
||||
alert("设置窗口大小格式不正确");
|
||||
return;
|
||||
}
|
||||
|
||||
var strURL=ntkoBrowser.NtkoStrURL(strURL);
|
||||
strURL1=strURL;
|
||||
var ntkoSessionURL="";
|
||||
var jsonValue = '{"OpenWindow":1,"URL":"';
|
||||
jsonValue += strURL;
|
||||
jsonValue += '","GUID":"';
|
||||
jsonValue += varNtkoGUID;
|
||||
jsonValue += '","URLMD5":"';
|
||||
jsonValue +=b64_md5(strURL);
|
||||
jsonValue += '","ntkobrowserMatch":"';
|
||||
jsonValue +=browserMatch.browser;
|
||||
jsonValue += '","IsShowOnExtendMonitor":"';
|
||||
jsonValue += IsShowOnExtendMonitor;
|
||||
jsonValue += '"';
|
||||
if( ( typeof ProductCaption != 'undefined' ) && ( ( null != ProductCaption ) && ( "" != ProductCaption ) ) )
|
||||
{
|
||||
jsonValue += ',"ProductCaption":"';
|
||||
jsonValue += ProductCaption;
|
||||
jsonValue += '"';
|
||||
}
|
||||
|
||||
if( ( typeof ntkoBrowserProductKey != 'undefined' ) && ( ( null != ntkoBrowserProductKey ) && ( "" != ntkoBrowserProductKey ) ) )
|
||||
{
|
||||
jsonValue += ',"ProductKey":"';
|
||||
jsonValue += ntkoBrowserProductKey;
|
||||
jsonValue += '"';
|
||||
}
|
||||
|
||||
if( ( typeof ntkoBrowserNoExpireKey != 'undefined' ) && ( ( null != ntkoBrowserNoExpireKey ) &&( "" != ntkoBrowserNoExpireKey ) ) )
|
||||
{
|
||||
jsonValue += ',"NoExpireKey":"';
|
||||
jsonValue += ntkoBrowserNoExpireKey;
|
||||
jsonValue += '"';
|
||||
}
|
||||
if( typeof ntkoSessionURL != 'undefined' && ( ( null != ntkoSessionURL ) && ( "" != ntkoSessionURL ) ) )
|
||||
{
|
||||
jsonValue += ',"SessionURL":"';
|
||||
jsonValue += ntkoSessionURL;
|
||||
jsonValue += '"';
|
||||
}
|
||||
|
||||
if( typeof ntkoBrowserOptions != 'undefined' && ( ( null != ntkoBrowserOptions ) && ( "" != ntkoBrowserOptions ) ) )
|
||||
{
|
||||
jsonValue += ',"Options":"';
|
||||
jsonValue += ntkoBrowserOptions;
|
||||
jsonValue += '"';
|
||||
}
|
||||
|
||||
|
||||
|
||||
var LocalStorge = window.localStorage;
|
||||
if( typeof LocalStorge != 'undefined' && ( 0 != LocalStorge.length ) )
|
||||
{
|
||||
var varLocalDataList = [];
|
||||
for( var i = 0; i < LocalStorge.length; i++ )
|
||||
{
|
||||
var varLocalData = {};
|
||||
varLocalData["StorageKey"] = LocalStorge.key(i);
|
||||
varLocalData["StorageValue"] = LocalStorge.getItem(LocalStorge.key(i));
|
||||
varLocalDataList[i] = varLocalData;
|
||||
}
|
||||
jsonValue += ',"LocalStorge":';
|
||||
jsonValue += JSON.stringify(varLocalDataList);;
|
||||
jsonValue += '';
|
||||
}
|
||||
|
||||
var SessionStorge = window.sessionStorage;
|
||||
if( typeof SessionStorge != 'undefined' && ( 0 != SessionStorge.length ) )
|
||||
{
|
||||
var varSessionDataList = [];
|
||||
for( var i = 0; i < SessionStorge.length; i++ )
|
||||
{
|
||||
var varSessionData = {};
|
||||
varSessionData["StorageKey"] = SessionStorge.key(i);
|
||||
varSessionData["StorageValue"] = SessionStorge.getItem(SessionStorge.key(i));
|
||||
varSessionDataList[i] = varSessionData;
|
||||
}
|
||||
|
||||
jsonValue += ',"SessionStorge":';
|
||||
jsonValue += JSON.stringify(varSessionDataList);
|
||||
jsonValue += '';
|
||||
}
|
||||
if( typeof ntkowidth != 'undefined' && ( ( null != ntkowidth ) && ( "" != ntkowidth ) ) )
|
||||
{
|
||||
jsonValue += ',"NtkoWidth":';
|
||||
jsonValue += ntkowidth;
|
||||
jsonValue += '';
|
||||
}
|
||||
|
||||
if( typeof ntkoheight != 'undefined' && ( ( null != ntkoheight ) && ( "" != ntkoheight ) ) )
|
||||
{
|
||||
jsonValue += ',"NtkoHeight":';
|
||||
jsonValue += ntkoheight;
|
||||
jsonValue += '';
|
||||
}
|
||||
if( typeof cookiesDomainPath != 'undefined' && ( ( null != cookiesDomainPath ) && ( "" != cookiesDomainPath ) ) )
|
||||
{
|
||||
jsonValue += ',"CookiesDomainPath":';
|
||||
jsonValue += cookiesDomainPath;
|
||||
jsonValue += '';
|
||||
}
|
||||
|
||||
jsonValue += '}';
|
||||
var ntkobr=ntkoBrowser.NtkoBrower();
|
||||
if(ntkobr){
|
||||
window.postMessage({type: "FROM_NTKO_PAGE", text: jsonValue}, "*");
|
||||
}else{
|
||||
ntkowin=b64_md5(strURL);
|
||||
if(ntkowidth==null||ntkowidth=="" ||ntkowidth=="undefined"){
|
||||
ntkowidth=window.screen.width;
|
||||
}
|
||||
if(ntkoheight==null||ntkoheight==""||ntkoheight=="undefined"){
|
||||
ntkoheight=window.screen.height;
|
||||
}
|
||||
ntkoWinOpen=window.open(strURL,ntkowin,"height="+ntkoheight+", width="+ntkowidth+", top=0,left=0,titlebar=no,toolbar =no, menubar=no, scrollbars=no, resizable=yes, location=no, status=no");
|
||||
ntkoWinOpen.resizeTo(ntkowidth,ntkoheight);
|
||||
ntkoWinOpen.focus();
|
||||
}
|
||||
},
|
||||
NtkoWShell:function(){
|
||||
|
||||
},
|
||||
NtkoiTop:function(){
|
||||
return (window.screen.height-30-300)/2;
|
||||
},
|
||||
NtkoiLeft:function(){
|
||||
return (window.screen.width-10-400)/2;
|
||||
},
|
||||
NtkoBrower:function(){
|
||||
if(browser=="IE"){
|
||||
return false;
|
||||
}
|
||||
if(browser=="firefox"){
|
||||
if(userAgent.indexOf("Windows NT 5.1") > -1){
|
||||
return false;
|
||||
}
|
||||
if(version>=50){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(browser=="chrome"){
|
||||
if(userAgent.indexOf("Windows NT 5.1") > -1){
|
||||
return false;
|
||||
}
|
||||
if(version>=45){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(browser=="edg"){
|
||||
return true;
|
||||
}
|
||||
},
|
||||
NtkoStrURL:function(strURL){
|
||||
var testurl =window.location.search;
|
||||
var docUrl=document.location.toString();
|
||||
var wpathname= window.document.location.pathname;
|
||||
var pos=docUrl.indexOf(wpathname);
|
||||
var relUrl= docUrl.substring(0,pos);
|
||||
if( ( null === strURL ) || ( "" === strURL ) )
|
||||
{
|
||||
alert("打开路径的url为null");
|
||||
return;
|
||||
}
|
||||
var strLowser = strURL.toLowerCase();
|
||||
if( '/' != strURL.charAt(0) )
|
||||
{
|
||||
if( ( "http://" === strLowser.substr(0,7) ) || ( "https://" === strLowser.substr(0,8) ) )
|
||||
{}
|
||||
else
|
||||
{
|
||||
if(strURL.indexOf("../")==-1)
|
||||
{
|
||||
var pathName = window.location.href;
|
||||
var varLength = pathName.lastIndexOf("/");
|
||||
strURL = pathName.substr( 0, varLength + 1 ) + strURL;
|
||||
}
|
||||
else
|
||||
{
|
||||
var strURLlen=strURL.length;
|
||||
strURL=strURL.substring(2,strURLlen);
|
||||
strURL = relUrl +strURL;
|
||||
}
|
||||
if(strURL.indexOf(testurl)==-1)
|
||||
{
|
||||
if(strURL.indexOf("?")==-1)
|
||||
{
|
||||
strURL=strURL+testurl
|
||||
}
|
||||
else
|
||||
{
|
||||
var docof= strURL.indexOf("?");
|
||||
var docend=strURL.length;
|
||||
var docs=strURL.substring(0,docof);
|
||||
var docsurl=strURL.substring(docof+1,docend);
|
||||
strURL=docs+testurl+"&"+docsurl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var strURLlen=strURL.length;
|
||||
strURL=strURL.substring(0,strURLlen);
|
||||
strURL = relUrl+ strURL;
|
||||
}
|
||||
return strURL;
|
||||
},
|
||||
NtkoWidthAndHeightWinScr:function(ntkowidth,ntkoheight){
|
||||
|
||||
var regNtko=/^\s*$/;
|
||||
if(typeof(ntkowidth)=="undefined"&&typeof(ntkoheight)=="undefined"){
|
||||
return true;
|
||||
}else{
|
||||
if(regNtko.test(ntkowidth)||typeof(ntkowidth)!="number"){
|
||||
return false;
|
||||
}else{
|
||||
if(regNtko.test(ntkoheight)||typeof(ntkoheight)!="number"){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
NtkoExtensionVersion:function(){
|
||||
if(browser=="firefox"){
|
||||
var ntkojsontext = JSON.parse(window.NtkoFireFoxVersion());
|
||||
var ntkofireforversion=ntkojsontext['ntkoversion'];
|
||||
return ntkofireforversion;
|
||||
}else{
|
||||
return ntkoextensionmainifest;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if(browser!="IE")
|
||||
{
|
||||
window.addEventListener("message", function(event)
|
||||
{
|
||||
if ( event.source != window )
|
||||
return;
|
||||
if (event.data.type && (event.data.type == "FROM_NTKO_CONTEXT_PAGE"))
|
||||
{
|
||||
var vJsonData = JSON.parse( event.data.text );
|
||||
var jsonData = vJsonData["ntkoData"];
|
||||
if( typeof jsonData !== "undefined" )
|
||||
{
|
||||
if( varNtkoGUID === jsonData["ntkoGUID"] )
|
||||
{
|
||||
if( "ntkoClose" === jsonData["functionName"] )
|
||||
{
|
||||
// 调用关闭事件
|
||||
try
|
||||
{
|
||||
eval('ntkoCloseEvent()');
|
||||
}
|
||||
catch(e)
|
||||
{}
|
||||
}
|
||||
else if( "ntkoReturnValueToParentPage" === jsonData["functionName"] )
|
||||
{
|
||||
// 调用返回值事件,解析值
|
||||
var varFunctionName = jsonData["parentExecutionFunction"]; // 要执行的函数名
|
||||
if( typeof varFunctionName != 'undefined' && ( ( null != varFunctionName ) && ( "" != varFunctionName ) ) )
|
||||
{
|
||||
var varFunctionAgrvs = jsonData["FunctionArgs"]; // 传递过来的参数值
|
||||
if( typeof varFunctionAgrvs != 'undefined' && ( ( null != varFunctionAgrvs ) && ( "" != varFunctionAgrvs ) ) )
|
||||
{
|
||||
// 调用eval执行函数
|
||||
eval( varFunctionName + "( varFunctionAgrvs[0], varFunctionAgrvs[1], varFunctionAgrvs[2], varFunctionAgrvs[3]," +
|
||||
"varFunctionAgrvs[4],varFunctionAgrvs[5],varFunctionAgrvs[6],varFunctionAgrvs[7],varFunctionAgrvs[8]);" );
|
||||
}
|
||||
}
|
||||
}else if("NtkoError" === jsonData["functionName"]){
|
||||
//启动扩展报错信息
|
||||
alert(jsonData["NtkoReason"])
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(event.data.type && (event.data.type == "FROM_NTKO_MANIFEST")){
|
||||
var ntkojsontext = JSON.parse( event.data.text );
|
||||
ntkoextensionmainifest=ntkojsontext['ntkoversion'];
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
function ieattachEventntko(data,varFunctionAgrvs)
|
||||
{
|
||||
if( typeof data !== "undefined" )
|
||||
{
|
||||
if( typeof varFunctionAgrvs != 'undefined' && ( ( null != varFunctionAgrvs ) && ( "" != varFunctionAgrvs ) ) )
|
||||
{
|
||||
eval( data + "( varFunctionAgrvs[0], varFunctionAgrvs[1], varFunctionAgrvs[2], varFunctionAgrvs[3]," +
|
||||
"varFunctionAgrvs[4],varFunctionAgrvs[5],varFunctionAgrvs[6],varFunctionAgrvs[7],varFunctionAgrvs[8]);" );
|
||||
}
|
||||
}
|
||||
}
|
||||
function ntkoSendDataToChildtext(ntkoDataSendUrl)
|
||||
{
|
||||
if(ntkoSendDataToChildSData!=null&&ntkoSendDataToChildSData!="")
|
||||
{
|
||||
ntkoBrowser.ntkoSendDataToChild(ntkoDataSendUrl,ntkoSendDataToChildSData);
|
||||
}
|
||||
}
|
||||
/*___md5___*/
|
||||
|
||||
var hexcase = 0;
|
||||
var b64pad = "";
|
||||
var chrsz = 8;
|
||||
function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
|
||||
function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
|
||||
function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
|
||||
function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
|
||||
function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
|
||||
function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }
|
||||
function md5_vm_test()
|
||||
{
|
||||
return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
|
||||
}
|
||||
function core_md5(x, len)
|
||||
{
|
||||
x[len >> 5] |= 0x80 << ((len) % 32);
|
||||
x[(((len + 64) >>> 9) << 4) + 14] = len;
|
||||
var a = 1732584193;
|
||||
var b = -271733879;
|
||||
var c = -1732584194;
|
||||
var d = 271733878;
|
||||
for(var i = 0; i < x.length; i += 16)
|
||||
{
|
||||
var olda = a;
|
||||
var oldb = b;
|
||||
var oldc = c;
|
||||
var oldd = d;
|
||||
a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
|
||||
d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
|
||||
c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
|
||||
b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
|
||||
a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
|
||||
d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
|
||||
c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
|
||||
b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
|
||||
a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
|
||||
d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
|
||||
c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
|
||||
b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
|
||||
a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
|
||||
d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
|
||||
c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
|
||||
b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
|
||||
a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
|
||||
d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
|
||||
c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
|
||||
b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
|
||||
a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
|
||||
d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
|
||||
c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
|
||||
b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
|
||||
a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
|
||||
d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
|
||||
c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
|
||||
b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
|
||||
a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
|
||||
d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
|
||||
c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
|
||||
b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
|
||||
a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
|
||||
d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
|
||||
c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
|
||||
b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
|
||||
a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
|
||||
d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
|
||||
c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
|
||||
b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
|
||||
a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
|
||||
d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
|
||||
c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
|
||||
b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
|
||||
a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
|
||||
d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
|
||||
c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
|
||||
b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
|
||||
a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
|
||||
d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
|
||||
c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
|
||||
b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
|
||||
a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
|
||||
d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
|
||||
c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
|
||||
b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
|
||||
a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
|
||||
d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
|
||||
c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
|
||||
b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
|
||||
a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
|
||||
d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
|
||||
c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
|
||||
b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
|
||||
a = safe_add(a, olda);
|
||||
b = safe_add(b, oldb);
|
||||
c = safe_add(c, oldc);
|
||||
d = safe_add(d, oldd);
|
||||
}
|
||||
return Array(a, b, c, d);
|
||||
}
|
||||
function md5_cmn(q, a, b, x, s, t)
|
||||
{
|
||||
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
|
||||
}
|
||||
function md5_ff(a, b, c, d, x, s, t)
|
||||
{
|
||||
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
|
||||
}
|
||||
function md5_gg(a, b, c, d, x, s, t)
|
||||
{
|
||||
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
|
||||
}
|
||||
function md5_hh(a, b, c, d, x, s, t)
|
||||
{
|
||||
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
|
||||
}
|
||||
function md5_ii(a, b, c, d, x, s, t)
|
||||
{
|
||||
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
|
||||
}
|
||||
|
||||
function core_hmac_md5(key, data)
|
||||
{
|
||||
var bkey = str2binl(key);
|
||||
if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);
|
||||
var ipad = Array(16), opad = Array(16);
|
||||
for(var i = 0; i < 16; i++)
|
||||
{
|
||||
ipad[i] = bkey[i] ^ 0x36363636;
|
||||
opad[i] = bkey[i] ^ 0x5C5C5C5C;
|
||||
}
|
||||
var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
|
||||
return core_md5(opad.concat(hash), 512 + 128);
|
||||
}
|
||||
function safe_add(x, y)
|
||||
{
|
||||
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
|
||||
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
||||
return (msw << 16) | (lsw & 0xFFFF);
|
||||
}
|
||||
function bit_rol(num, cnt)
|
||||
{
|
||||
return (num << cnt) | (num >>> (32 - cnt));
|
||||
}
|
||||
function str2binl(str)
|
||||
{
|
||||
var bin = Array();
|
||||
var mask = (1 << chrsz) - 1;
|
||||
for(var i = 0; i < str.length * chrsz; i += chrsz)
|
||||
bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
|
||||
return bin;
|
||||
}
|
||||
function binl2str(bin)
|
||||
{
|
||||
var str = "";
|
||||
var mask = (1 << chrsz) - 1;
|
||||
for(var i = 0; i < bin.length * 32; i += chrsz)
|
||||
str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
|
||||
return str;
|
||||
}
|
||||
function binl2hex(binarray)
|
||||
{
|
||||
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
|
||||
var str = "";
|
||||
for(var i = 0; i < binarray.length * 4; i++)
|
||||
{
|
||||
str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
|
||||
hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
function binl2b64(binarray)
|
||||
{
|
||||
|
||||
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
var str = "";
|
||||
for(var i = 0; i < binarray.length * 4; i += 3)
|
||||
{
|
||||
var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16)
|
||||
| (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
|
||||
| ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
|
||||
for(var j = 0; j < 4; j++)
|
||||
{
|
||||
if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
|
||||
else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
@@ -0,0 +1,231 @@
|
||||
/*------------------------------------------------------*/
|
||||
/* 修改控件的配置信息 */
|
||||
/* version:3.6.3 */
|
||||
/* 2022.12.05版本 跟随 评测专用演示版本 产品 发送 */
|
||||
/*------------------------------------------------------*/
|
||||
//64位控件的calssid
|
||||
var classidx64="A64E3073-2016-4baf-A89D-FFE1FAA10EE0";
|
||||
//32位控件的classid
|
||||
var classid="A64E3073-2016-4baf-A89D-FFE1FAA10EC0";
|
||||
//32位控件包的路径
|
||||
var codebase="officecontrol/OfficeControl.cab#version=6.0.0.6";
|
||||
//64位控件包的路径
|
||||
var codebase64="officecontrol/OfficeControlx64.cab#version=6.0.0.6";
|
||||
//设置高度
|
||||
var height="800px";
|
||||
//设置宽度
|
||||
var width="100%";
|
||||
//买断授权密钥如果不是买断可以不用写
|
||||
var MakerCaption="";
|
||||
//买断授权密钥如果不是买断可以不用写
|
||||
var MakerKey="";
|
||||
//密钥
|
||||
var ProductCaption="";
|
||||
//密钥
|
||||
var ProductKey="";
|
||||
//解除时间密钥
|
||||
var NoExpireKey="";
|
||||
|
||||
/*
|
||||
谷歌浏览器事件接管但此接管事件只支持低版本的谷歌(45以下版本不包含45)和火狐(52以下版本不包含52)
|
||||
*/
|
||||
function ntkosavetourl(type,code,html)
|
||||
{
|
||||
//alert("SaveToURL成功回调");
|
||||
}
|
||||
|
||||
|
||||
function ntkopublishashtml(type,code,html){
|
||||
//alert("Onpublishashtmltourl成功回调");
|
||||
}
|
||||
function ntkopublishaspdf(type,code,html){
|
||||
//alert("Onpublishaspdftourl成功回调");
|
||||
}
|
||||
function ntkosaveasotherurl(type,code,html){
|
||||
//alert("SaveAsOtherformattourl成功回调");
|
||||
}
|
||||
|
||||
function ntkoondocumentopened(type,code){
|
||||
//alert("Ondocumentopened成功回调");
|
||||
if(cmd==5){
|
||||
if(datavalue==1){
|
||||
ntko.ShowTipMessage("注意","已经接收到父页面传过来的值,请注意文档中内容的变化");
|
||||
ntkoDataToChild(datatext);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function OnCustomButtonOnMenuCmd(btnPos, btnCaption, btnID){
|
||||
|
||||
if(0 == btnCmdid) //切换全屏
|
||||
{
|
||||
//事件处理代码中可以直接引用控件属性或者方法,
|
||||
//可以省略控件对象前缀
|
||||
FullScreenMode = !FullScreenMode;
|
||||
}
|
||||
else if(1 == btnCmdid)
|
||||
{
|
||||
DoHandSign2('tanger');
|
||||
}
|
||||
else if(2 == btnCmdid)
|
||||
{
|
||||
|
||||
}
|
||||
else if(3 == btnCmdid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*------------------------------------------------------*/
|
||||
/* 以下内容 请勿修改,否则可能出错 */
|
||||
/*------------------------------------------------------*/
|
||||
|
||||
var userAgent = navigator.userAgent,
|
||||
rMsie = /(msie\s|trident.*rv:)([\w.]+)/,
|
||||
rFirefox = /(firefox)\/([\w.]+)/,
|
||||
rOpera = /(opera).+version\/([\w.]+)/,
|
||||
rChrome = /(chrome)\/([\w.]+)/,
|
||||
rSafari = /version\/([\w.]+).*(safari)/;
|
||||
var browser;
|
||||
var version;
|
||||
var ua = userAgent.toLowerCase();
|
||||
function uaMatch(ua) {
|
||||
var match = rMsie.exec(ua);
|
||||
if (match != null) {
|
||||
return { browser : "IE", version : match[2] || "0" };
|
||||
}
|
||||
var match = rFirefox.exec(ua);
|
||||
if (match != null) {
|
||||
return { browser : match[1] || "", version : match[2] || "0" };
|
||||
}
|
||||
var match = rOpera.exec(ua);
|
||||
if (match != null) {
|
||||
return { browser : match[1] || "", version : match[2] || "0" };
|
||||
}
|
||||
var match = rChrome.exec(ua);
|
||||
if (match != null) {
|
||||
return { browser : match[1] || "", version : match[2] || "0" };
|
||||
}
|
||||
var match = rSafari.exec(ua);
|
||||
if (match != null) {
|
||||
return { browser : match[2] || "", version : match[1] || "0" };
|
||||
}
|
||||
if (match != null) {
|
||||
return { browser : "", version : "0" };
|
||||
}
|
||||
}
|
||||
var browserMatch = uaMatch(userAgent.toLowerCase());
|
||||
if (browserMatch.browser) {
|
||||
browser = browserMatch.browser;
|
||||
version = browserMatch.version;
|
||||
}
|
||||
|
||||
|
||||
if (browser=="IE"){
|
||||
if(window.navigator.platform=="Win32"){
|
||||
|
||||
document.write('<!-- 用来产生编辑状态的ActiveX控件的JS脚本--> ');
|
||||
document.write('<!-- 因为微软的ActiveX新机制,需要一个外部引入的js--> ');
|
||||
document.write('<object id="TANGER_OCX" classid="clsid:'+classid+'"');
|
||||
document.write('codebase="'+codebase+'" width="'+width+'" height="'+height+'"> ');
|
||||
document.write('<param name="MakerCaption" value="'+MakerCaption+'"> ');
|
||||
document.write('<param name="MakerKey" value="'+MakerKey+'"> ');
|
||||
document.write('<param name="ProductCaption" value="'+ProductCaption+'"> ');
|
||||
document.write('<param name="ProductKey" value="'+ProductKey+'"> ');
|
||||
document.write('<param name="NoExpireKey" value="'+NoExpireKey+'"> ');
|
||||
document.write('<param name="IsUseUTF8URL" value="-1"> ');
|
||||
document.write('<param name="IsUseUTF8Data" value="-1"> ');
|
||||
document.write('<param name="Caption" value="NTKO OFFICE文档控件示例演示 http://www.ntko.com"> ');
|
||||
document.write('<SPAN STYLE="color:red">不能装载文档控件。请在检查浏览器的选项中检查浏览器的安全设置。</SPAN> ');
|
||||
document.write('</object>');
|
||||
}
|
||||
if(window.navigator.platform=="Win64"){
|
||||
|
||||
document.write('<!-- 用来产生编辑状态的ActiveX控件的JS脚本--> ');
|
||||
document.write('<!-- 因为微软的ActiveX新机制,需要一个外部引入的js--> ');
|
||||
document.write('<object id="TANGER_OCX" classid="clsid:'+classidx64+'"');
|
||||
document.write('codebase="'+codebase64+'" width="'+width+'" height="'+height+'"> ');
|
||||
document.write('<param name="MakerCaption" value="'+MakerCaption+'"> ');
|
||||
document.write('<param name="MakerKey" value="'+MakerKey+'"> ');
|
||||
document.write('<param name="ProductCaption" value="'+ProductCaption+'"> ');
|
||||
document.write('<param name="ProductKey" value="'+ProductKey+'"> ');
|
||||
document.write('<param name="NoExpireKey" value="'+NoExpireKey+'"> ');
|
||||
document.write('<param name="IsUseUTF8URL" value="-1"> ');
|
||||
document.write('<param name="IsUseUTF8Data" value="-1"> ');
|
||||
document.write('<param name="Caption" value="NTKO OFFICE文档控件示例演示 http://www.ntko.com"> ');
|
||||
document.write('<SPAN STYLE="color:red">不能装载文档控件。请在检查浏览器的选项中检查浏览器的安全设置。</SPAN> ');
|
||||
document.write('</object>');
|
||||
}
|
||||
}
|
||||
else if (browser=="firefox"){
|
||||
document.write('<object id="TANGER_OCX" type="application/ntko-plug" codebase="'+codebase+'" width="'+width+'" height="'+height+'" ForOnSaveToURL="ntkosavetourl" ForOndocumentopened="ntkoondocumentopened"');
|
||||
document.write('ForOnpublishAshtmltourl="ntkopublishashtml"');
|
||||
document.write('ForOnpublishAspdftourl="ntkopublishaspdf"');
|
||||
document.write('ForOnSaveAsOtherFormatToUrl="ntkosaveasotherurl"');
|
||||
document.write('_MakerCaption="'+MakerCaption+'" ');
|
||||
document.write('_MakerKey="'+MakerKey+'" ');
|
||||
document.write('_ProductCaption="'+ProductCaption+'" ');
|
||||
document.write('_ProductKey="'+ProductKey+'" ');
|
||||
document.write('_NoExpireKey="'+NoExpireKey+'" ');
|
||||
document.write('clsid="{'+classid+'}" >');
|
||||
document.write('<SPAN STYLE="color:red">尚未安装NTKO Web FireFox跨浏览器插件</SPAN> ');
|
||||
document.write('</object> ');
|
||||
}else if(browser=="chrome"){
|
||||
document.write('<object id="TANGER_OCX" clsid="{'+classid+'}" ForOnSaveToURL="ntkosavetourl" ForOndocumentopened="ntkoondocumentopened"');
|
||||
document.write('ForOnpublishAshtmltourl="ntkopublishashtml"');
|
||||
document.write('ForOnpublishAspdftourl="ntkopublishaspdf"');
|
||||
document.write('ForOnCustomButtonOnMenuCmd="OnCustomButtonOnMenuCmd"');
|
||||
document.write('ForOnSaveAsOtherFormatToUrl="ntkosaveasotherurl"');
|
||||
document.write('_IsUseUTF8URL="-1" ');
|
||||
document.write('_IsUseUTF8Data="-1" ');
|
||||
document.write('_MakerCaption="'+MakerCaption+'" ');
|
||||
document.write('_MakerKey="'+MakerKey+'" ');
|
||||
document.write('_ProductCaption="'+ProductCaption+'" ');
|
||||
document.write('_NoExpireKey="'+NoExpireKey+'" ');
|
||||
document.write('_ProductKey="'+ProductKey+'" ');
|
||||
document.write('codebase="'+codebase+'" width="'+width+'" height="'+height+'" type="application/ntko-plug" >');
|
||||
document.write('<SPAN STYLE="color:red">尚未安装NTKO Web Chrome跨浏览器插件</SPAN> ');
|
||||
document.write('</object>');
|
||||
}else if (Sys.opera){
|
||||
alert("sorry,ntko web印章暂时不支持opera!");
|
||||
}else if (Sys.safari){
|
||||
alert("sorry,ntko web印章暂时不支持safari!");
|
||||
}
|
||||
window.onunload =function(){
|
||||
var ntkojb= ntkoBrowser.NtkoJudgingBrowsers();
|
||||
if(ntkojb){
|
||||
window.opener.ntkoCloseEvent();
|
||||
}
|
||||
}
|
||||
|
||||
//ie,谷歌,火狐传值
|
||||
var ntkoBrowser={
|
||||
ntkoSetReturnValueToParentPage:function(data1,text1){
|
||||
var ntkojb= ntkoBrowser.NtkoJudgingBrowsers();
|
||||
if(ntkojb){
|
||||
window.opener.ieattachEventntko(data1,text1);
|
||||
}else{
|
||||
window.external.SetReturnValueToParentPage(data1,text1);
|
||||
}
|
||||
},
|
||||
NtkoJudgingBrowsers:function(){
|
||||
try{
|
||||
var ntkobtop=window.opener.top.browser;
|
||||
return true;
|
||||
}catch(err){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
//触发父页面传值的功能
|
||||
var NtkoUrlTest = window.location.href;
|
||||
if(NtkoUrlTest!=null&&NtkoUrlTest!=""){
|
||||
var ntkoarry=new Array();
|
||||
ntkoarry.push(NtkoUrlTest);
|
||||
ntkoBrowser.ntkoSetReturnValueToParentPage("ntkoSendDataToChildtext",ntkoarry);
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user