Source: site.view [edit]
Function name: siteeditpage
Arguments: ctype,module,usecache
Description: Template form for edit page
Page type: html
Render function:  
Module: collaborama

Page source:

<!DOCTYPE HTML>

<html>
<head>
<title>Collaborama: Re-inventing Software Development</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  
<noscript>
  <link rel="stylesheet" href="http://www.collaborama.com/css/5grid/core.css" />
  <link rel="stylesheet" href="http://www.collaborama.com/css/5grid/core-desktop.css" />
  <link rel="stylesheet" href="http://www.collaborama.com/css/5grid/core-1200px.css" />
  <link rel="stylesheet" href="http://www.collaborama.com/css/5grid/core-noscript.css" />
  <link rel="stylesheet" href="http://www.collaborama.com/css/style.css" />
  <link rel="stylesheet" href="http://www.collaborama.com/css/style-desktop.css" />
</noscript>
    
  <script src="http://codemirror.net/lib/codemirror.js"></script>
  <link rel="stylesheet" href="http://codemirror.net/lib/codemirror.css">
  <script src="http://codemirror.net/addon/search/searchcursor.js"></script>
  <script src="http://codemirror.net/addon/search/search.js"></script>  
  
  
  <script src="/static/cm/mode/wubhub/wubhub.js"></script>
  <script src="/static/cm/mode/xml/xml.js"></script>
  <script src="/static/cm/mode/javascript/javascript.js"></script>
  <script src="/static/cm/mode/css/css.js"></script>
  <script src="/static/cm/mode/htmlmixed/htmlmixed.js"></script>
  
    <style type="text/css">
      .CodeMirror {border: 1px solid grey; font-size:13px;background: #FFFFFF}
    </style>
    

    <style type="text/css">      
      .CodeMirror-fullscreen {
        display: block;
        position: absolute;
        top: 0; left: 0;
        width: 100%;
        z-index: 9999;
      }
    </style>
  
  <script src="http://www.collaborama.com/css/5grid/jquery.js"></script>
  <script src="http://www.collaborama.com/css/5grid/init.js?use=mobile,desktop,1000px&amp;mobileUI=1&amp;mobileUI.theme=none"></script>
  <!--[if IE 9]><link rel="stylesheet" href="http://www.collaborama.com/css/style-ie9.css" /><![endif]-->

</head>
  
<div id="smallheader-wrapper" class="12u">
	<header id="smallheader" class="5grid-layout">
		<div class="row">
			<div class="3u"> <!-- Logo -->
              <h1><img width=30 src="http://www.collaborama.com/images/logo.png"><a href="/site/home" class="mobileUI-site-name">Collaborama</a></h1>
			</div>
            <div class="8u" id="cmd">
                <section>
<webl>                  
  if wubinfo.user != false then
                  `<form name="wubhub" action="/doit/" method="post">
 						<input size=75 name="cmdline" title="Enter command">
  						<input type="submit" value="Go" title="Execute command">
					</form>`
  else ""
  end;
</webl>                  
              	</section>
            </div>
		</div>
	</header>
</div>

<div id="feature-wrapper">
	<div class="12u">
		<div id="onecolumn-content" class="5grid-layout">
			<div class="row">
				<div class="mobileUI-main-content">
					<section>


<form action="/webl/WubHub_SaveFunction" method="post">
  
<div id="content" width="100%">
<!-- <div id="content-header">Source: edit [<a href="/webl/WubHub_DoIt?cmdline=site.edit(edit)">edit</a>]
</div>  -->

<div id="main-text-wub">

      <table width="100%">
        <tbody>
        <tr>
          <td>Function:</td>
          <td>
	    <select name="module">
               <webl>
var SelectedOption = fun(item, desired)
   if (item == desired) then
       return ` selected="true"`
   else
       return " "
   end
end;

// -------------------------------------------------------------------------
// Returns HTML listing leagal module options for a user
// -------------------------------------------------------------------------
export var LegalModuleOptions = fun(module)
   var s = "";
   every m in Wub_WritableModules() do
      s = s + "<option" + SelectedOption(m,module) + ` value="` + m + `">` + m + "</option>\n"
   end;
   return s;
end;
                  LegalModuleOptions(module);
               </webl>
            </select>                        
            <input name="name" value="%name%" size="30" title="Name of the function"/>
            Args: <input name="arglist" value="%arglist%" size="45" title="Comma-separated list of arguments"/>
            &nbsp;
            <a href="/webl/WubHub_DoIt?cmdline=edit(%module%.%name%.<webl>"%"+"prevVersion%"</webl>)">&lt;&lt;</a> Ver. %version% 
            <a href="/webl/WubHub_DoIt?cmdline=edit(%module%.%name%.<webl>"%"+"nextVersion%"</webl>)">&gt;&gt;</a>
            
          </td><td align="right">
             <input name="version" value="%version%" type="hidden" size="30"/>
             <input name="created" value="%created%" type="hidden" size="30"/>
             <input name="createdby" value="%createdby%" type="hidden" size="30"/>
             <input name="modified" value="%modified%" type="hidden" size="30"/>
             <input name="modifiedby" value="%modifiedby%" type="hidden" size="30"/>
             <input name="oldtags" value="<webl>`%old` + `tags%`</webl>" type="hidden" size="30"/>
             <input name="oldflags" value="<webl>`%old` + `flags%`</webl>" type="hidden" size="30"/>
             <input name="oldspecialtags" value="<webl>`%old` + `specialtags%`</webl>" type="hidden" size="30"/>

             <input type="submit" value="SAVE">
          
          </td>
        </tr>
        <tr>
          <td valign="top">Description: </td>
          <td><textarea name="description" title="Brief synopsis of function">%description%</textarea></td>
        </tr>
        <tr>
          <td>Page type:
          </td>
          <td>
<webl>
  if !(ctype member ["alias", "url", "webl", "javascript", "snippet", "html", "text"]) then
   ctype = "snippet";
end;
var cattr = fun(b)
   if b then `checked="checked"` else "" end;
end;
var c1 = cattr(ctype=="url");
var c2 = cattr(ctype=="webl");
var c7 = cattr(ctype=="javascript");
var c3 = cattr(ctype=="snippet");
var c4 = cattr(ctype=="html");
var c5 = cattr(ctype=="text");
var c6 = cattr(ctype=="alias");
`<input type="radio" name="ctype" onchange="setContentMode('alias');" value="alias"`    + c6 + `>Alias
<input type="radio" name="ctype" onchange="setContentMode('url');" value="url"`     + c1 + `>URL
<input type="radio" name="ctype" onchange="setContentMode('webl');" value="webl"`    + c2 + `>WebL script
<input type="radio" name="ctype" onchange="setContentMode('javascript');" value="javascript"`    + c7 + `>JavaScript
<input type="radio" name="ctype" onchange="setContentMode('snippet');" value="snippet"` + c3 + `>HTML snippet
<input type="radio" name="ctype" onchange="setContentMode('html');" value="html"`    + c4 + `>HTML page
<input type="radio" name="ctype" onchange="setContentMode('text');" value="text"`    + c5 + `>Text/data
`
</webl>
          </td>
          <td align="right"><small>F3-fullscreen</small></td>
        </tr>
        </tbody>
     </table>
  </div>    
  
  <textarea id="exec" name="exec" title="Text, data, or source code">%exec%</textarea>
  
<script>

    var editor = CodeMirror.fromTextArea(document.getElementById("exec"), {
        lineNumbers: true,
        lineWrapping: true,
        extraKeys: {
        "F3": function(cm) {
          setFullScreen(cm, !isFullScreen(cm));
        },
        "Esc": function(cm) {
          if (isFullScreen(cm)) setFullScreen(cm, false);
        } 
      }
     });

  function setContentMode(val)
  {
     if (val == "webl")
        editor.setOption("mode", "wubhub");
    else if (val == "text")
        editor.setOption("mode", "text/plain");
    else if (val == "javascript")
        editor.setOption("mode", "text/javascript");
    else 
        editor.setOption("mode", "text/html");
  }      
                 
    function isFullScreen(cm) {
      return /\bCodeMirror-fullscreen\b/.test(cm.getWrapperElement().className);
    }
    function winHeight() {
      return window.innerHeight || (document.documentElement || document.body).clientHeight;
    }
    function setFullScreen(cm, full) {
      var wrap = cm.getWrapperElement();
      if (full) {
        wrap.className += " CodeMirror-fullscreen";
        wrap.style.height = winHeight() + "px";
        document.documentElement.style.overflow = "hidden";
      } else {
        wrap.className = wrap.className.replace(" CodeMirror-fullscreen", "");
        wrap.style.height = "";
        document.documentElement.style.overflow = "";
      }
      cm.refresh();
    }
    CodeMirror.on(window, "resize", function() {
      var showing = document.body.getElementsByClassName("CodeMirror-fullscreen")[0];
      if (!showing) {
         editor.getWrapperElement().style.height = (winHeight() - 400) + "px";
      } else {
         showing.CodeMirror.getWrapperElement().style.height = winHeight() + "px";
      }
    }); 
  
  // Call it the first time
    editor.getWrapperElement().style.height = (winHeight() - 400) + "px";
  
</script>
 
  <div id="main-text">
  
     <table>
       <tbody>  
        <tr>
          <td>Render function: </td>
          <td><input name="render" value="%render%" size="25" title="Specify function to render result, or leave blank for default behavior."/> </td>
          <td>
          Test function:
          <input name="test" value="%test%" size="25" title="Specify optional unit test function that returns a boolean.  May be left blank."/></td>
        </tr>

        <tr>
          <td>Tags:</td>
          <td><input name="tags" value="%tags%" size="45" title="Specify a comma-separated list of tags. Tags are user-defined, searchable mechanisms for classifying functions.  May be left blank."/> </td>
          <td> Flags:
          <input name="flags" value="%flags%" size="45" title="Specify a comma-separated list of flags.  Flags are special tags used in some way by other WubHub functions (e.g. 'test' is used to indicate a unit test function).  May be left blank."/></td>
        </tr>
        <tr>
          
          <td>
<webl>

var cattr = fun(b)
   if b then `checked="checked"` else "" end;
end;
var c1 = cattr(usecache=="usecache");

`<input type="checkbox" name="usecache" value="usecache" ` + c1 + `title="If selected, will save results for each arg combo to a cache and return results from cache before executing function.  This is GLOBAL across all users, so only use this as appropriate.">
   Cache results
 `;
</webl>  &nbsp; &nbsp;
          </td><td>
            Expiration date:
            <input name="cacheexpire" value="%cacheexpire%" size="22" title="Cache expiration date: use format '11/02/07 4:12 pm'"/> &nbsp; &nbsp;

           </td><td>
            Refresh rate:
            <input name="cacherefreshrate" value="%cacherefreshrate%" size="20" title="Cache refresh rate: use values such as '1W' (week), '1D' (day), or '1H' (hour) or combinations of these, such as '3D 2H'.  Note: refreshing will run in a background thread as the ANONYMOUS user, so only use for publicly-accessible functions."/>

          </td><td align="right">  [<a href="/webl/WubHub_DoIt?cmdline=site.terms">Terms</a>]</td>
        </tr>
      </tbody>
    </table>

</div>
</div>
</form>


					</section>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="5grid-layout">
	<div id="copyright">
		<p>&copy; 2013 Collaborama.com </p>
	</div>
</div>
  
</body>
</html>

<!--
Affection: A responsive HTML5 website template by HTML5Templates.com
Released for free under the Creative Commons Attribution 3.0 license (html5templates.com/license)
Visit http://html5templates.com for more great templates or follow us on Twitter @HTML5T
-->