Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
renderjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Klaus Wölfel
renderjs
Commits
43d97b8d
Commit
43d97b8d
authored
Jun 04, 2013
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Global gadget to display browser and preview
No interaction for now.
parent
079ec1a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
0 deletions
+71
-0
gadget/filebrowser_and_preview.html
gadget/filebrowser_and_preview.html
+18
-0
gadget/filebrowser_and_preview.js
gadget/filebrowser_and_preview.js
+53
-0
No files found.
gadget/filebrowser_and_preview.html
0 → 100644
View file @
43d97b8d
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta
name=
"viewport"
content=
"width=device-width, height=device-height, initial-scale=1"
/>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
/>
<script
type=
"text/javascript"
src=
"http://code.jquery.com/jquery-1.9.1.min.js"
></script>
<script
type=
"text/javascript"
src=
"../hyperbrowser.js"
></script>
<script
type=
"text/javascript"
src=
"../renderjs.js"
></script>
<script
type=
"text/javascript"
src=
"filebrowser_and_preview.js"
></script>
</head>
<body>
<noscript>
Please enable Javascript
</noscript>
</body>
</html>
gadget/filebrowser_and_preview.js
0 → 100644
View file @
43d97b8d
/*global document, jQuery */
// filebrowser.html?file=browser%3A%2F%2Fbrowse%2Fls%2F
"
use strict
"
;
(
function
(
document
,
$
)
{
var
getParameter
=
function
(
searchString
,
paramName
)
{
var
i
,
val
,
params
=
searchString
.
split
(
"
&
"
);
for
(
i
=
0
;
i
<
params
.
length
;
i
++
)
{
val
=
params
[
i
].
split
(
"
=
"
);
if
(
val
[
0
]
==
paramName
)
{
return
decodeURIComponent
(
val
[
1
]);
}
}
return
null
;
};
var
mapUrl
=
function
(
url
)
{
var
searchString
=
url
.
href
.
split
(
"
?
"
)[
1
],
fileToDisplay
;
if
(
searchString
)
{
fileToDisplay
=
getParameter
(
searchString
,
"
file
"
);
if
(
fileToDisplay
)
{
$
(
"
body
"
).
html
(
'
<iframe src="
'
+
// XXX Hardcoded gadget to load
'
filebrowser.html?file=
'
+
fileToDisplay
+
'
">
'
+
'
<p>Your browser does not support iframes.</p>
'
+
'
</iframe">
'
);
$
(
"
body
"
).
append
(
'
<iframe src="
'
+
// XXX Hardcoded gadget to load
'
preview.html
'
+
'
">
'
+
'
<p>Your browser does not support iframes.</p>
'
+
'
</iframe">
'
);
}
else
{
$
(
this
).
text
(
"
No parameter found in url
"
);
}
}
};
$
(
document
).
ready
(
function
()
{
mapUrl
(
window
.
location
);
});
}(
document
,
jQuery
));
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