Generates JavaScript and renders the Google Chart in the final HTML output.

 Parameters:
  *div_id            [Required] The ID of the DIV element that the Google Chart should be rendered in.
966133
def to_js(element_id)
      js =  ""
      js << "\n<script type='text/javascript'>"
      js << load_js(element_id)
      js << draw_js(element_id)
      js << "\n</script>"
      js
    end
1068643
function render(event) {
    var tooltip = document.createElement('div')
      , element = $(event.element)
      , pos = element.get('data-placement')
      , offset = this.offset(event.element)
      , placement;

    //
    // Create the tooltip with the proper content and insert.
    //
    tooltip.id = "tooltip";
    tooltip.innerHTML = element.get('data-content');
    tooltip.className = ['animated', 'tooltip', 'fadeIn', pos].concat(
      element.get('data-color')
    ).filter(Boolean).join(' ');

    document.body.appendChild(tooltip);

    //
    // Update the position of the tooltip.
    //
    placement = this.placement(pos, tooltip, event.element);
    tooltip.setAttribute('style', [
      'left:' + (offset.left + placement.left) + 'px',
      'top:' + (offset.top + placement.top) + 'px'
    ].join(';'));
  }
259089
function render () {
  todosContainer.innerHTML = '<ul>' +
    todos.map(function (todo, index) {
      return '<li class="item">' +
        todo +
        ' <button class="remove-todo" data-index="' + index + '">X</button>' +
      '</li>'
    }).join('') +
  '</ul>'

  document.dispatchEvent(new Event('render-event'))
}
1236251
public function run()
	{
		$id = $this->getId();

		// if there is no renderTo id, build the layer with current id and initialize renderTo option
		if (!isset($this->options['chart']) || !isset($this->options['chart']['renderTo'])) {
			$this->htmlOptions['id'] = $id;
			echo '<div ' . CHtml::renderAttributes($this->htmlOptions) . ' ></div>';

			if (isset($this->options['chart']) && is_array($this->options['chart'])) {
				$this->options['chart']['renderTo'] = $id;
			} else {
				$this->options['chart'] = array('renderTo' => $id);
			}
		}
		$this->registerClientScript();
	}
993562
function toHtml(){
        global $PAGE;

        // Enhance the select with javascript.
        $this->_generateId();
        $id = $this->getAttribute('id');

        if (!$this->isFrozen()) {
            $PAGE->requires->js_call_amd('core/form-autocomplete', 'enhance', $params = array('#' . $id, $this->tags, $this->ajax,
                $this->placeholder, $this->casesensitive, $this->showsuggestions, $this->noselectionstring));
        }

        $html = parent::toHTML();

        // Hacky bodge to add in the HTML code to the option tag. There is a nicer
        // version of this code in the new template version (see export_for_template).
        if ($this->valuehtmlcallback) {
            $html = preg_replace_callback('~value="([^"]+)"~', function($matches) {
                $value = html_entity_decode($matches[1]);
                $htmlvalue = call_user_func($this->valuehtmlcallback, $value);
                if ($htmlvalue !== false) {
                    return $matches[0] . ' data-html="' . s($htmlvalue) . '"';
                } else {
                    return $matches[0];
                }
            }, $html);
        }

        return $html;
    }
1335848
def show(self):
        
        display(HTML("""<div id="%s"></div>""" % (self.igv_id)))
        # DON'T check status before showing browser,
        msg = json.dumps({
            "id": self.igv_id,
            "command": "create",
            "options": self.config
        })
        self.comm.send(msg)
226247
public function run()
	{
		$id = $this->getId();
		$this->htmlOptions['id'] = $id;
		// if no container is set, it will create one
		if ($this->containerId == null) {
			$this->containerId = 'div-chart' . $id;
			echo '<div ' . CHtml::renderAttributes($this->htmlOptions) . '></div>';
		}
		$this->registerClientScript();
	}
