aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojciech Polak <polak@gnu.org>2014-02-09 17:57:17 +0100
committerWojciech Polak <polak@gnu.org>2014-02-09 17:57:17 +0100
commit4bfca38dd3eaf92a868390ac51ff85b54a6c2c90 (patch)
tree1e4793791204f5b9cf610d6ae8f5be61ccd2e61d
parenta5cc6e30ec0f31e64769c317b368f51d9d4ab808 (diff)
downloadcheetah-4bfca38dd3eaf92a868390ac51ff85b54a6c2c90.tar.gz
cheetah-4bfca38dd3eaf92a868390ac51ff85b54a6c2c90.tar.bz2
Fix notes list order.
-rw-r--r--frontend/xnotes.php9
-rw-r--r--js/v2/notes.js25
2 files changed, 18 insertions, 16 deletions
diff --git a/frontend/xnotes.php b/frontend/xnotes.php
index 5f2865d..7432666 100644
--- a/frontend/xnotes.php
+++ b/frontend/xnotes.php
@@ -2,7 +2,7 @@
2 2
3/* 3/*
4 Cheetah News xnotes.php 4 Cheetah News xnotes.php
5 Copyright (C) 2005, 2006, 2007 Wojciech Polak. 5 Copyright (C) 2005, 2006, 2007, 2014 Wojciech Polak.
6 6
7 This program is free software; you can redistribute it and/or modify it 7 This program is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
@@ -122,9 +122,10 @@ function getNoteList ()
122 122
123 $i = 1; $end = $db->num_rows (); 123 $i = 1; $end = $db->num_rows ();
124 if ($end > 0) { 124 if ($end > 0) {
125 echo "cheetahNoteList = {\n"; 125 echo "cheetahNoteList = [\n";
126 while ($db->next_record ()) { 126 while ($db->next_record ()) {
127 echo " '".$db->f ('id')."' : ['".encodeJsEntities ($db->f ('color')). 127 echo "['".$db->f ('id').
128 "', '".encodeJsEntities ($db->f ('color')).
128 "', '".encodeJsEntities ($db->f ('title')). 129 "', '".encodeJsEntities ($db->f ('title')).
129 "', '".encodeJsEntities ($db->f ('date')). 130 "', '".encodeJsEntities ($db->f ('date')).
130 "', '".encodeJsEntities ($db->f ('public')). 131 "', '".encodeJsEntities ($db->f ('public')).
@@ -132,7 +133,7 @@ function getNoteList ()
132 if ($i++ < $end) echo ','; 133 if ($i++ < $end) echo ',';
133 echo "\n"; 134 echo "\n";
134 } 135 }
135 echo "};\n"; 136 echo "];\n";
136 } 137 }
137 else { 138 else {
138 echo "cheetahNoteList = null;\n"; 139 echo "cheetahNoteList = null;\n";
diff --git a/js/v2/notes.js b/js/v2/notes.js
index 3fcf8a7..73f2b82 100644
--- a/js/v2/notes.js
+++ b/js/v2/notes.js
@@ -1,6 +1,6 @@
1/* 1/*
2 Cheetah News JS/v2 Notes 2 Cheetah News JS/v2 Notes
3 Copyright (C) 2005, 2006, 2008 Wojciech Polak. 3 Copyright (C) 2005, 2006, 2008, 2014 Wojciech Polak.
4 4
5 This program is free software; you can redistribute it and/or modify it 5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the 6 under the terms of the GNU General Public License as published by the
@@ -255,39 +255,40 @@ Modules.Notes = new function () {
255 countNoteList (); 255 countNoteList ();
256 256
257 if (cheetahNoteList) { 257 if (cheetahNoteList) {
258 for (var n in cheetahNoteList) { 258 for (var n = 0; n < cheetahNoteList.length; n++) {
259 259
260 var row_rem = DCE ('span', {id: 'noteRowRem_' + n}, 260 var noteId = cheetahNoteList[n][0];
261 ['<span class="link" id="removeNote_' + n + 261 var row_rem = DCE ('span', {id: 'noteRowRem_' + noteId},
262 ['<span class="link" id="removeNote_' + noteId +
262 '"action="rem"><img class="img-10-remove iremove" src="images/t.gif" width="10" height="10" alt="' 263 '"action="rem"><img class="img-10-remove iremove" src="images/t.gif" width="10" height="10" alt="'
263 + _('rem') + '" /></span>']); 264 + _('rem') + '" /></span>']);
264 row_rem.onmouseover = selectRow; 265 row_rem.onmouseover = selectRow;
265 row_rem.onmouseout = unselectRow; 266 row_rem.onmouseout = unselectRow;
266 267
267 var row_pstatus = DCE ('span', {id: 'notePStatus' + n}, 268 var row_pstatus = DCE ('span', {id: 'notePStatus' + noteId},
268 [cheetahNoteList[n][3] == 'yes' ? 269 [cheetahNoteList[n][4] == 'yes' ?
269 '<img class="img-16-world" src="images/t.gif" width="16" height="16" alt="P" title="' 270 '<img class="img-16-world" src="images/t.gif" width="16" height="16" alt="P" title="'
270 + _('Publicly visible')+'" />' : 271 + _('Publicly visible')+'" />' :
271 '<img class="img-16-world-i" src="images/t.gif" width="16" height="16" alt="NP" title="' 272 '<img class="img-16-world-i" src="images/t.gif" width="16" height="16" alt="NP" title="'
272 + _('Not publicly visible')+'" />']); 273 + _('Not publicly visible')+'" />']);
273 274
274 var tags = '<span class="nb_tags">' + cheetahNoteList[n][4].replace (/,/g, ', ') + '</span>'; 275 var tags = '<span class="nb_tags">' + cheetahNoteList[n][5].replace (/,/g, ', ') + '</span>';
275 276
276 var row = DCE ('div', {id: 'note_' + n, className: 'nbRow pointer'}, 277 var row = DCE ('div', {id: 'note_' + noteId, className: 'nbRow pointer'},
277 [DCE ('div', {className: 'nb_tls'}, 278 [DCE ('div', {className: 'nb_tls'},
278 [cheetahNoteList[n][1] + ' ' + tags, 279 [cheetahNoteList[n][2] + ' ' + tags,
279 DCE ('div', {className: 'nb_tld'}, 280 DCE ('div', {className: 'nb_tld'},
280 [cheetahNoteList[n][2].substr (0, 16), 281 [cheetahNoteList[n][3].substr (0, 16),
281 row_pstatus, 282 row_pstatus,
282 row_rem])]) 283 row_rem])])
283 ]); 284 ]);
284 285
285 row.setAttribute ('noteid', n); 286 row.setAttribute ('noteid', noteId);
286 row.onclick = openINote; 287 row.onclick = openINote;
287 row.rgbColor = '#ffffff'; 288 row.rgbColor = '#ffffff';
288 tbody.appendChild (row); 289 tbody.appendChild (row);
289 290
290 var rem = GID ('removeNote_' + n); 291 var rem = GID ('removeNote_' + noteId);
291 if (rem) { 292 if (rem) {
292 rem.title = _('Remove'); 293 rem.title = _('Remove');
293 rem.onclick = removeINote; 294 rem.onclick = removeINote;

Return to:

Send suggestions and report system problems to the System administrator.