Ejemplo n.º 1
0
    protected function getInput()
    {
        $document = JFactory::getDocument();
        $script = '
			window.addEvent("domready", function () {
				document.formvalidator.setHandler("comment",
					function (value) {
						if(value.length <= 1){
							return false;
						}

						return true;
					});
			});
		';
        $document->addScriptDeclaration($script);
        $html = "<div class=\"clr\"></div><textarea id=\"" . $this->id . "\" name=\"" . $this->name . "\" class = \"required validate-comment comment-editor\">" . $this->value . "</textarea>";
        JUDownloadFrontHelperEditor::getWysibbEditor('.comment-editor');
        return $html;
    }
Ejemplo n.º 2
0
                $readmoreCommentJS = "jQuery(document).ready(function($){
				            $('.comment-text .comment-content').readmore({
				                speed    : 300,
				                maxHeight: 150,
				                moreLink: '<span class=\"see-more\" title=\"" . JText::_('COM_JUDOWNLOAD_SEE_MORE') . "\" href=\"#\"><i class=\"fa fa-chevron-down\"></i></span>',
				                lessLink: '<span class=\"see-less\" title=\"" . JText::_('COM_JUDOWNLOAD_SEE_LESS') . "\" href=\"#\"><i class=\"fa fa-chevron-up\"></i></span>',
				                embedCSS: false
				            });
				        });";
                $document->addScriptDeclaration($readmoreCommentJS);
            }

            if ($this->params->get('comment_form_editor', 'wysibb') == 'wysibb' && $this->params->get('comment_system', 'default') == 'default')
            {
                JUDownloadFrontHelperEditor::getWysibbEditor('.comment-editor');
                // JText in comment-wysibb.js
                JText::script('COM_JUDOWNLOAD_UPDATE_COMMENT_ERROR');
                JText::script('COM_JUDOWNLOAD_PLEASE_ENTER_AT_LEAST_N_CHARACTERS');
                JText::script('COM_JUDOWNLOAD_CONTENT_LENGTH_REACH_MAX_N_CHARACTERS');
                $document->addScript(JUri::root(true) . "/components/com_judownload/assets/js/comment-wysibb.js");
            }
        }

		break;

	case 'embeddocument':
		$document->addScript(JUri::root(true) . "/components/com_judownload/assets/js/view.embeddocument.js");
		$document->addStyleSheet(JUri::root(true) . "/components/com_judownload/templates/" . $self_template . "/assets/css/embeddocument.css");
		break;