Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 6 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
View
4 Emakefile
@@ -1,4 +0,0 @@
-{'src/*/*', [
- {i, "include"},
- {outdir, 'ebin'}
- ]}.
View
22 Makefile
@@ -1,5 +1,21 @@
-all:
- erl -make
+ERL ?= erl
+ERLC = erlc
+EBIN_DIRS := $(wildcard deps/*/ebin)
+APPS := $(shell dir apps)
+
+.PHONY: rel deps
+
+all: deps compile
+
+compile:
+ ./rebar compile
+
+deps:
+ ./rebar get-deps
clean:
- rm -rf ./ebin/*.beam
+ ./rebar clean
+
+realclean: clean
+ ./rebar delete-deps
+
View
10 include/nitrogen_elements.hrl
@@ -2,7 +2,7 @@
-define(NITROGEN_ELEMENTS_HRL, ok).
%% NOTE: set the include path bellow to your nitrogen installation location
--include("../nitrogen/include/wf.inc").
+-include_lib("nitrogen_core/include/wf.inc").
%% Elements
-record(force_reload_on_back_button, {?ELEMENT_BASE(element_force_reload_on_back_button)}).
@@ -39,4 +39,10 @@
-record(tab_rotate, {?ACTION_BASE(action_tabs_methods), ms, continuing=false}).
-record(dialog, {?ACTION_BASE(action_dialog), body="", width="auto", height="auto", show_cancel=false ,buttons=[]}).
--endif.
+%%HTML5
+-record(textbox5, {?ELEMENT_BASE(element_textbox5), text="", html_encode=true,
+ next, postback, delegate, autocomplete="on"}).
+-record(formbox5, {?ELEMENT_BASE(element_formbox5), type=text, text="", html_encode=true,
+ next, postback, delegate, autocomplete="on", placeholder=""}).
+
+-endif.
View
7 rebar.config
@@ -0,0 +1,7 @@
+%%-*- mode: erlang -*-
+{sub_dirs, ["rel"]}.
+{erl_opts, [debug_info]}.
+{deps, [
+ {nitrogen_core, "2.1.*", {git, "git://github.com/nitrogen/nitrogen_core.git", "HEAD"}}
+ ]
+}.
View
33 src/html5/element_formbox5.erl
@@ -0,0 +1,33 @@
+-module (element_formbox5).
+-include_lib ("nitrogen_elements.hrl").
+-compile(export_all).
+
+reflect() -> record_info(fields, textbox).
+
+render_element(Record) ->
+ ID = Record#formbox5.id,
+ Anchor = Record#formbox5.anchor,
+ case Record#formbox5.next of
+ undefined -> ignore;
+ Next ->
+ Next1 = wf_render_actions:normalize_path(Next),
+ wf:wire(Anchor, #event { type=enterkey, actions=wf:f("Nitrogen.$go_next('~s');", [Next1]) })
+ end,
+
+
+ case Record#formbox5.postback of
+ undefined -> ignore;
+ Postback -> wf:wire(Anchor, #event { type=enterkey, postback=Postback, validation_group=ID, delegate=Record#formbox5.delegate })
+ end,
+
+ Value = wf:html_encode(Record#formbox5.text, Record#formbox5.html_encode),
+ wf_tags:emit_tag(input, [
+ {type, Record#formbox5.type},
+ {class, [textbox, Record#formbox5.class]},
+ {style, Record#formbox5.style},
+ {value, Value},
+ {autocomplete, Record#formbox5.autocomplete},
+ {placeholder, Record#formbox5.placeholder}
+
+ ]).
+
View
30 src/html5/element_textbox5.erl
@@ -0,0 +1,30 @@
+-module (element_textbox5).
+-include_lib ("nitrogen_elements.hrl").
+-compile(export_all).
+
+reflect() -> record_info(fields, textbox).
+
+render_element(Record) ->
+ ID = Record#textbox5.id,
+ Anchor = Record#textbox5.anchor,
+ case Record#textbox5.next of
+ undefined -> ignore;
+ Next ->
+ Next1 = wf_render_actions:normalize_path(Next),
+ wf:wire(Anchor, #event { type=enterkey, actions=wf:f("Nitrogen.$go_next('~s');", [Next1]) })
+ end,
+
+ case Record#textbox5.postback of
+ undefined -> ignore;
+ Postback -> wf:wire(Anchor, #event { type=enterkey, postback=Postback, validation_group=ID, delegate=Record#textbox5.delegate })
+ end,
+
+ Value = wf:html_encode(Record#textbox5.text, Record#textbox5.html_encode),
+ wf_tags:emit_tag(input, [
+ {type, text},
+ {class, [textbox, Record#textbox5.class]},
+ {style, Record#textbox5.style},
+ {value, Value},
+ {autocomplete, Record#textbox5.autocomplete}
+
+ ]).
View
10 src/nitrogen_elements.app.src
@@ -0,0 +1,10 @@
+{application, nitrogen_elements,
+ [
+ {description, ""},
+ {vsn, "1"},
+ {registered, []},
+ {applications, [
+ kernel,
+ stdlib
+ ]}
+ ]}.

No commit comments for this range

Something went wrong with that request. Please try again.