搜索“copycode”,template/wind/lang_bbscode.php里面:
'copycode' => '复制代码',
js/core/core.js里面:
function CopyCode(obj) {
if (typeof obj != 'object') {
if (is_ie) {
if(window.clipboardData.setData("Text",obj)){
alert('复制成功!');
}
} else {
prompt('按Ctrl+C复制内容', obj);
}
} else if (is_ie) {
var lis = obj.getElementsByTagName('li'), ar = [];
for(var i=0,l=lis.length; i<l; i++){
ar.push(lis[i].innerText);
}
if(window.clipboardData.setData('Text', ar.join("\r\n") ) ){
alert('复制成功!');
}
} else {
function openClipWin(){
var lis = obj.getElementsByTagName('li'), ar = [];
for(var i=0,l=lis.length; i<l; i++){
ar.push(lis[i].textContent);
}
window.clip = new ZeroClipboard.Client();
clip.setHandCursor( true );
clip.addEventListener('complete', function (client, text) {
alert("复制成功!" );
closep();
});
clip.setText(ar.join("\r\n"));
var clipEle = getObj('clipWin');
if (!clipEle){
var clipEle = document.createElement('div');
clipEle.innerHTML = '<div class="popout"><table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="bgcorner1"></td><td class="pobg1"></td><td class="bgcorner2"></td></tr><tr><td class="pobg4"></td><td><div class="popoutContent">\
<div class="p10"><a href="javascript:closep();" class="adel">关闭</a>提示</div><div class="popBottom"><span class="btn2"><span><button type="button">点击这里复制代码</button></span></span></div></div></td><td class="pobg2"></td></tr><tr><td class="bgcorner4"></td><td class="pobg3"></td><td class="bgcorner3"></td></tr></tbody></table></div>';
//clipEle.innerHTML = '<p id="d_clip_button">提示</p>';
clipEle.style.display = 'none';
document.body.appendChild(clipEle);
}
read.open(clipEle, null, 2);
var btn = getObj('pw_box').getElementsByTagName('button')[0];
clip.glue(btn);
//clip.glue( 'd_clip_button', 'd_clip_container' );
}//彈窗
if (!window.clip){
var script = document.createElement('script');
script.src = 'js/ZeroClipboard.js';
script.onload = function(){
ZeroClipboard.setMoviePath( 'js/ZeroClipboard.swf' );
openClipWin();
};
document.body.appendChild(script);
}else{
openClipWin();
}
}
return false;
}