Generates a SCRIPT tag with the type and src attributes.

@param type type of link
@param src the path for the script
@return an HtmlTree object for the SCRIPT tag
775379
public static HtmlTree SCRIPT(String type, String src) {
        HtmlTree htmltree = new HtmlTree(HtmlTag.SCRIPT);
        htmltree.addAttr(HtmlAttr.TYPE, nullCheck(type));
        htmltree.addAttr(HtmlAttr.SRC, nullCheck(src));
        return htmltree;
    }
1139674
private function createTextNodeWithTypeAttribute(\DOMDocument $dom, \DOMNode $node, $value, $type = 'int')
    {
        $text = $dom->createTextNode($value);
        $attr = $dom->createAttribute('type');
        $attr->value = $type;

        $node->appendChild($text);
        $node->appendChild($attr);
    }
726610
async function generateNodeSource() {
  const sourceText = await fs.readFile(sourceFile, 'utf8');

  // Parse index.d.ts. A dummy filename is required but it doesn't create a
  // file.
  let typescriptSourceFile = typescript.createSourceFile(
    'temp.d.ts',
    sourceText,
    typescript.ScriptTarget.ES2015,
    /*setParentNodes */ false
  );

  /**
   * Typescript transformer function. Removes nodes tagged with @webonly.
   */
  const removeWebOnlyNodes = context => rootNode => {
    function visit(node) {
      if (
        node.jsDoc &&
        node.jsDoc.some(
          item =>
            item.tags &&
            item.tags.some(tag => tag.tagName.escapedText === 'webonly')
        )
      ) {
        return null;
      }
      return typescript.visitEachChild(node, visit, context);
    }
    return typescript.visitNode(rootNode, visit);
  };

  // Use above transformer on source AST to remove nodes tagged with @webonly.
  const result = typescript.transform(typescriptSourceFile, [
    removeWebOnlyNodes
  ]);

  // Convert transformed AST to text and write to file.
  const printer = typescript.createPrinter();
  return fs.writeFile(
    tempNodeSourcePath,
    printer.printFile(result.transformed[0])
  );
}
155681
public static boolean isInHeader(final String scriptname) {
    final NodeList linkList =
        Browser.getDocument().getHead().getElementsByTagName(CssResources.TAG_TYPE);
    for (int i = 0; i < linkList.getLength(); i++) {
      final LinkElement linkTag = (LinkElement) linkList.item(i);
      if (StringUtils.equals(linkTag.getType(), CssResources.SCRIPT_TYPE)
          && StringUtils.equals(linkTag.getRel(), CssResources.REL_TYPE)
          && StringUtils.contains(linkTag.getHref(), scriptname)) {
        return true;
      }
    }
    return false;
  }
302807
protected Node createScript(Node parent, String name, boolean autoload, InputStream stream) throws Exception
   {
      Node scriptFile = parent.addNode(name, "nt:file");
      Node script = scriptFile.addNode("jcr:content", getNodeType());
      script.setProperty("exo:autoload", autoload);
      script.setProperty("jcr:mimeType", "script/groovy");
      script.setProperty("jcr:lastModified", Calendar.getInstance());
      script.setProperty("jcr:data", stream);
      return scriptFile;
   }
1080049
public static HtmlTree CODE(Content body) {
        HtmlTree htmltree = new HtmlTree(HtmlTag.CODE, nullCheck(body));
        return htmltree;
    }
1247265
public static String getSourceFile(TypeElement type) {
    if (type instanceof ClassSymbol) {
      JavaFileObject srcFile = ((ClassSymbol) type).sourcefile;
      if (srcFile != null) {
        return srcFile.getName();
      }
    }
    return null;
  }
632813
private Node createTemplateNode() {
    // The Node type choice is arbitrary.
    Node templateNode = new Node(Token.SCRIPT);
    templateNode.setStaticSourceFile(sourceFile);
    return templateNode;
  }
502374
public function script($src, $attr = array())
    {
        $src = $this->Assets->getScript($src);
        $attr['src'] = $src;
        return $this->tag('script', $attr, '', true);
    }
826362
public static HtmlTree FRAME(String src, String name, String title) {
        return FRAME(src, name, title, null);
    }
