Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4130720
Section.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
Section.js
View Options
const
util
=
require
(
'./util.js'
),
mfExtend
=
require
(
'./mfExtend'
),
View
=
require
(
'./View'
);
/**
* Builds a section of a page
*
* @extends module:mobile.startup/View
* @ignore
* @param {Object} options Configuration options
*/
function
Section
(
options
)
{
const
self
=
this
;
options
.
tag
=
'h'
+
options
.
level
;
this
.
line
=
options
.
line
;
this
.
text
=
options
.
text
;
this
.
hasReferences
=
options
.
hasReferences
||
false
;
this
.
id
=
options
.
id
||
null
;
this
.
anchor
=
options
.
anchor
;
this
.
subsections
=
[];
(
options
.
subsections
||
[]
).
forEach
(
(
section
)
=>
self
.
subsections
.
push
(
new
Section
(
section
)
)
);
View
.
call
(
this
,
options
);
}
mfExtend
(
Section
,
View
,
{
template
:
util
.
template
(
`
<h{{level}} id="{{anchor}}">{{{line}}}</h{{level}}>
{{{text}}}
`
),
/**
* @memberof Section
* @instance
* @mixes module:mobile.startup/View#defaults
* @property {Object} defaults Default options hash.
* @property {string} defaults.text Section text.
*/
defaults
:
{
line
:
undefined
,
text
:
''
}
}
);
module
.
exports
=
Section
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 19, 10:32 (2 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
bd/b0/38831b7fda7abdb5dbeae53bf0e2
Default Alt Text
Section.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment