Commit 8c4f532d authored by  JosephK's avatar JosephK

Fix #24

parent 3934011f
......@@ -59,7 +59,7 @@ function makePermalink(framalink) {
$(this).children('.panel-body').css('width').replace('px','')+','+
$(this).children('.panel-body').css('height').replace('px','')+',';
newHash = newHash + coord + encodeURIComponent($(this).find('iframe').attr('src').replace(a.protocol+"//"+a.host+a.pathname, ''))+';';
encodedHash = encodedHash + coord + encodeURIComponent(encodeURIComponent(encodeURIComponent($(this).find('iframe').attr('src').replace(a.protocol+"//"+a.host+a.pathname, ''))))+';';
encodedHash = encodedHash + coord + encodeURIComponent(encodeURIComponent($(this).find('iframe').attr('src').replace(a.protocol+"//"+a.host+a.pathname, '')))+';';
});
location.hash = newHash;
......@@ -83,8 +83,15 @@ function newTile(pTop,pLeft,sWidth,sHeight,url) {
var bsClass = panel[Math.floor(Math.random()*panel.length)];
var parser = document.createElement('a');
parser.href = decodeURIComponent((url+'').replace(/\+/g, '%20'));
if (/%25253A%25252F%25252F/.test(url)) {
parser.href = decodeURIComponent((decodeURIComponent(decodeURIComponent(url))+'').replace(/\+/g, '%20'));
} else if (/%253A%252F%252F/.test(url)) {
parser.href = decodeURIComponent((decodeURIComponent(url)+'').replace(/\+/g, '%20'));
} else {
parser.href = decodeURIComponent((url+'').replace(/\+/g, '%20'));
}
var frameLink = parser.href;
var panelTitle = parser.hostname.replace(/^(www|test)\./i,'').replace(/\.(com|net|org|fr|pro)$/i,'');
......@@ -352,7 +359,6 @@ $(document).ready(function() {
shortLink = tonality+'-'+concerto+'-'+(Math.floor((Date.now() - 1481497200000) / 1000).toString(36)); // 1481497200000 = 2016-12-12 00:00:00
fullLink = (collab) ? makePermalink(true)+$('#pLCoVal').val().substr(-22,22) : makePermalink(true) ;
id = (collab) ? 'Co' : '';
$.ajax({
method: "POST",
......@@ -362,6 +368,7 @@ $(document).ready(function() {
})
.done(function( msg ) {
if(msg.success) {
id = (collab) ? 'Co' : '';
$('#sL'+id+'Val').val('https://frama.link/'+shortLink).parent().parent('.form-group').show();
$('#sL'+id+'Href').attr('href', $('#sL'+id+'Val').val());
$('#sL'+id+'Btn').hide();
......@@ -670,4 +677,4 @@ $(document).ready(function() {
$('.modal-backdrop').remove();
event.preventDefault();
});
});
\ No newline at end of file
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment