Skip to content

Commit 45745c4

Browse files
committed
styling and stuff
1 parent 1fcf871 commit 45745c4

13 files changed

+220
-47
lines changed

Profile.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ public function getSyncList() {
100100
}
101101

102102
$this->consolidateSyncList();
103-
ksort($this->synclist); #FIXME implement our own sort with dir=0 at the top
104103
return $this->synclist;
105104
}
106105

@@ -305,10 +304,9 @@ protected function consolidateSyncList() {
305304

306305
foreach([self::TYPE_PAGES, self::TYPE_MEDIA] as $type) {
307306
foreach($this->synclist[$type] as $id => $item) {
308-
309307
// no sync if hashes match
310308
if($item['remote']['hash'] == $item['local']['hash']) {
311-
unset($this->synclist[$type][$item['id']]);
309+
unset($this->synclist[$type][$id]);
312310
continue;
313311
}
314312

@@ -333,7 +331,7 @@ protected function consolidateSyncList() {
333331
$dir = self::DIR_PUSH;
334332
}
335333
}
336-
$this->synclist[$type][$item['id']]['dir'] = $dir;
334+
$this->synclist[$type][$id]['dir'] = $dir;
337335
}
338336
}
339337
}

action.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,45 @@ protected function sync_init() {
6666
$profile = $prmanager->getProfile($profno);
6767
$list = $profile->getSyncList();
6868
$times = $profile->getTimes();
69+
$count = 0;
70+
71+
foreach($list as $items) {
72+
$count += count($items);
73+
}
6974

7075
$data = [
7176
'times' => [
7277
'ltime' => $times[0],
7378
'rtime' => $times[1],
7479
],
7580
'list' => $list,
81+
'count' => $count
7682
];
7783

7884
return $data;
7985
}
86+
87+
/**
88+
* Store the times of the last sync
89+
*
90+
* @return bool
91+
*/
92+
protected function sync_finish() {
93+
global $INPUT;
94+
$prmanager = new ProfileManager();
95+
$profno = $INPUT->int('no');
96+
97+
$profile = $prmanager->getProfile($profno);
98+
$times = $profile->getTimes();
99+
100+
$config = $profile->getConfig();
101+
102+
$config['ltime'] = $INPUT->int('ltime');
103+
$config['rtime'] = $INPUT->int('rtime');
104+
$config['letime'] = $times[0];
105+
$config['retime'] = $times[1];
106+
107+
$prmanager->setProfileConfig($profno, $config);
108+
return true;
109+
}
80110
}

admin.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,13 @@ function html() {
131131

132132
echo '<script src="' . DOKU_BASE . 'lib/plugins/sync/sync.js" type="text/javascript"></script>';
133133

134-
echo '<div id="sync__progress"></div>';
134+
echo '<div id="sync__progress"><div class="label"></div></div>';
135135
echo '<div id="sync__plugin"></div>';
136136

137137
} else {
138138
echo $this->locale_xhtml('intro');
139139

140+
echo '<div id="sync__plugin__form">';
140141
echo '<div class="sync_left">';
141142
$this->profileDropdown();
142143
if($this->profno !== -1) {
@@ -147,6 +148,7 @@ function html() {
147148
echo '<div class="sync_right">';
148149
$this->profileForm();
149150
echo '</div>';
151+
echo '</div>';
150152
}
151153
}
152154

lang/en/lang.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@
5353
$lang['remote'] = 'Remote Wiki';
5454
$lang['diff'] = 'Diff';
5555

56-
$lang['push'] = 'Push local revision to remote wiki.';
57-
$lang['pushdel'] = 'Delete revision at the remote wiki.';
58-
$lang['pull'] = 'Pull remote revision to local wiki.';
59-
$lang['pulldel'] = 'Delete local revision.';
60-
$lang['keep'] = 'Skip this file and keep both revisions as is.';
56+
$lang['js']['push'] = 'Push local revision to remote wiki.';
57+
$lang['js']['pushdel'] = 'Delete revision at the remote wiki.';
58+
$lang['js']['pull'] = 'Pull remote revision to local wiki.';
59+
$lang['js']['pulldel'] = 'Delete local revision.';
60+
$lang['js']['keep'] = 'Skip this file and keep both revisions as is.';
6161

6262
$lang['syncdone'] = 'Synchronization finished.';
6363
$lang['timeout'] = 'Timeout';
64+
65+
Lines changed: 1 addition & 0 deletions
Loading

pix/arrow-left-bold-circle.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

pix/arrow-right-bold-circle.svg

Lines changed: 1 addition & 0 deletions
Loading

pix/pause-circle-outline.svg

Lines changed: 1 addition & 0 deletions
Loading

pix/pause-circle.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)