Commit ec704ac6 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

Remove trailing whitespace

parent d756e23e
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
url: gadget.props.element.querySelector('.form-use-jio-dav .url').value, url: gadget.props.element.querySelector('.form-use-jio-dav .url').value,
basic_login: btoa(gadget.props.element.querySelector(".form-use-jio-dav .credential").value) basic_login: btoa(gadget.props.element.querySelector(".form-use-jio-dav .credential").value)
}); });
} }
function displayURLList(gadget, event) { function displayURLList(gadget, event) {
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
trElement.appendChild(tdElement); trElement.appendChild(tdElement);
tdElement = document.createElement('td'); tdElement = document.createElement('td');
tdElement.innerHTML = url_number + " URLs"; tdElement.innerHTML = url_number + " URLs";
trElement.appendChild(tdElement); trElement.appendChild(tdElement);
tdElement = document.createElement('td'); tdElement = document.createElement('td');
trElement.appendChild(tdElement); trElement.appendChild(tdElement);
footer_element.appendChild(trElement); footer_element.appendChild(trElement);
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
console.log("saving content"); console.log("saving content");
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return gadget.getDeclaredGadget('codeeditor'); return gadget.getDeclaredGadget('codeeditor');
}) })
.push(function (code_editor_gadget) { .push(function (code_editor_gadget) {
return code_editor_gadget.getContent(); return code_editor_gadget.getContent();
...@@ -177,8 +177,8 @@ ...@@ -177,8 +177,8 @@
[jio_gadget.put("/" + application_id + ".attachment/", { [jio_gadget.put("/" + application_id + ".attachment/", {
// url: path_to_save // url: path_to_save
}), }),
jio_gadget.putAttachment("/", application_id, new Blob([JSON.stringify({url: path_to_save})],{type: "application/json"})) jio_gadget.putAttachment("/", application_id, new Blob([JSON.stringify({url: path_to_save})],{type: "application/json"}))
]); ]);
}) })
.push(function() { .push(function() {
var promise_list = [], var promise_list = [],
...@@ -263,7 +263,7 @@ ...@@ -263,7 +263,7 @@
index = url.indexOf(location); index = url.indexOf(location);
if (index != -1) if (index != -1)
url = url.substr(index + location_len); url = url.substr(index + location_len);
promise_list.push( promise_list.push(
crib_sw_gadget.put(path_to_load + url, {blob: response_list[i]}) crib_sw_gadget.put(path_to_load + url, {blob: response_list[i]})
) )
} }
......
...@@ -47,8 +47,8 @@ ...@@ -47,8 +47,8 @@
xhr.abort(); xhr.abort();
}); });
} }
function sendMessage(message) { function sendMessage(message) {
// This wraps the message posting/response in a promise, which will resolve if the response doesn't // This wraps the message posting/response in a promise, which will resolve if the response doesn't
// contain an error, and reject with the error if it does. If you'd prefer, it's possible to call // contain an error, and reject with the error if it does. If you'd prefer, it's possible to call
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
resolve(event.data); resolve(event.data);
} }
}; };
// This sends the message data as well as transferring messageChannel.port2 to the service worker. // This sends the message data as well as transferring messageChannel.port2 to the service worker.
// The service worker can then use the transferred port to reply via postMessage(), which // The service worker can then use the transferred port to reply via postMessage(), which
// will in turn trigger the onmessage handler on messageChannel.port1. // will in turn trigger the onmessage handler on messageChannel.port1.
...@@ -72,11 +72,11 @@ ...@@ -72,11 +72,11 @@
return navigator.serviceWorker.controller.postMessage(message, [messageChannel.port2]); return navigator.serviceWorker.controller.postMessage(message, [messageChannel.port2]);
}); });
} }
function setStatus(statusMessage) { function setStatus(statusMessage) {
console.log(statusMessage); console.log(statusMessage);
} }
rJS(window) rJS(window)
.ready(function (g) { .ready(function (g) {
g.props = {}; g.props = {};
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
.push(function (element) { .push(function (element) {
g.props.element = element; g.props.element = element;
}); });
}) })
.ready(function(gadget) { .ready(function(gadget) {
// Initialize the gadget local parameters // Initialize the gadget local parameters
gadget.state_parameter_dict = {}; gadget.state_parameter_dict = {};
...@@ -108,11 +108,11 @@ ...@@ -108,11 +108,11 @@
throw "Service Worker are not available in your browser"; throw "Service Worker are not available in your browser";
} }
}) })
/** /**
* allDocs return the list of document in the cache * allDocs return the list of document in the cache
* *
* @params {Object} Not taken into account * @params {Object} Not taken into account
* @return {} Return the data url of the document * @return {} Return the data url of the document
*/ */
.declareMethod('allDocs', function(params) { .declareMethod('allDocs', function(params) {
...@@ -129,14 +129,14 @@ ...@@ -129,14 +129,14 @@
return sendMessage({ return sendMessage({
command: 'allDocs' command: 'allDocs'
}); });
}); });
}) })
/** /**
* get Return a data url. Cannot return a blob as the data * get Return a data url. Cannot return a blob as the data
* is transmitted through an iFrame * is transmitted through an iFrame
* *
* @url {string} url of the document to retrieve * @url {string} url of the document to retrieve
* @return {data_url} Return the data url of the document * @return {data_url} Return the data url of the document
*/ */
.declareMethod('get', function(url) { .declareMethod('get', function(url) {
...@@ -156,13 +156,13 @@ ...@@ -156,13 +156,13 @@
return e.target.result; return e.target.result;
}); });
}) })
/** /**
* put Return a data url. Cannot provide a blob as the data * put Return a data url. Cannot provide a blob as the data
* is transmitted through an iFrame * is transmitted through an iFrame
* *
* @url {string} url of the document to update * @url {string} url of the document to update
* @parameter {data_url} data url of the document to put, it will be transformed in a blob * @parameter {data_url} data url of the document to put, it will be transformed in a blob
* @return {data_url} Return the data url of the document * @return {data_url} Return the data url of the document
*/ */
.declareMethod('put', function(url, parameter) { .declareMethod('put', function(url, parameter) {
...@@ -179,11 +179,11 @@ ...@@ -179,11 +179,11 @@
return 'Added to cache: ' + url + ' at ' + Date(); return 'Added to cache: ' + url + ' at ' + Date();
}).fail(setStatus); }).fail(setStatus);
}) })
/** /**
* Remove an url from the cache * Remove an url from the cache
* *
* @url {string} url of the document to remove * @url {string} url of the document to remove
* @return {} * @return {}
*/ */
.declareMethod('remove', function(url) { .declareMethod('remove', function(url) {
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
} }
}) })
.push(undefined, function (e) { .push(undefined, function (e) {
// Ugly Hack to reload page and make service worker available // Ugly Hack to reload page and make service worker available
if (e.indexOf("Please reload this page to allow Service Worker to control this page") > -1 ) { if (e.indexOf("Please reload this page to allow Service Worker to control this page") > -1 ) {
console.log("reload"); console.log("reload");
window.location.reload(false); window.location.reload(false);
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
} }
}); });
} }
rJS(window) rJS(window)
.ready(function (g) { .ready(function (g) {
g.props = {}; g.props = {};
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
g.props.element = element; g.props.element = element;
getURL.protocol + "//" + getURL.host + "/crib-enable.html" getURL.protocol + "//" + getURL.host + "/crib-enable.html"
}); });
}) })
.ready(function(gadget) { .ready(function(gadget) {
// Initialize the gadget local parameters // Initialize the gadget local parameters
gadget.state_parameter_dict = {}; gadget.state_parameter_dict = {};
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
return storage_gadget.allDocs(params) return storage_gadget.allDocs(params)
}); });
}) })
.declareMethod('get', function(url) { .declareMethod('get', function(url) {
return getStorageGadget(this) return getStorageGadget(this)
.push(function (storage_gadget) { .push(function (storage_gadget) {
...@@ -81,14 +81,14 @@ ...@@ -81,14 +81,14 @@
return jIO.util.dataURItoBlob(result); return jIO.util.dataURItoBlob(result);
}); });
}) })
.declareMethod('put', function(url, parameter) { .declareMethod('put', function(url, parameter) {
var blob, gadget = this; var blob, gadget = this;
if (parameter.blob !== undefined) { if (parameter.blob !== undefined) {
blob = parameter.blob; blob = parameter.blob;
} else { } else {
blob = new Blob( blob = new Blob(
[parameter.content], [parameter.content],
{type: parameter.type,} {type: parameter.type,}
); );
} }
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
.push(console.log, console.log) .push(console.log, console.log)
; ;
}) })
.declareMethod('remove', function(url) { .declareMethod('remove', function(url) {
return getStorageGadget(this) return getStorageGadget(this)
.push(function (storage_gadget) { .push(function (storage_gadget) {
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<div class="ui-controlgroup-controls"> <div class="ui-controlgroup-controls">
</div> </div>
</div> </div>
<h1 class="ui-title"></h1> <h1 class="ui-title"></h1>
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-right"> <div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-right">
......
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
.push(function (link_list) { .push(function (link_list) {
for (var i = 0; i < link_list.length; i++) { for (var i = 0; i < link_list.length; i++) {
gadget.props.element.querySelector("." + page_list[i]).href = link_list[i] gadget.props.element.querySelector("." + page_list[i]).href = link_list[i]
} }
}); });
}) })
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
CribJS offer to you the possibility to create your version of the web application you are using. CribJS offer to you the possibility to create your version of the web application you are using.
Make your copy of the web from here: learn, modify, improve, share.</p> Make your copy of the web from here: learn, modify, improve, share.</p>
<p>As this application is a place to develop web applications, it can edit itself. <p>As this application is a place to develop web applications, it can edit itself.
See how it is made, modify it, improve it. See how it is made, modify it, improve it.
Start developping your own way. Feel free to make this place your own crib.</p> Start developping your own way. Feel free to make this place your own crib.</p>
<ul> <ul>
<li>1. Browse the <a class="url_list" href="#page=url_list">list of URLs</a> you wish to edit</li> <li>1. Browse the <a class="url_list" href="#page=url_list">list of URLs</a> you wish to edit</li>
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
.push(function (link_list) { .push(function (link_list) {
for (var i = 0; i < link_list.length; i++) { for (var i = 0; i < link_list.length; i++) {
gadget.props.element.querySelector("." + page_list[i]).href = link_list[i] gadget.props.element.querySelector("." + page_list[i]).href = link_list[i]
} }
}); });
}) })
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<!-- Custom --> <!-- Custom -->
<script src="./gadget_cribjs_page_editor.js" type="text/javascript"></script> <script src="./gadget_cribjs_page_editor.js" type="text/javascript"></script>
</head> </head>
<body> <body>
<div class="nav_content editor"> <div class="nav_content editor">
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
mimetype = gadget.props.element.querySelector("form.crib-editor-save .mimetype").value; mimetype = gadget.props.element.querySelector("form.crib-editor-save .mimetype").value;
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return gadget.getDeclaredGadget('codeeditor'); return gadget.getDeclaredGadget('codeeditor');
}) })
.push(function (code_editor_gadget) { .push(function (code_editor_gadget) {
return code_editor_gadget.getContent(); return code_editor_gadget.getContent();
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
var gadget = this; var gadget = this;
if (options === undefined) if (options === undefined)
options = {} options = {}
gadget.props.options = options; gadget.props.options = options;
return new RSVP.Queue() return new RSVP.Queue()
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
}) })
.push(function () { .push(function () {
return gadget.props.start_deferred.resolve(); return gadget.props.start_deferred.resolve();
}) })
}) })
.declareService(function () { .declareService(function () {
var gadget = this; var gadget = this;
...@@ -116,5 +116,5 @@ ...@@ -116,5 +116,5 @@
)); ));
return RSVP.all(promise_list); return RSVP.all(promise_list);
}); });
}) })
}(window, rJS, loopEventListener, jIO)); }(window, rJS, loopEventListener, jIO));
\ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<!-- Custom --> <!-- Custom -->
<script src="./gadget_cribjs_page_mass_remove.js" type="text/javascript"></script> <script src="./gadget_cribjs_page_mass_remove.js" type="text/javascript"></script>
</head> </head>
<body> <body>
<div class="nav_content mass_remove container"> <div class="nav_content mass_remove container">
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
gadget.props.element.querySelector(".crib-mass-remove-status").textContent = error; gadget.props.element.querySelector(".crib-mass-remove-status").textContent = error;
console.log(error); console.log(error);
}); });
} }
rJS(window) rJS(window)
.ready(function (g) { .ready(function (g) {
g.props = {}; g.props = {};
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return gadget.props.start_deferred.resolve(); return gadget.props.start_deferred.resolve();
}) })
}) })
.declareService(function () { .declareService(function () {
var gadget = this; var gadget = this;
...@@ -61,5 +61,5 @@ ...@@ -61,5 +61,5 @@
)); ));
return RSVP.all(promise_list); return RSVP.all(promise_list);
}); });
}) })
}(window, rJS, loopEventListener)); }(window, rJS, loopEventListener));
\ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<!-- Custom --> <!-- Custom -->
<script src="./gadget_cribjs_page_save_load.js" type="text/javascript"></script> <script src="./gadget_cribjs_page_save_load.js" type="text/javascript"></script>
</head> </head>
<body> <body>
<div class="nav_content save_load container"> <div class="nav_content save_load container">
......
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
<!-- Custom --> <!-- Custom -->
<script src="./gadget_cribjs_page_select_site.js" type="text/javascript"></script> <script src="./gadget_cribjs_page_select_site.js" type="text/javascript"></script>
</head> </head>
<body> <body>
<div class="nav_content save_load container"> <div class="nav_content save_load container">
<h3>Site Editor Gadget URL</h3> <h3>Site Editor Gadget URL</h3>
<p>Enter the URL of the Crib Gadget from the site you want to edit. If you want to edit this site use: <p>Enter the URL of the Crib Gadget from the site you want to edit. If you want to edit this site use:
"/crib-enable.html"</p> "/crib-enable.html"</p>
<div class="row"> <div class="row">
<table class="table"> <table class="table">
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
.push(function () { .push(function () {
gadget.props.element.querySelector(".crib-site-save-status").textContent = "Saved " + site_editor_gadget_url + " files at "+ Date () gadget.props.element.querySelector(".crib-site-save-status").textContent = "Saved " + site_editor_gadget_url + " files at "+ Date ()
}) })
} }
rJS(window) rJS(window)
.ready(function (g) { .ready(function (g) {
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
.push(function (site_editor_gadget_url) { .push(function (site_editor_gadget_url) {
gadget.props.element.querySelector('form.site-editor-gadget-url .url').value = site_editor_gadget_url; gadget.props.element.querySelector('form.site-editor-gadget-url .url').value = site_editor_gadget_url;
return gadget.props.start_deferred.resolve(); return gadget.props.start_deferred.resolve();
}) })
}) })
.declareService(function () { .declareService(function () {
var gadget = this; var gadget = this;
...@@ -58,5 +58,5 @@ ...@@ -58,5 +58,5 @@
)); ));
return RSVP.all(promise_list); return RSVP.all(promise_list);
}); });
}) })
}(window, rJS, loopEventListener)); }(window, rJS, loopEventListener));
\ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<!-- Custom --> <!-- Custom -->
<script src="./gadget_cribjs_page_url_list.js" type="text/javascript"></script> <script src="./gadget_cribjs_page_url_list.js" type="text/javascript"></script>
</head> </head>
<body> <body>
<div class="nav_content url_list container"> <div class="nav_content url_list container">
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
trElement.appendChild(tdElement); trElement.appendChild(tdElement);
tdElement = document.createElement('td'); tdElement = document.createElement('td');
tdElement.innerHTML = url_number + " URLs"; tdElement.innerHTML = url_number + " URLs";
trElement.appendChild(tdElement); trElement.appendChild(tdElement);
tdElement = document.createElement('td'); tdElement = document.createElement('td');
trElement.appendChild(tdElement); trElement.appendChild(tdElement);
footer_element.appendChild(trElement); footer_element.appendChild(trElement);
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
var gadget = this; var gadget = this;
if (options === undefined) if (options === undefined)
options = {} options = {}
gadget.props.options = options; gadget.props.options = options;
return new RSVP.Queue() return new RSVP.Queue()
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
}) })
.push(function () { .push(function () {
return gadget.props.start_deferred.resolve(); return gadget.props.start_deferred.resolve();
}) })
}) })
.declareService(function () { .declareService(function () {
var gadget = this; var gadget = this;
...@@ -115,5 +115,5 @@ ...@@ -115,5 +115,5 @@
function (event) {displayURLList(gadget, event)} function (event) {displayURLList(gadget, event)}
) )
}); });
}) })
}(window, rJS, loopEventListener)); }(window, rJS, loopEventListener));
\ No newline at end of file
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
}; };
}); });
}) })
.declareAcquiredMethod('jio_get', 'jio_get') .declareAcquiredMethod('jio_get', 'jio_get')
.declareAcquiredMethod('renderApplication', 'renderApplication') .declareAcquiredMethod('renderApplication', 'renderApplication')
.declareMethod('start', function () { .declareMethod('start', function () {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
function getSetting(gadget, key, default_value) { function getSetting(gadget, key, default_value) {
if ( key === "site_editor_gadget_url" ) { if ( key === "site_editor_gadget_url" ) {
return window.location.protocol + "//" + window.location.host + "/crib-enable.html" return window.location.protocol + "//" + window.location.host + "/crib-enable.html"
} }
return default_value; return default_value;
} }
...@@ -32,11 +32,11 @@ ...@@ -32,11 +32,11 @@
} }
relativePath = relativePath.substring(from_path.length); relativePath = relativePath.substring(from_path.length);
if (!relativePath.startsWith("/") && !path_to_load.endsWith("/")) { if (!relativePath.startsWith("/") && !path_to_load.endsWith("/")) {
end_url = path_to_load + "/" + relativePath end_url = path_to_load + "/" + relativePath
} else if (relativePath.startsWith("/") && path_to_load.endsWith("/")) { } else if (relativePath.startsWith("/") && path_to_load.endsWith("/")) {
end_url = path_to_load + relativePath.substring(1); end_url = path_to_load + relativePath.substring(1);
} else { } else {
end_url = path_to_load + relativePath end_url = path_to_load + relativePath
} }
promise_list.push( promise_list.push(
new RSVP.Queue(). new RSVP.Queue().
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
} else if ( end_url.endsWith(".css") ) { } else if ( end_url.endsWith(".css") ) {
// This is a ugly hack as mimetype needs to be correct for JS // This is a ugly hack as mimetype needs to be correct for JS
result = result.slice(0, result.size, "text/css") result = result.slice(0, result.size, "text/css")
} }
return crib_sw_gadget.put(end_url, {blob: result}) return crib_sw_gadget.put(end_url, {blob: result})
}) })
) )
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
file_list = options.file_list; file_list = options.file_list;
if (file_list.length === 0) { if (file_list.length === 0) {
return "No File to Load"; return "No File to Load";
} }
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
function getParameterDict () { function getParameterDict () {
var hash = window.location.hash.substring(1), var hash = window.location.hash.substring(1),
params = {}; params = {};
hash.split('&').map(hk => { hash.split('&').map(hk => {
let temp = hk.split('='); let temp = hk.split('=');
params[temp[0]] = temp[1]; params[temp[0]] = temp[1];
}); });
return params; return params;
......
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