136381
protected function renderContent() {        
        ?>                
        <div id="maj-geodisp-list-page" class="center">
			<h2><?php echo $this->data->get('title'); ?></h2>
			
			<?php
			if($this->data->get('has_analysis', false)) { 
			    /** @var GeoAnalysis $ga  */
    		    $ga = $this->data->get('geoanalysis');
    		?>
    		
    		<div id="geodispersion-panel">
    			<h3><?php echo $ga->getTitle() ?></h3>
    			
    			<div id="geodispersion-tabs">
    				<ul>
    					<li>
    						<a href="#geodisp-general"><?php echo I18N::translate('General data'); ?></a>
    					</li>
    					<li>
    						<a href="#geodisp-generations"><?php echo I18N::translate('Data by Generations'); ?></a>
    					</li>
    				</ul>
    				
    				<div id="geodisp-general">
    					<div id="loading-general" class="loading-image">&nbsp;</div>
    					<div id="geodisp-data-general" class="center"></div>
    				</div>
    				
    				<div id="geodisp-generations">
    					<div id="loading-generations" class="loading-image">&nbsp;</div>
    					<div id="geodisp-data-generations"></div>
    				</div>
    			</div>
    		</div>    		
      		
      		<?php } else { ?>
      		<p class="warning"><?php echo I18N::translate('The required dispersion analysis does not exist.'); ?><p>
      		<?php } ?>	
    	</div>
    	
    	<?php 
    }
1015474
function () {
        var self = this, layout = self._layout, role = this.settings.role;

        self.preRender();
        layout.preRender(self);

        return (
          '<div id="' + self._id + '" class="' + self.classes + '"' + (role ? ' role="' + this.settings.role + '"' : '') + '>' +
          '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' +
          (self.settings.html || '') + layout.renderHtml(self) +
          '</div>' +
          '</div>'
        );
      }
581897
protected void appendId(StringBuffer html, String id) {

        html.append(" name=\"");
        html.append(id);
        html.append("\" id=\"");
        html.append(id);
        html.append("\" ");
    }
325660
def render(self):
        
        html = ''
        href = self.view if self.view is not None else self.href
        
        attrs = copy(self.attrs)
        if self.submodal:
            attrs['role'] = "button"
            attrs['data-toggle'] = "remote-submodal"
            if self.data_target:
                if isinstance(self.data_target, basestring):
                    attrs['data-target'] = self.data_target
                else:
                    attrs['data-target'] = "#submodal"
        elif self.modal:
            attrs['role'] = "button"
            #attrs['data-dismiss'] = "modal"
            attrs['data-toggle'] = "modal"
            #attrs['data-submodal'] = "true"
            #attrs['data-remoteinbody'] = "false"
            if self.data_target:
                if isinstance(self.data_target, basestring):
                    attrs['data-target'] = self.data_target
                else:
                    attrs['data-target'] = "#modal"
            
        if self.data_tip:
            attrs['data-tip'] = self.data_tip
        if self.target:
            attrs['target'] = self.target
        if 'css_class' not in attrs:
            attrs['css_class'] = ''
        attrs['css_class'] += ' btn ' + " ".join(self.css)
        attrs = ' '.join(['%s="%s"' % (key if key != 'css_class' else 'class', value) for key,value in attrs.iteritems()])
        
        if href:
            if self.view:
                href = reverse(self.view, args=self.view_args, kwargs=self.view_kwargs)
            if self.next:
                href += '?next=%s' % (self.next if self.next.startswith('/') else reverse(self.next))
            html += '<a href="%s" %s>' % (href, attrs)
        else:
            html += '<button type="button" %s>' % (attrs,)
        
        if hasattr(self.inner, 'render'):
            html += self.inner.render()
        else:
            html += self.inner
        
        if self.title:
            html += self.title
        
        if href:
            html += "</a>"
        else:
            html += "</button>"
        
        return html
