Skip to content

TagSpaces is an offline, open source, document manager with tagging support

Sanitizing generated html

uggrock23a52635a6d9
diff --git a/build.number b/build.number
index b6513bf74..415902f2c 100644
--- a/build.number
+++ b/build.number
@@ -1,4 +1,4 @@
#Build Number for ANT. Do not edit!
-#Fri Jun 14 16:46:13 CEST 2013
-build.number=1382
+#Fri Jun 14 22:16:42 CEST 2013
+build.number=1384
3=
diff --git a/data/ext/editorHTML/extension.js b/data/ext/editorHTML/extension.js
index 6c90c8775..6670335f6 100644
--- a/data/ext/editorHTML/extension.js
+++ b/data/ext/editorHTML/extension.js
@@ -50,7 +50,11 @@ define(function(require, exports, module) {
extensionDirectory+'/cleditor/jquery.cleditor.js',
], function() {
$("#"+containerElementID).append('<textarea id="htmlEditor" style="border-width: 0px; width: 100%; height: 100%; overflow: auto;"></textarea>');
- $("#"+containerElementID).append('<link rel="stylesheet" type="text/css" href="'+extensionDirectory+"/"+'cleditor'+"/"+'jquery.cleditor.css">');
+ $("#"+containerElementID).append($('<link>', {
+ "rel": "stylesheet",
+ "type": "text/css",
+ "href": extensionDirectory+"/cleditor/jquery.cleditor.css"
+ }));
$.cleditor.defaultOptions.width = '100%';
$.cleditor.defaultOptions.height = '100%';
TSCORE.IO.loadTextFile(filePath);
diff --git a/data/ext/perspectiveGraph/extension.js b/data/ext/perspectiveGraph/extension.js
index 1b0d01ad1..41a9a67ac 100644
--- a/data/ext/perspectiveGraph/extension.js
+++ b/data/ext/perspectiveGraph/extension.js
@@ -53,11 +53,14 @@ define(function(require, exports, module) {
require([
extensionDirectory+'/d3/d3.v3.js',
], function() {
- viewContainer.append('<link rel="stylesheet" type="text/css" href="'+extensionDirectory+"/"+'styles.css">');
- });
-
- $( "#"+extensionID+"ReIndexButton" ).removeClass("disabled");
- TSCORE.hideLoadingAnimation();
+ viewContainer.append($('<link>', {
+ "rel": "stylesheet",
+ "type": "text/css",
+ "href": extensionDirectory+"/styles.css"
+ }));
+ $( "#"+extensionID+"ReIndexButton" ).removeClass("disabled");
+ TSCORE.hideLoadingAnimation();
+ });
}
var reDraw = function() {
diff --git a/data/ext/perspectiveRiver/extension.js b/data/ext/perspectiveRiver/extension.js
index 16a411bd5..70f459ac9 100644
--- a/data/ext/perspectiveRiver/extension.js
+++ b/data/ext/perspectiveRiver/extension.js
@@ -57,8 +57,9 @@ define(function(require, exports, module) {
tagsHTML = "";
var fileName = TSCORE.fileList[i][0];
var filePath = TSCORE.currentPath+"/"+fileName;
- tagsHTML += '<iframe id="idFrameViewer" style="width: 100%; height: 150px;" src="'+'file:///'+filePath+'" />';
- $("#"+exports.ID+"RV").append(tagsHTML);
+ // TODO sanitize html
+ //tagsHTML += '<iframe id="idFrameViewer" style="width: 100%; height: 150px;" src="'+'file:///'+filePath+'" />';
+ //$("#"+exports.ID+"RV").append(tagsHTML);
}
TSCORE.hideLoadingAnimation();
diff --git a/data/js/directories.ui.js b/data/js/directories.ui.js
index b8a8f297f..80c3e793d 100644
--- a/data/js/directories.ui.js
+++ b/data/js/directories.ui.js
@@ -144,7 +144,8 @@ define(function(require, exports, module) {
"class": "btn btn-warning btn-small",
"key": directoryHistory[i]["children"][j].key,
"title": directoryHistory[i]["children"][j].key,
- "style": "margin: 1px"
+ "style": "margin: 1px",
+ "text": " "+directoryHistory[i]["children"][j].title
})
.droppable({
greedy: "true",
@@ -161,8 +162,8 @@ define(function(require, exports, module) {
$(ui.helper).remove();
}
}
- })
- .html("<i class='icon-folder-close-alt'></i> "+directoryHistory[i]["children"][j].title)
+ })
+ .prepend("<i class='icon-folder-close-alt'></i>")
.click( function() {
navigateToDirectory($(this).attr("key"));
})
@@ -361,14 +362,14 @@ define(function(require, exports, module) {
$('<li>', {}).append(
$('<a>', {
title: favoritesList[i].path,
- name: favoritesList[i].name
+ name: favoritesList[i].name,
+ text: " "+favoritesList[i].name
} )
.click(function() {
nameCurrentFavorite = $(this).attr( "name" );
openFavorite($(this).attr( "title" ), $(this).attr( "name" ));
})
- .append("<i class='icon-bookmark'></i>")
- .append(" "+favoritesList[i].name)
+ .prepend("<i class='icon-bookmark'></i>")
));
};
$( "#favoritesList" ).append('<li class="divider"></li>');
diff --git a/data/js/fileopener.js b/data/js/fileopener.js
index a11210116..477b0a028 100644
--- a/data/js/fileopener.js
+++ b/data/js/fileopener.js
@@ -68,7 +68,7 @@ define(function(require, exports, module) {
src: filePath
}));
} else {
- require([TSCORE.Config.getExtensionPath()+"/"+viewerExt+"/"+"extension.js"], function(viewer) {
+ require([TSCORE.Config.getExtensionPath()+"/"+viewerExt+"/extension.js"], function(viewer) {
_tsEditor = viewer;
_tsEditor.init(filePath, "viewer");
_tsEditor.viewerMode(true);
@@ -228,8 +228,9 @@ define(function(require, exports, module) {
title: "Add tag "+suggTags[i]+" to current file",
tagname: suggTags[i],
filepath: filePath,
+ text: "Tag with '"+suggTags[i]+"'",
})
- .html("<i class='icon-tag'></i> Tag with '"+suggTags[i]+"'")
+ .prepend("<i class='icon-tag'></i>")
.click(function() {
var tagName = $(this).attr( "tagname" );
var filePath = $(this).attr( "filepath" );
diff --git a/data/js/perspective.manager.js b/data/js/perspective.manager.js
index 6bc1e565b..1cda6ac2f 100644
--- a/data/js/perspective.manager.js
+++ b/data/js/perspective.manager.js
@@ -38,7 +38,7 @@ var initViews = function () {
//if(extensions[i].enabled && (extensions[i].type == "view") ) {
// TODO Some libraries such as ace editor are not working using paths like this "file:///C:/blabal/extension.js"
- var extPath = TSCORE.Config.getExtensionPath()+"/"+extensions[i].id+"/"+"extension.js";
+ var extPath = TSCORE.Config.getExtensionPath()+"/"+extensions[i].id+"/extension.js";
require([extPath], function(perspective) {
perspectives.push(perspective);
@@ -72,14 +72,13 @@ var initViewsUI = function(perspective) {
}).hide());
$("#viewSwitcher").append($("<button>", {
- "viewid": perspective.ID,
- "class": "btn btn-link",
- id: perspective.ID+"Button",
- }).append($("<i>", {
+ "viewid": perspective.ID,
+ "class": "btn btn-link",
+ "id": perspective.ID+"Button",
+ "text": " "+perspective.Title
+ }).prepend($("<i>", {
"class": perspective.Icon
- }))
- .append(" "+perspective.Title)
- );
+ })))
// Adding event listener & icon to the radio button
$( "#"+perspective.ID+"Button" ).click(function() {
diff --git a/data/js/tags.ui.js b/data/js/tags.ui.js
index 99fef4cb1..d57fc18a0 100644
--- a/data/js/tags.ui.js
+++ b/data/js/tags.ui.js
@@ -192,14 +192,14 @@ define(function(require, exports, module) {
) // end heading
.append($("<div>", {
- "class": "accordion-body collapse in",
- "id": "tagButtons"+i,
- "style": "border: 0px;",
+ "class": "accordion-body collapse in",
+ "id": "tagButtons"+i,
+ "style": "border: 0px;",
})
.append($("<div>", {
- "class": "accordion-inner",
- "id": "tagButtonsContent"+i,
- "style": "border: 0px; padding: 3px",
+ "class": "accordion-inner",
+ "id": "tagButtonsContent"+i,
+ "style": "border: 0px; padding: 3px",
})
) // end accordion-inner
) // end accordion button
diff --git a/data/manifest.json b/data/manifest.json
index dfcdbc6f5..4554c30a3 100644
--- a/data/manifest.json
+++ b/data/manifest.json
@@ -1,6 +1,6 @@
{
"name": "TagSpaces",
- "version": "1.4.1380",
+ "version": "1.4.1382",
"manifest_version": 2,
"description": "TagSpaces Explorer",
"icons": {
diff --git a/package.json b/package.json
index edc5ed4a7..c119bab79 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "tagspaces",
"license": "AGPL 3.0",
"author": "Ugg Rock",
- "version": "1.4.1380",
+ "version": "1.4.1382",
"fullName": "TagSpaces",
"id": "jid1-FBaMKxTifTSahQ",
"description": "TagSpaces is a firefox addon, which allows you to browse your local file system and add tags to your files.",
diff --git a/update.rdf b/update.rdf
index aa07dee32..578b98273 100644
--- a/update.rdf
+++ b/update.rdf
@@ -7,13 +7,13 @@
<r:Seq>
<r:li>
<r:Description>
- <version>1.4.1380</version>
+ <version>1.4.1382</version>
<targetApplication>
<r:Description>
<id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id>
<minVersion>16.0</minVersion>
<maxVersion>*</maxVersion>
- <updateLink>http://tagspaces.com/releases/1.4/tagspaces.1.4.1380.xpi</updateLink>
+ <updateLink>http://tagspaces.com/releases/1.4/tagspaces.1.4.1382.xpi</updateLink>
<updateInfoURL>http://tagspaces.com/releases/1.4/updateInfo.xml</updateInfoURL>
</r:Description>
</targetApplication>