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
1bc8307f
Commit
1bc8307f
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
adaeef0d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
dream/platform/src2/string_field/index.html
dream/platform/src2/string_field/index.html
+18
-0
dream/platform/src2/string_field/stringfield.js
dream/platform/src2/string_field/stringfield.js
+27
-0
No files found.
dream/platform/src2/string_field/index.html
0 → 100644
View file @
1bc8307f
<!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=
"../<%= copy.rsvp.relative_dest %>"
></script>
<script
src=
"../<%= copy.renderjs.relative_dest %>"
></script>
<!-- custom script -->
<script
src=
"stringfield.js"
type=
"text/javascript"
></script>
</head>
<body>
<input
type=
'text'
data-mini=
"true"
/>
</body>
</html>
dream/platform/src2/string_field/stringfield.js
0 → 100644
View file @
1bc8307f
/*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
));
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