fix #807: merging was supported after all

pull/2/head
gorhill 7 years ago
parent 9c634ebd45
commit 97957b7bc3

@ -8,7 +8,7 @@
<button id="cloudPush" type="button" title="cloudPush"></button>
<span data-i18n="cloudNoData"></span>
<button id="cloudPull" type="button" title="cloudPull" disabled></button>
<!-- <button id="cloudPullAndMerge" type="button" title="cloudPullAndMerge" disabled></button> -->
<button id="cloudPullAndMerge" type="button" title="cloudPullAndMerge" disabled></button>
<p id="cloudError"><span></span></p>
<span id="cloudCog" class="fa">&#xf013;</span>
<div id="cloudOptions">

@ -2,39 +2,45 @@
background: url("../img/cloud.png") hsl(216, 100%, 93%);
border-radius: 3px;
margin: 0.5em 0;
padding: 1em;
padding: 1em 1em 0 1em;
position: relative;
}
#cloudWidget.hide {
display: none;
}
#cloudWidget > button {
font-size: 160%;
padding: 0.1em 0.2em;
}
#cloudPull[disabled] {
visibility: hidden;
}
#cloudPush:after ,
#cloudPull:before {
display: inline-block;
font-family: FontAwesome;
font-size: 160%;
font-style: normal;
font-weight: normal;
line-height: 1;
padding: 0.2em 0.25em 0.1em 0.25em;
position: relative;
vertical-align: baseline;
display: inline-block;
}
body[dir="ltr"] #cloudPush:after {
content: '\f0ee';
#cloudWidget > button[disabled] {
visibility: hidden;
}
#cloudWidget > button.error {
color: red;
}
body[dir="rtl"] #cloudPush:after {
#cloudPush:after {
content: '\f0ee';
}
body[dir="ltr"] #cloudPull:before {
#cloudPull:before,
#cloudPullAndMerge:before {
content: '\f0ed';
}
body[dir="rtl"] #cloudPull:before {
content: '\f0ed';
#cloudPullAndMerge {
margin: 0 0.25em;
}
#cloudPullAndMerge:after {
content: '\f067';
font-size: 50%;
position: absolute;
right: 0;
top: 10%;
}
#cloudWidget > span {
color: gray;
@ -45,7 +51,13 @@ body[dir="rtl"] #cloudPull:before {
vertical-align: bottom;
white-space: pre;
}
#cloudWidget > .nodata {
#cloudError {
color: red;
margin: 0;
padding: 0.5em 0;
}
#cloudError > span {
font-size: x-small;
}
#cloudWidget > #cloudCog {
cursor: pointer;

@ -62,6 +62,7 @@ var onCloudDataReceived = function(entry) {
self.cloud.data = entry.data;
uDom.nodeFromId('cloudPull').removeAttribute('disabled');
uDom.nodeFromId('cloudPullAndMerge').removeAttribute('disabled');
var timeOptions = {
weekday: 'short',
@ -118,6 +119,14 @@ var pullData = function(ev) {
/******************************************************************************/
var pullAndMergeData = function() {
if ( typeof self.cloud.onPull === 'function' ) {
self.cloud.onPull(self.cloud.data, true);
}
};
/******************************************************************************/
var openOptions = function() {
var input = uDom.nodeFromId('cloudDeviceName');
input.value = self.cloud.options.deviceName;
@ -188,6 +197,7 @@ var onInitialize = function(options) {
uDom('#cloudPush').on('click', pushData);
uDom('#cloudPull').on('click', pullData);
uDom('#cloudPullAndMerge').on('click', pullAndMergeData);
uDom('#cloudCog').on('click', openOptions);
uDom('#cloudOptions').on('click', closeOptions);
uDom('#cloudOptionsSubmit').on('click', submitOptions);

@ -307,9 +307,7 @@ self.cloud.onPush = function() {
};
self.cloud.onPull = function(data, append) {
if ( typeof data !== 'string' ) {
return;
}
if ( typeof data !== 'string' ) { return; }
if ( append ) {
data = rulesFromHTML('#diff .right li') + '\n' + data;
}

Loading…
Cancel
Save