Commit 0937f05c authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Drop jquery/jquerymobile dependencies

parent 5b8532f2
/*jslint indent: 2, maxerr: 3, nomen: true */
/*global window, rJS, RSVP, $ */
(function (window, rJS, RSVP, $) {
/*global window, rJS, RSVP */
(function (window, rJS, RSVP) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
......@@ -15,20 +15,12 @@
.push(function (element) {
g.props.element = element;
g.props.container = element.querySelector(".jqm-navmenu-panel");
g.props.jelement = $(g.props.container);
});
})
.ready(function (g) {
g.props.jelement.panel({
display: "overlay",
position: "right",
theme: "c"
});
})
.allowPublicAcquisition('trigger', function () {
return this.props.jelement.panel("toggle");
this.props.element.classList.toggle('visible');
// return this.props.jelement.panel("toggle");
})
//////////////////////////////////////////////
// acquired method
......@@ -36,10 +28,12 @@
//local method
.declareMethod('close', function () {
var container = this.props.container;
this.props.jelement.panel("close");
while (container.firstChild) {
container.removeChild(container.firstChild);
}
if (this.props.element.classList.contains('visible')) {
this.props.element.classList.remove('visible');
}
})
.declareMethod('render', function (url, options) {
var gadget = this,
......@@ -63,10 +57,9 @@
.push(function (result) {
var fragment = result[1];
gadget.props.container.appendChild(fragment);
gadget.props.jelement.trigger("create");
gadget.props.jelement.panel("toggle");
gadget.props.element.classList.toggle('visible');
});
}
gadget.props.jelement.panel("toggle");
gadget.props.element.classList.toggle('visible');
});
}(window, rJS, RSVP, $));
\ No newline at end of file
}(window, rJS, RSVP));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.64723.57071.20616</string> </value>
<value> <string>952.10013.10460.65075</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1447071678.82</float>
<float>1467031522.89</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -8,7 +8,6 @@
<title>${application_title}</title>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="jquerymobile.css">
<link rel="stylesheet" href="gadget_erp5.css">
<script data-renderjs-configuration="application_title" type="text/x-renderjs-configuration">${application_title}</script>
......@@ -18,8 +17,6 @@
<script data-renderjs-configuration="hateoas_url" type="text/x-renderjs-configuration">${hateoas_url}</script>
<script data-renderjs-configuration="frontpage_gadget" type="text/x-renderjs-configuration">${frontpage_gadget}</script>
<script src="jquery.js"></script>
<script src="jquerymobile.js"></script>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_global.js" ></script>
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.64733.4438.11997</string> </value>
<value> <string>952.1497.51502.20667</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1447067588.44</float>
<float>1467031565.3</float>
<string>UTC</string>
</tuple>
</state>
......
/*globals window, document, RSVP, rJS,
loopEventListener, jQuery, URI, location, XMLHttpRequest, console*/
loopEventListener, URI, location, XMLHttpRequest, console*/
/*jslint indent: 2, maxlen: 80*/
(function (window, document, RSVP, rJS, loopEventListener,
$, XMLHttpRequest, location, console) {
XMLHttpRequest, location, console) {
"use strict";
/////////////////////////////////////////////////////////////////
// Desactivate jQuery Mobile URL management
/////////////////////////////////////////////////////////////////
$.mobile.ajaxEnabled = false;
$.mobile.linkBindingEnabled = false;
$.mobile.hashListeningEnabled = false;
$.mobile.pushStateEnabled = false;
/*
if (navigator.hasOwnProperty('serviceWorker')) {
// Check if a ServiceWorker already controls the site on load
......@@ -218,7 +210,6 @@
g.props = {};
return g.getElement()
.push(function (element) {
$(element).trigger("create");
g.props.loading_counter = 0;
g.props.element = element;
g.props.content_element = element.querySelector('.gadget-content');
......@@ -324,10 +315,7 @@
return gadget.getDeclaredGadget(MAIN_SCOPE)
.push(function (main) {
if (main.render !== undefined) {
return main.render(JSON.parse(gadget.props.m_options_string))
.push(function () {
$(gadget.props.content_element).trigger("create");
});
return main.render(JSON.parse(gadget.props.m_options_string));
}
}, function () {
return;
......@@ -519,8 +507,6 @@
content_container.appendChild(fragment);
element.appendChild(content_container);
$(element).trigger("create");
return updateHeader(gadget);
// XXX Drop notification
// return header_gadget.notifyLoaded();
......@@ -572,5 +558,5 @@
);
});
}(window, document, RSVP, rJS, loopEventListener, jQuery,
}(window, document, RSVP, rJS, loopEventListener,
XMLHttpRequest, location, console));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>950.1266.16388.62907</string> </value>
<value> <string>952.1547.59762.20957</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1458731136.97</float>
<float>1467031817.3</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -136,8 +136,8 @@
<div class="ui-controlgroup ui-controlgroup-horizontal ui-corner-all ui-paging-menu">
<div class="ui-controlgroup-controls">
<a class="{{previous_classname}}" data-i18n="Previous" href="{{previous_url}}">Previous</a>
<span class="ui-btn ui-disabled" data-i18n="{{record}}">{{record}}</span>
<a class="{{next_classname}}" data-i18n="Next" href="{{next_url}}">Next</a>
<span class="ui-btn ui-disabled" data-i18n="{{record}}">{{record}}</span>
</div>
</div>
</th>
......@@ -147,17 +147,17 @@
<script id="listbox-template" type="text/x-handlebars-template">
<div class="ui-table-header ui-header ui-bar-c ui-corner-all">
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left">
<div class="ui-controlgroup-controls">
<h1 data-i18n="{{title}}" class="ui-title ui-override-theme">{{title}}</h1>
<!--div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left">
<div class="ui-controlgroup-controls"-->
<button data-rel="hide" data-i18n="Hide Rows" name="Hide" type="submit" class="submit responsive ui-last-child ui-btn ui-icon-eye ui-btn-icon-left {{hide_class}}">Hide Rows</button>
<!--/div>
</div>
</div>
<h1 data-i18n="{{title}}" class="ui-title ui-override-theme">{{title}}</h1>
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-right">
<div class="ui-controlgroup-controls">
<div class="ui-controlgroup-controls"-->
<button data-rel="Sort" data-i18n="Sort" name="Sort" type="submit" class="submit responsive ui-last-child ui-btn ui-icon-sort-amount-desc ui-btn-icon-left {{hide_sort}}">Sort</button>
</div>
</div>
<!--/div>
</div-->
</div>
<table class="ui-responsive ui-body-c ui-table-inset">
<thead class="ui-bar-inherit thead"></thead>
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>951.48046.6494.25736</string> </value>
<value> <string>952.10020.33938.42018</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1468328152.64</float>
<float>1467032548.63</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -220,7 +220,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>sven</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>942.62057.14260.21691</string> </value>
<value> <string>952.10050.10314.60416</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,8 +252,8 @@
</tuple>
<state>
<tuple>
<float>1431351348.13</float>
<string>GMT</string>
<float>1467033785.24</float>
<string>UTC</string>
</tuple>
</state>
</object>
......
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*global window, rJS, Handlebars, jQuery, RSVP, loopEventListener */
(function (window, rJS, Handlebars, $, RSVP, loopEventListener) {
/*global window, rJS, Handlebars, RSVP, loopEventListener */
(function (window, rJS, Handlebars, RSVP, loopEventListener) {
"use strict";
/////////////////////////////////////////////////////////////////
......@@ -94,7 +94,6 @@
})
.push(function (my_panel_header) {
panel_element.innerHTML = my_panel_header;
$(panel_element).enhanceWithin();
return gadget;
})
.push(function () {
......@@ -115,6 +114,7 @@
Do this.
*/
return;
})
.declareMethod('togglePanel', function () {
......@@ -169,33 +169,6 @@
}
return RSVP.all(event_list);
})
});
}(window, rJS, Handlebars, jQuery, RSVP, loopEventListener));
/*
.push(function (my_panel_category_list) {
return gadget.factoryPanelCategoryList({
"theme": "a",
"position": "left",
"animate_class": "overlay",
"close_i18n": "gen.close",
"i18n": "gen.categories",
"clear_i18n": "gen.clear",
"update_i18n": "gen.update",
"tag_list": tag_list,
"tree": my_panel_category_list
});
})
.push(function (my_panel_content) {
return gadget.translateHtml(my_panel_content);
})
.push(function (my_translated_panel_content) {
return gadget.setPanel("panel_search", my_translated_panel_content);
});
*/
\ No newline at end of file
}(window, rJS, Handlebars, RSVP, loopEventListener));
\ No newline at end of file
......@@ -213,7 +213,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>sven</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -227,7 +227,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>942.62105.59106.27904</string> </value>
<value> <string>952.10051.63355.58214</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -245,8 +245,8 @@
</tuple>
<state>
<tuple>
<float>1431354245.91</float>
<string>GMT</string>
<float>1467033842.68</float>
<string>UTC</string>
</tuple>
</state>
</object>
......
......@@ -10,16 +10,12 @@
<script src="renderjs.js" type="text/javascript"></script>
<script src="handlebars.js" type="text/javascript"></script>
<script src="gadget_global.js" type="text/javascript"></script>
<script src="jquery.js" type="text/javascript"></script>
<script src="jquerymobile.js" type="text/javascript"></script>
<script id="panel-template-header" type="text/x-handlebars-template">
<div data-role="header" class="ui-bar-inherit">
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left">
<div class="ui-controlgroup-controls">
<form action="#" method="post">
<input type="submit" data-i18n="[value]Close" data-icon="delete" data-iconpos="notext" value="Close" />
</form>
<button data-i18n="Close" class="ui-btn ui-btn-icon-notext ui-icon-delete">Close</button>
</div>
</div>
<img class="ui-title" alt="ERP5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b/fpMjks9Howtrt4e320uTx8Pb6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdfKHSQAAAOh0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ALItoLoAAAJkSURBVHja7NlZsqsgEABQ979C5kGGddxo4os0Q8BAynoFn0nUU23TNGRB9xzLdE3XdE3XdP2fLnIzF2VSrsYvC72HizAh9eZ5DVuOl15S4/jWwC+kDC8HPzCSJVHcRY8QXV2PwQuujUYTsYrvYlBv1yKLrsXHsPghnvR3Lazoip/JKuwpF8sm6/bY01Ow9CBlTXi53PNoRcUktEZT1NV1PIPnXAjtMJIMlzerFIzU1dVWF7aPj3Tetae4gjdxktG2et/qQjJ4kZFrv6ED4bK4eR1qduHzvEi4+PbGwD0EGu9CQQLFrv1F4jBc6BcuW3YhkPiPX1hOfxQvnHfh0HVMRqc4HuqiQf5k3mO6dq1s8Hx0H/Le5kq9YaNcxAcrZLpOvAv+ClcgNcZFtnrucd5Fwx4mXj0drnbBYXMuJmFDAV3Uhm4qlbHh3ddOrmholHNxFTVC+xTl2mf6pI4uVe4LwSp0DPGOmh/hAnM94bKZjkHlWuiLeV+cTab4luMKk82wy/Px2fLJskvKUk03hRf9RZ0wiYiZ4uVwVwTb9E71y0XboTYXGuTaa33Y47W5zBjXM3P11y7TfR2ycFdxyaW7uwSc5m0un9ix91m3TWJfW+1ijfW+wcVAfjS5dOP62LyvZZdcLHnA1MkFAtbgwq+Vm47po8OA1buwyy/a1ec5urzveAes2sV8kfW963mFaHNhlT0b6+Yi5+StchH1CtaK0ThXELDPLiyOPZHldzm/J1z9O/B14g7/K+DtkP7U8ivSeD4xaPCTSQvy+YIfubZWzRgtRe1iMP+3mq7pmq7p6jv+BBgAPrgi/TzwWzkAAAAASUVORK5CYII="/>
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>952.1430.15199.54101</string> </value>
<value> <string>952.1567.4220.17373</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1466516646.25</float>
<float>1467031987.88</float>
<string>UTC</string>
</tuple>
</state>
......
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*global window, rJS, Handlebars, jQuery, RSVP, loopEventListener */
(function (window, rJS, Handlebars, $, RSVP, loopEventListener) {
/*global window, rJS, Handlebars, RSVP, loopEventListener */
(function (window, rJS, Handlebars, RSVP, loopEventListener) {
"use strict";
/////////////////////////////////////////////////////////////////
......@@ -37,28 +37,20 @@
return g.getElement()
.push(function (element) {
g.props.element = element;
g.props.jelement = $(element.querySelector("div"));
g.props.render_deferred = RSVP.defer();
});
})
.ready(function (g) {
g.props.jelement.panel({
display: "overlay",
position: "left",
theme: "d"
// animate: false
});
})
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod('toggle', function () {
this.props.jelement.panel("toggle");
this.props.element.classList.toggle('visible');
})
.declareMethod('close', function () {
this.props.jelement.panel("close");
if (this.props.element.classList.contains('visible')) {
this.props.element.classList.remove('visible');
}
})
.declareMethod('render', function () {
......@@ -89,8 +81,7 @@
return tmp;
})
.push(function (my_translated_or_plain_html) {
g.props.jelement.html(my_translated_or_plain_html);
g.props.jelement.trigger("create");
g.props.element.querySelector("div").innerHTML = my_translated_or_plain_html;
g.props.render_deferred.resolve();
});
})
......@@ -110,8 +101,8 @@
})
.push(function () {
return loopEventListener(
panel_gadget.props.element.querySelector('form'),
'submit',
panel_gadget.props.element.querySelector('button'),
'click',
false,
formSubmit
);
......@@ -119,4 +110,4 @@
});
}(window, rJS, Handlebars, jQuery, RSVP, loopEventListener));
\ No newline at end of file
}(window, rJS, Handlebars, RSVP, loopEventListener));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>947.3414.45097.15701</string> </value>
<value> <string>952.1507.19232.15035</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1447406686.19</float>
<float>1466524414.0</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, URI, jQuery */
/*global window, rJS, URI */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, URI, $) {
(function (window, rJS, URI) {
"use strict";
var gadget_klass = rJS(window);
......@@ -135,9 +135,6 @@
element.removeChild(element.firstChild);
}
element.appendChild(fragment);
if (options.hasOwnProperty("form_validation_error")) {
$(element).trigger("create");
}
});
});
return queue;
......@@ -149,4 +146,4 @@
return this.render(options);
});
}(window, rJS, URI, jQuery));
\ No newline at end of file
}(window, rJS, URI));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>952.10268.42242.60416</string> </value>
<value> <string>952.10025.24641.8430</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1467046951.17</float>
<float>1467032278.85</float>
<string>UTC</string>
</tuple>
</state>
......
/*jslint indent: 2, maxerr: 3, maxlen: 100, nomen: true */
/*global window, document, rJS, RSVP, Handlebars, $, loopEventListener,
/*global window, document, rJS, RSVP, Handlebars, loopEventListener,
QueryFactory, SimpleQuery, ComplexQuery, Query, console*/
(function (window, document, rJS, RSVP, Handlebars, $, loopEventListener,
(function (window, document, rJS, RSVP, Handlebars, loopEventListener,
QueryFactory, SimpleQuery, ComplexQuery, Query, console) {
"use strict";
var gadget_klass = rJS(window),
......@@ -132,7 +132,6 @@
})
.push(function (innerHTML) {
select_list[1].innerHTML = innerHTML;
$(select_list[1]).selectmenu('refresh');
if (isNumericComparison(event.target.value)) {
if (event.target.value.indexOf("date") !== -1) {
input.setAttribute("type", "date");
......@@ -242,16 +241,11 @@
return RSVP.all(list);
})
.push(function (all_result) {
var innerHTML = "",
select_list;
var innerHTML = "";
for (i = 0; i < all_result.length; i += 1) {
innerHTML += all_result[i];
}
container.innerHTML = innerHTML;
select_list = container.querySelectorAll("select");
for (i = 0; i < select_list.length; i += 1) {
$(select_list[i]).selectmenu();
}
return listenToSelect(gadget, "auto");
});
}
......@@ -353,14 +347,8 @@
})
.push(function (template) {
var tmp = document.createElement("div"),
container = gadget.props.element.querySelector(".filter_item_container"),
select_list,
i;
container = gadget.props.element.querySelector(".filter_item_container");
tmp.innerHTML = template;
select_list = tmp.querySelectorAll("select");
for (i = 0; i < select_list.length; i += 1) {
$(select_list[i]).selectmenu();
}
container.appendChild(tmp.querySelector("div"));
return listenToSelect(gadget, class_value);
});
......@@ -379,5 +367,5 @@
);
});
}(window, document, rJS, RSVP, Handlebars, $, loopEventListener,
}(window, document, rJS, RSVP, Handlebars, loopEventListener,
QueryFactory, SimpleQuery, ComplexQuery, Query, console));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>949.2121.59518.17646</string> </value>
<value> <string>952.10062.13895.62105</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1455022145.56</float>
<float>1467034494.63</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -14,22 +14,9 @@
<script src="gadget_erp5_searchfield.js"></script>
<script id="panel-template" type="text/x-handlebars-template">
<div class="field_container">
<div class="ui-field-contain">
<div class="bottom">
<div class="ui-input-text ui-body-{{theme}} ui-input-has-icon ui-corner-all ui-shadow-inset ui-input-has-clear">
<input type="text" data-enhanced="true" value="{{widget_value}}" name="search" {{widget_status_attribute}} >
<div class="ui-btn ui-input-clear ui-input-btn ui-corner-all ui-icon-times ui-btn-icon-notext" data-i18n="[node]header-submit">
- Submit<input data-enhanced="true" class="clear_button" type="submit" data-i18n="[value]header-submit" value="Submit" {{widget_status_attribute}} />
</div>
</div>
<div class="ui-shadow-inset ui-btn ui-btn-inline ui-corner-all ui-btn-{{theme}} ui-btn-icon-notext ui-icon-search ui-override-theme " >
<div class="ui-input-btn">
<input class="search_button" data-role="button" data-enhanced="true" type="submit" data-i18n="[value]" value=" ">
</div>
</div>
</div>
</div>
<input type="search" data-enhanced="true" value="{{widget_value}}" name="search" {{widget_status_attribute}}>
<button class="search_button ui-shadow-inset ui-btn ui-btn-inline ui-corner-all ui-btn-{{theme}} ui-btn-icon-notext ui-icon-search ui-override-theme ui-input-btn" data-role="button" data-enhanced="true" type="submit" />
</div>
</script>
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>950.28959.27081.52548</string> </value>
<value> <string>952.1567.50811.55193</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1460449490.1</float>
<float>1467032063.71</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -77,20 +77,6 @@
result[input.getAttribute('name')] = value;
return result;
})
.declareService(function () {
var gadget = this,
clear_button = gadget.props.element.querySelector(".clear_button"),
search_input = gadget.props.element.querySelector("input");
return loopEventListener(
clear_button,
"click",
false,
function () {
search_input.value = "";
search_input.focus();
}
);
});
}(window, rJS, RSVP, Handlebars, loopEventListener));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>950.28962.48103.49971</string> </value>
<value> <string>951.35286.47701.22630</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1460390605.12</float>
<float>1466524830.34</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, document, RSVP, loopEventListener, jQuery */
/*global window, rJS, document, RSVP, loopEventListener */
/*jslint indent: 2, maxerr: 3 */
(function (window, rJS, document, RSVP, loopEventListener, $) {
(function (window, rJS, document, RSVP, loopEventListener) {
"use strict";
rJS(window)
......@@ -58,24 +58,6 @@
}
result[this.property_dict.name] = value;
return result;
})
.declareService(function () {
var gadget = this;
return new RSVP.Queue()
.push(function () {
return gadget.property_dict.textarea_deferred.promise;
})
.push(function (textarea) {
return loopEventListener(
textarea,
'focus',
false,
function () {
$(textarea).keyup();
}
);
});
});
}(window, rJS, document, RSVP, loopEventListener, jQuery));
\ No newline at end of file
}(window, rJS, document, RSVP, loopEventListener));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>949.24043.58938.21367</string> </value>
<value> <string>952.10031.38084.59682</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1456336348.49</float>
<float>1467032882.44</float>
<string>UTC</string>
</tuple>
</state>
......
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