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
Cédric Le Ninivin
renderjs
Commits
27aab967
Commit
27aab967
authored
Jun 10, 2013
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed event listeners from all files except renderjs
parent
4a44482d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
64 deletions
+7
-64
gadget/filebrowser_and_preview.js
gadget/filebrowser_and_preview.js
+0
-6
gadget/filecontent.js
gadget/filecontent.js
+7
-11
gadget/preview_by_hash_change.js
gadget/preview_by_hash_change.js
+0
-23
gadget/preview_by_postmessage.js
gadget/preview_by_postmessage.js
+0
-23
renderjs.js
renderjs.js
+0
-1
No files found.
gadget/filebrowser_and_preview.js
View file @
27aab967
...
...
@@ -70,12 +70,6 @@
}
else
{
$
(
"
body
"
).
text
(
"
No parameter found in url
"
);
}
// if (window.addEventListener){
// window.addEventListener("message", handler, false)
// } else {
// window.attachEvent("onmessage", handler)
// }
});
}(
document
,
jQuery
));
gadget/filecontent.js
View file @
27aab967
...
...
@@ -9,22 +9,19 @@
sessionStorage
.
setItem
(
"
schnick
"
,
"
schnack
"
);
var
setup
=
function
()
{
// not an easy API...
// can this be done internally?
// TODO:
//
"call" default API need not be passed,
//
"self" can be added automatically
//
"scope" (previous "storage") don't like... too gadget-specific?
//
"target" (previous "display") don't like, as above
// TODO:
I don't like scope/target for passing too specific information
//
like scope = which storage to use and target = which file to load in
//
the next target
//
TODO: Should be in window.location.href, not declared here
//
TODO: how to pass multiple instances of _links? allow at all?
var
instance1
=
"
data://application/hal+json;base64,
"
+
window
.
btoa
(
JSON
.
stringify
({
_links
:
{
self
:
{
href
:
''
},
scope
:
{
href
:
'
browser://browse/ls/
'
},
target
:
{
href
:
'
preview_by_hash_change.html
'
},
call
:
{
href
:
''
}
target
:
{
href
:
'
preview_by_hash_change.html
'
}
}}));
var
instance2
=
"
data://application/hal+json;base64,
"
+
...
...
@@ -32,8 +29,7 @@
_links
:
{
self
:
{
href
:
''
},
scope
:
{
href
:
'
browser://browse/ss/
'
},
target
:
{
href
:
'
preview_by_postmessage.html
'
},
call
:
{
href
:
''
}
target
:
{
href
:
'
preview_by_postmessage.html
'
}
}}));
$
(
"
body
"
).
addGadget
({
...
...
gadget/preview_by_hash_change.js
View file @
27aab967
...
...
@@ -16,23 +16,6 @@
});
};
var
handler
=
function
(
event
)
{
var
type
=
event
.
data
.
type
,
method
=
type
?
type
.
split
(
"
/
"
)[
0
]
:
undefined
;
// prevent both renderJs and page events triggering on "run"
if
(
type
===
undefined
||
method
!==
"
run
"
)
{
ajaxGet
(
event
.
data
,
function
(
value
,
status
,
jqXHR
)
{
ajaxGet
(
value
.
_links
.
enclosure
.
href
,
function
(
value
,
status
,
jqXHR
)
{
if
(
value
===
""
)
{
window
.
document
.
body
.
innerHTML
=
"
file not found
"
;
}
else
{
window
.
document
.
body
.
innerHTML
=
value
;
}
});
});
}
}
var
getParameter
=
function
(
searchString
,
paramName
)
{
var
i
,
val
,
params
=
searchString
.
split
(
"
&
"
);
...
...
@@ -97,12 +80,6 @@
}
else
{
$
(
"
body
"
).
text
(
"
No parameter found in url
"
);
}
if
(
window
.
addEventListener
){
window
.
addEventListener
(
"
message
"
,
handler
,
false
)
}
else
{
window
.
attachEvent
(
"
onmessage
"
,
handler
)
}
});
}(
document
,
jQuery
));
\ No newline at end of file
gadget/preview_by_postmessage.js
View file @
27aab967
...
...
@@ -16,23 +16,6 @@
});
};
var
handler
=
function
(
event
)
{
var
type
=
event
.
data
.
type
,
method
=
type
?
type
.
split
(
"
/
"
)[
0
]
:
undefined
;
// prevent both renderJs and page events triggering on "run"
if
(
type
===
undefined
||
method
!==
"
run
"
)
{
ajaxGet
(
event
.
data
,
function
(
value
,
status
,
jqXHR
)
{
ajaxGet
(
value
.
_links
.
enclosure
.
href
,
function
(
value
,
status
,
jqXHR
)
{
if
(
value
===
""
)
{
window
.
document
.
body
.
innerHTML
=
"
file not found
"
;
}
else
{
window
.
document
.
body
.
innerHTML
=
value
;
}
});
});
}
}
var
getParameter
=
function
(
searchString
,
paramName
)
{
var
i
,
val
,
params
=
searchString
.
split
(
"
&
"
);
...
...
@@ -103,12 +86,6 @@
}
else
{
$
(
"
body
"
).
text
(
"
No parameter found in url
"
);
}
if
(
window
.
addEventListener
){
window
.
addEventListener
(
"
message
"
,
handler
,
false
)
}
else
{
window
.
attachEvent
(
"
onmessage
"
,
handler
)
}
});
}(
document
,
jQuery
));
\ No newline at end of file
renderjs.js
View file @
27aab967
...
...
@@ -509,7 +509,6 @@
// => manages all interactions (listens to incoming postMessages)
priv
.
serviceHandler
=
function
(
event
)
{
var
type
=
event
.
data
.
type
,
route
;
if
(
type
)
{
route
=
event
.
data
.
type
.
split
(
"
/
"
);
...
...
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