예제 #1
0
    public function adminBodyEnd()
    {
        global $layout;
        $html = '';
        // Load CSS and JS only on Controllers in array.
        if (in_array($layout['controller'], $this->loadWhenController)) {
            $pluginPath = $this->htmlPath();
            $html = '<script>' . PHP_EOL;
            $html .= '$(document).ready(function() { ' . PHP_EOL;
            $html .= 'var simplemde = new SimpleMDE({
					element: document.getElementById("jscontent"),
					status: false,
					toolbarTips: true,
					toolbarGuideIcon: true,
					autofocus: false,
					lineWrapping: true,
					autoDownloadFontAwesome: false,
					indentWithTabs: true,
					tabSize: ' . $this->getDbField('tabSize') . ',
					spellChecker: false,
					toolbar: [' . Sanitize::htmlDecode($this->getDbField('toolbar')) . ']
			});';
            $html .= '$("#jsaddImage").on("click", function() {
					var filename = $("#jsimageList option:selected" ).text();
					if(!filename.trim()) {
						return false;
					}
					var text = simplemde.value();
					simplemde.value(text + "![alt text]("+filename+")" + "\\n");
			});';
            $html .= '}); </script>';
        }
        return $html;
    }
예제 #2
0
    public function siteBodyEnd()
    {
        // Path plugin.
        $pluginPath = $this->htmlPath();
        $html = '' . PHP_EOL;
        if ($this->getDbField('enable')) {
            $html .= '<!--html-compression no compression-->
<script>
// Set the number of snowflakes (more than 30 - 40 not recommended)
var snowmax=' . $this->getDbField('snowmax') . '
// Set the colors for the snow. Add as many colors as you like ("#aaaacc","#ddddff","#ccccdd","#f3f3f3","#f0ffff")
var snowcolor=new Array(' . Sanitize::htmlDecode($this->getDbField('snowcolor')) . ')
// Set the fonts, that create the snowflakes. Add as many fonts as you like("Times","Arial","Times","Verdana")
var snowtype=new Array("' . $this->getDbField('snowtype') . '")
// Set the letter that creates your snowflake (recommended: * )
var snowletter="' . Sanitize::htmlDecode($this->getDbField('snowletter')) . '"
// Set the speed of sinking (recommended values range from 0.3 to 2)
var sinkspeed=' . $this->getDbField('sinkspeed') . '
// Set the maximum-size of your snowflakes
var snowmaxsize=' . $this->getDbField('snowmaxsize') . '
// Set the minimal-size of your snowflakes
var snowminsize=' . $this->getDbField('snowminsize') . '
// Set the snowing-zone
// Set 1 for all-over-snowing, set 2 for left-side-snowing
// Set 3 for center-snowing, set 4 for right-side-snowing
var snowingzone=' . $this->getDbField('snowingzone') . '
</script>
<script src="' . $pluginPath . 'snowflakes.js"></script>' . PHP_EOL;
        }
        return $html;
    }
예제 #3
0
 private function ads4u()
 {
     $ret = '<!-- Ads4U BEGIN -->' . PHP_EOL;
     $ret .= Sanitize::htmlDecode($this->getDbField('ads4uCode')) . PHP_EOL;
     $ret .= '<!-- Ads4U END -->' . PHP_EOL;
     return $ret;
 }
예제 #4
0
파일: plugin.php 프로젝트: veshinak/bludit
    public function adminBodyEnd()
    {
        global $layout;
        $html = '';
        // Load CSS and JS only on Controllers in array.
        if (in_array($layout['controller'], $this->loadWhenController)) {
            $pluginPath = $this->htmlPath();
            $html = '<script>' . PHP_EOL;
            $html .= '$(document).ready(function() { ' . PHP_EOL;
            $html .= 'var simplemde = new SimpleMDE({
					element: document.getElementById("jscontent"),
					status: false,
					toolbarTips: true,
					toolbarGuideIcon: true,
					autofocus: false,
					lineWrapping: true,
					indentWithTabs: true,
					tabSize: ' . $this->getDbField('tabSize') . ',
					spellChecker: false,
					toolbar: [' . Sanitize::htmlDecode($this->getDbField('toolbar')) . ']
				});';
            $html .= '}); </script>';
        }
        return $html;
    }
예제 #5
0
 public function getDbField($key, $html = true)
 {
     if (isset($this->db[$key])) {
         if ($html) {
             // All fields from DBField are sanitized.
             return $this->db[$key];
         } else {
             // Decode HTML tags, this action unsanitized the variable.
             return Sanitize::htmlDecode($this->db[$key]);
         }
     }
     return '';
 }
