填充 HTML
@param spinner
334370
function (spinner) {
    var $spinner = $(spinner);
    var layer;
    if ($spinner.hasClass('mdui-spinner-colorful')) {
      layer = layerHTML('1') + layerHTML('2') + layerHTML('3') + layerHTML('4');
    } else {
      layer = layerHTML();
    }

    $spinner.html(layer);
  }
1368088
def spinner(self, spinner=None):
        

        self._spinner = self._get_spinner(spinner)
        self._frame_index = 0
        self._text_index = 0
1290584
private synchronized void init(String serverUrl) {
        LOGGER.info("开始下载URL抽取规则");
        LOGGER.info("serverUrl: " + serverUrl);
        //从配置管理web服务器获取完整的抽取规则
        String json = downJson(serverUrl);
        LOGGER.info("完成下载URL抽取规则");
        //抽取规则
        LOGGER.info("开始解析URL抽取规则");
        List<UrlPattern> urlPatterns = parseJson(json);
        LOGGER.info("完成解析URL抽取规则");
        init(urlPatterns);
    }
852682
function(content){

			var html = '';

			html += '<div class="ja_wrap '+backgroundClasses.join(' ')+'">'+
					'<div class="jAlert '+classes.join(' ')+ '" style="' +styles.join(' ')+ '" id="' +alert.id+ '">'+
					'<div>';

			if( alert.closeBtn )
			{
				html += 		"<div class='closejAlert ja_close";
				if( alert.closeBtnAlt )
				{
					html += ' ja_close_alt';
				}
                else if( alert.closeBtnRoundWhite )
                {
                    html += ' ja_close_round_white';
                }
                else if( alert.closeBtnRound )
                {
                    html += ' ja_close_round';
                }
				html += "'>&times;</div>"; //closejAlert has a close handler attached, ja_close is for styling
			}

			if( alert.title )
			{
				html += 		"<div class='ja_title'><div>"+alert.title+"</div></div>";
			}

			html += 			'<div class="ja_body">'+content;


			if( alert.btns )
			{
				html += 			'<div class="ja_btn_wrap ';

				if( alert.btnBackground )
				{
					html += 		'optBack';
				}

				html += 			'">';
			}

			if( typeof alert.btns[0] == 'object' )
			{
				$.each(alert.btns, function(index, btn){
					if( typeof btn == 'object' )
					{
						html += 		getBtnHTML(btn);
					}
				});
			}
			else if( typeof alert.btns == 'object' )
			{
				html += 				getBtnHTML(alert.btns);
			}
			else if( alert.btns )
			{
				console.log('jAlert Config Error: Incorrect value for btns (must be object or array of objects): '+alert.btns);
			}

			if( alert.btns )
			{
				html += 			'</div>';
			}

			html += 			'</div>'+
					'</div>'+
					'</div>'+
					'</div>';

			var alertHTML = $(html);

			if( alert.replaceOtherAlerts )
			{
                var alerts = $('.jAlert:visible');
                alerts.each(function(){
                    $(this).jAlert().closeAlert();
                });
			}

			$('body').append(alertHTML);

            //cache instance
			alert.instance = $('#'+alert.id);

            //attach alert object to dom element
            alert.instance[0]['jAlert'] = alert;

            //doing this now will prevent it from happening mid-animation
            $('html,body').css('overflow', 'hidden');

            //show the new alert
			alert.animateAlert('show');

            //add close button handler
			if( alert.closeBtn ){

				alert.instance.on('click', '.closejAlert', function(e){
					e.preventDefault();
					$(this).parents('.jAlert:first').jAlert().closeAlert();
					return false;
				});

			}

			/* Bind mouseup handler to document if this alert has closeOnClick enabled */
			if( alert.closeOnClick ){

				/* Unbind if already exists */
				$(document).off('mouseup touchstart', $.fn.jAlert.onMouseUp);

				/* Bind mouseup */
				$(document).on('mouseup touchstart', $.fn.jAlert.onMouseUp);

			}

			/* Bind on keydown handler to document and if esc was pressed, find all visible jAlerts with that close option enabled and close them */
			if( alert.closeOnEsc ){

				/* Unbind if already exists */
				$(document).off('keydown', $.fn.jAlert.onEscKeyDown);

				/* Bind keydown */
				$(document).on('keydown', $.fn.jAlert.onEscKeyDown);

			}

			/* If there are onOpen callbacks, run them. */
			if( alert.onOpen )
			{
				$.each(alert.onOpen, function(index, onOpen){
					onOpen(alert.instance);
				});
			}

			/* If the alert has an element that should be focused by default */
			if( alert.autofocus )
			{
				alert.instance.find(alert.autofocus).focus();
			}
			else
			{
				alert.instance.focus();
			}
            /*
            	Set Auto
            	usage $.jAlert({
            		autoClose : 3500,
            	});
             */
            if(alert.autoClose)
            {
                $.fn.closeTimer(function()
				{
                    var currentAlert = $.jAlert('current');
                    if(currentAlert !== false)
                    {
                        currentAlert.closeAlert();
                    }
				}, alert.autoClose);
            }

			return alert.instance;

		}