861070
function _draw_table_or_something(resp, manager){

	// Wipe interface.
	jQuery('#' + interface_id).empty();

	// Vary by what we got.
	if( ! resp.success() || resp.total_documents() === 0 ){
	    jQuery('#' + interface_id).append('<em>No results given your input and search fields. Please refine and try again.</em>');
	    last_response = null;
	}else{
	    last_response = resp;

	    // Render the buttons.
	    //console.log('user_buttons: ', user_buttons);
	    if( user_buttons && user_buttons.length && user_buttons.length > 0 ){

		// Ensure we have somewhere to put our buttons. If not
		// supplied with an injection id, make our own and use
		// it.
		var insert_div_id = user_buttons_div_id;
		if( ! user_buttons_div_id ){

		    // Generate new dic and add it to the display.
		    var ubt_attrs = {
			'generate_id': true
		    };
		    var ubt = new bbop.html.tag('div', ubt_attrs);
		    jQuery('#' + interface_id).append(ubt.to_string());
		    
		    // Ensure the id.
		    insert_div_id = ubt.get_id();
		}

		// Add all of the defined buttons after the spacing.
		_draw_user_buttons(user_buttons, insert_div_id);
	    }

	    // Display results.
	    var bwd = bbop.widget.display;
	    results_table =
		new bwd.results_table_by_class_conf_b3(conf_class, resp, linker,
						       handler, interface_id,
						       selectable_p,
						       select_column_id,
						       select_item_name);
	}
    }
1240456
function (id, callback) {
    var idIsArr = Array.isArray(id);

    if (!id || (idIsArr && id.length === 0)) {
      return _handleErr('Id required for id API call', callback);
    }

    // If an array of Id's was passed, generate a comma delimited string for
    // the query string.
    if (idIsArr) {
      id = id.join();
    }

    return this._request({
      api: 'gifs',
      query: {
        ids: id
      }
    }, callback);
  }
186788
def render(self, name, value, attrs=None, renderer=None):
        
        html = super(MarkdownWidget, self).render(name, value, attrs, renderer)
        attrs = self.build_attrs(attrs)
        html += editor_js_initialization("#%s" % attrs['id'])
        return mark_safe(html)
600528
function (div) {

            if (this._displayDiv != null) {
                return;
            }

            this.process();

            var document = Aria.$window.document;
            this._displayDiv = document.createElement('div');
            this._displayDiv.style.cssText = "position:absolute;top:0px;left:0px;width:100%;height:100%; z-index:99999999;overflow:auto;background:white";

            document.body.appendChild(this._displayDiv);

            Aria.loadTemplate({
                classpath : 'aria.utils.ProfilingDisplay',
                div : this._displayDiv,
                data : ariaUtilsJson.copy(this._logsPerClasspath, true)
            });
        }
884715
public function renderJs(): void
	{
		$el = Html::el('script type="text/javascript"');
		$el->addText('window.twttr=(function(d,s,id){var t,js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return}js=d.createElement(s);js.id=id;js.src="' . self::TWITTER_PLATFORM_URL . '";fjs.parentNode.insertBefore(js,fjs);return window.twttr||(t={_e:[],ready:function(f){t._e.push(f)}})}(document,"script","twitter-wjs"));');

		echo $el;
	}
147457
function() { 
        this.logger.log("Generating html");
        var sb = [];

        sb[sb.length] = '<table id="ygtvtableel' + this.index + '" border="0" cellpadding="0" cellspacing="0" class="ygtvtable ygtvdepth' + this.depth;
        if (this.enableHighlight) {
            sb[sb.length] = ' ygtv-highlight' + this.highlightState;
        }
        if (this.className) {
            sb[sb.length] = ' ' + this.className;
        }           
        sb[sb.length] = '"><tr class="ygtvrow">';
        
        for (var i=0;i<this.depth;++i) {
            sb[sb.length] = '<td class="ygtvcell ' + this.getDepthStyle(i) + '"><div class="ygtvspacer"></div></td>';
        }

        if (this.hasIcon) {
            sb[sb.length] = '<td id="' + this.getToggleElId();
            sb[sb.length] = '" class="ygtvcell ';
            sb[sb.length] = this.getStyle() ;
            sb[sb.length] = '"><a href="#" class="ygtvspacer">&#160;</a></td>';
        }

        sb[sb.length] = '<td id="' + this.contentElId; 
        sb[sb.length] = '" class="ygtvcell ';
        sb[sb.length] = this.contentStyle  + ' ygtvcontent" ';
        sb[sb.length] = (this.nowrap) ? ' nowrap="nowrap" ' : '';
        sb[sb.length] = ' >';
        sb[sb.length] = this.getContentHtml();
        sb[sb.length] = '</td></tr></table>';

        return sb.join("");

    }