Esempio n. 1
0
 protected function getInput()
 {
     $this->value = str_replace('<br />', "\n", strpos($this->value, " ") > 0 ? $this->value : JText::_($this->value));
     JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php");
     JEVHelper::ConditionalFields($this->element, $this->form->getName());
     return parent::getInput();
 }
Esempio n. 2
0
    public function getInput()
    {
        $html = array();
        $html[] = parent::getInput();
        // Auto-populate config text if a preset configuration is selected
        // Also change preset selection to "Custom" if the text in this field has been modified
        // so that it will not be overwrited on save
        $script = '
			window.addEvent("domready", function() {
				var thisControl = $("' . $this->getId('digits_xml', 'digits_xml') . '");
				var textField = $("scdp_config_text");
				if(textField) {
					var text = textField.get("value").replace(/\\t/g, "    ");
					thisControl.set("value", text);
				}
				thisControl.addEvent("change", function(e) {
					var presetControl = $("' . $this->getId('digits_config', 'digits_config') . '");
					presetControl.set("value", "");
				});
			});
		';
        $document = JFactory::getDocument();
        $document->addScriptDeclaration($script);
        $document->addStyleSheet(JURI::root(true) . '/modules/mod_smartcountdown/styles.css');
        return implode("\n", $html);
    }
    /**
     * Method to get the textarea field input markup.
     * Use the rows and columns attributes to specify the dimensions of the area.
     *
     * @return  string  The field input markup.
     * @since   11.1
     */
    protected function getInput()
    {
        // Initialize some field attributes.
        static $identifier;
        if (!isset($identifier)) {
            JHTML::_('behavior.modal');
            $identifier = 0;
        }
        $identifier++;
        // Initialize JavaScript field attributes.
        $button = '<br clear="left"/><br /><input type="button" class="btn" id="modal' . $identifier . '" href="../plugins/editors/arkeditor/form/fields/modals/typography.php" rel="{handler: \'iframe\' , size: {x:640, y:480}}" value="Expand View"/>
<script type="text/javascript">
window.addEvent(\'domready\', function()
{
	var dialog = document.getElementById("modal' . $identifier . '");
	dialog.addEvent("click",function()
	{
		SqueezeBox.fromElement(dialog,	{ parse: \'rel\'});
	});	
	
}); 
</script>';
        if ($this->value) {
            $this->value = base64_decode($this->value);
        }
        $textarea = parent::getInput();
        return str_replace('<textarea ', '<textarea style="overflow:auto; min-width:50%;" ', $textarea) . $button;
    }
Esempio n. 4
0
 /**
  * Method to get the textarea field input markup.
  * Use the rows and columns attributes to specify the dimensions of the area.
  *
  * @return  string  The field input markup.
  *
  * @since   2.0
  */
 public function getInput()
 {
     if ($this->value) {
         $value = json_decode($this->value);
         $this->value = implode("\n", $value);
     }
     return parent::getInput();
 }
Esempio n. 5
0
 public function getInput()
 {
     $buffer = parent::getInput();
     if (isset($this->element->description)) {
         $buffer .= '<label></label>';
         $buffer .= '<div style="float:left;">' . JText::_($this->element->description) . '</div>';
     }
     return $buffer;
 }
Esempio n. 6
0
 /**
  * Method to get the textarea field input markup.
  * Use the rows and columns attributes to specify the dimensions of the area.
  *
  * @return  string  The field input markup.
  * @since   11.1
  */
 function getInput()
 {
     if (empty($this->value)) {
         $this->value = JText::_(JText::_($this->element['default']) . $this->Addition('default'));
     }
     $output = parent::getInput();
     $output .= $this->Addition('input');
     return $output;
 }
    /**
     * Method to get the textarea field input markup.
     * Use the rows and columns attributes to specify the dimensions of the area.
     *
     * @return  string  The field input markup.
     *
     * @since   11.1
     */
    protected function getInput()
    {
        $html = parent::getInput();
        $html .= $this->getCounterMask();
        // @TODO : Convert this into a snippet that loads only once
        // using the .charcounter selector
        $doc = JFactory::getDocument();
        $doc->addScriptDeclaration('
			jQuery(document).ready(function() {
				jQuery("#' . $this->id . '").on("keyup", function() { 
					jQuery("#usedchars_' . $this->id . '").text(jQuery("#' . $this->id . '").val().length);
					jQuery("#remainingchars_' . $this->id . '").text((' . $this->maxlength . ' - jQuery("#' . $this->id . '").val().length));
				});
			});
		');
        return $html;
    }
Esempio n. 8
0
 protected function getInput()
 {
     // interface elements
     $html = '<div id="ratingmanager_errors" data-exists-text="' . JText::_('PLG_CONTENT_GKRATING_ERROR_EXISTS') . '" data-empty-text="' . JText::_('PLG_CONTENT_GKRATING_ERROR_EMPTY') . '"></div><div class="ratingmanager_form"><label for="ratingmanager_feature">' . JText::_('PLG_CONTENT_GKRATING_FEATURE_LABEL') . '</label><input type="text" name="ratingmanager_feature" id="ratingmanager_feature" value="" placeholder="' . JText::_('PLG_CONTENT_GKRATING_FEATURE_PLACEHOLDER') . '">';
     $html .= '<label for="ratingmanager_value">' . JText::_('PLG_CONTENT_GKRATING_VALUE_LABEL') . '</label>';
     $html .= '<div class="input-prepend"><input type="number" name="ratingmanager_value" id="ratingmanager_value" min="1" max="10" step="0.5" value="5" />';
     $html .= '<input type="button" class="btn" id="ratingform_add" value="' . JText::_('PLG_CONTENT_GKRATING_ADD') . '" /></div>';
     $html .= '<ul class="ratingWrapper" data-remove-text="' . JText::_('PLG_CONTENT_GKRATING_REMOVE') . '">';
     if ($this->value && json_decode($this->value) !== NULL && is_array(json_decode($this->value))) {
         foreach (json_decode($this->value) as $k => $v) {
             $html .= '<li><span class="icon-menu"></span> <span class="rate-label">' . $v->label . '</span> - <span class="rate-value">' . $v->val . '</span><a href="#" class="rate-remove">' . JText::_('PLG_CONTENT_GKRATING_REMOVE') . '</a></label></li>';
         }
     }
     $html .= '</ul></div>';
     // render text area with DRY attitude :)
     $html .= parent::getInput();
     $plugin = JPluginHelper::getPlugin('content', 'gkrating');
     $params = new JRegistry($plugin->params);
     return $html;
 }
    /**
     * Method to get the user field input markup.
     *
     * @return  string  The field input markup.
     *
     * @since   1.6.0
     */
    protected function getInput()
    {
        $html = parent::getInput();
        $html = str_replace('</span>', '<a href="#" class="btn btn-default" onclick="checkitout(this);" style="float:right;"><i class="fa fa-cogs"></i>Check out</a></span>', $html);
        $html = str_replace("fullwidth", "fullwidth linecodehere", $html);
        $script = '<script type="text/javascript">

					function checkitout(el){
						var auto_fulltext = 1;
						var textarea = el.parentNode.parentNode.getElementsByTagName("textarea")[1].value;
						var input_url = el.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.getElementsByClassName("obkey")[0].innerText;
						if(input_url == "Click me"){
						 	alert ("Please choose the first input field!");
						 	return false;
						}else{
						 	var list_oe = document.getElementById("ob-oe");
						 	var list_li = list_oe.getElementsByTagName("li");
						 	if("" != textarea){
						 		auto_fulltext = 0;
						 	}
						 	var value_input;
						 	for(var i=0;i<list_li.length;i++){
						 		var innerhtm = list_li[i].innerHTML;
						 		var first_innertext = innerhtm.split("</text><br>")[0];
						 		if (input_url==first_innertext.split(">")[1]){
						 			value_input = list_li[i].getElementsByTagName("p")[0].innerText;
						 		}
							}
							if(!checkValidurl(value_input)){
								alert ("Please input the valid url!");
								return false;
							}
							var url = encodeURI("http://demo.foobla.com/html_parser/index.php?url="+value_input+"&code="+textarea+"&auto_fulltext="+auto_fulltext);
							window.open(url);
							//document.write(\'<iframe height="450"  allowTransparency="true" frameborder="0" scrolling="yes" style="width:100%;" src="\'+value_input+\'" type= "text/javascript"></iframe>\');

						}

						/*jQuery(\'#myModal\').on(\'shown.bs.modal\',function (e){
								jQuery(\'#modal_iframe\').attr("src", url);
							}).on("show.bs.modal", function () {
							jQuery(this).find(".modal-dialog").css("height", \'800px\').css("width", \'1000px\').css(\'margin-top\', \'100px\');
							});

							jQuery(\'#myModal\').modal({show: true});*/
					}
					function checkValidurl(url){
						url_validate = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/;
						if(!url_validate.test(url)){
						   return false;
						}
						else{
						   return true;
						}
					}
					function change_auto_fulltext(el){
						var list_li = el.parentNode.parentNode.parentNode.getElementsByClassName("col-md-6")[1];
						var select = list_li.getElementsByTagName("select")[0];
						if(select.value == 1 && el.value != ""){
							select.value = 0;
						}
					}
					</script>';
        $line_script = '<script type="text/javascript">
			(function($){
			$.fn.linenumbers = function(in_opts){
				// Settings and Defaults
				var opt = $.extend({
					col_width: \'25px\',
					start: 1,
					digits: 4.
				},in_opts);
				return this.each(function(){
					// Get some numbers sorted out for the CSS changes
					var new_textarea_width = (parseInt($(this).css(\'width\'))-parseInt(opt.col_width))+\'px\';
					var new_textarea_height = parseInt($(this).css(\'height\'))+\'px\';
					var new_textarea_lineheight = parseInt($(this).css(\'line-height\'))+\'px\';
					var padding_top = parseInt($(this).css(\'padding-top\'))+\'px\';
					// Create the div and the new textarea and style it
					$(this).before(\'<div style="width:\'+$(this).css(\'width\')+\';"><textarea style="width:\'+new_textarea_width+\';height:\'+new_textarea_height+\';padding-top:\'+padding_top+\';line-height:\'+new_textarea_lineheight+\';float:left;margin-right:\'+\'-\'+new_textarea_width+\';white-space:pre;overflow:hidden;" disabled="disabled"></textarea>\');
					$(this).after(\'<div style="clear:both;"></div></div>\');
					// Edit the existing textarea\'s styles
					$(this).css({\'font-family\':\'monospace\',\'resize\':\'none\',\'height\':new_textarea_height,\'width\':new_textarea_width,\'float\':\'right\'});
					// Define a simple variable for the line-numbers box
					var lnbox = $(this).parent().find(\'textarea[disabled="disabled"]\');
					// Bind some actions to all sorts of events that may change it\'s contents
					$(this).bind(\'blur focus change keyup keydown\',function(){
						// Break apart and regex the lines, everything to spaces sans linebreaks
						var lines = "\\n"+$(this).val();
						lines = lines.match(/[^\\n]*\\n[^\\n]*/gi);
						// declare output var
						var line_number_output=\'\';
						// declare spacers and max_spacers vars, and set defaults
						var max_spacers = \'\'; var spacers = \'\';
						for(var i=0;i<opt.digits;i++){
							max_spacers += \' \';
						}
						// Loop through and process each line
						$.each(lines,function(k,v){
							// Add a line if not blank
							if(k!=0){
								line_number_output += "\\n";
							}
							// Determine the appropriate number of leading spaces
							lencheck = k+opt.start+\'!\';
							spacers = max_spacers.substr(lencheck.length-1);
							// Add the line, trimmed and with out line number, to the output variable
							line_number_output += spacers+(k+opt.start)+\':\'+v.replace(/\\n/gi,\'\').replace(/./gi,\' \').substr(opt.digits+1);
						});
						// Give the text area out modified content.
						$(lnbox).val(line_number_output);
						// Change scroll position as they type, makes sure they stay in sync
						$(lnbox).scrollTop($(this).scrollTop());
					})
					// Lock scrolling together, for mouse-wheel scrolling
					$(this).scroll(function(){
						$(lnbox).scrollTop($(this).scrollTop());
					});
					// Fire it off once to get things started
					$(this).trigger(\'keyup\');
				});
			};
		})(jQuery);
		jQuery(\'document\').ready(function(){
			jQuery(\'.linecodehere\').linenumbers({col_width:\'35px\'});
		})
		</script>';
        return $html . $script . $line_script;
    }
 protected function getInput()
 {
     $this->value = str_replace('<br />', "\n", JText::_($this->value));
     return parent::getInput();
 }
Esempio n. 11
0
 /**
  * 
  * @return type
  */
 protected function getInput()
 {
     $oFileRetriever = JchOptimizeFileRetriever::getInstance($this->getParams());
     if ($GLOBALS['bTextArea']) {
         return parent::getInput();
     }
     if (!$oFileRetriever->isUrlFOpenAllowed()) {
         $GLOBALS['bTextArea'] = TRUE;
         JFactory::getApplication()->enqueueMessage(JText::_('Your host does not have cURL or allow_url_fopen enabled. ' . 'Will use text areas instead of multiselect options for exclude settings'), 'notice');
         return parent::getInput();
     }
     try {
         $aOptions = $this->getFieldOptions();
     } catch (Exception $ex) {
         JFactory::getApplication()->enqueueMessage($ex->getMessage(), 'warning');
         return parent::getInput();
     }
     $sField = JHTML::_('select.genericlist', $aOptions, $this->name . '[]', 'class="inputbox" multiple="multiple" size="5"', 'id', 'name', $this->value, $this->id);
     return $sField;
 }