Permalink
Browse files

added files

  • Loading branch information...
0 parents commit 34ec202e9be4c228161905846bc1db90cf2d8d8d @marksands committed Sep 26, 2009
Showing with 1,596 additions and 0 deletions.
  1. +17 −0 Emakefile
  2. +5 −0 Makefile
  3. +2 −0 README
  4. +11 −0 ebin/myfirstwebapp.app
  5. BIN ebin/myfirstwebapp_app.beam
  6. BIN ebin/web_index.beam
  7. +37 −0 src/myfirstwebapp_app.erl
  8. +31 −0 src/pages/web_index.erl
  9. +9 −0 start.sh
  10. +14 −0 wwwroot/css/main.css
  11. +82 −0 wwwroot/nitrogen/basic.css
  12. BIN wwwroot/nitrogen/black_bl.png
  13. BIN wwwroot/nitrogen/black_br.png
  14. BIN wwwroot/nitrogen/black_tl.png
  15. BIN wwwroot/nitrogen/black_tr.png
  16. BIN wwwroot/nitrogen/checkmark.png
  17. +143 −0 wwwroot/nitrogen/elements.css
  18. BIN wwwroot/nitrogen/flash_bg.png
  19. BIN wwwroot/nitrogen/gray_bl.png
  20. BIN wwwroot/nitrogen/gray_br.png
  21. BIN wwwroot/nitrogen/gray_tl.png
  22. BIN wwwroot/nitrogen/gray_tr.png
  23. +273 −0 wwwroot/nitrogen/jquery-ui.js
  24. BIN wwwroot/nitrogen/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png
  25. BIN wwwroot/nitrogen/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png
  26. BIN wwwroot/nitrogen/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png
  27. BIN wwwroot/nitrogen/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png
  28. BIN wwwroot/nitrogen/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png
  29. BIN wwwroot/nitrogen/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png
  30. BIN wwwroot/nitrogen/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png
  31. BIN wwwroot/nitrogen/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png
  32. BIN wwwroot/nitrogen/jquery-ui/images/ui-icons_222222_256x240.png
  33. BIN wwwroot/nitrogen/jquery-ui/images/ui-icons_2e83ff_256x240.png
  34. BIN wwwroot/nitrogen/jquery-ui/images/ui-icons_454545_256x240.png
  35. BIN wwwroot/nitrogen/jquery-ui/images/ui-icons_888888_256x240.png
  36. BIN wwwroot/nitrogen/jquery-ui/images/ui-icons_cd0a0a_256x240.png
  37. +405 −0 wwwroot/nitrogen/jquery-ui/jquery-ui.css
  38. +19 −0 wwwroot/nitrogen/jquery.js
  39. +4 −0 wwwroot/nitrogen/livevalidation.js
  40. +3 −0 wwwroot/nitrogen/nitrogen.css
  41. +463 −0 wwwroot/nitrogen/nitrogen.js
  42. +52 −0 wwwroot/nitrogen/reset.css
  43. BIN wwwroot/nitrogen/spinner.gif
  44. BIN wwwroot/nitrogen/spinner2.gif
  45. BIN wwwroot/nitrogen/white_bl.png
  46. BIN wwwroot/nitrogen/white_br.png
  47. BIN wwwroot/nitrogen/white_tl.png
  48. BIN wwwroot/nitrogen/white_tr.png
  49. +26 −0 wwwroot/template.html
