001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.juneau.bean.html5;
018
019import org.apache.juneau.marshall.*;
020
021/**
022 * DTO for an HTML <a class="doclink" href="https://www.w3.org/TR/html5/scripting-1.html#the-noscript-element">&lt;noscript&gt;</a>
023 * element.
024 *
025 * <p>
026 * The noscript element represents nothing if scripting is enabled, and represents its children
027 * if scripting is disabled. It is used to provide alternative content for users who have
028 * JavaScript disabled or when JavaScript is not available. The noscript element can contain
029 * any flow content and is typically used to display a message or alternative functionality
030 * when JavaScript cannot be executed. It is commonly placed in the head or body of a document.
031 *
032 * <h5 class='section'>Examples:</h5>
033 * <p class='bcode w800'>
034 *    <jk>import static</jk> org.apache.juneau.bean.html5.HtmlBuilder.*;
035 *
036 *    <jc>// Simple noscript message</jc>
037 *    Noscript <jv>simple</jv> = <jsm>noscript</jsm>(<js>"Please enable JavaScript to use this application."</js>);
038 *
039 *    <jc>// Noscript with styling</jc>
040 *    Noscript <jv>styled</jv> = <jsm>noscript</jsm>(<js>"JavaScript is required for this page to function properly."</js>)
041 *       .class_(<js>"noscript-message"</js>);
042 *
043 *    <jc>// Noscript with complex content</jc>
044 *    Noscript <jv>complex</jv> = <jsm>noscript</jsm>(
045 *       <jsm>h2</jsm>(<js>"JavaScript Required"</js>),
046 *       <jsm>p</jsm>(<js>"This application requires JavaScript to function."</js>),
047 *       <jsm>p</jsm>(<js>"Please enable JavaScript in your browser and refresh the page."</js>)
048 *    );
049 *
050 *    <jc>// Noscript with ID</jc>
051 *    Noscript <jv>withId</jv> = <jsm>noscript</jsm>(<js>"JavaScript is disabled."</js>)
052 *       .id(<js>"noscript-message"</js>);
053 *
054 *    <jc>// Noscript with styling</jc>
055 *    Noscript <jv>styled2</jv> = <jsm>noscript</jsm>(<js>"JavaScript is required for this page."</js>)
056 *       .style(<js>"background-color: #f8d7da; color: #721c24; padding: 10px; border: 1px solid #f5c6cb;"</js>);
057 *
058 *    <jc>// Noscript with multiple elements</jc>
059 *    Noscript <jv>multiple</jv> = <jsm>noscript</jsm>(
060 *       <jsm>h3</jsm>(<js>"JavaScript Disabled"</js>),
061 *       <jsm>p</jsm>(<js>"This page requires JavaScript to function properly."</js>),
062 *       <jsm>p</jsm>(<js>"Please enable JavaScript and refresh the page."</js>),
063 *       <jsm>a</jsm>(<js>"/help/javascript"</js>, <js>"Learn how to enable JavaScript"</js>)
064 *    );
065 *
066 *    <jc>// Noscript with form</jc>
067 *    Noscript <jv>withForm</jv> = <jsm>noscript</jsm>(
068 *       <jsm>p</jsm>(<js>"JavaScript is disabled. Please use the form below:"</js>),
069 *       <jsm>form</jsm>().action(<js>"/submit"</js>).method(<js>"post"</js>).children(
070 *          <jsm>input</jsm>(<js>"text"</js>).name(<js>"name"</js>).placeholder(<js>"Name"</js>),
071 *          <jsm>input</jsm>(<js>"submit"</js>).value(<js>"Submit"</js>)
072 *       )
073 *    );
074 * </p>
075 *
076 * <h5 class='section'>See Also:</h5><ul>
077 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauBeanHtml5">juneau-bean-html5</a>
078 * </ul>
079 */
080@Marshalled(typeName = "noscript")
081public class Noscript extends HtmlElementMixed<Noscript> {
082
083   /**
084    * Creates an empty {@link Noscript} element.
085    */
086   public Noscript() {}
087
088   /**
089    * Creates a {@link Noscript} element with the specified child nodes.
090    *
091    * @param children The child nodes. Must not be <jk>null</jk>.
092    */
093   public Noscript(Object...children) {
094      children(children);
095   }
096
097}