Commit 0e6d6eca authored by Jérome Perrin's avatar Jérome Perrin

update static version

parent a0b568dd
......@@ -11,8 +11,6 @@
gadget_klass.declareAcquiredMethod("aq_allDocs", "jio_allDocs").declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash").declareAcquiredMethod("whoWantsToDisplayThisDocument", "whoWantsToDisplayThisDocument").declareMethod("render", function() {
var gadget = this;
return gadget.aq_allDocs({
include_docs: true,
query: 'type:= "Dream"',
select_list: [ "title", "modified" ]
}).push(function(document_list) {
var result_list = [], doc, i;
......
......@@ -21,7 +21,7 @@
}
throw error;
}).push(function(sim_json) {
var document = JSON.parse(sim_json), document_list = [], result_list = [], i;
var document_list = JSON.parse(sim_json), result_list = [], i;
if (document.result) {
if (document.result.result_list) {
document_list = document.result.result_list;
......
......@@ -18,9 +18,8 @@
<script id="panel-template" type="text/x-handlebars-template">
<ul data-role="listview">
<li><a class="pre_input_link ui-btn ui-icon-grid ui-btn-icon-left" data-icon="grid">Documents</a></li>
<!--li><a class="home_link ui-btn ui-icon-home ui-btn-icon-left" data-icon="home">Documents</a></li-->
<!--li><a class="fast_input_link ui-btn ui-icon-plus ui-btn-icon-left" data-icon="plus">New Document</a></li-->
<li><a class="home_link ui-btn ui-icon-home ui-btn-icon-left" data-icon="home">Documents</a></li>
<li><a class="fast_input_link ui-btn ui-icon-plus ui-btn-icon-left" data-icon="plus">New Document</a></li>
{{#navigationlist}}
<li><a href="{{link}}">{{title}}</a></li>
{{/navigationlist}}
......
This diff is collapsed.
/*global rJS, RSVP, jQuery, Handlebars,
promiseEventListener, initGadgetMixin, console */
promiseEventListener, initGadgetMixin*/
/*jslint nomen: true */
(function(window, rJS, RSVP, Handlebars, initGadgetMixin) {
"use strict";
......@@ -13,9 +13,6 @@
// XXX node_id is added like a property so that one can change the node
// id
var gadget = this, queue;
console.log("FIELDSET RENDER 1");
console.log(options);
console.log(node_id);
gadget.props.key = options.key;
// used for recursive fieldsets
gadget.props.field_gadget_list = [];
......@@ -24,27 +21,10 @@
queue.push(function() {
// XXX this is incorrect for recursive fieldsets.
// we should use nested fieldset with legend
console.log("insertingAdjacentHTML for:" + property_id);
gadget.props.element.insertAdjacentHTML("beforeend", label_template({
"for": property_id,
name: property_definition.name || property_id
name: property_definition.name || property_definition.description || property_id
}));
console.log("....................");
console.log(property_id);
console.log(property_definition);
console.log(value);
// XXX maybe type should be used instead
if (property_definition.allOf) {
// if there is type property then remove it
if (property_definition.allOf[0].type) {
delete property_definition.allOf[0].type;
}
return gadget.declareGadget("../expandable_field/index.html");
}
if (property_definition.properties) {
// Create a recursive fieldset for this key.
return gadget.declareGadget("../fieldset/index.html");
}
if (property_definition.type === "object") {
// Create a recursive fieldset for this key.
return gadget.declareGadget("../fieldset/index.html");
......@@ -71,63 +51,22 @@
});
}
queue = new RSVP.Queue().push(function() {
var reserved_keys = [];
if (node_id) {
addField("id", {
type: "string"
}, node_id);
}
Object.keys(options.property_definition.properties).forEach(function(property_name) {
var property_definition = options.property_definition.properties[property_name], value, i = 0, property, index;
if (property_definition) {
value = property_definition.default || {};
if (property_definition.allOf) {
if (property_definition.allOf[0].properties) {
for (property in property_definition.allOf[0].properties) {
if (property_definition.allOf[0].properties.hasOwnProperty(property)) {
i += 1;
if (i > 1) {
console.log("something is wrong!");
}
value = property_definition.allOf[0].properties[property].default;
}
}
}
}
}
console.log("TRYING TO FIND A VALUE!!!!");
console.log(options);
console.log(options.value);
console.log(property_name);
// XXX if the field is complex then the value may be complex
// eg options.value > "time_to_failure":{},"time_to_repair":{}...
// while the property_names are abstract as allOf_1 corresponding
// to (for example) time_to_failure
if (options.property_definition.properties[property_name].allOf) {
if ((options.value || {})[property_name] === undefined) {
if (typeof options.value === "object") {
if (Object.keys(options.value).length > 0) {
for (index = 0; index < Object.keys(options.value).length - 1; index += 1) {
if (!(reserved_keys.indexOf(Object.keys(options.value)[index]) > -1)) {
reserved_keys.push(Object.keys(options.value)[index]);
value = options.value[Object.keys(options.value)[index]];
break;
}
}
}
}
}
}
value = (options.value || {})[property_name] === undefined ? value : options.value[property_name];
if (property_name !== "coordinate" && property_name !== "_class" && property_name !== "id") {
console.log("ADDING FIELD FOR " + property_name + "!!!!!!!");
var property_definition = options.property_definition.properties[property_name], value = (options.value || {})[property_name] === undefined ? property_definition._default : options.value[property_name];
// XXX some properties are not editable
// XXX should not be defined here
if (property_name !== "coordinate" && property_name !== "_class") {
addField(property_name, property_definition, value);
}
});
});
return queue;
}).declareMethod("getContent", function() {
console.log("GET CONTENT SIMPLE FIELDSET");
var i, promise_list = [], gadget = this;
for (i = 0; i < this.props.field_gadget_list.length; i += 1) {
promise_list.push(this.props.field_gadget_list[i].getContent());
......@@ -135,8 +74,6 @@
return RSVP.Queue().push(function() {
return RSVP.all(promise_list);
}).push(function(result_list) {
console.log("(*)(/)(*)");
console.log(result_list);
var name, result = {}, content = result;
if (gadget.props.key) {
content = result[gadget.props.key] = {};
......@@ -148,19 +85,7 @@
}
}
}
console.log("GET CONTENT SIMPLE FIELDSET 2");
console.log(result);
return result;
});
}).declareMethod("startService", function() {
console.log("startservice FIElDSET 1");
var gadget = this, i, promise_list = [];
for (i = 0; i < gadget.props.field_gadget_list.length; i += 1) {
if (gadget.props.field_gadget_list[i].startService) {
promise_list.push(gadget.props.field_gadget_list[i].startService());
}
}
console.log("there are " + promise_list.length + " subgadget promises");
return RSVP.all(promise_list);
});
})(window, rJS, RSVP, Handlebars, initGadgetMixin);
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -2915,9 +2915,6 @@ function restCommandRejecter(param, args) {
if (arg.columnNumber !== undefined && arg.columnNumber !== null) {
current_priority.columnNumber = arg.columnNumber;
}
if (arg.fileName !== undefined && arg.fileName !== null) {
current_priority.fileName = arg.fileName;
}
if (arg.filename !== undefined && arg.filename !== null) {
current_priority.filename = arg.filename;
}
......@@ -4150,7 +4147,7 @@ function enableRestParamChecker(jio, shared) {
}
});
["removeAttachment"].forEach(function (method) {
["getAttachment", "removeAttachment"].forEach(function (method) {
shared.on(method, function (param) {
if (!checkId(param)) {
checkAttachmentId(param);
......@@ -4158,26 +4155,6 @@ function enableRestParamChecker(jio, shared) {
});
});
["getAttachment"].forEach(function (method) {
shared.on(method, function (param) {
if (param.storage_spec.type !== "indexeddb" &&
param.storage_spec.type !== "dav" &&
(param.kwargs._start !== undefined
|| param.kwargs._end !== undefined)) {
restCommandRejecter(param, [
'bad_request',
'unsupport',
'_start, _end not support'
]);
return false;
}
if (!checkId(param)) {
checkAttachmentId(param);
}
});
});
["check", "repair"].forEach(function (method) {
shared.on(method, function (param) {
if (param.kwargs._id !== undefined) {
......
/*!
* QUnit 1.15.0
* QUnit 1.14.0
* http://qunitjs.com/
*
* Copyright 2014 jQuery Foundation and other contributors
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2014-08-08T16:00Z
* Date: 2014-01-31T16:40Z
*/
/** Font Family and Sizes */
......@@ -62,14 +62,14 @@
}
#qunit-testrunner-toolbar {
padding: 0.5em 1em 0.5em 1em;
padding: 0.5em 0 0.5em 2em;
color: #5E740B;
background-color: #EEE;
overflow: hidden;
}
#qunit-userAgent {
padding: 0.5em 1em 0.5em 1em;
padding: 0.5em 0 0.5em 2.5em;
background-color: #2B81AF;
color: #FFF;
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
......@@ -86,7 +86,7 @@
}
#qunit-tests li {
padding: 0.4em 1em 0.4em 1em;
padding: 0.4em 0.5em 0.4em 2.5em;
border-bottom: 1px solid #FFF;
list-style-position: inside;
}
......@@ -215,7 +215,7 @@
/** Result */
#qunit-testresult {
padding: 0.5em 1em 0.5em 1em;
padding: 0.5em 0.5em 0.5em 2.5em;
color: #2B81AF;
background-color: #D2E0E6;
......
This diff is collapsed.
......@@ -30,21 +30,19 @@
*/
tools_container.className = "tools-container";
Object.keys(data.class_definition).forEach(function(key) {
var _class_object = data.class_definition[key], tool;
var _class = data.class_definition[key], tool;
// XXX "expand" the json schema "allOF" etc
if (_class_object.allOf) {
if (_class_object.allOf[0].$ref === "#/node") {
tool = document.createElement("div");
// XXX maybe allow to configure the class name ?
tool.className = "tool " + key;
tool.textContent = _class_object.name || key;
tool.draggable = true;
tool.dataset.class_name = JSON.stringify(key);
Object.keys(_class_object.css || {}).forEach(function(k) {
tool.style[k] = _class_object.css[k];
});
tools_container.appendChild(tool);
}
if (_class._class === "node") {
tool = document.createElement("div");
// XXX maybe allow to configure the class name ?
tool.className = "tool " + key;
tool.textContent = _class.name || key;
tool.draggable = true;
tool.dataset.class_name = JSON.stringify(key);
Object.keys(_class.css || {}).forEach(function(k) {
tool.style[k] = _class.css[k];
});
tools_container.appendChild(tool);
}
});
this.props.element.querySelector(".tools").appendChild(tools_container);
......
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