Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fc-pregmod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
macaronideath
fc-pregmod
Commits
646d40f7
Commit
646d40f7
authored
5 years ago
by
Skriv
Browse files
Options
Downloads
Patches
Plain Diff
delete obsolete textInput.js
parent
67f271b8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/js/textInput.js
+0
-56
0 additions, 56 deletions
src/js/textInput.js
with
0 additions
and
56 deletions
src/js/textInput.js
deleted
100644 → 0
+
0
−
56
View file @
67f271b8
Macro
.
add
(
"
textinput
"
,
{
// Signifies that the macro is a container macro.
tags
:
null
,
handler
:
function
()
{
if
(
this
.
args
.
length
<
2
)
{
const
errors
=
[];
if
(
this
.
args
.
length
===
0
)
{
errors
.
push
(
"
variable name
"
);
}
if
(
this
.
args
.
length
<
2
)
{
errors
.
push
(
"
default value
"
);
}
return
this
.
error
(
`no
${
errors
.
join
(
"
or
"
)}
specified`
);
}
// Ensure that the variable name argument is a string.
if
(
typeof
this
.
args
[
0
]
!==
"
string
"
)
{
return
this
.
error
(
"
variable name argument is not a string
"
);
}
const
varName
=
this
.
args
[
0
].
trim
();
// Try to ensure that we receive the variable's name (incl. sigil), not its value.
if
(
varName
[
0
]
!==
"
$
"
&&
varName
[
0
]
!==
"
_
"
)
{
return
this
.
error
(
`variable name '
${
varName
}
' is missing its sigil ($ or _)`
);
}
const
that
=
this
;
const
defaultValue
=
this
.
args
[
1
];
const
el
=
document
.
createElement
(
"
textarea
"
);
// Setup and append the textarea element to the output buffer.
jQuery
(
el
)
.
attr
({
rows
:
4
,
// cols: 68, // instead of setting "cols" we set the `min-width` in CSS
tabindex
:
0
// for accessibility
})
.
addClass
(
"
macro-textarea
"
)
// "hijack" the .macro-textarea class
.
on
(
"
input
"
,
function
()
{
Wikifier
.
setValue
(
varName
,
this
.
value
);
if
(
that
.
payload
[
0
].
contents
!==
""
)
{
Wikifier
.
wikifyEval
(
that
.
payload
[
0
].
contents
.
trim
());
}
})
.
appendTo
(
this
.
output
);
// Set the story variable and textarea element to the default value.
Wikifier
.
setValue
(
varName
,
defaultValue
);
// Ideally, we should be setting `.defaultValue` here, but IE doesn't support it,
// so we have to use `.textContent`, which is equivalent.
el
.
textContent
=
defaultValue
;
}
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment