使用书签运行就可以了
注意:https协议的网站不行
网上似乎没这种插件
目前只支持简单粉笔功能,热度高的话后续再添加功能
(function () {
var cdn_css = [
'http://wpaint.websanova.com/lib/wColorPicker.min.css',
'http://wpaint.websanova.com/wPaint.min.css'
];
var dom = {
link:this.link || document.createElement('link'),
script:this.script || document.createElement('script')
};
var cdn_script =[
"http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js",
"http://wpaint.websanova.com/lib/jquery.ui.core.1.10.3.min.js",
"http://wpaint.websanova.com/lib/jquery.ui.widget.1.10.3.min.js",
"http://wpaint.websanova.com/lib/jquery.ui.mouse.1.10.3.min.js",
"http://wpaint.websanova.com/lib/jquery.ui.draggable.1.10.3.min.js",
"http://wpaint.websanova.com/lib/wColorPicker.min.js",
"http://wpaint.websanova.com/wPaint.min.js",
"http://wpaint.websanova.com/plugins/main/wPaint.menu.main.min.js",
"http://wpaint.websanova.com/plugins/text/wPaint.menu.text.min.js",
"http://wpaint.websanova.com/plugins/shapes/wPaint.menu.main.shapes.min.js",
"http://wpaint.websanova.com/plugins/file/wPaint.menu.main.file.min.js"
];
var i = 0;
var forbidSelecte = function () {
if(document.all){
document.onselectstart= function(){return false;};
}else{
document.οnmοusedοwn= function(){return false;};
document.οnmοuseup= function(){return true;};
}
document.onselectstart = new Function('event.returnValue=false;');
};
var appendScript = function (src) {
var dom = {
script:this.script || document.createElement('script')
};
dom.script.setAttribute('src',src);
document.getElementsByTagName('head')[0].appendChild(dom.script);
dom.script.onload = function () {
if(i < cdn_script.length){
appendScript(cdn_script[i++]);
}else{
$('body').wPaint();
$('.wPaint-menu').hide();
forbidSelecte();
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML='.wPaint-canvas{z-index:99999999999999}';
document.getElementsByTagName('head')[0].appendChild(style);
}
};
};
var appendlink = function (href) {
var dom = {
link:this.link || document.createElement('link')
};
dom.link.setAttribute('href',href);
document.getElementsByTagName('head')[0].appendChild(dom.link);
};
function init() {
$('body').wPaint();
};
for(var href in cdn_css){
if(cdn_css[href]){
appendlink(cdn_css[href]);
}
};
appendScript(cdn_script[i]);
})();