예제 #6
0
    public function adminBodyEnd()
    {
        global $layout;
        $html = '';
        // Load CSS and JS only on Controllers in array.
        if (in_array($layout['controller'], $this->loadWhenController)) {
            $pluginPath = $this->htmlPath();
            $html = '<script>' . PHP_EOL;
            $html .= 'var simplemde = null;' . PHP_EOL;
            $html .= 'function addContentSimpleMDE(content) {
					var text = simplemde.value();
					simplemde.value(text + content + "\\n");
				}' . PHP_EOL;
            $html .= '$(document).ready(function() { ' . PHP_EOL;
            $html .= 'simplemde = new SimpleMDE({
					element: document.getElementById("jscontent"),
					status: false,
					toolbarTips: true,
					toolbarGuideIcon: true,
					autofocus: false,
					lineWrapping: true,
					autoDownloadFontAwesome: false,
					indentWithTabs: true,
					tabSize: ' . $this->getDbField('tabSize') . ',
					spellChecker: false,
					toolbar: [' . Sanitize::htmlDecode($this->getDbField('toolbar')) . ']
			});';
            /*
            $html .= '$("#jsaddImage").on("click", function() {
            
            		if(!imageFilename.trim()) {
            			return false;
            		}
            		var text = simplemde.value();
            		simplemde.value(text + "![alt text]("+imageFilename+")" + "\n");
            });';
            */
            // This is the event for Bludit images
            $html .= '$("body").on("dblclick", "img.bludit-thumbnail", function() {
					var filename = $(this).data("filename");
					addContentSimpleMDE("![alt text]("+filename+")");
			});';
            $html .= '}); </script>';
        }
        return $html;
    }
예제 #7
0
파일: plugin.php 프로젝트: vorons/bludit
    public function adminBodyEnd()
    {
        global $layout;
        global $Language;
        $html = '';
        // Load CSS and JS only on Controllers in array.
        if (in_array($layout['controller'], $this->loadWhenController)) {
            // Autosave
            global $_Page, $_Post;
            $autosaveID = $layout['controller'];
            $autosaveEnable = $this->getDbField('autosave') ? 'true' : 'false';
            if (isset($_Page)) {
                $autosaveID = $_Page->key();
            }
            if (isset($_Post)) {
                $autosaveID = $_Post->key();
            }
            $pluginPath = $this->htmlPath();
            $html = '<script>' . PHP_EOL;
            $html .= 'var simplemde = null;' . PHP_EOL;
            $html .= 'function addContentSimpleMDE(content) {
					var text = simplemde.value();
					simplemde.value(text + content + "\\n");
				}' . PHP_EOL;
            // This function is necesary on each Editor, it is used by Bludit Images v8.
            $html .= 'function editorAddImage(filename) {
					addContentSimpleMDE("![' . $Language->get('Image description') . ']("+filename+")");
				}' . PHP_EOL;
            $html .= '$(document).ready(function() { ' . PHP_EOL;
            $html .= 'simplemde = new SimpleMDE({
					element: document.getElementById("jscontent"),
					status: false,
					toolbarTips: true,
					toolbarGuideIcon: true,
					autofocus: false,
					lineWrapping: true,
					autoDownloadFontAwesome: false,
					indentWithTabs: true,
					tabSize: ' . $this->getDbField('tabSize') . ',
					spellChecker: false,
					autosave: {
						enabled: ' . $autosaveEnable . ',
						uniqueId: "' . $autosaveID . '",
						delay: 1000,
					},
					toolbar: [' . Sanitize::htmlDecode($this->getDbField('toolbar')) . ']
			});';
            $html .= '}); </script>';
        }
        return $html;
    }
예제 #8
0
    public function siteBodyEnd()
    {
        // Path plugin.
        $pluginPath = $this->htmlPath();
        $html = '' . PHP_EOL;
        if ($this->getDbField('adblock')) {
            $html .= '<script src="' . $pluginPath . 'js/advert.js"></script>' . PHP_EOL;
            $html .= '<script>
if (document.getElementById("ads") == null) {

    document.write("<div id=\'advert-notice\'>' . Sanitize::htmlDecode($this->getDbField('adblock_message')) . '</div>");

}
</script>' . PHP_EOL;
        }
        return $html;
    }
예제 #9
0
파일: plugin.php 프로젝트: MSylvia/bludit
    public function adminBodyEnd()
    {
        global $layout;
        $html = '';
        // Load CSS and JS only on Controllers in array.
        if (in_array($layout['controller'], $this->loadWhenController)) {
            // Autosave
            global $_Page, $_Post;
            $autosaveID = $layout['controller'];
            $autosaveEnable = $this->getDbField('autosave') ? 'true' : 'false';
            if (isset($_Page)) {
                $autosaveID = $_Page->key();
            }
            if (isset($_Post)) {
                $autosaveID = $_Post->key();
            }
            $pluginPath = $this->htmlPath();
            $html = '<script>' . PHP_EOL;
            $html .= 'var simplemde = null;' . PHP_EOL;
            $html .= 'function addContentSimpleMDE(content) {
					var text = simplemde.value();
					simplemde.value(text + content + "\\n");
				}' . PHP_EOL;
            $html .= '$(document).ready(function() { ' . PHP_EOL;
            $html .= 'simplemde = new SimpleMDE({
					element: document.getElementById("jscontent"),
					status: false,
					toolbarTips: true,
					toolbarGuideIcon: true,
					autofocus: false,
					lineWrapping: true,
					autoDownloadFontAwesome: false,
					indentWithTabs: true,
					tabSize: ' . $this->getDbField('tabSize') . ',
					spellChecker: false,
					autosave: {
						enabled: ' . $autosaveEnable . ',
						uniqueId: "' . $autosaveID . '",
						delay: 1000,
					},
					toolbar: [' . Sanitize::htmlDecode($this->getDbField('toolbar')) . ']
			});';
            // This is the event for Bludit images
            $html .= '$("body").on("dblclick", "img.bludit-thumbnail", function() {
					var filename = $(this).data("filename");
					addContentSimpleMDE("![alt text]("+filename+")");
			});';
            $html .= '}); </script>';
        }
        return $html;
    }