@@ -0,0 +1,17 @@
+{ './src/*', [
+ { i, "./include" },
+ { outdir, "./ebin" },
+ debug_info
+]}.
+
+{ './src/*/*', [
+ { i, "./include" },
+ { outdir, "./ebin" },
+ debug_info
+]}.
+
+{ './src/*/*/*', [
+ { i, "./include" },
+ { outdir, "./ebin" },
+ debug_info
+]}.
@@ -0,0 +1,5 @@
+compile:
+ erl -make
+
+clean:
+ rm -rf ./ebin/*.beam
2 README
@@ -0,0 +1,2 @@
+Very basic To-Do list app in Nitrogen.
+Just a small exercise to learn about Erlang and this framework.
@@ -0,0 +1,11 @@
+{application, myfirstwebapp, [
+ {description, "Nitrogen Website"},
+ {mod, {myfirstwebapp_app, []}},
+ {env, [
+ {platform, inets}, %% {inets|yaws|mochiweb}
+ {port, 8000},
+ {session_timeout, 20},
+ {sign_key, "SIGN_KEY"},
+ {www_root, "./wwwroot"}
+ ]}
+]}.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,37 @@
+-module (myfirstwebapp_app).
+-export ([start/2, stop/1, route/1, request/1]).
+-behavior(application).
+
+start(_, _) -> nitrogen:start(myfirstwebapp).
+stop(_) -> nitrogen:stop().
+
+%% route/1 lets you define new URL routes to your web pages,
+%% or completely create a new routing scheme.
+%% The 'Path' argument specifies the request path. Your
+%% function should return either an atom which is the page module
+%% to run, or a tuple containing {Module, PathInfo}. PathInfo
+%% can be accessed using wf:get_path_info().
+%%
+%% Uncomment the line below to direct requests
+%% from "/web/newroute" to the web_index module:
+%%
+%% route("/web/newroute") -> web_index;
+%%
+%% Uncomment the line below to direct requests
+%% from "/web/newroute" to the web_index module,
+%% with trailing PathInfo included:
+%%
+%% route("/web/newroute/" ++ PathInfo) -> {web_index, PathInfo};
+
+route(Path) -> nitrogen:route(Path).
+
+
+%% request/1 is executed before every Nitrogen page, and lets
+%% you add authentication and authorization. The 'Module' argument
+%% is the name of the page module.
+%% This function should return either 'ok' if processing can proceed,
+%% or it can return a full-fledged page by treating it just like the main function
+%% of a page. Alternatively, you can use the wf:redirect* functions to
+%% issue a client-side redirect to a new page.
+
+request(Module) -> nitrogen:request(Module).
@@ -0,0 +1,31 @@
+-module (web_index).
+-include_lib ("nitrogen/include/wf.inc").
+-compile(export_all).
+
+main() ->
+ #template { file="./wwwroot/template.html"}.
+
+title() ->
+ "To Do List".
+right() ->
+ linecount:render().
+
+body() -> [
+
+ #label{ id=update, text="" },
+ #textbox {id=taskText, text=""},
+ #button {text="Submit", postback=addTask},
+
+ #p{},
+ #span { text="Tasks:"},
+
+ #p{}
+].
+
+event(addTask) ->
+ [Message] = wf:q(taskText),
+ wf:flash( #span { id=task_item, text=Message } ),
+ ok;
+
+event(_) ->
+ ok.
@@ -0,0 +1,9 @@
+#!/bin/sh
+cd `dirname $0`
+
+echo Starting Nitrogen.
+erl \
+ -name nitrogen@localhost \
+ -pa ./ebin -pa ./include \
+ -s make all \
+ -eval "application:start(myfirstwebapp)"
@@ -0,0 +1,14 @@
+body {
+ margin: 0px 20px 0px 20px;
+ font-family: Helvetica;
+ font-size: 16px;
+}
+
+h1 {
+ font-size: 22px;
+ font-weight: bold;
+}
+
+button {
+
+}
@@ -0,0 +1,82 @@
+/*** FONTS ***/
+
+body, table, table td { font-size: 1em; font-family: "Lucida Grande", "Segoe UI", Tahoma, Helvetica, Arial, sans-serif; line-height: 1.7em; }
+
+h1 { font-family: 'Arial'; font-size: 2.2em; font-weight: bold; }
+h2 { font-family: 'Arial', Georgia; font-size: 1.7em; font-weight: bold; }
+h3 { font-family: 'Arial', Georgia; font-size: 1.2em; font-weight: bold; }
+h4 { font-family: 'Arial', Georgia; font-size: 0.9em; text-transform: uppercase; }
+
+a, a:visited { text-decoration: none; }
+a:hover, a:active { text-decoration: underline; }
+
+input[type=text], input[type=password], textarea {
+ font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-weight: bold; font-size: 1.1em; line-height: 1.1em;
+}
+
+input[type=submit], input[type=button] {
+ font-family: "Lucida Grande", "Segoe UI", Tahoma, Helvetica, Arial, sans-serif; font-size: 1em;
+}
+
+.big { font-size: 120%; line-height: 180%; }
+.small { font-size: 90%; }
+.error { font-size: 10px; }
+
+
+/*** COLORS ***/
+
+body, table, table td { color: #525252; }
+
+a, a:visited, a:active, a:hover { color: #4488FF; }
+
+h1 { color: #000000; }
+h2 { color: #84B712; }
+h3 { color: #84B712; }
+h4 { color: #000000; }
+
+input[type=text], input[type=password], textarea { border: solid 1px #99AACC; }
+input[type=submit], input[type=button] { color: #333333; }
+input[type=submit]:HOVER, input[type=button]:HOVER { color: #3333FF; }
+
+.error { color: #ffff00; }
+
+hr { background-color: #E0E0E0; }
+
+/*** POSITIONING ***/
+
+body, img, table, form { border: 0px; margin: 0px; padding: 0px}
+table td { vertical-align: top; padding: 4px 7px 4px 7px; }
+
+img { vertical-align: middle; }
+
+table { border-collapse:collapse; }
+
+p { clear: both; margin: 0px 0px 0px 0px; padding: 1em 0px 0px 0px; }
+
+h1 { margin: 0px 0px 0px 0px; padding: 0em 0px 0.75em 0px; }
+h2 { margin: 0px 0px 0px 0px; padding: 0em 0px 0.5em 0px; }
+h3 { margin: 0px 0px 0px 0px; padding: 0em 0px 0.5em 0px; }
+h4 { margin: 0px 0px 0px 0px; padding: 0.2em 0px 0.1em 0px; }
+
+input[type=text], input[type=password], textarea { padding: 5px 5px 5px 5px; margin: 0px 7px 0px 0px; }
+input[type=submit], input[type=button] { margin-right: 7px; }
+input[type=checkbox] { vertical-align: middle; margin-right: 10px; }
+label { vertical-align: middle; }
+hr { margin: 12px 0px 12px 0px; padding: 0px 0px 0px 0px; height: 1px; border: 0px; }
+.error { margin-top: 2px; }
+
+/*** EXTRAS ***/
+:focus { outline: 0; }
+
+ul {
+ list-style-type: disc;
+ padding-left: 20px;
+ padding-top: 7px;
+}
+
+
+
+.description {
+ font-size: 0.8em;
+ color: #000000;
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,143 @@
+.label {
+ display: block;
+ font-weight: bold;
+ font-size: 0.9em;
+ margin-top: 7px;
+}
+
+.value {
+ display: block;
+ font-weight: bold;
+ padding: 0px 0px 0px 0px;
+ margin-top: 2px;
+ margin-bottom: 10px;
+ color: #000000;
+}
+
+/*** ROUNDED PANEL ***/
+table.rounded_panel.black td { background: #000000; }
+table.rounded_panel.gray td { background: #F1F1F1; }
+table.rounded_panel.black td { background: #000000; }
+table.rounded_panel.white td { background: #FFFFFF; }
+table.rounded_panel tr.chrome td { font-size: 1px; line-height: 1px; padding: 0 0 0 0; margin: 0 0 0 0; border: 0; }
+table.rounded_panel tr.chrome img { padding: 0 0 0 0; margin: 0 0 0 0; border: 0; }
+
+
+table.rounded_panel { margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; border: 0px; }
+table.rounded_panel td { padding: 0px 0px 0px 0px; }
+table.rounded_panel td.content { padding: 4px 20px 4px 20px; }
+
+table.rounded_panel { margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; border: 0px; }
+table.rounded_panel td { padding: 0px 0px 0px 0px; }
+table.rounded_panel td.content { padding: 4px 20px 4px 20px; }
+
+
+/*** INPLACE EDITING ***/
+
+div.inplace_textbox div.view {
+ cursor: pointer;
+}
+
+div.inplace_textbox .label {
+ display: inline;
+}
+
+div.inplace_textbox .instructions {
+ padding-left: 12px;
+ font-size: 0.8em;
+}
+
+div.inplace_textbox .LV_invalid {
+ position: relative;
+ margin-right: 7px;
+ color:#CC0000;
+ background-color: #FFFF99;
+ border: solid 2px #D0D0C0;
+}
+
+.flash_container {
+}
+
+.flash {
+ color: #303030;
+ background-color: #FAEC7F;
+ border: #FFE800 solid 2px;
+ padding: 3px 5px 3px 5px;
+ margin-bottom: 7px;
+}
+
+.flash .flash_content {
+ margin-right: 50px;
+}
+
+.flash .flash_close_button {
+ float: right;
+ font-size: 90%;
+}
+
+.wizard {
+}
+
+.wizard .wizard_title {
+ font-family: 'Arial', Georgia; font-size: 1.2em; font-weight: bold;
+}
+
+.wizard .wizard_body {
+ margin-top: 20px;
+ margin-bottom: 20px;
+}
+
+.wizard .wizard_buttons {
+ padding-right: 40px;
+ text-align:right;
+}
+
+.wizard .wizard_buttons input {
+ margin-right: 20px;
+}
+
+/*** VALIDATION ***/
+
+.LV_validation_message {
+ vertical-align: middle;
+ display: inline;
+ line-height: 100%;
+ position: absolute;
+ font-weight:bold;
+ margin: 0px 0px 0px 7px;
+ padding: 5px 7px 5px 7px;
+ opacity: 0.8;
+ -moz-opacity: 0.8;
+ filter:alpha(opacity=80);
+}
+
+/*
+.LV_valid {
+ background-image: url(/nitrogen/checkmark.png);
+ margin: 2px 0px 5px 0px;
+ padding: 0px 20px 20px 0px;
+ color:#00CC00;
+}
+*/
+
+.LV_invalid {
+ color:#CC0000;
+ background-color: #FFFF99;
+ border: solid 2px #D0D0C0;
+}
+
+/*.LV_valid_field,
+input.LV_valid_field:hover,
+input.LV_valid_field:active,
+textarea.LV_valid_field:hover,
+textarea.LV_valid_field:active {
+ border: 1px solid #00CC00;
+}
+
+.LV_invalid_field,
+input.LV_invalid_field:hover,
+input.LV_invalid_field:active,
+textarea.LV_invalid_field:hover,
+textarea.LV_invalid_field:active {
+ border: 1px solid #CC0000;
+}*/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit 34ec202

Please sign in to comment.