Hi,
I finished folder drag/drop. Enables drag/dropping of folders onto a new parent folder, or to the root of the tree if dropped onto one of the 'protected' folders.
In the process I fixed sort_subscription_list(). Not that anybody ever noticed it was broken, but still.
Comments please, and tests on different browsers on different platforms. Firefox on win32 works fine, no need to test that :)
Robin
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/1j/DANjXG8A/folder-dragdrop.2007.patch Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/
Hi Robin
Unfortunately I didn't have the time to test your patch but I now updated my trunk and there are some javascript errors on the subscription list in my Firefox 2.0 on Mac. Also the folder names are not displayed anymore. I reopened http://trac.roundcube.net/trac.cgi/ticket/1457344 with a dump of the javascript error and a screenshot of my folder list.
In revision 813 you implicitly add new folders as a subfolder of the selected one. This should be confirmed by the user (with a checkbox for example) since it's hard to unselect a row in the subscription list and as a user I simply wouldn't expect it to be created as a subfolder.
And finally: do you update the IMAP subscription list when moving a folder? I remember some problems when deleting a folder but not unsubscribing it first. Some IMAP servers don't update the subscription list automatically.
Regards, ~Thomas
2007/9/21, Robin Elfrink elfrink@introweb.nl:
Hi,
I finished folder drag/drop. Enables drag/dropping of folders onto a new parent folder, or to the root of the tree if dropped onto one of the 'protected' folders.
In the process I fixed sort_subscription_list(). Not that anybody ever noticed it was broken, but still.
Comments please, and tests on different browsers on different platforms. Firefox on win32 works fine, no need to test that :)
Robin
List info: http://lists.roundcube.net/dev/
Thomas Bruederli wrote:
Unfortunately I didn't have the time to test your patch but I now updated my trunk and there are some javascript errors on the subscription list in my Firefox 2.0 on Mac. Also the folder names are not displayed anymore. I reopened http://trac.roundcube.net/trac.cgi/ticket/1457344 with a dump of the javascript error and a screenshot of my folder list.
I noticed, and updated it asking if you by any change have 'foreign' characters in your folder names. I haven't seen empty names, and suspect that's where your JS errors come from, somehow.
If you zip your complete Maildir and send it to me I can debug this problem :)
In revision 813 you implicitly add new folders as a subfolder of the selected one. This should be confirmed by the user (with a checkbox for example) since it's hard to unselect a row in the subscription list and as a user I simply wouldn't expect it to be created as a subfolder.
Okay, will do that. And/or add the ability to list.js to unselect one row, if multiselect is disabled, by simply clicking on the selected row again?
And finally: do you update the IMAP subscription list when moving a folder? I remember some problems when deleting a folder but not unsubscribing it first. Some IMAP servers don't update the subscription list automatically.
No, I assumed that the backend code for 'rename-folder' would do that. Because moving a folder in IMAP is nothing more than renaming it.
<clicketyclick>
Okay, unction rename_mailbox() in program/include/rcube_imap.inc handles that.
Robin _______________________________________________ List info: http://lists.roundcube.net/dev/
2007/9/26, Robin Elfrink elfrink@introweb.nl:
[...]
I guess the problem is the follwing replace: preg_replace('/.*' . preg_quote($IMAP->delimiter) ...)
My folders are all top-level and $IMAP->delimiter is empty. The resulting expression is /.*/ which removes all characters from the folder name. I'd suggest to split the folder name by the delimiter and then use the last array index (which would be 0 in my case).
In revision 813 you implicitly add new folders as a subfolder of the selected one. This should be confirmed by the user (with a checkbox for example) since it's hard to unselect a row in the subscription list and as a user I simply wouldn't expect it to be created as a subfolder.
Okay, will do that. And/or add the ability to list.js to unselect one row, if multiselect is disabled, by simply clicking on the selected row again?
Could be an idea but I'd suggest to add a checkbox named "create as subfolder of .." anyway.
Okay, unction rename_mailbox() in program/include/rcube_imap.inc handles that.
OK, I didn't see that it's a simple renaming.
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/
2007/9/26, Thomas Bruederli roundcube@gmail.com:
2007/9/26, Robin Elfrink elfrink@introweb.nl:
[...]
I guess the problem is the follwing replace: preg_replace('/.*' . preg_quote($IMAP->delimiter) ...)
My folders are all top-level and $IMAP->delimiter is empty. The resulting expression is /.*/ which removes all characters from the folder name. I'd suggest to split the folder name by the delimiter and then use the last array index (which would be 0 in my case).
Or probably you can use rcmail_build_folder_tree() to get the folder names without the complete path.
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/
Thomas Bruederli wrote:
My folders are all top-level and $IMAP->delimiter is empty. The resulting expression is /.*/ which removes all characters from the folder name. I'd suggest to split the folder name by the delimiter and then use the last array index (which would be 0 in my case).
An empty delimiter. Never thought of that. Okay, fixed.
Could be an idea but I'd suggest to add a checkbox named "create as subfolder of .." anyway.
this.get_label() does not know about variable substitutions. How's the attached patch?
Robin
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/fv/bMLXQ2Z4/confirm-create.20070.patch Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/
2007/9/26, Robin Elfrink elfrink@introweb.nl:
this.get_label() does not know about variable substitutions. How's the attached patch?
Right. I thought we'll implement it when needed...
- if (vars && vars.constructor.toString().indexOf('Array')>=0)
for (var i=0; i<vars.length; i++)
label = label.replace(/%s/, vars[i]);
I would like to use the same "syntax" as in PHP. This allows us to use the same labels in both PHP and Javascript. The replacement of $varname in the label string could look like this:
if (vars && typeof vars == 'object') for (var key in vars) label = label.replace(new RegExp('$'+key, 'g'), vars[key]);
and then use it with...
var foo = this.get_label('mylabel', {myvar:"Yeah!"});
~Thomas
P.S. The above code is untested. _______________________________________________ List info: http://lists.roundcube.net/dev/
2007/9/26, Robin Elfrink elfrink@introweb.nl:
Thomas Bruederli wrote:
My folders are all top-level and $IMAP->delimiter is empty. The resulting expression is /.*/ which removes all characters from the folder name. I'd suggest to split the folder name by the delimiter and then use the last array index (which would be 0 in my case).
An empty delimiter. Never thought of that. Okay, fixed.
I tested it on my Mac (IMAP daemon from Postfix Enabler which is derived from UW-IMAP) and added a default delimiter (r824). The server did not define any and exploding a string by NULL results in an empty array.
Sorry for bitching again but there are still some issues (see http://trac.roundcube.net/trac.cgi/ticket/1457344#comment:12) which should be solved before we can consider this feature as completed.
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/