Fix URL encoding - fixes #1059
Fixes both permalink & "browse this cluster". Substitutes encodeURIComponent for escape
This commit is contained in:
parent
4834deca5e
commit
c74fce0180
@ -196,8 +196,8 @@ ClusteringDialog.prototype._renderTable = function(clusters) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var params = [
|
var params = [
|
||||||
"project=" + escape(theProject.id),
|
"project=" + encodeURIComponent(theProject.id),
|
||||||
"ui=" + escape(JSON.stringify({
|
"ui=" + encodeURIComponent(JSON.stringify({
|
||||||
"facets" : [ facet ]
|
"facets" : [ facet ]
|
||||||
}))
|
}))
|
||||||
];
|
];
|
||||||
|
@ -229,7 +229,7 @@ Refine.OpenProjectUI.prototype._onClickUploadFileButton = function(evt) {
|
|||||||
} else {
|
} else {
|
||||||
$("#file-upload-form").attr("action",
|
$("#file-upload-form").attr("action",
|
||||||
"command/core/create-project-from-upload?" + [
|
"command/core/create-project-from-upload?" + [
|
||||||
"url=" + escape(dataURL),
|
"url=" + encodeURICompnent(dataURL),
|
||||||
"split-into-columns=" + $("#split-into-columns-input")[0].checked,
|
"split-into-columns=" + $("#split-into-columns-input")[0].checked,
|
||||||
"separator=" + $("#separator-input")[0].value,
|
"separator=" + $("#separator-input")[0].value,
|
||||||
"ignore=" + $("#ignore-input")[0].value,
|
"ignore=" + $("#ignore-input")[0].value,
|
||||||
|
@ -62,8 +62,6 @@ Refine.reportException = function(e) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function resize() {
|
function resize() {
|
||||||
var header = $("#header");
|
|
||||||
|
|
||||||
var leftPanelWidth = 300;
|
var leftPanelWidth = 300;
|
||||||
var width = $(window).width();
|
var width = $(window).width();
|
||||||
var top = $("#header").outerHeight();
|
var top = $("#header").outerHeight();
|
||||||
@ -457,8 +455,8 @@ Refine.fetchRows = function(start, limit, onDone, sorting) {
|
|||||||
|
|
||||||
Refine.getPermanentLink = function() {
|
Refine.getPermanentLink = function() {
|
||||||
var params = [
|
var params = [
|
||||||
"project=" + escape(theProject.id),
|
"project=" + encodeURIComponent(theProject.id),
|
||||||
"ui=" + escape(JSON.stringify({
|
"ui=" + encodeURIComponent(JSON.stringify({
|
||||||
facets: ui.browsingEngine.getFacetUIStates()
|
facets: ui.browsingEngine.getFacetUIStates()
|
||||||
}))
|
}))
|
||||||
];
|
];
|
||||||
@ -475,7 +473,7 @@ function onLoad() {
|
|||||||
var uiState = {};
|
var uiState = {};
|
||||||
if ("ui" in params) {
|
if ("ui" in params) {
|
||||||
try {
|
try {
|
||||||
uiState = JSON.parse(params.ui);
|
uiState = JSON.parse(decodeURIComponent(params.ui));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ ReconDialog.prototype._onAddNamespacedService = function() {
|
|||||||
var typeData = elmts.typeInput.data("data.suggest");
|
var typeData = elmts.typeInput.data("data.suggest");
|
||||||
if (namespaceData) {
|
if (namespaceData) {
|
||||||
var url = "http://reconcile.freebaseapps.com/namespace_reconcile?namespace="
|
var url = "http://reconcile.freebaseapps.com/namespace_reconcile?namespace="
|
||||||
+ escape(namespaceData.id);
|
+ encodeURIComponent(namespaceData.id);
|
||||||
if (typeData) {
|
if (typeData) {
|
||||||
url += "&type=" + typeData.id;
|
url += "&type=" + typeData.id;
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ URL.getParameters = function() {
|
|||||||
params = params.substr(1).split("&");
|
params = params.substr(1).split("&");
|
||||||
$.each(params, function() {
|
$.each(params, function() {
|
||||||
pair = this.split("=");
|
pair = this.split("=");
|
||||||
r[pair[0]] = unescape(pair[1]);
|
r[pair[0]] = decodeURIComponent(pair[1]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,15 +102,3 @@ URL.looksLikeUrl = function(s) {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
URL.getHostname = function(){
|
|
||||||
var url = location.href; // entire url including querystring - also: window.location.href;
|
|
||||||
var baseURL = url.substring(0, url.indexOf('/',7));//7 is the length of http://
|
|
||||||
return baseURL;
|
|
||||||
};
|
|
||||||
|
|
||||||
URL.urlify = function(str) {
|
|
||||||
if(!str) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
return escape(str.replace(/\W/g, '_'));
|
|
||||||
};
|
|
Loading…
Reference in New Issue
Block a user