1020637
function smartSpinner(cbk, spinners = ['dots']) {//{{{

    var messageCbk;

    var stopped = false;
    let frame = 0;
    let spinner = 0;
    let next;
    let is_tty = tty.isatty(process.stdout.fd);


    function showNextFrame () {//{{{
        const frames = cliSpinners[spinners[spinner]].frames;
        logUpdate(frames[frame++ % frames.length] + ' ' + messageCbk(true));
    };//}}}

    function ctrlAPI(stop, newCbk) {//{{{

        // Ignore calls after spinning finished:
        if (stopped) return false;

        // Make stop parameter optinal:
        if ("boolean" != typeof stop) {
            newCbk = stop;
            stop = undefined;
        };

        // Message string/callback updating operation:
        if (newCbk !== undefined) {
            // Accept callback or literal string:
            messageCbk = ("function" == typeof newCbk)
                ? newCbk
                : ()=>newCbk
            ;
            if (! is_tty) {
                if (stop !== undefined) {
                    stop || process.stdout.write("\n");
                } else {
                    console.log(symbols.arrow + ' ' + messageCbk(false));
                };
            };
        };

        // Handle Stopping operation:
        if (stop !== undefined) {
            clearInterval(next);
            stopped = true;

            let s = symbols[stop ? "ok" : "error"];
            logUpdate(s + ' ' + messageCbk(true));

            if (is_tty) process.stdout.write("\n");
        }

        return true; // Success.

    };//}}}

    ctrlAPI(cbk);


    if (is_tty) {
        
        if (spinners == "demo") {
            messageCbk = (function(cbk0){
                return x=>("["+spinners[spinner]+"] "+cbk0(x));
            })(messageCbk);
            spinners = "all";
        };

        if (spinners == "all") {
            spinners = Object.keys(cliSpinners);
        } else if (typeof spinners == 'string') {
            spinners = [spinners];

        };


        const showNextSpinner = () => {
            if (next) {
                clearInterval(next);
                spinner++;
            }

            if (spinner >= spinners.length) spinner = 0; // Loop.

            const s = cliSpinners[spinners[spinner]];

            if (! stopped) { next = setInterval(showNextFrame, s.interval);
                setTimeout(showNextSpinner, Math.max(s.interval * s.frames.length, 1000));
            };
        };

        showNextSpinner();

    };

    return ctrlAPI;
    
}
275844
@Override
	public void render() {
		String text = this.getErrorContent();
		if(isHtml){
			Response.setStatus(getErrorCode());
			new HtmlView(text).render();
		}else{
			super.render();
		}
	}
904039
@Override
    public void link(NGScope scope, JQElement element, JSON attrs) {
        IsWidget widget = scope.get(getName());
        String id = "gwt-widget-" + counter++;
        element.attr("id", id);
        RootPanel.get(id).add(widget);
    }
243748
public static void html(StringBuilder sb, String html) {
        for (int i = 0; i < html.length(); i++) {
            char c = html.charAt(i);
            switch (c) {
            case '&':
                sb.append("&amp;");
                break;
            case '"':
                sb.append("&quot;");
                break;
            case '\'':
                sb.append("&apos;");
                break;
            case '<':
                sb.append("&lt;");
                break;
            case '>':
                sb.append("&gt;");
                break;
            default:
                sb.append(c);
            }
        }
    }
1160890
private DetailHtmlBuilder htmlTreeNode(CallTreeNode node, DetailHtmlBuilder htmlBuilder, StringifierFactory htmlStringifierFactory) throws IOException {
		htmlBuilder.begin("li")
			.text(node.getName()).text(":&nbsp;");
		if (node.getParent()!=null) {
			htmlBuilder
				.text(htmlStringifierFactory.toString(node.getPercent())).text("%")
				.text(", ");
		}
		htmlBuilder
			.text("total&nbsp;").text(htmlStringifierFactory.toString(node.getTotal(), "Time"))
			.text(", ")
			.text("count&nbsp;").text(htmlStringifierFactory.toString(node.getSplitCount()));
		if (!node.getChildren().isEmpty()) {
			htmlBuilder.begin("ul");
			for(CallTreeNode childNode:node.getChildren()) {
				htmlTreeNode(childNode, htmlBuilder, htmlStringifierFactory);
			}
			htmlBuilder.end("ul");
		}
		return htmlBuilder.end("li");
	}
954925
public static void innerHtml(Element element, SafeHtml html) {
        if (element != null) {
            element.setInnerHTML(html.asString());
        }
    }
