projects
/
euphorik.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
'formater' -> 'formatter'
[euphorik.git]
/
js
/
fragment.js
diff --git
a/js/fragment.js
b/js/fragment.js
index
ef087f4
..
4ffbf8f
100644
(file)
--- a/
js/fragment.js
+++ b/
js/fragment.js
@@
-21,12
+21,18
@@
*/
Fragment = function() {
var thisFragment = this;
*/
Fragment = function() {
var thisFragment = this;
+ // remplacement des codes de type %22 (en hexa)
+ var replaceHtmlCode = function(str) {
+ return str.replace(/%(\d\d)/g, function(text, code) {
+ return String.fromCharCode(parseInt(code, 16));
+ });
+ };
this.fragments = {};
if (!window.location.hash) {
return;
}
try {
this.fragments = {};
if (!window.location.hash) {
return;
}
try {
- var fragmentsStr =
window.location.hash.slice(1
).split(";");
+ var fragmentsStr =
replaceHtmlCode(window.location.hash.slice(1)
).split(";");
fragmentsStr.each(function(i, tuple) {
tuple = tuple.split("=");
thisFragment.fragments[tuple[0]] = JSON.parse(tuple[1]);
fragmentsStr.each(function(i, tuple) {
tuple = tuple.split("=");
thisFragment.fragments[tuple[0]] = JSON.parse(tuple[1]);