diff --git a/helper.php b/helper.php index da2a13b9..8136c6d3 100644 --- a/helper.php +++ b/helper.php @@ -146,7 +146,7 @@ function registerOnLoad($js){ } } - +$ckg_brokenimg = $this->getLang('broken_image'); $default_fb = $this->getConf('default_fb'); if($default_fb == 'none') { $client = ""; @@ -472,6 +472,18 @@ function FCKeditor_OnComplete( editorInstance ) editorInstance.on("focus", function(e) { window.dwfckTextChanged = true; }); + + var broken_image ='http://' + location.host + DOKU_BASE + '/lib/plugins/ckgedit/fckeditor/userfiles/blink.jpg?nolink&33x34'; + + editorInstance.on("paste", function(e) { + var len = e.data.dataValue.length; + var broken_msg = "$ckg_brokenimg " + len; + if(e.data.dataValue.match(/data:image\/\w+;base64/) && len > 100000 ) { + alert(broken_msg + len); + e.data.dataValue = ''; + + } + }); oDokuWiki_FCKEditorInstance.dwiki_user = "$user_type"; oDokuWiki_FCKEditorInstance.dwiki_client = "$client"; diff --git a/lang/en/lang.php b/lang/en/lang.php index 412932f7..4bb7848f 100755 --- a/lang/en/lang.php +++ b/lang/en/lang.php @@ -63,3 +63,4 @@ $lang['js']['on'] ='on'; $lang['js']['off'] ='off'; $lang['broken_image'] = 'Use the imagePaste plugin with the Dokuwiki Mediamanager. Raw data of Ctrl-v images cannot exceed 1M. This image is: '; +