Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F10190421
desktop-file.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
desktop-file.js
View Options
/* -------------------------------------------------------------
GNOME .desktop file generator
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Author: Dereckson
Dependencies: jQuery
Filename: desktop-file.js
Version: 1.0
Created: 2014-07-27
Licence: BSD
------------------------------------------------------------- */
var
File
=
{
template
:
[
'[Desktop Entry]'
,
'Type=%%type%%'
,
'Encoding=%%encoding%%'
,
'Name=%%name%%'
,
'Comment=%%comment%%'
,
'Exec=%%exec%%'
,
'Icon=%%icon%%'
,
'Terminal=%%terminal%%'
].
join
(
'\n'
),
Generate
:
function
()
{
var
re
=
/%%([a-z]*)%%/mg
;
var
content
=
this
.
template
.
replace
(
re
,
function
(
expr
,
variable
)
{
var
div
=
document
.
forms
[
'data'
][
variable
];
if
(
div
==
null
)
{
return
"[Error: can't find "
+
variable
+
" value.]"
;
}
if
(
div
instanceof
NodeList
)
{
return
$
(
'input[name="'
+
variable
+
'"]:checked'
).
val
();
}
return
div
.
value
;
});
document
.
getElementById
(
'file'
).
innerHTML
=
content
;
}
};
var
CheatSheet
=
{
currentElement
:
''
,
Print
:
function
(
element
)
{
//Displays the right element in the cheatsheet area.
if
(
this
.
currentElement
==
element
)
{
return
;
}
if
(
this
.
currentElement
!=
''
)
{
document
.
getElementById
(
this
.
currentElement
).
style
.
display
=
'none'
;
}
this
.
currentElement
=
element
;
document
.
getElementById
(
element
).
style
.
display
=
'block'
;
}
};
File
.
Generate
();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jun 26, 05:22 (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2701739
Default Alt Text
desktop-file.js (1 KB)
Attached To
Mode
rTOOLS Nasqueron Tools
Attached
Detach File
Event Timeline
Log In to Comment