| | |
| | | <apex:page standardController="Quote" id="page11" showHeader="false" sidebar="false" pageStyle="Quote" > |
| | | <apex:page standardController="Quote" showHeader="false" sidebar="false" pageStyle="Quote" > |
| | | <script type="text/javascript"> |
| | | function closeMe() { |
| | | top.window.close(); |
| | |
| | | top.window.close(); |
| | | } |
| | | function setCB() { |
| | | var userAgent = navigator.userAgent; |
| | | var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; |
| | | var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; |
| | | var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1; |
| | | if (isIE|| isIE11 ){ |
| | | //txt = document.forms['{!$Component.mainForm}']['{!$Component.mainForm.page1.exceltext}'].value; |
| | | txt = window.clipboardData.getData("text"); |
| | | document.forms['{!$Component.mainForm}']['{!$Component.mainForm.page1.exceltext}'].value = txt; |
| | | }else{ |
| | | try{ |
| | | navigator.clipboard.readText().then(function(text){ |
| | | document.getElementById('page11:mainForm:page1:exceltext').value =text ; |
| | | }); |
| | | }catch(err){ |
| | | alert('粘贴失败!'); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <apex:form id="mainForm"> |
| | | <apex:pageBlock id="page1"> |
| | |
| | | </tr> |
| | | <tr> |
| | | <td colspan="2"><apex:outputLabel value="{!$Label.Tab_Text}"/></td> |
| | | <td><apex:commandButton onclick="setCB();return false;" style="width:100px" value="{!$Label.Paste_IE}" /></td> |
| | | <td> <!-- <apex:commandButton onclick="setCB()" style="width:100px" value="{!$Label.Paste_IE}" /> --></td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="3"><apex:inputTextarea style="width:350px;height:100px" id="exceltext"/></td> |