277455
public void setAdapter(SpinnerAdapter adapter) {
		if(mAdapter != null)
			mAdapter.unregisterDataSetObserver(mDataSetObserver);

        mRecycler.clear();

		mAdapter = adapter;
		mAdapter.registerDataSetObserver(mDataSetObserver);
		onDataChanged();

        if (mPopup != null)
            mPopup.setAdapter(new DropDownAdapter(adapter));
        else
            mTempAdapter = new DropDownAdapter(adapter);
	}
334733
function (str) {
      var index = this.html.indexOf(str, this.currentChar) + str.length;
      if (index === -1)
        this.currentChar = this.html.length;
      this.currentChar = index;
    }
55287
private function drawSpinner($characters, $label)
    {
        $spinner = "";

        if ($this->firstLine) {
            $this->firstLine = false;
        } else {
            $spinner .= $this->util->cursor->up(1);
            $spinner .= $this->util->cursor->startOfCurrentLine();
            $spinner .= $this->util->cursor->deleteCurrentLine();
        }

        $spinner .= trim("{$characters} {$label}");

        $this->output->write($this->parser->apply($spinner));
    }
788587
function() {

    if (!this._containsCover()) return;

    var self = this;
    var $cover = this.$(".cover");
    var $img = $cover.find("img");
    var $shadow = this.$(".shadow");
    var url = this._getCoverURL();

    if (!this._isValidURL(url)) {
      $img.hide();
      $shadow.hide();
      cdb.log.info("Header image url not valid");
      return;
    }

    // configure spinner
    var target  = document.getElementById('spinner');
    var opts    = { lines: 9, length: 4, width: 2, radius: 4, corners: 1, rotate: 0, color: '#ccc', speed: 1, trail: 60, shadow: true, hwaccel: false, zIndex: 2e9 };
    var spinner = new Spinner(opts).spin(target);

    // create the image

    $img.hide(function() {
      this.remove();
    });

    $img = $("<img />").attr("src", url);
    $cover.append($img);

    $img.load(function(){
      spinner.stop();

      var w  = $img.width();
      var h  = $img.height();
      var coverWidth = $cover.width();
      var coverHeight = $cover.height();

      var ratio = h / w;
      var coverRatio = coverHeight / coverWidth;

      // Resize rules
      if ( w > coverWidth && h > coverHeight) { // bigger image
        if ( ratio < coverRatio ) $img.css({ height: coverHeight });
        else {
          var calculatedHeight = h / (w / coverWidth);
          $img.css({ width: coverWidth, top: "50%", position: "absolute", "margin-top": -1*parseInt(calculatedHeight, 10)/2 });
        }
      } else {
        var calculatedHeight = h / (w / coverWidth);
        $img.css({ width: coverWidth, top: "50%", position: "absolute", "margin-top": -1*parseInt(calculatedHeight, 10)/2 });
      }

      $img.fadeIn(300);
    })
    .error(function(){
      spinner.stop();
    });
  }
1006676
@Override
	public void render() {
		if (false == HuluSetting.isDevMode) {
			Response.sendError(this.errorCode, this.errorContent);
			return;
		}

		if (null != e) {
			StaticLog.error(e);
			if (null == this.errorContent) {
				this.errorContent = StrUtil.EMPTY;
			}
			String stacktraceContent = ExceptionUtil.stacktraceToString(e)
					.replace("\tat", "&nbsp;&nbsp;&nbsp;&nbsp;\tat")
					.replace("\n", "<br/>\n");
			this.errorContent = StrUtil.format(TEMPLATE_ERROR, this.getErrorCode(), Request.getServletRequest().getRequestURI(), this.errorContent, stacktraceContent);
		}
		
		Response.setStatus(errorCode);
		Response.write(errorContent, Response.CONTENT_TYPE_HTML);
	}
723641
protected void html() {
        int p = bp;
        nextChar();
        if (isIdentifierStart(ch)) {
            String name = readIdentifier();
            checkHtmlTag(name);
            htmlAttrs();
            if (ch == '/') {
                nextChar();
            }
            if (ch == '>') {
                nextChar();
                return;
            }
        } else if (ch == '/') {
            nextChar();
            if (isIdentifierStart(ch)) {
                readIdentifier();
                skipWhitespace();
                if (ch == '>') {
                    nextChar();
                    return;
                }
            }
        } else if (ch == '!') {
            nextChar();
            if (ch == '-') {
                nextChar();
                if (ch == '-') {
                    nextChar();
                    while (bp < buflen) {
                        int dash = 0;
                        while (ch == '-') {
                            dash++;
                            nextChar();
                        }
                        // Strictly speaking, a comment should not contain "--"
                        // so dash > 2 is an error, dash == 2 implies ch == '>'
                        // See http://www.w3.org/TR/html-markup/syntax.html#syntax-comments
                        // for more details.
                        if (dash >= 2 && ch == '>') {
                            nextChar();
                            return;
                        }

                        nextChar();
                    }
                }
            }
        }

        bp = p + 1;
        ch = buf[bp];
    }
624693
public static String html(String html) {
        StringBuilder sb = createStringBuilder(html.length());
        html(sb, html);
        return sb.toString();
    }