Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
90bf2510
Commit
90bf2510
authored
Jun 11, 2014
by
Romain Courteaud
🐙
Committed by
Jérome Perrin
Aug 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add simple string field.
parent
c69b64e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
dream/platform/static/string_field/index.html
dream/platform/static/string_field/index.html
+18
-0
dream/platform/static/string_field/stringfield.js
dream/platform/static/string_field/stringfield.js
+18
-0
No files found.
dream/platform/static/string_field/index.html
0 → 100644
View file @
90bf2510
<!DOCTYPE html>
<html>
<head>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no"
/>
<title>
Stringfield
</title>
<!-- renderjs -->
<script
src=
"../lib/rsvp.min.js"
></script>
<script
src=
"../lib/renderjs.min.js"
></script>
<!-- custom script -->
<script
src=
"stringfield.js"
type=
"text/javascript"
></script>
</head>
<body>
<input
type=
'text'
data-mini=
"true"
/>
</body>
</html>
dream/platform/static/string_field/stringfield.js
0 → 100644
View file @
90bf2510
/*global window, rJS, RSVP */
(
function
(
window
,
rJS
,
RSVP
)
{
"
use strict
"
;
rJS
(
window
).
ready
(
function
(
gadget
)
{
return
gadget
.
getElement
().
push
(
function
(
element
)
{
gadget
.
element
=
element
;
});
}).
declareMethod
(
"
render
"
,
function
(
options
)
{
var
input
=
this
.
element
.
querySelector
(
"
input
"
),
field_json
=
options
.
field_json
||
{};
input
.
setAttribute
(
"
value
"
,
field_json
.
value
||
""
);
input
.
setAttribute
(
"
name
"
,
field_json
.
key
);
input
.
setAttribute
(
"
title
"
,
field_json
.
title
);
}).
declareMethod
(
"
getContent
"
,
function
()
{
var
input
=
this
.
element
.
querySelector
(
"
input
"
),
result
=
{};
result
[
input
.
getAttribute
(
"
name
"
)]
=
input
.
value
;
return
result
;
});
})(
window
,
rJS
,
RSVP
);
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment