Closed
Bug 160019
Opened 22 years ago
Closed 21 years ago
First step to a robust bookmarks handling
Categories
(SeaMonkey :: Bookmarks & History, defect, P2)
SeaMonkey
Bookmarks & History
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.4alpha
People
(Reporter: p_ch, Assigned: p_ch)
References
Details
Attachments
(1 file, 2 obsolete files)
274.89 KB,
patch
|
Details | Diff | Splinter Review |
The patch I will attach proposes a way to simplify (a lot) the bookmark code and make it robust (move/delete/cut/copy) and maintainable. WHAT: 1) remove the fork code between trees and the personal toolbar. 2) systematic handling of non permitted actions. 3) services defined as const in one place WHY: 1) The current bookmark code is quite complicated and rather difficult to maintain in its current form. All the commands are duplicated in bookmarks.xml, bookmarksOverlay.js and a bit in personalToolbar.js. None of the version is bug-free. 2) Wrong actions have been prohibited patch after patch, (copy a folder into itself, drop in find:bookmarks or file: bookmarks, etc...) some part of the patch is corrected but the major part isn't. 3) There is no naming convention (RDF, RDFC, etc...). I found a misleading naming. But the interest here is to make the code much more readable by not redefining those services everytime we need them. HOW? 1) The commands were defined in BookmarksUIElement.prototype and <bookmarks-tree>. They will be removed in bookmarks.xml and ve only defined in a var called BookmarksCommand. A method specific to trees |getTreeSelection| and another one |getPTSelection| specific to the personal toolbar will return an object containing the selection. This object will be passed to the methods in BookmarksCommand. 2) the selection will contain information whether the selected item is immutable or not. The immutability will be computed once in one place. It will also contain the item parent URI so that the bookmarks will be uniquely identified. A method |checkTargetFolder| will check if the selection can be dropped (paste, moved...) in a folder. CM menu, buttons and commands will use this information to allow or forbid the actions. 3) services, bookmark datasource will be defined in one place at the top of bookmarksOverlay.js. A better place would obviously be a proper file services.js but due to redefinition conflicts, I prefer to postpone this issue. The patch: It implements only one command in the way I described previously: File bookmarks renamed as Move Bookmarks (bug 159762) Note: The File Bookmarks command in the Bookmark menu in the PT or menubar is unrelated to this one and is therefore not touched. Only the bookmark manager and the CM are affected by the name changing. Since the patch is just a first step, BookmarksCommand is still assigned to BookmarksUIElement.prototype. In addition, CM does not use yet the facilities provided by the selection to disable its menuitems.
Assignee | ||
Comment 1•22 years ago
|
||
note: this patch does not break the mozilla bookmark handling, even if it only deals with |Move Bookmarks| Comments are welcome!!!
Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•22 years ago
|
||
Patch addressing timeless review
Attachment #93212 -
Attachment is obsolete: true
Assignee | ||
Updated•22 years ago
|
Target Milestone: --- → mozilla1.2alpha
Assignee | ||
Comment 3•22 years ago
|
||
Well, here is the last version of my patch. I'll give some precision tomorrow
Attachment #93341 -
Attachment is obsolete: true
Assignee | ||
Comment 4•22 years ago
|
||
So far, this patch needs still a bit of work, but I would like to gather some feedback before polishing it. Basically what it does it: - gets rid of the duplicated RDF projections (tree and DOM) and do the work with RDF, only. To do so, I implemented two methods getTreeSelection and getBTSelection (BT stands for bookmark toolbar) that set up an object 'selection' that does not include tree or DOM representation but instead, include the selected item and parent RDF node. That way, I could remove 1200 lines in bookmarks.xml and completely drop the file personalToolbar.js (500 lines). All the actions are now in BookmarksOverlay.js - this selection object includes pertinent information, that will prevent silly actions, that can be easily tweaked. - actions are performed in only two methods: insertSelection and removeSelection - implements the editor transaction manager for undoing/redoing bookmark actions. So far, drag, delete, new folder|bookmark|separator, move actions are handled. Still need to do the import.
Assignee | ||
Comment 5•22 years ago
|
||
also I xblyfied the personal toolbar. Bookmark can now have two light representations: - tree (bookmarks.xml that should be renamed into bookmarksTree.xml) - toolbar (bookmarksToolbar.xml) There is still the menu to be done, though The motivation is clearly for easier use of the bookmark module by clients The patch removes also the unused files: - bookmarksTree.js - bookmarksDD.js Note: - I know that the interdependencies between bookmarksToolbar.xml and navigatorDD.js still suck but should be adressed when the drop into folder feature will be widgetized. - and I am also aware that I did not include the new file bookmarksToolbar.xml in the proper manner (jar.mn and proper cvs)
Comment 6•22 years ago
|
||
Dude, you rock.
Assignee | ||
Comment 7•22 years ago
|
||
moving to m1.3a, unfortunately, I will have no time to update this patch and because I can not guarantee to be on the hook to fix the eventual regressions. This patch will be checked in phoenix, though, quite soon.
Target Milestone: mozilla1.2alpha → mozilla1.3alpha
Comment 8•22 years ago
|
||
That's the right way to go, dont give up! I'll closely watch improvement on bookmark handling hopefully landing in 1.3a Regards,
Comment 9•22 years ago
|
||
What is happening with this bug?
Assignee | ||
Comment 10•22 years ago
|
||
Sorry, there are still some issues that I have to hammer first. Currently, I have no time to work on it. ->1.5 (maybe 1.4 hopefully)
Target Milestone: mozilla1.3alpha → mozilla1.5alpha
Assignee | ||
Comment 11•22 years ago
|
||
let's be optimistic -> 1.4a
Target Milestone: mozilla1.5alpha → mozilla1.4alpha
Updated•22 years ago
|
Flags: blocking1.4a?
Assignee | ||
Comment 13•21 years ago
|
||
landed in the bookmark branch. should be ready for 1.4b early
Target Milestone: mozilla1.4alpha → mozilla1.4beta
Updated•21 years ago
|
Priority: -- → P2
Target Milestone: mozilla1.4beta → mozilla1.4alpha
Comment 14•21 years ago
|
||
The bookmarks branch has landed. Fixed.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 15•21 years ago
|
||
This also fixed _at_least_ bug 53422, bug 81895, bug 90567, bug 92317, bug 122199, bug 138523, bug 159762, bug 160019 and bug 165150. Can a bookmark branch person please resolve them?
Updated•21 years ago
|
Flags: blocking1.4a?
Comment 16•21 years ago
|
||
Was this patch supposed to fix a problem pointed out in comment #20 of bug #90567? Steps to reproduce: 1) open Bookmarks|Manage Bookmarks 2) select and highlight a bookmark contained in a folder 3) click on "File Bookmarks" button 4) select the SAME folder for the target location and click "OK" Result: bookmark not displayed in expanded folder view until it is collapsed and reopened. Expected Result: the bookmark should be displayed without extra effort.
Comment 17•21 years ago
|
||
Becki, it works for me with a recent nightly.
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•