1192613
public HtmlTree getScriptProperties() {
        HtmlTree script = HtmlTree.SCRIPT("text/javascript",
                pathToRoot.resolve(DocPaths.JAVASCRIPT).getPath());
        return script;
    }
195611
protected void addModifierAndType(Element member, TypeMirror type,
            Content tdSummaryType) {
        HtmlTree code = new HtmlTree(HtmlTag.CODE);
        addModifier(member, code);
        if (type == null) {
            code.addContent(utils.isClass(member) ? "class" : "interface");
            code.addContent(Contents.SPACE);
        } else {
            List<? extends TypeParameterElement> list = utils.isExecutableElement(member)
                    ? ((ExecutableElement)member).getTypeParameters()
                    : null;
            if (list != null && !list.isEmpty()) {
                Content typeParameters = ((AbstractExecutableMemberWriter) this)
                        .getTypeParameters((ExecutableElement)member);
                    code.addContent(typeParameters);
                //Code to avoid ugly wrapping in member summary table.
                if (typeParameters.charCount() > 10) {
                    code.addContent(new HtmlTree(HtmlTag.BR));
                } else {
                    code.addContent(Contents.SPACE);
                }
                code.addContent(
                        writer.getLink(new LinkInfoImpl(configuration,
                        LinkInfoImpl.Kind.SUMMARY_RETURN_TYPE, type)));
            } else {
                code.addContent(
                        writer.getLink(new LinkInfoImpl(configuration,
                        LinkInfoImpl.Kind.SUMMARY_RETURN_TYPE, type)));
            }

        }
        tdSummaryType.addContent(code);
    }
918848
public TagFileType<WebJsptaglibraryDescriptor> getOrCreateTagFile()
   {
      List<Node> nodeList = model.get("tag-file");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new TagFileTypeImpl<WebJsptaglibraryDescriptor>(this, "tag-file", model, nodeList.get(0));
      }
      return createTagFile();
   }
281928
public SrcTree generate(String[] srcFiles, Charset srcCharset, String[] classPathEntries) {
        // collect root class and method table without code body
        CollectRootRequestor rootRequestor = new CollectRootRequestor();
        parseAST(srcFiles, srcCharset, classPathEntries, rootRequestor);

        // collect sub class and method table without code body
        CollectSubRequestor subRequestor = new CollectSubRequestor(rootRequestor.getRootClassTable());
        parseAST(srcFiles, srcCharset, classPathEntries, subRequestor);

        // add additional TestDoc to the table
        AdditionalTestDocsSetter setter = new AdditionalTestDocsSetter(
                rootRequestor.getRootClassTable(), subRequestor.getSubClassTable(),
                rootRequestor.getRootMethodTable(), subRequestor.getSubMethodTable());
        setter.set(additionalTestDocs);

        // collect code
        CollectCodeRequestor codeRequestor = new CollectCodeRequestor(
                subRequestor.getSubClassTable(), rootRequestor.getRootMethodTable(),
                subRequestor.getSubMethodTable(), subRequestor.getFieldTable());
        parseAST(srcFiles, srcCharset, classPathEntries, codeRequestor);

        SrcTree result = new SrcTree();
        result.setRootClassTable(rootRequestor.getRootClassTable());
        result.setSubClassTable(subRequestor.getSubClassTable());
        result.setRootMethodTable(rootRequestor.getRootMethodTable());
        result.setSubMethodTable(subRequestor.getSubMethodTable());
        result.setFieldTable(subRequestor.getFieldTable());
        return result;
    }
164746
private void colorizeTags(Area root, String type)
    {
        recursiveColorizeTags(root, type);
        browser.updateDisplay();
    }
125055
function compile(src) {
   var cached;

   if (typeof src !== "string") {
      throw new TypeError("src must be a string, instead saw '" + typeof src + "'");
   }

   if (!compile.cache) {
      return parser.parse(src);
   }

   cached = compile.cache[src];

   if (!cached) {
      cached = compile.cache[src] = parser.parse(src);
   }

   return cached;
}
1346411
protected IScriptReporter getHtmlTag(ServletRequest req)
    {
        Html html = (Html) req.getAttribute(Html.HTML_TAG_ID);
        if (html != null && html instanceof IScriptReporter)
            return (IScriptReporter) html;
        return null;
    }