Skip to content

Commit

Permalink
Remove obsolete XXX
Browse files Browse the repository at this point in the history
  • Loading branch information
mitra42 committed Oct 24, 2017
1 parent f2dca33 commit 34c4f21
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples/htmlutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function addtemplatedchild(el, ...dict) {
el: An HTML element, or a string with the id of one.
html: html to add under outerelement
dict: Dictionary with parameters to replace in html, it looks for nodes with name="xyz" and replaces text inside it with dict[xxx]
dict: Dictionary with parameters to replace in html, it looks for nodes with name="xyz" and replaces text inside it with dict[xyz]
*/
el = (typeof(el) === "string") ? document.getElementById(el) : el;
let el_li = el.getElementsByClassName("template")[0].cloneNode(true); // Copy first child with class=Template
Expand All @@ -131,7 +131,7 @@ function addhtml(el, htmleach, dict) { //TODO merge into addtemplatechild - note
el: An HTML element, or a string with the id of one.
html: html to add under outerelement
dict: Dictionary with parameters to replace in html, it looks for nodes with name="xyz" and replaces text inside it with dict[xxx]
dict: Dictionary with parameters to replace in html, it looks for nodes with name="xyz" and replaces text inside it with dict[xyz]
*/
el = (typeof(el) === "string") ? document.getElementById(el) : el;
let el_li = document.createElement('div'); // usually a 'li' but could be a 'div'
Expand Down
4 changes: 1 addition & 3 deletions js/CommonList.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,8 @@ class CommonList extends SmartDict {
// ----- Listener interface ----- see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget for the pattern

addEventListener(type, callback) {
console.log("XXX@CL.addEventListener",type);
if (!(type in this._listeners)) this._listeners[type] = [];
this._listeners[type].push(callback);
console.log("XXX@CL.addEventListener done")
}

removeEventListener(type, callback) {
Expand All @@ -252,7 +250,7 @@ class CommonList extends SmartDict {
}
}
dispatchEvent(event) {
console.log("XXX@CL.dispatchEvent",event);
console.log("CL.dispatchEvent",event);
if (!(event.type in this._listeners)) return true;
let stack = this._listeners[event.type];
console.log("THIS=",this, "event.target=",event.target);
Expand Down
2 changes: 0 additions & 2 deletions js/KeyPair.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const sodium = require("libsodium-wrappers");
//Uncomment to debug, check urlsafe occurs: console.log("XXX@keypair:2",sodium)
const SmartDict = require("./SmartDict");
const Dweb = require("./Dweb");
const crypto = require('crypto'); // Needed to do a simple sha256 which doesnt appear to be in libsodium
Expand Down Expand Up @@ -144,7 +143,6 @@ class KeyPair extends SmartDict {
if (keytype === Dweb.KeyPair.KEYTYPEENCRYPT || keytype === Dweb.KeyPair.KEYTYPESIGNANDENCRYPT) {
key.encrypt = sodium.crypto_box_seed_keypair(key.seed); // Object { publicKey: Uint8Array[32], privateKey: Uint8Array[64] } <<maybe other keyType
// note this doesnt have the keyType field
//console.log("XXX write this into KeyPair.js line 32", key.encrypt);
}
//if (verbose) { console.log("key generated:",key); }
return key;
Expand Down
2 changes: 1 addition & 1 deletion js/Transport.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Transport {
p_rawstore(data, verbose) {
/*
Store a blob of data onto the decentralised transport.
Returns a promise that resolves to the url of the data, but also see xxx
Returns a promise that resolves to the url of the data
:param string|Buffer data: Data to store - no assumptions made to size or content
:param boolean verbose: True for debugging output
Expand Down
2 changes: 1 addition & 1 deletion js/TransportIPFS.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ class TransportIPFS extends Transport {
p_rawstore(data, verbose) {
/*
Store a blob of data onto the decentralised transport.
Returns a promise that resolves to the url of the data, but also see xxx
Returns a promise that resolves to the url of the data
:param string|Buffer data: Data to store - no assumptions made to size or content
:param boolean verbose: True for debugging output
Expand Down
1 change: 0 additions & 1 deletion js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const jsdom = require("jsdom");
const { JSDOM } = jsdom; //TODO - figure out what this does, dont understand the Javascript
htmlfake = '<!DOCTYPE html><ul><li id="myList.0">Failed to load sb via StructuredBlock</li><li id="myList.1">Failed to load mb via MutableBlock</li><li id="myList.2">Failed to load sb via dwebfile</li><li id="myList.3">Failed to load mb via dwebfile</li></ul>';
const dom = new JSDOM(htmlfake);
//console.log("XXX@8",dom.window.document.getElementById("myList.0").textContent); // Before loading = "Failed to load sb via StructuredBlock"
document = dom.window.document; // Note in JS can't see "document" like can in python

let verbose = true;
Expand Down

0 comments on commit 34c4f21

Please sign in to comment.