OSDN Git Service

import source-tree based svn r84. master
author松島 浩道 <hirom@white.local>
Fri, 12 Jun 2009 06:14:06 +0000 (15:14 +0900)
committer松島 浩道 <hirom@white.local>
Fri, 12 Jun 2009 06:14:06 +0000 (15:14 +0900)
564 files changed:
Makefile.in [new file with mode: 0644]
app/Makefile.in [new file with mode: 0644]
app/application.ini [new file with mode: 0644]
app/bluegriffon.exe.manifest [new file with mode: 0644]
app/bluegriffon.ico [new file with mode: 0644]
app/default16.png [new file with mode: 0644]
app/icons/bluegriffon.ico [new file with mode: 0644]
app/icons/bluegriffon.png [new file with mode: 0644]
app/icons/bluegriffon128.png [new file with mode: 0644]
app/icons/bluegriffon16.png [new file with mode: 0644]
app/icons/bluegriffon16.xpm [new file with mode: 0644]
app/icons/bluegriffon32.png [new file with mode: 0644]
app/icons/bluegriffon48.png [new file with mode: 0644]
app/icons/bluegriffon50.png [new file with mode: 0644]
app/icons/bluegriffon50.xpm [new file with mode: 0644]
app/icons/default16.png [new file with mode: 0644]
app/icons/default50.png [new file with mode: 0644]
app/macbuild/Contents/Info.plist.in [new file with mode: 0644]
app/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in [new file with mode: 0644]
app/macbuild/Contents/Resources/bluegriffon.icns [new file with mode: 0755]
app/mozilla.in [new file with mode: 0644]
app/nsEditorApp.cpp [new file with mode: 0644]
app/profile/bluegriffon-prefs.js [new file with mode: 0644]
app/splash.rc [new file with mode: 0644]
base/Makefile.in [new file with mode: 0644]
base/content/bluegriffon/DI.png [new file with mode: 0644]
base/content/bluegriffon/EditorContent.css [new file with mode: 0644]
base/content/bluegriffon/EditorOverride.css [new file with mode: 0644]
base/content/bluegriffon/Thumbs.db [new file with mode: 0644]
base/content/bluegriffon/about-logo.png [new file with mode: 0644]
base/content/bluegriffon/aboutDialog.css [new file with mode: 0644]
base/content/bluegriffon/bindings/cssToggler.xml [new file with mode: 0644]
base/content/bluegriffon/bindings/ecolorpicker.xml [new file with mode: 0644]
base/content/bluegriffon/bindings/filepickerbutton.css [new file with mode: 0644]
base/content/bluegriffon/bindings/filepickerbutton.xml [new file with mode: 0644]
base/content/bluegriffon/bindings/multistate.css [new file with mode: 0644]
base/content/bluegriffon/bindings/multistate.xml [new file with mode: 0644]
base/content/bluegriffon/bindings/rulers.xml [new file with mode: 0644]
base/content/bluegriffon/bindings/sidebar.css [new file with mode: 0644]
base/content/bluegriffon/bindings/sidebar.xml [new file with mode: 0644]
base/content/bluegriffon/bindings/structurebar.css [new file with mode: 0644]
base/content/bluegriffon/bindings/structurebar.xml [new file with mode: 0644]
base/content/bluegriffon/bindings/tabeditor.xml [new file with mode: 0644]
base/content/bluegriffon/blanks/strict.html [new file with mode: 0644]
base/content/bluegriffon/blanks/strict.xhtml [new file with mode: 0644]
base/content/bluegriffon/blanks/transitional.html [new file with mode: 0644]
base/content/bluegriffon/blanks/transitional.xhtml [new file with mode: 0644]
base/content/bluegriffon/brightness.png [new file with mode: 0644]
base/content/bluegriffon/colourPickerArrow.gif [new file with mode: 0644]
base/content/bluegriffon/colourPickerCrosshair.gif [new file with mode: 0644]
base/content/bluegriffon/credits.xhtml [new file with mode: 0644]
base/content/bluegriffon/dialogs/insertTable.js [new file with mode: 0644]
base/content/bluegriffon/dialogs/insertTable.xul [new file with mode: 0644]
base/content/bluegriffon/dialogs/languages.js [new file with mode: 0644]
base/content/bluegriffon/dialogs/languages.xul [new file with mode: 0644]
base/content/bluegriffon/dialogs/markupCleaner.js [new file with mode: 0644]
base/content/bluegriffon/dialogs/markupCleaner.xul [new file with mode: 0644]
base/content/bluegriffon/dialogs/newPageWizard.js [new file with mode: 0644]
base/content/bluegriffon/dialogs/newPageWizard.xul [new file with mode: 0644]
base/content/bluegriffon/dialogs/openLocation.js [new file with mode: 0644]
base/content/bluegriffon/dialogs/openLocation.xul [new file with mode: 0644]
base/content/bluegriffon/dialogs/pageProperties.js [new file with mode: 0644]
base/content/bluegriffon/dialogs/pageProperties.xul [new file with mode: 0644]
base/content/bluegriffon/dialogs/standaloneSidebar.js [new file with mode: 0644]
base/content/bluegriffon/dialogs/standaloneSidebar.xul [new file with mode: 0644]
base/content/bluegriffon/hsPanel.png [new file with mode: 0644]
base/content/bluegriffon/js/aboutDialog.js [new file with mode: 0644]
base/content/bluegriffon/js/activeSourceView.js [new file with mode: 0644]
base/content/bluegriffon/js/bluegriffon.js [new file with mode: 0644]
base/content/bluegriffon/js/col.js [new file with mode: 0644]
base/content/bluegriffon/js/colourPicker.js [new file with mode: 0644]
base/content/bluegriffon/js/colourPickerHelper.js [new file with mode: 0644]
base/content/bluegriffon/js/commands.js [new file with mode: 0644]
base/content/bluegriffon/js/customize.js [new file with mode: 0644]
base/content/bluegriffon/js/customizeToolbarSheet.js [new file with mode: 0644]
base/content/bluegriffon/js/dummyCommands.inc [new file with mode: 0644]
base/content/bluegriffon/js/fileCommands.inc [new file with mode: 0644]
base/content/bluegriffon/js/formatCommands.inc [new file with mode: 0644]
base/content/bluegriffon/js/insertionCommands.inc [new file with mode: 0644]
base/content/bluegriffon/js/languages.js [new file with mode: 0644]
base/content/bluegriffon/js/markupCleaner.js [new file with mode: 0644]
base/content/bluegriffon/js/navigationCommands.inc [new file with mode: 0644]
base/content/bluegriffon/js/observers.inc [new file with mode: 0644]
base/content/bluegriffon/js/propertiesDeck.js [new file with mode: 0644]
base/content/bluegriffon/js/recentPages.js [new file with mode: 0644]
base/content/bluegriffon/js/shutdown.inc [new file with mode: 0644]
base/content/bluegriffon/js/startup.inc [new file with mode: 0644]
base/content/bluegriffon/js/toolbars.js [new file with mode: 0644]
base/content/bluegriffon/js/viewCommands.inc [new file with mode: 0644]
base/content/bluegriffon/js/zoomManager.js [new file with mode: 0644]
base/content/bluegriffon/sourceViewTemplate.html [new file with mode: 0644]
base/content/bluegriffon/utils/colors.js [new file with mode: 0644]
base/content/bluegriffon/utils/css.js [new file with mode: 0644]
base/content/bluegriffon/utils/dgid.js [new file with mode: 0644]
base/content/bluegriffon/utils/editorUtils.js [new file with mode: 0644]
base/content/bluegriffon/utils/fileUtils.js [new file with mode: 0644]
base/content/bluegriffon/utils/global.js [new file with mode: 0644]
base/content/bluegriffon/utils/l10n.js [new file with mode: 0644]
base/content/bluegriffon/utils/login.js [new file with mode: 0644]
base/content/bluegriffon/utils/notifiers.js [new file with mode: 0644]
base/content/bluegriffon/utils/prompter.js [new file with mode: 0644]
base/content/bluegriffon/utils/urls.js [new file with mode: 0644]
base/content/bluegriffon/xul/aboutDialog.xul [new file with mode: 0644]
base/content/bluegriffon/xul/bluegriffon.xul [new file with mode: 0644]
base/content/bluegriffon/xul/colourPicker.xul [new file with mode: 0644]
base/content/bluegriffon/xul/customizeToolbarSheet.xul [new file with mode: 0644]
base/content/bluegriffon/xul/formatbarpalette.inc [new file with mode: 0644]
base/content/bluegriffon/xul/maintoolbarpalette.inc [new file with mode: 0644]
base/content/bluegriffon/xul/menubar.inc [new file with mode: 0644]
base/content/bluegriffon/xul/overlays.inc [new file with mode: 0644]
base/content/bluegriffon/xul/propertiesDeck.xul [new file with mode: 0644]
base/content/bluegriffon/xul/scripts.inc [new file with mode: 0644]
base/content/bluegriffon/xul/sets.inc [new file with mode: 0644]
base/jar.mn [new file with mode: 0644]
base/locale/en-US/bluegriffon/aboutDialog.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/bluegriffon.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/bluegriffon.properties [new file with mode: 0644]
base/locale/en-US/bluegriffon/colourPicker.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/credits.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/cssToggler.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/filePicking.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/filepickerbutton.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/insertTable.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/language.properties [new file with mode: 0644]
base/locale/en-US/bluegriffon/languages.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/markupCleaner.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/masterPasswordQuery.properties [new file with mode: 0644]
base/locale/en-US/bluegriffon/newPageWizard.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/newPageWizard.properties [new file with mode: 0644]
base/locale/en-US/bluegriffon/openLocation.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/openLocation.properties [new file with mode: 0644]
base/locale/en-US/bluegriffon/pageProperties.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/pagePropertiesPreview.html [new file with mode: 0644]
base/locale/en-US/bluegriffon/propertiesDeck.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/sidebar.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/standaloneSidebar.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/structurebar.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/tabeditor.dtd [new file with mode: 0644]
base/locale/en-US/bluegriffon/tabeditor.properties [new file with mode: 0644]
base/locale/en-US/branding/brand.dtd [new file with mode: 0644]
base/locale/en-US/branding/brand.properties [new file with mode: 0644]
build.mk [new file with mode: 0644]
config/mozconfig.linux [new file with mode: 0644]
config/mozconfig.macosx [new file with mode: 0644]
config/mozconfig.win [new file with mode: 0644]
config/netwerkProtocolFtp.patch [new file with mode: 0644]
config/version.txt [new file with mode: 0644]
confvars.sh [new file with mode: 0644]
doc/BUILD.txt [new file with mode: 0644]
doc/bg.png [new file with mode: 0644]
doc/colorPicker.html [new file with mode: 0644]
doc/colorPicker.png [new file with mode: 0644]
doc/doc.css [new file with mode: 0644]
doc/index.html [new file with mode: 0644]
doc/notifiers.html [new file with mode: 0644]
doc/sidebarcontent.html [new file with mode: 0644]
extensions/Makefile.in [new file with mode: 0644]
extensions/diavolo/Makefile.in [new file with mode: 0644]
extensions/diavolo/content/EditorOverride.css [new file with mode: 0644]
extensions/diavolo/content/codecompletion.js [new file with mode: 0644]
extensions/diavolo/content/completionPopup.xml [new file with mode: 0644]
extensions/diavolo/content/css.css [new file with mode: 0644]
extensions/diavolo/content/css.xml [new file with mode: 0644]
extensions/diavolo/content/cssCompletion.xml [new file with mode: 0644]
extensions/diavolo/content/editor.js [new file with mode: 0644]
extensions/diavolo/content/grammar.js [new file with mode: 0644]
extensions/diavolo/content/highlighter.js [new file with mode: 0644]
extensions/diavolo/content/linenumbering.css [new file with mode: 0644]
extensions/diavolo/content/linenumbering.xml [new file with mode: 0644]
extensions/diavolo/content/selector.js [new file with mode: 0644]
extensions/diavolo/content/sourceeditor.xml [new file with mode: 0644]
extensions/diavolo/content/tokeniser.js [new file with mode: 0644]
extensions/diavolo/jar.mn [new file with mode: 0644]
extensions/jQuery/MIT-LICENSE.txt [new file with mode: 0644]
extensions/jQuery/Makefile.in [new file with mode: 0644]
extensions/jQuery/content/jquery.min.js [new file with mode: 0644]
extensions/jQuery/install.rdf [new file with mode: 0644]
extensions/jQuery/jar.mn [new file with mode: 0644]
installer/Makefile.in [new file with mode: 0644]
makefiles.sh [new file with mode: 0644]
modules/Makefile.in [new file with mode: 0644]
modules/colourPickerHelper.jsm [new file with mode: 0644]
readme.html [new file with mode: 0644]
sidebars/Makefile.in [new file with mode: 0644]
sidebars/projectManager/Makefile.in [new file with mode: 0644]
sidebars/projectManager/content/bluegriffonOverlay.js [new file with mode: 0644]
sidebars/projectManager/content/bluegriffonOverlay.xul [new file with mode: 0644]
sidebars/projectManager/content/ftpDirParser.js [new file with mode: 0644]
sidebars/projectManager/content/ftpProgressListener.js [new file with mode: 0644]
sidebars/projectManager/content/localDirParser.js [new file with mode: 0755]
sidebars/projectManager/content/projectManager.js [new file with mode: 0644]
sidebars/projectManager/content/projectManager.xul [new file with mode: 0644]
sidebars/projectManager/content/projectProperties.js [new file with mode: 0644]
sidebars/projectManager/content/projectProperties.xul [new file with mode: 0644]
sidebars/projectManager/content/url-loader.js [new file with mode: 0755]
sidebars/projectManager/jar.mn [new file with mode: 0644]
sidebars/projectManager/locale/en-US/bluegriffonOverlay.dtd [new file with mode: 0644]
sidebars/projectManager/locale/en-US/projectManager.dtd [new file with mode: 0644]
sidebars/projectManager/locale/en-US/projectManager.properties [new file with mode: 0644]
sidebars/projectManager/locale/en-US/projectProperties.dtd [new file with mode: 0644]
sidebars/projectManager/skin/config-disabled.png [new file with mode: 0644]
sidebars/projectManager/skin/config.png [new file with mode: 0644]
sidebars/projectManager/skin/minus-disabled.png [new file with mode: 0644]
sidebars/projectManager/skin/minus.png [new file with mode: 0644]
sidebars/projectManager/skin/plus.png [new file with mode: 0644]
sidebars/projectManager/skin/projectManager.css [new file with mode: 0644]
sidebars/projectManager/skin/projectProperties.css [new file with mode: 0644]
src/Makefile.in [new file with mode: 0644]
src/diIAttrChangedTxn.idl [new file with mode: 0644]
src/diIAttrNameChangedTxn.idl [new file with mode: 0644]
src/diITextNodeChangedTxn.idl [new file with mode: 0644]
themes/Makefile.in [new file with mode: 0644]
themes/mac/Makefile.in [new file with mode: 0644]
themes/mac/classic/backgroundImage.png [new file with mode: 0755]
themes/mac/classic/backgroundPosition.png [new file with mode: 0755]
themes/mac/classic/bluegriffon.css [new file with mode: 0644]
themes/mac/classic/bluegriffon.ico [new file with mode: 0644]
themes/mac/classic/bluegriffonDialogs.css [new file with mode: 0644]
themes/mac/classic/colourPicker.css [new file with mode: 0644]
themes/mac/classic/config-disabled.png [new file with mode: 0644]
themes/mac/classic/config.png [new file with mode: 0644]
themes/mac/classic/cssToggler.css [new file with mode: 0644]
themes/mac/classic/ecolorpicker.css [new file with mode: 0644]
themes/mac/classic/formatToolbar.css [new file with mode: 0644]
themes/mac/classic/formatToolbar/Thumbs.db [new file with mode: 0644]
themes/mac/classic/formatToolbar/align-center-disabled.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/align-center.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/align-justify-disabled.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/align-justify.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/align-left-disabled.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/align-left.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/align-right-disabled.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/align-right.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/bold-disabled.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/bold.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/code-disabled.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/code.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/dd-disabled.gif [new file with mode: 0644]
themes/mac/classic/formatToolbar/dd-disabled.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/dd.gif [new file with mode: 0644]
themes/mac/classic/formatToolbar/dd.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/dt-disabled.gif [new file with mode: 0644]
themes/mac/classic/formatToolbar/dt-disabled.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/dt.gif [new file with mode: 0644]
themes/mac/classic/formatToolbar/dt.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/em-disabled.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/em.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/indent-disabled.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/indent.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/italic-disabled.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/italic.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/ol-disabled.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/ol.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/outdent-disabled.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/outdent.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/strong-disabled.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/strong.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/ul-disabled.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/ul.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/underline-disabled.png [new file with mode: 0644]
themes/mac/classic/formatToolbar/underline.png [new file with mode: 0644]
themes/mac/classic/icons/Thumbs.db [new file with mode: 0644]
themes/mac/classic/icons/bold-disabled.png [new file with mode: 0644]
themes/mac/classic/icons/bold-hover.png [new file with mode: 0644]
themes/mac/classic/icons/bold.png [new file with mode: 0644]
themes/mac/classic/icons/btn3.png [new file with mode: 0644]
themes/mac/classic/icons/close-button.png [new file with mode: 0644]
themes/mac/classic/icons/filePicking-hover.png [new file with mode: 0644]
themes/mac/classic/icons/filePicking.png [new file with mode: 0644]
themes/mac/classic/icons/information-disabled.png [new file with mode: 0644]
themes/mac/classic/icons/information-hover.png [new file with mode: 0644]
themes/mac/classic/icons/information.png [new file with mode: 0644]
themes/mac/classic/icons/loading.gif [new file with mode: 0644]
themes/mac/classic/icons/modified.gif [new file with mode: 0644]
themes/mac/classic/icons/new.png [new file with mode: 0644]
themes/mac/classic/icons/newstop.png [new file with mode: 0644]
themes/mac/classic/icons/open.png [new file with mode: 0644]
themes/mac/classic/icons/stop.png [new file with mode: 0644]
themes/mac/classic/icons/twistyClosed.png [new file with mode: 0644]
themes/mac/classic/icons/twistyOpen.png [new file with mode: 0644]
themes/mac/classic/insertTable.css [new file with mode: 0644]
themes/mac/classic/languages.css [new file with mode: 0644]
themes/mac/classic/layouts/full1.png [new file with mode: 0755]
themes/mac/classic/layouts/full10.png [new file with mode: 0755]
themes/mac/classic/layouts/full11.png [new file with mode: 0755]
themes/mac/classic/layouts/full12.png [new file with mode: 0755]
themes/mac/classic/layouts/full13.png [new file with mode: 0755]
themes/mac/classic/layouts/full14.png [new file with mode: 0755]
themes/mac/classic/layouts/full15.png [new file with mode: 0755]
themes/mac/classic/layouts/full16.png [new file with mode: 0755]
themes/mac/classic/layouts/full17.png [new file with mode: 0755]
themes/mac/classic/layouts/full18.png [new file with mode: 0755]
themes/mac/classic/layouts/full19.png [new file with mode: 0755]
themes/mac/classic/layouts/full2.png [new file with mode: 0755]
themes/mac/classic/layouts/full20.png [new file with mode: 0755]
themes/mac/classic/layouts/full21.png [new file with mode: 0755]
themes/mac/classic/layouts/full22.png [new file with mode: 0644]
themes/mac/classic/layouts/full23.png [new file with mode: 0644]
themes/mac/classic/layouts/full24.png [new file with mode: 0644]
themes/mac/classic/layouts/full25.png [new file with mode: 0644]
themes/mac/classic/layouts/full26.png [new file with mode: 0644]
themes/mac/classic/layouts/full27.png [new file with mode: 0644]
themes/mac/classic/layouts/full28.png [new file with mode: 0644]
themes/mac/classic/layouts/full29.png [new file with mode: 0644]
themes/mac/classic/layouts/full3.png [new file with mode: 0755]
themes/mac/classic/layouts/full30.png [new file with mode: 0644]
themes/mac/classic/layouts/full31.png [new file with mode: 0644]
themes/mac/classic/layouts/full32.png [new file with mode: 0644]
themes/mac/classic/layouts/full33.png [new file with mode: 0644]
themes/mac/classic/layouts/full34.png [new file with mode: 0644]
themes/mac/classic/layouts/full35.png [new file with mode: 0644]
themes/mac/classic/layouts/full36.png [new file with mode: 0644]
themes/mac/classic/layouts/full37.png [new file with mode: 0644]
themes/mac/classic/layouts/full38.png [new file with mode: 0644]
themes/mac/classic/layouts/full39.png [new file with mode: 0644]
themes/mac/classic/layouts/full4.png [new file with mode: 0755]
themes/mac/classic/layouts/full40.png [new file with mode: 0644]
themes/mac/classic/layouts/full41.png [new file with mode: 0644]
themes/mac/classic/layouts/full42.png [new file with mode: 0644]
themes/mac/classic/layouts/full5.png [new file with mode: 0755]
themes/mac/classic/layouts/full6.png [new file with mode: 0755]
themes/mac/classic/layouts/full7.png [new file with mode: 0755]
themes/mac/classic/layouts/full8.png [new file with mode: 0755]
themes/mac/classic/layouts/full9.png [new file with mode: 0755]
themes/mac/classic/layouts/layouts.mn [new file with mode: 0644]
themes/mac/classic/listboxBg.css [new file with mode: 0644]
themes/mac/classic/listboxBg.png [new file with mode: 0644]
themes/mac/classic/listboxBgActive.png [new file with mode: 0644]
themes/mac/classic/mainToolbar.css [new file with mode: 0644]
themes/mac/classic/mainToolbar/anchor.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/browser.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/copy.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/cut.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/find.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/form.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/hline.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/image.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/link.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/logo-hover.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/logo.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/new.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/open.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/paste.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/preview.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/print.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/publish.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/save.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/anchor.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/browser.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/copy.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/cut.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/find.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/form.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/hline.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/image.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/link.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/logo-hover.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/logo.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/new.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/open.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/paste.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/preview.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/print.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/publish.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/save.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/spell.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/stop.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/small/table.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/spell.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/stop.png [new file with mode: 0644]
themes/mac/classic/mainToolbar/table.png [new file with mode: 0644]
themes/mac/classic/minus-disabled.png [new file with mode: 0644]
themes/mac/classic/minus.png [new file with mode: 0644]
themes/mac/classic/newPageWizard.css [new file with mode: 0644]
themes/mac/classic/pageProperties.css [new file with mode: 0644]
themes/mac/classic/plus-disabled.png [new file with mode: 0644]
themes/mac/classic/plus.png [new file with mode: 0644]
themes/mac/classic/refresh.png [new file with mode: 0644]
themes/mac/classic/rulers.css [new file with mode: 0644]
themes/mac/classic/sidebar.css [new file with mode: 0644]
themes/mac/classic/sidebarcontent.css [new file with mode: 0644]
themes/mac/classic/standaloneSidebar.css [new file with mode: 0644]
themes/mac/classic/structurebar.css [new file with mode: 0644]
themes/mac/classic/tab-bkgnd.png [new file with mode: 0644]
themes/mac/classic/tabeditor-tabs-bkgnd.png [new file with mode: 0644]
themes/mac/classic/tabeditor.css [new file with mode: 0644]
themes/mac/jar.mn [new file with mode: 0644]
themes/win/Makefile.in [new file with mode: 0644]
themes/win/classic/backgroundImage.png [new file with mode: 0755]
themes/win/classic/backgroundPosition.png [new file with mode: 0755]
themes/win/classic/bluegriffon.css [new file with mode: 0644]
themes/win/classic/bluegriffon.ico [new file with mode: 0644]
themes/win/classic/bluegriffonDialogs.css [new file with mode: 0644]
themes/win/classic/colourPicker.css [new file with mode: 0644]
themes/win/classic/config-disabled.png [new file with mode: 0644]
themes/win/classic/config.png [new file with mode: 0644]
themes/win/classic/cssToggler.css [new file with mode: 0644]
themes/win/classic/ecolorpicker.css [new file with mode: 0644]
themes/win/classic/formatToolbar.css [new file with mode: 0644]
themes/win/classic/formatToolbar/Thumbs.db [new file with mode: 0644]
themes/win/classic/formatToolbar/align-center-disabled.png [new file with mode: 0644]
themes/win/classic/formatToolbar/align-center.png [new file with mode: 0644]
themes/win/classic/formatToolbar/align-justify-disabled.png [new file with mode: 0644]
themes/win/classic/formatToolbar/align-justify.png [new file with mode: 0644]
themes/win/classic/formatToolbar/align-left-disabled.png [new file with mode: 0644]
themes/win/classic/formatToolbar/align-left.png [new file with mode: 0644]
themes/win/classic/formatToolbar/align-right-disabled.png [new file with mode: 0644]
themes/win/classic/formatToolbar/align-right.png [new file with mode: 0644]
themes/win/classic/formatToolbar/bold-disabled.png [new file with mode: 0644]
themes/win/classic/formatToolbar/bold.png [new file with mode: 0644]
themes/win/classic/formatToolbar/code-disabled.png [new file with mode: 0644]
themes/win/classic/formatToolbar/code.png [new file with mode: 0644]
themes/win/classic/formatToolbar/dd-disabled.gif [new file with mode: 0644]
themes/win/classic/formatToolbar/dd-disabled.png [new file with mode: 0644]
themes/win/classic/formatToolbar/dd.gif [new file with mode: 0644]
themes/win/classic/formatToolbar/dd.png [new file with mode: 0644]
themes/win/classic/formatToolbar/dt-disabled.gif [new file with mode: 0644]
themes/win/classic/formatToolbar/dt-disabled.png [new file with mode: 0644]
themes/win/classic/formatToolbar/dt.gif [new file with mode: 0644]
themes/win/classic/formatToolbar/dt.png [new file with mode: 0644]
themes/win/classic/formatToolbar/em-disabled.png [new file with mode: 0644]
themes/win/classic/formatToolbar/em.png [new file with mode: 0644]
themes/win/classic/formatToolbar/indent-disabled.png [new file with mode: 0644]
themes/win/classic/formatToolbar/indent.png [new file with mode: 0644]
themes/win/classic/formatToolbar/italic-disabled.png [new file with mode: 0644]
themes/win/classic/formatToolbar/italic.png [new file with mode: 0644]
themes/win/classic/formatToolbar/ol-disabled.png [new file with mode: 0644]
themes/win/classic/formatToolbar/ol.png [new file with mode: 0644]
themes/win/classic/formatToolbar/outdent-disabled.png [new file with mode: 0644]
themes/win/classic/formatToolbar/outdent.png [new file with mode: 0644]
themes/win/classic/formatToolbar/strong-disabled.png [new file with mode: 0644]
themes/win/classic/formatToolbar/strong.png [new file with mode: 0644]
themes/win/classic/formatToolbar/ul-disabled.png [new file with mode: 0644]
themes/win/classic/formatToolbar/ul.png [new file with mode: 0644]
themes/win/classic/formatToolbar/underline-disabled.png [new file with mode: 0644]
themes/win/classic/formatToolbar/underline.png [new file with mode: 0644]
themes/win/classic/icons/Thumbs.db [new file with mode: 0644]
themes/win/classic/icons/bold-disabled.png [new file with mode: 0644]
themes/win/classic/icons/bold-hover.png [new file with mode: 0644]
themes/win/classic/icons/bold.png [new file with mode: 0644]
themes/win/classic/icons/btn3.png [new file with mode: 0644]
themes/win/classic/icons/close-button.png [new file with mode: 0644]
themes/win/classic/icons/filePicking-hover.png [new file with mode: 0644]
themes/win/classic/icons/filePicking.png [new file with mode: 0644]
themes/win/classic/icons/information-disabled.png [new file with mode: 0644]
themes/win/classic/icons/information-hover.png [new file with mode: 0644]
themes/win/classic/icons/information.png [new file with mode: 0644]
themes/win/classic/icons/loading.gif [new file with mode: 0644]
themes/win/classic/icons/modified.gif [new file with mode: 0644]
themes/win/classic/icons/new.png [new file with mode: 0644]
themes/win/classic/icons/newstop.png [new file with mode: 0644]
themes/win/classic/icons/open.png [new file with mode: 0644]
themes/win/classic/icons/stop.png [new file with mode: 0644]
themes/win/classic/icons/twistyClosed.png [new file with mode: 0644]
themes/win/classic/icons/twistyOpen.png [new file with mode: 0644]
themes/win/classic/insertTable.css [new file with mode: 0644]
themes/win/classic/languages.css [new file with mode: 0644]
themes/win/classic/layouts/full1.png [new file with mode: 0755]
themes/win/classic/layouts/full10.png [new file with mode: 0755]
themes/win/classic/layouts/full11.png [new file with mode: 0755]
themes/win/classic/layouts/full12.png [new file with mode: 0755]
themes/win/classic/layouts/full13.png [new file with mode: 0755]
themes/win/classic/layouts/full14.png [new file with mode: 0755]
themes/win/classic/layouts/full15.png [new file with mode: 0755]
themes/win/classic/layouts/full16.png [new file with mode: 0755]
themes/win/classic/layouts/full17.png [new file with mode: 0755]
themes/win/classic/layouts/full18.png [new file with mode: 0755]
themes/win/classic/layouts/full19.png [new file with mode: 0755]
themes/win/classic/layouts/full2.png [new file with mode: 0755]
themes/win/classic/layouts/full20.png [new file with mode: 0755]
themes/win/classic/layouts/full21.png [new file with mode: 0755]
themes/win/classic/layouts/full22.png [new file with mode: 0644]
themes/win/classic/layouts/full23.png [new file with mode: 0644]
themes/win/classic/layouts/full24.png [new file with mode: 0644]
themes/win/classic/layouts/full25.png [new file with mode: 0644]
themes/win/classic/layouts/full26.png [new file with mode: 0644]
themes/win/classic/layouts/full27.png [new file with mode: 0644]
themes/win/classic/layouts/full28.png [new file with mode: 0644]
themes/win/classic/layouts/full29.png [new file with mode: 0644]
themes/win/classic/layouts/full3.png [new file with mode: 0755]
themes/win/classic/layouts/full30.png [new file with mode: 0644]
themes/win/classic/layouts/full31.png [new file with mode: 0644]
themes/win/classic/layouts/full32.png [new file with mode: 0644]
themes/win/classic/layouts/full33.png [new file with mode: 0644]
themes/win/classic/layouts/full34.png [new file with mode: 0644]
themes/win/classic/layouts/full35.png [new file with mode: 0644]
themes/win/classic/layouts/full36.png [new file with mode: 0644]
themes/win/classic/layouts/full37.png [new file with mode: 0644]
themes/win/classic/layouts/full38.png [new file with mode: 0644]
themes/win/classic/layouts/full39.png [new file with mode: 0644]
themes/win/classic/layouts/full4.png [new file with mode: 0755]
themes/win/classic/layouts/full40.png [new file with mode: 0644]
themes/win/classic/layouts/full41.png [new file with mode: 0644]
themes/win/classic/layouts/full42.png [new file with mode: 0644]
themes/win/classic/layouts/full5.png [new file with mode: 0755]
themes/win/classic/layouts/full6.png [new file with mode: 0755]
themes/win/classic/layouts/full7.png [new file with mode: 0755]
themes/win/classic/layouts/full8.png [new file with mode: 0755]
themes/win/classic/layouts/full9.png [new file with mode: 0755]
themes/win/classic/layouts/layouts.mn [new file with mode: 0644]
themes/win/classic/listboxBg.css [new file with mode: 0644]
themes/win/classic/listboxBg.png [new file with mode: 0644]
themes/win/classic/listboxBgActive.png [new file with mode: 0644]
themes/win/classic/mainToolbar.css [new file with mode: 0644]
themes/win/classic/mainToolbar/anchor.png [new file with mode: 0644]
themes/win/classic/mainToolbar/browser.png [new file with mode: 0644]
themes/win/classic/mainToolbar/copy.png [new file with mode: 0644]
themes/win/classic/mainToolbar/cut.png [new file with mode: 0644]
themes/win/classic/mainToolbar/find.png [new file with mode: 0644]
themes/win/classic/mainToolbar/form.png [new file with mode: 0644]
themes/win/classic/mainToolbar/hline.png [new file with mode: 0644]
themes/win/classic/mainToolbar/image.png [new file with mode: 0644]
themes/win/classic/mainToolbar/link.png [new file with mode: 0644]
themes/win/classic/mainToolbar/logo-hover.png [new file with mode: 0644]
themes/win/classic/mainToolbar/logo.png [new file with mode: 0644]
themes/win/classic/mainToolbar/new.png [new file with mode: 0644]
themes/win/classic/mainToolbar/open.png [new file with mode: 0644]
themes/win/classic/mainToolbar/paste.png [new file with mode: 0644]
themes/win/classic/mainToolbar/preview.png [new file with mode: 0644]
themes/win/classic/mainToolbar/print.png [new file with mode: 0644]
themes/win/classic/mainToolbar/publish.png [new file with mode: 0644]
themes/win/classic/mainToolbar/save.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/anchor.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/browser.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/copy.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/cut.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/find.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/form.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/hline.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/image.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/link.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/logo-hover.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/logo.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/new.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/open.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/paste.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/preview.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/print.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/publish.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/save.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/spell.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/stop.png [new file with mode: 0644]
themes/win/classic/mainToolbar/small/table.png [new file with mode: 0644]
themes/win/classic/mainToolbar/spell.png [new file with mode: 0644]
themes/win/classic/mainToolbar/stop.png [new file with mode: 0644]
themes/win/classic/mainToolbar/table.png [new file with mode: 0644]
themes/win/classic/minus-disabled.png [new file with mode: 0644]
themes/win/classic/minus.png [new file with mode: 0644]
themes/win/classic/newPageWizard.css [new file with mode: 0644]
themes/win/classic/pageProperties.css [new file with mode: 0644]
themes/win/classic/plus-disabled.png [new file with mode: 0644]
themes/win/classic/plus.png [new file with mode: 0644]
themes/win/classic/rulers.css [new file with mode: 0644]
themes/win/classic/sidebar.css [new file with mode: 0644]
themes/win/classic/sidebarcontent.css [new file with mode: 0644]
themes/win/classic/standaloneSidebar.css [new file with mode: 0644]
themes/win/classic/structurebar.css [new file with mode: 0644]
themes/win/classic/tab-active-bkgnd.png [new file with mode: 0644]
themes/win/classic/tab-bkgnd.png [new file with mode: 0644]
themes/win/classic/tab-hover-bkgnd.png [new file with mode: 0644]
themes/win/classic/tabeditor-tabs-bkgnd.png [new file with mode: 0644]
themes/win/classic/tabeditor.css [new file with mode: 0644]
themes/win/classic/tabstrip-bottom.png [new file with mode: 0644]
themes/win/jar.mn [new file with mode: 0644]

diff --git a/Makefile.in b/Makefile.in
new file mode 100644 (file)
index 0000000..dceea6d
--- /dev/null
@@ -0,0 +1,49 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is BlueGriffon.
+#
+# The Initial Developer of the Original Code is
+# Disruptive Innovations SARL.
+# Portions created by the Initial Developer are Copyright (C) 2006
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK ***** */
+
+
+DEPTH          = ..
+topsrcdir      = @top_srcdir@
+srcdir         = @srcdir@
+VPATH          = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+DIRS           = src base themes sidebars extensions app
+
+
+include $(topsrcdir)/config/rules.mk
diff --git a/app/Makefile.in b/app/Makefile.in
new file mode 100644 (file)
index 0000000..a9362d2
--- /dev/null
@@ -0,0 +1,370 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is mozilla.org code.
+#
+# The Initial Developer of the Original Code is
+# Netscape Communications.
+# Portions created by the Initial Developer are Copyright (C) 2001
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#  Brian Ryner <bryner@brianryner.com>
+#  Jonathan Wilson <jonwil@tpgi.com.au>
+#  Dan Mosedale <dmose@mozilla.org>
+#  Benjamin Smedberg <benjamin@smedbergs.us>
+#  Laurent Jouanneau <laurent.jouanneau@disruptive-innovations.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH          = ../..
+topsrcdir      = @top_srcdir@
+srcdir = @srcdir@
+VPATH          = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+PREF_JS_EXPORTS = $(srcdir)/profile/bluegriffon-prefs.js \
+                 $(NULL)
+
+# hardcoded en-US for the moment
+AB_CD = en-US
+#AB_CD = $(MOZ_UI_LOCALE)
+
+APP_UA_NAME = $(shell echo $(MOZ_APP_DISPLAYNAME) | sed -e's/[^A-Za-z]//g')
+APP_BINARY = $(MOZ_APP_NAME)$(BIN_SUFFIX)
+APP_VERSION = $(shell cat $(srcdir)/../config/version.txt)
+
+DIST_FILES = application.ini
+
+GRE_MILESTONE = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
+GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
+
+
+DEFINES += \
+       -DAPP_NAME=$(MOZ_APP_DISPLAYNAME) \
+       -DAPP_VERSION=$(APP_VERSION) \
+       -DAPP_UA_NAME="$(APP_UA_NAME)" \
+       -DGRE_BUILDID=$(GRE_BUILDID) \
+       -DGRE_MILESTONE=$(GRE_MILESTONE) \
+       -DMOZ_APP_NAME=$(MOZ_APP_NAME) \
+       -DAB_CD=$(AB_CD) \
+   $(NULL)
+
+LIBS += $(JEMALLOC_LIBS)
+
+ifdef LIBXUL_SDK
+include $(topsrcdir)/config/rules.mk
+else
+
+# Build a binary bootstrapping with XRE_main
+
+ifeq ($(USE_SHORT_LIBNAME), 1)
+PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
+else
+PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
+endif
+
+REQUIRES = \
+       xpcom \
+       string \
+       xulapp \
+       $(NULL)
+
+CPPSRCS = nsEditorApp.cpp
+
+LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
+
+ifdef BUILD_STATIC_LIBS
+ifdef _MSC_VER
+STATIC_COMPONENTS_LINKER_PATH = -LIBPATH:$(DEPTH)/staticlib
+else
+STATIC_COMPONENTS_LINKER_PATH = -L$(DEPTH)/staticlib
+endif
+LIBS += $(MOZDEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
+else
+ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
+LIBS += $(DIST)/bin/XUL
+else
+EXTRA_DSO_LIBS += xul
+endif
+endif
+
+ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
+TK_LIBS :=  -framework Cocoa  $(TK_LIBS)
+endif
+
+ifdef MOZ_ENABLE_LIBXUL
+APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
+else
+MOZILLA_INTERNAL_API = 1
+APP_XPCOM_LIBS = $(XPCOM_LIBS)
+endif
+
+LIBS += \
+       $(STATIC_COMPONENTS_LINKER_PATH) \
+       $(MOZ_JS_LIBS) \
+       $(EXTRA_DSO_LIBS) \
+       $(APP_XPCOM_LIBS) \
+       $(NSPR_LIBS) \
+       $(TK_LIBS) \
+       $(NULL)
+
+# Add explicit X11 dependency when building against X11 toolkits
+ifneq (,$(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)))
+LIBS += $(XLDFLAGS) $(XLIBS) $(ZLIB_LIBS)
+endif
+
+ifdef MOZ_JPROF
+LIBS += -ljprof
+endif
+
+ifndef MOZ_WINCONSOLE
+ifdef MOZ_DEBUG
+MOZ_WINCONSOLE = 1
+else
+MOZ_WINCONSOLE = 0
+endif
+endif
+
+NSDISTMODE = copy
+
+include $(topsrcdir)/config/config.mk
+
+ifdef _MSC_VER
+# Always enter a Windows program through wmain, whether or not we're
+# a console application.
+WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
+endif
+
+ifndef BUILD_STATIC_LIBS
+
+ifdef NS_TRACE_MALLOC
+EXTRA_DSO_LIBS += tracemalloc
+endif
+
+else
+include $(topsrcdir)/config/static-config.mk
+
+EXTRA_DEPS     += \
+       $(STATIC_EXTRA_DEPS) \
+       $(NULL)
+DEFINES                += $(STATIC_DEFINES)
+CPPSRCS                += $(STATIC_CPPSRCS)
+EXTRA_DSO_LIBS += $(STATIC_EXTRA_DSO_LIBS)
+REQUIRES       += $(STATIC_REQUIRES)
+EXTRA_LIBS     += $(STATIC_EXTRA_LIBS)
+endif
+
+
+ifeq ($(OS_ARCH),WINNT)
+OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
+OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32)
+RCINCLUDE = splash.rc
+ifndef GNU_CC
+RCFLAGS += -I$(srcdir)
+else
+RCFLAGS += --include-dir $(srcdir)
+endif
+ifdef BUILD_STATIC_LIBS
+RCFLAGS += -DMOZ_STATIC_BUILD
+endif
+ifdef DEBUG
+RCFLAGS += -DDEBUG
+endif
+endif
+
+ifeq ($(OS_ARCH),BeOS)
+#BEOS_PROGRAM_RESOURCE = $(srcdir)/apprunner-beos.rsrc
+ifdef BUILD_STATIC_LIBS
+OS_LIBS += -ltracker -lgame
+endif
+endif
+
+#ifeq ($(OS_ARCH),OS2)
+#RESFILE=splashos2.res
+#ifdef BUILD_STATIC_LIBS
+#EXE_DEF_FILE = bluegriffon.def
+#RCFLAGS += -DMOZ_STATIC_BUILD -i $(DIST)/include/widget
+#endif
+#ifdef DEBUG
+#RCFLAGS += -DDEBUG
+#endif
+#RCFLAGS += -DCOMPOSER_ICO=\"$(srcdir)/icons/bluegriffon.ico\" -DDOCUMENT_ICO=\"$(srcdir)/icons/bluegriffon.ico\"
+#endif
+
+include $(topsrcdir)/config/rules.mk
+
+
+DEFINES += -DCOMPOSER_ICO=\"$(srcdir)/icons/bluegriffon.ico\" -DDOCUMENT_ICO=\"$(srcdir)/icons/bluegriffon.ico\"
+
+ifdef BUILD_STATIC_LIBS
+include $(topsrcdir)/config/static-rules.mk
+
+DEFINES += -DIMPL_XREAPI
+endif
+
+ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
+LIBS += -lphexlib
+endif
+
+ifeq ($(OS_ARCH),WINNT)
+#
+# Control the default heap size.
+# This is the heap returned by GetProcessHeap().
+# As we use the CRT heap, the default size is too large and wastes VM.
+#
+# The default heap size is 1MB on Win32.
+# The heap will grow if need be.
+#
+# Set it to 256k.  See bug 127069.
+#
+ifndef GNU_CC
+LDFLAGS += /HEAP:0x40000
+endif
+endif
+
+$(PROGRAM): $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
+
+ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
+
+$(MOZ_APP_NAME):: mozilla.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk
+       cat $< | sed -e "s|%MOZAPPDIR%|$(installdir)|" \
+               -e "s|%MREDIR%|$(mredir)|" \
+               -e "s|%MOZILLA-BIN%|$(PROGRAM)|g" \
+               -e "s|%MOZ_APP_DISPLAYNAME%|$(MOZ_APP_DISPLAYNAME)|" > $@
+       chmod +x $@
+
+libs:: $(MOZ_APP_NAME)
+       $(INSTALL) $< $(DIST)/bin
+
+install:: $(MOZ_APP_NAME)
+       $(SYSINSTALL) $< $(DESTDIR)$(bindir)
+
+GARBAGE += $(MOZ_APP_NAME)
+GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, bluegriffon-prefs.js)
+
+endif
+
+ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
+ifdef BUILD_STATIC_LIBS
+LIBS   += -lcups -framework AddressBook
+endif
+endif
+
+endif # LIBXUL_SDK
+
+
+
+ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
+ICON_FILES     = \
+               $(srcdir)/icons/bluegriffon50.xpm \
+               $(srcdir)/icons/bluegriffon50.png \
+               $(srcdir)/icons/bluegriffon16.xpm \
+               $(srcdir)/icons/bluegriffon16.png \
+               $(NULL)
+libs::
+       $(INSTALL) $(ICON_FILES) $(DIST)/bin/icons/
+
+install::
+       $(SYSINSTALL) $(IFLAGS1) $(ICON_FILES) $(DESTDIR)$(mozappdir)/icons
+endif
+
+ifneq (,$(filter windows os2,$(MOZ_WIDGET_TOOLKIT)))
+#libs:: $(DESKTOP_ICONS)
+#      $(INSTALL) $^ $(DIST)/bin/chrome/icons/default
+endif
+
+libs::
+       touch $(DIST)/bin/.autoreg
+
+
+ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
+
+APP_NAME = $(MOZ_APP_DISPLAYNAME)
+
+ifdef MOZ_DEBUG
+APP_NAME := $(APP_NAME)Debug
+endif
+
+AB := $(firstword $(subst -, ,$(AB_CD)))
+
+clean clobber repackage::
+       rm -rf $(DIST)/$(APP_NAME).app
+
+ifdef LIBXUL_SDK
+APPFILES = Resources
+else
+APPFILES = MacOS
+endif
+
+libs repackage:: $(PROGRAM) application.ini
+       mkdir -p $(DIST)/$(APP_NAME).app/Contents/MacOS
+       rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app --exclude English.lproj
+       mkdir -p $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
+       rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
+       sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(APP_NAME).app/Contents/Info.plist
+       sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj/InfoPlist.strings
+       rsync -a $(DIST)/bin/ $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)
+       $(RM) $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)/mangle $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)/shlibsign
+ifdef LIBXUL_SDK
+       cp $(LIBXUL_DIST)/bin/$(XR_STUB_NAME) $(DIST)/$(APP_NAME).app/Contents/MacOS/firefox-bin
+else
+       rm -f $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM)
+       rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS
+endif
+       mkdir -p $(DIST)/$(APP_NAME).app/Contents/Plug-Ins
+       rsync -a --copy-unsafe-links $(LIBXUL_DIST)/package/PrintPDE.plugin $(DIST)/$(APP_NAME).app/Contents/Plug-Ins
+#      -cp -L $(DIST)/bin/mangle $(DIST)/bin/shlibsign $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)
+       cp -RL $(srcdir)/macbuild/Contents/Resources/bluegriffon.icns $(DIST)/$(APP_NAME).app/Contents/Resources/bluegriffon.icns
+       echo -n APPLMOZB > $(DIST)/$(APP_NAME).app/Contents/PkgInfo
+#       remove CVS dirs from packaged app
+       find $(DIST)/$(APP_NAME).app -type d -name "CVS" -prune -exec rm -rf {} \;
+       find $(DIST)/$(APP_NAME).app -type d -name ".svn" -prune -exec rm -rf {} \;
+else
+ifdef LIBXUL_SDK
+libs::
+       cp $(LIBXUL_DIST)/bin/xulrunner-stub$(BIN_SUFFIX) $(DIST)/bin/firefox$(BIN_SUFFIX)
+endif
+endif
+
+libs::
+ifeq ($(OS_ARCH),WINNT)
+       $(PERL) -pe 's/(?<!\r)\n/\r\n/g;' < $(topsrcdir)/LICENSE > $(DIST)/bin/LICENSE
+else
+       $(INSTALL) $(topsrcdir)/LICENSE $(DIST)/bin
+endif
+
+ifdef LIBXUL_SDK
+ifndef SKIP_COPY_XULRUNNER
+libs::
+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
+       rsync -a --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(DIST)/$(APP_NAME).app/Contents/Frameworks
+else
+       $(NSINSTALL) -D $(DIST)/bin/xulrunner
+       (cd $(LIBXUL_SDK)/bin && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DIST)/bin/xulrunner && tar -xf -)
+endif # cocoa
+endif # SKIP_COPY_XULRUNNER
+endif # LIBXUL_SDK
\ No newline at end of file
diff --git a/app/application.ini b/app/application.ini
new file mode 100644 (file)
index 0000000..be25ac9
--- /dev/null
@@ -0,0 +1,58 @@
+; ***** BEGIN LICENSE BLOCK *****
+; Version: MPL 1.1/GPL 2.0/LGPL 2.1
+;
+; The contents of this file are subject to the Mozilla Public License Version
+; 1.1 (the "License"); you may not use this file except in compliance with
+; the License. You may obtain a copy of the License at
+; http://www.mozilla.org/MPL/
+;
+; Software distributed under the License is distributed on an "AS IS" basis,
+; WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+; for the specific language governing rights and limitations under the
+; License.
+;
+; The Original Code is BlueGriffon.
+;
+; The Initial Developer of the Original Code is
+; Disruptive Innovations.
+;
+; Portions created by the Initial Developer are Copyright (C) 2008
+; Disruptive Innovations SARL. All Rights Reserved.
+;
+; Contributor(s):
+;  Daniel Glazman <daniel.glazman@disruptive-innovations.com>
+;  Laurent Jouanneau <laurent.jouanneau@disruptive-innovations.com>
+;
+; Contributor(s):
+;
+; Alternatively, the contents of this file may be used under the terms of
+; either the GNU General Public License Version 2 or later (the "GPL"), or
+; the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+; in which case the provisions of the GPL or the LGPL are applicable instead
+; of those above. If you wish to allow use of your version of this file only
+; under the terms of either the GPL or the LGPL, and not to allow others to
+; use your version of this file under the terms of the MPL, indicate your
+; decision by deleting the provisions above and replace them with the notice
+; and other provisions required by the GPL or the LGPL. If you do not delete
+; the provisions above, a recipient may use your version of this file under
+; the terms of any one of the MPL, the GPL or the LGPL.
+;
+; ***** END LICENSE BLOCK *****
+#filter substitution
+[App]
+Name=@APP_NAME@
+Version=@APP_VERSION@
+ID={8fa6f1b4-7ed3-4895-bac6-01f1cc206ab3}
+BuildID=@GRE_BUILDID@
+Copyright=Copyright (c) 2006-2008 Disruptive Innovations SARL
+Vendor=Disruptive Innovations SARL
+
+[Gecko]
+MinVersion=@GRE_MILESTONE@
+MaxVersion=@GRE_MILESTONE@
+
+[Shell]
+Icon=chrome/skin/classic/bluegriffon/bluegriffon
+
+[XRE]
+EnableExtensionManager=1
diff --git a/app/bluegriffon.exe.manifest b/app/bluegriffon.exe.manifest
new file mode 100644 (file)
index 0000000..3faeece
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity
+        version="1.0.0.0"
+        processorArchitecture="*"
+        name="BlueGriffon"
+        type="win32"
+/>
+<description>BlueGriffon</description>
+<dependency>
+        <dependentAssembly>
+                <assemblyIdentity
+                        type="win32"
+                        name="Microsoft.Windows.Common-Controls"
+                        version="6.0.0.0"
+                        processorArchitecture="*"
+                        publicKeyToken="6595b64144ccf1df"
+                        language="*"
+                />
+        </dependentAssembly>
+</dependency>
+<ms_asmv3:trustInfo xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3">
+  <ms_asmv3:security>
+    <ms_asmv3:requestedPrivileges>
+      <ms_asmv3:requestedExecutionLevel level="asInvoker" uiAccess="false">
+      </ms_asmv3:requestedExecutionLevel>
+    </ms_asmv3:requestedPrivileges>
+  </ms_asmv3:security>
+</ms_asmv3:trustInfo>
+</assembly>
diff --git a/app/bluegriffon.ico b/app/bluegriffon.ico
new file mode 100644 (file)
index 0000000..93a460b
Binary files /dev/null and b/app/bluegriffon.ico differ
diff --git a/app/default16.png b/app/default16.png
new file mode 100644 (file)
index 0000000..3c5d84e
Binary files /dev/null and b/app/default16.png differ
diff --git a/app/icons/bluegriffon.ico b/app/icons/bluegriffon.ico
new file mode 100644 (file)
index 0000000..93a460b
Binary files /dev/null and b/app/icons/bluegriffon.ico differ
diff --git a/app/icons/bluegriffon.png b/app/icons/bluegriffon.png
new file mode 100644 (file)
index 0000000..f996134
Binary files /dev/null and b/app/icons/bluegriffon.png differ
diff --git a/app/icons/bluegriffon128.png b/app/icons/bluegriffon128.png
new file mode 100644 (file)
index 0000000..15f9b90
Binary files /dev/null and b/app/icons/bluegriffon128.png differ
diff --git a/app/icons/bluegriffon16.png b/app/icons/bluegriffon16.png
new file mode 100644 (file)
index 0000000..5329ff2
Binary files /dev/null and b/app/icons/bluegriffon16.png differ
diff --git a/app/icons/bluegriffon16.xpm b/app/icons/bluegriffon16.xpm
new file mode 100644 (file)
index 0000000..8b717df
--- /dev/null
@@ -0,0 +1,111 @@
+/* XPM */
+static char * bluegriffon16_xpm[] = {
+"16 16 92 2",
+"      c None",
+".     c #10004C",
+"+     c #110050",
+"@     c #120059",
+"#     c #10004A",
+"$     c #11004E",
+"%     c #110053",
+"&     c #110057",
+"*     c #12005B",
+"=     c #05001A",
+"-     c #06001D",
+";     c #060021",
+">     c #070024",
+",     c #090028",
+"'     c #0F0049",
+")     c #110051",
+"!     c #110056",
+"~     c #050019",
+"{     c #070025",
+"]     c #11004F",
+"^     c #110054",
+"/     c #03000B",
+"(     c #2A000D",
+"_     c #2F0011",
+":     c #050018",
+"<     c #0F0048",
+"[     c #110052",
+"}     c #110055",
+"|     c #000004",
+"1     c #020008",
+"2     c #04000C",
+"3     c #31000D",
+"4     c #40000F",
+"5     c #070021",
+"6     c #0E0046",
+"7     c #10004B",
+"8     c #000003",
+"9     c #030010",
+"0     c #030014",
+"a     c #0D0044",
+"b     c #10004D",
+"c     c #0D0014",
+"d     c #09002A",
+"e     c #0C0042",
+"f     c #FF0000",
+"g     c #2C0011",
+"h     c #040018",
+"i     c #0A002E",
+"j     c #0C0040",
+"k     c #040010",
+"l     c #040014",
+"m     c #0A002C",
+"n     c #090031",
+"o     c #0A0035",
+"p     c #0C0039",
+"q     c #0D003D",
+"r     c #0E0047",
+"s     c #080026",
+"t     c #09002B",
+"u     c #09002F",
+"v     c #090033",
+"w     c #0C0037",
+"x     c #0D003C",
+"y     c #080025",
+"z     c #090029",
+"A     c #09002D",
+"B     c #090032",
+"C     c #0B0035",
+"D     c #0C003A",
+"E     c #0D003E",
+"F     c #0D0042",
+"G     c #06001C",
+"H     c #06001F",
+"I     c #070023",
+"J     c #080027",
+"K     c #090030",
+"L     c #0A0033",
+"M     c #0C0038",
+"N     c #0D0045",
+"O     c #040017",
+"P     c #09002E",
+"Q     c #0B0036",
+"R     c #0D0043",
+"S     c #060020",
+"T     c #09002C",
+"U     c #0A0034",
+"V     c #0C0041",
+"W     c #030012",
+"X     c #040016",
+"Y     c #06001B",
+"Z     c #06001E",
+"`     c #0D003F",
+"                      . +   @   ",
+"                      # $ % & * ",
+"            = - ; > , ' . ) ! @ ",
+"            ~ - ; {     # ] ^ & ",
+"      / ( _ : - ; {     < . [ } ",
+"  | 1 2 3 4 : - 5       6 7 ] ^ ",
+"  8   / 9 0 : - ;       a < b [ ",
+"          c : - ; { d   e 6 7 + ",
+"    f f f g h   5     i j a ' b ",
+"  f     k l     m n o p q e r . ",
+"              s t u v w x j a # ",
+"            ; y z A B C D E F r ",
+"          G H I J t K L M x j N ",
+"        O = - ; y z P B Q D E R ",
+"        l h G S I J T K U M x V ",
+"        W X Y Z 5 y d P B Q D ` "};
diff --git a/app/icons/bluegriffon32.png b/app/icons/bluegriffon32.png
new file mode 100644 (file)
index 0000000..0c57ddc
Binary files /dev/null and b/app/icons/bluegriffon32.png differ
diff --git a/app/icons/bluegriffon48.png b/app/icons/bluegriffon48.png
new file mode 100644 (file)
index 0000000..3887bf0
Binary files /dev/null and b/app/icons/bluegriffon48.png differ
diff --git a/app/icons/bluegriffon50.png b/app/icons/bluegriffon50.png
new file mode 100644 (file)
index 0000000..f5a50f1
Binary files /dev/null and b/app/icons/bluegriffon50.png differ
diff --git a/app/icons/bluegriffon50.xpm b/app/icons/bluegriffon50.xpm
new file mode 100644 (file)
index 0000000..e6bd7c7
--- /dev/null
@@ -0,0 +1,221 @@
+/* XPM */
+static char * bluegriffon50_xpm[] = {
+"50 50 168 2",
+"      c None",
+".     c #16006A",
+"+     c #16006D",
+"@     c #150068",
+"#     c #16006B",
+"$     c #16006F",
+"%     c #150067",
+"&     c #170071",
+"*     c #190078",
+"=     c #19007C",
+"-     c #150066",
+";     c #150069",
+">     c #16006C",
+",     c #180077",
+"'     c #19007A",
+")     c #1A007E",
+"!     c #16006E",
+"~     c #180076",
+"{     c #180074",
+"]     c #190077",
+"^     c #19007B",
+"/     c #150065",
+"(     c #170073",
+"_     c #190079",
+":     c #10004B",
+"<     c #10004E",
+"[     c #120058",
+"}     c #12005B",
+"|     c #170070",
+"1     c #0F004A",
+"2     c #10004D",
+"3     c #110050",
+"4     c #120057",
+"5     c #12005A",
+"6     c #150064",
+"7     c #17006F",
+"8     c #170072",
+"9     c #19007E",
+"0     c #1A0080",
+"a     c #05001B",
+"b     c #06001E",
+"c     c #070021",
+"d     c #0F0049",
+"e     c #10004C",
+"f     c #10004F",
+"g     c #110052",
+"h     c #110055",
+"i     c #120059",
+"j     c #140063",
+"k     c #1A007F",
+"l     c #050019",
+"m     c #06001D",
+"n     c #070025",
+"o     c #080027",
+"p     c #0E0048",
+"q     c #110051",
+"r     c #110054",
+"s     c #13005F",
+"t     c #140061",
+"u     c #19007D",
+"v     c #050018",
+"w     c #070024",
+"x     c #13005C",
+"y     c #150063",
+"z     c #180075",
+"A     c #03000C",
+"B     c #03000F",
+"C     c #030012",
+"D     c #040015",
+"E     c #070027",
+"F     c #0E0047",
+"G     c #13005E",
+"H     c #190076",
+"I     c #010003",
+"J     c #020006",
+"K     c #02000A",
+"L     c #39000C",
+"M     c #900008",
+"N     c #320011",
+"O     c #0E0046",
+"P     c #110053",
+"Q     c #110056",
+"R     c #12005C",
+"S     c #020009",
+"T     c #1D000D",
+"U     c #54000C",
+"V     c #200013",
+"W     c #0F004B",
+"X     c #000001",
+"Y     c #100050",
+"Z     c #13005D",
+"`     c #130060",
+" .    c #0E0044",
+"..    c #170074",
+"+.    c #3F000E",
+"@.    c #09002B",
+"#.    c #0D0041",
+"$.    c #0E0043",
+"%.    c #120056",
+"&.    c #240000",
+"*.    c #FF0000",
+"=.    c #D10004",
+"-.    c #0A002E",
+";.    c #0D003F",
+">.    c #0D0042",
+",.    c #0E0045",
+"'.    c #140062",
+").    c #160069",
+"!.    c #210010",
+"~.    c #0D003D",
+"{.    c #0D0040",
+"].    c #130061",
+"^.    c #08002A",
+"/.    c #09002D",
+"(.    c #0A002F",
+"_.    c #0B0033",
+":.    c #0B0036",
+"<.    c #0C0039",
+"[.    c #0C003C",
+"}.    c #080028",
+"|.    c #09002C",
+"1.    c #0A0031",
+"2.    c #0B0034",
+"3.    c #0B0037",
+"4.    c #0C003B",
+"5.    c #0C003D",
+"6.    c #070022",
+"7.    c #0A0030",
+"8.    c #060020",
+"9.    c #070023",
+"0.    c #070026",
+"a.    c #080029",
+"b.    c #0B0035",
+"c.    c #0D003E",
+"d.    c #05001C",
+"e.    c #06001F",
+"f.    c #0A002D",
+"g.    c #080026",
+"h.    c #0A0032",
+"i.    c #0B0038",
+"j.    c #050017",
+"k.    c #05001A",
+"l.    c #06001C",
+"m.    c #0C003A",
+"n.    c #0D0043",
+"o.    c #12005D",
+"p.    c #040013",
+"q.    c #040016",
+"r.    c #060021",
+"s.    c #040011",
+"t.    c #040014",
+"u.    c #03000D",
+"v.    c #030010",
+"w.    c #0B0032",
+"x.    c #02000C",
+"y.    c #040012",
+"z.    c #02000B",
+"A.    c #03000E",
+"B.    c #020008",
+"C.    c #010006",
+"D.    c #030011",
+"E.    c #040017",
+"F.    c #020007",
+"G.    c #070020",
+"H.    c #060022",
+"I.    c #08002B",
+"J.    c #010005",
+"K.    c #010007",
+"                                                                                                    ",
+"                                                                                                    ",
+"                                                                                                    ",
+"                                                                                                    ",
+"                                                                        . +                         ",
+"                                                                        @ # $                       ",
+"                                                                        % . + &   * =               ",
+"                                                                        - ; > $   , ' )             ",
+"                                                                          % . ! & ~ * =             ",
+"                                                                          - ; > $ { ] ^             ",
+"                                                                          / % # ! ( ~ _ =           ",
+"                                                            : <     [ }     - ; > | { ] '           ",
+"                                                            1 2 3   4 5     6 @ # 7 8 ~   9 0       ",
+"                                                a b c       d e f g h i     j - ; + | {   = k       ",
+"                                              l a m c n o   p 1 2 q r 4 5 s t 6   # $ ( ~ ' u       ",
+"                                              v a b c w o     d e f g h [ x s y   . + | z * =       ",
+"                                      A B C D v a b c w E     F 1 < q r 4 } G t - @ # | ( H '       ",
+"                                I J K A L M N v a b c w       O d e f P Q i R s j % . ! & z *       ",
+"                                I J S A T U V v a b c           p W < q r [ } G t /   > $ ( ~ '     ",
+"                              X I J S A B C D v a b c           O d 2 Y P Q 5 Z ` y @ . ! &   _ =   ",
+"                                I         C D v a b c w o        .p W < q h [ } s   - ; > $ .., '   ",
+"                                          +.D v a b c w o @.  #.$.F d 2 Y P %.5 x t 6 % # ! 8 ~     ",
+"                &.                  *.*.*.=.D v a b c     @.-.;.>.,.p : < g h [   s '.- ).+ | {     ",
+"              &.&.              *.*.*.*.  !.D v               ~.{.$.F 1 2 3 P Q 5 Z ].6 @ # ! 8     ",
+"            &.&.&.            *.        B C D     ^./.(._.:.<.[.;.>.,.p W f g h i R s j - . +       ",
+"            &.&.                                n }.|.-.1.2.3.4.5.#. .F 1 2 q r 4 5 G t / @ #       ",
+"    &.&.    &.&.                              6.n o ^./.7._.:.<.[.;.>.O d e f g h i R s j -         ",
+"    &.&.&.  &.&.  &.&.&.&.                  m 8.9.0.a.|.(.1.b.3.4.c.#. .F 1 2 q r 4 } G t   @ #     ",
+"      &.&.&.&.&.&.&.&.&.                  l d.e.6.n o ^.f.7._.:.<.[.;.>.O d e f P Q i   ` j % .     ",
+"        &.&.&.&.&.&.                      v a m 8.w g.a.|.(.h.b.i.4.c.#. .p W < q r 4 } G './       ",
+"          &.&.&.&.                      D j.k.l.e.6.n }.@.-.7.2.:.m.5.{.n.O d e 3 P %.5 o.` 6       ",
+"          &.&.&.                        p.q.v a b r.w o a./.(.h.b.i.4.c.#.,.p : < g h [ } G         ",
+"            &.&.&.                    B s.t.j.k.l.e.9.n }.@.-.7.2.3.m.5.{.n.O d 2 Y P 4             ",
+"            &.&.&.                    u.v.p.q.l a b c w o a./.(.w.b.i.[.;.>.,.p       h [           ",
+"            &.&.&.&.&.                x.B y.D j.k.m 8.9.n }.@.-.1.2.3.m.        1 2 Y P             ",
+"              &.&.&.&.&.              z.A.v.p.q.l a b c w o ^./.7._.:.<.[.;.>.,.p e f g             ",
+"              &.    &.&.&.&.        B.K A B y.D v k.m 8.9.n }.|.-.1.2.3.m.5.#. .F 1                 ",
+"              &.&.    &.&.&.        C.S z.A.D.t.E.l d.b 6.w o ^./.7._.:.<.[.;.>.                    ",
+"            &.&.&.      &.&.&.        F.K u.B y.D v k.m G.9.0.a.|.-.1.b.3.4.c.#.                    ",
+"              &.&.          &.        C.S x.A.s.t.E.l d.e.H.n }.I.-.7._.:.<.[.                      ",
+"                &.                    J.B.K u.B y.q.v a m 8.9.                                      ",
+"                                      J.K.S A A.s.t.j.k.l.e.6.n }.                                  ",
+"                                        C.B.K u.  p.q.v   b c w 0.a.                                ",
+"                                            K x.    D j.                                            ",
+"                                                                                                    ",
+"                                                                                                    ",
+"                                                                                                    ",
+"                                                                                                    ",
+"                                                                                                    ",
+"                                                                                                    "};
diff --git a/app/icons/default16.png b/app/icons/default16.png
new file mode 100644 (file)
index 0000000..67740d3
Binary files /dev/null and b/app/icons/default16.png differ
diff --git a/app/icons/default50.png b/app/icons/default50.png
new file mode 100644 (file)
index 0000000..f5a50f1
Binary files /dev/null and b/app/icons/default50.png differ
diff --git a/app/macbuild/Contents/Info.plist.in b/app/macbuild/Contents/Info.plist.in
new file mode 100644 (file)
index 0000000..5123dc4
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>English</string>
+       <key>CFBundleExecutable</key>
+       <string>%APP_BINARY%</string>
+       <key>CFBundleGetInfoString</key>
+       <string>%APP_NAME% %APP_VERSION%, © 2007-2008 Disruptive Innovations</string>
+       <key>CFBundleIconFile</key>
+       <string>bluegriffon</string>
+       <key>CFBundleIdentifier</key>
+       <string>com.disruptive-innovations.bluegriffon</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleName</key>
+       <string>%APP_NAME%</string>
+       <key>CFBundlePackageType</key>
+       <string>APPL</string>
+       <key>CFBundleShortVersionString</key>
+       <string>%APP_VERSION%</string>
+       <key>CFBundleSignature</key>
+       <string>MOZB</string>
+       <key>CFBundleVersion</key>
+       <string>%APP_VERSION%</string>
+       <key>NSAppleScriptEnabled</key>
+       <true/>
+</dict>
+</plist>
diff --git a/app/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in b/app/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in
new file mode 100644 (file)
index 0000000..d877c72
--- /dev/null
@@ -0,0 +1,2 @@
+CFBundleName = "%APP_NAME%";
+NSHumanReadableCopyright = "Copyright © 2008 Disruptive Innovations";
diff --git a/app/macbuild/Contents/Resources/bluegriffon.icns b/app/macbuild/Contents/Resources/bluegriffon.icns
new file mode 100755 (executable)
index 0000000..beb99be
Binary files /dev/null and b/app/macbuild/Contents/Resources/bluegriffon.icns differ
diff --git a/app/mozilla.in b/app/mozilla.in
new file mode 100644 (file)
index 0000000..ec8814b
--- /dev/null
@@ -0,0 +1,142 @@
+#!/bin/sh
+#
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is mozilla.org Code.
+#
+# The Initial Developer of the Original Code is
+# Netscape Communications Corporation.
+# Portions created by the Initial Developer are Copyright (C) 1998
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+## $Id: mozilla.in,v 1.16 2007/10/05 07:29:26 reed%reedloden.com Exp $
+## 
+## Usage:
+##
+## $ mozilla [args]
+##
+## This script is meant to run the mozilla-bin binary from either 
+## mozilla/xpfe/bootstrap or mozilla/dist/bin.
+##
+## The script will setup all the environment voodoo needed to make
+## the mozilla-bin binary to work.
+##
+
+#uncomment for debugging
+#set -x
+
+moz_libdir=%MOZAPPDIR%
+
+# Use run-mozilla.sh in the current dir if it exists
+# If not, then start resolving symlinks until we find run-mozilla.sh
+found=0
+progname="$0"
+curdir=`dirname "$progname"`
+progbase=`basename "$progname"`
+run_moz="$curdir/run-mozilla.sh"
+if test -x "$run_moz"; then
+  dist_bin="$curdir"
+  found=1
+else
+  here=`/bin/pwd`
+  while [ -h "$progname" ]; do
+    bn=`basename "$progname"`
+    cd `dirname "$progname"`
+    progname=`/bin/ls -l "$bn" | sed -e 's/^.* -> //' `
+    progbase=`basename "$progname"`
+    if [ ! -x "$progname" ]; then
+      break
+    fi
+    curdir=`dirname "$progname"`
+    run_moz="$curdir/run-mozilla.sh"
+    if [ -x "$run_moz" ]; then
+      cd "$curdir"
+      dist_bin=`pwd`
+      run_moz="$dist_bin/run-mozilla.sh"
+      found=1
+      break
+    fi
+  done
+  cd "$here"
+fi
+if [ $found = 0 ]; then
+  # Check default compile-time libdir
+  if [ -x "$moz_libdir/run-mozilla.sh" ]; then
+    dist_bin="$moz_libdir"
+  else 
+    echo "Cannot find mozilla runtime directory. Exiting."
+    exit 1
+  fi
+fi
+
+script_args=""
+debugging=0
+MOZILLA_BIN="${progbase}-bin"
+
+if [ "$OSTYPE" = "beos" ]; then
+  mimeset -F "$MOZILLA_BIN"
+fi
+
+pass_arg_count=0
+while [ $# -gt $pass_arg_count ]
+do
+  case "$1" in
+    -p | --pure | -pure)
+      MOZILLA_BIN="${MOZILLA_BIN}.pure"
+      shift
+      ;;
+    -g | --debug)
+      script_args="$script_args -g"
+      debugging=1
+      shift
+      ;;
+    -d | --debugger)
+      script_args="$script_args -d $2"
+      shift 2
+      ;;
+    *)
+      # Move the unrecognized argument to the end of the list.
+      arg="$1"
+      shift
+      set -- "$@" "$arg"
+      pass_arg_count=`expr $pass_arg_count + 1`
+      ;;
+  esac
+done
+
+if [ $debugging = 1 ]
+then
+  echo $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@"
+fi
+"$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@"
+exitcode=$?
+
+exit $exitcode
+# EOF.
diff --git a/app/nsEditorApp.cpp b/app/nsEditorApp.cpp
new file mode 100644 (file)
index 0000000..2aaa153
--- /dev/null
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *  Brian Ryner <bryner@brianryner.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#include "nsXULAppAPI.h"
+#ifdef XP_WIN
+#include <windows.h>
+#include <stdlib.h>
+#endif
+
+#include <stdio.h>
+#include <stdarg.h>
+
+#include "nsCOMPtr.h"
+#include "nsILocalFile.h"
+#include "nsStringGlue.h"
+
+#ifdef XP_WIN
+// we want a wmain entry point
+#include "nsWindowsWMain.cpp"
+#endif
+
+static void Output(const char *fmt, ... )
+{
+  va_list ap;
+  va_start(ap, fmt);
+
+#if defined(XP_WIN) && !MOZ_WINCONSOLE
+  PRUnichar msg[2048];
+  _vsnwprintf(msg, sizeof(msg)/sizeof(msg[0]), NS_ConvertUTF8toUTF16(fmt).get(), ap);
+  MessageBoxW(NULL, msg, L"XULRunner", MB_OK | MB_ICONERROR);
+#else
+  vfprintf(stderr, fmt, ap);
+#endif
+
+  va_end(ap);
+}
+
+
+/**
+ * A helper class which calls NS_LogInit/NS_LogTerm in its scope.
+ */
+class ScopedLogging
+{
+public:
+  ScopedLogging() { NS_LogInit(); }
+  ~ScopedLogging() { NS_LogTerm(); }
+};
+
+int main(int argc, char* argv[])
+{
+  ScopedLogging log;
+
+  nsCOMPtr<nsILocalFile> appini;
+  nsresult rv = XRE_GetBinaryPath(argv[0], getter_AddRefs(appini));
+  if (NS_FAILED(rv)) {
+    Output("Couldn't calculate the application directory.");
+    return 255;
+  }
+  appini->SetNativeLeafName(NS_LITERAL_CSTRING("application.ini"));
+
+  nsXREAppData *appData;
+  rv = XRE_CreateAppData(appini, &appData);
+  if (NS_FAILED(rv)) {
+    Output("Couldn't read application.ini");
+    return 255;
+  }
+
+  int result = XRE_main(argc, argv, appData);
+  XRE_FreeAppData(appData);
+  return result;
+}
diff --git a/app/profile/bluegriffon-prefs.js b/app/profile/bluegriffon-prefs.js
new file mode 100644 (file)
index 0000000..41392a7
--- /dev/null
@@ -0,0 +1,73 @@
+#filter substitution
+
+pref("toolkit.defaultChromeURI", "chrome://bluegriffon/content/xul/bluegriffon.xul");
+
+/* debugging prefs */
+pref("browser.dom.window.dump.enabled", true);
+pref("javascript.options.showInConsole", true);
+pref("javascript.options.strict", true);
+pref("nglayout.debug.disable_xul_cache", true);
+pref("nglayout.debug.disable_xul_fastload", true);
+
+pref("general.useragent.extra.mybrowser", "@APP_UA_NAME@/@APP_VERSION@");
+
+pref("extensions.update.enabled", true);
+pref("extensions.update.url", "chrome://mozapps/locale/extensions/extensions.properties");
+pref("extensions.update.interval", 86400);  // Check for updates to Extensions and 
+                                            // Themes every week
+// Non-symmetric (not shared by extensions) extension-specific [update] preferences
+pref("extensions.getMoreExtensionsURL", "chrome://mozapps/locale/extensions/extensions.properties");
+pref("extensions.getMoreThemesURL", "chrome://mozapps/locale/extensions/extensions.properties");
+pref("extensions.dss.enabled", false);          // Dynamic Skin Switching                                               
+pref("extensions.dss.switchPending", false);    // Non-dynamic switch pending after next
+                                                // restart.
+// browser preferences
+pref("bluegriffon.display.use_system_colors", true);
+pref("bluegriffon.display.foreground_color", "#000000");
+pref("bluegriffon.display.background_color", "#ffffff");
+pref("bluegriffon.display.active_color", "#ee0000");
+pref("bluegriffon.display.anchor_color", "#0000ee");
+pref("bluegriffon.display.visited_color", "#551a8b");
+pref("bluegriffon.display.underline_links", true);
+
+// document preferences
+pref("bluegriffon.author", "");
+
+// table preferences
+pref("bluegriffon.defaults.table.halign", "");
+pref("bluegriffon.defaults.table.valign", "");
+pref("bluegriffon.defaults.table.border", "1");
+pref("bluegriffon.defaults.table.rows", "2");
+pref("bluegriffon.defaults.table.cols", "2");
+pref("bluegriffon.defaults.table.width", "100");
+pref("bluegriffon.defaults.table.width_unit", "percentage");
+pref("bluegriffon.defaults.table.text_wrap", "");
+pref("bluegriffon.defaults.table.cell_spacing", "2");
+pref("bluegriffon.defaults.table.cell_padding", "2");
+
+// CSS policy
+pref("bluegriffon.css.policy", 0); // 0: HTML Attr; 1: Inline styles; 2: embedded CSS Rules; 3: existing rule 
+
+pref("bluegriffon.prettyprint", true);
+pref("bluegriffon.encode_entity", "html");
+
+pref("bluegriffon.zoom.default", "1");
+
+pref("bluegriffon.history.url_maximum", 10);
+
+pref("signon.rememberSignons", true);
+pref("signon.expireMasterPassword", false);
+pref("signon.SignonFileName", "signons.txt");
+
+// suppress external-load warning for standard browser schemes
+pref("network.protocol-handler.warn-external.http", false);
+pref("network.protocol-handler.warn-external.https", false);
+pref("network.protocol-handler.warn-external.ftp", false);
+
+// XPI
+pref("xpinstall.dialog.confirm", "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul");
+pref("xpinstall.dialog.progress.skin", "chrome://mozapps/content/extensions/extensions.xul");
+pref("xpinstall.dialog.progress.chrome", "chrome://mozapps/content/extensions/extensions.xul");
+pref("xpinstall.dialog.progress.type.skin", "Extension:Manager");
+pref("xpinstall.dialog.progress.type.chrome", "Extension:Manager");
+
diff --git a/app/splash.rc b/app/splash.rc
new file mode 100644 (file)
index 0000000..67ef69e
--- /dev/null
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Bill Law       law@netscape.com
+ *   Jonathan Wilson <jonwil@tpgi.com.au>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+#include <windows.h>
+#include "nsNativeAppSupportWin.h"
+
+1 24 "bluegriffon.exe.manifest"
+
+IDI_APPICON ICON COMPOSER_ICO
+IDI_DOCUMENT ICON DOCUMENT_ICO
+IDI_APPLICATION ICON COMPOSER_ICO
+
+STRINGTABLE DISCARDABLE
+BEGIN
+#ifdef DEBUG
+    IDS_STARTMENU_APPNAME,              "BlueGriffon Debug"
+#else
+    IDS_STARTMENU_APPNAME,              "BlueGriffon"
+#endif
+END
+
+#ifdef MOZ_STATIC_BUILD
+
+// XXX This code is copied from resource.h and widget.rc.  It's a work-around
+// for the limitation that only one resource file can be used in an .exe.  We
+// should develop a method, for static builds only, to combine multiple .rc
+// files into a single .rc file, and then use that to build the single .res
+// file for the .exe.
+
+#define IDC_GRAB                        4101
+#define IDC_GRABBING                    4102
+#define IDC_CELL                        4103
+#define IDC_COPY                        4104
+#define IDC_ALIAS                       4105
+#define IDC_ZOOMIN                      4106
+#define IDC_ZOOMOUT                     4107
+#define IDC_COLRESIZE                   4108
+#define IDC_ROWRESIZE                   4109
+#define IDC_VERTICALTEXT                4110
+#define IDC_NONE                        4112
+
+IDC_GRAB                CURSOR  DISCARDABLE     "..\\..\\widget\\src\\build\\res\\grab.cur"
+IDC_GRABBING            CURSOR  DISCARDABLE     "..\\..\\widget\\src\\build\\res\\grabbing.cur"
+IDC_CELL                CURSOR  DISCARDABLE     "..\\..\\widget\\src\\build\\res\\cell.cur"
+IDC_COPY                CURSOR  DISCARDABLE     "..\\..\\widget\\src\\build\\res\\copy.cur"
+IDC_ALIAS               CURSOR  DISCARDABLE     "..\\..\\widget\\src\\build\\res\\aliasb.cur"
+IDC_ZOOMIN              CURSOR  DISCARDABLE     "..\\..\\widget\\src\\build\\res\\zoom_in.cur"
+IDC_ZOOMOUT             CURSOR  DISCARDABLE     "..\\..\\widget\\src\\build\\res\\zoom_out.cur"
+IDC_COLRESIZE           CURSOR  DISCARDABLE     "..\\..\\widget\\src\\build\\res\\col_resize.cur"
+IDC_ROWRESIZE           CURSOR  DISCARDABLE     "..\\..\\widget\\src\\build\\res\\row_resize.cur"
+IDC_VERTICALTEXT        CURSOR  DISCARDABLE     "..\\..\\widget\\src\\build\\res\\vertical_text.cur"
+IDC_NONE                CURSOR  DISCARDABLE     "..\\..\\widget\\src\\build\\res\\none.cur"
+
+#endif
diff --git a/base/Makefile.in b/base/Makefile.in
new file mode 100644 (file)
index 0000000..1898a94
--- /dev/null
@@ -0,0 +1,55 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla.org
+#
+# The Initial Developer of the Original Code is
+# Netscape Communications Corporation.
+# Portions created by the Initial Developer are Copyright (C) 2003
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Daniel Glazman (daniel@glazman.org), on behalf of Lindows.com
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH          = ../..
+topsrcdir      = @top_srcdir@
+srcdir = @srcdir@
+VPATH          = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+DEFINES += \
+       -DAPP_NAME=$(MOZ_APP_DISPLAYNAME) \
+       -DAPP_VERSION=$(MOZ_APP_VERSION) \
+       $(NULL)
+
+ifneq (,$(filter mac cocoa, $(MOZ_WIDGET_TOOLKIT)))
+DEFINES += -DTOOLBAR_CUSTOMIZATION_SHEET
+endif
+
+include $(topsrcdir)/config/rules.mk
+
diff --git a/base/content/bluegriffon/DI.png b/base/content/bluegriffon/DI.png
new file mode 100644 (file)
index 0000000..c2b8523
Binary files /dev/null and b/base/content/bluegriffon/DI.png differ
diff --git a/base/content/bluegriffon/EditorContent.css b/base/content/bluegriffon/EditorContent.css
new file mode 100644 (file)
index 0000000..52f53db
--- /dev/null
@@ -0,0 +1,114 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998-1999
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <glazman@netscape.com>
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, on behalf of Linspire Inc.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+ /* Styles to alter look of things in the Editor content window 
+ *  for the "Normal Edit Mode" These settings will be removed
+ *  when we display in completely WYSIWYG "Edit Preview" mode
+ *  Anything that should never change, like cursors, should be 
+ *  place in EditorOverride.css, instead of here.
+*/
+
+@namespace nvu url("http://disruptive-innovations.com/zoo/nvu");
+
+
+a[name] {
+  min-height: 17px; margin-left: 2px; margin-top: 2px;
+  padding-left: 20px; 
+  background-image: url(chrome://bluegriffon/content/images/tag-anchor.gif);
+  background-repeat: no-repeat; 
+  background-position: top left;
+}
+
+/* Force border display for empty cells 
+   and tables with 0 border
+*/
+table {
+  empty-cells: show;
+}
+
+/* give a red dotted border to tables and cells with no border
+   otherwise they are invisible
+*/
+table[empty-cells],
+  table[border="0"],
+  /* next two selectors on line below for the case where tbody is omitted */
+  table[border="0"] > tr > td, table[border="0"] > tr > th,
+  table[border="0"] > thead > tr > td, table[border="0"] > tbody > tr > td, table[border="0"] > tfoot > tr > td,
+  table[border="0"] > thead > tr > th, table[border="0"] > tbody > tr > th, table[border="0"] > tfoot > tr > th,
+  /* next two selectors on line below for the case where tbody is omitted */
+  table:not([border]) > tr > td, table:not([border]) > tr >  th,
+  table:not([border]) > thead > tr > td, table:not([border]) > tbody > tr > td, table:not([border]) > tfoot > tr > td,
+  table:not([border]) > thead > tr > th, table:not([border]) > tbody > tr > th, table:not([border]) > tfoot > tr > th
+{
+  outline: 1px dotted;
+}
+
+/* give a green dashed border to forms otherwise they are invisible
+*/
+form
+{
+  outline: 1px dashed #66cccc;
+}
+
+/* give a green dotted border to labels otherwise they are invisible
+*/
+label
+{
+  outline: 1px dotted green;
+}
+
+
+
+
+img {
+  -moz-force-broken-image-icon: 1;
+}
+
+nvu|comment, nvu|pi, nvu|php {
+  -moz-user-select: all ! important;
+  display: inline;
+}
+
+table > nvu|*,
+tbody > nvu|*,
+thead > nvu|*,
+tfoot > nvu|*,
+tr > nvu|* {
+  display: none ! important}
+
diff --git a/base/content/bluegriffon/EditorOverride.css b/base/content/bluegriffon/EditorOverride.css
new file mode 100644 (file)
index 0000000..5187801
--- /dev/null
@@ -0,0 +1,366 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998-1999
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, on behalf of Linspire Inc.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/* Styles to alter look of things in the Editor content window 
+ *  that should NOT be removed when we display in completely WYSIWYG 
+ *  "Browser Preview" mode.
+ *  Anything that should change, like appearance of table borders
+ *  and Named Anchors, should be placed in EditorContent.css instead of here.
+*/
+
+@namespace nvu url("http://disruptive-innovations.com/zoo/nvu");
+
+/* Primary cursor is text I-beam */
+
+::-moz-canvas, a:link {
+  cursor: text;
+}
+
+/* Use default arrow over objects with size that 
+   are selected when clicked on.
+   Override the browser's pointer cursor over links
+*/
+
+img, img[usemap], area,
+object, object[usemap], 
+applet, hr, button, input, isindex, textarea, select,
+a:link img, a:visited img, a:active img,
+a[name]:empty {
+  cursor: default;
+}
+
+a:visited, a:active {
+  cursor: text;
+  color : inherit;
+}
+
+/* Prevent clicking on links from going to link */
+a:link img, a:visited img {
+  -moz-user-input: none;
+}
+
+/* We suppress user/author's prefs for link underline, 
+   so we must set explicitly. This isn't good!
+*/
+a:link {
+  text-decoration: underline -moz-anchor-decoration;
+  color: -moz-hyperlinktext;
+}
+
+/* Allow double-clicks on these widgets to open properties dialogs
+   XXX except when the widget has disabled attribute */
+input, button, textarea {
+  -moz-user-select: all !important;
+  -moz-user-input: auto !important;
+  -moz-user-focus: none !important;
+}
+
+/* XXX Still need a better way of blocking other events to these widgets */
+select, input[disabled], input[type="checkbox"], input[type="radio"], input[type="file"] {
+  -moz-user-select: all !important;
+  -moz-user-input: none !important;
+  -moz-user-focus: none !important;
+}
+
+isindex[prompt]
+{
+  -moz-user-select: none !important;
+  -moz-user-input: none !important;
+  -moz-user-focus: none !important;
+}
+
+input[type="hidden"] {
+  border: 1px solid black !important;
+  visibility: visible !important;
+}
+
+label {
+    -moz-user-select: all !important;
+}
+
+::-moz-display-comboboxcontrol-frame {
+  -moz-user-select: text !important;
+}
+
+option {
+  -moz-user-select: text !important;
+}
+
+#mozToc.readonly {
+  -moz-user-select: all !important;
+  -moz-user-input: none !important;
+}
+
+/* the following rules are for Image Resizing */
+
+span[\_moz_anonclass="mozResizer"] {
+  width: 5px;
+  height: 5px;
+  position: absolute;
+  border: 1px black solid;
+  background-color: white;
+  -moz-user-select: none;
+  z-index: 2147483646; /* max value -1 for this property */
+}
+
+/* we can't use :active below */
+span[\_moz_anonclass="mozResizer"][\_moz_activated],
+span[\_moz_anonclass="mozResizer"]:hover {
+  background-color: black;
+}
+
+span[\_moz_anonclass="mozResizer"].hidden,
+span[\_moz_anonclass="mozResizingShadow"].hidden,
+img[\_moz_anonclass="mozResizingShadow"].hidden,
+span[\_moz_anonclass="mozGrabber"].hidden,
+span[\_moz_anonclass="mozResizingInfo"].hidden,
+a[\_moz_anonclass="mozTableRemoveRow"].hidden,
+a[\_moz_anonclass="mozTableRemoveColumn"].hidden {
+  display: none !important;
+}
+
+span[\_moz_anonclass="mozResizer"][anonlocation="nw"] {
+  cursor: nw-resize;
+}
+span[\_moz_anonclass="mozResizer"][anonlocation="n"] {
+  cursor: n-resize;
+}
+span[\_moz_anonclass="mozResizer"][anonlocation="ne"] {
+  cursor: ne-resize;
+}
+span[\_moz_anonclass="mozResizer"][anonlocation="w"] {
+  cursor: w-resize;
+}
+span[\_moz_anonclass="mozResizer"][anonlocation="e"] {
+  cursor: e-resize;
+}
+span[\_moz_anonclass="mozResizer"][anonlocation="sw"] {
+  cursor: sw-resize;
+}
+span[\_moz_anonclass="mozResizer"][anonlocation="s"] {
+  cursor: s-resize;
+}
+span[\_moz_anonclass="mozResizer"][anonlocation="se"] {
+  cursor: se-resize;
+}
+
+span[\_moz_anonclass="mozResizingShadow"],
+img[\_moz_anonclass="mozResizingShadow"] {
+  -moz-outline: thin dashed black;
+  -moz-user-select: none;
+  -moz-opacity: 0.5;
+  position: absolute;
+  z-index: 2147483647; /* max value for this property */
+}
+
+span[\_moz_anonclass="mozResizingInfo"] {
+  font-family: sans-serif;
+  font-size: x-small;
+  color: black;
+  background-color: #d0d0d0;
+  border: ridge 2px #d0d0d0;
+  padding: 2px;
+  position: absolute;
+  z-index: 2147483647; /* max value for this property */
+}
+
+img[\_moz_resizing] {
+  -moz-outline: thin solid black;
+}
+
+*[\_moz_abspos] {
+  -moz-outline: silver ridge 2px;
+  z-index: 2147483645 !important; /* max value -2 for this property */
+}
+*[\_moz_abspos="white"] {
+  background-color: white !important;
+}
+*[\_moz_abspos="black"] {
+  background-color: black !important;
+}
+
+span[\_moz_anonclass="mozGrabber"] {
+  -moz-outline: ridge 2px silver;
+  padding: 2px;
+  position: absolute;
+  width: 12px;
+  height: 12px;
+  background-image: url("resource:/res/grabber.gif");
+  background-repeat: no-repeat;
+  background-position: center center;
+  -moz-user-select: none;
+  cursor: move;
+}
+
+/* INLINE TABLE EDITING */
+
+a[\_moz_anonclass="mozTableAddColumnBefore"] {
+  position: absolute;
+  z-index: 2147483647; /* max value for this property */
+  text-decoration: none !important;
+  border: none 0px !important;
+  width: 4px;
+  height: 8px;
+  background-image: url("resource:/res/table-add-column-before.gif");
+  background-repeat: no-repeat;
+  background-position: center center;
+  -moz-user-select: none !important;
+  -moz-user-focus: none !important;
+}
+
+a[\_moz_anonclass="mozTableAddColumnBefore"]:hover {
+  background-image: url("resource:/res/table-add-column-before-hover.gif");
+}
+
+a[\_moz_anonclass="mozTableAddColumnBefore"]:active {
+  background-image: url("resource:/res/table-add-column-before-active.gif");
+}
+
+a[\_moz_anonclass="mozTableAddColumnAfter"] {
+  position: absolute;
+  z-index: 2147483647; /* max value for this property */
+  text-decoration: none !important;
+  border: none 0px !important;
+  width: 4px;
+  height: 8px;
+  background-image: url("resource:/res/table-add-column-after.gif");
+  background-repeat: no-repeat;
+  background-position: center center;
+  -moz-user-select: none !important;
+  -moz-user-focus: none !important;
+}
+
+a[\_moz_anonclass="mozTableAddColumnAfter"]:hover {
+  background-image: url("resource:/res/table-add-column-after-hover.gif");
+}
+
+a[\_moz_anonclass="mozTableAddColumnAfter"]:active {
+  background-image: url("resource:/res/table-add-column-after-active.gif");
+}
+
+a[\_moz_anonclass="mozTableRemoveColumn"] {
+  position: absolute;
+  z-index: 2147483647; /* max value for this property */
+  text-decoration: none !important;
+  border: none 0px !important;
+  width: 8px;
+  height: 8px;
+  background-image: url("resource:/res/table-remove-column.gif");
+  background-repeat: no-repeat;
+  background-position: center center;
+  -moz-user-select: none !important;
+  -moz-user-focus: none !important;
+}
+
+a[\_moz_anonclass="mozTableRemoveColumn"]:hover {
+  background-image: url("resource:/res/table-remove-column-hover.gif");
+}
+
+a[\_moz_anonclass="mozTableRemoveColumn"]:active {
+  background-image: url("resource:/res/table-remove-column-active.gif");
+}
+
+a[\_moz_anonclass="mozTableAddRowBefore"] {
+  position: absolute;
+  z-index: 2147483647; /* max value for this property */
+  text-decoration: none !important;
+  border: none 0px !important;
+  width: 8px;
+  height: 4px;
+  background-image: url("resource:/res/table-add-row-before.gif");
+  background-repeat: no-repeat;
+  background-position: center center;
+  -moz-user-select: none !important;
+  -moz-user-focus: none !important;
+}
+
+a[\_moz_anonclass="mozTableAddRowBefore"]:hover {
+  background-image: url("resource:/res/table-add-row-before-hover.gif");
+}
+
+a[\_moz_anonclass="mozTableAddRowBefore"]:active {
+  background-image: url("resource:/res/table-add-row-before-active.gif");
+}
+
+a[\_moz_anonclass="mozTableAddRowAfter"] {
+  position: absolute;
+  z-index: 2147483647; /* max value for this property */
+  text-decoration: none !important;
+  border: none 0px !important;
+  width: 8px;
+  height: 4px;
+  background-image: url("resource:/res/table-add-row-after.gif");
+  background-repeat: no-repeat;
+  background-position: center center;
+  -moz-user-select: none !important;
+  -moz-user-focus: none !important;
+}
+
+a[\_moz_anonclass="mozTableAddRowAfter"]:hover {
+  background-image: url("resource:/res/table-add-row-after-hover.gif");
+}
+
+a[\_moz_anonclass="mozTableAddRowAfter"]:active {
+  background-image: url("resource:/res/table-add-row-after-active.gif");
+}
+
+a[\_moz_anonclass="mozTableRemoveRow"] {
+  position: absolute;
+  z-index: 2147483647; /* max value for this property */
+  text-decoration: none !important;
+  border: none 0px !important;
+  width: 8px;
+  height: 8px;
+  background-image: url("resource:/res/table-remove-row.gif");
+  background-repeat: no-repeat;
+  background-position: center center;
+  -moz-user-select: none !important;
+  -moz-user-focus: none !important;
+}
+
+a[\_moz_anonclass="mozTableRemoveRow"]:hover {
+  background-image: url("resource:/res/table-remove-row-hover.gif");
+}
+
+a[\_moz_anonclass="mozTableRemoveRow"]:active {
+  background-image: url("resource:/res/table-remove-row-active.gif");
+}
+
+nvu|php, nvu|comment {
+  display: none ! important;
+}
diff --git a/base/content/bluegriffon/Thumbs.db b/base/content/bluegriffon/Thumbs.db
new file mode 100644 (file)
index 0000000..7378b0f
Binary files /dev/null and b/base/content/bluegriffon/Thumbs.db differ
diff --git a/base/content/bluegriffon/about-logo.png b/base/content/bluegriffon/about-logo.png
new file mode 100644 (file)
index 0000000..79984d4
Binary files /dev/null and b/base/content/bluegriffon/about-logo.png differ
diff --git a/base/content/bluegriffon/aboutDialog.css b/base/content/bluegriffon/aboutDialog.css
new file mode 100644 (file)
index 0000000..d721fea
--- /dev/null
@@ -0,0 +1,61 @@
+ #aboutDialog {
+   padding: 0px 0px 10px 0px;
+   width: 299px;
+ }
+
+ #clientBox {
+   background-color: #FFFFFF;
+   padding: 0px;
+   margin: 0px;
+   color: #000000;
+ }
+
+ #brandName {
+   font-weight: bold; font-size: larger;
+ } 
+
+ #detailsBox {
+   padding: 8px 10px 0px 8px;
+ }
+
+ #userAgent {
+   margin: 3px 10px 10px 5px;
+   background-color: #FFFFFF;
+   color: #000000;
+   padding: 1px 0px 0px 3px;
+   -moz-appearance: none;
+   height: 4em;
+   border: 0px;
+ }
+
+ #groove {
+   margin-top: 0px;
+ }
+
+ #creditsIframe {
+   cursor: default;
+   -moz-user-select: none;
+   border: 0px;
+ }
+
+ #version {
+   font-weight: bold;
+   color: #909090;
+   margin: 1em 0px 10px 17px;
+ }
+
+ #copyright {
+   margin: 0px 0px 3px 16px;
+ }
+
+ button[dlgtype="extra2"] {
+   margin-left: 13px;
+ }
+ button[dlgtype="accept"] {
+   margin-right: 13px;
+ }
+
+* {
+  overflow: hidden;
+}
\ No newline at end of file
diff --git a/base/content/bluegriffon/bindings/cssToggler.xml b/base/content/bluegriffon/bindings/cssToggler.xml
new file mode 100644 (file)
index 0000000..83c4caf
--- /dev/null
@@ -0,0 +1,370 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2008
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<!DOCTYPE bindings [
+  <!ENTITY % cssTogglerDTD SYSTEM "chrome://bluegriffon/locale/cssToggler.dtd" >
+  %cssTogglerDTD;
+]>
+<bindings id="cssTogglerBindings"
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:html="http://www.w3.org/1999/xhtml"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
+
+  <binding id="cssToggler">
+
+    <resources>
+      <stylesheet src="chrome://bluegriffon/skin/cssToggler.css"/>
+    </resources>
+
+    <content>
+      <xul:hbox align="center" anonid="prefBox">
+        <xul:label value="&cssPolicy.label;"/>
+        <xul:menulist oncommand="this.parentNode.parentNode.toggle()"
+                      anonid="cssPolicy">
+          <xul:menupopup>
+            <xul:menuitem label="&htmlAttr.label;"
+                          value="0"/>
+            <xul:menuitem label="&inlineStyles.label;"
+                          value="1"/>
+            <xul:menuitem label="&cssRules.label;"
+                          value="2"/>
+            <xul:menuitem label="&reuseExistingStyle.label;"
+                          value="3"/>
+          </xul:menupopup>
+        </xul:menulist>
+      </xul:hbox>
+      <xul:groupbox anonid="idBox" collapsed="true">
+        <xul:caption label="&styleRule.label;"/>
+        <xul:description>&mandatoryId.description;</xul:description>
+        <xul:grid flex="1">
+          <xul:columns><xul:column /><xul:column flex="1"/><xul:column/></xul:columns>
+          <xul:rows>
+            <xul:row align="center">
+              <xul:label value="&idList.label;"/>
+              <xul:textbox anonid="idTextbox" flex="1"
+                           oninput="onIdOrClassBoxChange()"/>
+              <xul:button label="&pickOne.button;"
+                          oncommand="pickId(mIdTextBox)"/>
+            </xul:row>
+            <xul:row align="center">
+              <xul:label value="&classList.label;"/>
+              <xul:textbox anonid="classTextbox" flex="1"
+                           oninput="onIdOrClassBoxChange()"/>
+              <xul:button label="&pickOne.button;"
+                          oncommand="pickId(mClassTextBox)"/>
+            </xul:row>
+          </xul:rows>
+        </xul:grid>
+        <xul:label value="&existingId.alert;" class="hiddenAlert" anonid="existingIdAlert"/>
+      </xul:groupbox>
+      <xul:groupbox anonid="reuseStylesBox" collapsed="true">
+        <xul:caption label="&reuseExistingStyle.label;"/>
+        <xul:grid flex="1">
+          <xul:columns><xul:column/><xul:column/></xul:columns>
+          <xul:rows>
+            <xul:row align="center">
+              <xul:label value="&classList.label;"/>
+              <xul:menulist anonid="ClassList"
+                            oncommand="onClassOrIdChange()">
+                <xul:menupopup id="ClassPopup" onpopupshowing="initClassMenu(this, false);"/>
+              </xul:menulist>
+            </xul:row>
+            <xul:row align="center">
+              <xul:label value="&idList.label;"/>
+              <xul:menulist anonid="IDList"
+                            oncommand="onClassOrIdChange()">
+                <xul:menupopup id="ClassPopup" onpopupshowing="initIdMenu(this);"/>
+              </xul:menulist>
+            </xul:row>
+          </xul:rows>
+        </xul:grid>
+      </xul:groupbox>
+      <xul:box anonid="childrenBox" collapsed="true" orient="vertical">
+        <children/>
+      </xul:box>
+    </content>
+
+    <implementation>
+
+      <property name="cssPolicy"
+                readonly="true"
+                onget="return parseInt(this.mCSSPolicy.value)" />
+
+      <property name="reusedID"
+                readonly="true"
+                onget="return this.mIDList.value" />
+      <property name="reusedClass"
+                readonly="true"
+                onget="return this.mClassList.value" />
+
+      <property name="newID"
+                readonly="true"
+                onget="return this.mIdTextBox.value" />
+      <property name="newClass"
+                readonly="true"
+                onget="return this.mClassTextBox.value" />
+
+
+      <property name="mCSSPolicy"
+                readonly="true"
+                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'cssPolicy')" />
+
+      <property name="mChildrenBox"
+                readonly="true"
+                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'childrenBox')" />
+
+      <property name="mIdBox"
+                readonly="true"
+                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'idBox')" />
+
+      <property name="mIdTextBox"
+                readonly="true"
+                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'idTextbox')" />
+
+      <property name="mClassTextBox"
+                readonly="true"
+                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'classTextbox')" />
+
+      <property name="mReuseStylesBox"
+                readonly="true"
+                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'reuseStylesBox')" />
+
+      <property name="mIDList"
+                readonly="true"
+                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'IDList')" />
+
+      <property name="mClassList"
+                readonly="true"
+                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'ClassList')" />
+
+      <property name="mExistingIdAlert"
+                readonly="true"
+                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'existingIdAlert')" />
+
+      <constructor>
+        <![CDATA[
+          //this.init();
+        ]]>
+      </constructor>
+
+      <method name="init">
+        <body>
+        <![CDATA[
+          var useCssPref = 0;
+          try {
+            var useCssPref = GetPrefs().getIntPref("bluegriffon.css.policy");
+          }
+          catch(e) {}
+          this.mCSSPolicy.value = useCssPref;
+          // adapt dialog depending on the pref
+          this.showOrHideBoxes(useCssPref);
+        ]]>
+        </body>
+      </method>
+
+      <method name="toggle">
+        <body>
+        <![CDATA[
+          // get user's choice for CSS policy
+          var useCssPref = parseInt(this.mCSSPolicy.value);
+          try {
+            // early way out if no change
+            if (GetPrefs().getIntPref("bluegriffon.css.policy") == useCssPref)
+              return;
+          }
+          catch(e) {}
+
+          // save in pref
+          try {
+            GetPrefs().setIntPref("bluegriffon.css.policy", useCssPref);
+          }
+          catch(e) {}
+
+          // update dialog
+          this.showOrHideBoxes(useCssPref);
+        ]]>
+        </body>
+      </method>
+
+      <method name="showOrHideBoxes">
+        <parameter name="useCssPref"/>
+        <body>
+        <![CDATA[
+          switch(useCssPref)
+          {
+            case 3: // reuse existing CSS rule
+              this.mChildrenBox.setAttribute("collapsed", "true");
+              this.mIdBox.setAttribute("collapsed", "true");
+              this.mReuseStylesBox.removeAttribute("collapsed");
+              initClassMenu(this.mClassList.menupopup, false);
+              initIdMenu(this.mIDList.menupopup);
+              this.onClassOrIdChange(this.mClassList);
+              break;
+            case 2: // create style rules if possible
+              this.mChildrenBox.removeAttribute("collapsed");
+              this.mIdBox.removeAttribute("collapsed");
+              this.mReuseStylesBox.setAttribute("collapsed", "true");
+              this.onIdOrClassBoxChange();
+              break;
+            case 1: // create inline styles if possible
+              this.mChildrenBox.removeAttribute("collapsed");
+              this.mIdBox.setAttribute("collapsed", "true");
+              this.mReuseStylesBox.setAttribute("collapsed", "true");
+              document.documentElement.getButton("accept").removeAttribute("disabled");
+              this.enableControls(true);
+              break;
+            case 0: // OMG, user really wants HTML attributes, OMG!!!
+              this.mChildrenBox.setAttribute("collapsed", "true");
+              this.mIdBox.setAttribute("collapsed", "true");
+              this.mReuseStylesBox.setAttribute("collapsed", "true");
+              document.documentElement.getButton("accept").removeAttribute("disabled");
+              this.enableControls(true);
+              break;
+            default: break;
+          }
+
+          this.setAttribute("style", "display: none");
+          this.removeAttribute("style");
+
+          try {
+            // ugly hack needed because sizeToContent() can suck if window
+            // was never resized before...
+            window.resizeTo(window.outerWidth, window.outerHeight + 1); 
+            window.sizeToContent();
+          }
+          catch(e) {}
+        ]]>
+        </body>
+      </method>
+
+      <method name="onIdOrClassBoxChange">
+        <body>
+        <![CDATA[
+          // make the alert on existing ID visible by default
+          this.mExistingIdAlert.removeAttribute("class");
+          if (this.mIdTextBox.value || this.mClassTextBox.value)
+          {
+            // ah, we have at least class or ID... if we have an ID, is there already
+            // an element with that ID in the document ?
+            var elt = this.mIdTextBox.value ?
+                        EditorUtils.getCurrentDocument().getElementById(this.mIdTextBox.value)
+                        : null;
+            if (!elt)
+            {
+              // lucky man...
+              this.mExistingIdAlert.setAttribute("class", "hiddenAlert");
+              document.documentElement.getButton("accept").removeAttribute("disabled");
+              this.enableControls(true);
+              return;
+            }
+          }
+          else
+            this.mExistingIdAlert.setAttribute("class", "hiddenAlert");
+
+          // cannot create the element in that case
+          document.documentElement.getButton("accept").setAttribute("disabled", "true");
+          this.enableControls(false);
+        ]]>
+        </body>
+      </method>
+
+      <method name="onClassOrIdChange">
+        <parameter name="aElt"/>
+        <body>
+        <![CDATA[
+          if (this.mIDList.value || this.mClassList.value)
+          {
+            // we have at least an ID or a class, we can create an element
+            document.documentElement.getButton("accept").removeAttribute("disabled");
+            this.enableControls(true);
+            return;
+          }
+          document.documentElement.getButton("accept").setAttribute("disabled", "true");
+          this.enableControls(false);
+        ]]>
+        </body>
+      </method>
+
+      <method name="enableControls">
+        <parameter name="aEnable"/>
+        <body>
+        <![CDATA[
+          var allControls = this.getAttribute("controls").split(',');
+          for (var i = 0; i < allControls.length; i++)
+          {
+            var c = allControls[i];
+            var elt = document.getElementById(c);
+            if (elt)
+            {
+              if (aEnable)
+                elt.removeAttribute("disabled");
+              else
+                elt.setAttribute("disabled", "true");
+            }
+          }
+        ]]>
+        </body>
+        
+      </method>
+
+      <method name="pickId">
+        <parameter name="aElt"/>
+        <body>
+        <![CDATA[
+          var prefix;
+          try {
+            // not sure this is needed, but I wanted to reserve user-defined
+            // prefices for future use
+            var useCssPref = GetPrefs().getCharPref("bluegriffon.css.id_prefix");
+          }
+          catch(e) { prefix = "BGelt"; }
+
+          aElt.value = prefix + new Date().valueOf() +
+                            "_" + Math.round(Math.random() * 100000);
+          this.onIdOrClassBoxChange(aElt);
+        ]]>
+        </body>
+      </method>
+
+
+    </implementation>
+  </binding>
+
+</bindings>
diff --git a/base/content/bluegriffon/bindings/ecolorpicker.xml b/base/content/bluegriffon/bindings/ecolorpicker.xml
new file mode 100644 (file)
index 0000000..13759dd
--- /dev/null
@@ -0,0 +1,103 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2008
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<bindings id="ecolorpickerBindings"
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:html="http://www.w3.org/1999/xhtml"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
+
+  <binding id="ecolorpicker">
+
+    <resources>
+      <stylesheet src="chrome://bluegriffon/skin/ecolorpicker.css"/>
+    </resources>
+
+    <content>
+      <xul:hbox class="colorpicker-button-colorbox" anonid="colorbox" flex="1" xbl:inherits="disabled"/>
+    </content>
+
+    <implementation>
+      <constructor>
+        try {
+          Components.utils.import("resource://gre/modules/colourPickerHelper.jsm");
+        } catch (e) {}
+      </constructor>
+
+      <property name="mColorBox"
+                readonly="true"
+                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'colorbox')" />
+
+      <property name="color"
+                onget="return this.getAttribute('color');"
+                onset="this.setAttribute('color', val); this.mColorBox.style.backgroundColor = val;"/>
+
+      <method name="open">
+        <parameter name="aColorObjectId"/>
+        <parameter name="aWindowTitle"/>
+        <parameter name="aShowTransparency"/>
+        <body>
+        <![CDATA[
+          var cph = ColorPickerHelper;
+          cph.openColorPicker(window, aColorObjectId, aWindowTitle, aShowTransparency);
+          if (!cph.isCancelled(aColorObjectId))
+                                 {
+            var currentColor = cph.getCurrentColor(aColorObjectId)
+                                   this.mColorBox.style.backgroundColor = currentColor;
+            this.setAttribute("color", currentColor);
+                                 }
+        ]]>
+        </body>
+      </method>
+    </implementation>
+
+    <handlers>
+      <handler event="click" phase="capturing">
+        <![CDATA[
+          if (!this.getAttribute("disabled"))
+                 this.open(this.getAttribute("colorObjectId"),
+                           this.getAttribute("windowTitle"),
+                           this.getAttribute("showTransparency"));
+        ]]>
+      </handler>
+    </handlers>
+
+  </binding>
+
+</bindings>
diff --git a/base/content/bluegriffon/bindings/filepickerbutton.css b/base/content/bluegriffon/bindings/filepickerbutton.css
new file mode 100644 (file)
index 0000000..8fcd1fb
--- /dev/null
@@ -0,0 +1,19 @@
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+filepickerbutton  {
+  margin: 0px;
+  padding: 0px;
+  list-style-image: url('chrome://bluegriffon/skin/icons/filePicking.png');
+}
+
+filepickerbutton:hover  {
+  margin: 0px;
+  padding: 0px;
+  list-style-image: url('chrome://bluegriffon/skin/icons/filePicking-hover.png');
+}
+
+.toolbarbutton-icon {
+  min-width: 0px;
+  padding: 0px;
+  margin: 2px ! important;
+}
diff --git a/base/content/bluegriffon/bindings/filepickerbutton.xml b/base/content/bluegriffon/bindings/filepickerbutton.xml
new file mode 100644 (file)
index 0000000..d0fc2c4
--- /dev/null
@@ -0,0 +1,144 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2008
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<!DOCTYPE bindings [
+  <!ENTITY % filepickerbuttonDTD SYSTEM "chrome://bluegriffon/locale/filepickerbutton.dtd" >
+  %filepickerbuttonDTD;
+]>
+
+
+<bindings id="filepickerbuttonBindings"
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:html="http://www.w3.org/1999/xhtml"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
+
+  <binding id="filepickerbutton">
+
+    <resources>
+      <stylesheet src="chrome://bluegriffon/content/bindings/filepickerbutton.css"/>
+    </resources>
+
+    <content>
+      <xul:toolbarbutton xbl:inherits="disabled,tooltiptext=title"
+                         anonid="button" />
+      <children/>
+    </content>
+
+    <implementation>
+      <property name="mButton"
+                readonly="true"
+                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'button')" />
+
+      <property name="value"
+                onget="return this.getAttribute('value');"
+                onset="this.setAttribute('value', val);"/>
+
+      <property name="disabled"
+                onget="return this.mButton.getAttribute('disabled');"
+                onset="this.mButton.setAttribute('disabled', val);"/>
+
+      <field name="fp">null</field>
+      <field name="nsIFP">Components.interfaces.nsIFilePicker</field>
+
+      <constructor>
+        <![CDATA[
+          try {
+            this.fp = Components.classes["@mozilla.org/filepicker;1"].
+                        createInstance(this.nsIFP);
+            this.fp.init(window, this.getAttribute("title"),
+                         parseInt(this.getAttribute("mode")));
+          }
+          catch(e) {}
+        ]]>
+      </constructor>
+
+      <method name="appendFilters">
+        <parameter name="aFilter"/>
+        <body>
+        <![CDATA[
+          try {
+            this.fp.appendFilters(aFilter);
+          }
+          catch(e) {}
+        ]]>
+        </body>
+      </method>
+
+      <method name="appendFilter">
+        <parameter name="aTitle"/>
+        <parameter name="aFilter"/>
+        <body>
+        <![CDATA[
+          try {
+            this.fp.appendFilter(aTitle, aFilter);
+          }
+          catch(e) {}
+        ]]>
+        </body>
+      </method>
+
+     </implementation>
+
+    <handlers>
+      <handler event="command" phase="capturing">
+        <![CDATA[
+          try {
+            if (this.fp.show() == this.nsIFP.returnOK &&
+                this.fp.fileURL.spec && this.fp.fileURL.spec.length > 0)
+            {
+              var spec = this.fp.fileURL.spec;
+              if (this.hasAttribute("processor"))
+                spec = eval(this.getAttribute("processor") + "(spec)");
+              this.setAttribute("value", spec);
+              if (this.hasAttribute("control"))
+              {
+                var c = document.getElementById(this.getAttribute("control"));
+                c.value = spec;
+              }
+            }
+          }
+          catch(e) {}
+        ]]>
+      </handler>
+    </handlers>
+
+  </binding>
+
+</bindings>
diff --git a/base/content/bluegriffon/bindings/multistate.css b/base/content/bluegriffon/bindings/multistate.css
new file mode 100644 (file)
index 0000000..641099c
--- /dev/null
@@ -0,0 +1,40 @@
+/* ***** BEGIN LICENSE BLOCK *****
+   * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   *
+   * The contents of this file are subject to the Mozilla Public License Version
+   * 1.1 (the "License"); you may not use this file except in compliance with
+   * the License. You may obtain a copy of the License at
+   * http://www.mozilla.org/MPL/
+   *
+   * Software distributed under the License is distributed on an "AS IS" basis,
+   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   * for the specific language governing rights and limitations under the
+   * License.
+   *
+   * The Original Code is BlueGriffon.
+   *
+   * The Initial Developer of the Original Code is
+   * Disruptive Innovations SARL.
+   * Portions created by the Initial Developer are Copyright (C) 2007
+   * the Initial Developer. All Rights Reserved.
+   *
+   * Contributor(s):
+   *   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   *
+   * Alternatively, the contents of this file may be used under the terms of
+   * either the GNU General Public License Version 2 or later (the "GPL"), or
+   * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   * in which case the provisions of the GPL or the LGPL are applicable instead
+   * of those above. If you wish to allow use of your version of this file only
+   * under the terms of either the GPL or the LGPL, and not to allow others to
+   * use your version of this file under the terms of the MPL, indicate your
+   * decision by deleting the provisions above and replace them with the notice
+   * and other provisions required by the LGPL or the GPL. If you do not delete
+   * the provisions above, a recipient may use your version of this file under
+   * the terms of any one of the MPL, the GPL or the LGPL.
+   *
+   * ***** END LICENSE BLOCK ***** */
+
+state {
+  display: none;
+}
diff --git a/base/content/bluegriffon/bindings/multistate.xml b/base/content/bluegriffon/bindings/multistate.xml
new file mode 100644 (file)
index 0000000..d7b9ac6
--- /dev/null
@@ -0,0 +1,157 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2007
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<bindings id="multistateBindings"
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:html="http://www.w3.org/1999/xhtml"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
+
+  <binding id="multistatebutton">
+
+    <resources>
+      <stylesheet src="chrome://bluegriffon/content/bindings/multistate.css"/>
+    </resources>
+
+    <content>
+      <xul:toolbarbutton xbl:inherits="value,label,image,disabled"
+                  anonid="button"
+                  class="multistate-button"/>
+      <children/>
+    </content>
+
+    <implementation>
+      <property name="mButton"
+                readonly="true"
+                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'button')" />
+
+      <property name="value"
+                onget="return this.mButton.getAttribute('value');"
+                onset="this.mButton.setAttribute('value', val);"/>
+
+      <property name="disabled"
+                onget="return this.mButton.getAttribute('disabled');"
+                onset="this.mButton.setAttribute('disabled', val);"/>
+
+      <constructor>
+        <![CDATA[
+          if (!this.mButton.hasAttribute("value") && this.firstChild)
+            this._adoptNextState(this.firstChild);
+        ]]>
+      </constructor>
+
+      <method name="_isState">
+        <parameter name="aNode"/>
+        <body>
+        <![CDATA[
+          if (!aNode)
+            throw Components.results.NS_ERROR_NULL_POINTER;
+
+          return (aNode.nodeType == Node.ELEMENT_NODE &&
+                  aNode.nodeName == "state" &&
+                  aNode.namespaceURI == "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul")
+        ]]>
+        </body>
+      </method>
+
+      <method name="_adoptNextState">
+        <parameter name="aSeed"/>
+        <body>
+        <![CDATA[
+          var child = aSeed;
+          while (child)
+          {
+            if (this._isState(child))
+            {
+              this._cloneAttributes(child, this.mButton);
+              return true;
+            }
+            child = child.nextSibling;
+          }
+          return false;
+        ]]>
+        </body>
+      </method>
+
+      <method name="_cloneAttributes">
+        <parameter name="aSrc"/>
+        <parameter name="aDest"/>
+        <body>
+        <![CDATA[
+          if (!aSrc || !aDest)
+            throw Components.results.NS_ERROR_NULL_POINTER;
+
+          if (aSrc.nodeType  != Node.ELEMENT_NODE ||
+              aDest.nodeType != Node.ELEMENT_NODE)
+            throw Components.results.NS_ERROR_INVALID_ARG;
+
+          var attributes = aSrc.attributes;
+          for (var i = 0 ; i < attributes.length; i++)
+            aDest.setAttributeNS(attributes[i].namespaceURI,
+                                 attributes[i].localName,
+                                 attributes[i].nodeValue);
+        ]]>
+        </body>
+      </method>
+
+    </implementation>
+
+    <handlers>
+      <handler event="command" phase="capturing">
+        <![CDATA[
+          var done = false;
+          if (this.mButton.hasAttribute("value"))
+          {
+            var states = this.getElementsByAttribute("value", this.value);
+            for (var i = 0 ; i < states.length; i++)
+              if (this._isState(states[i]))
+              {
+                done = this._adoptNextState(states[i].nextSibling);
+                break;
+              }
+          }
+          if (!done)
+            this._adoptNextState(this.firstChild);
+        ]]>
+      </handler>
+    </handlers>
+
+  </binding>
+
+</bindings>
diff --git a/base/content/bluegriffon/bindings/rulers.xml b/base/content/bluegriffon/bindings/rulers.xml
new file mode 100644 (file)
index 0000000..2f1c1d5
--- /dev/null
@@ -0,0 +1,420 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+
+<bindings id="rulersBindings"
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:html="http://www.w3.org/1999/xhtml"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl"
+          xmlns:svg="http://www.w3.org/2000/svg">
+
+  <binding id="ruler-base">
+
+       <implementation>
+
+      <constructor>
+        <![CDATA[
+          NotifierUtils.addNotifierCallback("selection",      this.selectionChanged, this);
+          NotifierUtils.addNotifierCallback("resizeEvent",    this.onResizeEvent, this);
+          NotifierUtils.addNotifierCallback("editorScrolled", this.onEditorScrolled, this);
+        ]]>
+      </constructor>
+
+      <field name="kSVG_NS">"http://www.w3.org/2000/svg"</field>
+
+      <field name="mPos">0</field>
+      <field name="mSize">0</field>
+      <field name="mSource">null</field>
+      <field name="mRulerSeparatorPosition">null</field>
+      <field name="mResizing">false</field>
+      <field name="mRuleSeparator">null</field>
+
+      <method name="onEditorScrolled">
+        <body>
+        <![CDATA[
+          var elt = EditorUtils.getSelectionContainer().node;
+          this.selectionChanged(null, elt, true);
+        ]]>
+        </body>
+      </method>
+
+      <method name="onResizeEvent">
+        <body>
+        <![CDATA[
+          var elt = EditorUtils.getSelectionContainer().node;
+          this.selectionChanged(null, elt, true);
+        ]]>
+        </body>
+      </method>
+
+      <method name="selectionChanged">
+        <parameter name="aArguments"/>
+        <parameter name="aNode"/>
+        <parameter name="aOneElementSelected"/>
+        <body>
+        <![CDATA[
+          var node = aNode;
+          var display = this.getComputedStyle(aNode).getPropertyValue("display");
+          while (node &&
+                 display != "block" &&
+                 display != "inline-block" &&
+                 display != "table" &&
+                 display != "table-cell" &&
+                 display != "list-item" &&
+                 node.nodeName.toLowerCase() != "img")
+          {
+            node = node.parentNode;
+            display = this.getComputedStyle(node).getPropertyValue("display");
+          }
+          this.clean();
+          if (node instanceof Components.interfaces.nsIDOMHTMLTableCellElement)
+          {
+            var child = node;
+            while (child.previousSibling)
+              child = child.previousSibling;
+            while (child)
+            {
+              if (child.nodeType == Node.ELEMENT_NODE)
+                this._showElementRuler(child);
+              child = child.nextSibling;
+            }
+          }
+          else
+            this._showElementRuler(node);
+        ]]>
+        </body>
+      </method>
+
+      <method name="getComputedStyle">
+        <parameter name="aElt"/>
+        <body>
+        <![CDATA[
+          return aElt.ownerDocument.defaultView.getComputedStyle(aElt, "");
+        ]]>
+        </body>
+      </method>
+
+      <property name="mSVGGroup">
+        <getter>
+        <![CDATA[
+          return document.getAnonymousElementByAttribute(this, "anonid", "SVGGroup");
+        ]]>
+        </getter>
+      </property>
+
+      <property name="mHTMLcontainer">
+        <getter>
+        <![CDATA[
+          return document.getAnonymousElementByAttribute(this, "anonid", "HTMLcontainer");
+        ]]>
+        </getter>
+      </property>
+
+      <method name="clean">
+        <body>
+        <![CDATA[
+          var svgGroup = this.mSVGGroup;
+          var child = svgGroup.firstChild;
+          while (child)
+          {
+            var tmp = child.nextSibling;
+            svgGroup.removeChild(child);
+            child = tmp;
+          }
+        ]]>
+        </body>
+      </method>
+
+
+       </implementation>
+  </binding>
+
+  <binding id="hruler" extends="chrome://bluegriffon/content/bindings/rulers.xml#ruler-base">
+    <content>
+        <html:div anonid="HTMLcontainer"
+                                               style="margin: 0px; padding: 0px; width: 100%!important; height: 100%">
+               <svg:svg style="width: 100% ! important; height: 16px;" height="16"
+                                                preserveAspectRatio="xMidYMid meet">
+                       <svg:g anonid="SVGGroup"/>
+                 </svg:svg>
+               </html:div>
+    </content>
+
+    <implementation>
+
+      <field name="mOriginalX">0</field>
+      <field name="mMarginLeft">0</field>
+      <field name="mWidth">0</field>
+
+      <method name="_showElementRuler">
+        <parameter name="aElt"/>
+        <body>
+        <![CDATA[
+          var w = aElt.clientWidth;
+          var x = aElt.offsetLeft + 12;
+          var o = aElt;
+          while (o.offsetParent)
+          {
+            o = o.offsetParent;
+            x += o.offsetLeft;
+          }
+          if (aElt instanceof Components.interfaces.nsIDOMHTMLTableCellElement)
+          {
+            var cs = this.getComputedStyle(aElt);
+            var pl = cs.getPropertyCSSValue("padding-left");
+            var pr = cs.getPropertyCSSValue("padding-right");
+
+            if (pl.primitiveType == CSSPrimitiveValue.CSS_PX)
+            {
+              var plv = pl.getFloatValue(CSSPrimitiveValue.CSS_PX);
+              x += plv;
+              w -= plv;
+            }
+            if (pr.primitiveType == CSSPrimitiveValue.CSS_PX)
+            {
+              var prv = pr.getFloatValue(CSSPrimitiveValue.CSS_PX);
+              w -= prv;
+            }
+          }
+          this.addObject("hruler", x, w, aElt);
+        ]]>
+        </body>
+      </method>
+
+      <property name="mScrollX">
+        <getter>
+        <![CDATA[
+          return EditorUtils.getCurrentEditorElement() ?
+                   EditorUtils.getCurrentEditorElement().contentWindow.scrollX :
+                   0;
+        ]]>
+        </getter>
+      </property>
+
+      <method name="addObject">
+       <parameter name="aName"/>
+       <parameter name="aPos"/>
+       <parameter name="aSize"/>
+       <parameter name="aSource"/>
+        <body>
+        <![CDATA[
+          this.mPos  = aPos;
+          this.mSize = aSize; 
+        
+          var svgGroup = this.mSVGGroup;
+          var realRulerSize = this.mHTMLcontainer.clientWidth;
+          var g = document.createElementNS(this.kSVG_NS, "g");
+
+          var r = document.createElementNS(this.kSVG_NS, "rect")
+          r.setAttribute("x", (100*(aPos-this.mScrollX)/realRulerSize) + "%");
+          r.setAttribute("y", "0");
+          r.setAttribute("width", (100*aSize/realRulerSize) + "%");
+          r.setAttribute("height", "16");
+          r.setAttribute("anonid", "ruler");
+          r.setAttribute("style", "fill: white; stroke-width: 1px; stroke: gray");
+
+          var lH = document.createElementNS(this.kSVG_NS, "rect")
+          lH.setAttribute("x", (100*(aPos-this.mScrollX)/realRulerSize) + "%");
+          lH.setAttribute("y", "0");
+          lH.setAttribute("width", (100*4/realRulerSize) + "%");
+          lH.setAttribute("height", "16");
+          lH.setAttribute("style", "fill: gray; stroke-width: 1px; stroke: gray; cursor: w-resize");
+          lH.setAttribute("ruler-position", aPos-12);
+          lH.setAttribute("ruler-size", aSize);
+          lH.setAttribute("class", "hruler-separator");
+          lH.setAttribute("ruler-separator-position", "left");
+          lH.setUserData("source", aSource, null);
+
+          var rH = document.createElementNS(this.kSVG_NS, "rect")
+          rH.setAttribute("x", (100*(aPos+aSize-4-this.mScrollX)/realRulerSize) + "%");
+          rH.setAttribute("y", "0");
+          rH.setAttribute("width", (100*4/realRulerSize) + "%");
+          rH.setAttribute("height", "16");
+          rH.setAttribute("style", "fill: gray; stroke-width: 1px; stroke: gray; cursor: w-resize");
+          rH.setAttribute("ruler-position", aPos-12);
+          rH.setAttribute("ruler-size", aSize);
+          rH.setAttribute("class", "hruler-separator");
+          rH.setAttribute("ruler-separator-position", "right");
+          rH.setUserData("source", aSource, null);
+
+          var t = document.createElementNS(this.kSVG_NS, "text");
+          t.setAttribute("x", (100*(aPos-this.mScrollX+aSize/2)/realRulerSize) + "%");
+          t.setAttribute("y", "50%");
+
+          var text = document.createTextNode(aSize + "px");
+          t.appendChild(text);
+
+          g.appendChild(r);
+          g.appendChild(lH);
+          g.appendChild(rH);
+          g.appendChild(t);
+          svgGroup.appendChild(g);
+        ]]>
+        </body>
+      </method>
+
+    </implementation>
+
+    <resources>
+      <stylesheet src="chrome://bluegriffon/skin/rulers.css"/>
+    </resources>
+
+    <handlers>
+      <handler event="mousedown">
+        <![CDATA[
+          var elt = event.originalTarget;
+          if (elt.getAttribute("class") != "hruler-separator")
+            return; 
+
+          this.mRulerSeparatorPosition = elt.getAttribute("ruler-separator-position");
+
+          this.mOriginalX = event.clientX; 
+          this.mSource = elt.getUserData("source");
+          this.mMarginLeft = parseFloat(this.getComputedStyle(mSource).getPropertyValue("margin-left"));
+          if (!this.mMarginLeft)
+            this.mMarginLeft = 0; 
+          this.mWidth = this.mSource.clientWidth;
+          this.mRuleSeparator = elt;
+
+          this.mResizing = true;
+        ]]>
+      </handler>
+
+      <handler event="mousemove">
+        <![CDATA[
+          if (!this.mResizing)
+            return;
+
+          var x = event.clientX;
+          var realRulerSize = this.mHTMLcontainer.clientWidth;
+
+          switch (this.mRulerSeparatorPosition)
+          {
+            case "left":
+              this.mRuleSeparator.setAttribute("x",
+                 (100*(this.mPos - this.mOriginalX + x - this.mScrollX)/realRulerSize) + "%");
+              // update main ruler element
+              this.mRuleSeparator.parentNode.firstChild
+                .setAttribute("x", (100*(this.mPos - this.mOriginalX + x- this.mScrollX)/realRulerSize) + "%");
+              this.mRuleSeparator.parentNode.firstChild
+                .setAttribute("width", (100*(this.mSize + this.mOriginalX - x)/realRulerSize) + "%");
+              // update text
+              this.mRuleSeparator.parentNode.lastChild
+                .setAttribute("x", (100*((this.mPos - this.mOriginalX + x- this.mScrollX)+(this.mSize + this.mOriginalX - x)/2)/realRulerSize) + "%");
+              this.mRuleSeparator.parentNode.lastChild.firstChild
+                .data = (this.mSize + this.mOriginalX - x) + "px";
+              break;
+            case "right":
+              this.mRuleSeparator.setAttribute("x",
+                 (100*(this.mPos - this.mOriginalX + x + this.mSize - 4- this.mScrollX)/realRulerSize) + "%");
+              // update main ruler element
+              this.mRuleSeparator.parentNode.firstChild
+                .setAttribute("width", (100*(this.mSize - this.mOriginalX + x)/realRulerSize) + "%");
+              // update text
+              this.mRuleSeparator.parentNode.lastChild
+                .setAttribute("x", (100*(this.mPos - this.mScrollX + (this.mSize - this.mOriginalX + x)/2)/realRulerSize) + "%");
+              this.mRuleSeparator.parentNode.lastChild.firstChild
+                .data = (this.mSize - this.mOriginalX + x) + "px";
+              break;
+            default: break;
+          }
+        ]]>
+      </handler>
+
+      <handler event="mouseup">
+        <![CDATA[
+          if (!this.mResizing)
+            return;
+
+          this.mResizing = false;
+          this.mRuleSeparator = null;
+
+          var x = event.clientX;
+          var realRulerSize = this.mHTMLcontainer.clientWidth;
+          var styleAttrValue = this.mSource.getAttribute("style");
+          if (styleAttrValue)
+            styleAttrValue += ";"
+          else
+            styleAttrValue = "";
+          switch (this.mRulerSeparatorPosition)
+          {
+            case "left":
+              styleAttrValue += "margin-left: " + (this.mMarginLeft - this.mOriginalX +
+                                               x) + "px";
+              styleAttrValue += "; width: " + (this.mWidth  + this.mOriginalX -
+                                          x) + "px";
+              break;
+            case "right":
+              styleAttrValue += "width: " + (this.mWidth  - this.mOriginalX +
+                                          x) + "px";
+              break;
+            default: break;
+          }
+          EditorUtils.getCurrentEditor()
+            .setAttribute(this.mSource, "style", styleAttrValue);
+          this.selectionChanged(null, this.mSource, null);
+        ]]>
+      </handler>
+
+    </handlers>
+
+  </binding>
+
+  <binding id="vruler">
+
+    <content>
+
+        <html:div style="margin:0;padding: 0; width: 100%!important; height: 100%;">
+          <svg:svg style="width: 16px ! important; height: 98%" viewBox="0 0 16 100"
+                   preserveAspectRatio="xMidYMid meet">
+            <svg:g>
+              <svg:text transform="rotate(-90,8,50)" x="50%" y="50%">foo</svg:text>
+            </svg:g>
+          </svg:svg>
+        </html:div>
+
+    </content>
+    <resources>
+      <stylesheet src="chrome://bluegriffon/skin/rulers.css"/>
+    </resources>
+
+  </binding>
+
+</bindings>
diff --git a/base/content/bluegriffon/bindings/sidebar.css b/base/content/bluegriffon/bindings/sidebar.css
new file mode 100644 (file)
index 0000000..1dd7f23
--- /dev/null
@@ -0,0 +1,55 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+sidebar {
+  width: 200px;
+  -moz-box-orient: vertical;
+  -moz-binding: url('chrome://bluegriffon/content/bindings/sidebar.xml#sidebar');
+}
+
+sidebarcontent {
+  -moz-box-orient: vertical;
+  -moz-binding: url('chrome://bluegriffon/content/bindings/sidebar.xml#sidebarcontent');
+  -moz-box-flex: 1;
+}
+
+sidebaritems {
+  -moz-binding: url('chrome://bluegriffon/content/bindings/sidebar.xml#sidebaritems');
+  display: none ! important;
+}
diff --git a/base/content/bluegriffon/bindings/sidebar.xml b/base/content/bluegriffon/bindings/sidebar.xml
new file mode 100644 (file)
index 0000000..bfb0d62
--- /dev/null
@@ -0,0 +1,815 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<!DOCTYPE bindings [
+  <!ENTITY % sidebarDTD SYSTEM "chrome://bluegriffon/locale/sidebar.dtd" >
+  %sidebarDTD;
+]>
+
+<bindings id="sidebarBindings"
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:html="http://www.w3.org/1999/xhtml"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
+
+  <binding id="sidebaritems">
+
+    <resources>
+      <stylesheet src="chrome://bluegriffon/skin/sidebar.css"/>
+    </resources>
+
+    <implementation>
+      <method name="init">
+        <body>
+        <![CDATA[
+          // let's find all sidebaritems living in their own window
+          var items = this.getElementsByAttribute("standalone", "true");
+          for (var i = 0; i < items.length; i++)
+          {
+            var item = items[i];
+            // retrieve all the data it carries
+            var name       = item.getAttribute("name");
+            var properties = item.getAttribute("properties");
+            var src        = item.getAttribute("src");
+            // let's see if we have a localized string for that
+            // item name
+            var label      = item.getAttribute("title");
+
+            // show it
+            window.openDialog("chrome://bluegriffon/content/dialogs/standaloneSidebar.xul","_blank",
+                              "all,dialog=no", name,
+                              label ? label : name, src, item);
+          }
+        ]]>
+        </body>
+      </method>
+
+      <property name="mItems"
+                readonly="true"
+                onget="return this.getElementsByTagName('sidebaritem');" />
+
+      <method name="_getItemsFromName">
+        <parameter name="aName"/>
+        <body>
+        <![CDATA[
+          return this.getElementsByAttribute("name", aName);
+        ]]>
+        </body>
+      </method>
+
+    </implementation>
+
+  </binding>
+
+  <binding id="sidebar">
+
+    <resources>
+      <stylesheet src="chrome://bluegriffon/skin/sidebar.css"/>
+    </resources>
+
+    <content>
+      <xul:hbox align="center" class="titlebox"
+                ondragover="this.parentNode.onDragOver(event, this)"
+                ondragleave="this.parentNode.onDragLeave(this)"
+                ondrop="this.parentNode.onDrop(event)">
+        <xul:toolbarbutton label="&addSidebarContent.label;" class="sidebar-morebutton" type="menu"
+                           tooltiptext="&addSidebarContent.tooltip;">
+          <xul:menupopup onpopupshowing="this.parentNode.parentNode.parentNode._updateMissingSidebarItems(this)"/>
+        </xul:toolbarbutton>
+        <xul:spacer flex="1"/>
+        <xul:toolbarbutton class="sidebar-closebutton"
+                           tooltiptext="&closeSidebar.tooltip;"
+                           oncommand="this.parentNode.parentNode._close()"/>
+      </xul:hbox>
+      <xul:vbox flex="1" anonid="content">
+        <children/>
+      </xul:vbox>
+    </content>
+
+    <implementation>
+
+      <field name="mXUL_NS">"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"</field>
+
+      <field name="mSidebarItems">null</field>
+      <field name="mOtherSidebar">null</field>
+      <field name="mSplitter">null</field>
+
+      <property name="mContents"
+                readonly="true"
+                onget="return this.getElementsByTagName('sidebarcontent');" />
+      <property name="mSplitters"
+                readonly="true"
+                onget="return this.getElementsByTagName('splitter');" />
+
+      <method name="init">
+        <parameter name="aSidebarItems"/>
+        <parameter name="aOtherSidebar"/>
+        <parameter name="aSplitter"/>
+        <body>
+        <![CDATA[
+
+          if (!aSidebarItems)
+            return;
+
+          this.mSidebarItems = aSidebarItems;
+          this.mOtherSidebar = aOtherSidebar;
+          this.mSplitter     = aSplitter;
+
+          // get the list of sidebaritems shown in this sidebar
+          var itemsAttr  = this.getAttribute("sidebaritems");
+          var itemsArray = itemsAttr.split(",");
+          var ordinalIndex = 1;
+          for (var i = 0; i < itemsArray.length; i++)
+          {
+            // sanity case
+            if (itemsArray[i])
+            {
+              // now, find the corresponding sidebaritem
+              var item = aSidebarItems._getItemsFromName(itemsArray[i]).item(0);
+              if (item)
+              {
+                // retrieve all the data it carries
+                var properties = item.getAttribute("properties");
+                var src        = item.getAttribute("src");
+                // the height on the sidebaritem is persistent, and is updated
+                // each time a splitter between sidebarcontent elements is moved
+                var height     = item.getAttribute("height");
+
+                // let's see if we have a localized string for that
+                // item name
+                var label      = item.getAttribute("title");
+
+                // create a sidebarcontent
+                var sidebarcontent = document.createElementNS(this.mXUL_NS, "sidebarcontent");
+                // set the name and the height
+                sidebarcontent.setAttribute("name",  itemsArray[i]);
+                sidebarcontent.setAttribute("height",  height);
+                // append it to the sidebar
+                this.appendChild(sidebarcontent);
+                // and init it
+                sidebarcontent._setLabel(label ? label : itemsArray[i]);
+                // now create the iframe
+                var iframe = document.createElementNS(this.mXUL_NS, "iframe");
+                iframe.setAttribute("flex", "1");
+                iframe.setAttribute("src", src);
+                sidebarcontent.appendChild(iframe);
+                
+                sidebarcontent.setAttribute("ordinal", ordinalIndex++);
+
+                // and this is not the last sidebaritem for this sidebar,
+                // let's add a splitter
+                if (i < itemsArray.length - 1)
+                {
+                  var splitter = document.createElementNS(this.mXUL_NS, "splitter");
+                  // we need to know when the splitter is moved.
+                  splitter.setAttribute("oncommand",
+                                        "this.parentNode._setPersistentHeights()");
+                  // append the splitter to the sidebar
+                  splitter.setAttribute("ordinal", ordinalIndex++);
+                  this.appendChild(splitter);
+                }
+              }
+            }
+          }
+
+        ]]>
+        </body>
+      </method>
+
+      <method name="_setPersistentHeights">
+        <body>
+        <![CDATA[
+
+          // early way out if no sidebaritems
+          if (!this.mSidebarItems)
+            return;
+
+          // browse all sidebarcontent elements in this sidebar
+          var contents = this.mContents;
+          for (var i = 0; i < contents.length; i++)
+          {
+            var child = contents[i];
+            // find their unique identifier
+            var name = child.getAttribute("name");
+            if (name.length)
+            {
+              // find the corresponding sidebaritem
+              var items = this.mSidebarItems._getItemsFromName(name);
+              if (items && items.length)
+              {
+                var item = items[0];
+                // get the sidebarcontent's height and store it in the
+                // sidebaritem
+                item.setAttribute("height", child.getAttribute("height"));
+                // make it persist so we get it back next session
+                document.persist(item.getAttribute("id"), "height");
+              }
+            }
+          }
+
+        ]]>
+        </body>
+      </method>
+
+      <method name="_updatePersistentItemsList">
+        <body>
+        <![CDATA[
+
+          function compare(a, b) {
+            return a.ordinal - b.ordinal;
+          }
+
+          // early way out if no sidebaritems
+          if (!this.mSidebarItems)
+            return;
+
+          // find all sidebarcontents in the current sidebar
+          var contents = this.mContents;
+          if (!contents || !contents.length)
+          {
+            // none, zilch, nada... Make that persist and leave
+            this.setAttribute("sidebaritems", "");
+            document.persist(this, "sidebaritems");
+            return;
+          }
+
+          // make an array storing all sidebarcontents
+          var itemsArray = [];
+          for (var i = 0; i < contents.length; i++)
+            itemsArray.push( contents[i] );
+
+          // sort it by ordinal
+          itemsArray.sort(compare);
+
+          // now rebuild the sidebaritems attribute on the sidebar
+          var newList = "";
+          for (var i = 0; i < itemsArray.length; i++)
+          {
+            var item = itemsArray[i];
+            item.setAttribute("ordinal", i * 2 + 1);
+            if (i)
+              newList += ",";
+            newList += item.getAttribute("name");
+          }
+
+          // store and persist
+          this.setAttribute("sidebaritems", newList);
+          document.persist(this, "sidebaritems");
+
+          // don't forget to update splitters' ordinal !
+          var splitters = this.mSplitters;
+          for (var i = 0; i < splitters.length; i++)
+          {
+            splitters[i].setAttribute("ordinal", i * 2 + 2);
+          }
+
+        ]]>
+        </body>
+      </method>
+
+      <method name="_addToOtherSidebar">
+        <parameter name="aName"/>
+        <parameter name="aTitle"/>
+        <parameter name="aURL"/>
+        <body>
+        <![CDATA[
+          this.mOtherSidebar.addContent(aName, aTitle, aURL);
+        ]]>
+        </body>
+      </method>
+
+      <method name="addContent">
+        <parameter name="aName"/>
+        <parameter name="aTitle"/>
+        <parameter name="aURL"/>
+        <body>
+        <![CDATA[
+          // what should be the default original for this new content ?
+          var ordinalIndex = this.childNodes.length;
+          if (ordinalIndex)
+          {
+            var splitter = document.createElementNS(this.mXUL_NS, "splitter");
+            // we need to know when the splitter is moved.
+            splitter.setAttribute("oncommand",
+                                  "this.parentNode._setPersistentHeights()");
+            // append the splitter to the sidebar
+            splitter.setAttribute("ordinal", ++ordinalIndex);
+            this.appendChild(splitter);
+          }
+
+          // create a sidebarcontent
+          var sidebarcontent = document.createElementNS(this.mXUL_NS, "sidebarcontent");
+          // set the name and the height
+          sidebarcontent.setAttribute("name",  aName);
+          // append it to the sidebar
+          this.appendChild(sidebarcontent);
+          // and init it
+          sidebarcontent._setLabel(aTitle);
+          // now create the iframe
+          var iframe = document.createElementNS(this.mXUL_NS, "iframe");
+          iframe.setAttribute("flex", "1");
+          iframe.setAttribute("src", aURL);
+          sidebarcontent.appendChild(iframe);
+          
+          sidebarcontent.setAttribute("ordinal", ordinalIndex++);
+
+          this._updatePersistentItemsList();
+        ]]>
+        </body>
+      </method>
+
+      <method name="_addSidebarItem">
+        <parameter name="aMenuitem"/>
+        <body>
+        <![CDATA[
+          this.addContent( aMenuitem.getAttribute("name"),
+                            aMenuitem.getAttribute("label"),
+                            aMenuitem.getAttribute("src") );
+        ]]>
+        </body>
+      </method>
+
+      <method name="_updateMissingSidebarItems">
+        <parameter name="aPopup"/>
+        <body>
+        <![CDATA[
+          // early way out if no sidebaritems
+          if (!this.mSidebarItems)
+            return;
+
+          // find all sidebaritems
+          var items = this.mSidebarItems.mItems;
+          var missingItems = {};
+          for (var i = 0; i < items.length; i++)
+          {
+            var item = items[i];
+            var name  = item.getAttribute("name");
+            var title = item.getAttribute("title");
+            var src   = item.getAttribute("src");
+
+            // don't offer to them to a sidebar if they are
+            // already shown in standalone windows
+            if (item.getAttribute("standalone") != "true")
+              missingItems[name] = [ title, src ]
+          }
+
+          // remove from list the ones already in the current sidebar
+          var contents = this.mContents;
+          for (var i = 0; i < contents.length; i++)
+          {
+            var content = contents[i];
+            name = content.getAttribute("name");
+            delete missingItems[name];
+          }
+          // and remove from list the ones already in the other sidebar
+          // if there is one
+          if (this.mOtherSidebar)
+          {
+            contents = this.mOtherSidebar.mContents;
+            for (var i = 0; i < contents.length; i++)
+            {
+              content = contents[i];
+              name = content.getAttribute("name");
+              delete missingItems[name];
+            }
+          }
+
+          // popup cleanup
+          while (aPopup.hasChildNodes())
+            aPopup.removeChild(aPopup.lastChild);
+
+          var empty = true;
+          for (i in missingItems)
+          {
+            empty = false;
+            var menuitem = document.createElementNS(this.mXUL_NS, "menuitem");
+            var label    = missingItems[i][0];
+            menuitem.setAttribute("label", label ? label : i);
+            menuitem.setAttribute("tooltiptext", label ? label : i);
+            menuitem.setAttribute("name",  i);
+            menuitem.setAttribute("src",   missingItems[i][1]);
+            menuitem.setAttribute("oncommand", "this.parentNode.parentNode.parentNode.parentNode._addSidebarItem(this)");
+            aPopup.appendChild(menuitem);
+          }
+          if (empty)
+          {
+            var menuitem = document.createElementNS(this.mXUL_NS, "menuitem");
+            menuitem.setAttribute("label", " -- ");
+            menuitem.setAttribute("disabled", "true");
+            aPopup.appendChild(menuitem);
+          }
+        ]]>
+        </body>
+      </method>
+
+      <method name="_close">
+        <body>
+        <![CDATA[
+          if (this.mSplitter)
+          {
+            this.mSplitter.setAttribute("state", "collapsed");
+            document.persist(this.mSplitter.getAttribute("id"), "state");
+          }
+          else
+            this.setAttribute("collapsed", "true");
+        ]]>
+        </body>
+      </method>
+
+      <method name="onDragOver">
+        <parameter name="aEvent"/>
+        <parameter name="aDropTarget"/>
+        <body>
+        <![CDATA[
+          var sidebar = aDropTarget.parentNode;
+
+          var dt = aEvent.dataTransfer;
+          var hasNode = dt.types.contains("application/x-moz-node");
+          if (hasNode)
+          {
+            var node = dt.mozGetDataAt("application/x-moz-node", 0);
+            if (node.nodeName.toLowerCase() != "sidebarcontent")
+              return;
+
+
+            if (node.parentNode != sidebar)
+            {
+              aDropTarget.setAttribute("style", "background-color: orange");
+              aEvent.preventDefault();
+            }
+          }
+          
+        ]]>
+        </body>
+      </method>
+
+      <method name="onDragLeave">
+        <parameter name="aDropTarget"/>
+        <body>
+        <![CDATA[
+          aDropTarget.removeAttribute("style");
+        ]]>
+        </body>
+      </method>
+
+       <method name="onDrop">
+        <parameter name="aEvent"/>
+        <body>
+        <![CDATA[
+
+          var dt = aEvent.dataTransfer;
+          var e = aEvent.target;
+          while (e && (e.localName.toLowerCase() != "hbox" ||
+                       e.className != "titlebox"))
+            e = e.parentNode;
+          if (!e)
+            return; 
+          var dragSource = dt.mozGetDataAt("application/x-moz-node", 0);
+
+          dragSource._moveToOtherSidebar();
+        ]]>
+        </body>
+      </method>
+    </implementation>
+
+  </binding>
+
+  <binding id="sidebarcontent">
+
+    <resources>
+      <stylesheet src="chrome://bluegriffon/skin/sidebarcontent.css"/>
+    </resources>
+
+    <content>
+      <xul:hbox align="center" class="titlebox" anonid="titlebox"
+                ondragover="this.parentNode.onDragOver(event, this)"
+                ondragleave="this.parentNode.onDragLeave(this)"
+                ondrop="this.parentNode.onDrop(event)">
+        <xul:label ondragstart="this.parentNode.parentNode.onDragStart(event, this.parentNode.parentNode)"
+                   ondragend="this.parentNode.parentNode.onDragEnd(event, this.parentNode.parentNode)"
+                   anonid="name" class="sidebarcontent-name"/>
+        <xul:spacer flex="1"/>
+        <xul:toolbarbutton label="&actions.label;" class="sidebar-arrowbutton" type="menu">
+          <xul:menupopup onpopupshowing="this.parentNode.parentNode.parentNode._updateActionsPopup(this)">
+            <xul:menuitem anonid="detachmenu"
+                          label="&detachMenu.label;"
+                          accesskey="&detachMenu.accesskey;"
+                          oncommand="this.parentNode.parentNode.parentNode.parentNode._detach()" />
+            <xul:menuseparator/>
+            <xul:menuitem anonid="closemenu"
+                          label="&closeMenu.label;"
+                          accesskey="&closeMenu.accesskey;"
+                          oncommand="this.parentNode.parentNode.parentNode.parentNode._close()"/>
+          </xul:menupopup>
+        </xul:toolbarbutton>
+      </xul:hbox>
+      <children/>
+    </content>
+
+    <implementation>
+      <property name="mTitleBox">
+        <getter>
+        <![CDATA[
+          return document.getAnonymousElementByAttribute(this, "anonid", "titlebox");
+        ]]>
+        </getter>
+      </property>
+
+      <property name="mLabel">
+        <getter>
+        <![CDATA[
+          return this.mTitleBox.firstChild;
+        ]]>
+        </getter>
+      </property>
+
+      <property name="mTitle">
+        <getter>
+        <![CDATA[
+          return this.mLabel.value;
+        ]]>
+        </getter>
+      </property>
+
+      <property name="mContent">
+        <getter>
+        <![CDATA[
+          return this.getElementsByTagName("iframe").item(0);
+        ]]>
+        </getter>
+      </property>
+
+      <method name="_updateActionsPopup">
+        <parameter name="aPopup"/>
+        <body>
+        <![CDATA[
+          var isFirst = (this.getAttribute("ordinal") == "1");
+          var isLast  = (this.getAttribute("ordinal") == this.parentNode.childNodes.length);
+          var moveupmenu   = aPopup.getElementsByAttribute("anonid", "moveupmenu")[0];
+          var movedownmenu = aPopup.getElementsByAttribute("anonid", "movedownmenu")[0];
+          moveupmenu.setAttribute("disabled", isFirst);
+          movedownmenu.setAttribute("disabled", isLast);
+          var moveothermenu = aPopup.getElementsByAttribute("anonid", "moveothermenu")[0];
+          if (this.parentNode.mOtherSidebar)
+            moveothermenu.removeAttribute("disabled");
+          else
+            moveothermenu.setAttribute("disabled", "true");
+        ]]>
+        </body>
+      </method>
+
+      <method name="_setLabel">
+        <parameter name="aLabel"/>
+        <body>
+        <![CDATA[
+          this.mLabel.value = aLabel;
+        ]]>
+        </body>
+      </method>
+
+      <method name="_close">
+        <body>
+        <![CDATA[
+          var currentOrdinal  = parseInt(this.getAttribute("ordinal"));
+          var sidebar = this.parentNode;
+          if (currentOrdinal == 1)
+          {
+            // we have a splitter after the current item and we have
+            // to remove it
+            var splitterOrdinal = currentOrdinal + 1;
+            var splitters = this.parentNode.getElementsByAttribute("ordinal", splitterOrdinal);
+            if (splitters && splitters.length)
+              sidebar.removeChild(splitters[0]);
+          }
+          else
+          {
+            // we have a splitter before the current item and we have
+            // to remove it
+            var splitterOrdinal = currentOrdinal - 1;
+            var splitters = this.parentNode.getElementsByAttribute("ordinal", splitterOrdinal);
+            if (splitters && splitters.length)
+              sidebar.removeChild(splitters[0]);
+          }
+          sidebar.removeChild(this);
+
+          sidebar._updatePersistentItemsList();
+        ]]>
+        </body>
+      </method>
+
+      <method name="_move">
+        <parameter name="aOffset"/>
+        <body>
+        <![CDATA[
+          // we always have a splitter before the current element
+          // as we always have another sidebarcontent before the splitter
+          var currentOrdinal  = this.getAttribute("ordinal");
+          var otherOrdinal = parseInt(currentOrdinal) + aOffset;
+          var otherContent = this.parentNode.getElementsByAttribute("ordinal", otherOrdinal).item(0);
+          otherContent.setAttribute("ordinal", currentOrdinal);
+          this.setAttribute("ordinal", otherOrdinal);
+
+          this.parentNode._updatePersistentItemsList();
+        ]]>
+        </body>
+      </method>
+
+      <method name="_moveToOtherSidebar">
+        <body>
+        <![CDATA[
+          var sidebar = this.parentNode;
+          var title = this.mTitle;
+          var src   = this.mContent.getAttribute("src");
+          var name  = this.getAttribute("name");
+
+          // we cannot really move a sidebarcontent from one
+          // sidebar to the other because the iframe's context is
+          // lost anyway
+          //sidebar._addToOtherSidebar(name, title, src);
+
+          // close this one
+          //this._close();
+
+          var ordinalIndex = sidebar.mOtherSidebar.childNodes.length;
+
+          if (ordinalIndex)
+          {
+            var splitter = document.createElementNS(sidebar.mXUL_NS, "splitter");
+            // we need to know when the splitter is moved.
+            splitter.setAttribute("oncommand",
+                                  "this.parentNode._setPersistentHeights()");
+            // append the splitter to the sidebar
+            splitter.setAttribute("ordinal", ++ordinalIndex);
+            sidebar.mOtherSidebar.appendChild(splitter);
+          }
+          this.setAttribute("ordinal", ++ordinalIndex);
+
+          if (this.previousSibling &&
+              this.previousSibling.nodeName.toLowerCase() == "splitter")
+            sidebar.removeChild(this.previousSibling);
+
+          sidebar.mOtherSidebar.appendChild(this);
+          this.setAttribute("name", name);
+          this.mLabel.value = title;
+
+          sidebar._updatePersistentItemsList()
+          sidebar.mOtherSidebar._updatePersistentItemsList();
+        ]]>
+        </body>
+      </method>
+
+      <method name="_detach">
+        <body>
+        <![CDATA[
+          var label = this.mTitle;
+          var name  = this.getAttribute("name");
+          // find the corresponding sidebaritem
+          var sidebar = this.parentNode;
+          var items = sidebar.mSidebarItems._getItemsFromName(name);
+          if (items && items.length)
+          {
+            var item = items[0];
+            // remember that we want this sidebaritem to be floating alone
+            item.setAttribute("standalone", "true");
+            document.persist(item.getAttribute("id"), "standalone");
+
+            var src  = item.getAttribute("src");
+            // make it float, make it float
+            window.openDialog("chrome://bluegriffon/content/dialogs/standaloneSidebar.xul","_blank",
+                              "chrome,modal=no,titlebar,scrollbars=yes,resizable", name, label, src, item);
+
+            // close this one
+            this._close();
+          }
+        ]]>
+        </body>
+      </method>
+
+      <method name="onDragOver">
+        <parameter name="aEvent"/>
+        <parameter name="aDropTarget"/>
+        <body>
+        <![CDATA[
+          var sidebarContent = aDropTarget.parentNode;
+          var dt = aEvent.dataTransfer;
+          var hasNode = dt.types.contains("application/x-moz-node");
+          if (hasNode)
+          {
+            var node = dt.mozGetDataAt("application/x-moz-node", 0);
+            if (node.nodeName.toLowerCase() != "sidebarcontent")
+              return;
+            if (node.getAttribute("name") != aDropTarget.parentNode.getAttribute("name"))
+            {
+              aDropTarget.setAttribute("style", "background-color: orange");
+              aEvent.preventDefault();
+            }
+          }
+        ]]>
+        </body>
+      </method>
+
+      <method name="onDragLeave">
+        <parameter name="aDropTarget"/>
+        <body>
+        <![CDATA[
+          aDropTarget.removeAttribute("style");
+        ]]>
+        </body>
+      </method>
+
+      <method name="onDragStart">
+        <parameter name="aEvent"/>
+        <parameter name="aDragSource"/>
+        <body>
+        <![CDATA[
+
+          var dt = aEvent.dataTransfer;
+          dt.setData("text/plain", aDragSource.mTitle);
+          dt.mozSetDataAt("application/x-moz-node", aDragSource, 0);
+          dt.effectAllowed = "all";
+        ]]>
+        </body>
+      </method>
+
+      <method name="onDragEnd">
+        <parameter name="aEvent"/>
+        <parameter name="aDragSource"/>
+        <body>
+        <![CDATA[
+
+          var dt = aEvent.dataTransfer;
+        ]]>
+        </body>
+      </method>
+
+       <method name="onDrop">
+        <parameter name="aEvent"/>
+        <body>
+        <![CDATA[
+
+          var dt = aEvent.dataTransfer;
+          var e = aEvent.target;
+          while (e && e.nodeName.toLowerCase() != "sidebarcontent")
+            e = e.parentNode;
+          if (!e)
+            return; 
+          var dragSource = dt.mozGetDataAt("application/x-moz-node", 0);
+
+          var sameSidebar = (e.parentNode == dragSource.parentNode);
+          if (!sameSidebar)
+            dragSource._moveToOtherSidebar();
+
+          var offset = ( parseInt(dragSource.getAttribute("ordinal")) <
+                         parseInt(e.getAttribute("ordinal")) ) ?
+                         2 : -2;
+
+          while (parseInt(e.getAttribute("ordinal")) -
+                 parseInt(dragSource.getAttribute("ordinal")) +
+                 offset != 0)
+            dragSource._move(offset);
+
+        ]]>
+        </body>
+      </method>
+
+    </implementation>
+
+  </binding>
+
+</bindings>
diff --git a/base/content/bluegriffon/bindings/structurebar.css b/base/content/bluegriffon/bindings/structurebar.css
new file mode 100644 (file)
index 0000000..65ad7f0
--- /dev/null
@@ -0,0 +1,78 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+structurebar {
+  -moz-binding: url("chrome://bluegriffon/content/bindings/structurebar.xml#structurebar");
+  overflow: -moz-hidden-unscrollable;
+  min-width: 1px;
+  -moz-box-pack: end;
+}
+
+toolbarbutton {
+  padding: 0px;
+}
+
+autorepeatbutton {
+  -moz-border-radius: 3px;
+  width: 1.5em;
+}
+
+.autorepeatbutton-up {
+  margin-right: 1em;
+}
+
+.autorepeatbutton-down {
+  margin-left: 1em;
+}
+
+autorepeatbutton:not([disabled]) {
+  background-color: #e0e0e0;
+}
+
+autorepeatbutton[disabled]:hover,
+autorepeatbutton[disabled]:hover:active {
+  -moz-box-align: center;
+  -moz-box-pack: center;
+  margin-top: 1px;
+  margin-bottom: 2px;
+  -moz-margin-start: 1px;
+  -moz-margin-end: 2px;
+  border: 1px solid transparent;
+  padding: 1px;
+}
diff --git a/base/content/bluegriffon/bindings/structurebar.xml b/base/content/bluegriffon/bindings/structurebar.xml
new file mode 100644 (file)
index 0000000..aba1789
--- /dev/null
@@ -0,0 +1,172 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<!DOCTYPE bindings [
+  <!ENTITY % structurebarDTD SYSTEM "chrome://bluegriffon/locale/structurebar.dtd" >
+  %structurebarDTD;
+]>
+
+<bindings id="structurebarBindings"
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:html="http://www.w3.org/1999/xhtml"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
+
+  <binding id="structurebar" extends="chrome://global/content/bindings/scrollbox.xml#arrowscrollbox">
+
+    <resources>
+      <stylesheet src="chrome://bluegriffon/skin/structurebar.css"/>
+    </resources>
+
+    <implementation>
+
+      <field name="mLastNode">null</field>
+
+      <method name="selectionChanged">
+        <parameter name="aArguments"/>
+        <parameter name="aNode"/>
+        <parameter name="aOneElementSelected"/>
+        <body>
+        <![CDATA[
+          var node = aNode;
+          var toolbarbutton;
+          if (this.mLastNode == node)
+          {
+            // avoid rebuilding the whole structure toolbar if possible
+            toolbarbutton = this.lastChild;
+            while (node && toolbarbutton &&
+                   node == toolbarbutton.getUserData("node") &&
+                   node.nodeName.toLowerCase() != "html")
+            {
+              node = node.parentNode;
+              toolbarbutton = toolbarbutton.previousSibling;
+            }
+            // so we rebuild from toolbarbutton up to the root
+          }
+          else
+          {
+            // the deepest node is not the one the toolbar is currently showing,
+            // so let's clear all
+            this.mLastNode = node;
+            toolbarbutton = this.lastChild;
+          }
+
+          while (toolbarbutton)
+          {
+            var tmp = toolbarbutton.previousSibling;
+            if (toolbarbutton.localName == "toolbarbutton")
+              this.removeChild(toolbarbutton);
+            toolbarbutton = tmp;
+          }
+
+          while (node.nodeName.toLowerCase() != "html")
+          {
+            var newLabel = document.createElement("toolbarbutton");
+
+            var text = "<" + node.nodeName.toLowerCase();
+            if (node.id)
+              text += "#" + node.id;
+            if (node.className)
+              text += "." + node.className.replace( / /g, ".");
+            text += ">"
+
+            newLabel.setAttribute("label",     text);
+            if (aOneElementSelected && aNode == node)
+              newLabel.setAttribute("checked", "true");
+
+            newLabel.setUserData("node", node, null);
+            newLabel.setAttribute("context", "structureBarContextMenu");
+
+            this.insertBefore(newLabel, this.firstChild);
+
+            node = node.parentNode;
+          }
+
+          // make sure the deepest element is visible;
+          // we always have a lastChild here
+          var lastButton = this.lastChild.previousSibling;
+          if (lastButton)
+            this.ensureElementIsVisible(lastButton);
+        ]]>
+        </body>
+      </method>
+
+      <method name="init">
+        <body>
+        <![CDATA[
+          NotifierUtils.addNotifierCallback("selection", this.selectionChanged, this);
+        ]]>
+        </body>
+      </method>
+
+      <method name="shutdown">
+        <body>
+        <![CDATA[
+          NotifierUtils.removeNotifierCallback("selection", this.selectionChanged, this);
+        ]]>
+        </body>
+      </method>
+
+      <method name="selectNode">
+        <parameter name="aNode"/>
+        <body>
+        <![CDATA[
+          var editor = EditorUtils.getCurrentEditor();
+          var node   = aNode.getUserData("node");
+          if (editor && node)
+            editor.selectElement(node);
+        ]]>
+        </body>
+      </method>
+
+    </implementation>
+
+    <handlers>
+      <handler event="command">
+        <![CDATA[
+          var elt = event.target;
+          if (elt.localName == "toolbarbutton")
+            this.selectNode(elt);
+        ]]>
+      </handler>
+    </handlers>
+
+  </binding>
+
+</bindings>
diff --git a/base/content/bluegriffon/bindings/tabeditor.xml b/base/content/bluegriffon/bindings/tabeditor.xml
new file mode 100644 (file)
index 0000000..299ae74
--- /dev/null
@@ -0,0 +1,502 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<!DOCTYPE bindings [
+  <!ENTITY % tabEditorDTD SYSTEM "chrome://bluegriffon/locale/tabeditor.dtd" >
+  %tabEditorDTD;
+]>
+
+<bindings id="tabEditorBindings"
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:html="http://www.w3.org/1999/xhtml"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl"
+          xmlns:svg="http://www.w3.org/2000/svg">
+
+  <binding id="tabeditor">
+
+    <resources>
+      <stylesheet src="chrome://bluegriffon/skin/tabeditor.css"/>
+    </resources>
+
+    <content>
+      <xul:tabbox anonid="EditorTabbox" flex="1" onselect="">
+        <xul:hbox class="tabeditor-strip">
+          <xul:tabs flex="1" anonid="EditorTabs" closebutton="true"
+                    class="tabeditor-tabs"
+                    setfocus="false" onselect="onTabSelected(event, this.parentNode.parentNode)"/>
+        </xul:hbox>
+        <xul:grid flex="1">
+               <xul:columns><xul:column /><xul:column flex="1"/></xul:columns>
+               <xul:rows>
+                       <xul:row>
+                               <xul:spacer/>
+              <xul:hruler anonid="hruler" disabled="true"/>
+                       </xul:row>
+                       <xul:row flex="1">
+                               <xul:vruler anonid="vruler" disabled="true" />
+                               <xul:tabpanels anonid="EditorTabpanels" selectedIndex="0" flex="1" />
+                       </xul:row>
+               </xul:rows>
+        </xul:grid>
+        
+      </xul:tabbox>
+    </content>
+
+    <implementation>
+
+      <property name="mHruler">
+        <getter>
+        <![CDATA[
+          return document.getAnonymousElementByAttribute(this, "anonid", "hruler");
+        ]]>
+        </getter>
+      </property>
+
+      <property name="mVruler">
+        <getter>
+        <![CDATA[
+          return document.getAnonymousElementByAttribute(this, "anonid", "vruler");
+        ]]>
+        </getter>
+      </property>
+
+      <property name="mTabbox">
+        <getter>
+        <![CDATA[
+          return document.getAnonymousElementByAttribute(this, "anonid", "EditorTabbox");
+        ]]>
+        </getter>
+      </property>
+
+      <property name="mTabs">
+        <getter>
+        <![CDATA[
+          return document.getAnonymousElementByAttribute(this, "anonid", "EditorTabs");
+        ]]>
+        </getter>
+      </property>
+
+      <property name="mTabpanels">
+        <getter>
+        <![CDATA[
+          return document.getAnonymousElementByAttribute(this, "anonid", "EditorTabpanels");
+        ]]>
+        </getter>
+      </property>
+
+      <constructor>
+        <![CDATA[
+          this.setAttribute("empty", "true");
+        ]]>
+      </constructor>
+
+      <destructor>
+        <![CDATA[
+          const editors = this.mTabPanels.childNodes;
+          for (var i = 0; i < editors.length; i++)
+          {
+            editors[i].removeEventListener("DOMTitleChanged", this.changeTabTitle, false);
+          }
+        ]]>
+      </destructor>
+
+      <property name="selectedTab">
+        <getter>
+        <![CDATA[
+          return this.mTabbox.selectedTab;
+        ]]>
+        </getter>
+        <setter>
+        <![CDATA[
+          this.mTabbox.selectedTab = val;
+        ]]>
+        </setter>
+      </property>
+
+      <property name="selectedIndex">
+        <getter>
+        <![CDATA[
+          return this.mTabbox.selectedIndex;
+        ]]>
+        </getter>
+        <setter>
+        <![CDATA[
+          this.mTabbox.selectedIndex = val;
+        ]]>
+        </setter>
+      </property>
+
+      <method name="addEditor">
+        <parameter name="aTitle"/>
+        <parameter name="aURL"/>
+        <body>
+          <![CDATA[
+            function EditorContentListener(aTabeditor, aEditor, aURL, aTab)
+            {
+              this.init(aTabeditor, aEditor, aURL, aTab);
+            }
+
+            EditorContentListener.prototype = {
+            
+              init : function(aTabeditor, aEditor, aURL, aTab)
+                {
+                  this.mTabeditor = aTabeditor;
+                  this.mEditor = aEditor;
+                  this.mURL = aURL;
+                  this.mTab = aTab;
+                },
+            
+              QueryInterface : function(aIID)
+                {
+                  if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
+                      aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
+                      aIID.equals(Components.interfaces.nsISupports))
+                    return this;
+                  throw Components.results.NS_NOINTERFACE;
+                },
+            
+              onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus)
+              {
+                const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
+            
+                var progress = document.getElementById("progress");
+                var statusbarDeck = document.getElementById("statusbarDeck");
+            
+                if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST)
+                {
+                  if (aStateFlags & nsIWebProgressListener.STATE_START)
+                  {
+                    this._requestsStarted++;
+                  }
+                  else if (aStateFlags & nsIWebProgressListener.STATE_STOP)
+                  {
+                    this._requestsFinished++;
+                  }
+                  if (this._requestsStarted > 1)
+                  {
+                    var value = (100 * this._requestsFinished) / this._requestsStarted;
+                    if (progress)
+                      progress.setAttribute("mode", "determined");
+                    if (progress)
+                      progress.setAttribute("value", value + "%");
+                  }
+                }
+            
+                if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK)
+                {
+                  if (aStateFlags & nsIWebProgressListener.STATE_START)
+                  {
+                    if (statusbarDeck)
+                      statusbarDeck.selectedPanel = document.getElementById("progressBar");
+                    if (progress)
+                      progress.setAttribute("style", "");
+                    this.mTab.setAttribute("busy", "true");
+                  }
+                  else if (aStateFlags & nsIWebProgressListener.STATE_STOP)
+                  {
+                    if (progress)
+                      progress.setAttribute("style", "display: none");
+                    this.onStatusChange(aWebProgress, aRequest, 0, "Done");
+                    this._requestsStarted = this._requestsFinished = 0;
+
+                    this.mTab.removeAttribute("busy");
+
+                    if (statusbarDeck)
+                      statusbarDeck.selectedPanel = document.getElementById("editorBar");
+
+                    var editor = this.mEditor.getEditor(this.mEditor.contentWindow);
+                    if (editor && !this.mEditorSheets)
+                    {
+                      this.mEditorSheets = true;
+                      editor instanceof Components.interfaces.nsIPlaintextEditor;
+                      editor instanceof Components.interfaces.nsIHTMLEditor;
+                      editor instanceof Components.interfaces.nsIEditorStyleSheets;
+
+                      editor.addOverrideStyleSheet("chrome://bluegriffon/content/EditorContent.css");
+                      editor.addOverrideStyleSheet("chrome://bluegriffon/content/EditorOverride.css");
+
+                      editor.selection.QueryInterface(Components.interfaces.nsISelectionPrivate).
+                        addSelectionListener(ComposerCommands.selectionListener);
+                    }
+                    if (editor)
+                    {
+                      var source = new ActiveSourceTree(this.mEditor);
+                      var sourceElt = source.mSourceTreeXULElement;
+                    }
+                  }
+                  window.updateCommands("navigation");
+                  window.updateCommands("create");
+
+                  NotifierUtils.notify("tabCreated");
+                  RecentPagesHandler.saveRecentFilesPrefs();
+                }
+              },
+            
+
+              onProgressChange : function(aWebProgress, aRequest,
+                                          aCurSelfProgress, aMaxSelfProgress,
+                                          aCurTotalProgress, aMaxTotalProgress)
+                {
+                },
+            
+              onLocationChange : function(aWebProgress, aRequest, aLocation)
+                {
+                },
+            
+              onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage)
+                {
+                  var status = document.getElementById("status");
+                  if (status) status.setAttribute("label", aMessage);
+                },
+            
+              onSecurityChange : function(aWebProgress, aRequest, aState)
+                {
+                },
+            
+                _requestsStarted: 0,
+                _requestsFinished: 0,
+
+                mTabeditor: null,
+                mEditor: null,
+                mEditorSheets: false,
+                mURL: null,
+                mTab: null
+            };
+
+            this.mHruler.removeAttribute("disabled");
+            this.mHruler.addObject("foo", 50, 200);
+            this.mVruler.removeAttribute("disabled");
+
+            var newEditorElement = this._newEditor();
+
+            var newTab = this.mTabs.appendItem(aTitle,
+                           UrlUtils.stripUsernamePassword(aURL, null, null));
+            newTab.setAttribute("label", aTitle);
+            newTab.setAttribute("class", "tabeditor-tab");
+            newTab.setAttribute("maxwidth", 200);
+            newTab.setAttribute("width", 0);
+            newTab.setAttribute("minwidth", 30);
+            newTab.setAttribute("flex", 100);
+            newTab.setAttribute("crop", "end");
+
+            this.mTabpanels.appendChild(newEditorElement);
+
+            newEditorElement.makeEditable("html", true);
+
+            var docShell = newEditorElement.boxObject.QueryInterface(Components.interfaces.nsIEditorBoxObject).docShell;
+            var progress = docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebProgress);
+            var progressListener = new EditorContentListener(this, newEditorElement, aURL, newTab);
+            progress.addProgressListener(progressListener, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
+
+            newEditorElement.addEventListener("pageshow", function(evt) { if (evt.originalTarget == content.document){} }, true);
+            newEditorElement.addEventListener("DOMTitleChanged", this.changeTabTitle, false);
+
+            // select that new tab
+            this.selectedTab = newTab;
+            this.selectedIndex = this.mTabpanels.childNodes.length - 1;
+            window.EditorLoadUrl(newEditorElement, aURL);
+
+            this.setAttribute("visibility", "visible");
+            ComposerCommands.setupFormatCommands();
+
+            return {tab: newTab, panel: newEditorElement};
+          ]]>
+        </body>
+      </method>
+
+      <method name="changeTabTitle">
+        <parameter name="aEvent" />
+        <body>
+        <![CDATA[
+          var e     = aEvent.currentTarget;
+          var title = aEvent.target.title;
+
+          if (/*!e.getEditor(e.contentWindow) &&*/ !title)
+          {
+            title = L10NUtils.getString("untitled");
+          }
+
+          var tabeditor = this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
+          var tabs      = tabeditor.mTabs.childNodes;
+          var editors   = tabeditor.mTabpanels.childNodes;
+          var l = editors.length;
+          for (var i = 0; i < l; i++)
+          {
+            if (editors.item(i) == e)
+            {
+              var tab = tabs.item(i);
+              tab.label = title;
+              return;
+            }
+          }          
+        ]]>
+        </body>
+      </method>
+
+      <method name="stopWebNavigation">
+        <body>
+        <![CDATA[
+          var editor = this.getCurrentEditorElement();
+          var tab    = this.selectedTab;
+          if (tab.hasAttribute("busy"))
+            editor.webNavigation.stop(Components.interfaces.nsIWebNavigation.STOP_ALL);
+        ]]>
+        </body>
+      </method>
+
+      <method name="_newEditor">
+        <body>
+        <![CDATA[
+            var editors = this.mTabpanels.childNodes;
+            for (var i = 0; i < editors.length; i++)
+              editors.item(i).removeAttribute("type");
+
+            var newEditorElement = document.createElement("editor");
+            newEditorElement.setAttribute("editortype", "html");
+            newEditorElement.setAttribute("type", "content-primary");
+
+            return newEditorElement;
+        ]]>
+        </body>
+      </method>
+
+      <method name="getCurrentEditorElement">
+        <body>
+        <![CDATA[
+            return this.mTabpanels.selectedPanel;
+        ]]>
+        </body>
+      </method>
+
+      <method name="IsDocumentAlreadyEdited">
+        <parameter name="aURL"/>
+        <body>
+        <![CDATA[
+            var editors = this.mTabpanels.childNodes;
+            for (var i = 0; i < editors.length; i++)
+            {
+              var editorElt = editors.item(i);
+              var editor = editorElt.getEditor(editorElt.contentWindow);
+              if (editor.document.URL == aURL)
+                return editorElt;
+            }
+            return null;
+        ]]>
+        </body>
+      </method>
+
+      <method name="onTabSelected">
+        <parameter name="aEvent"/>
+        <parameter name="aTabeditor"/>
+        <body>
+        <![CDATA[
+           var activeSourceDeck = document.getElementById("sourceTreeDeck");
+           if (aTabeditor.selectedIndex < activeSourceDeck.childNodes.length)
+             activeSourceDeck.selectedIndex = aTabeditor.selectedIndex;
+
+           var editors = this.mTabpanels.childNodes;
+           for (var i = 0; i < editors.length; i++)
+             editors.item(i).removeAttribute("type");
+
+           this.getCurrentEditorElement().setAttribute("type", "content-primary");
+           window.content.focus();
+           window.updateCommands("navigation");
+           window.updateCommands("style");
+
+           window.UpdateWindowTitle();
+
+           NotifierUtils.notify("tabSelected");
+        ]]>
+        </body>
+      </method>
+
+      <method name="_trimTrailingSlash">
+        <parameter name="aURL" />
+        <body>
+        <![CDATA[
+          if (!aURL)
+            return aURL;
+          if (aURL.charAt(aURL.length - 1) == "/")
+            return aURL.substr(0, aURL.length - 1);
+          return aURL;
+        ]]>
+        </body>
+      </method>
+
+      <method name="isAlreadyEdited">
+        <parameter name="aURL" />
+        <body>
+        <![CDATA[
+          // always accept a new blank document
+          if (UrlUtils.isUrlAboutBlank(aURL))
+            return null;
+
+          var editors = this.mTabpanels.childNodes;
+          var i, l = editors.length;
+          for (i=0; i< l; i++)
+          {
+            var e = editors[i];
+            var elt = e.getEditor(e.contentWindow);
+            if (elt &&
+                this._trimTrailingSlash(elt.document.URL) == this._trimTrailingSlash(aURL))
+              return { index: i, editor: e };
+          }
+          return null;
+        ]]>
+        </body>
+      </method>
+
+      <method name="showCurrentTabAsModified">
+        <parameter name="val" />
+        <body>
+        <![CDATA[
+          if (val)
+            this.selectedTab.setAttribute("modified", "true");
+          else
+            this.selectedTab.removeAttribute("modified");
+        ]]>
+        </body>
+      </method>
+
+    </implementation>
+
+  </binding>
+
+</bindings>
diff --git a/base/content/bluegriffon/blanks/strict.html b/base/content/bluegriffon/blanks/strict.html
new file mode 100644 (file)
index 0000000..6ca2cbf
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+          "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+   <meta content="text/html; charset=us-ascii"
+         http-equiv="content-type">
+   <title></title>
+</head>
+<body>
+  <p><br></p>
+</body>
+</html>
diff --git a/base/content/bluegriffon/blanks/strict.xhtml b/base/content/bluegriffon/blanks/strict.xhtml
new file mode 100644 (file)
index 0000000..0320ea3
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
+  <title></title>
+</head>
+<body>
+  <p><br /></p>
+</body>
+</html>
diff --git a/base/content/bluegriffon/blanks/transitional.html b/base/content/bluegriffon/blanks/transitional.html
new file mode 100644 (file)
index 0000000..96df1b1
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+          "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
+<html>
+<head>
+   <meta content="text/html; charset=us-ascii"
+         http-equiv="content-type">
+   <title></title>
+</head>
+<body>
+  <br>
+</body>
+</html>
diff --git a/base/content/bluegriffon/blanks/transitional.xhtml b/base/content/bluegriffon/blanks/transitional.xhtml
new file mode 100644 (file)
index 0000000..5c221b3
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+   <meta content="text/html; charset=us-ascii"
+         http-equiv="content-type" />
+   <title></title>
+</head>
+<body>
+   <br />
+</body>
+</html>
diff --git a/base/content/bluegriffon/brightness.png b/base/content/bluegriffon/brightness.png
new file mode 100644 (file)
index 0000000..7ab48e6
Binary files /dev/null and b/base/content/bluegriffon/brightness.png differ
diff --git a/base/content/bluegriffon/colourPickerArrow.gif b/base/content/bluegriffon/colourPickerArrow.gif
new file mode 100644 (file)
index 0000000..f3432cb
Binary files /dev/null and b/base/content/bluegriffon/colourPickerArrow.gif differ
diff --git a/base/content/bluegriffon/colourPickerCrosshair.gif b/base/content/bluegriffon/colourPickerCrosshair.gif
new file mode 100644 (file)
index 0000000..aca98c4
Binary files /dev/null and b/base/content/bluegriffon/colourPickerCrosshair.gif differ
diff --git a/base/content/bluegriffon/credits.xhtml b/base/content/bluegriffon/credits.xhtml
new file mode 100644 (file)
index 0000000..36114ff
--- /dev/null
@@ -0,0 +1,355 @@
+<!-- -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Firefox Credits.
+#
+# The Initial Developer of the Original Code is Ben Goodger.
+# Portions created by the Initial Developer are Copyright (C) 2004
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Ben Goodger <ben@mozilla.org>
+#   David Baron <dbaron@mozilla.org>
+#   Daniel Glazman <daniel.glazman@disruptive-innovations.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+-->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+                      "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
+  [
+    <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
+    %brandDTD;
+    <!ENTITY % creditsDTD SYSTEM "chrome://bluegriffon/locale/credits.dtd">
+    %creditsDTD;
+    <!ENTITY % licenseDTD SYSTEM "chrome://global/locale/license.dtd">
+    %licenseDTD;
+  ]
+>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <title>&brandFullName; Credits</title>
+
+    <style>
+      html {
+        background-color: white;
+      }
+
+      * {
+        cursor: default;
+        -moz-user-select: none;
+        /*overflow: hidden;*/
+      }
+
+      #titleBox {
+        position: fixed;
+        left: 0px;
+        top: 0px;
+        right: 0px;
+        bottom: auto;
+        z-index: 999;
+      }
+
+      #footerBox {
+        position: fixed;
+        left: 0px;
+        top: auto;
+        right: 0px;
+        bottom: 0px;
+        z-index: 999;
+      }
+
+      #creditsBox {
+        position: absolute;
+        left: 0px;
+        top: 0px;
+        overflow: hidden;
+        z-index: 1;
+        height: 285px;
+        width: 280px;
+        margin-left: 10px;
+        margin-right: 10px;
+        font-family: Arial, sans-serif;
+        font-size: small;
+      }
+
+      h3 {
+        font-weight: bold;
+        font-size: small;
+        text-align: center;
+        margin: 15px 0px 5px 0px;
+      }
+
+      .creditsGroup {
+        margin-bottom: 1px;
+        text-align: center;
+      }
+
+      .footnote {
+        font-size: x-small;
+        text-align: justify;
+      }
+
+      h2.title {
+        margin-top: 100px;
+        margin-bottom: 200px;
+        text-align: center;
+      }
+
+      .motto {
+        margin-top: 2px;
+        font-style: italic;
+        font-size: small;
+        font-weight: normal;
+        padding-left: 2em;
+      }
+
+      #gecko {
+        margin-top:    100px;
+        margin-bottom: 100px;
+        font-size: medium;
+      }
+
+      a {
+        color: blue;
+        text-decoration: underline;
+      }
+
+      :not(blockquote) > ul {
+        margin-top: 0px;
+        margin-left: 0px;
+        padding-left: 0px;
+      }
+
+      li {
+        list-style-type: none;
+      }
+      
+      blockquote li {
+        list-style-type: square ! important;
+      }
+
+      .center {
+        text-align: center;
+      }
+
+      blockquote {
+        border-left: thin solid silver;
+        padding-left: 2px;
+      }
+    </style>
+
+    <script type="application/x-javascript">
+    <![CDATA[
+
+      var gCreditsInterval = -1;
+
+      function uninit()
+      {
+        if (gCreditsInterval > -1)
+          clearInterval(gCreditsInterval);
+      }
+
+      function init()
+      {
+        var cb = document.getElementById("creditsBox");
+        cb.scrollTop = 0;
+        setTimeout(runCredits, 3000);
+      }
+
+      function runCredits()
+      {
+        gCreditsInterval = setInterval("creditsCallback()", 25);
+      }
+
+      function creditsCallback()
+      {
+        var cb = document.getElementById("creditsBox");
+        var newtop = cb.scrollTop + 1;
+        cb.scrollTop = newtop;
+        if (cb.scrollTop != newtop) {
+          // we're at the bottom
+          clearInterval(gCreditsInterval);
+          setTimeout(function() { cb.scrollTop = 0 }, 3000);
+        }
+      }
+
+      function visitLink(aEvent) {
+        var node = aEvent.target;
+        while (node.nodeType != Node.ELEMENT_NODE)
+          node = node.parentNode;
+        var url = node.getAttribute("link");
+        if (!url)
+          return;
+
+        window.top.openURL(url);
+      }
+
+      function StopScrolling()
+      {
+        if (gCreditsInterval)
+        {
+          clearInterval(gCreditsInterval);
+          gCreditsInterval = 0;
+          window.setCursor("wait");
+        }
+      }
+
+      function StartAgainScrolling()
+      {
+        if (!gCreditsInterval)
+        {
+          gCreditsInterval = setInterval("creditsCallback()", 25);
+          window.setCursor("wait");
+        }
+      }
+    ]]>
+    </script>
+  </head>
+  <body onload="init();" onunload="uninit();">
+
+    <div id="creditsBox" onmouseover="StopScrolling()"
+                         onmouseout="StartAgainScrolling()">
+        <h2 class="title">&brandFullName;
+          <div class="motto">&brandMotto;</div>
+        </h2>
+
+        <div class="creditsGroup">
+          <img src="chrome://bluegriffon/content/DI.png"/>
+        </div>
+
+        <div class="creditsGroup">
+          <h3>&credit.leads;</h3>
+          <ul>
+            <li>Daniel Glazman</li>
+          </ul>
+
+          <h3>&credit.contributors;</h3>
+          <ul>
+            <li>Laurent Jouanneau</li>
+          </ul>
+
+          &credit.translation;
+        </div>
+
+        <p id="gecko" class="center">&credit.poweredByGecko;</p>
+
+        <p class="footnote">
+          &brandFullName;&trade; &tm.part0; Disruptive Innovations SARL.
+        </p>
+        <p class="footnote">
+          &brandFullName;&trade; &license.part0; copyright &copy;1998-2009 &license.part1;
+          &license.contrib;,
+          &license.part2;
+          <a href="chrome://global/content/MPL-1.1.html">Mozilla Public License</a>
+          &license.and;
+          <a href="chrome://global/content/NPL-1.1.html">Netscape Public License</a>&license.part3;</p>
+
+        <p class="footnote">
+          Portions of this software are Copyright &copy;1994 The Regents of the
+          University of California. All Rights Reserved.</p>
+
+        <p class="footnote">The Yahoo! UI Library is copyright (c) 2008, Yahoo! Inc.</p>
+        <blockquote class="footnote">
+                                       <p>Copyright
+                                       (c) 2008, Yahoo! Inc. All rights reserved.</p>
+                                       <p>Redistribution and use of this software in source and binary forms,
+                                       with or without modification, are permitted provided that the following
+                                       conditions are met:</p>
+                                       <ul>
+                                         <li>Redistributions of source
+                                       code must retain the above copyright notice, this list of conditions
+                                       and the following disclaimer.</li>
+                                         <li>Redistributions in binary
+                                       form must reproduce the above copyright notice, this list of conditions
+                                       and the following disclaimer in the documentation and/or other
+                                       materials provided with the distribution.</li>
+                                         <li>Neither the name of Yahoo!
+                                       Inc. nor the names of its contributors may be used to endorse or
+                                       promote products derived from this software without specific prior
+                                       written permission of Yahoo! Inc.</li>
+                                       </ul>
+                                       <p>THIS SOFTWARE IS PROVIDED BY
+                                       THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+                                       IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+                                       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+                                       DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+                                       LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+                                       CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+                                       SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+                                       BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+                                       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+                                       OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+                                       ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
+        </blockquote>
+
+        <p class="footnote">jQuery is copyright (c) 2008 John Resig.</p>
+        <blockquote class="footnote">
+                                       <p>Copyright (c) 2008 John Resig, http://jquery.com/</p>
+                                       <p>Permission is hereby granted, free of charge, to any person obtaining
+                                       a copy of this software and associated documentation files (the
+                                       "Software"), to deal in the Software without restriction, including
+                                       without limitation the rights to use, copy, modify, merge, publish,
+                                       distribute, sublicense, and/or sell copies of the Software, and to
+                                       permit persons to whom the Software is furnished to do so, subject to
+                                       the following conditions:</p>
+                                       <p>The above copyright notice and this permission notice shall be
+                                       included in all copies or substantial portions of the Software.</p>
+                                       <p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+                                       EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+                                       MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+                                       NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+                                       LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+                                       OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+                                       WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
+        </blockquote>
+        <p class="footnote">
+          This software may contain portions that are Copyright &copy;1998-2005
+          SupportSoft, Inc. All Rights Reserved.</p>
+
+        <!--p class="footnote">
+          Mozilla Firefox&trade; and the Firefox logo are trademarks of the Mozilla
+          Foundation. You are not granted rights or licenses to the trademarks
+          of the Mozilla Foundation or any party, including without limitation the
+          Firefox name or logo.</p-->
+
+        <p class="footnote">
+          U.S. GOVERNMENT END USERS. The Software is a &ldquo;commercial item,&rdquo;
+          as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of
+          &ldquo;commercial computer software&rdquo; and &ldquo;commercial computer software
+          documentation,&rdquo; as such terms are used in 48 C.F.R. 12.212 (Sept. 1995).
+          Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through
+          227.7202-4 (June 1995), all U.S. Government End Users acquire the
+          Software with only those rights set forth herein.</p>
+
+    </div>
+
+  </body>
+</html>
+
diff --git a/base/content/bluegriffon/dialogs/insertTable.js b/base/content/bluegriffon/dialogs/insertTable.js
new file mode 100644 (file)
index 0000000..b0e0afd
--- /dev/null
@@ -0,0 +1,283 @@
+
+var gCellID = 12;
+var gActiveEditor = null;
+var gPrefs = null;
+
+function Startup()
+{
+  gActiveEditor = EditorUtils.getCurrentTableEditor();
+  if (!gActiveEditor)
+  {
+    dump("Failed to get active editor!\n");
+    window.close();
+    return;
+  }
+
+  GetUIElements();
+  SetWidthTextBoxMax(null);
+  gDialog.cssToggler.init();
+}
+
+function SetWidthTextBoxMax(aElt)
+{
+  var defaultWidth_unit;
+  if (aElt)
+  {
+    defaultWidth_unit = aElt.getAttribute("value");
+  }
+  else
+  {
+    gPrefs = GetPrefs();
+    if (!gPrefs)
+      return;
+  
+    defaultWidth_unit  = gPrefs.getCharPref("bluegriffon.defaults.table.width_unit");
+  }
+
+  if (defaultWidth_unit == "percentage")
+    gDialog.widthInput.setAttribute("max", "100");
+  else
+    gDialog.widthInput.removeAttribute("max");
+  var foo = gDialog.widthInput.value;
+  gDialog.widthInput.value = foo;
+}
+
+function SelectArea(cell)
+{
+  if (gDialog.sizeSelector.hasAttribute("disabled"))
+    return;
+  var cellID    = cell.id;
+  var numCellID = Number(cellID.substr(1));
+
+  // early way out if we can...
+  if (gCellID == numCellID)
+    return;
+
+  gCellID = numCellID;
+
+  var i, anyCell;
+  for (i = 1; i < 60; i += 10)
+  {
+    anyCell = gDialog["c"+i];
+    while (anyCell)
+    {
+      anyCell.removeAttribute("class");
+      anyCell = anyCell.nextSibling;
+    }
+  }
+
+  for (i = numCellID; i > 0; i -= 10)
+  {
+    anyCell = gDialog["c"+i];
+    while (anyCell)
+    {
+      anyCell.setAttribute("class", "selected");
+      anyCell = anyCell.previousSibling;
+    }
+  }
+  ShowSize();
+}
+
+function ShowSize()
+{
+  var columns  = (gCellID % 10);
+  var rows     = Math.ceil(gCellID / 10);
+  gDialog.sizeLabel.value = rows + " x " + columns;
+}
+
+function CreateRowsAndCells(aTbody, aAttributes)
+{
+  // Create necessary rows and cells for the table
+  for (var i = 0; i < gDialog.rowsInput.value; i++)
+  {
+    var newRow = gActiveEditor.document.createElement("tr");
+    if (newRow)
+    {
+      aTbody.appendChild(newRow);
+      for (var j = 0; j < gDialog.columnsInput.value; j++)
+      {
+        var newCell = gActiveEditor.document.createElement("td");
+        if (aAttributes)
+          for (var k = 0; k < aAttributes.length; k++)
+          {
+            var attr = aAttributes[k];
+            newCell.setAttribute(attr.name, attr.value);
+          }
+        if (newCell)
+        {
+          newRow.appendChild(newCell);
+        }
+      }
+    }
+  }
+}
+
+function onAccept()
+{
+  var wrapping = gDialog.textWrapping.selectedItem.value;
+  var align = gDialog.horizAlignment.value;
+  var valign = gDialog.vertAlignment.value;
+  var cellSpacing = gDialog.cellSpacing.value;
+  var cellPadding = gDialog.cellPadding.value;
+
+  var useCSS = CssUtils.getUseCSSPref();
+
+  gActiveEditor.beginTransaction();
+
+  var tableElement = gActiveEditor.document.createElement("table");
+  var tableBody = gActiveEditor.document.createElement("tbody");
+  
+  if (tableBody)
+  {
+    
+    tableElement.appendChild(tableBody);
+
+    switch(useCSS)
+    {
+      case 0:
+        tableElement.setAttribute("border", gDialog.borderInput.value);
+        tableElement.setAttribute("width", Number(gDialog.widthInput.value) +
+                                            (gDialog.widthPixelOrPercentMenulist.value == "pixels" ? "" : "%"));
+        tableElement.setAttribute("cellpadding", gDialog.cellSpacing.value);
+        tableElement.setAttribute("cellspacing", gDialog.cellPadding.value);
+        {
+          var attributes = [];
+          if (gDialog.horizAlignment.value)
+            attributes.push( { name: "align",
+                               value: gDialog.horizAlignment.value });
+          if (gDialog.vertAlignment.value)
+            attributes.push( { name: "valign",
+                               value: gDialog.vertAlignment.value });
+          if (gDialog.textWrapping.value)
+            attributes.push( { name: "nowrap",
+                               value: "nowrap" });
+        }
+        CreateRowsAndCells(tableBody, attributes);
+        break;
+
+      case 1:
+        {
+          var styleAttr = "width: " + Number(gDialog.widthInput.value) +
+                            (gDialog.widthPixelOrPercentMenulist.value == "pixels" ? "px" : "%") +
+                            ";";
+          styleAttr += "border-spacing: " + gDialog.cellPadding.value + "px;";
+          styleAttr += "border: outset " + gDialog.borderInput.value + "px;";
+          styleAttr += "border-collapse: " + (gDialog.collapseBorders.checked ? "collapse;" : "separat;e");
+          styleAttr += "empty-cells: " + (gDialog.hideEmptyCells.checked ? "hide;" : "show;");
+          styleAttr += "table-layout: " + (gDialog.fixedLayout.checked ? "fixed;" : "auto;");
+          if (gDialog.horizAlignment.value)
+            styleAttr += "text-align:" + gDialog.horizAlignment.value  + ";";
+          tableElement.setAttribute("style", styleAttr);
+
+          styleAttr = "";
+          if (gDialog.vertAlignment.value)
+            styleAttr += "vertical-align: " + gDialog.vertAlignment.value + ";";
+          if (gDialog.textWrapping.value)
+            styleAttr += "white-space: nowrap;";
+          if (gDialog.cellPadding.value)
+            styleAttr += "padding: " + gDialog.cellPadding.value + "px;";
+          if (gDialog.borderInput.value != "0")
+            styleAttr += "border: inset 1px;";
+          if (styleAttr)
+            CreateRowsAndCells(tableBody, [ { name: "style",
+                                              value: styleAttr} ] ); 
+          else
+            CreateRowsAndCells(tableBody, null);
+          
+        }
+        break;
+
+      case 2:
+        {
+          CreateRowsAndCells(tableBody, null);
+          // first, build the selector we're going to use
+          var cssToggler = gDialog.cssToggler;
+          var selectorText = (cssToggler.newID ?   '#' + cssToggler.newID : "") +
+                             (cssToggler.newClass? '.' + cssToggler.newClass : "");
+          var tableProperties = [
+            { priority: false, property: "border",
+              value: "outset " + gDialog.borderInput.value + "px" },
+            { priority: false, property: "border-spacing",
+              value: gDialog.cellPadding.value + "px" },
+            { priority: false, property: "width",
+              value: Number(gDialog.widthInput.value) +
+                       (gDialog.widthPixelOrPercentMenulist.value == "pixels" ? "px" : "%") },
+            { priority: false, property:  "text-align",
+              value: gDialog.horizAlignment.value },
+            { priority: false, property:  "border-collapse",
+              value: (gDialog.collapseBorders.checked ? "collapse" : "separate") },
+            { priority: false, property:  "empty-cells",
+              value: (gDialog.hideEmptyCells.checked ? "hide" : "show") },
+            { priority: false, property:  "table-layout",
+              value: (gDialog.fixedLayout.checked ? "fixed" : "auto") }
+          ];
+          CssUtils.addRuleForSelector(gActiveEditor.document,
+                                      selectorText,
+                                      tableProperties);
+          if (cssToggler.newID)
+            tableElement.setAttribute("id", cssToggler.newID);
+          if (cssToggler.newClass)
+            tableElement.setAttribute("class", cssToggler.newClass);
+
+          var cellProperties = [];
+          if (gDialog.vertAlignment.value)
+            cellProperties.push( { priority: false,
+                                  property: "vertical-align",
+                                  value: gDialog.vertAlignment.value } );
+
+          if (gDialog.textWrapping.value)
+            cellProperties.push( { priority: false,
+                                  property: "white-space",
+                                  value: "nowrap" } );
+
+          if (gDialog.cellPadding.value)
+            cellProperties.push( { priority: false,
+                                  property: "padding",
+                                  value: gDialog.cellPadding.value + "px" } );
+
+          if (gDialog.borderInput.value != "0")
+            cellProperties.push( { priority: false,
+                                  property: "border",
+                                  value: "inset 1px" } );
+          cellSelectorText = selectorText + " > * > tr > *";
+          CssUtils.addRuleForSelector(gActiveEditor.document,
+                                      cellSelectorText + "",
+                                      cellProperties);
+        }
+        break;
+
+      case 3:
+        CreateRowsAndCells(tableBody, null);
+        if (gDialog.cssToggler.reusedID)
+          tableElement.setAttribute("id", gDialog.cssToggler.reusedID);
+        if (gDialog.cssToggler.reusedClass)
+          tableElement.setAttribute("class", gDialog.cssToggler.reusedClass);
+        break;
+
+      default: // we should never hit this one
+        break
+    }
+
+    // true means delete selection when inserting
+    gActiveEditor.insertElementAtSelection(tableElement, true);
+
+
+  }
+  gActiveEditor.endTransaction();
+}
+
+function SelectSize(cell)
+{
+  if (document.documentElement.getButton("accept").hasAttribute("disabled"))
+    return;
+
+  var columns  = (gCellID % 10);
+  var rows     = Math.ceil(gCellID / 10);
+
+  gDialog.rowsInput.value    = rows;
+  gDialog.columnsInput.value = columns;
+
+  onAccept();
+  window.close();
+}
+
diff --git a/base/content/bluegriffon/dialogs/insertTable.xul b/base/content/bluegriffon/dialogs/insertTable.xul
new file mode 100644 (file)
index 0000000..5e5246e
--- /dev/null
@@ -0,0 +1,310 @@
+<?xml version="1.0"?>
+
+<!--
+   - The contents of this file are subject to the Netscape Public
+   - License Version 1.1 (the "License"); you may not use this file
+   - except in compliance with the License. You may obtain a copy of
+   - the License at http://www.mozilla.org/NPL/
+   -  
+   - Software distributed under the License is distributed on an "AS
+   - IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+   - implied. See the License for the specific language governing
+   - rights and limitations under the License.
+   -  
+   - The Original Code is Mozilla Communicator client code, released
+   - March 31, 1998.
+   - 
+   - The Initial Developer of the Original Code is Netscape
+   - Communications Corporation. Portions created by Netscape are
+   - Copyright (C) 1998-2000 Netscape Communications Corporation. All
+   - Rights Reserved.
+   - 
+   - Contributor(s): 
+  -->
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://bluegriffon/skin/insertTable.css" type="text/css"?>
+<?xml-stylesheet href="chrome://bluegriffon/skin/bluegriffonDialogs.css" type="text/css"?>
+
+
+<!DOCTYPE prefwindow SYSTEM "chrome://bluegriffon/locale/insertTable.dtd">
+
+<prefwindow title="&windowTitle.label;"
+    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+    onload = "Startup()"
+    buttons="accept,cancel"
+    style="height: auto"
+    ondialogaccept="return onAccept();"
+    persist="screenX screenY"
+    screenX="24" screenY="24">
+
+  <!-- Methods common to all editor dialogs -->
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/dgid.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/global.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/editorUtils.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/css.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/l10n.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/dialogs/insertTable.js"/>
+
+  <prefpane>
+    <preferences>
+      <preference id="bluegriffon.defaults.table.halign"
+                  name="bluegriffon.defaults.table.halign"
+                  type="string" />
+      <preference id="bluegriffon.defaults.table.valign"
+                  name="bluegriffon.defaults.table.valign"
+                  type="string" />
+      <preference id="bluegriffon.defaults.table.border"
+                  name="bluegriffon.defaults.table.border"
+                  type="string" />
+      <preference id="bluegriffon.defaults.table.rows"
+                  name="bluegriffon.defaults.table.rows"
+                  type="string" />
+      <preference id="bluegriffon.defaults.table.cols"
+                  name="bluegriffon.defaults.table.cols"
+                  type="string" />
+      <preference id="bluegriffon.defaults.table.width"
+                  name="bluegriffon.defaults.table.width"
+                  type="string" />
+      <preference id="bluegriffon.defaults.table.width_unit"
+                  name="bluegriffon.defaults.table.width_unit"
+                  type="string" />
+      <preference id="bluegriffon.defaults.table.text_wrap"
+                  name="bluegriffon.defaults.table.text_wrap"
+                  type="string" />
+      <preference id="bluegriffon.defaults.table.cell_spacing"
+                  name="bluegriffon.defaults.table.cell_spacing"
+                  type="string" />
+      <preference id="bluegriffon.defaults.table.cell_padding"
+                  name="bluegriffon.defaults.table.cell_padding"
+                  type="string" />
+    </preferences>
+
+    <broadcaster id="args" value=""/>
+    <tabbox>
+      <tabs>
+        <tab label="&quicklyTab.label;"/>
+        <tab label="&preciselyTab.label;"/>
+        <tab label="&cellTab.label;"/>
+      </tabs>
+      <tabpanels>
+        <vbox flex="1">
+          <spacer class="spacer" flex="1"/>
+          <grid id="sizeSelector">
+            <columns><column flex="1"/><column/><column flex="1"/></columns>
+            <rows>
+              <row>
+                <spacer/>
+                <hbox>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c1" class="selected"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c2" class="selected"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c3"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c4"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c5"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c6"/>
+                </hbox>
+                <spacer/>
+              </row>
+              <row>
+                <spacer/>
+                <hbox>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c11" class="selected"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c12" class="selected"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c13"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c14"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c15"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c16"/>
+                </hbox>
+                <spacer/>
+              </row>
+              <row>
+                <spacer/>
+                <hbox>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c21"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c22"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c23"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c24"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c25"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c26"/>
+                </hbox>
+                <spacer/>
+              </row>
+              <row>
+                <spacer/>
+                <hbox>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c31"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c32"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c33"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c34"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c35"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c36"/>
+                </hbox>
+                <spacer/>
+              </row>
+              <row>
+                <spacer/>
+                <hbox>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c41"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c42"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c43"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c44"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c45"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c46"/>
+                </hbox>
+                <spacer/>
+              </row>
+              <row>
+                <spacer/>
+                <hbox>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c51"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c52"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c53"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c54"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c55"/>
+                  <label onmouseover="SelectArea(this)" onclick="SelectSize(this)" value=" " id="c56"/>
+                </hbox>
+                <spacer/>
+              </row>
+            </rows>
+          </grid>
+          <hbox align="center">
+            <spacer class="spacer" flex="1"/>
+            <label id="sizeLabel" value="2 x 2"/>
+            <spacer class="spacer" flex="1"/>
+          </hbox>
+          <spacer class="spacer" flex="1"/>
+        </vbox>
+        <vbox>
+          <groupbox><caption label="&size.label;"/>
+            <grid>
+              <columns>
+                <column />
+                <column />
+                <column />
+              </columns>
+              <rows>
+                <row align="center">
+                  <label control="rowsInput" class="align-right"
+                         value="&numRowsEditField.label;"
+                         accesskey="&numRowsEditField.accessKey;"/>
+                  <textbox value="2"
+                           type="number"
+                           id="rowsInput"
+                           preference="bluegriffon.defaults.table.rows"/>
+  
+                  <spacer/>
+                </row>
+                <row align="center">
+                  <label control="columnsInput" class="align-right"
+                         value="&numColumnsEditField.label;"
+                         accesskey="&numColumnsEditField.accessKey;"/>
+                  <textbox value="2"
+                           type="number"
+                           id="columnsInput" 
+                           preference="bluegriffon.defaults.table.cols"/>
+                  <spacer/>
+                </row>
+                <row align="center">
+                  <label control="widthInput" class="align-right"
+                         value="&widthEditField.label;"
+                         accesskey="&widthEditField.accessKey;"/>
+                  <textbox value="100"
+                           type="number"
+                           min="0"
+                           preference="bluegriffon.defaults.table.width"
+                           id="widthInput"/>
+                  <menulist id="widthPixelOrPercentMenulist" flex="1"
+                            preference="bluegriffon.defaults.table.width_unit">
+                    <menupopup>
+                      <menuitem label="%"  value="percentage" oncommand="SetWidthTextBoxMax(this)" />
+                      <menuitem label="&pixels.label;" value="pixels" oncommand="SetWidthTextBoxMax(this)" />
+                    </menupopup>
+                  </menulist>
+                </row>
+              </rows>
+            </grid>
+            <spacer class="spacer"/>
+          </groupbox>
+          <spacer class="spacer"/>
+          <hbox align="center">
+            <label control="borderInput" class="align-right"
+                value="&borderEditField.label;"
+                accesskey="&borderEditField.accessKey;"
+                tooltiptext="&borderEditField.tooltip;" />
+            <textbox value="1"
+                     type="number"
+                     id="borderInput"
+                     preference="bluegriffon.defaults.table.border"/>
+            <label value="&pixels.label;"/>
+          </hbox>
+        </vbox>
+        <grid>
+          <columns><column/><column/></columns>
+          <rows>
+            <row align="center">
+              <label value="&horizAlignment.label;" id="horizAlignmentLabel"/>
+              <menulist id="horizAlignment"
+                        preference="bluegriffon.defaults.table.halign">
+                <menupopup>
+                  <menuitem label="&unspecifiedHAlignment.label;" value=""/>
+                  <menuitem label="&leftHAlignment.label;"        value="left"/>
+                  <menuitem label="&centerHAlignment.label;"      value="center"/>
+                  <menuitem label="&rightHAlignment.label;"       value="right"/>
+                </menupopup>
+              </menulist>
+            </row>
+            <row align="center">
+              <label value="&vertAlignment.label;" id="vertAlignmentLabel"/>
+              <menulist id="vertAlignment"
+                        preference="bluegriffon.defaults.table.valign">
+                <menupopup>
+                  <menuitem label="&unspecifiedVAlignment.label;" value=""/>
+                  <menuitem label="&topVAlignment.label;"         value="top"/>
+                  <menuitem label="&middleVAlignment.label;"      value="middle"/>
+                  <menuitem label="&bottomVAlignment.label;"      value="bottom"/>
+                </menupopup>
+              </menulist>
+            </row>
+            <row align="center">
+              <label value="&textWrapping.label;" id="textWrappingLabel"/>
+              <radiogroup id="textWrapping" orient="horizontal"
+                          preference="bluegriffon.defaults.table.text_wrap" >
+                <radio id="wrapRadio"   label="&wrapWrapping.label;"       value=""/>
+                <radio id="nowrapRadio" label="&nowrapWrapping.label;" value="nowrap"/>
+              </radiogroup>
+            </row>
+            <row align="center">
+              <label value="&cellSpacing.label;"/>
+              <hbox>
+                <textbox value="2" type="number" id="cellSpacing" oninput="forceInteger(this.id);"
+                         preference="bluegriffon.defaults.table.cell_spacing" />
+                <label value="&pixels.label;"/>
+              </hbox>
+            </row>
+            <row align="center">
+              <label value="&cellPadding.label;"/>
+              <hbox>
+                <textbox value="2" type="number" id="cellPadding" oninput="forceInteger(this.id);"
+                         preference="bluegriffon.defaults.table.cell_padding" />
+                <label value="&pixels.label;"/>
+              </hbox>
+  
+            </row>
+          </rows>
+        </grid>
+      </tabpanels>
+    </tabbox>
+    <csstoggler id="cssToggler"
+                controls="sizeSelector">
+      <groupbox orient="vertical">
+        <caption label="&cssExtras.label;"/>
+        <checkbox id="collapseBorders"
+                  label="&collapseBorders.label;"/>
+        <checkbox id="hideEmptyCells"
+                  label="&hideEmptyCells.label;"/>
+        <checkbox id="fixedLayout"
+                  label="&fixedLayout.label;"/>
+      </groupbox>
+    </csstoggler>
+  </prefpane>
+</prefwindow>
diff --git a/base/content/bluegriffon/dialogs/languages.js b/base/content/bluegriffon/dialogs/languages.js
new file mode 100644 (file)
index 0000000..640e092
--- /dev/null
@@ -0,0 +1,131 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+var gNode = null;
+var gOkButton = null;
+var returnValue = null;
+
+ function Startup()
+{
+  if (!window.arguments)
+    return;
+
+  var parameter = window.arguments[0];
+
+  GetUIElements();
+  BGLanguagesHelper.init();
+
+  if (parameter instanceof Element)
+  {
+    gNode = parameter;
+    gDialog.clearSubtree.removeAttribute("hidden");
+
+    if (gNode.hasAttribute("lang"))
+    {
+      var lang = gNode.getAttribute("lang");
+      var kids = gDialog.languageListBox.getElementsByAttribute("value", lang);
+      if (kids && kids.item(0))
+        gDialog.currentLanguage.value = kids[0].getAttribute("label");
+      else
+        gDialog.currentLanguage.value = lang;
+    }
+    else
+      gDialog.currentLanguageBox.setAttribute("hidden", "true");
+
+    window.sizeToContent();
+  }
+  else
+    returnValue = window.arguments[1];
+  gOkButton = document.documentElement.getButton("accept");
+  gOkButton.setAttribute("disabled", "true");
+}
+
+function onAccept()
+{
+  var lang = null;
+  if (gDialog.otherTextBox.value)
+    lang = gDialog.otherTextBox.value;
+  else
+    lang = gDialog.languageListBox.value;
+
+  if (gNode)
+  {
+    var editor = EditorUtils.getCurrentEditor();
+    var clearSubtree = gDialog.clearSubtree.checked;
+    if (clearSubtree)
+      editor.beginTransaction();
+
+    editor.setAttribute(gNode, "lang", lang);
+
+    if (clearSubtree)
+    {
+      var elementsHavingLang = gNode.querySelectorAll("*[lang]");
+      for (var i = 0; i < elementsHavingLang.length; i++)
+        editor.removeAttribute(elementsHavingLang[i], "lang");
+    }
+
+    if (clearSubtree)
+      editor.endTransaction();
+  }
+  else
+    returnValue.lang = lang;
+}
+
+function onListboxSelect()
+{
+  try {
+    if (gDialog.languageListBox.value)
+      gOkButton.removeAttribute("disabled");
+  }
+  catch(e) {}
+}
+
+function onTextboxInput()
+{
+  try {
+    if (gDialog.otherTextBox.value)
+      gOkButton.removeAttribute("disabled");
+    else
+    {
+      if (gDialog.languageListBox.value)
+        gOkButton.removeAttribute("disabled");
+      else
+        gOkButton.setAttribute("disabled", "true");
+    }
+  }
+  catch(e) {}
+}
diff --git a/base/content/bluegriffon/dialogs/languages.xul b/base/content/bluegriffon/dialogs/languages.xul
new file mode 100644 (file)
index 0000000..70ff632
--- /dev/null
@@ -0,0 +1,76 @@
+<?xml version="1.0"?>
+
+<!--
+   - The contents of this file are subject to the Netscape Public
+   - License Version 1.1 (the "License"); you may not use this file
+   - except in compliance with the License. You may obtain a copy of
+   - the License at http://www.mozilla.org/NPL/
+   -  
+   - Software distributed under the License is distributed on an "AS
+   - IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+   - implied. See the License for the specific language governing
+   - rights and limitations under the License.
+   -  
+   - The Original Code is Mozilla Communicator client code, released
+   - March 31, 1998.
+   - 
+   - The Initial Developer of the Original Code is Netscape
+   - Communications Corporation. Portions created by Netscape are
+   - Copyright (C) 1998-2000 Netscape Communications Corporation. All
+   - Rights Reserved.
+   - 
+   - Contributor(s): 
+  -->
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://bluegriffon/skin/languages.css" type="text/css"?>
+<?xml-stylesheet href="chrome://bluegriffon/skin/bluegriffonDialogs.css" type="text/css"?>
+
+<!DOCTYPE dialog SYSTEM "chrome://bluegriffon/locale/languages.dtd">
+
+<dialog title="&window.title;"
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        onload="Startup()"
+        buttons="accept,cancel"
+        ondialogaccept="return onAccept();"
+        persist="screenX screenY"
+        screenX="24" screenY="24">
+
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/dgid.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/global.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/editorUtils.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/css.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/l10n.js"/>
+  <script type="application/javascript"   src="chrome://bluegriffon/content/js/languages.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/dialogs/languages.js"/>
+
+  <stringbundleset id="languageSet">
+    <stringbundle id="bundleRegions"      src="chrome://global/locale/regionNames.properties"/>
+    <stringbundle id="bundleLanguages"    src="chrome://global/locale/languageNames.properties"/>
+    <stringbundle id="bundlePreferences"  src="chrome://bluegriffon/locale/language.properties"/>
+    <stringbundle id="bundleAccepted"     src="resource://gre/res/language.properties"/>
+  </stringbundleset>
+
+  <hbox align="center" id="currentLanguageBox">
+    <label value="&currentLanguage.label;"/>
+    <label id="currentLanguage"/>
+  </hbox>
+
+  <label value="&languagesList.label;" />
+
+  <listbox id="languageListBox" rows="8" seltype="single"
+           onselect="onListboxSelect()" />
+
+  <hbox align="center">
+    <label value="&others.label;"
+           accesskey="&others.accesskey;"
+           control="otherTextBox" />
+    <textbox id="otherTextBox"
+             oninput="onTextboxInput()" />
+    <label value="&examples.label;"/>
+  </hbox>
+  <checkbox id="clearSubtree"
+            hidden="true"
+            checked="true"
+            label="&clearSubtree.label;"/>
+</dialog>
\ No newline at end of file
diff --git a/base/content/bluegriffon/dialogs/markupCleaner.js b/base/content/bluegriffon/dialogs/markupCleaner.js
new file mode 100644 (file)
index 0000000..22893b2
--- /dev/null
@@ -0,0 +1,62 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Nvu.
+ *
+ * The Initial Developer of the Original Code is
+ * Linspire Inc..
+ * Portions created by the Initial Developer are Copyright (C) 2004
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman (glazman@disruptive-innovations.com), on behalf of Linspire Inc.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+function Startup()
+{
+  GetUIElements();
+}
+
+function RunCleanup()
+{
+  return MarkupCleaner.runCleanup(ClearReport, IncreaseReport);
+}
+
+function IncreaseReport(report)
+{
+  var reportValue = Number(report.value) + 1;
+  report.value = reportValue;
+}
+
+function ClearReport(report, checkbox)
+{
+  if (report)
+    if (checkbox && checkbox.checked)
+      report.setAttribute("value", "0");
+    else
+      report.setAttribute("value", " ");
+}
+
diff --git a/base/content/bluegriffon/dialogs/markupCleaner.xul b/base/content/bluegriffon/dialogs/markupCleaner.xul
new file mode 100644 (file)
index 0000000..b904148
--- /dev/null
@@ -0,0 +1,90 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is Nvu.
+   -
+   - The Initial Developer of the Original Code is
+   - Linspire Inc..
+   - Portions created by the Initial Developer are Copyright (C) 2004
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman <glazman@disruptive-innovations.com>, on behalf of Linspire Inc.
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+
+<!DOCTYPE dialog SYSTEM "chrome://bluegriffon/locale/markupCleaner.dtd">
+
+<dialog id="markupCleanerDlg" title="&window.title;"
+   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+   buttons="accept,cancel"
+   onload="Startup();"
+   buttonlabelaccept="&cleanUp.label;"
+   ondialogaccept="return RunCleanup();">
+
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/dgid.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/global.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/editorUtils.js"/>
+
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/js/markupCleaner.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/dialogs/markupCleaner.js"/>
+  
+  <broadcaster id="args" value=""/>
+  <spacer id="location" offsetY="50" persist="offsetX offsetY"/>
+
+  <vbox>
+    <grid>
+      <columns><column flex="1"/><column/></columns>
+      <rows>
+        <row align="center" style="border-bottom: ridge thin">
+          <label value="&actionColumnHeader.label;"/>
+          <label value="&reportColumnHeader.label;"/>
+        </row>
+
+        <row align="center">
+          <checkbox checked="true" id="nestedListsCheckbox" label="&nestedLists.label;"/>
+          <label value=" " id="nestedListsReport"/>
+        </row>
+        <row align="center">
+          <checkbox checked="true" id="trailinBRCheckbox" label="&trailingBR.label;"/>
+          <label value=" " id="trailinBRReport"/>
+        </row>
+        <row align="center">
+          <checkbox checked="true" id="emptyBlocksCheckbox" label="&emptyBlocks.label;"/>
+          <label value=" " id="emptyBlocksReport"/>
+        </row>
+        <row align="center">
+          <checkbox checked="true" id="emptyCellsCheckbox" label="&emptyCells.label;"/>
+          <label value=" " id="emptyCellsReport"/>
+        </row>
+      </rows>
+    </grid>
+  </vbox>
+  <separator class="groove"/>
+</dialog>
diff --git a/base/content/bluegriffon/dialogs/newPageWizard.js b/base/content/bluegriffon/dialogs/newPageWizard.js
new file mode 100644 (file)
index 0000000..aa4a462
--- /dev/null
@@ -0,0 +1,568 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+Components.utils.import("resource://gre/modules/colourPickerHelper.jsm");
+
+var gFpb = null;     // file picker
+var gPreview = null; // preview iframe for colors
+var gAuthor = "";
+var gDescription = "";
+var gKeywords = "";
+var gRootElement;
+var gTitleWasEdited = false;
+var gAuthorWasEdited = false;
+var gDescriptionWasEdited = false;
+var gKeywordsWasEdited = false;
+var gLanguageWasEdited = false;
+var gPrefs;
+
+var gUseSystemColors = true;
+
+var gHorizPosition = "50%";
+var gVertPosition = "50%";
+
+function Startup()
+{
+  GetUIElements();
+
+  var gFpb = gDialog["filepickerbutton"];
+  if (gFpb)
+    gFpb.appendFilters(Components.interfaces.nsIFilePicker.filterImages);
+
+  gPreview = gDialog["pagePreview"];
+
+  gRootElement = EditorUtils.getCurrentEditor().rootElement;
+  InitDialog();
+
+  SetTextboxFocus(gDialog.pageTitle);
+}
+
+function InitDialog()
+{
+  gDialog.pageTitle.value = EditorUtils.getDocumentTitle();
+  try {
+    // Fill in with value from editor prefs
+    gPrefs = GetPrefs();
+    if (gPrefs) 
+      gAuthor = gPrefs.getCharPref("bluegriffon.author");
+  }
+  catch(e) {}
+  // if we still have no author name, use the system username if any
+  if (!gAuthor)
+    try {
+      gAuthor = Components.classes["@mozilla.org/userinfo;1"]
+                  .getService(Components.interfaces.nsIUserInfo).username;
+    }
+    catch(e) {}
+  gDialog.pageAuthor.value = gAuthor;
+
+  // COLORS
+  gUseSystemColors = gPrefs.getBoolPref("bluegriffon.display.use_system_colors");
+  gForegroundColor = gPrefs.getCharPref("bluegriffon.display.foreground_color");
+  gBackgroundColor = gPrefs.getCharPref("bluegriffon.display.background_color");
+  gActiveColor = gPrefs.getCharPref("bluegriffon.display.active_color");
+  gAnchorColor = gPrefs.getCharPref("bluegriffon.display.anchor_color");
+  gVisitedColor = gPrefs.getCharPref("bluegriffon.display.visited_color");
+  gDialog.underlineLinks.checked = gPrefs.getBoolPref("bluegriffon.display.underline_links");
+  gDialog.userDefinedColors.checked = !gUseSystemColors;
+  EnableUserDefinedColorsControls();
+}
+
+function EnableUserDefinedColorsControls()
+{
+  var enabled = gDialog.userDefinedColors.checked;
+  gDialog.backgroundColorColorpicker.color = (enabled ? gBackgroundColor : "transparent");
+  gDialog.textColorColorpicker.color = (enabled ? gForegroundColor : "transparent");
+  gDialog.linksColorColorpicker.color = (enabled ? gAnchorColor : "transparent");
+  gDialog.activeLinksColorColorpicker.color = (enabled ? gActiveColor : "transparent");
+  gDialog.visitedLinksColorColorpicker.color = (enabled ? gVisitedColor : "transparent");
+
+  gDialog.pagePreview.style.backgroundColor = enabled ? gBackgroundColor : "#ffffff";
+  gDialog.textPreview.style.color = enabled ? gForegroundColor : "#000000";
+  gDialog.linksPreview.style.color = enabled ? gAnchorColor : "#0000ee";
+  gDialog.activeLinksPreview.style.color = enabled ? gActiveColor : "#ee0000";
+  gDialog.visitedLinksPreview.style.color = enabled ? gVisitedColor : "#551a8b";
+
+  var underline = gDialog.underlineLinks.checked || !enabled;
+  gDialog.linksPreview.style.textDecoration = underline ? "underline" : "none";
+  gDialog.activeLinksPreview.style.textDecoration = underline ? "underline" : "none";
+  gDialog.visitedLinksPreview.style.textDecoration = underline ? "underline" : "none";
+  
+  SetEnabledElement(gDialog.backgroundColorColorpickerLabel, enabled);
+  SetEnabledElement(gDialog.backgroundColorColorpicker, enabled);
+  SetEnabledElement(gDialog.textColorColorpickerLabel, enabled);
+  SetEnabledElement(gDialog.textColorColorpicker, enabled);
+  SetEnabledElement(gDialog.linksColorColorpickerLabel, enabled);
+  SetEnabledElement(gDialog.linksColorColorpicker, enabled);
+  SetEnabledElement(gDialog.activeLinksColorColorpickerLabel, enabled);
+  SetEnabledElement(gDialog.activeLinksColorColorpicker, enabled);
+  SetEnabledElement(gDialog.visitedLinksColorColorpickerLabel, enabled);
+  SetEnabledElement(gDialog.visitedLinksColorColorpicker, enabled);
+  SetEnabledElement(gDialog.textPreview, enabled);
+  SetEnabledElement(gDialog.linksPreview, enabled);
+  SetEnabledElement(gDialog.activeLinksPreview, enabled);
+  SetEnabledElement(gDialog.visitedLinksPreview, enabled);
+  SetEnabledElement(gDialog.underlineLinks, enabled);
+}
+
+function onColorChange(aColorPicker)
+{
+  switch (aColorPicker.id)
+  {
+    case "backgroundColorColorpicker":
+      gBackgroundColor = aColorPicker.color;
+      break;
+    case "textColorColorpicker":
+      gForegroundColor = aColorPicker.color;
+      break;
+    case "linksColorColorpicker":
+      gAnchorColor = aColorPicker.color;
+      break;
+    case "activeLinksColorColorpicker":
+      gActiveColor = aColorPicker.color;
+      break;
+    case "visitedLinksColorColorpicker":
+      gVisitedColor = aColorPicker.color;
+      break;
+    default: break;  // sanity code
+  }
+  EnableUserDefinedColorsControls();
+}
+
+var gColorPicker = {};
+
+function OpenColorDialog(aElt, aColorObjectId)
+{
+  switch(aElt.id)
+  {
+    case "backgroundColorColorpicker":
+      ColorPickerHelper.openColorPickerPanel("backgroundColor", "", true,
+                                             "colorPickerPopup",
+                                             "colorPickerSheetIFrame",
+                                             aElt);
+      break;
+    default:
+      break;
+  }
+}
+
+function SelectLanguage(aElt)
+{
+  var retValue = { lang: "" };
+  window.openDialog("chrome://bluegriffon/content/dialogs/languages.xul","_blank",
+                    "chrome,modal=no,dialog=yes,titlebar", null, retValue);
+  gDialog.pageLanguage.value = retValue.lang;
+}
+
+function ShowBackgroundPosition(aEvent)
+{
+  var x = aEvent.screenX  - gDialog.backgroundPositionBox.boxObject.screenX;
+  var y = aEvent.screenY + 1 - gDialog.backgroundPositionBox.boxObject.screenY;
+  if (x < 0 || y < 0 || x > 100 | y > 100)
+    ExitBackgroundPosition(aEvent);
+
+  gDialog.horizPosition.value = x + "%";
+  gDialog.vertPosition.value  = y + "%";
+  gDialog.horizPosition.style.color = "";
+  gDialog.vertPosition.style.color = "";
+  gDialog.horizPosition.style.fontWeight = "";
+  gDialog.vertPosition.style.fontWeight = "";
+  gDialog.backgroundPositionBox.style.backgroundPosition = (100-x) + "% " + (100-y) +"%";
+}
+
+function SetBackgroundPosition(aEvent)
+{
+  var x = aEvent.screenX  - gDialog.backgroundPositionBox.boxObject.screenX;
+  var y = aEvent.screenY + 1 - gDialog.backgroundPositionBox.boxObject.screenY;
+  if (x < 0 || y < 0 || x > 100 | y > 100)
+    ExitBackgroundPosition(aEvent);
+
+  ShowBackgroundPosition(aEvent)
+
+  gDialog.horizPosition.style.color = "red";
+  gDialog.vertPosition.style.color = "red";
+  gDialog.horizPosition.style.fontWeight = "bold";
+  gDialog.vertPosition.style.fontWeight = "bold";
+  gHorizPosition = gDialog.horizPosition.value;
+  gVertPosition = gDialog.vertPosition.value;
+  gDialog.backgroundImageBox.style.backgroundPosition = gHorizPosition + " " + gVertPosition;
+}
+
+function ExitBackgroundPosition(event)
+{
+  gDialog.horizPosition.value = gHorizPosition;
+  gDialog.vertPosition.value  = gVertPosition;
+  gDialog.horizPosition.style.color = "";
+  gDialog.vertPosition.style.color = "";
+  gDialog.horizPosition.style.fontWeight = "";
+  gDialog.vertPosition.style.fontWeight = "";
+  var x = parseInt(gHorizPosition);
+  var y = parseInt(gVertPosition);
+  gDialog.backgroundPositionBox.style.backgroundPosition = (100-x) + "% " + (100-y) +"%";
+}
+
+function SetBackgroundRepeat(aElt)
+{
+  gDialog.backgroundImageBox.style.backgroundRepeat = aElt.value;
+}
+
+function onUsePageLayoutChanged(aCheckbox)
+{
+  var enabled = aCheckbox.checked;
+  SetEnabledElementAndControl(gDialog.LayoutTypeMenulistLabel, enabled);
+  SetEnabledElementAndControl(gDialog.LayoutSubtypeMenulistLabel, enabled);
+
+  SetEnabledElement(gDialog.ContentRowsListbox, enabled);
+
+  SetEnabledElement(gDialog.ContentRowsPlusButton, enabled);
+  SetEnabledElement(gDialog.ContentRowsMinusButton, enabled && gDialog.ContentRowsListbox.itemCount);
+  // SetEnabledElement(gDialog.ContentRowsConfigButton, enabled);
+
+  SetEnabledElement(gDialog.LoremIpsumCheckbox, enabled);
+}
+
+function AddContentRow(aEvent)
+{
+  var item = aEvent.originalTarget;
+  var label = item.label;
+  var value = item.value;
+
+  var listItem = gDialog.ContentRowsListbox.appendItem(label, value);
+  gDialog.ContentRowsListbox.selectItem(listItem);
+  SetEnabledElement(gDialog.ContentRowsMinusButton, true);
+}
+
+function RemoveContentRow()
+{
+  var listbox = gDialog.ContentRowsListbox;
+  var item = listbox.selectedItem;
+  if (item)
+  {
+    var index = listbox.getIndexOfItem(item);
+    listbox.removeItemAt(index);
+    var count = listbox.itemCount;
+    if (count)
+    {
+      if (index >= count)
+        index = count - 1;
+      item = listbox.getItemAtIndex(index);
+      listbox.selectItem(item);
+    }
+    else
+      SetEnabledElement(gDialog.ContentRowsMinusButton, false);
+  }
+}
+
+function Apply()
+{
+  var doc = EditorUtils.getCurrentDocument();
+
+  // UI CSS GRID LAYOUT
+  if (gDialog.usePageLayout.checked)
+  {
+    var loremIpusm = gDialog.LoremIpsumCheckbox.checked;
+
+    var linkElt = doc.createElement("link");
+    linkElt.setAttribute("type", "text/css");
+    linkElt.setAttribute("rel", "stylesheet");
+    linkElt.setAttribute("href", "http://yui.yahooapis.com/2.6.0/build/reset-fonts-grids/reset-fonts-grids.css");
+    EditorUtils.getHeadElement().appendChild(linkElt);
+    linkElt = doc.createElement("link");
+    linkElt.setAttribute("type", "text/css");
+    linkElt.setAttribute("rel", "stylesheet");
+    linkElt.setAttribute("href", "http://yui.yahooapis.com/2.6.0/build/base/base-min.css");
+    EditorUtils.getHeadElement().appendChild(linkElt);
+
+    var docId    = gDialog.LayoutTypeMenulist.value;
+    var docClass = gDialog.LayoutSubtypeMenulist.value;
+    var outerDiv = doc.createElement("div");
+    outerDiv.setAttribute("id", docId);
+    outerDiv.setAttribute("class", docClass);
+    doc.body.innerHTML = "";
+    doc.body.appendChild(outerDiv);
+
+    var headerDiv = doc.createElement("div");
+    headerDiv.setAttribute("id", "hd");
+    var bodyDiv = doc.createElement("div");
+    bodyDiv.setAttribute("id", "bd");
+    var footerDiv = doc.createElement("div");
+    footerDiv.setAttribute("id", "ft");
+    outerDiv.appendChild(headerDiv);
+    outerDiv.appendChild(bodyDiv);
+    outerDiv.appendChild(footerDiv);
+
+    var loremIpsumStr = "<br>";
+    var navProse = "";
+    if (loremIpusm)
+    {
+      var loremIpsumProse = L10NUtils.getStringFromURL("loremIpsum",
+                                             "chrome://bluegriffon/locale/newPageWizard.properties");
+      var headerProse = L10NUtils.getStringFromURL("header",
+                                             "chrome://bluegriffon/locale/newPageWizard.properties");
+      var footerProse = L10NUtils.getStringFromURL("footer",
+                                             "chrome://bluegriffon/locale/newPageWizard.properties");
+      navProse =    L10NUtils.getStringFromURL("nav",
+                                             "chrome://bluegriffon/locale/newPageWizard.properties");
+
+      var h1 = doc.createElement("h1");
+      var headerTextNode = doc.createTextNode(headerProse);
+      h1.appendChild(headerTextNode);
+      headerDiv.appendChild(h1);
+      var p = doc.createElement("p");
+      var footerTextNode = doc.createTextNode(footerProse);
+      p.appendChild(footerTextNode);
+      footerDiv.appendChild(p);
+
+      loremIpsumStr = "<p>" + loremIpsumProse + "</p>";
+    }
+    else
+    {
+      var headerBr = doc.createElement("br");
+      headerDiv.appendChild(headerBr);
+      var footerBr = doc.createElement("br");
+      footerDiv.appendChild(footerBr);
+    }
+
+    var mainContainer = bodyDiv;
+    if (docClass != "yui-t7")
+    {
+      mainContainer = doc.createElement("div");
+      mainContainer.setAttribute("class", "yui-b");
+      mainContainerContainer = doc.createElement("div");
+      mainContainerContainer.setAttribute("id", "yui-main");
+
+      mainContainerContainer.appendChild(mainContainer);
+      bodyDiv.appendChild(mainContainerContainer);
+    }
+
+    var listbox = gDialog.ContentRowsListbox;
+    for (var i = 0 ; i < listbox.itemCount; i++)
+    {
+      var item = listbox.getItemAtIndex(i);
+      var value = item.value;
+      var ihtml = "";
+      switch (value)
+      {
+             case "1": // .yui-g
+          ihtml = "<div class='yui-g'>" + loremIpsumStr + "</div>";
+          break;  // oneColumn100
+
+        case "2": // .yui-g > .yui-u.first + .yui-u 
+          ihtml = "<div class='yui-g'><div class='yui-u first'>" + loremIpsumStr +
+                               "</div><div class='yui-u'>" + loremIpsumStr +
+                               "</div></div>";
+          break;  // twoColumns5050
+
+        case "3": // .yui-gc > .yui-u.first + .yui-u 
+          ihtml = "<div class='yui-gc'><div class='yui-u first'>" + loremIpsumStr +
+                               "</div><div class='yui-u'>" + loremIpsumStr +
+                               "</div></div>";
+          break;  // twoColumns6633
+
+        case "4": // .yui-gd > .yui-u.first + .yui-u 
+          ihtml = "<div class='yui-gd'><div class='yui-u first'>" + loremIpsumStr +
+                               "</div><div class='yui-u'>" + loremIpsumStr +
+                               "</div></div>";
+          break;  // twoColumns3366
+
+        case "5": // .yui-ge > .yui-u.first + .yui-u 
+          ihtml = "<div class='yui-ge'><div class='yui-u first'>" + loremIpsumStr +
+                               "</div><div class='yui-u'>" + loremIpsumStr +
+                               "</div></div>";
+          break;  // twoColumns7525
+
+        case "6": // .yui-gf > .yui-u.first + .yui-u 
+          ihtml = "<div class='yui-gf'><div class='yui-u first'>" + loremIpsumStr +
+                               "</div><div class='yui-u'>" + loremIpsumStr +
+                               "</div></div>";
+          break;  // twoColumns2575
+
+        case "7": // .yui-gb > .yui-u.first + .yui-u + .yui-u 
+          ihtml = "<div class='yui-gb'><div class='yui-u first'>" + loremIpsumStr +
+                               "</div><div class='yui-u'>" + loremIpsumStr +
+                               "</div><div class='yui-u'>" + loremIpsumStr +
+                               "</div></div>";
+          break;  // threeColumns333333
+
+        case "8": // .yui-g > .yui-u first + .yui-g > .yui-u.first + .yui-u
+          ihtml = "<div class='yui-g'><div class='yui-u first'>" + loremIpsumStr +
+                               "</div><div class='yui-g'><div class='yui-u first'>" + loremIpsumStr +
+                                                   "</div><div class='yui-u'>" + loremIpsumStr +
+                                       "</div></div></div>";
+          break;  // threeColumns502525
+
+        case "9": // .yui-g > .yui-g.first ( > .yui-u.first + .yui-u ) + .yui-u
+          ihtml = "<div class='yui-g'><div class='yui-g first'><div class='yui-u first'>" + loremIpsumStr +
+                                                   "</div><div class='yui-u'>" + loremIpsumStr +
+                                       "</div></div><div class='yui-u'>" + loremIpsumStr +
+                               "</div></div>";
+          break;  // threeColumns252550
+
+        case "10": // .yui-g > .yui-g.first ( > .yui-u.first + .yui-u ) + .yui-g ( > .yui-u.first + .yui-u )
+          ihtml = "<div class='yui-g'><div class='yui-g first'><div class='yui-u first'>" + loremIpsumStr +
+                                                   "</div><div class='yui-u'>" + loremIpsumStr +
+                                       "</div></div><div class='yui-g'><div class='yui-u first'>" + loremIpsumStr +
+                                                   "</div><div class='yui-u'>" + loremIpsumStr +
+                                       "</div></div></div>";
+          break;  // fourColumns25252525
+
+        default: break // should not happen
+      }
+      mainContainer.innerHTML += ihtml;
+    }
+
+    // the sidebar now...
+    if (docClass != "yui-t7")
+    {
+      bodyDiv.innerHTML += "<div class='yui-b'>" + navProse + "</div>";
+    }
+  }
+
+  // DOCUMENT METADATA
+  if (gDialog.pageTitle.value)
+  {
+    EditorUtils.setDocumentTitle(gDialog.pageTitle.value);
+  }
+
+  if (gDialog.pageAuthor.value)
+  {
+    var meta = EditorUtils.createMetaElement("author");
+    EditorUtils.insertMetaElement(meta, gDialog.pageAuthor.value, true, false);
+  }
+
+  if (gDialog.pageDescription.value)
+  {
+    meta = EditorUtils.createMetaElement("description");
+    EditorUtils.insertMetaElement(meta, gDialog.pageDescription.value, true, false);
+  }
+
+  if (gDialog.pageKeywords.value)
+  {
+    meta = EditorUtils.createMetaElement("keywords");
+    EditorUtils.insertMetaElement(meta, gDialog.pageKeywords.value, true, false);
+  }
+
+  meta = EditorUtils.createMetaElement("generator");
+  EditorUtils.insertMetaElement(meta, "BlueGriffon wysiwyg editor", true, false);
+
+  if (gDialog.pageLanguage.value)
+    EditorUtils.getCurrentDocument().documentElement.
+      setAttribute("lang", gDialog.pageLanguage.value);
+
+  // COLORS
+  var prefs = GetPrefs();
+  if (gDialog.makeColorsDefault.checked)
+    prefs.setBoolPref("bluegriffon.display.use_system_colors", !gDialog.userDefinedColors.checked)
+  if (gDialog.userDefinedColors.checked)
+  {
+    var bgColor      = gDialog.backgroundColorColorpicker.color;
+    var fgColor      = gDialog.textColorColorpicker.color;
+    var linksColor   = gDialog.linksColorColorpicker.color;
+    var activeColor  = gDialog.activeLinksColorColorpicker.color;
+    var visitedColor = gDialog.visitedLinksColorColorpicker.color;
+
+    CssUtils.getStyleSheetForScreen(doc);
+    CssUtils.addRuleForSelector(doc, "html", [ { property: "background-color",
+                                                 value: bgColor,
+                                                 priority: false } ] );
+    CssUtils.addRuleForSelector(doc, "body", [ { property: "background-color",
+                                                 value: bgColor,
+                                                 priority: false },
+                                               {
+                                                 property: "color",
+                                                 value: fgColor,
+                                                 priority: false } ] );
+    CssUtils.addRuleForSelector(doc, ":link", [ { property: "color",
+                                                 value: linksColor,
+                                                 priority: false } ] );
+    if (!gDialog.underlineLinks.checked)
+           CssUtils.addRuleForSelector(doc, ":link", [ { property: "text-decoration",
+                                                        value: "none",
+                                                        priority: false } ] );
+    CssUtils.addRuleForSelector(doc, ":link:active", [ { property: "color",
+                                                          value: activeColor,
+                                                          priority: false } ] );
+    CssUtils.addRuleForSelector(doc, ":link:visited", [ { property: "color",
+                                                          value: visitedColor,
+                                                          priority: false } ] );
+
+    if (gDialog.makeColorsDefault.checked)
+    {
+           prefs.setCharPref("bluegriffon.display.foreground_color", fgColor);
+           prefs.setCharPref("bluegriffon.display.background_color", bgColor);
+           prefs.setCharPref("bluegriffon.display.active_color", activeColor);
+           prefs.setCharPref("bluegriffon.display.anchor_color", linksColor);
+           prefs.setCharPref("bluegriffon.display.visited_color", visitedColor);
+           prefs.setBoolPref("bluegriffon.display.underline_links", gDialog.underlineLinks.checked);
+    }
+  }
+
+  // BACKGROUND IMAGE
+  var bgImage = gDialog.backgroundImage.value; 
+  if (bgImage)
+  {
+    var bgRepeat     = gDialog.backgroundTile.value;
+    var bgAttachment = gDialog.backgroundScroll.value;
+    var bgPosition   = gDialog.horizPosition.value + " " + gDialog.vertPosition.value;
+    CssUtils.addRuleForSelector(doc, "body", [ { property: "background-image",
+                                                 value: 'url("' + bgImage + '")',
+                                                 priority: false },
+                                               {
+                                                 property: "background-repeat",
+                                                 value: bgRepeat,
+                                                 priority: false },
+                                               {
+                                                 property: "background-attachment",
+                                                 value: bgAttachment,
+                                                 priority: false },
+                                               {
+                                                 property: "background-position",
+                                                 value: bgPosition,
+                                                 priority: false } ] );
+  }
+}
+
+
+function OpenColorDialog(aColorObjectId, aElt)
+{
+  var cph = ColorPickerHelper;
+  cph.openColorPicker(window, aColorObjectId, "tagada", true);
+  if (!cph.isCancelled(aColorObjectId))
+  {
+    aElt.firstChild.style.backgroundColor = cph.getCurrentColor(aColorObjectId);
+  }
+}
diff --git a/base/content/bluegriffon/dialogs/newPageWizard.xul b/base/content/bluegriffon/dialogs/newPageWizard.xul
new file mode 100644 (file)
index 0000000..54cee09
--- /dev/null
@@ -0,0 +1,406 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://bluegriffon/skin/newPageWizard.css" type="text/css"?>
+<?xml-stylesheet href="chrome://bluegriffon/skin/listboxBg.css" type="text/css"?>
+
+<!DOCTYPE wizard [
+  <!ENTITY % pagePropertiesDTD SYSTEM "chrome://bluegriffon/locale/newPageWizard.dtd" >
+  <!ENTITY % filePickingDTD SYSTEM "chrome://bluegriffon/locale/filePicking.dtd" >
+  %pagePropertiesDTD;
+  %filePickingDTD;
+]>
+
+<wizard id="newPageWizard"
+        title="&window.title;"
+        onload="Startup()"
+        onwizardfinish="Apply()"
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        persist="screenX screenY">
+
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/editorUtils.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/dgid.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/global.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/colors.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/l10n.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/urls.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/css.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/js/colourPickerHelper.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/dialogs/newPageWizard.js"/>
+
+  <panel id="colorPickerPopup"
+#ifndef XP_MACOSX
+         noautohide="true">
+#else
+         >
+#endif
+    <iframe id="colorPickerSheetIFrame" allowevents="true"
+            style="width: 635px; height: 400px;"
+            hidden="true"/>
+  </panel>
+
+  <wizardpage label="&generalTab.label;">
+    <grid flex="1">
+      <columns><column/><column flex="1"/></columns>
+      <rows>
+        <row align="center">
+          <label value="&pageTitle.label;"
+                 control="pageTitle"
+                 accesskey="&pageTitle.accesskey;"/>
+          <textbox id="pageTitle" spellcheck="true"
+                   oninput="TextboxChanged(this.id);"/>
+        </row>
+        <row align="center">
+          <label value="&pageAuthor.label;"
+                 control="pageAuthor"
+                 accesskey="&pageAuthor.accesskey;"/>
+          <textbox id="pageAuthor"
+                   oninput="TextboxChanged(this.id);"/>
+        </row>
+        <row align="center">
+          <label value="&pageDescription.label;"
+                 control="pageDescription"
+                 accesskey="&pageDescription.accesskey;"/>
+          <textbox id="pageDescription" spellcheck="true"
+                   oninput="TextboxChanged(this.id);"/>
+        </row>
+        <row align="center">
+          <label value="&pageKeywords.label;"
+                 control="pageKeywords"
+                 accesskey="&pageKeywords.accesskey;"/>
+          <textbox id="pageKeywords" spellcheck="true"
+                   oninput="TextboxChanged(this.id);"/>
+        </row>
+        <row align="center">
+          <label value="&language.label;"
+                 control="pageLanguage"
+                 accesskey="&language.accesskey;"/>
+          <hbox>
+                 <textbox id="pageLanguage" flex="1"
+                          oninput="TextboxChanged(this.id);"/>
+            <button label="&selectLanguage.label;"
+                    oncommand="SelectLanguage(this)"/>
+         </hbox>
+        </row>
+      </rows>
+    </grid>
+  </wizardpage>
+
+  <wizardpage label="&colorsTab.label;">
+    <checkbox id="userDefinedColors"
+              label="&userDefinedColors.label;"
+              oncommand="EnableUserDefinedColorsControls()"/>
+
+         <hbox class="indent">
+           <grid>
+             <columns><column/><column/></columns>
+             <rows>
+               <row align="center">
+                 <label value="&backgroundColor.label;" disabled="true"
+                   accesskey="&backgroundColor.accesskey;"
+                   id="backgroundColorColorpickerLabel"
+                   control="backgroundColorColorpicker"/>
+                             <ecolorpicker id="backgroundColorColorpicker"
+                                           color="transparent"
+                                           disabled="true"
+                                           colorObjectId="TextColor"
+                                           windowTitle="Background color"
+                                           showTransparency="true"/>
+               </row>
+               <row align="center">
+                 <label value="&textColor.label;" disabled="true"
+                        accesskey="&textColor.accesskey;"
+                   id="textColorColorpickerLabel"
+                        control="textColorColorpicker"/>
+            <ecolorpicker id="textColorColorpicker"
+                          color="transparent"
+                          disabled="true"
+                          colorObjectId="TextColor"
+                          windowTitle="Text color"
+                          showTransparency="false"/>
+               </row>
+               <row align="center">
+                 <label value="&linksColor.label;" disabled="true"
+                        accesskey="&linksColor.accesskey;"
+                   id="linksColorColorpickerLabel"
+                        control="linksColorColorpicker"/>
+            <ecolorpicker id="linksColorColorpicker"
+                          color="transparent"
+                          disabled="true"
+                          colorObjectId="TextColor"
+                          windowTitle="Links color"
+                          showTransparency="false"/>
+               </row>
+               <row align="center">
+                 <label value="&activeLinksColor.label;" disabled="true"
+                        accesskey="&activeLinksColor.accesskey;"
+                   id="activeLinksColorColorpickerLabel"
+                        control="activeLinksColorColorpicker"/>
+            <ecolorpicker id="activeLinksColorColorpicker"
+                          color="transparent"
+                          disabled="true"
+                          colorObjectId="TextColor"
+                          windowTitle="Active links color"
+                          showTransparency="false"/>
+               </row>
+               <row align="center">
+                 <label value="&visitedLinksColor.label;" disabled="true"
+                        accesskey="&visitedLinksColor.accesskey;"
+                   id="visitedLinksColorColorpickerLabel"
+                        control="visitedLinksColorColorpicker"/>
+            <ecolorpicker id="visitedLinksColorColorpicker"
+                          color="transparent"
+                          disabled="true"
+                          colorObjectId="TextColor"
+                          windowTitle="Visited links color"
+                          showTransparency="false"/>
+               </row>
+             </rows>
+           </grid>
+           <vbox id="pagePreview" flex="1">
+              <spacer flex="1"/>
+              <label class="larger" id="textPreview" value="&normalText.preview;" disabled="true"/>
+              <spacer flex="1"/>
+              <label class="larger" id="linksPreview" value="&links.preview;" disabled="true"/>
+              <spacer flex="1"/>
+              <label class="larger" id="activeLinksPreview" value="&activeLinks.preview;" disabled="true"/>
+              <spacer flex="1"/>
+              <label class="larger" id="visitedLinksPreview" value="&visitedLinks.preview;" disabled="true"/>
+              <spacer flex="1"/>
+           </vbox>
+         </hbox>
+         <checkbox id="underlineLinks" class="indent"
+                   label="&underlineLinks.label;"
+              oncommand="EnableUserDefinedColorsControls()"
+              checked="true"/>
+
+    <separator style="height: 5px"/>
+    <checkbox id="makeColorsDefault"
+              label="&makeColorsDefault.label;"
+              checked="true"/>
+  </wizardpage>
+
+  <wizardpage label="&bgTab.label;">
+    <grid>
+      <columns>
+        <column/>
+        <column flex="1"/>
+        <column/>
+      </columns>
+      <rows>
+        <row align="center">
+                     <label value="&backgroundImage.label;"
+                            control="backgroundImage"
+                            accesskey="&backgroundImage.accesskey;"/>
+                     <textbox id="backgroundImage" flex="1"/>
+                     <filepickerbutton id="filepickerbutton"
+                                       control="backgroundImage"
+                            mode="0"
+                            title="&filepickerForBgImage.title;"/>
+        </row>
+        <row align="center">
+          <label value="&tile.label;"
+                 control="backgroundTile"
+                 accesskey="&tile.accesskey;"/>
+          <menulist id="backgroundTile"
+                    oncommand="SetBackgroundRepeat(this)">
+            <menupopup>
+              <menuitem value="no-repeat" label="None"/>
+              <menuitem value="repeat-x" label="Horizontally"/>
+              <menuitem value="repeat-y" label="Vertically"/>
+              <menuitem value="repeat" label="Both"/>
+            </menupopup>
+          </menulist>
+        </row>
+        <row align="center">
+          <label value="&scrolling.label;"
+                 control="backgroundAttachment"
+                 accesskey="&scrolling.accesskey;"/>
+          <menulist id="backgroundScroll">
+            <menupopup>
+              <menuitem value="scroll" label="&scrollWithPage.label;"/>
+              <menuitem value="fixed" label="&noScrolling.label;"/>
+            </menupopup>
+          </menulist>
+        </row>
+        <row align="center">
+          <spacer/>
+          <hbox>
+            <spacer flex="1"/>
+            <label value="&horizPosition.label;"/>
+            <label id="horizPosition" value="50%"/>
+            <label value="&vertPosition.label;"/>
+            <label id="vertPosition" value="50%"/>
+            <spacer flex="1"/>
+          </hbox>
+        </row>
+        <row align="center">
+          <label value="Position:"/>
+          <hbox align="center">
+            <spacer flex="1"/>
+            <stack
+                 onmousemove="ShowBackgroundPosition(event)"
+                 onmousedown="SetBackgroundPosition(event)"
+                 onmouseout="ExitBackgroundPosition(event)">
+              <box id="backgroundImageBox"/>
+              <box id="backgroundPositionBox"/>
+            </stack>
+            <spacer flex="1"/>
+          </hbox>
+        </row>
+      </rows>
+    </grid>
+  </wizardpage>
+
+  <wizardpage label="&layoutsTab.label;" orient="vertical">
+    <checkbox id="usePageLayout"
+              checked="true"
+              oncommand="onUsePageLayoutChanged(this)"
+              label="&usePageLayout.checkbox;"/>
+    <vbox flex="1" class="indent">
+           <hbox align="center">
+             <label value="&layoutType.label;"
+               id="LayoutTypeMenulistLabel"
+               control="LayoutTypeMenulist"
+               accesskey="&layoutType.accesskey;" />
+             <menulist id="LayoutTypeMenulist">
+          <menupopup>
+            <menuitem label="&layout100percent.label;" selected="true"
+                      value="doc3"/>
+            <menuitem label="&layout750px.label;"
+                      value="doc"/>
+            <menuitem label="&layout950px.label;"
+                      value="doc2"/>
+            <menuitem label="&layout974px.label;"
+                      value="doc4"/>
+          </menupopup>
+        </menulist>
+             <spacer flex="1"/>
+        <label value="&layoutSubtype.label;"
+               id="LayoutSubtypeMenulistLabel"
+               control="LayoutSubtypeMenulist"
+               accesskey="&layoutSubtype.accesskey;" />
+        <menulist id="LayoutSubtypeMenulist">
+          <menupopup>
+            <menuitem label="&noSidebar.label;"
+                      value="yui-t7"/>
+            <menuitem label="&left160Sidebar.label;" selected="true"
+                      value="yui-t1"/>
+            <menuitem label="&left180Sidebar.label;"
+                      value="yui-t2"/>
+            <menuitem label="&left300Sidebar.label;"
+                      value="yui-t3"/>
+            <menuitem label="&right180Sidebar.label;"
+                      value="yui-t4"/>
+            <menuitem label="&right240Sidebar.label;"
+                      value="yui-t5"/>
+            <menuitem label="&right300Sidebar.label;"
+                      value="yui-t6"/>
+          </menupopup>
+        </menulist>
+           </hbox>
+      <hbox flex="1" style="margin: 1em">
+        <vbox flex="1">
+               <listbox id="ContentRowsListbox" class="listboxBg" flex="1"/>
+#ifdef XP_MACOSX
+          <hbox class="listboxBg" align="center">
+            <toolbarbutton class="listboxBgPlusButton"
+                           id="ContentRowsPlusButton"
+                           type="menu"
+                           oncommand="AddContentRow(event)">
+              <menupopup>
+                <menuitem value="1"  label="&oneColumn100.label;"/>
+                <menuitem value="2"  label="&twoColumns5050.label;"/>
+                <menuitem value="3"  label="&twoColumns6633.label;"/>
+                <menuitem value="4"  label="&twoColumns3366.label;"/>
+                <menuitem value="5"  label="&twoColumns7525.label;"/>
+                <menuitem value="6"  label="&twoColumns2575.label;"/>
+                <menuitem value="7"  label="&threeColumns333333.label;"/>
+                <menuitem value="8"  label="&threeColumns502525.label;"/>
+                <menuitem value="9"  label="&threeColumns252550.label;"/>
+                <menuitem value="10" label="&fourColumns25252525.label;"/>
+              </menupopup>
+            </toolbarbutton>
+            <toolbarbutton class="listboxBgMinusButton"
+                           id="ContentRowsMinusButton"
+                           oncommand="RemoveContentRow()"
+                           disabled="true"/>
+            <toolbarbutton class="listboxBgConfigButton"
+                           id="ContentRowsConfigButton"
+                           disabled="true"/>
+          </hbox>
+#else
+          <hbox>
+            <button label="&newRow.label;"
+                    id="ContentRowsPlusButton"
+                         type="menu"
+                         oncommand="AddContentRow(event)">
+              <menupopup>
+                <menuitem value="1"  label="&oneColumn100.label;"/>
+                <menuitem value="2"  label="&twoColumns5050.label;"/>
+                <menuitem value="3"  label="&twoColumns6633.label;"/>
+                <menuitem value="4"  label="&twoColumns3366.label;"/>
+                <menuitem value="5"  label="&twoColumns7525.label;"/>
+                <menuitem value="6"  label="&twoColumns2575.label;"/>
+                <menuitem value="7"  label="&threeColumns333333.label;"/>
+                <menuitem value="8"  label="&threeColumns502525.label;"/>
+                <menuitem value="9"  label="&threeColumns252550.label;"/>
+                <menuitem value="10" label="&fourColumns25252525.label;"/>
+              </menupopup>
+            </button>
+            <spacer flex="1"/>
+            <button label="&removeRow.label;"
+                    id="ContentRowsMinusButton"
+                    oncommand="RemoveContentRow()"
+                    disabled="true"/>
+          </hbox>
+#endif
+        </vbox>
+      </hbox>
+      <checkbox label="&loremIpsum.label;"
+                id="LoremIpsumCheckbox"
+                checked="true"
+                accesskey="&loremIpsum.accesskey;" />
+    </vbox>
+  </wizardpage>
+</wizard>
+
+
+
diff --git a/base/content/bluegriffon/dialogs/openLocation.js b/base/content/bluegriffon/dialogs/openLocation.js
new file mode 100644 (file)
index 0000000..3aa87f2
--- /dev/null
@@ -0,0 +1,96 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+const nsIFilePicker = Components.interfaces.nsIFilePicker;
+
+var gDialog = {};
+
+function Startup()
+{
+  if (!window.arguments.length)
+    return;
+
+  var type = window.arguments[0];
+  gDialog.bundle = document.getElementById("openLocationBundle");
+  gDialog.input = document.getElementById("dialog.input");
+  gDialog.tabOrWindow = document.getElementById("tabOrWindow");
+
+  gDialog.tabOrWindow.value = type;
+  gDialog.prefs = GetPrefs();
+}
+
+function onChooseFile()
+{
+  try {
+    var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
+    fp.init(window, gDialog.bundle.getString("chooseFileDialogTitle"), nsIFilePicker.modeOpen);
+    
+    fp.appendFilters(nsIFilePicker.filterHTML);
+    fp.appendFilter(gDialog.bundle.getString("templateFilter"), "*.mzt");
+    fp.appendFilters(nsIFilePicker.filterText);
+    fp.appendFilters(nsIFilePicker.filterAll);
+
+    if (fp.show() == nsIFilePicker.returnOK && fp.fileURL.spec && fp.fileURL.spec.length > 0)
+    {
+      gDialog.input.value = fp.fileURL.spec;
+      // give focus to the OK buton
+      document.documentElement.getButton("accept").focus();
+    }
+  }
+  catch(ex) {
+  }
+}
+
+function OpenFile()
+{
+  var filename = gDialog.input.value;
+  var inTab = (gDialog.tabOrWindow.value == "tab");
+  window.opener.OpenFile(filename, inTab);
+
+  if (gDialog.prefs)
+  {
+    var str = Components.classes["@mozilla.org/supports-string;1"]
+                        .createInstance(Components.interfaces.nsISupportsString);
+    str.data = filename;
+    gDialog.prefs.setComplexValue("general.open_location.last_url",
+                         Components.interfaces.nsISupportsString, str);
+  }
+  // Delay closing slightly to avoid timing bug on Linux.
+  window.close();
+  return false;
+}
+
diff --git a/base/content/bluegriffon/dialogs/openLocation.xul b/base/content/bluegriffon/dialogs/openLocation.xul
new file mode 100644 (file)
index 0000000..19023e9
--- /dev/null
@@ -0,0 +1,89 @@
+<?xml version="1.0"?> 
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+
+<!DOCTYPE dialog [
+  <!ENTITY % openDialogDTD SYSTEM "chrome://bluegriffon/locale/openLocation.dtd" >
+  %openDialogDTD;
+]>            
+<dialog id="openLocation"
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        title="&window.title;"
+        onload="Startup()"
+        ondialogaccept="OpenFile()"
+        style="width: 40em;"
+        persist="screenX screenY"
+        screenX="24" screenY="24">
+
+  <stringbundle id="openLocationBundle" src="chrome://bluegriffon/locale/openLocation.properties"/>
+
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/dgid.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/global.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/dialogs/openLocation.js"/>
+
+  <vbox>
+    <hbox>
+      <label value="&enterLocation.label;" control="dialog.input"
+             accesskey="&enterLocation.accesskey;"/>
+    </hbox>
+    <separator class="thin"/>
+    <hbox align="center">
+      <textbox flex="1" id="dialog.input" />
+      <button label="&chooseFile.label;"
+              accesskey="&chooseFile.accesskey;"
+              oncommand="onChooseFile()"/>
+    </hbox>
+    <hbox align="center">
+      <label value="&createIn.label;"/>
+      <radiogroup id="tabOrWindow"
+                  orient="horizontal"
+                  value="tab">
+        <radio label="&inATab.label;"
+               accesskey="&inATab.accesskey;"
+               value="tab"
+               selected="true"/>
+        <radio label="&inAWindow.label;"
+               accesskey="&inAWindow.accesskey;"
+               value="window"/>
+      </radiogroup>
+    </hbox>
+  </vbox>
+</dialog>
diff --git a/base/content/bluegriffon/dialogs/pageProperties.js b/base/content/bluegriffon/dialogs/pageProperties.js
new file mode 100644 (file)
index 0000000..59ef5a1
--- /dev/null
@@ -0,0 +1,265 @@
+var gAuthorElement;
+var gDescriptionElement;
+var gKeywordsElement;
+var gAuthor = "";
+var gDescription = "";
+var gKeywords = "";
+var gInsertNewAuthor = false;
+var gInsertNewDescription = false;
+var gInsertNewKeywords = false;
+var gRootElement;
+var gTitleWasEdited = false;
+var gAuthorWasEdited = false;
+var gDescriptionWasEdited = false;
+var gKeywordsWasEdited = false;
+var gPrefs;
+
+var gDefaultColors;
+
+function Startup()
+{
+  GetUIElements();
+
+  var fpb = gDialog["filepickerbutton"];
+  fpb.appendFilters(Components.interfaces.nsIFilePicker.filterImages);
+
+  var iframe = gDialog["pagePreview"];
+
+  var location = UrlUtils.getDocumentUrl();
+  var lastmodString = L10NUtils.getString("Unknown");
+
+  if (!UrlUtils.isUrlAboutBlank(location))
+  {
+    gDialog.pageLocation.setAttribute("value",
+                                      UrlUtils.stripUsernamePassword(location));
+
+    // retrieve the last-modification date and time
+    var lastmod;
+    try {
+      lastmod = EditorUtils.getCurrentEditor().document.lastModified;
+    }
+    catch (e) {}
+    // convert date+time into readable form
+    if (Date.parse(lastmod))
+    {
+      try {
+        const nsScriptableDateFormat_CONTRACTID = "@mozilla.org/intl/scriptabledateformat;1";
+        const nsIScriptableDateFormat = Components.interfaces.nsIScriptableDateFormat;
+        var dateService = Components.classes[nsScriptableDateFormat_CONTRACTID]
+                            .getService(nsIScriptableDateFormat);
+
+        var lastModDate = new Date();
+        lastModDate.setTime(Date.parse(lastmod));
+        lastmodString =  dateService.FormatDateTime("", 
+                                      dateService.dateFormatLong,
+                                      dateService.timeFormatSeconds,
+                                      lastModDate.getFullYear(),
+                                      lastModDate.getMonth()+1,
+                                      lastModDate.getDate(),
+                                      lastModDate.getHours(),
+                                      lastModDate.getMinutes(),
+                                      lastModDate.getSeconds());
+      } catch (e) {}
+
+    }
+  }
+  gDialog.pageLastModified.value = lastmodString;
+
+  gAuthorElement = EditorUtils.getMetaElement("author");
+  if (!gAuthorElement)
+  {
+    gAuthorElement = EditorUtils.createMetaElement("author");
+    if (!gAuthorElement)
+    {
+      window.close();
+      return;
+    }
+    gInsertNewAuthor = true;
+  }
+
+  gDescriptionElement = EditorUtils.getMetaElement("description");
+  if (!gDescriptionElement)
+  {
+    gDescriptionElement = EditorUtils.createMetaElement("description");
+    if (!gDescriptionElement)
+      window.close();
+
+    gInsertNewDescription = true;
+  }
+
+  gKeywordsElement = EditorUtils.getMetaElement("keywords");
+  if (!gKeywordsElement)
+  {
+    gKeywordsElement = EditorUtils.createMetaElement("keywords");
+    if (!gKeywordsElement)
+      window.close();
+
+    gInsertNewKeywords = true;
+  }
+
+  gRootElement = EditorUtils.getCurrentEditor().rootElement;
+  InitDialog();
+
+  SetTextboxFocus(gDialog.pageTitle);
+
+  // SetWindowLocation();
+}
+
+function InitDialog()
+{
+  gDialog.pageTitle.value = EditorUtils.getDocumentTitle();
+
+  var gAuthor = TrimString(gAuthorElement.getAttribute("content"));
+  if (!gAuthor)
+    try {
+      // Fill in with value from editor prefs
+      gPrefs = GetPrefs();
+      if (gPrefs) 
+        gAuthor = gPrefs.getCharPref("bluegriffon.author");
+    }
+    catch(e) {}
+  // if we still have no author name, use the system username if any
+  if (!gAuthor)
+    try {
+      gAuthor = Components.classes["@mozilla.org/userinfo;1"]
+                  .getService(Components.interfaces.nsIUserInfo).username;
+    }
+    catch(e) {}
+  gDialog.pageAuthor.value = gAuthor;
+  
+  gDialog.pageDescription.value = gDescriptionElement.getAttribute("content");
+  gDialog.pageKeywords.value    = gKeywordsElement.getAttribute("content");
+
+  gDefaultColors = ColorUtils.getDefaultBrowserColors();
+  if (gDefaultColors.UseSysColors)
+    gDialog.colorRadiogroup.selectedItem = gDialog.useSystemColors;
+  else
+    gDialog.colorRadiogroup.selectedItem = gDialog.userDefinedColors;
+
+  SetEnabledElementAndControl(gDialog.backgroundColorColorpickerLabel, !gDefaultColors.UseSysColors);
+  SetEnabledElementAndControl(gDialog.textColorColorpickerLabel, !gDefaultColors.UseSysColors);
+  SetEnabledElementAndControl(gDialog.linksColorColorpickerLabel, !gDefaultColors.UseSysColors);
+  SetEnabledElementAndControl(gDialog.activeLinksColorColorpickerLabel, !gDefaultColors.UseSysColors);
+  SetEnabledElementAndControl(gDialog.visitedLinksColorColorpickerLabel, !gDefaultColors.UseSysColors);
+
+  gDialog.pagePreview.style.backgroundColor = gDefaultColors.BackgroundColor;
+  gDialog.pagePreview.style.backgroundImage = "none";
+  gDialog.textPreview.style.color = gDefaultColors.TextColor;
+  gDialog.linksPreview.style.color = gDefaultColors.LinkColor;
+  gDialog.activeLinksPreview.style.color = gDefaultColors.ActiveLinkColor;
+  gDialog.visitedLinksPreview.style.color = gDefaultColors.VisitedLinkColor;
+  gDialog.linksPreview.style.textDecoration = "underline";
+  gDialog.activeLinksPreview.style.textDecoration = "underline";
+  gDialog.visitedLinksPreview.style.textDecoration = "underline";
+}
+
+function onAccept()
+{
+  var editor = EditorUtils.getCurrentEditor();
+  editor.beginTransaction();
+
+  // general properties
+  if (gTitleWasEdited)
+    EditorUtils.setDocumentTitle(TrimString(gDialog.pageTitle.value));
+
+  if (gAuthorWasEdited)
+    EditorUtils.insertMetaElement(gAuthorElement, TrimString(gDialog.pageAuthor.value),
+                                  gInsertNewAuthor, false);
+
+  if (gDescriptionWasEdited)
+    EditorUtils.insertMetaElement(gDescriptionElement, TrimString(gDialog.pageDescription.value),
+                                  gInsertNewDescription, false);
+
+  if (gKeywordsWasEdited)
+    EditorUtils.insertMetaElement(gKeywordsElement, TrimString(gDialog.pageKeywords.value),
+                                  gInsertNewKeywords, false);
+
+  // style properties
+
+  
+  editor.endTransaction();
+
+  editor.transactionManager.clear();
+  editor.resetModificationCount();
+  var tabeditorElt = EditorUtils.getCurrentTabEditor();
+  tabeditorElt.showCurrentTabAsModified(EditorUtils.isDocumentModified());
+
+  return true;
+}
+
+function onCancel()
+{
+  return true;
+}
+
+function TextboxChanged(aId)
+{
+  switch(aId)
+  {
+    case "pageTitle":       gTitleWasEdited = true; break;
+    case "pageAuthor":      gAuthorWasEdited = true; break;
+    case "pageDescription": gDescriptionWasEdited = true; break;
+    case "pageKeywords":    gKeywordsWasEdited = true; break;
+    default: break;
+  }
+}
+
+function UseDefaultColors()
+{
+  SetColorPreview("textCW",       defaultTextColor);
+  SetColorPreview("linkCW",       defaultLinkColor);
+  SetColorPreview("activeCW",     defaultActiveColor);
+  SetColorPreview("visitedCW",    defaultVisitedColor);
+  SetColorPreview("backgroundCW", defaultBackgroundColor);
+
+  // Setting to blank color will remove color from buttons,
+  setColorWell("textCW",       "");
+  setColorWell("linkCW",       "");
+  setColorWell("activeCW",     "");
+  setColorWell("visitedCW",    "");
+  setColorWell("backgroundCW", "");
+
+  // Disable color buttons and labels
+  SetElementEnabledById("Text", false);
+  SetElementEnabledById("TextButton", false);
+
+  SetElementEnabledById("Link", false);
+  SetElementEnabledById("LinkButton", false);
+
+  SetElementEnabledById("Active", false);
+  SetElementEnabledById("ActiveLinkButton", false);
+
+  SetElementEnabledById("VisitedLinkButton", false);
+  SetElementEnabledById("Visited", false);
+
+  SetElementEnabledById("BackgroundButton", false);
+  SetElementEnabledById("Background", false);
+}
+
+function SetColorPreview(ColorWellID, color)
+{
+  switch( ColorWellID )
+  {
+    case "textCW":
+      gDialog.NormalText.setAttribute(styleStr,colorStyle+color);
+      break;
+    case "linkCW":
+      gDialog.LinkText.setAttribute(styleStr,colorStyle+color);
+      break;
+    case "activeCW":
+      gDialog.ActiveLinkText.setAttribute(styleStr,colorStyle+color);
+      break;
+    case "visitedCW":
+      gDialog.VisitedLinkText.setAttribute(styleStr,colorStyle+color);
+      break;
+    case "backgroundCW":
+      // Must combine background color and image style values
+      var styleValue = backColorStyle+color;
+      if (gBackgroundImage)
+        styleValue += ";"+backImageStyle+gBackgroundImage+");";
+
+      gDialog.ColorPreview.setAttribute(styleStr,styleValue);
+      previewBGColor = color;
+      break;
+  }
+}
\ No newline at end of file
diff --git a/base/content/bluegriffon/dialogs/pageProperties.xul b/base/content/bluegriffon/dialogs/pageProperties.xul
new file mode 100644 (file)
index 0000000..26b459b
--- /dev/null
@@ -0,0 +1,197 @@
+<?xml version="1.0"?> 
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://bluegriffon/skin/pageProperties.css" type="text/css"?>
+
+<!DOCTYPE dialog [
+  <!ENTITY % pagePropertiesDTD SYSTEM "chrome://bluegriffon/locale/pageProperties.dtd" >
+  <!ENTITY % filePickingDTD SYSTEM "chrome://bluegriffon/locale/filePicking.dtd" >
+  %pagePropertiesDTD;
+  %filePickingDTD;
+]>            
+<dialog id="pageProperties"
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        title="&window.title;"
+        onload="Startup()"
+        ondialogaccept="return onAccept()"
+        ondialogcancel="return onCancel()"
+        style="width: 40em;"
+        persist="screenX screenY"
+        screenX="24" screenY="24">
+
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/editorUtils.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/dgid.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/global.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/colors.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/l10n.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/urls.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/dialogs/pageProperties.js"/>
+
+  <tabbox id="pagePropertiesTab" flex="1">
+    <tabs>
+      <tab label="&generalTab.label;"/>
+      <tab label="&styleTab.label;"/>
+      <tab label="&advancedTab.label;"/>
+    </tabs>
+    <tabpanels>
+      <tabpanel>
+        <grid flex="1">
+          <columns><column/><column flex="1"/></columns>
+          <rows>
+            <row align="center">
+              <label value="&pageLocation.label;"/>
+              <label id="pageLocation" value="[New page, not saved yet]"/>
+            </row>
+            <row align="center">
+              <label value="&pageLastModified.label;"/>
+              <label id="pageLastModified" value="foo"/>
+            </row>
+            <row align="center">
+              <label value="&pageTitle.label;"
+                     control="pageTitle"
+                     accesskey="&pageTitle.accesskey;"/>
+              <textbox id="pageTitle" spellcheck="true"
+                       oninput="TextboxChanged(this.id);"/>
+            </row>
+            <row align="center">
+              <label value="&pageAuthor.label;"
+                     control="pageAuthor"
+                     accesskey="&pageAuthor.accesskey;"/>
+              <textbox id="pageAuthor"
+                       oninput="TextboxChanged(this.id);"/>
+            </row>
+            <row align="center">
+              <label value="&pageDescription.label;"
+                     control="pageDescription"
+                     accesskey="&pageDescription.accesskey;"/>
+              <textbox id="pageDescription" spellcheck="true"
+                       oninput="TextboxChanged(this.id);"/>
+            </row>
+            <row align="center">
+              <label value="&pageKeywords.label;"
+                     control="pageKeywords"
+                     accesskey="&pageKeywords.accesskey;"/>
+              <textbox id="pageKeywords" spellcheck="true"
+                       oninput="TextboxChanged(this.id);"/>
+            </row>
+          </rows>
+        </grid>
+      </tabpanel>
+      
+
+      <tabpanel orient="vertical">
+        <radiogroup id="colorRadiogroup">
+          <radio id="useSystemColors"
+                 label="&useSystemColors.label;"
+                 oncommand="UseDefaultColors()"/>
+          <radio id="userDefinedColors"
+                 label="&userDefinedColors.label;"
+                 oncommand="UseCustomColors()"/>
+        </radiogroup>
+        <hbox class="indent">
+          <grid>
+            <columns><column/><column/></columns>
+            <rows>
+              <row align="center">
+                <label value="&backgroundColor.label;"
+                       id="backgroundColorColorpickerLabel"
+                       control="backgroundColorColorpicker"/>
+                <colorpicker type="button" id="backgroundColorColorpicker"/>
+              </row>
+              <row align="center">
+                <label value="&textColor.label;"
+                       id="textColorColorpickerLabel"
+                       control="textColorColorpicker"/>
+                <colorpicker type="button" id="textColorColorpicker"/>
+              </row>
+              <row align="center">
+                <label value="&linksColor.label;"
+                       id="linksColorColorpickerLabel"
+                        control="linksColorColorpicker"/>
+                <colorpicker type="button" id="linksColorColorpicker"/>
+              </row>
+              <row align="center">
+                <label value="&activeLinksColor.label;"
+                       id="activeLinksColorColorpickerLabel"
+                        control="activeLinksColorColorpicker"/>
+                <colorpicker type="button" id="activeLinksColorColorpicker"/>
+              </row>
+              <row align="center">
+                <label value="&visitedLinksColor.label;"
+                       id="visitedLinksColorColorpickerLabel"
+                        control="visitedLinksColorColorpicker"/>
+                <colorpicker type="button" id="visitedLinksColorColorpicker"/>
+              </row>
+            </rows>
+          </grid>
+          <vbox id="pagePreview" flex="1">
+             <spacer flex="1"/>
+             <label class="larger" id="textPreview" value="Normal text"/>
+             <spacer flex="1"/>
+             <label class="larger" id="linksPreview" value="Links"/>
+             <spacer flex="1"/>
+             <label class="larger" id="activeLinksPreview" value="Active links"/>
+             <spacer flex="1"/>
+             <label class="larger" id="visitedLinksPreview" value="Visited links"/>
+             <spacer flex="1"/>
+          </vbox>
+        </hbox>
+        <hbox align="center">
+          <label value="&backgroundImage.label;"
+                 control="backgroundImage"
+                 accesskey="&backgroundImage.accesskey;"/>
+          <textbox id="backgroundImage" flex="1"/>
+          <filepickerbutton id="filepickerbutton"
+                            mode="0"
+                            control="backgroundImage"
+                            title="&filepickerForBgImage.title;"/>
+          <toolbarbutton id="removeBackground" />
+        </hbox>
+        <hbox align="center">
+          <checkbox label="&relativeURLForBgImage.label;"
+                    disabled="true"/>
+        </hbox>
+      </tabpanel>
+    </tabpanels>
+  </tabbox>
+
+</dialog>
+
diff --git a/base/content/bluegriffon/dialogs/standaloneSidebar.js b/base/content/bluegriffon/dialogs/standaloneSidebar.js
new file mode 100644 (file)
index 0000000..bc872e8
--- /dev/null
@@ -0,0 +1,106 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+function Startup()
+{
+  if(window.arguments.length != 4)
+    return;
+
+  GetUIElements();
+
+  gDialog.name  = window.arguments[0];
+  gDialog.label = window.arguments[1];
+  gDialog.src   = window.arguments[2];
+  gDialog.sidebaritem = window.arguments[3];
+
+  document.documentElement.setAttribute("id", gDialog.name);
+  gDialog.iframe.setAttribute("src", gDialog.src);
+  document.title = gDialog.label;
+
+  var root = document.documentElement;
+  var item = gDialog.sidebaritem;
+  root.setAttribute("screenX", item.getAttribute("screenX"));
+  root.setAttribute("screenY", item.getAttribute("screenY"));
+  root.setAttribute("width",   item.getAttribute("width"));
+  root.setAttribute("height",  item.getAttribute("height"));
+}
+
+function Onclose()
+{
+  gDialog.sidebaritem.removeAttribute("standalone");
+
+  return true;
+}
+
+function Shutdown()
+{
+  var item = gDialog.sidebaritem;
+  var root = document.documentElement;
+
+  item.setAttribute("screenX", window.screenX);
+  item.setAttribute("screenY", window.screenY);
+  item.setAttribute("width",   document.documentElement.width);
+  item.setAttribute("height",  document.documentElement.height);
+
+  var doc = gDialog.sidebaritem.ownerDocument;
+  var id  = item.getAttribute("id");
+  doc.persist(id, "standalone");
+  doc.persist(id, "screenX");
+  doc.persist(id, "screenY");
+  doc.persist(id, "width");
+  doc.persist(id, "height");
+}
+
+function Reattach(aSide)
+{
+  var sidebar;
+  switch (aSide)
+  {
+    case "first":  sidebar = window.opener.gDialog.sidebar1; break;
+    case "second": sidebar = window.opener.gDialog.sidebar2; break;
+    default:
+      dump("bad sidebar descriptor\n");
+      return;
+  }
+  
+  var sidebaritem = gDialog.sidebaritem;
+  sidebaritem.removeAttribute("standalone");
+  sidebar.addContent( sidebaritem.getAttribute("name"),
+                      sidebaritem.getAttribute("title"),
+                      sidebaritem.getAttribute("src") );
+  window.close();
+}
diff --git a/base/content/bluegriffon/dialogs/standaloneSidebar.xul b/base/content/bluegriffon/dialogs/standaloneSidebar.xul
new file mode 100644 (file)
index 0000000..84061cb
--- /dev/null
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://bluegriffon/skin/standaloneSidebar.css" type="text/css"?>
+
+<!DOCTYPE window SYSTEM "chrome://bluegriffon/locale/standaloneSidebar.dtd">
+
+<window
+  id     = "standaloneSidebar"
+  windowtype = "Composer:standaloneSidebar"
+  width  = "300"
+  height = "300"
+  onload = "Startup()"
+  onclose = "Onclose()"
+  onunload = "Shutdown()"
+  persist="screenX screenY width height"
+  xmlns  = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/utils/dgid.js"/>
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/dialogs/standaloneSidebar.js"/>
+
+  <hbox align="center" id="mainMenu">
+    <spacer flex="1"/>
+    <toolbarbutton label="&reattachMenu.label;" type="menu">
+      <menupopup>
+        <menuitem label="&intoFirstSidebar.label;"  oncommand="Reattach('first')"/>
+        <menuitem label="&intoSecondSidebar.label;" oncommand="Reattach('second')"/>
+      </menupopup>
+    </toolbarbutton>
+  </hbox>
+  <iframe flex="1" id="iframe"/>
+
+</window>
diff --git a/base/content/bluegriffon/hsPanel.png b/base/content/bluegriffon/hsPanel.png
new file mode 100644 (file)
index 0000000..ae2f66c
Binary files /dev/null and b/base/content/bluegriffon/hsPanel.png differ
diff --git a/base/content/bluegriffon/js/aboutDialog.js b/base/content/bluegriffon/js/aboutDialog.js
new file mode 100644 (file)
index 0000000..87d0701
--- /dev/null
@@ -0,0 +1,94 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla Firebird about dialog.
+#
+# The Initial Developer of the Original Code is
+# Blake Ross (blaker@netscape.com).
+# Portions created by the Initial Developer are Copyright (C) 2002
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Daniel Glazman <daniel.glazman@disruptive-innovations.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the LGPL or the GPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK ***** -->
+
+var gSelectedPage = 0;
+
+function init(aEvent) 
+{
+  if (aEvent.target != document)
+    return;
+  var userAgentField = document.getElementById("userAgent");
+  var userAgentString = document.createTextNode(navigator.userAgent);
+  userAgentField.appendChild(userAgentString);
+
+  var button = document.documentElement.getButton("extra2");
+  button.setAttribute("label", document.documentElement.getAttribute("creditslabel"));
+  button.addEventListener("command", switchPage, false);
+
+  document.documentElement.getButton("accept").focus();
+#ifdef XP_MACOSX
+  // it may not be sized at this point, and we need its width to calculate its position
+  window.sizeToContent();
+  window.moveTo((screen.availWidth / 2) - (window.outerWidth / 2), screen.availHeight / 5);
+#endif
+}
+
+function uninit(aEvent)
+{
+  if (aEvent.target != document)
+    return;
+  var iframe = document.getElementById("creditsIframe");
+  iframe.setAttribute("src", "");
+}
+
+function switchPage(aEvent)
+{
+  var button = aEvent.target;
+  if (button.localName != "button")
+    return;
+
+  var iframe = document.getElementById("creditsIframe");
+  if (gSelectedPage == 0) { 
+    iframe.setAttribute("src", "chrome://bluegriffon/content/credits.xhtml");
+    button.setAttribute("label", document.documentElement.getAttribute("aboutlabel"));
+    gSelectedPage = 1;
+  }
+  else {
+    iframe.setAttribute("src", ""); 
+    button.setAttribute("label", document.documentElement.getAttribute("creditslabel"));
+    gSelectedPage = 0;
+  }
+  var modes = document.getElementById("modes");
+  modes.setAttribute("selectedIndex", gSelectedPage);
+}
+
+function openURL(aUrl)
+{
+  var iframe = document.getElementById("creditsIframe");
+  iframe.setAttribute("src", aUrl);
+}
+
diff --git a/base/content/bluegriffon/js/activeSourceView.js b/base/content/bluegriffon/js/activeSourceView.js
new file mode 100644 (file)
index 0000000..c8bb674
--- /dev/null
@@ -0,0 +1,947 @@
+function ActiveSourceTree(aEditor)
+{
+  this.mOldSourceElt = null;
+  this.mOneEltSelected = false;
+  this.mOldSelectedLi = null;
+
+  this.mEditing = false;
+  this.mEditedNode = null;
+
+  this.mMutationsEnabled = true;
+
+  this.mSourceTreeXULElement = null;
+  this.mEditor = null;
+
+  this.mRefuseNextMergeTransaction = false;
+
+  this.startup(aEditor);
+}
+
+ActiveSourceTree.prototype.startup =
+function(aEditor)
+{
+    function ActiveSourceTreeContentListener(aActiveSourceTree)
+    {
+      this.init(aActiveSourceTree);
+    }
+    
+    ActiveSourceTreeContentListener.prototype = {
+    
+      init : function(aActiveSourceTree)
+        {
+          this.mActiveSourceTree = aActiveSourceTree;
+        },
+    
+      QueryInterface : function(aIID)
+        {
+          if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
+              aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
+              aIID.equals(Components.interfaces.nsISupports))
+            return this;
+          throw Components.results.NS_NOINTERFACE;
+        },
+    
+      onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus)
+      {
+        const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
+    
+        if (aStateFlags & nsIWebProgressListener.STATE_IS_DOCUMENT)
+        {
+          if (aStateFlags & nsIWebProgressListener.STATE_STOP)
+          {
+            this.mActiveSourceTree.postStartup();
+          }
+        }
+      },
+    
+      onProgressChange : function(aWebProgress, aRequest,
+                                  aCurSelfProgress, aMaxSelfProgress,
+                                  aCurTotalProgress, aMaxTotalProgress)
+      {},
+    
+      onLocationChange : function(aWebProgress, aRequest, aLocation)
+      {},
+    
+      onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage)
+      {},
+    
+      onSecurityChange : function(aWebProgress, aRequest, aState)
+      {},
+    };
+
+  var sourceTreeDeck = gDialog.sourceTreeDeck;
+
+  var browser = document.createElement("browser");
+  browser.setAttribute("flex", "1");
+
+  sourceTreeDeck.appendChild(browser);
+  sourceTreeDeck.selectedPanel = browser;
+
+  this.mSourceTreeXULElement = browser;
+  this.mEditor = aEditor;
+  browser.setAttribute("src", "chrome://bluegriffon/content/sourceViewTemplate.html");
+  var docShell = browser.docShell;
+  var progress = docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebProgress);
+  var progressListener = new ActiveSourceTreeContentListener(this);
+  progress.addProgressListener(progressListener, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
+
+
+};
+
+ActiveSourceTree.prototype.postStartup =
+function()
+{
+  this.mSourceTreeXULElement.contentWindow.startup();
+  this.addEditorListeners();
+  this.addSourceTreeListeners();
+
+  this.serializeInSourceTree();
+};
+
+ActiveSourceTree.prototype.shutdown =
+function()
+{
+  this.removeEditorListeners();
+  this.removeSourceTreeListeners()
+
+};
+
+ActiveSourceTree.prototype.addEditorListeners =
+function()
+{
+  var doc = this.mEditor.contentDocument;
+  var _self = this;
+
+  doc.addEventListener("DOMAttrModified",          function(aEvent){_self.onBrowserMutateAttribute(aEvent)}, false);
+  doc.addEventListener("DOMNodeInserted",          function(aEvent){_self.onBrowserMutateNode(aEvent)}, false);
+  doc.addEventListener("DOMNodeRemoved",           function(aEvent){_self.onBrowserMutateNode(aEvent)}, false);
+  doc.addEventListener("DOMCharacterDataModified", function(aEvent){_self.onBrowserMutateText(aEvent)}, false);
+
+  NotifierUtils.addNotifierCallback("selection",   function(a,b,c){_self.onBrowserSelectionChanged(a,b,c)}, this);
+};
+
+ActiveSourceTree.prototype.removeEditorListeners =
+function()
+{
+  var doc = this.mEditor.contentDocument;
+  var _self = this;  
+
+  doc.removeEventListener("DOMAttrModified",          function(aEvent){_self.onBrowserMutateAttribute(aEvent)}, false);
+  doc.removeEventListener("DOMNodeInserted",          function(aEvent){_self.onBrowserMutateNode(aEvent)}, false);
+  doc.removeEventListener("DOMNodeRemoved",           function(aEvent){_self.onBrowserMutateNode(aEvent)}, false);
+  doc.removeEventListener("DOMCharacterDataModified", function(aEvent){_self.onBrowserMutateText(aEvent)}, false);
+
+  NotifierUtils.removeNotifierCallback("selection",   function(a,b,c){_self.onBrowserSelectionChanged(a,b,c)});
+};
+
+ActiveSourceTree.prototype.addSourceTreeListeners =
+function()
+{
+  var sourceDoc = this.mSourceTreeXULElement.contentDocument;
+  var _self = this;
+
+  sourceDoc.addEventListener("mousemove",                function(aEvent){_self.onSourceViewMouseMove(aEvent)}, true);
+  sourceDoc.addEventListener("click",                    function(aEvent){_self.onSourceViewClick(aEvent)}, true);
+  sourceDoc.addEventListener("keypress",                 function(aEvent){_self.onSourceViewKeyPress(aEvent)}, true);
+  sourceDoc.addEventListener("blur",                     function(aEvent){_self.onSourceViewBlur(aEvent)}, true);
+  sourceDoc.addEventListener("DOMCharacterDataModified", function(aEvent){_self.onSourceViewMutateText(aEvent)}, false);
+};
+
+ActiveSourceTree.prototype.removeSourceTreeListeners =
+function()
+{
+  var sourceDoc = this.mSourceTreeXULElement.contentDocument;
+  var _self = this;
+
+  sourceDoc.removeEventListener("mousemove",                function(aEvent){_self.onSourceViewMouseMove(aEvent)}, true);
+  sourceDoc.removeEventListener("click",                    function(aEvent){_self.onSourceViewClick(aEvent)}, true);
+  sourceDoc.removeEventListener("keypress",                 function(aEvent){_self.onSourceViewKeyPress(aEvent)}, true);
+  sourceDoc.removeEventListener("blur",                     function(aEvent){_self.onSourceViewBlur(aEvent)}, true);
+  sourceDoc.removeEventListener("DOMCharacterDataModified", function(aEvent){_self.onSourceViewMutateText(aEvent)}, false);
+};
+
+ActiveSourceTree.prototype.onSourceViewBlur =
+function(aEvent)
+{
+  var target = aEvent.target;
+  if (target &&
+      target.nodeType == Node.ELEMENT_NODE &&
+      target.getAttribute("contenteditable") == "true")
+    this.mRefuseNextMergeTransaction = true;
+
+  this.mOneEltSelected = false;
+  if (this.mOldSelectedLi)
+    this.mOldSelectedLi.removeAttribute("selected");
+  this.mOldSelectedLi = null;};
+
+ActiveSourceTree.prototype.serializeInSourceTree =
+function()
+{
+  this.cleanupSourceTree();
+
+  this.mMutationsEnabled = false;
+
+  var sourceDoc = this.mSourceTreeXULElement.contentDocument;
+  var doc = this.mEditor.contentDocument;
+
+  // create the initial UL that will hold the root element
+  var currentUL = sourceDoc.createElement("ul");
+  sourceDoc.body.appendChild(currentUL);
+
+  this.addEltToSourceView(sourceDoc,
+                          doc.documentElement,
+                          currentUL);
+
+  this.mMutationsEnabled = true;
+};
+
+ActiveSourceTree.prototype.addEltToSourceView =
+function(aDoc, aNode, aCurrentUL)
+{
+    while (aNode)
+    {
+      var li; 
+      switch (aNode.nodeType)
+      {
+        case Node.TEXT_NODE:
+          li = this.createSourceViewForTextNode(aDoc, aNode, aCurrentUL);
+          aCurrentUL.appendChild(li);
+          if (!aNode.data.match( /\S/g ))
+            li.setAttribute("style", "display: none");
+          break;
+        case Node.ELEMENT_NODE:
+          if (aNode.nodeName.toLowerCase() != "br" ||
+              aNode.getAttribute("type") != "_moz")
+          {
+            li = this.createSourceViewForElementNode(aDoc, aNode, aCurrentUL, null);
+            aCurrentUL.appendChild(li);
+          }
+          break;
+        default:
+          break;
+      }
+      aNode = aNode.nextSibling;
+    }
+};
+
+ActiveSourceTree.prototype.createSourceViewForTextNode =
+function(aDoc, aNode, aCurrentUL)
+{
+  var span = aDoc.createElement("span");
+  span.setAttribute("class", "textNode");
+
+  var t = aDoc.createTextNode(aNode.data);
+  var li = aDoc.createElement("li");
+  var id = this.getRandomID();
+  li.setAttribute("id", id);
+  li.setAttribute("contenteditable", "true");
+  span.appendChild(t);
+  li.appendChild(span);
+  li.setUserData("originalNode", aNode, null);
+  aNode.setUserData("sourceViewID", id, null);
+  li.setAttribute("empty", "true");
+  return li
+};
+
+ActiveSourceTree.prototype.createSourceViewForElementNode =
+function(aDoc, aNode, aCurrentUL, aCurrentLI)
+{
+  var li;
+  if (aCurrentLI)
+    li = aCurrentLI;
+  else
+  {
+    var id = this.getRandomID();
+    li = aDoc.createElement("li");
+    li.setAttribute("id", id);
+    aNode.setUserData("sourceViewID", id, null);
+  }
+                    
+  var img = aDoc.createElement("img");
+  img.setAttribute("src", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAABGdBTUEAANbY1E9YMgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADgSURBVHjalFFLDgFBFKw2RAwJiVjYOIA4gI0zuI6jOAFrC4mt2FhYij0SvxHjMxmjP1r3zCBMCJW87uq86pfqaiKlxK+I66UzGMvhZPZRVC2XUK9VCPTkRrMrvyHsB5M1hOAgJOCGkQDnTDEJRi+vNjQYoyEL3kCViNEznIP9EMfu5HrlSKXSqjL+2TQzyOYK6pIXnSyEwH6/VTtDPl/EZj3H5ezCc09R8dG24KkmD+1sV3OfC9/7m3hnLeAcbXBK0e+1YS2nflKGoSXpp1jn2BrpnJNhRXPWIP/84E2AAQCcuIfwPqAmjQAAAABJRU5ErkJggg==");
+  img.setAttribute("class", "minusTwisty");
+  li.appendChild(img);
+  
+  var img = aDoc.createElement("img");
+  img.setAttribute("src", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAABGdBTUEAANbY1E9YMgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADHSURBVHjalJE9CsJAEIXfEsEihTfwAOIBbDyD1/EonsDewhPYWFiJ2FgIFjYRE2PIz/5k3DExQRZFH+wPzDePt7OCiPCrOrwtVjta708fodGgj8l4KMDO09mSvqmuV84sYzSEaN2qdAQli/cYLKXkC2tgJTMkt9CFy1LD93tO3uNh68LGGETRxZ4KVJJtNiiyFHl6d+E4DJDborZxiMrnw/lutHLha3BGEofQ0sJNboLnMeK3MM9xvuE5d+vlzpkl/vnBhwADALPWiKYmr0SBAAAAAElFTkSuQmCC");
+  img.setAttribute("class", "plusTwisty");
+  li.appendChild(img);
+  
+  var lt = aDoc.createTextNode("<");
+  li.appendChild(lt);
+
+  var span = aDoc.createElement("span");
+  span.setAttribute("class", "tagName");
+  var tagName = aNode.nodeName.toLowerCase();
+  var t = aDoc.createTextNode(tagName);
+  span.appendChild(t);
+  li.appendChild(span);
+
+  if (aNode.attributes.length)
+  {
+    var attributes = aNode.attributes;
+    for (var i = 0; i < attributes.length; i++)
+    {
+      var name = attributes[i].nodeName;
+      if (name.substr(0, 4) == "_moz")
+        continue;
+
+      // the @ in the line below is here because of bug 455992
+      span = aDoc.createElement("span");
+      span.setAttribute("class", "at-separator");
+      span.appendChild(aDoc.createTextNode("@"));
+      li.appendChild(span);
+
+      span = aDoc.createElement("span");
+      span.setAttribute("class", "attrName");
+      span.setAttribute("originalAttrName", name);
+      span.setAttribute("contenteditable", "true");
+      span.appendChild(aDoc.createTextNode(name));
+      li.appendChild(span);
+
+      li.appendChild(aDoc.createTextNode("=\""));
+
+      span = aDoc.createElement("span");
+      span.setAttribute("class", "attrValue");
+      span.setAttribute("originalAttrName", name);
+      span.setAttribute("contenteditable", "true");
+      span.appendChild(aDoc.createTextNode(attributes[i].nodeValue));
+      li.appendChild(span);
+
+      li.appendChild(aDoc.createTextNode("\""));
+    }
+  }
+
+  if (tagName == "style"  ||
+      tagName == "script" ||
+      tagName == "pre")
+    li.setAttribute("class", "pre-content");
+  li.appendChild(aDoc.createTextNode(">"));
+  li.setUserData("originalNode", aNode, null);
+
+  if (!aCurrentLI)
+  {
+    if (aNode.firstChild)
+    {
+      var newUL = aDoc.createElement("ul");
+      li.appendChild(newUL);
+  
+      this.addEltToSourceView(aDoc, aNode.firstChild, newUL);
+    }
+    else
+      li.setAttribute("empty", "true");
+  }
+
+  return li;
+};
+
+ActiveSourceTree.prototype.getRandomID =
+function()
+{
+  return "moz" + new Date().valueOf() +
+         "_" + Math.round(Math.random() * 100000);
+};
+
+ActiveSourceTree.prototype.onBrowserMutateNode =
+function(aEvent)
+{
+  if (!this.mMutationsEnabled)
+    return;
+
+  this.mMutationsEnabled = false;
+
+  var target = aEvent.target;
+  var parent = aEvent.relatedNode;
+  var removal = aEvent.type == "DOMNodeRemoved";
+
+  var sourceDoc = this.mSourceTreeXULElement.contentDocument;
+  if (removal)
+  {
+    var sourceViewID = target.getUserData("sourceViewID");
+    if (!sourceViewID)
+    {
+      this.mMutationsEnabled = true;
+      return;
+    }
+    var sourceTarget = sourceDoc.getElementById(sourceViewID);
+    if (!sourceTarget)
+    {
+      this.mMutationsEnabled = true;
+      return;
+    }
+    var sourceParent = sourceTarget.parentNode;
+    sourceParent.removeChild(sourceTarget);
+    if (!sourceParent.childNodes.length)
+      sourceParent.parentNode.removeChild(sourceParent);
+  }
+  else
+  {
+    var sourceViewID = parent.getUserData("sourceViewID");
+    var sourceParent = sourceDoc.getElementById(sourceViewID);
+    var currentUL = null;
+    if (sourceParent.lastChild.nodeName.toLowerCase() == "ul")
+      currentUL = sourceParent.lastChild;
+    else
+    {
+      currentUL = sourceDoc.createElement("ul");
+      sourceParent.appendChild(currentUL);
+    }
+
+    var nextSibling = target.nextSibling;
+    var sourceNextSibling = null;
+    if (nextSibling)
+    {
+      var sourceViewNextSiblingID =  nextSibling.getUserData("sourceViewID");
+      sourceNextSibling = sourceDoc.getElementById(sourceViewNextSiblingID);
+    }
+
+    var li = null;
+    switch (target.nodeType)
+    {
+      case Node.TEXT_NODE:
+        if (target.data.match( /\S/g ))
+        {
+          li = this.createSourceViewForTextNode(sourceDoc, target, currentUL);
+          currentUL.insertBefore(li, sourceNextSibling);
+        }
+          
+        break;
+      case Node.ELEMENT_NODE:
+        if (target.nodeName.toLowerCase() == "br" &&
+            target.getAttribute("type") == "_moz")
+          break;
+        li = this.createSourceViewForElementNode(sourceDoc, target, currentUL, null);
+        li.setAttribute("open", "true");
+        currentUL.insertBefore(li, sourceNextSibling);
+
+        li.setAttribute("selected", "true");
+        if (this.mOldSelectedLi && this.mOneEltSelected)
+        {
+          this.mOldSelectedLi.removeAttribute("selected");
+        }
+        this.mOneEltSelected = true;
+        this.mOldSelectedLi = li;
+        break;
+      default:
+        break;
+    }
+    if (li)
+      this.ensureElementIsVisible(this.mSourceTreeXULElement, li);
+  }
+
+  this.mMutationsEnabled = true;
+
+};
+
+ActiveSourceTree.prototype.cleanupSourceTree =
+function()
+{
+  this.mMutationsEnabled = false;
+
+  var sourceDoc = this.mSourceTreeXULElement.contentDocument;
+  sourceDoc.body.innerHTML = "";
+
+  this.mMutationsEnabled = true;
+};
+
+ActiveSourceTree.prototype.onBrowserMutateText =
+function(aEvent)
+{
+  if (!this.mMutationsEnabled)
+    return;
+
+  this.mMutationsEnabled = false;
+
+  var target = aEvent.target;
+  var sourceViewID = target.getUserData("sourceViewID");
+  var sourceDoc = this.mSourceTreeXULElement.contentDocument;
+  var sourceTarget = sourceDoc.getElementById(sourceViewID);
+  sourceTarget.firstChild.firstChild.data = target.data;
+
+  this.mMutationsEnabled = true;
+};
+
+ActiveSourceTree.prototype.onBrowserSelectionChanged =
+function(aArgs, aElt, aOneElementSelected)
+{
+  if (!this.mMutationsEnabled)
+    return;
+
+  var elt = EditorUtils.getSelectionContainer().node;
+  var sourceViewID = elt.getUserData("sourceViewID");
+  var sourceDoc = this.mSourceTreeXULElement.contentDocument;
+  var sourceElt = sourceDoc.getElementById(sourceViewID);
+  var e = sourceElt;
+  if (!e)
+    return;
+  while (e)
+  {
+    if (e.nodeType == Node.ELEMENT_NODE &&
+        e.nodeName.toLowerCase() == "li")
+      e.setAttribute("open", "true");
+    e = e.parentNode;
+  }
+  this.ensureElementIsVisible(this.mSourceTreeXULElement, sourceElt);
+
+  sourceElt.setAttribute("selected", "true");
+  if (this.mOldSelectedLi && this.mOneEltSelected)
+  {
+    this.mOldSelectedLi.removeAttribute("selected");
+  }
+  this.mOneEltSelected = true;
+  this.mOldSelectedLi = sourceElt;
+};
+
+ActiveSourceTree.prototype.onSourceViewMouseMove =
+function(aEvent)
+{
+  if (!this.mMutationsEnabled)
+    return;
+
+  if (this.mOneEltSelected)
+    return;
+  this._onSourceViewMouseMove(aEvent);
+};
+
+
+ActiveSourceTree.prototype._onSourceViewMouseMove =
+function(aEvent)
+{
+  var e = aEvent.originalTarget;
+  if (!e)
+    return;
+  if (e != this.mOldSourceElt &&
+      this.mOldSourceElt &&
+      this.mOldSourceElt.style)
+  {
+    //this.mOldSourceElt.style.outline = "";
+    if (this.mOldSelectedLi)
+      this.mOldSelectedLi.removeAttribute("selected");
+  }
+  this.mOldSourceElt = null;
+
+  var tagName = e.nodeName.toLowerCase();
+  if (tagName != "li" &&
+      tagName != "span" &&
+      tagName != "#text")
+    return;
+
+  if (tagName != "li")
+    e = e.parentNode;
+  if (this.mOneEltSelected)
+    this.mOldSelectedLi = e;
+  e = e.getUserData("originalNode");
+  if (e && e.style)
+  {
+    this.flash(EditorUtils.getCurrentEditorElement(), e);
+  }
+};
+
+ActiveSourceTree.prototype.ensureElementIsVisible =
+function(aXULContainer, aHTMLElement)
+{
+  var y = 0;
+  while (aHTMLElement)
+  {
+    y += aHTMLElement.offsetTop;
+    aHTMLElement = aHTMLElement.offsetParent;
+  }
+  aXULContainer.contentWindow.scroll(0, Math.max(0, y - 10));
+};
+
+ActiveSourceTree.prototype.flash =
+function(aXULContainer, aHTMLElement)
+{
+  this.mOldSourceElt = aHTMLElement;
+  //aHTMLElement.style.outline = "blue solid 2px";
+
+  this.ensureElementIsVisible(aXULContainer, aHTMLElement);
+};
+
+ActiveSourceTree.prototype.onSourceViewClick =
+function(aEvent)
+{
+  if (!this.mMutationsEnabled)
+    return;
+
+  var e = aEvent.explicitOriginalTarget;
+  var p = e.parentNode;
+  var currentTag = e.nodeName.toLowerCase();
+  if (e.nodeType == Node.TEXT_NODE &&
+      p.nodeType == Node.ELEMENT_NODE)
+  {
+    if (p.className == "tagName")
+    {
+      var li = p.parentNode;
+      li.setAttribute("selected", "true");
+      this.mOneEltSelected = true;
+      this._onSourceViewMouseMove(
+          { originalTarget: li }
+        );
+    }
+    else if (p.className == "textNode" ||
+             p.className == "attrName" ||
+             p.className == "attrValue")
+    {
+      this.mEditing = true;
+      this.mEditedNode = p;
+      this.mOneEltSelected = true;
+      switch (p.className)
+      {
+        case "textNode":
+          this._onSourceViewMouseMove(
+            { originalTarget: p.parentNode.parentNode.firstChild }
+          );
+          break;
+        case "attrName":
+        case "attrValue":
+          this._onSourceViewMouseMove(
+            { originalTarget: p.parentNode }
+          );
+          break;
+        default: break;
+      }
+    }
+  }
+  else if (this.mOneEltSelected &&
+           (currentTag == "li" ||
+            currentTag == "ul" ||
+            currentTag == "body"))
+  {
+    this.mOneEltSelected = false;
+    if (this.mOldSelectedLi)
+      this.mOldSelectedLi.removeAttribute("selected");
+    this.mOldSelectedLi = null;
+  }
+};
+
+ActiveSourceTree.prototype.getIndexOfNode =
+function getIndexOfNode(aNode)
+{
+  if (aNode)
+  {
+    // the following 3 lines are an excellent suggestion from Neil Rashbrook
+    var range = aNode.ownerDocument.createRange();
+    range.selectNode(aNode);
+    return range.startOffset;
+  }
+  return null;
+};
+
+ActiveSourceTree.prototype.onSourceViewKeyPress =
+function(aEvent)
+{
+  if (!this.mMutationsEnabled)
+    return;
+
+  if (aEvent.keyCode == 27 && // ESCAPE KEY
+      this.mEditing &&
+      this.mEditedNode)
+  {
+    this.mEditing = false;
+    this.mEditedNode.blur();
+    this.mEditedNode = null;
+  }
+};
+
+ActiveSourceTree.prototype.onSourceViewMutateText = function(aEvent)
+{
+  if (!this.mMutationsEnabled)
+    return;
+
+  this.mMutationsEnabled = false;
+
+  var e = aEvent.originalTarget; 
+  if (e.parentNode.nodeName.toLowerCase() == "span")
+  {
+    
+    var type = e.parentNode.className;
+    if (type != "textNode" &&
+        type != "attrName" &&
+        type != "attrValue")
+      return;
+
+    
+    switch (e.parentNode.className)
+    {
+      case "textNode":
+        {
+          var textNode = e.parentNode.parentNode.getUserData("originalNode");
+          var txn = new diTextNodeChangedTxn(this, textNode, e.data);
+          EditorUtils.getCurrentEditor().transactionManager.doTransaction(txn);          
+        }
+        break;
+      case "attrValue":
+        {
+          var targetElement = e.parentNode.parentNode.getUserData("originalNode");
+          var attrName = e.parentNode.getAttribute("originalattrname");
+          var txn = new diAttrChangedTxn(this, targetElement, attrName, e.data);
+          EditorUtils.getCurrentEditor().transactionManager.doTransaction(txn);  
+        }
+        break;
+        case "attrName":
+        {
+          var targetElement = e.parentNode.parentNode.getUserData("originalNode");
+          var attrName = e.parentNode.getAttribute("originalattrname");
+          var newName = e.data;
+          var txn = new diAttrNameChangedTxn(this, targetElement, attrName, newName);
+          EditorUtils.getCurrentEditor().transactionManager.doTransaction(txn);
+          e.parentNode.setAttribute("originalattrname", newName);
+          e.parentNode.nextSibling.nextSibling.setAttribute("originalattrname", newName);
+        }
+        break;
+      default:
+        break;
+    }
+  }
+
+  this.mMutationsEnabled = true;
+
+};
+
+ActiveSourceTree.prototype.onBrowserMutateAttribute =
+function(aEvent)
+{
+  if (!this.mMutationsEnabled)
+    return;
+
+  var target = aEvent.target;
+
+  var attrChange = aEvent.attrChange;
+  var attrName = aEvent.attrName;
+  var newValue = aEvent.newValue;
+
+  // early way out in case of a scrollbar change
+  if (attrName == "curpos" ||
+      attrName.substr(0, 4) == "_moz")
+    return;
+
+  this.mMutationsEnabled = false;
+
+  var sourceViewID = target.getUserData("sourceViewID");
+  var sourceDoc = this.mSourceTreeXULElement.contentDocument;
+  var sourceElt = sourceDoc.getElementById(sourceViewID);
+
+  switch (attrChange)
+  {
+    case MutationEvent.ADDITION:
+    case MutationEvent.MODIFICATION: break;
+    case MutationEvent.REMOVAL: break;
+    default: break;
+  }
+
+  var child = sourceElt.firstChild;
+  while (child && child.nodeName.toLowerCase() != "ul")
+  {
+    var tmp = child.nextSibling;
+    sourceElt.removeChild(child);
+    child = tmp;
+  }
+
+  this.createSourceViewForElementNode(sourceDoc, target, sourceElt.parentNode, sourceElt);
+  if (sourceElt.firstChild.nodeName.toLowerCase() == "ul")
+    sourceElt.appendChild(sourceElt.firstChild);
+
+  this.mMutationsEnabled = true;
+};
+
+
+/********************** diTextNodeChangedTxn **********************/
+
+function diTextNodeChangedTxn(aContext, aNode, aData)
+{
+  this.mContext = aContext;
+  this.mNode = aNode;
+  this.mOldData = aNode.data;
+  this.mNewData = aData;
+}
+
+diTextNodeChangedTxn.prototype = {
+
+  getNode:    function() { return this.mNode; },
+  getOldData: function() { return this.mOldData; },
+  getNewData: function() { return this.mNewData; },
+
+  QueryInterface : function(aIID)
+  {
+    if (aIID.equals(Components.interfaces.nsITransaction) ||
+        aIID.equals(Components.interfaces.diITextNodeChangedTxn) ||
+        aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
+        aIID.equals(Components.interfaces.nsISupports))
+      return this;
+    throw Components.results.NS_NOINTERFACE;
+  },
+
+  doTransaction: function()
+  {
+    this.mNode.data = this.mNewData;
+  },
+
+  undoTransaction: function()
+  {
+    this.mNode.data = this.mOldData;
+  },
+
+  redoTransaction: function()
+  {
+    this.doTransaction();
+  },
+
+  isTransient: false,
+
+  merge: function(aTransaction)
+  {
+    var txn = aTransaction.QueryInterface(Components.interfaces.diITextNodeChangedTxn);
+    if (txn)
+    {
+      if (this.getNode() == txn.getNode())
+      {
+        if (this.mContext.mRefuseNextMergeTransaction)
+          this.mContext.mRefuseNextMergeTransaction = false;
+        else
+        {
+          this.mNewData = txn.getNewData();
+          return true;
+        }
+      }
+    }
+    return false;
+  }
+};
+
+/********************** diAttrChangedTxn **********************/
+
+function diAttrChangedTxn(aContext, aNode, aAttrName, aData)
+{
+  this.mContext = aContext;
+  this.mNode = aNode;
+  this.mAttrName = aAttrName;
+  this.mAttrWasSet = this.mNode.hasAttribute(this.mAttrName);
+  this.mOldData = this.mNode.getAttribute(this.mAttrName);
+  this.mNewData = aData;
+}
+
+diAttrChangedTxn.prototype = {
+
+  getNode:          function() { return this.mNode; },
+  getOldData:       function() { return this.mOldData; },
+  getNewData:       function() { return this.mNewData; },
+  getAttributeName: function() { return this.mAttrName; },
+
+  QueryInterface : function(aIID)
+  {
+    if (aIID.equals(Components.interfaces.nsITransaction) ||
+        aIID.equals(Components.interfaces.diIAttrChangedTxn) ||
+        aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
+        aIID.equals(Components.interfaces.nsISupports))
+      return this;
+    throw Components.results.NS_NOINTERFACE;
+  },
+
+  doTransaction: function()
+  {
+    this.mNode.setAttribute(this.mAttrName, this.mNewData);
+  },
+
+  undoTransaction: function()
+  {
+    if (this.mAttrWasSet)
+      this.mNode.setAttribute(this.mAttrName, this.mOldData);
+    else
+      this.mNode.removeAttribute(this.mAttrName);
+  },
+
+  redoTransaction: function()
+  {
+    this.doTransaction();
+  },
+
+  isTransient: false,
+
+  merge: function(aTransaction)
+  {
+    var txn = aTransaction.QueryInterface(Components.interfaces.diIAttrChangedTxn);
+    if (txn)
+    {
+      if (this.getNode() == txn.getNode() &&
+          this.getAttributeName() == txn.getAttributeName())
+      {
+        if (this.mContext.mRefuseNextMergeTransaction)
+          this.mContext.mRefuseNextMergeTransaction = false;
+        else
+        {
+          this.mNewData = txn.getNewData();
+          return true;
+        }
+      }
+    }
+    return false;
+  }
+};
+
+/********************** diAttrNameChangedTxn **********************/
+
+function diAttrNameChangedTxn(aContext, aNode, aOldAttrName, aNewAttrName)
+{
+  this.mContext = aContext;
+  this.mNode = aNode;
+  this.mOldAttrName = aOldAttrName;
+  this.mNewAttrName = aNewAttrName;
+
+  this.mValue = this.mNode.getAttribute(this.mOldAttrName);
+}
+
+diAttrNameChangedTxn.prototype = {
+
+  getNode:             function() { return this.mNode; },
+  getNewAttributeName: function() { return this.mNewAttrName; },
+
+
+  QueryInterface : function(aIID)
+  {
+    if (aIID.equals(Components.interfaces.nsITransaction) ||
+        aIID.equals(Components.interfaces.diIAttrNameChangedTxn) ||
+        aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
+        aIID.equals(Components.interfaces.nsISupports))
+      return this;
+    throw Components.results.NS_NOINTERFACE;
+  },
+
+  doTransaction: function()
+  {
+    this.mNode.removeAttribute(this.mOldAttrName);
+    this.mNode.setAttribute(this.mNewAttrName, this.mValue);
+  },
+
+  undoTransaction: function()
+  {
+    this.mNode.removeAttribute(this.mNewAttrName);
+    this.mNode.setAttribute(this.mOldAttrName, this.mValue);
+  },
+
+  redoTransaction: function()
+  {
+    this.doTransaction();
+  },
+
+  isTransient: false,
+
+  merge: function(aTransaction)
+  {
+    var txn = aTransaction.QueryInterface(Components.interfaces.diIAttrChangedTxn);
+    if (txn)
+    {
+      if (this.getNode() == txn.getNode())
+      {
+        if (this.mContext.mRefuseNextMergeTransaction)
+          this.mContext.mRefuseNextMergeTransaction = false;
+        else
+        {
+          this.mNewAttrName = txn.getNewAttributeName();
+          return true;
+        }
+      }
+    }
+    return false;
+  }
+};
diff --git a/base/content/bluegriffon/js/bluegriffon.js b/base/content/bluegriffon/js/bluegriffon.js
new file mode 100644 (file)
index 0000000..3aa86ca
--- /dev/null
@@ -0,0 +1,376 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#include observers.inc
+
+#include startup.inc
+
+#include shutdown.inc
+
+function OpenLocation(aEvent, type)
+{
+  window.openDialog("chrome://bluegriffon/content/dialogs/openLocation.xul","_blank",
+              "chrome,modal,titlebar", type);
+  if (aEvent) aEvent.stopPropagation();
+}
+
+function OpenNewWindow(aURL)
+{
+  // warning, the first argument MUST be null here because when the
+  // first window is created, it gets the cmdLine as an argument
+  window.delayedOpenWindow("chrome://bluegriffon/content/xul/bluegriffon.xul", "chrome,all,dialog=no", null, aURL);
+}
+
+function NewDocument(aEvent)
+{
+  OpenFile("chrome://bluegriffon/content/blanks/transitional.html", true);
+  if (aEvent) aEvent.stopPropagation();
+}
+
+function NewDocumentInNewWindow(aEvent)
+{
+  OpenFile("chrome://bluegriffon/content/blanks/transitional.html", false);
+  if (aEvent) aEvent.stopPropagation();
+}
+
+function OpenFile(aURL, aInTab)
+{
+  // early way out if no URL
+  if (!aURL)
+    return;
+  var alreadyEdited = EditorUtils.isAlreadyEdited(aURL);
+  if (alreadyEdited)
+  {
+    var win    = alreadyEdited.window;
+    var editor = alreadyEdited.editor;
+    var index  = alreadyEdited.index;
+    win.document.getElementById("tabeditor").selectedIndex = index;
+    win.document.getElementById("tabeditor").mTabpanels.selectedPanel = editor;
+
+    // nothing else to do here...
+    win.focus();
+    return;
+  }
+
+  if (aInTab)
+    document.getElementById("tabeditor").addEditor(
+         UrlUtils.stripUsernamePassword(aURL, null, null),
+         aURL);
+  else
+    OpenNewWindow(aURL);
+}
+
+function EditorLoadUrl(aElt, aURL)
+{
+  try {
+    if (aURL)
+    {
+      var url = UrlUtils.normalizeURL(aURL);
+
+      aElt.webNavigation.loadURI(url, // uri string
+             Components.interfaces.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE,     // load flags
+             null,                                         // referrer
+             null,                                         // post-data stream
+             null);
+    }
+  } catch (e) { dump(" EditorLoadUrl failed: "+e+"\n"); }
+}
+
+function AboutComposer()
+{
+  window.openDialog('chrome://bluegriffon/content/xul/aboutDialog.xul',
+                    "", "resizable=no");
+}
+
+function OpenConsole()
+{
+  window.open("chrome://global/content/console.xul","_blank",
+              "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar");
+}
+
+function OpenExtensionsManager()
+{
+  window.openDialog("chrome://mozapps/content/extensions/extensions.xul?type=extensions",
+                    "",
+                    "chrome,dialog=no,resizable");
+}
+
+function StopLoadingPage()
+{
+  gDialog.tabeditor.stopWebNavigation();
+}
+
+//--------------------------------------------------------------------
+function onButtonUpdate(button, commmandID)
+{
+  var commandNode = gDialog[commmandID];
+  var state = commandNode.getAttribute("state");
+  button.checked = state == "true";
+}
+
+function UpdateWindowTitle()
+{
+  try {
+    var windowTitle = EditorUtils.getDocumentTitle();
+    if (!windowTitle)
+      windowTitle = L10NUtils.getString("untitled");
+
+    // Append just the 'leaf' filename to the Doc. Title for the window caption
+    var docUrl = UrlUtils.getDocumentUrl();
+    if (docUrl && !UrlUtils.isUrlAboutBlank(docUrl))
+    {
+      var scheme = UrlUtils.getScheme(docUrl);
+      var filename = UrlUtils.getFilename(docUrl);
+      if (filename)
+        windowTitle += " [" + scheme + ":/.../" + filename + "]";
+
+      // TODO: 1. Save changed title in the recent pages data in prefs
+    }
+
+    // Set window title with
+    var titleModifier = L10NUtils.getString("titleModifier");
+    document.title    = L10NUtils.getBundle()
+                                 .formatStringFromName("titleFormat",
+                                                       [windowTitle, titleModifier],
+                                                       2);
+  } catch (e) { dump(e); }
+}
+
+function onParagraphFormatChange(paraMenuList, commandID)
+{
+  if (!paraMenuList)
+    return;
+
+  var commandNode = gDialog[commandID];
+  var state = commandNode.getAttribute("state");
+
+  // force match with "normal"
+  if (state == "body")
+    state = "";
+
+  if (state == "mixed")
+  {
+    //Selection is the "mixed" ( > 1 style) state
+    paraMenuList.selectedItem = null;
+    paraMenuList.setAttribute("label",GetString('Mixed'));
+  }
+  else
+  {
+    var menuPopup = gDialog.ParagraphPopup;
+    var menuItems = menuPopup.childNodes;
+    for (var i=0; i < menuItems.length; i++)
+    {
+      var menuItem = menuItems.item(i);
+      if ("value" in menuItem && menuItem.value == state)
+      {
+        paraMenuList.selectedItem = menuItem;
+        break;
+      }
+    }
+  }
+}
+
+/************* GLOBAL VARS *************/
+
+
+
+/************* FONT FACE ****************/
+
+function initFontFaceMenu(menuPopup)
+{
+  initLocalFontFaceMenu(menuPopup);
+
+  if (menuPopup)
+  {
+    var children = menuPopup.childNodes;
+    if (!children) return;
+
+    var firstHas = { value: false };
+    var anyHas = { value: false };
+    var allHas = { value: false };
+
+    // we need to set or clear the checkmark for each menu item since the selection
+    // may be in a new location from where it was when the menu was previously opened
+
+    // Fixed width (second menu item) is special case: old TT ("teletype") attribute
+    EditorUtils.getTextProperty("tt", "", "", firstHas, anyHas, allHas);
+    children[1].setAttribute("checked", allHas.value);
+
+    if (!anyHas.value)
+      EditorUtils.getTextProperty("font", "face", "", firstHas, anyHas, allHas);
+
+    children[0].setAttribute("checked", !anyHas.value);
+
+    // Skip over default, TT, and separator
+    for (var i = 3; i < children.length; i++)
+    {
+      var menuItem = children[i];
+      var faceType = menuItem.getAttribute("value");
+
+      if (faceType)
+      {
+        EditorUtils.getTextProperty("font", "face", faceType, firstHas, anyHas, allHas);
+
+        // Check the menuitem only if all of selection has the face
+        if (allHas.value)
+        {
+          menuItem.setAttribute("checked", "true");
+          break;
+        }
+
+        // in case none match, make sure we've cleared the checkmark
+        menuItem.removeAttribute("checked");
+      }
+    }
+  }
+}
+
+const kFixedFontFaceMenuItems = 7; // number of fixed font face menuitems
+
+function initLocalFontFaceMenu(menuPopup)
+{
+  // fill in the menu only once...
+  var callingId = menuPopup.parentNode.id;
+
+  if(!BlueGriffonVars.fontMenuOk)
+    BlueGriffonVars.fontMenuOk = {};
+  if (BlueGriffonVars.fontMenuOk[callingId ] &&
+      menuPopup.childNodes.length != kFixedFontFaceMenuItems)
+    return;
+  BlueGriffonVars.fontMenuOk[callingId ] = callingId ;
+
+  if (!BlueGriffonVars.localFonts)
+  {
+    // Build list of all local fonts once per editor
+    try 
+    {
+      var enumerator = Components.classes["@mozilla.org/gfx/fontenumerator;1"]
+                                 .getService(Components.interfaces.nsIFontEnumerator);
+      var localFontCount = { value: 0 }
+      BlueGriffonVars.localFonts = enumerator.EnumerateAllFonts(localFontCount);
+    }
+    catch(e) { }
+  }
+  
+  var useRadioMenuitems = (menuPopup.parentNode.localName == "menu"); // don't do this for menulists  
+  if (menuPopup.childNodes.length == kFixedFontFaceMenuItems) 
+  {
+    if (BlueGriffonVars.localFonts.length == 0) {
+      menuPopup.childNodes[kFixedFontFaceMenuItems - 1].hidden = true;
+    }
+    for (var i = 0; i < BlueGriffonVars.localFonts.length; ++i)
+    {
+      if (BlueGriffonVars.localFonts[i] != "")
+      {
+        var itemNode = document.createElementNS(BlueGriffonVars.kXUL_NS, "menuitem");
+        itemNode.setAttribute("label", BlueGriffonVars.localFonts[i]);
+        itemNode.setAttribute("value", BlueGriffonVars.localFonts[i]);
+        if (useRadioMenuitems) {
+          itemNode.setAttribute("type", "radio");
+          itemNode.setAttribute("name", "2");
+          itemNode.setAttribute("observes", "cmd_renderedHTMLEnabler");
+        }
+        menuPopup.appendChild(itemNode);
+      }
+    }
+  }
+}
+
+function onFontFaceChange(fontFaceMenuList, commandID)
+{
+  var commandNode = document.getElementById(commandID);
+  var state = commandNode.getAttribute("state");
+
+  if (state == "mixed")
+  {
+    //Selection is the "mixed" ( > 1 style) state
+    fontFaceMenuList.selectedItem = null;
+    fontFaceMenuList.setAttribute("label",GetString('Mixed'));
+  }
+  else
+  {
+    var menuPopup = document.getElementById("FontFacePopup");
+    var menuItems = menuPopup.childNodes;
+    for (var i=0; i < menuItems.length; i++)
+    {
+      var menuItem = menuItems.item(i);
+      if (menuItem.getAttribute("label") && ("value" in menuItem && menuItem.value.toLowerCase() == state.toLowerCase()))
+      {
+        fontFaceMenuList.selectedItem = menuItem;
+        break;
+      }
+    }
+  }
+}
+
+/************** CLASS MANAGEMENT **************/
+
+function onClassChange(classMenuList, commandID)
+{
+  var commandNode = document.getElementById(commandID);
+  var state = commandNode.getAttribute("state");
+  classMenuList.setAttribute("label", state);
+}
+
+function ToggleSplitter(aElt, aId)
+{
+  if (aElt.getAttribute("disabled") == "true")
+    return;
+  var splitter = document.getElementById(aId);
+  if (splitter)
+  {
+    if (splitter.hasAttribute("state"))
+      splitter.removeAttribute("state");
+    else
+      splitter.setAttribute("state", "collapsed");
+  }
+}
+
+function ShowLanguageDialog(aEvent)
+{
+  var popupNode = document.popupNode;
+  if (popupNode)
+  {
+    var target = popupNode.getUserData("node");
+    if (target)
+      window.openDialog("chrome://bluegriffon/content/dialogs/languages.xul","_blank",
+                        "chrome,modal,titlebar", target);
+  }
+}
+
+
diff --git a/base/content/bluegriffon/js/col.js b/base/content/bluegriffon/js/col.js
new file mode 100644 (file)
index 0000000..b74028f
--- /dev/null
@@ -0,0 +1,326 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla.org.
+ *
+ * The Initial Developer of the Original Code is
+ * Neil Marshall.
+ * Portions created by the Initial Developer are Copyright (C) 2003
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Neil Marshall (neil.marshall@sympatico.ca), Original author
+ *   Daniel Glazman (glazman@disruptive-innovations.com), on behalf of Linspire Inc.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var colours;
+var satSlider = new objColour();
+var hexChars = "0123456789ABCDEF";
+var selectedColour = 0;
+var mouseDown = false;
+var eventInitiator = null;
+var mouseX, mouseY, offsetLeft, offsetTop;
+
+var gColor = "";
+var LastPickedColor = "";
+var ColorType = "Text";
+var TextType = false;
+var HighlightType = false;
+var TableOrCell = false;
+var LastPickedIsDefault = false;
+var NoDefault = false;
+var gColorObj;
+
+function StartUp()
+{
+
+  if (!window.arguments[1])
+  {
+    dump("colourPicker: Missing color object param\n");
+    return;
+  }
+
+  // window.arguments[1] is object to get initial values and return color data
+  gColorObj = window.arguments[1];
+  gColorObj.Cancel = false;
+
+  gDialog.red              = document.getElementById("red");
+  gDialog.blue             = document.getElementById("blue");
+  gDialog.green            = document.getElementById("green");
+  gDialog.hue              = document.getElementById("hue");
+  gDialog.saturation       = document.getElementById("saturation");
+  gDialog.brightness       = document.getElementById("brightness");
+  gDialog.hexColour        = document.getElementById("hexColour");
+  gDialog.nameColour       = document.getElementById("nameColour");
+
+  gDialog.redLabel = document.getElementById("redLabel");
+  gDialog.blueLabel = document.getElementById("blueLabel");
+  gDialog.greenLabel = document.getElementById("greenLabel");
+  gDialog.hueLabel = document.getElementById("hueLabel");
+  gDialog.saturationLabel = document.getElementById("saturationLabel");
+  gDialog.brightnessLabel = document.getElementById("brightnessLabel");
+  gDialog.hexColourLabel = document.getElementById("hexColourLabel");
+  gDialog.nameColourLabel = document.getElementById("nameColourLabel");
+
+  gDialog.hueAndSaturationImg = document.getElementById("hueAndSaturationImg");
+  gDialog.hueAndSaturationCrosshair = document.getElementById("hueAndSaturationCrosshair");
+  gDialog.brightnessImg    = document.getElementById("brightnessImg");
+  gDialog.swatch           = document.getElementById("swatch");
+  gDialog.brightnessArrow  = document.getElementById("brightnessArrow");
+  gDialog.colorpicker      = document.getElementById("colorpicker");
+  gDialog.Ok               = document.documentElement.getButton("accept");
+  gDialog.transparencyCheckbox = document.getElementById("transparencyCheckbox");
+
+  gDialog.CellOrTableGroup = document.getElementById("CellOrTableGroup");
+  gDialog.TableRadio       = document.getElementById("TableRadio");
+  gDialog.CellRadio        = document.getElementById("CellRadio");
+  gDialog.LastPickedColor  = document.getElementById("LastPickedColor");
+
+  // The type of color we are setting: 
+  //  text: Text, Link, ActiveLink, VisitedLink, 
+  //  or background: Page, Table, or Cell
+  var prefs = GetPrefs();
+  if (gColorObj.Type)
+  {
+    ColorType = gColorObj.Type;
+    // Get string for dialog title from passed-in type 
+    //   (note constraint on editor.properties string name)
+    var IsCSSPrefChecked = prefs.getBoolPref("editor.use_css");
+
+    if (GetCurrentEditor())
+    {
+      window.title = GetString(ColorType+"Color");
+      if (ColorType == "Page" && IsCSSPrefChecked && IsHTMLEditor())
+        window.title = GetString("BlockColor");
+    }
+  }
+  if (!window.title)
+    window.title = GetString("Color");
+
+  colours = new objColour();
+
+  makeDraggable(gDialog.hueAndSaturationImg);
+  makeDraggable(gDialog.hueAndSaturationCrosshair);
+  makeDraggable(gDialog.brightnessImg);
+
+  gDialog.hexColour.value = "";
+  var tmpColor;
+  var haveTableRadio = false;
+  var showTransparencyCheckbox = false;
+
+  switch (ColorType)
+  {
+    case "Page":
+      tmpColor = gColorObj.PageColor;
+      if (tmpColor && tmpColor.toLowerCase() != "window")
+        gColor = tmpColor;
+      showTransparencyCheckbox = true;
+      break;
+    case "Table":
+      if (gColorObj.TableColor)
+        gColor = gColorObj.TableColor;
+      break;
+    case "Cell":
+      if (gColorObj.CellColor)
+        gColor = gColorObj.CellColor;
+      break;
+    case "TableOrCell":
+      TableOrCell = true;
+      document.getElementById("TableOrCellGroup").collapsed = false;
+      showTransparencyCheckbox = true;
+      haveTableRadio = true;
+      if (gColorObj.SelectedType == "Cell")
+      {
+        gColor = gColorObj.CellColor;
+        gDialog.CellOrTableGroup.selectedItem = gDialog.CellRadio;
+        gDialog.CellRadio.focus();
+      }
+      else
+      {
+        gColor = gColorObj.TableColor;
+        gDialog.CellOrTableGroup.selectedItem = gDialog.TableRadio;
+        gDialog.TableRadio.focus();
+      }
+      break;
+    case "Highlight":
+      HighlightType = true;
+      if (gColorObj.HighlightColor)
+        gColor = gColorObj.HighlightColor;
+      showTransparencyCheckbox = true;
+      break;
+    default:
+      // Any other type will change some kind of text,
+      TextType = true;
+      tmpColor = gColorObj.TextColor;
+      if (tmpColor && tmpColor.toLowerCase() != "windowtext")
+        gColor = gColorObj.TextColor;
+      break;
+  }
+
+  if (!gColor)
+  {
+    var useCustomColors = prefs.getBoolPref("editor.use_custom_colors");
+    switch (ColorType)
+    {
+      case "Page":
+      case "Highlight":
+        if (useCustomColors)
+          gColor = prefs.getCharPref("editor.background_color");
+        else
+        {
+          gColor = prefs.getCharPref("browser.display.background_color");
+        }
+        break;
+      case "Table":
+      case "Cell":
+      case "TableOrCell":
+        gColor = "transparent";
+        showTransparencyCheckbox = true;
+        break;
+      default:
+        if (useCustomColors)
+          gColor = prefs.getCharPref("editor.text_color");
+        else
+        {
+          gColor = prefs.getCharPref("browser.display.foreground_color");
+        }
+        break;
+    }
+  }
+
+  if (!showTransparencyCheckbox)
+    gDialog.transparencyCheckbox.setAttribute("hidden", true);
+
+  // Use last-picked colors passed in, or those persistent on dialog
+  if (TextType)
+  {
+    if ( !("LastTextColor" in gColorObj) || !gColorObj.LastTextColor)
+      gColorObj.LastTextColor = gDialog.LastPickedColor.getAttribute("LastTextColor");
+    LastPickedColor = gColorObj.LastTextColor;
+  }
+  else if (HighlightType)
+  {
+    if ( !("LastHighlightColor" in gColorObj) || !gColorObj.LastHighlightColor)
+      gColorObj.LastHighlightColor = gDialog.LastPickedColor.getAttribute("LastHighlightColor");
+    LastPickedColor = gColorObj.LastHighlightColor;
+  }
+  else
+  {
+    if ( !("LastBackgroundColor" in gColorObj) || !gColorObj.LastBackgroundColor)
+      gColorObj.LastBackgroundColor = gDialog.LastPickedColor.getAttribute("LastBackgroundColor");
+    LastPickedColor = gColorObj.LastBackgroundColor;
+  }
+  gDialog.LastPickedColor.setAttribute("style","background-color: "+LastPickedColor);
+
+  // Set initial color in input field and in the colorpicker
+  SetCurrentColor(gColor);
+  if (!showTransparencyCheckbox)
+    gDialog.colorpicker.initColor(gColor);
+
+  // Caller can prevent user from submitting an empty, i.e., default color
+  NoDefault = gColorObj.NoDefault;
+  if (NoDefault)
+  {
+    // Hide the "Default button -- user must pick a color
+    var defaultColorButton = document.getElementById("DefaultColorButton");
+    if (defaultColorButton)
+      defaultColorButton.collapsed = true;
+  }
+
+  // Set focus to colorpicker if not set to table radio buttons above
+  if (!haveTableRadio)
+    gDialog.colorpicker.focus();
+
+  SetWindowLocation();
+}
+
+function ValidateData()
+{
+  if (gDialog.transparencyCheckbox.checked)
+    gColor = "transparent";
+  else if (LastPickedIsDefault)
+    gColor = LastPickedColor;
+  else
+    gColor = gDialog.hexColour.value;
+
+  if (ColorType == "TableOrCell" &&
+      gColor == "transparent")
+    gColor = "";
+  gColor = TrimString(gColor).toLowerCase();
+
+  // TODO: Validate the color string!
+
+  if (NoDefault && !gColor)
+  {
+    ShowInputErrorMessage(GetString("NoColorError"));
+    SetTextboxFocus(gDialog.hexColour);
+    return false;   
+  }
+  return true;
+}
+
+function onAccept()
+{
+  if (!ValidateData())
+    return false;
+
+  // Set return values and save in persistent color attributes
+  if (TextType)
+  {
+    gColorObj.TextColor = gColor;
+    if (gColor.length > 0)
+    {
+      gDialog.LastPickedColor.setAttribute("LastTextColor", gColor);
+      gColorObj.LastTextColor = gColor;
+    }
+  }
+  else if (HighlightType)
+  {
+    gColorObj.HighlightColor = gColor;
+    if (gColor.length > 0)
+    {
+      gDialog.LastPickedColor.setAttribute("LastHighlightColor", gColor);
+      gColorObj.LastHighlightColor = gColor;
+    }
+  }
+  else
+  {
+    gColorObj.BackgroundColor = gColor;
+    if (gColor.length > 0)
+    {
+      gDialog.LastPickedColor.setAttribute("LastBackgroundColor", gColor);
+      gColorObj.LastBackgroundColor = gColor;
+    }
+    // If table or cell requested, tell caller which element to set on
+    if (TableOrCell && gDialog.TableRadio.selected)
+      gColorObj.Type = "Table";
+  }
+  SaveWindowLocation();
+
+  return true; // do close the window
+}
+
+
diff --git a/base/content/bluegriffon/js/colourPicker.js b/base/content/bluegriffon/js/colourPicker.js
new file mode 100644 (file)
index 0000000..18c3b17
--- /dev/null
@@ -0,0 +1,779 @@
+var gColorObj = {};
+var gWindowTitle = "";
+var gShowTransparency = false;
+
+var colours;
+var satSlider = new objColour();
+var hexChars = "0123456789ABCDEF";
+var selectedColour = 0;
+var mouseDown = false;
+var eventInitiator = null;
+var mouseX, mouseY, offsetLeft, offsetTop;
+
+var gColor = "";
+var LastPickedColor = "";
+var ColorType = "Text";
+var TextType = false;
+var HighlightType = false;
+var TableOrCell = false;
+var LastPickedIsDefault = false;
+var NoDefault = false;
+
+var namedColorsArray = [
+  { name:"aqua",     value:"#00ffff" },
+  { name:"black",    value:"#000000" },
+  { name:"blue",     value:"#0000ff" },
+  { name:"fuchsia",  value:"#ff00ff" },
+  { name:"gray",     value:"#808080" },
+  { name:"green",    value:"#008000" },
+  { name:"lime",     value:"#00ff00" },
+  { name:"maroon",   value:"#800000" },
+  { name:"navy",     value:"#000080" },
+  { name:"olive",    value:"#808000" },
+  { name:"orange",   value:"#FFA500" },    
+  { name:"purple",   value:"#800080" },
+  { name:"red",      value:"#ff0000" },
+  { name:"silver",   value:"#c0c0c0" },
+  { name:"teal",     value:"#008080" },
+  { name:"white",    value:"#ffffff" },
+  { name:"yellow",   value:"#ffff00" }
+  ];
+
+
+function StartUp()
+{
+  GetUIElements();
+
+
+  if (!window.arguments[0])
+  {
+    dump("colourPicker: Missing color object param\n");
+    return;
+  }
+
+  // window.arguments[0] is object to get initial values and return color data
+  gColorObj = window.arguments[0];
+  gWindowTitle  = window.arguments[1];
+  gShowTransparency = window.arguments[2];
+
+  gColorObj.cancelled = false;
+
+  colours = new objColour();
+
+  makeDraggable(gDialog.hueAndSaturationImg);
+  makeDraggable(gDialog.hueAndSaturationCrosshair);
+  makeDraggable(gDialog.brightnessImg);
+
+  gDialog.hexColour.value = "";
+  var tmpColor;
+  var haveTableRadio = false;
+  var showTransparencyCheckbox = false;
+
+  if (!gShowTransparency)
+    gDialog.transparencyCheckbox.setAttribute("hidden", true);
+
+  gColorObj.currentColor = ConvertRGBColorIntoHEXColor(gColorObj.currentColor);
+  gColorObj.lastPickedColor = ConvertRGBColorIntoHEXColor(gColorObj.lastPickedColor);
+
+  gDialog.LastPickedColor.setAttribute("style", "background-color: " +
+                                       gColorObj.lastPickedColor);
+
+  // Set initial color in input field and in the colorpicker
+  SetCurrentColor(gColorObj.currentColor);
+  if (!showTransparencyCheckbox)
+    gDialog.colorpicker.initColor(gColorObj.currentColor);
+
+  // Caller can prevent user from submitting an empty, i.e., default color
+  NoDefault = gColorObj.NoDefault;
+  if (NoDefault)
+  {
+    // Hide the "Default button -- user must pick a color
+    var defaultColorButton = document.getElementById("DefaultColorButton");
+    if (defaultColorButton)
+      defaultColorButton.collapsed = true;
+  }
+
+  // Set focus to colorpicker if not set to table radio buttons above
+  if (!haveTableRadio)
+    gDialog.colorpicker.focus();
+
+  // SetWindowLocation();
+}
+
+// * utility function to convert predefined HTML4 color names
+//   into their #rrggbb equivalent and back
+function getHexColorFromColorName(color)
+{
+  color = color.toLowerCase();
+  for (var i=0; i< namedColorsArray.length; i++) {
+    if (color == namedColorsArray[i].name) {
+      return namedColorsArray[i].value;
+    }
+  }
+  return null;
+}
+
+function getColorNameFromHexColor(color)
+{
+  color = color.toLowerCase();
+  for (var i=0; i< namedColorsArray.length; i++) {
+    if (color == namedColorsArray[i].value) {
+      return namedColorsArray[i].name;
+    }
+  }
+  return null;
+}
+
+function makeDraggable(obj)
+{
+   obj.onmousedown = startDrag;
+   obj.onmousemove = moveDrag;
+   obj.onmouseup = endDrag;
+}
+
+function computeOffsets(t)
+{
+  offsetLeft = 0;
+  offsetTop = 0;
+  while (t && !(t instanceof XULElement))
+  {
+    offsetLeft += t.offsetLeft;
+    offsetTop  += t.offsetTop;
+    t = t.parentNode;
+  }
+}
+
+function startDrag(e)
+{
+   mouseDown = true;
+
+   var target = e.target;
+   if (target.id == "hueAndSaturationCrosshair")
+     target = target.parentNode;
+
+   eventInitiator = target;
+   computeOffsets(target);
+   mouseX = e.clientX - offsetLeft + 1;
+   mouseY = e.clientY - offsetTop + 1;
+
+   handleValueChange(target);
+   e.preventDefault();
+
+}
+
+function moveDrag(e)
+{
+   var target = e.target;
+   if (target.id == "hueAndSaturationCrosshair")
+     target = target.parentNode;
+
+   if (mouseDown && target == eventInitiator)
+   {
+      computeOffsets(target);
+      mouseX = e.clientX - offsetLeft  + 1;
+      mouseY = e.clientY - offsetTop  + 1;
+
+      mouseX = Math.max(0, Math.min(mouseX, 199));
+      mouseY = Math.max(0, Math.min(mouseY, 199));
+
+      handleValueChange(target);
+   }
+}
+
+function endDrag(e)
+{
+
+   mouseDown = false;
+   eventInitiator = null;
+   handleValueChange(e.target);
+   e.preventDefault();
+}
+
+function handleValueChange(obj)
+{
+   var sWidth = 200;
+
+   if (obj.id == "brightnessImg")
+   { 
+         var bVal = mouseX * 255 / sWidth;
+         var h = colours.getHue();
+         var s = colours.getSaturation();
+         colours.setHSB(h, s, bVal);
+         redrawEverything();
+   }
+   else if (obj.id == "hueAndSaturationImg")
+   {
+         var hVal = mouseX * 360 / sWidth;
+         var sVal = (200 - mouseY) * 100 / sWidth;
+         var b = colours.getBrightness();
+         if (!b)
+           b = 1;
+         colours.setHSB(hVal, sVal/100, b);
+         redrawEverything();
+   }
+}
+
+function checkRange(value, min, max)
+{
+  return Math.max(min, Math.min(value, max));
+}
+
+// the user has changed the RGB textboxes
+function changeRGB()
+{
+
+   var red   = gDialog.red;
+   var green = gDialog.green;
+   var blue  = gDialog.blue;
+
+   // XXX Check for numbers
+   red.value   = checkRange(red.value, 0, 255);
+   green.value = checkRange(green.value, 0, 255);
+   blue.value  = checkRange(blue.value, 0, 255);
+
+   colours.setRGB(red.value, green.value, blue.value);
+   redrawEverything();
+}
+
+function changeHSB()
+{
+   var hue        = gDialog.hue;
+   var saturation = gDialog.saturation;
+   var brightness = gDialog.brightness;
+
+   // XXX Check for letters
+   brightness.value = checkRange(brightness.value, 0, 255);
+   saturation.value = checkRange(saturation.value, 0, 100);
+
+   var sat = saturation.value / 100;
+
+   // Hue is a degree from 0-360
+   // XXX Maybe rotate it back until it's 0-360
+   hue.value = checkRange(hue.value, 0, 359);
+
+   colours.setHSB(hue.value, sat, brightness.value);
+   redrawEverything();
+}
+
+function SetCurrentColor(color)
+{
+  if (!color)
+    color = "transparent";
+
+  if (color == "transparent")
+    gDialog.transparencyCheckbox.checked = true;
+  else
+  {
+    var hexCol = getHexColorFromColorName(color);
+    if (hexCol)
+      color = hexCol;
+    gDialog.hexColour.value = color;
+    changeHex();
+  }
+  ToggleTransparency(gDialog.transparencyCheckbox);
+}
+
+function changeHex()
+{
+   var hex = gDialog.hexColour.value;
+
+   // XXX Check to see if they are hex digits
+   if (hex.length < 6)
+   {
+     alert("Color is not made of a hash ('#') followed by six hex digits");
+     return;
+   }
+
+   colours.setHex(hex.toUpperCase().substr(1, hex.length-1));
+   redrawEverything();
+}
+
+
+function redrawEverything()
+{
+   gDialog.transparencyCheckbox.checked = false;
+   ToggleTransparency(gDialog.transparencyCheckbox);
+
+   LastPickedIsDefault = false;  
+
+   redisplaySwatches();
+   redisplayHexValue();
+   redisplayRGBValues();
+   redisplayHSBValues();
+
+   redisplayColorName();
+   redisplayBrightness();
+}
+
+function redisplayBrightness()
+{
+   var sat = gDialog.brightnessImg;
+   var h = colours.getHue();
+   var s = colours.getSaturation();
+   satSlider.setHSB(h, s, 255);
+   sat.setAttribute("style",
+     sat.getAttribute("style") + ";background-color: #" + satSlider.getHex());
+}
+
+function redisplaySaturation()
+{
+   var sat = gDialog.saturationImg;
+   var h = colours.getHue();
+   var b = colours.getBrightness();
+   satSlider.setHSB(h, 1, b);
+   sat.setAttribute("style",
+     sat.getAttribute("style") + ";background-color: #" + satSlider.getHex());
+}
+
+function redisplaySwatches()
+{
+  gDialog.swatch.style.backgroundColor = "#" + colours.getHex();
+}
+
+function redisplayHexValue()
+{
+   gDialog.hexColour.value = "#" + colours.getHex();
+}
+
+function redisplayColorName()
+{
+   var color = getColorNameFromHexColor("#" + colours.getHex());
+   if (color)
+     gDialog.nameColour.value = color;
+   else
+     gDialog.nameColour.value = "";
+}
+
+function redisplayRGBValues()
+{
+   gDialog.red.value   = Math.round(colours.getRed());
+   gDialog.green.value = Math.round(colours.getGreen());
+   gDialog.blue.value  = Math.round(colours.getBlue());
+}
+
+function redisplayHSBValues()
+{
+  var h = Math.round(colours.getHue());
+  var s = Math.round(colours.getSaturation() * 100);
+  var b = Math.round(colours.getBrightness());
+
+  gDialog.hue.value        = h;
+  gDialog.saturation.value = s;
+  gDialog.brightness.value = b;
+
+  computeOffsets(gDialog.hueAndSaturationCrosshair.parentNode);
+
+  var arrow = gDialog.brightnessArrow;
+  arrow.setAttribute("style",
+    arrow.getAttribute("style") + ";left: " + (b/255*200 + 2) + "px");
+
+  var crosshair = gDialog.hueAndSaturationCrosshair;
+  crosshair.setAttribute("style",
+    crosshair.getAttribute("style") + ";left: " + (h/360*200 + 4) + "px"
+                                    + ";top:  " + ((100-s)/100*200 +4) + "px");
+
+}
+
+
+// The object that stores the colours in ram
+function objColour()
+{
+
+ this.r = 128;
+ this.g = (128 + (Math.random() * 100));
+ this.b = 128;
+
+ // Returns the hex value
+ this.getHex = function()
+ {
+   var v = Math.floor(this.r) * 256 * 256 +
+           Math.floor(this.g) *256 +
+           Math.floor(this.b);
+   var c = Number(v).toString(16);
+   while (c.length < 6)
+     c = "0" + c;
+   return c;
+ }
+ this.getRed = function()
+ {
+   return this.r;
+ }
+ this.getGreen = function()
+ {
+   return this.g;
+ }
+ this.getBlue = function()
+ {
+   return this.b;
+ }
+ this.getBrightness = function()
+ {
+   // find the min and max rgb values
+   var max1 = Math.max(this.r, this.g);
+   var max2 = Math.max(max1, this.b);
+   return max2;
+ }
+ this.getSaturation = function()
+ {
+   // find the min and max rgb values
+   var min1 = Math.min(this.r, this.g);
+   var min2 = Math.min(min1, this.b);
+   var max1 = Math.max(this.r, this.g);
+   var max2 = Math.max(max1, this.b); // v
+
+   var delta = max2 - min2;
+   var sat = 0;
+   if (max2 != 0)
+   {
+      sat = delta / max2;
+   }
+   return sat;
+ }
+
+ this.getHue = function()
+ {
+   var hue = 0;
+   // If all the values are the same, there is no hue, just brightness
+   if (this.r == this.g && this.g == this.b)
+   {
+      hue = 0;
+      return hue;
+   }
+
+   // find the min and max rgb values
+   var min1 = Math.min(this.r, this.g);
+   var min2 = Math.min(min1, this.b);
+   var max1 = Math.max(this.r, this.g);
+   var max2 = Math.max(max1, this.b); // v
+
+   var delta = max2 - min2;
+
+   if (max2 == 0)
+   {
+      hue = 0;
+      return hue; // Saturation is undefined, so there is no hue
+   }
+
+   if (this.r == max2)
+   {
+      hue = (this.g - this.b) / delta; // It's between yellow and magenta
+   }
+   else if (this.g == max2)
+   {
+      hue = 2 + (this.b - this.r) / delta; // It's between cyan and yellow
+   }
+   else
+   {
+      hue = 4 + (this.r - this.g) / delta; // It's between magenta and cyan
+   }
+
+   hue *= 60; // Get it in degrees
+   if (hue < 0)
+   {
+      hue += 360;
+   }
+   if (!hue)
+   {
+      hue = 0;
+   }
+   return hue;
+ }
+
+ this.setRGB = function(r, g, b)
+ {
+    this.r = r;
+    this.g = g;
+    this.b = b;
+ }
+
+ this.setHSB = function(h, s, b)
+ {
+
+    if (s == 0)
+    {
+       // Set it to a grey based on the brightness
+       this.r = b;
+       this.g = b;
+       this.b = b;
+       return;
+    }
+
+    h /= 60; // Get it out of degrees
+
+    var i = Math.floor(h);
+    var f = h - i; // Grab the decimal part
+    var p = b * (1 - s);
+    var q = b * (1 - s * f);
+    var t = b * (1 - s * (1 - f));
+
+    switch (i)
+    {
+       case 0:
+          this.r = b;
+          this.g = t;
+          this.b = p;
+          break;
+       case 1:
+          this.r = q;
+          this.g = b;
+          this.b = p;
+          break;
+       case 2:
+          this.r = p;
+          this.g = b;
+          this.b = t;
+          break;
+       case 3:
+          this.r = p;
+          this.g = q;
+          this.b = b;
+          break;
+       case 4:
+          this.r = t;
+          this.g = p;
+          this.b = b;
+          break;
+       default:
+          this.r = b;
+          this.g = p;
+          this.b = q;
+          break;
+    }
+ }
+
+ this.setHex = function(hex)
+ {
+    var c = hex.split("");
+    var red = hex2dec(c[0]) * 16 + hex2dec(c[1]);
+    var green = hex2dec(c[2]) * 16 + hex2dec(c[3]);
+    var blue = hex2dec(c[4]) * 16 + hex2dec(c[5]);
+    this.r = red;
+    this.g = green;
+    this.b = blue;
+ }
+}
+
+
+// Returns the decimal value of a hex character
+function hex2dec(hex)
+{
+   return hexChars.indexOf(hex);
+}
+
+// return the hexidecimal value of a decimal digit from 1-16
+function dec2hex(dec)
+{
+   return hexChars.charAt(dec);
+}
+
+function SelectColor()
+{
+  var color = gDialog.colorpicker.color;
+  if (color)
+  {
+    colours.setHex(color.toUpperCase().substr(1, color.length-1));
+    redrawEverything();
+  }
+}
+
+function onAccept()
+{
+  if (gDialog.transparencyCheckbox.checked)
+    gColorObj.currentColor = "transparent";
+  else
+    gColorObj.currentColor = gDialog.hexColour.value;
+  gColorObj.lastPickedColor = gColorObj.currentColor;
+  return true;
+}
+
+function ValidateData()
+{
+}
+
+function onCancelColor()
+{
+  // Tells caller that user canceled
+  gColorObj.cancelled = true;
+  //SaveWindowLocation();
+  return true;
+}
+
+function IncreaseTextboxValue(id, maxValue)
+{
+  var e = document.getElementById(id);
+  if (e)
+  {
+    var v = e.value;
+    var newValue = Math.min(maxValue, Number(v) + 1);
+    e.value = newValue;
+    if (newValue != v)
+      redrawEverythingAfterTexboxValueChanged(id);
+  }
+}
+
+function DecreaseTextboxValue(id, minValue)
+{
+  var e = document.getElementById(id);
+  if (e)
+  {
+    var v = e.value;
+    var newValue = Math.max(minValue, Number(v) - 1);
+    e.value = newValue;
+    if (newValue != v)
+      redrawEverythingAfterTexboxValueChanged(id);
+  }
+}
+
+function redrawEverythingAfterTexboxValueChanged(id)
+{
+  if (id == "hue" ||
+      id == "saturation" ||
+      id == "brightness")
+  {
+    var h = gDialog.hue.value;
+    var s = gDialog.saturation.value;
+    var b = gDialog.brightness.value;
+    colours.setHSB(h, s/100, b);
+  }
+  else
+  {
+    var r = gDialog.red.value;
+    var g = gDialog.green.value;
+    var b = gDialog.blue.value;
+    colours.setRGB(r, g, b);
+  }
+  redrawEverything();
+}
+
+function onTextboxValueChanged(e, id)
+{
+  forceInteger(id);
+  var v = e.value;
+  switch (id)
+  {
+    case "hue":
+      v = checkRange(v, 0, 359);
+      break;
+    case "brightness":
+    case "red":
+    case "green":
+    case "blue":
+      v = checkRange(v, 0, 255);
+      break;
+    case "saturation":
+      v = checkRange(v, 0, 100);
+      break;
+  }
+  e.value = v;
+  redrawEverythingAfterTexboxValueChanged(id);
+}
+
+function ToggleTransparency(elt)
+{
+  if (elt.checked)
+  {
+    gDialog.red.setAttribute("disabled", true);
+    gDialog.blue.setAttribute("disabled", true);
+    gDialog.green.setAttribute("disabled", true);
+    gDialog.hue.setAttribute("disabled", true);
+    gDialog.saturation.setAttribute("disabled", true);
+    gDialog.brightness.setAttribute("disabled", true);
+    gDialog.hexColour.setAttribute("disabled", true);
+    gDialog.nameColour.setAttribute("disabled", true);
+    gDialog.redLabel.setAttribute("disabled", true);
+    gDialog.blueLabel.setAttribute("disabled", true);
+    gDialog.greenLabel.setAttribute("disabled", true);
+    gDialog.hueLabel.setAttribute("disabled", true);
+    gDialog.saturationLabel.setAttribute("disabled", true);
+    gDialog.brightnessLabel.setAttribute("disabled", true);
+    gDialog.hexColourLabel.setAttribute("disabled", true);
+    gDialog.nameColourLabel.setAttribute("disabled", true);
+
+    gDialog.swatch.style.backgroundColor = "#ffffff";
+  }
+  else
+  {
+    gDialog.red.removeAttribute("disabled");
+    gDialog.blue.removeAttribute("disabled");
+    gDialog.green.removeAttribute("disabled");
+    gDialog.hue.removeAttribute("disabled");
+    gDialog.saturation.removeAttribute("disabled");
+    gDialog.brightness.removeAttribute("disabled");
+    gDialog.hexColour.removeAttribute("disabled");
+    gDialog.nameColour.removeAttribute("disabled");
+    gDialog.redLabel.removeAttribute("disabled");
+    gDialog.blueLabel.removeAttribute("disabled");
+    gDialog.greenLabel.removeAttribute("disabled");
+    gDialog.hueLabel.removeAttribute("disabled");
+    gDialog.saturationLabel.removeAttribute("disabled");
+    gDialog.brightnessLabel.removeAttribute("disabled");
+    gDialog.hexColourLabel.removeAttribute("disabled");
+    gDialog.nameColourLabel.removeAttribute("disabled");
+
+    gDialog.swatch.style.backgroundColor = "#" + colours.getHex();
+  }
+}
+
+function onNamedColourChanged(elt)
+{
+  var namedColour = elt.value;
+  var i, l = namedColorsArray.length;
+  for (i=0; i<l; i++)
+  {
+    if (namedColorsArray[i].name == namedColour)
+    {
+      gDialog.hexColour.value = namedColorsArray[i].value;
+      changeHex();
+      return;
+    }
+  }
+}
+
+function SelectLastPickedColor()
+{
+  SetCurrentColor(gColorObj.lastPickedColor);
+  LastPickedIsDefault = true;  
+  if ( onAccept() )
+  {
+    window.close();
+    return true;
+  }
+  return false;
+}
+
+function forceInteger(elementID)
+{
+  var editField = document.getElementById( elementID );
+  if ( !editField )
+    return;
+
+  var stringIn = editField.value;
+  if (stringIn && stringIn.length > 0)
+  {
+    // Strip out all nonnumeric characters
+    stringIn = stringIn.replace(/\D+/g,"");
+    if (!stringIn) stringIn = "";
+
+    // Write back only if changed
+    if (stringIn != editField.value)
+      editField.value = stringIn;
+  }
+}
+
+
+function ConvertRGBColorIntoHEXColor(color)
+{
+  if ( /rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.test(color) ) {
+    var r = Number(RegExp.$1).toString(16);
+    if (r.length == 1) r = "0"+r;
+    var g = Number(RegExp.$2).toString(16);
+    if (g.length == 1) g = "0"+g;
+    var b = Number(RegExp.$3).toString(16);
+    if (b.length == 1) b = "0"+b;
+    return "#"+r+g+b;
+  }
+  else
+  {
+    return color;
+  }
+}
diff --git a/base/content/bluegriffon/js/colourPickerHelper.js b/base/content/bluegriffon/js/colourPickerHelper.js
new file mode 100644 (file)
index 0000000..dac26c4
--- /dev/null
@@ -0,0 +1,82 @@
+var ColorPickerHelper = {
+
+// MEMBERS
+
+  mPersistentColorObjects: {},
+  mColorPickerPanelObject: {},
+
+// CONSTANTS
+
+  kCOLOUR_PICKER_URL: "chrome://bluegriffon/content/xul/colourPicker.xul",
+
+// PUBLIC
+
+  newPersistentColorObject: function(aColorObjectId)
+  {
+    if (!aColorObjectId)
+      return null;
+
+    if (this.mPersistentColorObjects[aColorObjectId])
+      return this.mPersistentColorObjects[aColorObjectId];
+
+    var newColorObject = { currentColor: "",
+                           lastPickedColor: "",
+                           cancelled: false };
+    this.mPersistentColorObjects[aColorObjectId] = newColorObject;
+    return newColorObject;
+  },
+
+  cleanPersistentColorObject: function(aColorObjectId)
+  {
+    if (!aColorObjectId)
+      return;
+
+    if (this.mPersistentColorObjects[aColorObjectId])
+      delete this.mPersistentColorObjects[aColorObjectId];
+  },
+
+  getCurrentColor: function(aColorObjectId)
+  {
+    if (!aColorObjectId || !this.mPersistentColorObjects[aColorObjectId])
+      return null;
+    return this.mPersistentColorObjects[aColorObjectId].currentColor;
+  },
+
+  setLastPickedColor: function(aColorObjectId, aColor)
+  {
+    if (!aColorObjectId || !this.mPersistentColorObjects[aColorObjectId])
+      return null;
+    this.mPersistentColorObjects[aColorObjectId].lastPickedColor = aColor;
+    return aColor;
+  },
+
+  isCancelled: function(aColorObjectId)
+  {
+    if (!aColorObjectId || !this.mPersistentColorObjects[aColorObjectId])
+      throw Components.results.NS_ERROR_NULL_POINTER;
+    return this.mPersistentColorObjects[aColorObjectId].cancelled;
+  },
+
+  openColorPicker: function(aColorObjectId, aWindowTitle, aShowTransparency)
+  {
+    if (!aColorObjectId)
+      return null;
+
+    var colorObject = this.newPersistentColorObject(aColorObjectId);
+    this._resetCancelledFlag(colorObject);
+
+    window.openDialog(this.kCOLOUR_PICKER_URL,
+                      "_blank",
+                      "chrome,close,titlebar,modal",
+                      colorObject, aWindowTitle, aShowTransparency);
+    return colorObject;
+  },
+
+  // PRIVATE
+
+  _resetCancelledFlag: function(aColorObject)
+  {
+    aColorObject.cancelled = false;
+  }
+
+};
diff --git a/base/content/bluegriffon/js/commands.js b/base/content/bluegriffon/js/commands.js
new file mode 100644 (file)
index 0000000..3450066
--- /dev/null
@@ -0,0 +1,333 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+const kBASE_COMMAND_CONTROLLER_CID = "@mozilla.org/embedcomp/base-command-controller;1";
+
+const nsIControllerContext = interfaces.nsIControllerContext;
+const nsIInterfaceRequestor = interfaces.nsIInterfaceRequestor;
+const nsIControllerCommandTable = interfaces.nsIControllerCommandTable;
+
+var ComposerCommands = {
+
+  mComposerJSCommandControllerID: null,
+  mSelectionTimeOutId: null,
+
+  getComposerCommandTable: function getComposerCommandTable()
+  {
+    var controller;
+    if (this.mComposerJSCommandControllerID)
+    {
+      try { 
+        controller = window.content.controllers.getControllerById(this.mComposerJSCommandControllerID);
+      } catch (e) {}
+    }
+    if (!controller)
+    {
+      //create it
+      controller = Components.classes[kBASE_COMMAND_CONTROLLER_CID].createInstance();
+  
+      var editorController = controller.QueryInterface(nsIControllerContext);
+      editorController.init(null);
+      editorController.setCommandContext(null);
+      window.controllers.insertControllerAt(0, controller);
+    
+      // Store the controller ID so we can be sure to get the right one later
+      this.mComposerJSCommandControllerID = window.controllers.getControllerId(controller);
+    }
+  
+    if (controller)
+    {
+      var interfaceRequestor = controller.QueryInterface(nsIInterfaceRequestor);
+      return interfaceRequestor.getInterface(nsIControllerCommandTable);
+    }
+    return null;
+  },
+
+  goUpdateComposerMenuItems: function goUpdateComposerMenuItems(commandset)
+  {
+    dump("Updating commands for " + commandset.id + "\n");
+    for (var i = 0; i < commandset.childNodes.length; i++)
+    {
+      var commandNode = commandset.childNodes[i];
+      var commandID = commandNode.id;
+      if (commandID)
+      {
+        goUpdateCommand(commandID);  // enable or disable
+        if (commandNode.hasAttribute("state"))
+          this.goUpdateCommandState(commandID);
+      }
+    }
+  },
+
+  goUpdateCommandState: function goUpdateCommandState(command)
+  {
+    try
+    {
+      var controller = top.document.commandDispatcher.getControllerForCommand(command);
+      if (!(controller instanceof Components.interfaces.nsICommandController))
+        return;
+
+      var params = this.newCommandParams();
+      if (!params) return;
+
+      controller.getCommandStateWithParams(command, params);
+
+      switch (command)
+      {
+        case "cmd_bold":
+        case "cmd_italic":
+        case "cmd_underline":
+        case "cmd_strong":
+        case "cmd_em":
+        case "cmd_code":
+
+        case "cmd_ul":
+        case "cmd_ol":
+
+        case "cmd_dd":
+        case "cmd_dt":
+          this.pokeStyleUI(command, params.getBooleanValue("state_all"));
+          break;
+
+        case "cmd_paragraphState":
+        case "cmd_align":
+        case "cmd_fontFace":
+        case "cmd_class":
+          this.pokeMultiStateUI(command, params);
+          break;
+
+        case "cmd_indent":
+        case "cmd_outdent":
+          break;
+
+        default: dump("no update for command: " +command+"\n");
+      }
+    }
+    catch (e) { dump("An error occurred updating the "+command+" command: \n"+e+"\n"); }
+  },
+
+  pokeStyleUI: function pokeStyleUI(uiID, aDesiredState)
+  {
+   try {
+    var commandNode = top.document.getElementById(uiID);
+    if (!commandNode)
+      return;
+
+    var uiState = ("true" == commandNode.getAttribute("state"));
+    if (aDesiredState != uiState)
+    {
+      var newState;
+      if (aDesiredState)
+        newState = "true";
+      else
+        newState = "false";
+      commandNode.setAttribute("state", newState);
+    }
+   } catch(e) { dump("poking UI for "+uiID+" failed: "+e+"\n"); }
+  },
+
+  newCommandParams: function newCommandParams()
+  {
+    try {
+      return Components.classes["@mozilla.org/embedcomp/command-params;1"].createInstance(Components.interfaces.nsICommandParams);
+    }
+    catch(e) { dump("error thrown in newCommandParams: "+e+"\n"); }
+    return null;
+  },
+
+  pokeMultiStateUI: function pokeMultiStateUI(uiID, cmdParams)
+  {
+    try
+    {
+      var commandNode = document.getElementById(uiID);
+      if (!commandNode)
+        return;
+
+      var isMixed = cmdParams.getBooleanValue("state_mixed");
+      var desiredAttrib;
+      if (isMixed)
+        desiredAttrib = "mixed";
+      else
+        desiredAttrib = cmdParams.getCStringValue("state_attribute");
+
+      var uiState = commandNode.getAttribute("state");
+      if (desiredAttrib != uiState)
+      {
+        commandNode.setAttribute("state", desiredAttrib);
+      }
+    } catch(e) {}
+  },
+
+  doStyleUICommand: function doStyleUICommand(cmdStr)
+  {
+    try
+    {
+      var cmdParams = this.newCommandParams();
+      this.goDoCommandParams(cmdStr, cmdParams);
+    } catch(e) {}
+  },
+
+  doStatefulCommand: function doStatefulCommand(commandID, newState)
+  {
+    var commandNode = document.getElementById(commandID);
+    if (commandNode)
+        commandNode.setAttribute("state", newState);
+
+    try
+    {
+      var cmdParams = this.newCommandParams();
+      if (!cmdParams) return;
+
+      cmdParams.setCStringValue("state_attribute", newState);
+      this.goDoCommandParams(commandID, cmdParams);
+
+      this.pokeMultiStateUI(commandID, cmdParams);
+
+    } catch(e) { dump("error thrown in doStatefulCommand: "+e+"\n"); }
+  },
+
+  goDoCommandParams: function goDoCommandParams(command, params)
+  {
+    try
+    {
+      var controller = top.document.commandDispatcher.getControllerForCommand(command);
+      if (controller && controller.isCommandEnabled(command))
+      {
+        if (controller instanceof Components.interfaces.nsICommandController)
+        {
+          controller.doCommandWithParams(command, params);
+
+          // the following two lines should be removed when we implement observers
+          if (params)
+            controller.getCommandStateWithParams(command, params);
+        }
+        else
+        {
+          controller.doCommand(command);
+        }
+      }
+    }
+    catch (e)
+    {
+      dump("An error occurred executing the "+command+" command\n");
+    }
+  },
+
+  setupMainCommands: function setupMainCommands()
+  {
+    var commandTable = this.getComposerCommandTable();
+    if (!commandTable)
+      return;
+    
+    //dump("Registering plain text editor commands\n");
+    commandTable.registerCommand("cmd_stopLoading", cmdStopLoading);
+    commandTable.registerCommand("cmd_open",        cmdOpen);
+    commandTable.registerCommand("cmd_save",        cmdSave);
+    commandTable.registerCommand("cmd_saveAs",      cmdSaveAs);
+    commandTable.registerCommand("cmd_fullScreen",  cmdFullScreen);
+    commandTable.registerCommand("cmd_new",         cmdNew);
+    commandTable.registerCommand("cmd_newWizard",   cmdNewWizard);
+    commandTable.registerCommand("cmd_renderedHTMLEnabler", cmdDummyHTML);
+    commandTable.registerCommand("cmd_cleanup",     cmdMarkupCleaner);
+
+    commandTable.registerCommand("cmd_table",       cmdInsertOrEditTableCommand);
+
+    commandTable.registerCommand("cmd_class", cmdClass);
+  },
+
+  setupFormatCommands: function setupFormatCommands()
+  {
+    try {
+      var commandManager = EditorUtils.getCurrentCommandManager();
+
+      commandManager.addCommandObserver(gEditorDocumentObserver, "obs_documentCreated");
+      commandManager.addCommandObserver(gEditorDocumentObserver, "cmd_setDocumentModified");
+      commandManager.addCommandObserver(gEditorDocumentObserver, "obs_documentWillBeDestroyed");
+      commandManager.addCommandObserver(gEditorDocumentObserver, "obs_documentLocationChanged");
+
+      // cmd_bold is a proxy, that's the only style command we add here
+      commandManager.addCommandObserver(gEditorDocumentObserver, "cmd_bold");
+    } catch (e) { alert(e); }
+  },
+
+  updateSelectionBased: function updateSelectionBased(aElt, aEvent)
+  {
+    try {
+      var mixed = EditorUtils.getSelectionContainer();
+      if (!mixed) return;
+      var element = mixed.node;
+      var oneElementSelected = mixed.oneElementSelected;
+
+      if (!element) return;
+
+      if (this.mSelectionTimeOutId)
+        clearTimeout(this.mSelectionTimeOutId);
+
+      this.mSelectionTimeOutId = setTimeout(this._updateSelectionBased, 100, element, oneElementSelected);
+    }
+    catch(e) {}
+  },
+
+  _updateSelectionBased: function _updateSelectionBased(aElement, aOneElementSelected)
+  {
+    NotifierUtils.notify("selection", aElement, aOneElementSelected);
+  },
+
+  onStateButtonUpdate: function onStateButtonUpdate(button, commmandID, onState)
+  {
+    var commandNode = document.getElementById(commmandID);
+    var state = commandNode.getAttribute("state");
+  
+    button.checked = state == onState;
+  },
+
+  selectionListener: {
+    notifySelectionChanged: function(doc, sel, reason)
+    {
+      ComposerCommands.updateSelectionBased();
+    }
+
+  }
+};
+
+#include navigationCommands.inc
+#include fileCommands.inc
+#include viewCommands.inc
+#include dummyCommands.inc
+#include formatCommands.inc
+#include insertionCommands.inc
+
diff --git a/base/content/bluegriffon/js/customize.js b/base/content/bluegriffon/js/customize.js
new file mode 100644 (file)
index 0000000..0495e5e
--- /dev/null
@@ -0,0 +1,142 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 2001
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+
+function CustomizeToolbar(id)
+{
+  // Disable the toolbar context menu items
+  var menubar = document.getElementById("composer-main-menubar");
+  for (var i = 0; i < menubar.childNodes.length; ++i)
+    menubar.childNodes[i].setAttribute("disabled", true);
+
+  var customizePopup = document.getElementById("CustomizeMainToolbar");
+  if (customizePopup)
+    customizePopup.setAttribute("disabled", "true");
+  customizePopup = document.getElementById("CustomizeFormatToolbar");
+  if (customizePopup)
+    customizePopup.setAttribute("disabled", "true");
+
+  var customizeURL = "chrome://global/content/customizeToolbar.xul";
+#ifdef TOOLBAR_CUSTOMIZATION_SHEET
+  var sheetFrame = document.getElementById("customizeToolbarSheetIFrame");
+  sheetFrame.hidden = false;
+
+  // The document might not have been loaded yet, if this is the first time.
+  // If it is already loaded, reload it so that the onload initialization code
+  // re-runs.
+  if (sheetFrame.getAttribute("src") == customizeURL)
+    sheetFrame.contentWindow.location.reload()
+  else
+    sheetFrame.setAttribute("src", customizeURL);
+
+  // XXXmano: there's apparently no better way to get this when the iframe is
+  // hidden
+  var sheetWidth = sheetFrame.style.width.match(/([0-9]+)px/)[1];
+  var popup = document.getElementById("customizeToolbarSheetPopup");
+  popup.setAttribute("refid", id);
+  popup.openPopup(document.getElementById(id), "after_start", (window.innerWidth - sheetWidth) / 2, 0);
+#else
+  window.openDialog(customizeURL,
+                    "CustomizeToolbar",
+                    "chrome,titlebar,toolbar,resizable,dependent",
+                    document.getElementById(id));
+#endif
+}
+
+function ToolboxCustomizeDone(aToolboxChanged)
+{
+#ifdef TOOLBAR_CUSTOMIZATION_SHEET
+  document.getElementById("customizeToolbarSheetIFrame").hidden = true;
+  document.getElementById("customizeToolbarSheetPopup").hidePopup();
+#endif
+
+  // Re-enable parts of the UI we disabled during the dialog
+  var menubar = document.getElementById("composer-main-menubar");
+  for (var i = 0; i < menubar.childNodes.length; ++i)
+    menubar.childNodes[i].removeAttribute("disabled");
+
+  var customizePopup = document.getElementById("CustomizeMainToolbar");
+  if (customizePopup)
+    customizePopup.removeAttribute("disabled");
+  customizePopup = document.getElementById("CustomizeFormatToolbar");
+  if (customizePopup)
+    customizePopup.removeAttribute("disabled");
+
+  // make sure our toolbar buttons have the correct enabled state restored to them...
+  if (this.UpdateMainToolbar != undefined)
+    UpdateMainToolbar(focus); 
+}
+
+function onViewToolbarCommand(aToolbarId, aMenuItemId)
+{
+  var toolbar = document.getElementById(aToolbarId);
+  var menuItem = document.getElementById(aMenuItemId);
+
+  if (!toolbar || !menuItem) return;
+
+  var toolbarCollapsed = toolbar.collapsed;
+
+  // toggle the checkbox
+  menuItem.setAttribute('checked', toolbarCollapsed);
+
+  // toggle visibility of the toolbar
+  toolbar.collapsed = !toolbarCollapsed;
+
+  document.persist(aToolbarId, 'collapsed');
+  document.persist(aMenuItemId, 'checked');
+}
+
+function UpdateMainToolbar(caller)
+{
+    dump("===> UPDATING TOOLBAR\n");
+}
+
+function UpdateCustomizeMenuPopup(aPopup)
+{
+  while (aPopup.hasChildNodes())
+    aPopup.removeChild(aPopup.lastChild);
+
+  var toolboxes = document.getElementsByTagName("toolbox");
+  
+}
+
+function InstallCustomizationDoneCallbacks()
+{
+  gDialog.MainToolbox.customizeDone   = ToolboxCustomizeDone;
+  gDialog.FormatToolbox.customizeDone = ToolboxCustomizeDone;
+}
diff --git a/base/content/bluegriffon/js/customizeToolbarSheet.js b/base/content/bluegriffon/js/customizeToolbarSheet.js
new file mode 100644 (file)
index 0000000..b83d029
--- /dev/null
@@ -0,0 +1,44 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is mozilla.org Code.
+#
+# The Initial Developer of the Original Code is
+# Mozilla Corporation
+# Portions created by the Initial Developer are Copyright (C) 2005-2006
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Asaf Romano <mozilla.mano@sent.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+var gCustomizeToolbarSheet = {
+  init: function() {
+    var popup = window.parent.document.getElementById("customizeToolbarSheetPopup");
+    var refid = popup.getAttribute("refid");
+    InitWithToolbox(window.parent.document.getElementById(refid));
+  }
+};
diff --git a/base/content/bluegriffon/js/dummyCommands.inc b/base/content/bluegriffon/js/dummyCommands.inc
new file mode 100644 (file)
index 0000000..0413526
--- /dev/null
@@ -0,0 +1,42 @@
+//-----------------------------------------------------------------------------------
+var cmdDummyHTML =
+{
+  isCommandEnabled: function(aCommand, dummy)
+  {
+    return (EditorUtils.getCurrentEditorElement() &&
+            EditorUtils.isDocumentEditable() &&
+            EditorUtils.isEditingRenderedHTML());
+  },
+
+  getCommandStateParams: function(aCommand, aParams, aRefCon) {},
+  doCommandParams: function(aCommand, aParams, aRefCon) {},
+
+  doCommand: function(aCommand)
+  {
+    // do nothing
+    dump("Hey, who's calling the dummy command?\n");
+  }
+
+};
+
+var cmdMarkupCleaner =
+{
+  isCommandEnabled: function(aCommand, dummy)
+  {
+    return (EditorUtils.isDocumentEditable() /*&& 
+            !IsInHTMLSourceMode()*/);
+  },
+
+  getCommandStateParams: function(aCommand, aParams, aRefCon) {},
+  doCommandParams: function(aCommand, aParams, aRefCon) {},
+
+  doCommand: function(aCommand)
+  {
+    try {
+      window.openDialog("chrome://bluegriffon/content/dialogs/markupCleaner.xul", "_blank",
+              "chrome,close,titlebar,modal");
+    }
+    catch(ex) {}
+    window.content.focus();
+  }
+};
diff --git a/base/content/bluegriffon/js/fileCommands.inc b/base/content/bluegriffon/js/fileCommands.inc
new file mode 100644 (file)
index 0000000..2c85afd
--- /dev/null
@@ -0,0 +1,80 @@
+var cmdOpen =
+{
+  isCommandEnabled: function(aCommand, dummy)
+  {
+    return true;    // we can always do this
+  },
+
+  getCommandStateParams: function(aCommand, aParams, aRefCon) {},
+  doCommandParams: function(aCommand, aParams, aRefCon) {},
+
+  doCommand: function(aCommand)
+  {
+    window.openDialog("chrome://bluegriffon/content/dialogs/openLocation.xul","_blank",
+                      "chrome,modal,titlebar", "tab");
+  }
+};
+
+var cmdSave =
+{
+  isCommandEnabled: function(aCommand, dummy)
+  {
+    // Always allow saving when editing a remote document,
+    //  otherwise the document modified state would prevent that
+    //  when you first open a remote file.
+    try {
+      var docUrl = EditorUtils.getDocumentUrl();
+      return EditorUtils.isDocumentEditable() &&
+        (EditorUtils.isDocumentModified() ||
+         UrlUtils.isUrlAboutBlank(docUrl) || UrlUtils.getScheme(docUrl) != "file");
+    } catch (e) {return false;}
+  },
+  
+  getCommandStateParams: function(aCommand, aParams, aRefCon) {},
+  doCommandParams: function(aCommand, aParams, aRefCon) {},
+
+  doCommand: function(aCommand)
+  {
+    var result = false;
+    var editor = EditorUtils.getCurrentEditor();
+    if (editor)
+    {
+      // FinishHTMLSource();
+      // for the time being, we use the HTML serializer
+      var editorMimeType = editor.contentsMIMEType;
+      if (editorMimeType == "application/xhtml+xml")
+        editorMimeType = "text/html";
+
+      result = FileUtils.saveDocument(
+                 UrlUtils.isUrlAboutBlank(EditorUtils.getDocumentUrl()),
+                 false,
+                 editorMimeType);
+      window.content.focus();
+    }
+    return result;
+  }
+}
+
+var cmdSaveAs =
+{
+  isCommandEnabled: function(aCommand, dummy)
+  {
+    return (EditorUtils.isDocumentEditable());
+  },
+
+  getCommandStateParams: function(aCommand, aParams, aRefCon) {},
+  doCommandParams: function(aCommand, aParams, aRefCon) {},
+
+  doCommand: function(aCommand)
+  {
+    var editor = EditorUtils.getCurrentEditor();
+    if (editor)
+    {
+      // FinishHTMLSource();
+      var result = FileUtils.saveDocument(true, false, editor.contentsMIMEType);
+      window.content.focus();
+      return result;
+    }
+    return false;
+  }
+}
diff --git a/base/content/bluegriffon/js/formatCommands.inc b/base/content/bluegriffon/js/formatCommands.inc
new file mode 100644 (file)
index 0000000..d13a4f2
--- /dev/null
@@ -0,0 +1,62 @@
+//-----------------------------------------------------------------------------------
+
+var cmdClass =
+{
+  isCommandEnabled: function(aCommand, dummy)
+  {
+       return (EditorUtils.getCurrentEditorElement() &&
+            EditorUtils.isDocumentEditable() &&
+            EditorUtils.isEditingRenderedHTML());
+  },
+
+  getCommandStateParams: function (aCommandName, aParams, aRefcon)
+  {
+       var enabled = this.isCommandEnabled(aCommandName, aRefcon);
+    aParams.setBooleanValue("state_enabled", enabled);
+    aParams.setBooleanValue("state_mixed", false);
+    var selContainer = EditorUtils.getSelectionContainer();
+    if (selContainer)
+    {
+      var classes = EditorUtils.getClasses(selContainer.node).classes;
+      if (classes)
+      {
+        aParams.setCStringValue("state_attribute", classes);
+        return;
+      }
+    }
+
+    aParams.setCStringValue("state_attribute", L10NUtils.getString("NoClassAvailable"));
+  },
+
+  doCommandParams: function(aCommandName, aParams, aRefCon)
+  {
+       var className = aParams.getCStringValue("state_attribute");
+       var node = EditorUtils.getSelectionContainer().node;
+
+       var retValue = EditorUtils.getClasses(node);
+       var classes = retValue.classes;
+       node = retValue.node;
+
+       var newList = className;
+       if (classes)
+       {
+               var list = classes.split(" ");
+               var found = false;
+               newList = "";
+               for (var i = 0; i < list.length; i++)
+               {
+        if (list[i] == className)
+          found = true;
+        else
+        newList += list[i] + " ";
+               }
+      if (!found)
+        newList += className;
+       }
+
+       EditorUtils.getCurrentEditor().setAttribute(node, "class", newList);
+       // be kind with the rest of the world
+       NotifierUtils.notify("selection", node, false);
+  }
+};
+
diff --git a/base/content/bluegriffon/js/insertionCommands.inc b/base/content/bluegriffon/js/insertionCommands.inc
new file mode 100644 (file)
index 0000000..e33bf52
--- /dev/null
@@ -0,0 +1,23 @@
+
+var cmdInsertOrEditTableCommand =
+{
+  isCommandEnabled: function(aCommand, dummy)
+  {
+    //return (EditorUtils.isDocumentEditable() && this.isEditingRenderedHTML());
+    return true;
+  },
+
+  getCommandStateParams: function(aCommand, aParams, aRefCon) {},
+  doCommandParams: function(aCommand, aParams, aRefCon) {},
+
+  doCommand: function(aCommand)
+  {
+    /*if (IsInTableCell())
+      EditorTableCellProperties();
+    else
+      EditorInsertOrEditTable(true);*/
+
+    window.openDialog("chrome://bluegriffon/content/dialogs/insertTable.xul","_blank",
+                      "chrome,modal,titlebar, resizable=yes");
+  }
+};
\ No newline at end of file
diff --git a/base/content/bluegriffon/js/languages.js b/base/content/bluegriffon/js/languages.js
new file mode 100644 (file)
index 0000000..3c3ba12
--- /dev/null
@@ -0,0 +1,178 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is the Firefox Preferences System.
+ *
+ * The Initial Developer of the Original Code is
+ * Ben Goodger.
+ * Portions created by the Initial Developer are Copyright (C) 2005
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *  Ben Goodger <ben@mozilla.org>
+ *  Adrian Havill <havill@redhat.com>
+ *  Steffen Wilberg <steffen.wilberg@web.de>
+ *  Daniel Glazman <daniel.glazman@disruptive-innovations.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+/* code chunk needed in dialog or window is
+    <stringbundleset id="languageSet">
+      <stringbundle id="bundleRegions"      src="chrome://global/locale/regionNames.properties"/>
+      <stringbundle id="bundleLanguages"    src="chrome://global/locale/languageNames.properties"/>
+      <stringbundle id="bundlePreferences"  src="chrome://bluegriffon/locale/language.properties"/>
+      <stringbundle id="bundleAccepted"     src="resource://gre/res/language.properties"/>
+    </stringbundleset>
+ */
+
+
+var BGLanguagesHelper = {
+
+  _availableLanguagesList : [],
+  _acceptLanguages        : { },
+  
+  _selectedItemID         : null,
+  
+  init: function ()
+  {
+    var languageListBox = document.getElementById("languageListBox");
+    if (languageListBox)
+    {
+      this._loadAvailableLanguages();
+    }
+  },
+  
+  get _activeLanguages()
+  {
+    return document.getElementById("activeLanguages");
+  },
+  
+  get _availableLanguages()
+  {
+    return document.getElementById("availableLanguages");
+  },
+  
+  _loadAvailableLanguages: function ()
+  {
+    // This is a parser for: resource://gre/res/language.properties
+    // The file is formatted like so:
+    // ab[-cd].accept=true|false
+    //  ab = language
+    //  cd = region
+    var bundleAccepted    = document.getElementById("bundleAccepted");
+    var bundleRegions     = document.getElementById("bundleRegions");
+    var bundleLanguages   = document.getElementById("bundleLanguages");
+    var bundlePreferences = document.getElementById("bundlePreferences");
+
+    function LanguageInfo(aName, aABCD, aIsVisible)
+    {
+      this.name = aName;
+      this.abcd = aABCD;
+      this.isVisible = aIsVisible;
+    }
+
+    // 1) Read the available languages out of language.properties
+    var strings = bundleAccepted.strings;
+    while (strings.hasMoreElements()) {
+      var currString = strings.getNext();
+      if (!(currString instanceof Components.interfaces.nsIPropertyElement))
+        break;
+      
+      var property = currString.key.split("."); // ab[-cd].accept
+      if (property[1] == "accept") {
+        var abCD = property[0];
+        var abCDPairs = abCD.split("-");      // ab[-cd]
+        var useABCDFormat = abCDPairs.length > 1;
+        var ab = useABCDFormat ? abCDPairs[0] : abCD;
+        var cd = useABCDFormat ? abCDPairs[1] : "";
+        if (ab) {
+          var language = "";
+          try {
+            language = bundleLanguages.getString(ab);
+          } 
+          catch (e) { continue; };
+          
+          var region = "";
+          if (useABCDFormat) {
+            try {
+              region = bundleRegions.getString(cd);
+            }
+            catch (e) { continue; }
+          }
+          
+          var name = "";
+          if (useABCDFormat)
+            name = bundlePreferences.getFormattedString("languageRegionCodeFormat", 
+                                                        [language, region, abCD]);
+          else
+            name = bundlePreferences.getFormattedString("languageCodeFormat", 
+                                                        [language, abCD]);
+          
+          if (name && abCD) {
+            var isVisible = currString.value == "true" && 
+                            (!(abCD in this._acceptLanguages) || !this._acceptLanguages[abCD]);
+            var li = new LanguageInfo(name, abCD, isVisible);
+            this._availableLanguagesList.push(li);
+          }
+        }
+      }
+    }
+    this._buildAvailableLanguageList();
+  },
+  
+  _buildAvailableLanguageList: function ()
+  {
+    var languageListBox = document.getElementById("languageListBox");
+    if (!languageListBox)
+      return;
+    while (languageListBox.hasChildNodes())
+      languageListBox.removeChild(languageListBox.firstChild);
+      
+    // Sort the list of languages by name
+    this._availableLanguagesList.sort(function (a, b) {
+                                        return a.name.localeCompare(b.name);
+                                      });
+                                  
+    // Load the UI with the data
+    for (var i = 0; i < this._availableLanguagesList.length; ++i) {
+      var abCD = this._availableLanguagesList[i].abcd;
+      if (this._availableLanguagesList[i].isVisible && 
+          (!(abCD in this._acceptLanguages) || !this._acceptLanguages[abCD])) {
+        var menuitem = document.createElement("listitem");
+        menuitem.id = this._availableLanguagesList[i].abcd;
+        languageListBox.appendChild(menuitem);
+        menuitem.setAttribute("label", this._availableLanguagesList[i].name);
+        menuitem.setAttribute("value", this._availableLanguagesList[i].abcd);
+      }
+    }
+  },
+
+  showChoice: function(aElt)
+  {
+    var a = 1;
+    alert(aElt.value);
+  }
+};
+
diff --git a/base/content/bluegriffon/js/markupCleaner.js b/base/content/bluegriffon/js/markupCleaner.js
new file mode 100644 (file)
index 0000000..5d7e363
--- /dev/null
@@ -0,0 +1,163 @@
+var MarkupCleaner = {
+  onlyWhiteTextNodesStartingAtNode: function(node, acceptOneBR)
+  {
+    var result = true;
+    var brOccurences = 0;
+    while (node && result)
+    {
+      if (node.nodeType != Node.TEXT_NODE)
+      {
+        if (acceptOneBR &&
+            node.nodeType == Node.ELEMENT_NODE &&
+            node.nodeName.toLowerCase() == "br")
+        {
+          brOccurences++;
+           if (brOccurences > 1)
+             result = false;
+        }
+        else
+          result = false;
+      }
+      else
+        result = RegExp( /^\s*$/ ).test(node.data);
+      node = node.nextSibling;
+    }
+    return result;
+  },
+
+  runCleanup: function(aClearReport, aIncreaseReport)
+  {
+    if (aClearReport)
+    {
+      aClearReport(gDialog.nestedListsReport, gDialog.nestedListsCheckbox);
+      aClearReport(gDialog.trailinBRReport,   gDialog.trailinBRCheckbox);
+      aClearReport(gDialog.emptyBlocksReport, gDialog.emptyBlocksCheckbox);
+      aClearReport(gDialog.emptyCellsReport,  gDialog.emptyCellsCheckbox);
+    }
+
+    function acceptNode(node, nestedLists, trailingBR, emptyBLocks, emptyCells)
+    {
+      // TBD : useless test below
+      if (node.nodeType == Node.ELEMENT_NODE)
+      {
+        var tagName = node.nodeName.toLowerCase();
+        switch (tagName)
+        {
+          case "br":
+            if ((!gDialog.trailinBRCheckbox || gDialog.trailinBRCheckbox.checked) &&
+                 MarkupCleaner.onlyWhiteTextNodesStartingAtNode(node.nextSibling, false))
+              return NodeFilter.FILTER_ACCEPT;
+            break;
+  
+          case "ul":
+          case "ol":
+            if (!gDialog.nestedListsCheckbox || gDialog.nestedListsCheckbox.checked)
+            {
+              var parentTagName = node.parentNode.nodeName.toLowerCase();
+              if (parentTagName == "ul" || parentTagName == "ol")
+                return NodeFilter.FILTER_ACCEPT;
+            }
+            break;
+  
+          case "p":
+          case "div":
+          case "h1":
+          case "h2":
+          case "h3":
+          case "h4":
+          case "h5":
+          case "h6":
+            if ((!gDialog.emptyBlocksCheckbox || gDialog.emptyBlocksCheckbox.checked) &&
+                 MarkupCleaner.onlyWhiteTextNodesStartingAtNode(node.firstChild, true))
+              return NodeFilter.FILTER_ACCEPT;
+            break;
+  
+          case "td":
+          case "th":
+            if ((!gDialog.emptyCellsCheckbox || gDialog.emptyCellsCheckbox.checked) &&
+                MarkupCleaner.onlyWhiteTextNodesStartingAtNode(node.firstChild, true))
+              return NodeFilter.FILTER_ACCEPT;
+            break;
+            
+        }
+      }
+      return NodeFilter.FILTER_SKIP;
+    }
+  
+    var editor = EditorUtils.getCurrentEditor();
+    var theDocument = editor.document;
+    var treeWalker = theDocument.createTreeWalker(theDocument.documentElement,
+                                                  NodeFilter.SHOW_ELEMENT,
+                                                  acceptNode,
+                                                  true);
+    if (treeWalker) {
+      var theNode = treeWalker.nextNode(), tmpNode;
+      editor.beginTransaction();
+  
+      while (theNode) {
+        var tagName = theNode.nodeName.toLowerCase();
+        if (tagName == "ul" || tagName == "ol")
+        {
+          var liNode = theNode.previousSibling;
+          while (liNode && liNode.nodeName.toLowerCase() != "li")
+            liNode = liNode.previousSibling;
+  
+          tmpNode = treeWalker.nextNode();
+          if (liNode)
+          {
+            editor.deleteNode(theNode);
+            // editor.insertNodeAfter(theNode, liNode, null);
+            editor.insertNode(theNode, liNode, liNode.childNodes.length);
+            if (aIncreaseReport)
+              aIncreaseReport(gDialog.nestedListsReport);
+          }
+          theNode = tmpNode;
+        }
+  
+        else if (tagName == "br")
+        {
+          tmpNode = treeWalker.nextNode();
+          var parentTagName = theNode.parentNode.nodeName.toLowerCase();
+          if (parentTagName != "td" && parentTagName != "th")
+          {
+            editor.deleteNode(theNode)
+            if (aIncreaseReport)
+              aIncreaseReport(gDialog.trailinBRReport);
+          }
+  
+          theNode = tmpNode;
+        }
+        
+        else if (tagName == "td" || tagName == "th")
+        {
+          if (theNode.hasAttribute("align") ||
+              theNode.hasAttribute("valign"))
+          {
+            editor.removeAttribute(theNode, "align");
+            editor.removeAttribute(theNode, "valign");
+            if (aIncreaseReport)
+              aIncreaseReport(gDialog.emptyCellsReport);
+  
+          }
+          theNode = treeWalker.nextNode();
+        }
+  
+        else
+        {
+          tmpNode = treeWalker.nextNode();
+          editor.deleteNode(theNode)
+          if (aIncreaseReport)
+            aIncreaseReport(gDialog.emptyBlocksReport);
+  
+          theNode = tmpNode;
+        }
+      }
+  
+      editor.endTransaction();
+    
+    }
+    return false;
+  }
+
+};
+
diff --git a/base/content/bluegriffon/js/navigationCommands.inc b/base/content/bluegriffon/js/navigationCommands.inc
new file mode 100644 (file)
index 0000000..4a0becd
--- /dev/null
@@ -0,0 +1,69 @@
+
+var cmdStopLoading =
+{
+  isCommandEnabled: function(aCommand, dummy)
+  {
+    var res = false;
+    try {
+      var tab = document.getElementById("tabeditor").selectedTab;
+      if (tab)
+        res = tab.hasAttribute("busy");
+    }
+    catch(e) {}
+    return res;
+  },
+
+  getCommandStateParams: function(aCommand, aParams, aRefCon) {},
+  doCommandParams: function(aCommand, aParams, aRefCon) {},
+
+  doCommand: function(aCommand)
+  {
+    document.getElementById("tabeditor").stopWebNavigation();
+  }
+};
+
+var cmdTabeditor =
+{
+  isCommandEnabled: function(aCommand, dummy)
+  {
+    return document.getElementById("tabeditor").mTabpanels.hasChildNodes();
+  },
+
+  getCommandStateParams: function(aCommand, aParams, aRefCon) {},
+  doCommandParams: function(aCommand, aParams, aRefCon) {},
+  doCommand: function(aCommand) {}
+};
+
+var cmdNew =
+{
+  isCommandEnabled: function(aCommand, dummy)
+  {
+    return true;
+  },
+
+  getCommandStateParams: function(aCommand, aParams, aRefCon) {},
+  doCommandParams: function(aCommand, aParams, aRefCon) {},
+  doCommand: function(aCommand)
+  {
+    OpenFile("chrome://bluegriffon/content/blanks/transitional.html", true);
+  }
+};
+
+var cmdNewWizard =
+{
+  isCommandEnabled: function(aCommand, dummy)
+  {
+    return true;
+  },
+
+  getCommandStateParams: function(aCommand, aParams, aRefCon) {},
+  doCommandParams: function(aCommand, aParams, aRefCon) {},
+  doCommand: function(aCommand)
+  {
+
+    OpenFile("chrome://bluegriffon/content/blanks/transitional.html", true);
+    OpenAppModalWindow(window,
+                       "chrome://bluegriffon/content/dialogs/newPageWizard.xul",
+                       "newPageWizard");
+  }
+};
diff --git a/base/content/bluegriffon/js/observers.inc b/base/content/bluegriffon/js/observers.inc
new file mode 100644 (file)
index 0000000..795e265
--- /dev/null
@@ -0,0 +1,138 @@
+// implements nsIObserver
+var gEditorDocumentObserver =
+{ 
+  observe: function(aSubject, aTopic, aData)
+  {
+    // Should we allow this even if NOT the focused editor?
+    var commandManager = EditorUtils.getCurrentCommandManager();
+    if (commandManager != aSubject)
+      return;
+
+    var editor = EditorUtils.getCurrentEditor();
+    gContentWindow = window.content;
+    switch(aTopic)
+    {
+      case "obs_documentCreated":
+        // placeholder; TBD
+        dump("obs_documentCreated\n");
+
+        // TBD : 1. DONE
+        //       2. add override stylesheets if needed
+        //       3. call "load" notifier callbacks
+        //       4. update window title
+        //       5. place initial selection
+        //       6. check DTD strictness
+
+        // Get state to see if document creation succeeded
+        var params = EditorUtils.newCommandParams();
+        if (!params)
+          return;
+
+        // TBD : RealTimeSpell.Init(editor, true);
+
+        try {
+          commandManager.getCommandState(aTopic, gContentWindow, params);
+          var errorStringId = 0;
+          var editorStatus = params.getLongValue("state_data");
+          if (!editor && editorStatus == nsIEditingSession.eEditorOK)
+          {
+            dump("\n ****** NO EDITOR BUT NO EDITOR ERROR REPORTED ******* \n\n");
+            editorStatus = nsIEditingSession.eEditorErrorUnknown;
+          }
+
+          switch (editorStatus)
+          {
+            case nsIEditingSession.eEditorErrorCantEditFramesets:
+              errorStringId = "CantEditFramesetMsg";
+              break;
+            case nsIEditingSession.eEditorErrorCantEditMimeType:
+              errorStringId = "CantEditMimeTypeMsg";
+              break;
+            case nsIEditingSession.eEditorErrorUnknown:
+              errorStringId = "CantEditDocumentMsg";
+              break;
+            // Note that for "eEditorErrorFileNotFound, 
+            // network code popped up an alert dialog, so we don't need to
+          }
+          if (errorStringId)
+            PromptUtils.alertWithTitle("", L10NUtils.getString(errorStringId));
+        } catch(e) { dump("EXCEPTION GETTING obs_documentCreated state "+e+"\n"); }
+
+        // We have a bad editor -- nsIEditingSession will rebuild an editor
+        //   with a blank page, so simply abort here
+        if (editorStatus)
+          return; 
+
+        // Set window title
+        UpdateWindowTitle();
+
+        window.content.focus();
+        break;
+
+      case "cmd_setDocumentModified":
+        dump("cmd_setDocumentModified " + EditorUtils.isDocumentModified() + "\n");
+        gDialog.tabeditor.showCurrentTabAsModified(EditorUtils.isDocumentModified());    // || IsHTMLSourceChanged());
+
+        // TBD : 1. update web navigation commands
+        //       2. DONE
+
+        break;
+
+      case "obs_documentWillBeDestroyed":
+        dump("obs_documentWillBeDestroyed\n");
+        // placeholder; TBD
+        break;
+
+      case "obs_documentLocationChanged":
+        dump("obs_documentLocationChanged\n");
+        // TBD : 1. update base URL
+        break;
+
+      case "cmd_bold":
+        // Update all style items
+        // cmd_bold is a proxy; see EditorSharedStartup (above) for details
+        window.updateCommands("style");
+        // update the undo/redo items too
+        window.updateCommands("undo");
+        // and finally the main toolbar
+        window.updateCommands("navigation");
+        break;
+    }
+  }
+}
+
+var ResizeEventNotifier = {
+  startup: function ResizeEventNotifier_startup()
+  {
+    window.addEventListener("resize", this.onResizeEvent, false);
+  },
+
+  shutdown: function ResizeEventNotifier_shutdown()
+  {
+    window.removeEventListener("resize", this.onResizeEvent, false);
+  },
+
+  onResizeEvent: function ResizeEventNotifier_onResizeEvent(aEvent)
+  {
+    NotifierUtils.notify("resizeEvent");
+  }
+};
+
+var EditorScrolledNotifier =  {
+  startup: function EditorScrolledNotifier_startup()
+  {
+       var tabeditor = document.getElementById("tabeditor");
+    tabeditor.addEventListener("scroll", this.onEditorScrolled, false);
+  },
+
+  shutdown: function EditorScrolledNotifier_shutdown()
+  {
+    var tabeditor = document.getElementById("tabeditor");
+    tabeditor.removeEventListener("scroll", this.onEditorScrolled, false);
+  },
+
+  onEditorScrolled: function EditorScrolledNotifier_onEditorScrolled(aEvent)
+  {
+    NotifierUtils.notify("editorScrolled");
+  }
+};
diff --git a/base/content/bluegriffon/js/propertiesDeck.js b/base/content/bluegriffon/js/propertiesDeck.js
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/base/content/bluegriffon/js/recentPages.js b/base/content/bluegriffon/js/recentPages.js
new file mode 100644 (file)
index 0000000..b9889bd
--- /dev/null
@@ -0,0 +1,166 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var RecentPagesHandler = {
+
+  appendRecentMenuitem: function(menupopup, title, url, menuIndex)
+  {
+    if (menupopup)
+    {
+      var menuItem = document.createElement("menuitem");
+      if (menuItem)
+      {
+        var accessKey;
+        if (menuIndex <= 9)
+          accessKey = String(menuIndex);
+        else if (menuIndex == 10)
+          accessKey = "0";
+        else
+          accessKey = " ";
+  
+        var itemString = accessKey+" ";
+  
+        // Show "title [url]" or just the URL
+        if (title)
+        {
+         itemString += title;
+         itemString += " [";
+        }
+        itemString += url;
+        if (title)
+          itemString += "]";
+  
+        menuItem.setAttribute("label", itemString);
+        menuItem.setAttribute("crop", "center");
+        menuItem.setAttribute("value", url);
+        if (accessKey != " ")
+          menuItem.setAttribute("accesskey", accessKey);
+        menupopup.appendChild(menuItem);
+      }
+    }
+  },
+  
+  buildRecentPagesMenu: function()
+  {
+    var editor = EditorUtils.getCurrentEditor();
+    if (!GetPrefs())
+      return;
+  
+    var popup = gDialog["menupopup_RecentFiles"];
+    if (!popup)
+      return;
+  
+    // Delete existing menu
+    while (popup.firstChild)
+      popup.removeChild(popup.firstChild);
+  
+    // Current page is the "0" item in the list we save in prefs,
+    //  but we don't include it in the menu.
+    var curUrl = "";
+    if (editor)
+      curUrl = UrlUtils.stripPassword(EditorUtils.getDocumentUrl());
+    var historyCount = 10;
+    try {
+      historyCount = GetPrefs().getIntPref("bluegriffon.history.url_maximum");
+    } catch(e) {}
+    var menuIndex = 1;
+  
+    for (var i = 0; i < historyCount; i++)
+    {
+      var url = GetUnicharPref("bluegriffon.history_url_"+i);
+  
+      // Skip over current url
+      if (url && url != curUrl)
+      {
+        // Build the menu
+        var title = GetUnicharPref("bluegriffon.history_title_"+i);
+        this.appendRecentMenuitem(popup, title, url, menuIndex);
+        menuIndex++;
+      }
+    }
+  },
+  
+  saveRecentFilesPrefs: function()
+  {
+    // Can't do anything if no prefs
+    if (!GetPrefs())
+      return;
+  
+    var curUrl = UrlUtils.stripPassword(EditorUtils.getDocumentUrl());
+    if (!curUrl)
+      return;
+    var historyCount = 10;
+    try {
+      historyCount = GetPrefs().getIntPref("bluegriffon.history.url_maximum"); 
+    } catch(e) {}
+  
+    var titleArray = [];
+    var urlArray = [];
+  
+    // XXX code below is suspect...
+    if (historyCount &&
+        !UrlUtils.isUrlAboutBlank(curUrl) &&
+        UrlUtils.getScheme(curUrl) != "data")
+    {
+      titleArray.push(EditorUtils.getDocumentTitle());
+      urlArray.push(curUrl);
+    }
+  
+    for (var i = 0; i < historyCount && urlArray.length < historyCount; i++)
+    {
+      var url = GetUnicharPref("bluegriffon.history_url_"+i);
+  
+      // Continue if URL pref is missing because 
+      //  a URL not found during loading may have been removed
+  
+      // Skip over current an "data" URLs
+      if (url && url != curUrl && UrlUtils.getScheme(url) != "data")
+      {
+        var title = GetUnicharPref("bluegriffon.history_title_"+i);
+        titleArray.push(title);
+        urlArray.push(url);
+      }
+    }
+  
+    // Resave the list back to prefs in the new order
+    for (i = 0; i < urlArray.length; i++)
+    {
+      SetUnicharPref("bluegriffon.history_title_"+i, titleArray[i]);
+      SetUnicharPref("bluegriffon.history_url_"+i, urlArray[i]);
+    }
+  }
+};
\ No newline at end of file
diff --git a/base/content/bluegriffon/js/shutdown.inc b/base/content/bluegriffon/js/shutdown.inc
new file mode 100644 (file)
index 0000000..1e35e57
--- /dev/null
@@ -0,0 +1,8 @@
+function Shutdown()
+{
+  gDialog.structurebar.shutdown();
+  ResizeEventNotifier.shutdown();
+  EditorScrolledNotifier.shutdown();
+  BGZoomManager.shutdown();
+}
+
diff --git a/base/content/bluegriffon/js/startup.inc b/base/content/bluegriffon/js/startup.inc
new file mode 100644 (file)
index 0000000..e76ca6e
--- /dev/null
@@ -0,0 +1,30 @@
+var gContentWindow = null;
+
+function Startup()
+{
+  var url = null;
+  // do we have a URL to open ?
+  if (window.arguments.length == 2)
+    url = window.arguments[1];
+
+  GetUIElements();
+
+  // let's finish with the url
+  if (url)
+    OpenFile(url, true);
+
+  ComposerCommands.setupMainCommands();
+  window.updateCommands("style");
+
+  gDialog.sidebaritems.init();
+  gDialog.sidebar1.init(gDialog.sidebaritems, gDialog.sidebar2, gDialog.splitter1);
+  gDialog.sidebar2.init(gDialog.sidebaritems, gDialog.sidebar1, gDialog.splitter2);
+
+  InstallCustomizationDoneCallbacks();
+
+  gDialog.structurebar.init();
+
+  ResizeEventNotifier.startup();
+  EditorScrolledNotifier.startup();
+  BGZoomManager.startup();
+}
diff --git a/base/content/bluegriffon/js/toolbars.js b/base/content/bluegriffon/js/toolbars.js
new file mode 100644 (file)
index 0000000..8a04709
--- /dev/null
@@ -0,0 +1,83 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var BGToolbarManager = {
+
+  goToggleToolbar: function( id, elementID )
+  {
+    var toolbar = document.getElementById(id);
+    var element = document.getElementById(elementID);
+    if (toolbar)
+    {
+      var isHidden = toolbar.hidden;
+      toolbar.hidden = !isHidden;
+      document.persist(id, 'hidden');
+      if (element) {
+        element.setAttribute("checked", isHidden ? "true" : "false");
+        document.persist(elementID, 'checked');
+      }
+    }
+  },
+
+  getAllToolbars: function()
+  {
+    return document.getElementsByTagName("toolbar");
+  },
+
+  listToolbars: function (aPopup)
+  {
+    if (!aPopup)
+      return;
+
+    deleteAllChildren(aPopup);
+    var toolbars = this.getAllToolbars();
+    for (var i = 0; i < toolbars.length; i++)
+    {
+      var toolbar = toolbars[i];
+      var isHidden = toolbar.hidden;
+      var name = toolbar.toolbarName;
+      var id = toolbar.getAttribute("id");
+      var item = aPopup.parentNode.appendItem(name, id);
+      item.setAttribute("type", "checkbox");
+      item.setAttribute("oncommand",
+                        "BGToolbarManager.goToggleToolbar('" +
+                          id + "')" );
+      if (!isHidden)
+        item.setAttribute("checked", "true");
+    }
+  }
+};
diff --git a/base/content/bluegriffon/js/viewCommands.inc b/base/content/bluegriffon/js/viewCommands.inc
new file mode 100644 (file)
index 0000000..c8a3dbe
--- /dev/null
@@ -0,0 +1,16 @@
+var cmdFullScreen =
+{
+  isCommandEnabled: function(aCommand, dummy)
+  {
+    return true;    // we can always do this
+  },
+
+  getCommandStateParams: function(aCommand, aParams, aRefCon) {},
+  doCommandParams: function(aCommand, aParams, aRefCon) {},
+
+  doCommand: function(aCommand)
+  {
+    window.fullScreen = !window.fullScreen;
+  }
+};
+
diff --git a/base/content/bluegriffon/js/zoomManager.js b/base/content/bluegriffon/js/zoomManager.js
new file mode 100644 (file)
index 0000000..ebdb13f
--- /dev/null
@@ -0,0 +1,209 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var BGZoomManager = {
+
+  kZOOM_VALUES:  "toolkit.zoomManager.zoomValues",
+  kDEFAULT_ZOOM: "bluegriffon.zoom.default",
+
+  zoomValues: function BGZoomManager_zoomValues()
+  {
+    var values;
+    try {
+      values = GetPrefs().getCharPref(this.kZOOM_VALUES);
+    }
+    catch(e) {
+      values = ".5,.75,1,1.25,1.5,2,3";
+    }
+    return values.split(",").map(parseFloat);
+  },
+
+  getMarkupDocumentViewer: function BGZoomManager_getMarkupDocumentViewer()
+  {
+    return EditorUtils.getCurrentEditorElement()
+             .docShell.contentViewer
+             .QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
+  },
+
+  getCurrentZoom: function BGZoomManager_getCurrentZoom()
+  {
+    return this.getMarkupDocumentViewer().fullZoom;
+  },
+
+  setCurrentZoom: function BGZoomManager_setCurrentZoom(aZoom)
+  {
+    this.getMarkupDocumentViewer().fullZoom = aZoom;
+  },
+
+  fillZoomValues: function BGZoomManager_fillZoomValues(aPopup)
+  {
+    var valueArray = this.zoomValues();
+
+    var menulist = aPopup.parentNode;
+    var child = aPopup.lastChild;
+    while (child)
+    {
+      var tmp = child.previousSibling;
+      aPopup.removeChild(child);
+      child = tmp;
+    }
+
+    var ratio = this.getCurrentZoom();
+    menulist.setAttribute("value", ratio*100 +"%");
+
+    for (var i = 0; i < valueArray.length; i++)
+    {
+      var value = Math.floor(valueArray[i] * 100);
+      var item = document.createElement("menuitem");
+      item.setAttribute("label", value + "%");
+      item.setAttribute("value", value);
+      aPopup.appendChild(item);
+    }
+  },
+
+  applyZoomValue: function BGZoomManager_applyZoomValue(aMenulist)
+  {
+    if (aMenulist.selectedItem && aMenulist.selectedItem.value)
+    {
+      this.setCurrentZoom(parseInt(aMenulist.selectedItem.value) / 100);
+      EditorUtils.getCurrentEditorElement().contentWindow.focus();
+    }
+    else
+      aMenulist.value = this.getCurrentZoom() * 100 + "%";
+  },
+
+  enlarge: function BGZoomManager_enlarge(aMenulist)
+  {
+    var zoomValues = this.zoomValues();
+    var currentZoom = Math.floor(this.getCurrentZoom() * 100) / 100;
+    var i = zoomValues.indexOf(currentZoom);
+    if (i >= 0 && i < zoomValues.length - 1)
+    {
+      var value = zoomValues[i+1];
+      this.setCurrentZoom(value);
+      aMenulist.value = value * 100 + "%";
+    }
+    else if (i == -1)
+      for (var index = 0; index < zoomValues.length; index++)
+        if (zoomValues[index] > currentZoom)
+        {
+          var value = zoomValues[index];
+          this.setCurrentZoom(value);
+          aMenulist.value = value * 100 + "%";
+          return;
+        }
+  },
+
+  reduce: function BGZoomManager_reduce(aMenulist)
+  {
+    var zoomValues = this.zoomValues();
+    var currentZoom = Math.floor(this.getCurrentZoom() * 100) / 100;
+    var i = zoomValues.indexOf(currentZoom);
+    if (i > 0)
+    {
+      var value = zoomValues[i-1];
+      this.setCurrentZoom(value);
+      aMenulist.value = value * 100 + "%";
+    }
+    else if (i == -1)
+      for (var index = 0; index < zoomValues.length; index++)
+        if (zoomValues[index] < currentZoom &&
+            zoomValues[index+1] > currentZoom)
+        {
+          var value = zoomValues[index];
+          this.setCurrentZoom(value);
+          aMenulist.value = value * 100 + "%";
+          return;
+        }
+  },
+
+  onKeyUp: function onKeyUp(aEvent, aMenulist)
+  {
+    if (aEvent.keyCode != 13)
+      return;
+    var value = parseInt(aMenulist.value);
+    if (value)
+    {
+      this.setCurrentZoom(value / 100);
+    }
+    else
+    {
+      value = Math.floor(this.getCurrentZoom() * 100);
+    }
+    aMenulist.value = value + "%";
+    EditorUtils.getCurrentEditorElement().contentWindow.focus();
+  },
+
+  startup: function BGZoomManager_startup()
+  {
+    var _self = this;
+    NotifierUtils.addNotifierCallback("tabSelected",
+      function() { _self.onTabSelected(); }, this);
+    NotifierUtils.addNotifierCallback("tabCreated",
+      function() { _self.onTabCreated(); }, this);
+  },
+
+  shutdown: function BGZoomManager_shutdown()
+  {
+    var _self = this;
+    NotifierUtils.removeNotifierCallback("tabSelected",
+      function() { _self.onTabSelected(); }, this);
+    NotifierUtils.removeNotifierCallback("tabCreated",
+      function() { _self.onTabCreated(); }, this);
+  },
+
+  onTabSelected: function BGZoomManager_onTabSelect()
+  {
+    var zoom = this.getCurrentZoom();
+    gDialog["menulist-zoompanel"].value = Math.floor(zoom * 100) + "%"; 
+  },
+
+  onTabCreated: function BGZoomManager_onTabSelect()
+  {
+    var defaultZoom;
+    try {
+      defaultZoom = parseFloat(GetPrefs().getCharPref(this.kDEFAULT_ZOOM));
+    }
+    catch(e)
+    {
+      defaultZoom = 1;
+    }
+    this.setCurrentZoom(defaultZoom);
+    gDialog["menulist-zoompanel"].value = Math.floor(defaultZoom * 100) + "%"; 
+  }
+};
+
diff --git a/base/content/bluegriffon/sourceViewTemplate.html b/base/content/bluegriffon/sourceViewTemplate.html
new file mode 100644 (file)
index 0000000..da00275
--- /dev/null
@@ -0,0 +1,93 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+          "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+  <head>
+    <style type="text/css">
+      body {
+        background-color: white;
+        font-family: "Courier New", Courier, monospace;
+        font-size: 12px;
+      }
+      ul {
+        padding-left: 20px;
+        list-style-image: none;
+        list-style-type: none;
+      }
+
+      li > .plusTwisty {
+        display: none;
+      }
+      li > .minusTwisty {
+        display: inline;
+      }
+      li[open="true"] > .plusTwisty {
+        display: inline;
+      }
+      li[open="true"] > .minusTwisty {
+        display: none;
+      }
+
+      li:not([open="true"]) > ul {
+        display: none;
+      }
+      .tagName {
+        color: blue;
+      }
+      .attrName {
+        color: darkblue;
+      }
+      .attrValue {
+        color: red;
+      }
+      .textNode {
+        white-space: pre-wrap;
+      }
+      .at-separator {
+        color: white;
+        background-color: transparent;
+      }
+      *[selected="true"] *.at-separator {
+        color: darkblue;
+      }
+      .pre-content > ul {
+        white-space: pre;
+      }
+      li[selected="true"] {
+        background-color: darkblue;
+        color: white;
+        -moz-border-radius: 3px;
+      }
+      li[selected="true"] span {
+        color: white;
+      }
+    </style>
+    <title></title>
+    <script>
+      function startup()
+      {
+        document.addEventListener("click", onClick, true);
+      }
+
+      function shutdown()
+      {
+        document.removeEventListener("click", onClick, true);
+      }
+
+      function onClick(aEvent)
+      {
+        var e = aEvent.explicitOriginalTarget;
+
+        if (e.nodeName.toLowerCase() == "img")
+        {
+          e = e.parentNode;
+          if (e.hasAttribute("open"))
+            e.removeAttribute("open");
+          else
+            e.setAttribute("open", "true");
+          aEvent.preventDefault();
+        }
+      }
+    </script>
+  </head>
+  <body onload="startup();" onunload="shutdown();"></body>
+</html>
\ No newline at end of file
diff --git a/base/content/bluegriffon/utils/colors.js b/base/content/bluegriffon/utils/colors.js
new file mode 100644 (file)
index 0000000..e50c917
--- /dev/null
@@ -0,0 +1,94 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Pete Collins
+ *   Brian King
+ *   Daniel Glazman (glazman@disruptive-innovations.com), on behalf of Linspire Inc.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the NPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the NPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var ColorUtils = {
+  getDefaultBrowserColors: function()
+  {
+    var prefs = GetPrefs();
+    var colors = { UseSysColors: true,
+                   TextColor:0,
+                   BackgroundColor:0,
+                   LinkColor:0,
+                   ActiveLinkColor:0 ,
+                   VisitedLinkColor:0 };
+    try { colors.UseSysColors = prefs.getBoolPref("browser.display.use_system_colors"); } catch (e) {}
+  
+    if (!colors.UseSysColors)
+    {
+      try { colors.TextColor = prefs.getCharPref("browser.display.foreground_color"); } catch (e) {}
+  
+      try { colors.BackgroundColor = prefs.getCharPref("browser.display.background_color"); } catch (e) {}
+    }
+    // Use OS colors for text and background if explicitly asked or pref is not set
+    if (!colors.TextColor)
+      colors.TextColor = "windowtext";
+  
+    if (!colors.BackgroundColor)
+      colors.BackgroundColor = "window";
+  
+    colors.LinkColor = prefs.getCharPref("browser.anchor_color");
+    colors.ActiveLinkColor = prefs.getCharPref("browser.active_color");
+    colors.VisitedLinkColor = prefs.getCharPref("browser.visited_color");
+  
+    return colors;
+  },
+
+  getDocumentColors: function(aDocument)
+  {
+    var colors = { UseSysColors: true,
+                   TextColor:0,
+                   BackgroundColor:0,
+                   LinkColor:0,
+                   ActiveLinkColor:0 ,
+                   VisitedLinkColor:0 };
+    var editor  = EditorUtils.getCurrentEditor();
+    var bodyElt = editor.rootElement;
+    var doc     = editor.document;
+
+    var dummyAnchor1 = doc.createElement("a");
+    dummyAnchor1.setAttribute("href", "foo");
+    var dummyAnchor1 = doc.createElement("a");
+    dummyAnchor1.setAttribute("href", "foo");
+  },
+
+  getComputedColor: function(aElt)
+  {
+    
+  }
+};
diff --git a/base/content/bluegriffon/utils/css.js b/base/content/bluegriffon/utils/css.js
new file mode 100644 (file)
index 0000000..3f3e697
--- /dev/null
@@ -0,0 +1,312 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var CssUtils = {
+       getStyleSheets: function CssUtils_getStyleSheets(aDoc)
+       {
+               return aDoc.styleSheets;
+       },
+
+  _enumerateStyleSheet: function CssUtils__enumerateStyleSheet(aSheet, aCallback)
+  {
+    if (aCallback(aSheet))
+      return;
+    var rules = aSheet.cssRules;
+    for (var j = 0; j < rules.length; j++)
+    {
+      var rule = rules.item(j);
+      switch (rule.type)
+      {
+       case CSSRule.IMPORT_RULE:
+         this._enumerateStyleSheet(rule.styleSheet, aCallback);
+         break;
+       case CSSRule.MEDIA_RULE:
+         this._enumerateStyleSheet(rule, aCallback);
+         break;
+       default:
+         break;
+      }
+
+    }
+  },
+
+  enumerateStyleSheets: function CssUtils_enumerateStyleSheets(aDocument, aCallback)
+  {
+       var stylesheetsList = aDocument.styleSheets;
+    for (var i = 0; i < stylesheetsList.length; i++)
+    {
+      var sheet = stylesheetsList.item(i);
+      this._enumerateStyleSheet(sheet, aCallback);
+    }
+  },
+
+  getComputedStyle: function CssUtils_getComputedStyle(aElt)
+  {
+       return aElt.ownerDocument.defaultView.getComputedStyle(aElt, "");
+  },
+
+  findClassesInSelector: function CssUtils_findClassesInSelector(aSelector)
+  {
+    return aSelector.match( /\.-?([_a-z]|[\200-\377]|((\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?)|\\[^\r\n\f0-9a-f]))([_a-z0-9-]|[\200-\377]|((\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?)|\\[^\r\n\f0-9a-f]))*/gi );
+  },
+
+  findIdsInSelector: function CssUtils_findClassesInSelector(aSelector)
+  {
+    return aSelector.match( /#-?([_a-z]|[\200-\377]|((\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?)|\\[^\r\n\f0-9a-f]))([_a-z0-9-]|[\200-\377]|((\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?)|\\[^\r\n\f0-9a-f]))*/gi );
+  },
+
+  getCssHintsFromDocument: function CssUtils_getAllClassesFromDocument(aDocument, aDetector)
+  {
+    var classList = [];
+  
+    function enumerateClass(aSheet)
+    {
+      var cssRules = aSheet.cssRules;
+      for (var i = 0; i < cssRules.length; i++)
+      {
+        var rule = cssRules.item(i);
+        if (rule.type == CSSRule.STYLE_RULE)
+        {
+          var selectorText = rule.selectorText;
+          var matches = aDetector(selectorText);
+          if (matches)
+            for (var j = 0; j < matches.length; j++)
+              classList.push(matches[j].substr(1));
+        }
+      }
+      return false;
+    }
+  
+    CssUtils.enumerateStyleSheets(aDocument, enumerateClass);
+
+    return classList;
+  },
+
+  getAllClassesForDocument: function CssUtils_getAllClassesForDocument(aDocument)
+  {
+    return this.getCssHintsFromDocument(aDocument, this.findClassesInSelector);
+  },
+
+  getAllIdsForDocument: function CssUtils_getAllClassesForDocument(aDocument)
+  {
+    return this.getCssHintsFromDocument(aDocument, this.findIdsInSelector);
+  },
+
+  getAllLocalRulesForSelector: function CssUtils_getAllLocalRulesForSelector(aDocument, aSelector)
+  {
+    var ruleList = [];
+  
+    function enumerateRules(aSheet)
+    {
+      if (aSheet.ownerNode instanceof HTMLStyleElement)
+      {
+        var cssRules = aSheet.cssRules;
+        for (var i = 0; i < cssRules.length; i++)
+        {
+          var rule = cssRules.item(i);
+          if (rule.type == CSSRule.STYLE_RULE)
+          {
+            var selectorText = rule.selectorText;
+            if (selectorText == aSelector)
+              ruleList.push({rule:rule, index:i});
+          }
+        }
+        return false;
+      }
+      return true;
+    }
+  
+    CssUtils.enumerateStyleSheets(aDocument, enumerateRules);
+
+    return ruleList;
+  },
+
+  deleteAllLocalRulesForSelector: function CssUtils_deleteAllLocalRulesForSelector(aDocument, aSelector, aDeclarations)
+  {
+    var ruleList = this.getAllLocalRulesForSelector(aDocument, aSelector);
+    var l = ruleList.length;
+    for (var i = 0; i < l; i++)
+    {
+      var rule = ruleList[i].rule;
+      var parentRule = rule.parentRule;
+      var parentStyleSheet = rule.parentStyleSheet;
+      if (rule.type == CSSRule.STYLE_RULE && !parentRule)
+      {
+        if (aDeclarations)
+        {
+          for (var j = 0; j < aDeclarations.length; j++)
+            rule.style.removeProperty(aDeclarations[j].property);
+          if (!rule.style.length)
+            parentStyleSheet.deleteRule(ruleList[i].index);
+        }
+        else
+          parentStyleSheet.deleteRule(ruleList[i].index);
+      }
+      this.reserializeEmbeddedStylesheet(parentStyleSheet);
+    }
+  },
+
+  getStyleSheetForScreen: function CssUtils_getStyleSheetForScreen(aDocument)
+  {
+    var styleElements = aDocument.getElementsByTagName("style");
+    var stylesheet = null;
+    if (styleElements.length)
+    {
+      // try to find a stylesheet for the correct media
+      for (var i = 0; !stylesheet && i < styleElements.length; i++)
+      {
+        var styleElement = styleElements[i];
+        if (styleElement.hasAttribute("media"))
+        {
+          var mediaAttr = styleElement.getAttribute("media");
+          if (mediaAttr.indexOf("screen") != -1||
+              mediaAttr.indexOf("all") != -1)
+            stylesheet = styleElement.sheet;
+        }
+        else
+          stylesheet = styleElement.sheet;
+      }
+    }
+    if (!stylesheet)
+    {
+      var styleElement = aDocument.createElement("style");
+      styleElement.setAttribute("type", "text/css");
+      var textNode = aDocument.createTextNode("/* created by BlueGriffon */");
+      styleElement.appendChild(textNode);
+      aDocument.getElementsByTagName("head")[0].appendChild(styleElement);
+      stylesheet = styleElement.sheet;
+    }
+    return stylesheet;
+  },
+
+  addRuleForSelector: function CssUtils_addRuleForSelector(aDocument, aSelector, aDeclarations)
+  {
+    this.deleteAllLocalRulesForSelector(aDocument, aSelector, aDeclarations);
+    var ruleList = this.getAllLocalRulesForSelector(aDocument, aSelector);
+
+    if (!ruleList || !ruleList.length)
+    {
+      var stylesheet = this.getStyleSheetForScreen(aDocument);
+      var str = stylesheet.ownerNode.textContent;
+      str += "\n" + aSelector + " {";
+      for (var j = 0; j < aDeclarations.length; j++)
+      {
+        var property = aDeclarations[j].property;
+        var value = aDeclarations[j].value;
+        var priority = aDeclarations[j].priority;
+        str += "\n  " + property + ": " +
+               value +
+               (priority ? " !important;" : ";");
+      }
+      str += "\n}\n";
+      stylesheet.ownerNode.firstChild.data = str;
+      return;
+    }
+
+    var rule = ruleList[ruleList.length -1].rule;
+    for (var j = 0; j < aDeclarations.length; j++)
+    {
+        var property = aDeclarations[j].property;
+        var value = aDeclarations[j].value;
+        var priority = aDeclarations[j].priority ? " !important" : "";
+
+        rule.style.setProperty(property,
+                               value,
+                               priority);
+    }
+
+    this.reserializeEmbeddedStylesheet(rule.parentStyleSheet);
+  },
+
+  reserializeEmbeddedStylesheet: function CssUtils_reserializeEmbeddedStylesheet(aSheet)
+  {
+    var cssRules = aSheet.cssRules;
+    var str = "";
+    for (var i = 0; i < cssRules.length; i++)
+    {
+      var rule = cssRules[i];
+      switch (rule.type)
+      {
+        case CSSRule.CHARSET_RULE:
+        case CSSRule.IMPORT_RULE:
+          str += (i ? "\n" : "") + rule.cssText;
+          break;
+        case CSSRule.STYLE_RULE:
+          {
+            str += (i ? "\n" : "") + rule.selectorText + " {\n " +
+                   rule.style.cssText.replace( /;/g , ";\n");
+            /*var declarations = rule.style;
+            for (var j = 0; j < declarations.length; j++)
+            {
+              var property = declarations.item(j);
+              var value = declarations.getPropertyValue(property);
+              var priority = declarations.getPropertyPriority(property);
+              str += "\n  " + property + ": " +
+                     value +
+                     (priority ? ";" : " !important;");
+            }*/
+          }
+          break;
+        default:
+          break;
+      }
+      str += "}\n";
+    }
+    var styleElt = aSheet.ownerNode;
+    var child = styleElt.firstChild;
+    while (child)
+    {
+      var tmp = child.nextSibling;
+      styleElt.removeChild(child);
+      child = tmp;
+    }
+    var textNode = styleElt.ownerDocument.createTextNode(str);
+    styleElt.appendChild(textNode);
+  },
+
+  getUseCSSPref: function()
+  {
+    try {
+      var useCSS = GetPrefs().getIntPref("bluegriffon.css.policy");
+      return useCSS;
+    }
+    catch(e) { dump("Cannot get preference bluegriffon.css.policy; defaulting to HTML attributes") }
+
+    return 0;
+  }
+};
+
diff --git a/base/content/bluegriffon/utils/dgid.js b/base/content/bluegriffon/utils/dgid.js
new file mode 100644 (file)
index 0000000..885ec70
--- /dev/null
@@ -0,0 +1,49 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+// we store all globals in a gDialog object for convenience
+var gDialog = {};
+
+function GetUIElements()
+{
+  var elts = document.getElementsByAttribute("id", "*");
+  for (var i = 0; i < elts.length; i++)
+  {
+    var elt = elts.item(i);
+    gDialog[ elt.getAttribute("id") ] = elt;
+  }
+}
diff --git a/base/content/bluegriffon/utils/editorUtils.js b/base/content/bluegriffon/utils/editorUtils.js
new file mode 100644 (file)
index 0000000..1a39429
--- /dev/null
@@ -0,0 +1,502 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var EditorUtils = {
+
+  /********** PUBLIC **********/
+
+  getCurrentTabEditor: function getCurrentTabEditor()
+  {
+    var tmpWindow = window;
+
+#ifdef XP_MACOSX
+    // do we have an app-modal window on MAC OS X ?
+    if (window.location.href != "chrome://bluegriffon/content/xul/bluegriffon.xul" &&
+        !tmpWindow.opener)
+    {
+           var windowManager = Components.classes[kWINDOWMEDIATOR_CID].getService();
+           var windowManagerInterface = windowManager.QueryInterface(nsIWindowMediator);
+      tmpWindow = windowManagerInterface.getMostRecentWindow("bluegriffon");
+    }
+#endif
+    
+    do {
+      var tabeditor = tmpWindow.document.getElementById("tabeditor");
+  
+      if (tabeditor)
+        return tabeditor ;
+  
+      tmpWindow = tmpWindow.opener;
+    } 
+    while (tmpWindow);
+  
+    return null;
+  },
+  
+  getCurrentEditorElement: function getCurrentEditorElement()
+  {
+       var tabeditor = this.getCurrentTabEditor();
+    if (tabeditor)
+      return tabeditor.getCurrentEditorElement() ;
+    return null;
+  },
+  
+  getCurrentEditor: function getCurrentEditor()
+  {
+    // Get the active editor from the <editor> tag
+    var editor = null;
+    try {
+      var editorElement = this.getCurrentEditorElement();
+      if (editorElement)
+      {
+        editor = editorElement.getEditor(editorElement.contentWindow);
+    
+        // Do QIs now so editor users won't have to figure out which interface to use
+        // Using "instanceof" does the QI for us.
+        editor instanceof Components.interfaces.nsIEditor;
+        editor instanceof Components.interfaces.nsIPlaintextEditor;
+        editor instanceof Components.interfaces.nsIHTMLEditor;
+      }
+    } catch (e) { dump("Error in GetCurrentEditor: " + e + "\n"); }
+  
+    return editor;
+  },
+
+  getCurrentDocument: function getCurrentDocument()
+  {
+    // Get the active editor from the <editor> tag
+    var editor = this.getCurrentEditor();
+    if (editor)
+      return editor.document;
+    return null;
+  },
+  
+  getCurrentCommandManager: function getCurrentCommandManager()
+  {
+    try {
+      return this.getCurrentEditorElement().commandManager;
+    } catch (e) { dump (e)+"\n"; }
+
+    return null;
+  },
+  
+  newCommandParams: function newCommandParams()
+  {
+    try {
+      const contractId = "@mozilla.org/embedcomp/command-params;1";
+      const nsICommandParams = Components.interfaces.nsICommandParams;
+
+      return Components.classes[contractId].createInstance(nsICommandParams);
+    }
+    catch(e) { dump("error thrown in newCommandParams: "+e+"\n"); }
+    return null;
+  },
+
+  getCurrentEditingSession: function getCurrentEditingSession()
+  {
+    try {
+      return this.getCurrentEditorElement().editingSession;
+    } catch (e) { dump (e)+"\n"; }
+
+    return null;
+  },
+
+  getCurrentEditorType: function getCurrentEditorType()
+  {
+    try {
+      return this.getCurrentEditorElement().editortype;
+    } catch (e) { dump (e)+"\n"; }
+
+    return "";
+  },
+
+  isAlreadyEdited: function isAlreadyEdited(aURL)
+  {
+    // blank documents are never "already edited"...
+    if (UrlUtils.isUrlAboutBlank(aURL))
+      return null;
+  
+    var url = UrlUtils.newURI(aURL).spec;
+  
+    var windowManager = Components.classes[kWINDOWMEDIATOR_CID].getService();
+    var windowManagerInterface = windowManager.QueryInterface(nsIWindowMediator);
+    var enumerator = windowManagerInterface.getEnumerator( "bluegriffon" );
+    while ( enumerator.hasMoreElements() )
+    {
+      var win = enumerator.getNext().QueryInterface(nsIDOMWindowInternal);
+      try {
+        var mixed = win.gDialog.tabeditor.isAlreadyEdited(url);
+        if (mixed)
+          return {window: win, editor: mixed.editor, index: mixed.index};
+      }
+      catch(e) {}
+    }
+    return null;
+  },
+
+  isDocumentEditable: function isDocumentEditable()
+  {
+    try {
+      return this.getCurrentEditor().isDocumentEditable;
+    } catch (e) { dump (e)+"\n"; }
+    return false;
+  },
+
+  isDocumentModified: function isDocumentModified()
+  {
+    try {
+      return this.getCurrentEditor().documentModified;
+    } catch (e) { dump (e)+"\n"; }
+    return false;
+  },
+
+  isDocumentEmpty: function isDocumentEmpty()
+  {
+    try {
+      return this.getCurrentEditor().documentIsEmpty;
+    } catch (e) { dump (e)+"\n"; }
+    return false;
+  },
+
+  getDocumentTitle: function getDocumentTitle()
+  {
+    try {
+      return this.getCurrentDocument().title;
+    } catch (e) { dump (e)+"\n"; }
+
+    return "";
+  },
+
+  isHTMLEditor: function isHTMLEditor()
+  {
+    // We don't have an editorElement, just return false
+    if (!this.getCurrentEditorElement())
+      return false;
+
+    var editortype = this.getCurrentEditorType();
+    switch (editortype)
+    {
+        case "html":
+        case "htmlmail":
+          return true;
+
+        case "text":
+        case "textmail":
+          return false
+
+        default:
+          dump("INVALID EDITOR TYPE: " + editortype + "\n");
+          break;
+    }
+    return false;
+  },
+
+  isEditingRenderedHTML: function isEditingRenderedHTML()
+  {
+    return this.isHTMLEditor(); // && !this.isInHTMLSourceMode();
+  },
+
+  setDocumentTitle: function setDocumentTitle(title)
+  {
+    try {
+      this.getCurrentEditor().setDocumentTitle(title);
+
+      // Update window title (doesn't work if called from a dialog)
+      if ("UpdateWindowTitle" in window)
+        window.UpdateWindowTitle();
+      else if ("UpdateWindowTitle" in window.opener)
+        window.opener.UpdateWindowTitle();
+    } catch (e) { dump (e)+"\n"; }
+  },
+
+  getSelectionContainer: function getSelectionContainer()
+  {
+    var editor = this.getCurrentEditor();
+    if (!editor) return null;
+
+    try {
+      var selection = editor.selection;
+      if (!selection) return null;
+    }
+    catch (e) { return null; }
+
+    var result = { oneElementSelected:false };
+
+    if (selection.isCollapsed) {
+      result.node = selection.focusNode;
+    }
+    else {
+      var rangeCount = selection.rangeCount;
+      if (rangeCount == 1) {
+        result.node = editor.getSelectedElement("");
+        var range = selection.getRangeAt(0);
+
+        // check for a weird case : when we select a piece of text inside
+        // a text node and apply an inline style to it, the selection starts
+        // at the end of the text node preceding the style and ends after the
+        // last char of the style. Assume the style element is selected for
+        // user's pleasure
+        if (!result.node &&
+            range.startContainer.nodeType == Node.TEXT_NODE &&
+            range.startOffset == range.startContainer.length &&
+            range.endContainer.nodeType == Node.TEXT_NODE &&
+            range.endOffset == range.endContainer.length &&
+            range.endContainer.nextSibling == null &&
+            range.startContainer.nextSibling == range.endContainer.parentNode)
+          result.node = range.endContainer.parentNode;
+
+        if (!result.node) {
+          // let's rely on the common ancestor of the selection
+          result.node = range.commonAncestorContainer;
+        }
+        else {
+          result.oneElementSelected = true;
+        }
+      }
+      else {
+        // assume table cells !
+        var i, container = null;
+        for (i = 0; i < rangeCount; i++) {
+          range = selection.getRangeAt(i);
+          if (!container) {
+            container = range.startContainer;
+          }
+          else if (container != range.startContainer) {
+            // all table cells don't belong to same row so let's
+            // select the parent of all rows
+            result.node = container.parentNode;
+            break;
+          }
+          result.node = container;
+        }
+      }
+    }
+
+    // make sure we have an element here
+    while (result.node.nodeType != Node.ELEMENT_NODE)
+      result.node = result.node.parentNode;
+
+    // and make sure the element is not a special editor node like
+    // the <br> we insert in blank lines
+    // and don't select anonymous content !!! (fix for bug 190279)
+    editor instanceof Components.interfaces.nsIHTMLEditor;
+    while (result.node.hasAttribute("_moz_editor_bogus_node") ||
+           editor.isAnonymousElement(result.node))
+      result.node = result.node.parentNode;
+
+    return result;
+  },
+
+  getMetaElement: function getMetaElement(aName)
+  {
+    if (aName)
+    {
+      var name = aName.toLowerCase();
+      try {
+        var metanodes = this.getCurrentDocument()
+                          .getElementsByTagName("meta");
+        for (var i = 0; i < metanodes.length; i++)
+        {
+          var metanode = metanodes.item(i);
+          if (metanode && metanode.getAttribute("name") == name)
+            return metanode;
+        }
+      }
+      catch(e) {}
+    }
+    return null;
+  },
+
+  createMetaElement: function createMetaElement(aName)
+  {
+    var editor = this.getCurrentEditor();
+    try {
+      var metanode = editor.createElementWithDefaults("meta");
+      metanode.setAttribute("name", aName);
+      return metanode;
+    }
+    catch(e) {}
+    return null;
+  },
+
+  insertMetaElement: function insertMetaElement(aElt, aContent, aInsertNew, aPrepend)
+  {
+   if (aElt)
+   {
+     var editor = this.getCurrentEditor();
+     try {
+       if (!aContent)
+       {
+         if (!insertNew)
+           editor.deleteNode(aElt);
+       }
+       else
+       {
+         if (aInsertNew)
+         {
+           aElt.setAttribute("content", aContent);
+           if (aPrepend)
+             this.prependHeadElement(aElt);
+           else
+             this.appendHeadElement(aElt);
+         }
+         else
+         {
+           editor.setAttribute(aElt, "content", aContent);
+         }
+       }
+     }
+     catch(e) {}
+   } 
+  },
+
+  getHeadElement: function getHeadElement()
+  {
+    try {
+      var doc = EditorUtils.getCurrentDocument();
+      var heads = doc.getElementsByTagName("head");
+      return heads.item(0);
+    }
+    catch(e) {}
+
+    return null;
+  },
+
+  prependHeadElement: function prependHeadElement(aElt)
+  {
+    var head = this.getHeadElement();
+    if (head)
+      try {
+        var editor = EditorUtils.getCurrentEditor();
+        editor.insertNode(aElt, head, 0, true);
+      }
+      catch(e) {}
+  },
+
+  appendHeadElement: function appendHeadElement(aElt)
+  {
+    var head = this.getHeadElement();
+    if (head)
+    {
+      var pos = 0;
+      if (head.hasChildNodes())
+        pos = head.childNodes.length;
+      try {
+        var editor = EditorUtils.getCurrentEditor();
+        editor.insertNode(aElt, head, pos, true);
+      }
+      catch(e) {}
+    }
+  },
+
+  getTextProperty: function(property, attribute, value, firstHas, anyHas, allHas)
+  {
+    try {
+      if (!gAtomService) GetAtomService();
+      var propAtom = gAtomService.getAtom(property);
+  
+      this.getCurrentEditor().getInlineProperty(propAtom, attribute, value,
+                                                firstHas, anyHas, allHas);
+    }
+    catch(e) {}
+  },
+
+  getClasses: function(aElt)
+  {
+    var e = aElt;
+    var display = CssUtils.getComputedStyle(e).getPropertyValue("display");
+    while (e && display == "inline" && e.className == "")
+    {
+      e = e.parentNode;
+      display = CssUtils.getComputedStyle(e).getPropertyValue("display");
+    }
+    return {classes: e.className, node: e};
+  },
+
+  getCurrentTableEditor: function()
+  {
+    var editor = this.getCurrentEditor();
+    return (editor &&
+            (editor instanceof Components.interfaces.nsITableEditor)) ? editor : null;
+  },
+
+  isStrictDTD: function()
+  {
+    var doctype = this.getCurrentEditor().document.doctype;
+    return (doctype.publicId.lastIndexOf("Strict") != -1);
+  },
+  
+  isCSSDisabledAndStrictDTD: function()
+  {
+    var prefs = GetPrefs();
+    var IsCSSPrefChecked = prefs.getBoolPref("editor.use_css");
+    return !IsCSSPrefChecked && this.isStrictDTD();
+  },
+
+  getDocumentUrl: function()
+  {
+    try {
+      var aDOMHTMLDoc = this.getCurrentEditor().document.QueryInterface(Components.interfaces.nsIDOMHTMLDocument);
+      return aDOMHTMLDoc.URL;
+    }
+    catch (e) {}
+    return "";
+  },
+
+  isXHTMLDocument: function()
+  {
+    var doctype = this.getCurrentEditor().document.doctype;
+    return (doctype.publicId == "-//W3C//DTD XHTML 1.0 Transitional//EN" ||
+            doctype.publicId == "-//W3C//DTD XHTML 1.0 Strict//EN");
+  },
+
+  getWrapColumn: function()
+  {
+    try {
+      return this.getCurrentEditor().wrapWidth;
+    } catch (e) {}
+    return 0;
+  },
+
+  setDocumentURI: function(uri)
+  {
+    try {
+      // XXX WE'LL NEED TO GET "CURRENT" CONTENT FRAME ONCE MULTIPLE EDITORS ARE ALLOWED
+      this.getCurrentEditorElement().docShell.setCurrentURI(uri);
+    } catch (e) { dump("SetDocumentURI:\n"+e +"\n"); }
+  }
+};
diff --git a/base/content/bluegriffon/utils/fileUtils.js b/base/content/bluegriffon/utils/fileUtils.js
new file mode 100644 (file)
index 0000000..fac8f4e
--- /dev/null
@@ -0,0 +1,568 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var FileUtils = {
+
+  kLAST_FILE_LOCATION_PREFIX: "bluegriffon.lastFileLocation.",
+
+  kErrorBindingAborted: 2152398850,
+  kErrorBindingRedirected: 2152398851,
+  kFileNotFound: 2152857618,
+
+  nsIFilePicker:Components.interfaces.nsIFilePicker,
+  nsIWebBrowserPersist: Components.interfaces.nsIWebBrowserPersist,
+  nsIWebProgressListener: Components.interfaces.nsIWebProgressListener,
+
+  mFilePickerDirectory: null,
+  mShowDebugOutputStateChange: false,
+  mPublishData: null,
+  mProgressDialog: null,
+
+  // throws an error or returns true if user attempted save; false if user canceled save
+  saveDocument: function(aSaveAs, aSaveCopy, aMimeType)
+  {
+    var editor = EditorUtils.getCurrentEditor();
+    if (!aMimeType || aMimeType == "" || !editor)
+      throw NS_ERROR_NOT_INITIALIZED;
+  
+    var editorDoc = editor.document;
+    if (!editorDoc)
+      throw NS_ERROR_NOT_INITIALIZED;
+  
+    // if we don't have the right editor type bail (we handle text and html)
+    var editorType = EditorUtils.getCurrentEditorType();
+    if (editorType != "html")
+      throw NS_ERROR_NOT_IMPLEMENTED;
+  
+    var urlstring = EditorUtils.getDocumentUrl();
+    var mustShowFileDialog = (aSaveAs ||
+                              UrlUtils.isUrlAboutBlank(urlstring) ||
+                              (urlstring == ""));
+  
+    // If editing a remote URL, force SaveAs dialog
+    if (!mustShowFileDialog && UrlUtils.getScheme(urlstring) != "file")
+      mustShowFileDialog = true;
+  
+    var replacing = !aSaveAs;
+    var titleChanged = false;
+    var doUpdateURI = false;
+    var tempLocalFile = null;
+  
+    if (mustShowFileDialog)
+    {
+      try {
+        // Prompt for title
+        var userContinuing = this.promptAndSetTitleIfNone(); // not cancel
+        if (!userContinuing)
+          return false;
+
+        var dialogResult = this.promptForSaveLocation(false, editorType, aMimeType, urlstring);
+        if (dialogResult.filepickerClick == this.nsIFilePicker.returnCancel)
+          return false;
+  
+        replacing = (dialogResult.filepickerClick == this.nsIFilePicker.returnReplace);
+        urlstring = dialogResult.resultingURIString;
+        tempLocalFile = dialogResult.resultingLocalFile;
+   
+        // update the new URL for the webshell unless we are saving a copy
+        if (!aSaveCopy)
+          doUpdateURI = true;
+     } catch (e) {  return false; }
+    } // mustShowFileDialog
+  
+    var success = true;
+    var ioService;
+    try {
+      // if somehow we didn't get a local file but we did get a uri, 
+      // attempt to create the localfile if it's a "file" url
+      var docURI;
+      if (!tempLocalFile)
+      {
+        ioService = UrlUtils.getIOService();
+        docURI = ioService.newURI(urlstring, editor.documentCharacterSet, null);
+        
+        if (docURI.schemeIs("file"))
+        {
+          var fileHandler = UrlUtils.getFileProtocolHandler();
+          tempLocalFile = fileHandler.getFileFromURLSpec(urlstring).QueryInterface(Components.interfaces.nsILocalFile);
+        }
+      }
+  
+      // this is the location where the related files will go
+      var relatedFilesDir = null;
+      
+      // First check pref for saving associated files
+      var saveAssociatedFiles = false;
+      try {
+        var prefs = GetPrefs();
+        saveAssociatedFiles = prefs.getBoolPref("editor.save_associated_files");
+      } catch (e) {}
+  
+      // Only change links or move files if pref is set 
+      //  and we are saving to a new location
+      if (saveAssociatedFiles && aSaveAs)
+      {
+        try {
+          if (tempLocalFile)
+          {
+            // if we are saving to the same parent directory, don't set relatedFilesDir
+            // grab old location, chop off file
+            // grab new location, chop off file, compare
+            var oldLocation = EditorUtils.getDocumentUrl();
+            var oldLocationLastSlash = oldLocation.lastIndexOf("\/");
+            if (oldLocationLastSlash != -1)
+              oldLocation = oldLocation.slice(0, oldLocationLastSlash);
+  
+            var relatedFilesDirStr = urlstring;
+            var newLocationLastSlash = relatedFilesDirStr.lastIndexOf("\/");
+            if (newLocationLastSlash != -1)
+              relatedFilesDirStr = relatedFilesDirStr.slice(0, newLocationLastSlash);
+            if (oldLocation == relatedFilesDirStr || UrlUtils.isUrlAboutBlank(oldLocation))
+              relatedFilesDir = null;
+            else
+              relatedFilesDir = tempLocalFile.parent;
+          }
+          else
+          {
+            var lastSlash = urlstring.lastIndexOf("\/");
+            if (lastSlash != -1)
+            {
+              var relatedFilesDirString = urlstring.slice(0, lastSlash + 1);  // include last slash
+              ioService = UrlUtils.getIOService();
+              relatedFilesDir = ioService.newURI(relatedFilesDirString, editor.documentCharacterSet, null);
+            }
+          }
+        } catch(e) { relatedFilesDir = null; }
+      }
+  
+      var destinationLocation;
+      if (tempLocalFile)
+        destinationLocation = tempLocalFile;
+      else
+        destinationLocation = docURI;
+  
+      success = this.outputFileWithPersistAPI(editorDoc, destinationLocation, relatedFilesDir, aMimeType);
+    }
+    catch (e)
+    {
+      success = false;
+    }
+  
+    if (success)
+    {
+      try {
+        if (doUpdateURI)
+        {
+           // If a local file, we must create a new uri from nsILocalFile
+          if (tempLocalFile)
+            docURI = UrlUtils.getFileProtocolHandler().newFileURI(tempLocalFile);
+  
+          // We need to set new document uri before notifying listeners
+          EditorUtils.setDocumentURI(docURI);
+        }
+  
+        // Update window title to show possibly different filename
+        // This also covers problem that after undoing a title change,
+        //   window title loses the extra [filename] part that this adds
+        UpdateWindowTitle();
+  
+        if (!aSaveCopy)
+          editor.resetModificationCount();
+        // this should cause notification to listeners that document has changed
+  
+        // Set UI based on whether we're editing a remote or local url
+        this.setSaveAndPublishUI(urlstring);
+      } catch (e) {}
+    }
+    else
+    {
+      var saveDocStr = L10NUtils.getString("SaveDocument");
+      var failedStr = L10NUtils.getString("SaveFileFailed");
+      PromptUtils.alertWithTitle(saveDocStr, failedStr);
+    }
+    return success;
+  },
+
+  promptAndSetTitleIfNone: function()
+  {
+    if (EditorUtils.getDocumentTitle()) // we have a title; no need to prompt!
+      return true;
+  
+    var result = {value:null};
+    var captionStr = L10NUtils.getString("DocumentTitle");
+    var msgStr = L10NUtils.getString("NeedDocTitle") + '\n' + L10NUtils.getString("DocTitleHelp");
+    var confirmed = PromptUtils.prompt(window, captionStr, msgStr, result, null, {value:0});
+    if (confirmed)
+      EditorUtils.setDocumentTitle(TrimString(result.value));
+  
+    return confirmed;
+  },
+
+  promptForSaveLocation: function(aDoSaveAsText, aEditorType, aMIMEType, aDocumentURLString)
+  {
+    var dialogResult = {};
+    dialogResult.filepickerClick = this.nsIFilePicker.returnCancel;
+    dialogResult.resultingURI = "";
+    dialogResult.resultingLocalFile = null;
+  
+    var fp = null;
+    try {
+      fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(this.nsIFilePicker);
+    } catch (e) {}
+    if (!fp) return dialogResult;
+  
+    // determine prompt string based on type of saving we'll do
+    var promptString;
+    if (aDoSaveAsText || aEditorType == "text")
+      promptString = L10NUtils.getString("ExportToText");
+    else
+      promptString = L10NUtils.getString("SaveDocumentAs")
+  
+    fp.init(window, promptString, this.nsIFilePicker.modeSave);
+  
+    // Set filters according to the type of output
+    if (aDoSaveAsText)
+      fp.appendFilters(this.nsIFilePicker.filterText);
+    /* else if (CurrentDocumentIsTemplate())
+      fp.appendFilter(GetString("HTMLtemplates"), "*.mzt"); */
+    else if (EditorUtils.isXHTMLDocument())
+      fp.appendFilter(L10NUtils.getString("XHTMLfiles"), "*.xhtml");
+    else
+      fp.appendFilters(this.nsIFilePicker.filterHTML);
+    fp.appendFilters(this.nsIFilePicker.filterAll);
+  
+    // now let's actually set the filepicker's suggested filename
+    var suggestedFileName = this.getSuggestedFileName(aDocumentURLString, aMIMEType);
+    if (suggestedFileName)
+      fp.defaultString = suggestedFileName;
+  
+    // set the file picker's current directory
+    // assuming we have information needed (like prior saved location)
+    try {
+      var ioService = UrlUtils.getIOService();
+      var fileHandler = UrlUtils.getFileProtocolHandler();
+      
+      var isLocalFile = true;
+      try {
+        var docURI = ioService.newURI(aDocumentURLString, 
+                                      EditorUtils.getCurrentEditor().documentCharacterSet,
+                                      null);
+        isLocalFile = docURI.schemeIs("file");
+      }
+      catch (e) {}
+  
+      var parentLocation = null;
+      if (isLocalFile)
+      {
+        var fileLocation = fileHandler.getFileFromURLSpec(aDocumentURLString); // this asserts if url is not local
+        parentLocation = fileLocation.parent;
+      }
+      if (parentLocation)
+      {
+        // Save current filepicker's default location
+        this.mFilePickerDirectory = fp.displayDirectory;
+  
+        fp.displayDirectory = parentLocation;
+      }
+      else
+      {
+        // Initialize to the last-used directory for the particular type (saved in prefs)
+        this.setFilePickerDirectory(fp, aEditorType);
+      }
+    }
+    catch(e) {}
+  
+    dialogResult.filepickerClick = fp.show();
+    if (dialogResult.filepickerClick != this.nsIFilePicker.returnCancel)
+    {
+      // reset urlstring to new save location
+      dialogResult.resultingURIString = fileHandler.getURLSpecFromFile(fp.file);
+      dialogResult.resultingLocalFile = fp.file;
+      this.saveFilePickerDirectory(fp, aEditorType);
+    }
+    else if (this.mFilePickerDirectory)
+      fp.displayDirectory = this.mFilePickerDirectory; 
+  
+    return dialogResult;
+  },
+
+  getSuggestedFileName: function(aDocumentURLString, aMIMEType)
+  {
+    var extension = this.getExtensionBasedOnMimeType(aMIMEType);
+    if (extension)
+      extension = "." + extension;
+  
+    // check for existing file name we can use
+    if (aDocumentURLString.length > 0 && !UrlUtils.isUrlAboutBlank(aDocumentURLString))
+    {
+      var docURI = null;
+      try {
+  
+        var ioService = UrlUtils.getIOService();
+        docURI = ioService.newURI(aDocumentURLString,
+                                  EditorUtils.getCurrentEditor().documentCharacterSet,
+                                  null);
+        docURI = docURI.QueryInterface(Components.interfaces.nsIURL);
+  
+        // grab the file name
+        var url = docURI.fileBaseName;
+        if (url)
+          return url+extension;
+      } catch(e) {}
+    } 
+  
+    // check if there is a title we can use
+    var title = EditorUtils.getDocumentTitle();
+    // generate a valid filename, if we can't just go with "untitled"
+    return this.generateValidFilename(title, extension) ||
+           L10NUtils.getString("untitled") + extension;
+  },
+
+setFilePickerDirectory: function(filePicker, fileType)
+{
+  if (filePicker)
+  {
+    try {
+      var prefBranch = GetPrefs();
+      if (prefBranch)
+      {
+        // Save current directory so we can reset it in SaveFilePickerDirectory
+        this.mFilePickerDirectory = filePicker.displayDirectory;
+
+        var location = prefBranch.getComplexValue(this.kLAST_FILE_LOCATION_PREFIX + fileType,
+                                                  Components.interfaces.nsILocalFile);
+        if (location)
+          filePicker.displayDirectory = location;
+      }
+    }
+    catch(e) {}
+  }
+},
+
+  saveFilePickerDirectory: function(filePicker, fileType)
+  {
+    if (filePicker && filePicker.file)
+    {
+      try {
+        var prefBranch = GetPrefs();
+  
+        var fileDir;
+        if (filePicker.file.parent)
+          fileDir = filePicker.file.parent.QueryInterface(Components.interfaces.nsILocalFile);
+  
+        if (prefBranch)
+         prefBranch.setComplexValue(this.kLAST_FILE_LOCATION_PREFIX + fileType,
+                                    Components.interfaces.nsILocalFile,
+                                    fileDir);
+      
+        var prefsService = GetPrefsService();
+          prefsService.savePrefFile(null);
+      } catch (e) {}
+    }
+  
+    // Restore the directory used before SetFilePickerDirectory was called;
+    // This reduces interference with Browser and other module directory defaults
+    if (this.mFilePickerDirectory)
+      filePicker.displayDirectory = this.mFilePickerDirectory;
+  
+    this.mFilePickerDirectory = null;
+  },
+
+  getExtensionBasedOnMimeType: function(aMIMEType)
+  {
+    /*if (CurrentDocumentIsTemplate())
+      return "mzt";*/
+  
+    try {
+      var mimeService = null;
+      mimeService = Components.classes["@mozilla.org/mime;1"].getService();
+      mimeService = mimeService.QueryInterface(Components.interfaces.nsIMIMEService);
+  
+      var fileExtension = mimeService.getPrimaryExtension(aMIMEType, null);
+  
+      // the MIME service likes to give back ".htm" for text/html files,
+      // so do a special-case fix here.
+      if (fileExtension == "htm")
+        fileExtension = "html";
+  
+      return fileExtension;
+    }
+    catch (e) {}
+    return "";
+  },
+
+  generateValidFilename: function(filename, extension)
+  {
+    if (filename) // we have a title; let's see if it's usable
+    {
+      // clean up the filename to make it usable and
+      // then trim whitespace from beginning and end
+      filename = this.validateFileName(filename).replace(/^\s+|\s+$/g, "");
+      if (filename.length > 0)
+        return filename + extension;
+    }
+    return null;
+  },
+  
+  validateFileName: function(aFileName)
+  {
+    var re = /[\/]+/g;
+    if (navigator.appVersion.indexOf("Windows") != -1) {
+      re = /[\\\/\|]+/g;
+      aFileName = aFileName.replace(/[\"]+/g, "'");
+      aFileName = aFileName.replace(/[\*\:\?]+/g, " ");
+      aFileName = aFileName.replace(/[\<]+/g, "(");
+      aFileName = aFileName.replace(/[\>]+/g, ")");
+    }
+    else if (navigator.appVersion.indexOf("Macintosh") != -1)
+      re = /[\:\/]+/g;
+    
+    return aFileName.replace(re, "_");
+  },
+
+  outputFileWithPersistAPI: function(editorDoc, aDestinationLocation, aRelatedFilesParentDir, aMimeType)
+  {
+    gPersistObj = null;
+    var editor = EditorUtils.getCurrentEditor();
+    try {
+      var imeEditor = editor.QueryInterface(Components.interfaces.nsIEditorIMESupport);
+      imeEditor.ForceCompositionEnd();
+      } catch (e) {}
+  
+    var isLocalFile = false;
+    try {
+      var tmp1 = aDestinationLocation.QueryInterface(Components.interfaces.nsIFile);
+      isLocalFile = true;
+    } 
+    catch (e) {
+      try {
+        var tmp = aDestinationLocation.QueryInterface(Components.interfaces.nsIURI);
+        isLocalFile = tmp.schemeIs("file");
+      }
+      catch (e) {}
+    }
+  
+    try {
+      // we should supply a parent directory if/when we turn on functionality to save related documents
+      var persistObj = Components.classes["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]
+                         .createInstance(this.nsIWebBrowserPersist);
+      //persistObj.progressListener = gEditorOutputProgressListener;
+      
+      var wrapColumn = EditorUtils.getWrapColumn();
+      var outputFlags = this.getOutputFlags(aMimeType, wrapColumn);
+  
+      // for 4.x parity as well as improving readability of file locally on server
+      // this will always send crlf for upload (http/ftp)
+      if (!isLocalFile) // if we aren't saving locally then send both cr and lf
+      {
+        outputFlags |= this.nsIWebBrowserPersist.ENCODE_FLAGS_CR_LINEBREAKS |
+                       this.nsIWebBrowserPersist.ENCODE_FLAGS_LF_LINEBREAKS;
+  
+        // we want to serialize the output for all remote publishing
+        // some servers can handle only one connection at a time
+        // some day perhaps we can make this user-configurable per site?
+        persistObj.persistFlags = persistObj.persistFlags |
+                                  this.nsIWebBrowserPersist.PERSIST_FLAGS_SERIALIZE_OUTPUT;
+      }
+  
+      // note: we always want to set the replace existing files flag since we have
+      // already given user the chance to not replace an existing file (file picker)
+      // or the user picked an option where the file is implicitly being replaced (save)
+      persistObj.persistFlags = persistObj.persistFlags 
+                              | this.nsIWebBrowserPersist.PERSIST_FLAGS_NO_BASE_TAG_MODIFICATIONS
+                              | this.nsIWebBrowserPersist.PERSIST_FLAGS_REPLACE_EXISTING_FILES
+                              | this.nsIWebBrowserPersist.PERSIST_FLAGS_DONT_FIXUP_LINKS
+                              | this.nsIWebBrowserPersist.PERSIST_FLAGS_DONT_CHANGE_FILENAMES
+                              | this.nsIWebBrowserPersist.PERSIST_FLAGS_FIXUP_ORIGINAL_DOM;
+  
+      // HACK: in Nvu, always save as text/html...
+      persistObj.saveDocument(editorDoc, aDestinationLocation, aRelatedFilesParentDir, 
+                              "text/html", outputFlags, wrapColumn);
+      gPersistObj = persistObj;
+    }
+    catch(e) { dump("caught an error, bail\n"); return false; }
+  
+    return true;
+  },
+
+  getOutputFlags: function(aMimeType, aWrapColumn)
+  {
+    var outputFlags = 0;
+    var editor = EditorUtils.getCurrentEditor();
+    var outputEntity = (editor && editor.documentCharacterSet == "ISO-8859-1")
+      ? this.nsIWebBrowserPersist.ENCODE_FLAGS_ENCODE_LATIN1_ENTITIES
+      : this.nsIWebBrowserPersist.ENCODE_FLAGS_ENCODE_BASIC_ENTITIES;
+    if (aMimeType == "text/plain")
+    {
+      // When saving in "text/plain" format, always do formatting
+      outputFlags |= this.nsIWebBrowserPersist.ENCODE_FLAGS_FORMATTED;
+    }
+    else
+    {
+      try {
+        // Should we prettyprint? Check the pref
+        var prefs = GetPrefs();
+        if (prefs.getBoolPref("bluegriffon.prettyprint"))
+          outputFlags |= this.nsIWebBrowserPersist.ENCODE_FLAGS_FORMATTED;
+  
+        // How much entity names should we output? Check the pref
+        var encodeEntity = prefs.getCharPref("bluegriffon.encode_entity");
+        switch (encodeEntity) {
+          case "basic"  : outputEntity = this.nsIWebBrowserPersist.ENCODE_FLAGS_ENCODE_BASIC_ENTITIES; break;
+          case "latin1" : outputEntity = this.nsIWebBrowserPersist.ENCODE_FLAGS_ENCODE_LATIN1_ENTITIES; break;
+          case "html"   : outputEntity = this.nsIWebBrowserPersist.ENCODE_FLAGS_ENCODE_HTML_ENTITIES; break;
+          case "none"   : outputEntity = 0; break;
+        }
+      }
+      catch (e) {}
+    }
+    outputFlags |= outputEntity;
+  
+    if (aWrapColumn > 0)
+      outputFlags |= this.nsIWebBrowserPersist.ENCODE_FLAGS_WRAP;
+  
+    return outputFlags;
+  },
+
+  setSaveAndPublishUI: function(urlstring)
+  {
+    // Be sure enabled state of toolbar buttons are correct
+    goUpdateCommand("cmd_save");
+    goUpdateCommand("cmd_publish");
+  }
+};
+
diff --git a/base/content/bluegriffon/utils/global.js b/base/content/bluegriffon/utils/global.js
new file mode 100644 (file)
index 0000000..85f12ce
--- /dev/null
@@ -0,0 +1,373 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+const kWINDOWMEDIATOR_CID = "@mozilla.org/appshell/window-mediator;1";
+
+const interfaces = Components.interfaces;
+const nsIWindowMediator = interfaces.nsIWindowMediator;
+const nsIDOMWindowInternal = interfaces.nsIDOMWindowInternal;
+const nsIPlaintextEditor = interfaces.nsIPlaintextEditor;
+const nsIHTMLEditor = interfaces.nsIHTMLEditor;
+const nsIEditingSession = interfaces.nsIEditingSession;
+
+var BlueGriffonVars = {
+  kXUL_NS: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
+};
+
+var gPrefs = null;
+
+function TrimStringLeft(string)
+{
+  if(!string) return "";
+  return string.replace(/^\s+/, "");
+}
+
+function TrimStringRight(string)
+{
+  if (!string) return "";
+  return string.replace(/\s+$/, '');
+}
+
+// Remove whitespace from both ends of a string
+function TrimString(string)
+{
+  if (!string) return "";
+  return string.replace(/(^\s+)|(\s+$)/g, '')
+}
+
+function baseConverter (number,ob,nb) {
+       // Created 1997 by Brian Risk.  http://members.aol.com/brianrisk
+       number = String(number).toUpperCase();
+       var list = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+       var dec = 0;
+       for (var i = 0; i <=  number.length; i++) {
+               dec += (list.indexOf(number.charAt(i))) * (Math.pow(ob , (number.length - i - 1)));
+       }
+       number = "";
+       var magnitude = Math.floor((Math.log(dec))/(Math.log(nb)));
+       for (var i = magnitude; i >= 0; i--) {
+               var amount = Math.floor(dec/Math.pow(nb,i));
+               number = number + list.charAt(amount); 
+               dec -= amount*(Math.pow(nb,i));
+       }
+       return number;
+}
+
+// used by openLocation. see openLocation.js for additional notes.
+function delayedOpenWindow(chrome, flags, param1, param2)
+{
+  dump("delayOpenWindow: setting timeout\n");
+  setTimeout("window.openDialog('"+chrome+"','_blank','"+flags+"','"+param1+"','"+param2+"')", 10);
+}
+
+function GetPrefs()
+{
+  if (gPrefs)
+    return gPrefs;
+  try {
+    gPrefs = Components.classes["@mozilla.org/preferences-service;1"]
+                     .getService(Components.interfaces.nsIPrefBranch);
+  } catch (ex) {
+    // not critical, remain silent
+  }
+  return gPrefs;
+}
+
+function GetPrefsService()
+{
+  if (gPrefsService)
+    return gPrefsService;
+
+  try {
+    gPrefsService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
+  }
+  catch(ex) {
+    dump("failed to get prefs service!\n");
+  }
+
+  return gPrefsService;
+}
+
+function GetUnicharPref(aPrefName, aDefVal)
+{
+  var prefs = GetPrefs();
+  if (prefs)
+  {
+    try {
+      return prefs.getComplexValue(aPrefName, Components.interfaces.nsISupportsString).data;
+    }
+    catch(e) {}
+  }
+  return "";
+}
+
+function SetUnicharPref(aPrefName, aPrefValue)
+{
+  var prefs = GetPrefs();
+  if (prefs)
+  {
+    try {
+      var str = Components.classes["@mozilla.org/supports-string;1"]
+                          .createInstance(Components.interfaces.nsISupportsString);
+      str.data = aPrefValue;
+      prefs.setComplexValue(aPrefName, Components.interfaces.nsISupportsString, str);
+    }
+    catch(e) {}
+  }
+}
+
+function toOpenWindowByType(inType, uri)
+{
+  window.open(uri, "_blank", "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar");
+}
+
+function SetTextboxFocusById(aId)
+{
+  SetTextboxFocus(document.getElementById(aId));
+}
+
+function SetTextboxFocus(aElt)
+{
+  if (aElt)
+  {
+    setTimeout( function(textbox) { textbox.focus(); textbox.select(); }, 0, aElt);
+  }
+}
+
+function SetEnabledElementAndControl(aElt, aEnabled)
+{
+  if (aElt)
+  {
+    SetEnabledElement(aElt, aEnabled);
+    if (aElt.hasAttribute("control"))
+    {
+      SetEnabledElement(document.getElementById(aElt.getAttribute("control")),
+                        aEnabled);
+    }
+  }
+}
+
+function SetEnabledElement(aElt, aEnabled)
+{
+  if (!aElt)
+    return;
+  if (aEnabled)
+    aElt.removeAttribute("disabled");
+  else
+    aElt.setAttribute("disabled", "true");
+}
+
+function deleteAllChildren(aElt)
+{
+  var child = aElt.lastChild;
+  while (child)
+  {
+    var tmp = child.previousSibling;
+    aElt.removeChild(child);
+    child = tmp;
+  }
+}
+
+function initClassMenu(menuPopup, aUseSelection)
+{
+  deleteAllChildren(menuPopup);
+
+  var mixedObj = new Object();
+  var classesArray, classesArrayLength = 0;
+  
+  if (aUseSelection)
+  {
+    var classes  = EditorUtils.getClasses(EditorUtils.getSelectionContainer().node).classes;
+    if (classes)
+    {
+      classesArray = classes.split(" ");
+      classesArray.sort();
+      classesArrayLength = classesArray.length;
+
+      for (var index = 0; index < classesArrayLength; index++)
+      {
+        var menuEntry = document.createElementNS(BlueGriffonVars.kXUL_NS, "menuitem");
+        menuEntry.setAttribute("type",    "checkbox");
+        menuEntry.setAttribute("checked", "true");
+        menuEntry.setAttribute("class",   "menuitem-iconic");
+        menuEntry.setAttribute("label",   classesArray[index]);
+        menuEntry.setAttribute("value",   classesArray[index]);
+  
+        menuPopup.appendChild(menuEntry);
+      }
+    }
+  }
+  else
+  {
+    var menuEntry = document.createElementNS(BlueGriffonVars.kXUL_NS, "menuitem");
+    menuEntry.setAttribute("type",    "checkbox");
+    menuEntry.setAttribute("class",   "menuitem-iconic");
+    menuEntry.setAttribute("label",   L10NUtils.getString("NoClassAvailable"));
+    menuEntry.setAttribute("value",   "");
+    menuPopup.appendChild(menuEntry);
+
+    var menuSep = document.createElementNS(BlueGriffonVars.kXUL_NS, "menuseparator");
+    menuPopup.appendChild(menuSep);
+
+    menuPopup.parentNode.selectedIndex = 0;
+  }
+
+  var classList =  CssUtils.getAllClassesForDocument(EditorUtils.getCurrentEditor().document);
+
+  if (classList && classList.length)
+  {
+    if (classesArrayLength)
+    {
+      var menuSep = document.createElementNS(BlueGriffonVars.kXUL_NS, "menuseparator");
+      menuPopup.appendChild(menuSep);
+    }
+
+
+    var classListLength = classList.length;
+
+    classList.sort();
+
+    var previousClass = "";
+    for (var index = 0; index < classListLength; index++)
+    {
+      var classEntry = classList[index];
+      if (classEntry != previousClass)
+      {
+        previousClass = classEntry;
+
+        var found = false;
+        if (classesArrayLength)
+        {
+          var existingClassesIndex;
+          for (existingClassesIndex = 0; existingClassesIndex < classesArrayLength; existingClassesIndex++)
+            if (classesArray[existingClassesIndex] == classEntry)
+            {
+              found = true;
+              break;
+            }
+        }
+        if (!found)
+        {
+          menuEntry = document.createElementNS(BlueGriffonVars.kXUL_NS, "menuitem");
+          menuEntry.setAttribute("type",    "checkbox");
+          menuEntry.setAttribute("class",   "menuitem-iconic");
+          menuEntry.setAttribute("label",   classEntry);
+          menuEntry.setAttribute("value",   classEntry);
+          menuPopup.appendChild(menuEntry);
+        }
+      }
+    }
+  }
+  else if (aUseSelection)
+  {
+    // no class defined in the document
+    menuEntry = document.createElementNS(BlueGriffonVars.kXUL_NS, "menuitem");
+    menuEntry.setAttribute("type",    "checkbox");
+    menuEntry.setAttribute("label",   L10NUtils.getString("NoClassAvailable"));
+    menuPopup.appendChild(menuEntry);
+  }
+}
+
+function initIdMenu(menuPopup)
+{
+  deleteAllChildren(menuPopup);
+
+  var menuEntry = document.createElementNS(BlueGriffonVars.kXUL_NS, "menuitem");
+  menuEntry.setAttribute("type",    "checkbox");
+  menuEntry.setAttribute("class",   "menuitem-iconic");
+  menuEntry.setAttribute("label",   L10NUtils.getString("NoIdAvailable"));
+  menuEntry.setAttribute("value",   "");
+  menuPopup.appendChild(menuEntry);
+
+  var menuSep = document.createElementNS(BlueGriffonVars.kXUL_NS, "menuseparator");
+  menuPopup.appendChild(menuSep);
+
+  menuPopup.parentNode.selectedIndex = 0;
+
+  var idList =  CssUtils.getAllIdsForDocument(EditorUtils.getCurrentEditor().document);
+
+  if (idList && idList.length)
+  {
+    var idListLength = idList.length;
+
+    idList.sort();
+
+    var previousId = "";
+    for (var index = 0; index < idListLength; index++)
+    {
+      var idEntry = idList[index];
+      if (idEntry != previousId)
+      {
+        previousId = idEntry;
+
+        menuEntry = document.createElementNS(BlueGriffonVars.kXUL_NS, "menuitem");
+        menuEntry.setAttribute("type",    "checkbox");
+        menuEntry.setAttribute("class",   "menuitem-iconic");
+        menuEntry.setAttribute("label",   idEntry);
+        menuEntry.setAttribute("value",   idEntry);
+        menuPopup.appendChild(menuEntry);
+      }
+    }
+  }
+}
+
+function GetIndexOfNode(aNode)
+{
+  if (aNode)
+  {
+    // the following 3 lines are an excellent suggestion from Neil Rashbrook
+    var range = aNode.ownerDocument.createRange();
+    range.selectNode(aNode);
+    return range.startOffset;
+  }
+  return null;
+}
+
+function OpenAppModalWindow(aParentWindow, aChromeURL, aWindowName) 
+{
+  var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
+                     .getService(Components.interfaces.nsIWindowWatcher);
+#ifdef XP_MACOSX
+  ww.openWindow(null, // make this an app-modal window on Mac
+#else
+  ww.openWindow(aParentWindow,
+#endif
+                aChromeURL,
+                aWindowName,
+                "chrome,titlebar,centerscreen,modal",
+                null);
+};
diff --git a/base/content/bluegriffon/utils/l10n.js b/base/content/bluegriffon/utils/l10n.js
new file mode 100644 (file)
index 0000000..0091a45
--- /dev/null
@@ -0,0 +1,111 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var L10NUtils = {
+
+  /********** CONSTANTS **********/
+
+  kCOMPOSER_PROPERTIES: "chrome://bluegriffon/locale/bluegriffon.properties",
+
+  /********** ATTRIBUTES **********/
+
+  mStringBundleService: null,
+  mStringBundle: null,
+
+  /********** PRIVATE **********/
+
+  _getStringBundleService: function _getStringBundleService()
+  {
+    if (!this.mStringBundleService)
+    {
+      try {
+        this.mStringBundleService =
+            Components.classes["@mozilla.org/intl/stringbundle;1"]
+                      .getService(Components.interfaces.nsIStringBundleService); 
+      } catch (e) { dump (e)+"\n"; }
+    }
+    return this.mStringBundleService;
+  },
+
+  _getStringFromBundle: function _getStringFromBundle(aBundle, aName)
+  {
+    if (aBundle)
+    {
+      try {
+        return aBundle.GetStringFromName(aName);
+      } catch (e) { dump (e)+"\n"; }
+    }
+    return null;
+  },
+
+  _getBundleFromURL: function _getBundleFromURL(aProperties)
+  {
+    var stringBundle;
+    if (this._getStringBundleService())
+      try {
+        stringBundle = this.mStringBundleService.createBundle(aProperties);
+      } catch (e) { dump (e)+"\n"; }
+    return stringBundle;
+  },
+
+  /********** PUBLIC **********/
+
+  getString: function getString(aName)
+  {
+    return this._getStringFromBundle(this.getBundle(), aName);
+  },
+
+  getStringFromURL: function getStringFromURL(aName, aProperties)
+  {
+    var stringBundle;
+    try {
+      stringBundle = this._getBundleFromURL(aProperties); 
+    } catch (e) { dump (e)+"\n"; }
+
+    return this._getStringFromBundle(stringBundle, aName);
+  },
+
+  getBundle: function getBundle()
+  {
+    if (!this.mStringBundle)
+      try {
+        this.mStringBundle = this._getBundleFromURL(this.kCOMPOSER_PROPERTIES); 
+      } catch (e) { dump (e)+"\n"; }
+
+    return this.mStringBundle;
+  }
+};
diff --git a/base/content/bluegriffon/utils/login.js b/base/content/bluegriffon/utils/login.js
new file mode 100644 (file)
index 0000000..1f4cf58
--- /dev/null
@@ -0,0 +1,147 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var LoginUtils = {
+
+  mLoginManager: null,
+
+  _getLoginManager: function()
+  {
+    if (!this.mLoginManager)
+           try {
+                   this.mLoginManager = Components.classes["@mozilla.org/login-manager;1"]
+                                    .getService(Components.interfaces.nsILoginManager);
+           }
+           catch(e) { dump(e + "\n");}
+
+    return this.mLoginManager;
+  },
+
+  newLoginInfo: function(aURL, aUser, aPassword)
+  {
+               var nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
+                                                            Components.interfaces.nsILoginInfo,
+                                                            "init");
+                   
+               var loginInfo = new nsLoginInfo(aURL, null, "bluegriffon", aUser, aPassword,
+                                               "", "");
+    return loginInfo;
+  },
+
+  addLogin: function(aURL, aUser, aPassword)
+  {
+    var loginInfo = this.newLoginInfo(aURL, aUser, aPassword);
+    try {
+      this._getLoginManager().addLogin(loginInfo);
+    }
+    catch(e) { dump(e + "\n");}
+  },
+
+  checkForMasterPasswordSetting: function()
+  {
+    if (!this.isMasterPasswordSet())
+    {
+      const bundleURL = "chrome://bluegriffon/locale/masterPasswordQuery.properties";
+      var windowTitle = L10NUtils.getStringFromURL("windowTitle", bundleURL);
+      var query = L10NUtils.getStringFromURL("query", bundleURL);
+      var yesButton = L10NUtils.getStringFromURL("yesButton", bundleURL);
+      var noButton = L10NUtils.getStringFromURL("noButton", bundleURL);
+      if (PromptUtils.confirmWithTitle(windowTitle, query, yesButton, noButton))
+        this.openSetMasterPasswordDialog();
+    }
+  },
+
+  openSetMasterPasswordDialog: function()
+  {
+    window.openDialog("chrome://mozapps/content/preferences/changemp.xul", "",
+                      "modal,centerscreen,resizable=no", null);
+  },
+
+  openRemoveMasterPasswordDialog: function()
+  {
+    window.openDialog("chrome://mozapps/content/preferences/removemp.xul", "",
+                      "modal,centerscreen,resizable=no", null);
+  },
+
+  isMasterPasswordSet: function ()
+  {
+    const Cc = Components.classes, Ci = Components.interfaces;
+    var secmodDB = Cc["@mozilla.org/security/pkcs11moduledb;1"].
+                   getService(Ci.nsIPKCS11ModuleDB);
+    var slot = secmodDB.findSlotByName("");
+    if (slot)
+    {
+      var status = slot.status;
+      var hasMP = status != Ci.nsIPKCS11Slot.SLOT_UNINITIALIZED &&
+                  status != Ci.nsIPKCS11Slot.SLOT_READY;
+      return hasMP;
+    }
+    else
+    {
+      // XXX I have no bloody idea what this means
+      return false;
+    }
+  },
+
+  findPassword: function(hostname, formSubmitURL, httprealm, username)
+  {
+               var password = null;
+               
+               try {
+                  // Get Login Manager 
+                  var myLoginManager = this._getLoginManager();
+                   
+                  // Find users for the given parameters
+                  var logins = myLoginManager.findLogins({}, hostname, formSubmitURL, httprealm);
+                     
+                  // Find user from returned array of nsILoginInfo objects
+                  for (var i = 0; i < logins.length; i++) {
+                     if (logins[i].username == username) {
+                        password = logins[i].password;
+                        break;
+                     }
+                  }
+               }
+               catch(ex) {
+                  // This will only happen if there is no nsILoginManager component class
+               }
+
+    return password;
+  }
+
+};
+
diff --git a/base/content/bluegriffon/utils/notifiers.js b/base/content/bluegriffon/utils/notifiers.js
new file mode 100644 (file)
index 0000000..90c01d1
--- /dev/null
@@ -0,0 +1,147 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var NotifierUtils = {
+
+  mKeywords: {},
+  mContexts: {},
+
+  // PRIVATE
+
+  _error: function NotifierUtils__error(aErrorString, aHelperString)
+  {
+    var caller = this._error.caller;
+    var s = "";
+    for (i in this)
+      if (this[i].toString() == caller)
+      {
+        s = i + "()";
+        break;
+      }
+    var errorString = aErrorString +
+                      (aHelperString ? " '" + aHelperString + "'" : "");
+    dump("### NotifierUtils: " + s + " " + errorString + "\n");
+  },
+
+  _addNotifier: function NotifierUtils__addNotifier(aKeyword)
+  {
+    if (aKeyword &&
+        !(aKeyword in this.mKeywords))
+    {
+      this.mKeywords[aKeyword] = [];
+      this.mContexts[aKeyword] = [];
+    }
+  },
+
+
+  // PUBLIC
+
+  cleanNotifier: function NotifierUtils_cleanNotifier(aKeyword)
+  {
+    if (aKeyword in this.mKeywords)
+    {
+      this.mKeywords[aKeyword] = [];
+      this.mContexts[aKeyword] = [];
+    }
+    else
+      this._error("called with unrecognized notifier id", aKeyword);
+  },
+
+  addNotifierCallback: function NotifierUtils_addNotifierCallback(aKeyword, aFn, aContext)
+  {
+    if (!aKeyword || !aFn || (typeof aFn != "function"))
+    {
+      this._error("invalid call\n");
+      return;
+    }
+
+    if (!(aKeyword in this.mKeywords))
+      this._addNotifier((aKeyword));
+
+    if (aKeyword in this.mKeywords)
+    {
+      this.mKeywords[aKeyword].push( aFn );
+      this.mContexts[aKeyword].push( aContext );
+    }
+    else
+      this._error("called with unrecognized notifier id", aKeyword);
+  },
+
+  removeNotifierCallback: function NotifierUtils_removeNotifierCallback(aKeyword, aFn)
+  {
+    if (!aKeyword || !aFn || (typeof aFn != "function"))
+    {
+      this._error("invalid call\n");
+      return;
+    }
+
+    if (aKeyword in this.mKeywords)
+    {
+      var callbacks = this.mKeywords[aKeyword];
+      for (var index = 0; index < callbacks.length;  index++)
+        if (callbacks[index] == aFn)
+        {
+          this.mKeywords[aKeyword].splice(index, 1);
+          this.mContexts[aKeyword].splice(index, 1);
+          return;
+        }
+      this._error("no such callback for notifier id", aKeyword);
+    }
+    else
+      this._error("called with unrecognized notifier id", aKeyword);
+  },
+
+  notify: function NotifierUtils_notify(aKeyword)
+  {
+    if (aKeyword in this.mKeywords)
+    {
+      var processes = this.mKeywords[aKeyword];
+      var contexts  = this.mContexts[aKeyword];
+
+      for (var i = 0; i < processes.length; i++)
+        try {
+          processes[i].apply(contexts[i], arguments);
+        }
+        catch (e) {
+          this._error("callback raised an exception for notifier id", aKeyword);
+        }
+    }
+    else
+      this._error("called with unrecognized notifier id", aKeyword);
+  }
+
+};
diff --git a/base/content/bluegriffon/utils/prompter.js b/base/content/bluegriffon/utils/prompter.js
new file mode 100644 (file)
index 0000000..ec6dc69
--- /dev/null
@@ -0,0 +1,111 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var PromptUtils = {
+
+  /********** ATTRIBUTES **********/
+
+  mPromptService: null,
+
+  /********** PRIVATE **********/
+
+  _getPromptService: function()
+  {
+    if (!this.mPromptService)
+    {
+      try {
+        this.mPromptService =
+          Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
+                    .getService(Components.interfaces.nsIPromptService);
+      }
+      catch(e) { dump("### cannot get a PromptService\n"); }
+    }
+    return this.mPromptService;
+  },
+
+  /********** PUBLIC **********/
+
+  alertWithTitle: function (aTitle, aMsg, aParentWindow)
+  {
+    var parentWindow = aParentWindow ? aParentWindow : window;
+
+    if (this._getPromptService())
+    {
+      if (!aTitle)
+        aTitle = L10NUtils.getString("Alert");
+
+      this.mPromptService.alert(parentWindow, aTitle, aMsg);
+    }
+  },
+
+  confirmWithTitle: function (aTitle, aMsg, aOkBtnText, aCancelBtnText)
+  {
+    const nsIPromptService = Components.interfaces.nsIPromptService;
+
+    var promptService = this._getPromptService();
+    if (promptService)
+    {
+      var okFlag = aOkBtnText ? nsIPromptService.BUTTON_TITLE_IS_STRING
+                              : nsIPromptService.BUTTON_TITLE_OK;
+      var cancelFlag = aCancelBtnText ? nsIPromptService.BUTTON_TITLE_IS_STRING
+                                      : nsIPromptService.BUTTON_TITLE_CANCEL;
+
+      return promptService.confirmEx(window, aTitle, aMsg,
+                                     (okFlag * nsIPromptService.BUTTON_POS_0) +
+                                     (cancelFlag * nsIPromptService.BUTTON_POS_1),
+                                     aOkBtnText, aCancelBtnText, null, null, {value:0}) == 0;
+    }
+    return false;
+  },
+
+  confirm: function(aTitle, aMsg)
+  {
+    var promptService = this._getPromptService();
+    if (promptService)
+    {
+      return promptService.confirm(window,
+                                   aTitle,
+                                   aMsg)
+    }
+    return false;
+  },
+
+  prompt: function(window, captionStr, msgStr, result)
+  {
+    return this._getPromptService().prompt(window, captionStr, msgStr, result, null, {value:0});
+  }
+};
diff --git a/base/content/bluegriffon/utils/urls.js b/base/content/bluegriffon/utils/urls.js
new file mode 100644 (file)
index 0000000..844ebea
--- /dev/null
@@ -0,0 +1,537 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var UrlUtils = {
+
+  /********** CONSTANTS ***********/
+
+  gWin: "Win",
+       gUNIX: "UNIX",
+  gMac: "Mac",
+
+ /********** ATTRIBUTES **********/
+
+  mIOService: null,
+  mOS: null,
+
+  /********** PUBLIC **********/
+
+  normalizeURL: function normalizeURL(url)
+  {
+    if (!this.getScheme(url) && !this.isUrlAboutBlank(url))
+    {
+      var k = Components.classes["@mozilla.org/file/local;1"]
+                        .createInstance(Components.interfaces.nsILocalFile);
+
+      var noBackSlashUrl = url.replace(/\\\"/g, "\"");
+      var c0 = noBackSlashUrl[0];
+      var c1 = noBackSlashUrl[1];
+      if ((c0 == '/') || ((/^[a-zA-z]/.test(c0)) && (c1 == ":") ))
+      {
+        // this is an absolute path
+        k.initWithPath(url);
+      }
+      else
+      {
+        // First, get the current dir for the process...
+        var dirServiceProvider =
+          Components.classes["@mozilla.org/file/directory_service;1"]
+                    .getService(Components.interfaces.nsIDirectoryServiceProvider);
+        var p = {};
+        var currentProcessDir = dirServiceProvider.getFile("CurWorkD", p).path;
+        k.initWithPath(currentProcessDir);
+
+        // then try to append the relative path
+        try {
+          k.appendRelativePath(url);
+        }
+        catch (e) {
+          dump("### Can't understand the filepath\n");
+          return "chrome://bluegriffon/content/blanks/transitional.html";
+        }
+        var ioService =
+          Components.classes["@mozilla.org/network/io-service;1"]
+                    .getService(Components.interfaces.nsIIOService);
+        var fileHandler =
+          ioService.getProtocolHandler("file")
+                   .QueryInterface(Components.interfaces.nsIFileProtocolHandler);
+        url = fileHandler.getURLSpecFromFile(k);
+      }
+    }
+    return url;
+  },
+
+  isUrlAboutBlank: function isUrlAboutBlank(urlString)
+  {
+    return (urlString == "chrome://bluegriffon/content/blanks/transitional.html");
+  },
+
+  getIOService: function getIOService()
+  {
+    if (this.mIOService)
+      return this.mIOService;
+
+    this.mIOService = Components.classes["@mozilla.org/network/io-service;1"]
+                      .getService(Components.interfaces.nsIIOService);
+
+    return this.mIOService;
+  },
+
+  newURI: function newURI(aURLString)
+  {
+    try {
+      return this.getIOService().newURI(aURLString, null, null);
+    } catch (e) { dump (e)+"\n"; }
+
+    return null;
+  },
+
+  isTextURI: function isTextURI(aText)
+  {
+    return aText && /^http:\/\/|^https:\/\/|^file:\/\/|\
+      ^ftp:\/\/|^about:|^mailto:|^news:|^snews:|^telnet:|^ldap:|\
+      ^ldaps:|^gopher:|^finger:|^javascript:/i.test(aText);
+  },
+
+  makeRelativeUrl: function makeRelativeUrl(aURLString)
+  {
+    var inputUrl = TrimString(aURLString);
+    if (!inputUrl)
+      return inputUrl;
+
+    // Get the filespec relative to current document's location
+    // NOTE: Can't do this if file isn't saved yet!
+    var docUrl = this.getDocumentBaseUrl();
+    var docScheme = this.getScheme(docUrl);
+
+    // Can't relativize if no doc scheme (page hasn't been saved)
+    if (!docScheme)
+      return inputUrl;
+
+    var urlScheme = this.getScheme(inputUrl);
+
+    // Do nothing if not the same scheme or url is already relativized
+    if (docScheme != urlScheme)
+      return inputUrl;
+
+    var IOService = this.getIOService();
+    if (!IOService)
+      return inputUrl;
+
+    // Host must be the same
+    var docHost = this.getHost(docUrl);
+    var urlHost = this.getHost(inputUrl);
+    if (docHost != urlHost)
+      return inputUrl;
+
+
+    // Get just the file path part of the urls
+    var charset = EditorUtils.getCurrentEditor().documentCharacterSet;
+    var docPath = IOService.newURI(docUrl,   charset, null).path;
+    var urlPath = IOService.newURI(inputUrl, charset, null).path;
+
+    // We only return "urlPath", so we can convert
+    //  the entire docPath for case-insensitive comparisons
+    var os = this.getOS();
+    var doCaseInsensitive = (docScheme == "file" && os == this.gWin);
+    if (doCaseInsensitive)
+      docPath = docPath.toLowerCase();
+
+    // Get document filename before we start chopping up the docPath
+    var docFilename = this.getFilename(docPath);
+
+    // Both url and doc paths now begin with "/"
+    // Look for shared dirs starting after that
+    urlPath = urlPath.slice(1);
+    docPath = docPath.slice(1);
+
+    var firstDirTest = true;
+    var nextDocSlash = 0;
+    var done = false;
+
+    // Remove all matching subdirs common to both doc and input urls
+    do {
+      nextDocSlash = docPath.indexOf("\/");
+      var nextUrlSlash = urlPath.indexOf("\/");
+
+      if (nextUrlSlash == -1)
+      {
+        // We're done matching and all dirs in url
+        // what's left is the filename
+        done = true;
+
+        // Remove filename for named anchors in the same file
+        if (nextDocSlash == -1 && docFilename)
+        { 
+          var anchorIndex = urlPath.indexOf("#");
+          if (anchorIndex > 0)
+          {
+            var urlFilename = doCaseInsensitive ? urlPath.toLowerCase() : urlPath;
+          
+            if (urlFilename.indexOf(docFilename) == 0)
+              urlPath = urlPath.slice(anchorIndex);
+          }
+        }
+      }
+      else if (nextDocSlash >= 0)
+      {
+        // Test for matching subdir
+        var docDir = docPath.slice(0, nextDocSlash);
+        var urlDir = urlPath.slice(0, nextUrlSlash);
+        if (doCaseInsensitive)
+          urlDir = urlDir.toLowerCase();
+
+        if (urlDir == docDir)
+        {
+
+          // Remove matching dir+"/" from each path
+          //  and continue to next dir
+          docPath = docPath.slice(nextDocSlash+1);
+          urlPath = urlPath.slice(nextUrlSlash+1);
+        }
+        else
+        {
+          // No match, we're done
+          done = true;
+
+          // Be sure we are on the same local drive or volume 
+          //   (the first "dir" in the path) because we can't 
+          //   relativize to different drives/volumes.
+          // UNIX doesn't have volumes, so we must not do this else
+          //  the first directory will be misinterpreted as a volume name
+          if (firstDirTest && docScheme == "file" && os != this.gUNIX)
+            return inputUrl;
+        }
+      }
+      else  // No more doc dirs left, we're done
+        done = true;
+
+      firstDirTest = false;
+    }
+    while (!done);
+
+    // Add "../" for each dir left in docPath
+    while (nextDocSlash > 0)
+    {
+      urlPath = "../" + urlPath;
+      nextDocSlash = docPath.indexOf("\/", nextDocSlash + 1);
+    }
+    return urlPath;
+  },
+
+  makeAbsoluteUrl: function makeAbsoluteUrl(url)
+  {
+    var resultUrl = TrimString(url);
+    if (!resultUrl)
+      return resultUrl;
+
+    // Check if URL is already absolute, i.e., it has a scheme
+    var urlScheme = this.getScheme(resultUrl);
+
+    if (urlScheme)
+      return resultUrl;
+
+    var docUrl = this.getDocumentBaseUrl();
+    var docScheme = this.getScheme(docUrl);
+
+    // Can't relativize if no doc scheme (page hasn't been saved)
+    if (!docScheme)
+      return resultUrl;
+
+    var  IOService = this.getIOService();
+    if (!IOService)
+      return resultUrl;
+    
+    // Make a URI object to use its "resolve" method
+    var absoluteUrl = resultUrl;
+    var docUri = IOService.newURI(docUrl, EditorUtils.getCurrentEditor().documentCharacterSet, null);
+
+    try {
+      absoluteUrl = docUri.resolve(resultUrl);
+      // This is deprecated and buggy! 
+      // If used, we must make it a path for the parent directory (remove filename)
+      //absoluteUrl = IOService.resolveRelativePath(resultUrl, docUrl);
+    } catch (e) { dump (e)+"\n"; }
+
+    return absoluteUrl;
+  },
+
+  getDocumentBaseUrl: function getDocumentBaseUrl()
+  {
+    try {
+      var docUrl;
+
+      // if document supplies a <base> tag, use that URL instead 
+      var baseList = EditorUtils.getCurrentEditor().document.getElementsByTagName("base");
+      if (baseList)
+      {
+        var base = baseList.item(0);
+        if (base)
+          docUrl = base.getAttribute("href");
+      }
+      if (!docUrl)
+        docUrl = this.getDocumentUrl();
+
+      if (!this.isUrlAboutBlank(docUrl))
+        return docUrl;
+    } catch (e) { dump (e)+"\n"; }
+    return "";
+  },
+
+  getDocumentUrl: function getDocumentUrl()
+  {
+    try {
+      var aDOMHTMLDoc = EditorUtils.getCurrentEditor().document.QueryInterface(Components.interfaces.nsIDOMHTMLDocument);
+      return aDOMHTMLDoc.URL;
+    }
+    catch (e) { dump (e)+"\n"; }
+    return "";
+  },
+
+  getScheme: function getScheme(urlspec)
+  {
+    var resultUrl = TrimString(urlspec);
+    // Unsaved document URL has no acceptable scheme yet
+    if (!resultUrl || this.isUrlAboutBlank(resultUrl))
+      return "";
+
+    var IOService = this.getIOService();
+    if (!IOService)
+      return "";
+
+    var scheme = "";
+    try {
+      // This fails if there's no scheme
+      scheme = IOService.extractScheme(resultUrl);
+    } catch (e) { dump (e)+"\n"; }
+
+    return scheme ? scheme.toLowerCase() : "";
+  },
+
+  _getURI: function _getURI(aURLSpec)
+  {
+    if (!aURLSpec)
+      return "";
+
+    var IOService = this.getIOService();
+    if (!IOService)
+      return "";
+
+    var uri = null;
+    try {
+      uri = IOService.newURI(aURLSpec, null, null);
+     } catch (e) { dump (e)+"\n"; }
+
+    return uri;
+  },
+
+  getHost: function getHost(aURLSpec)
+  {
+    var host = "";
+    var uri = this._getURI(aURLSpec);
+    if (uri)
+      host = uri.host;
+    return host;
+  },
+
+  getUsername: function getUsername(aURLSpec)
+  {
+    var username = "";
+    var uri = this._getURI(aURLSpec);
+    if (uri)
+      username = uri.username;
+    return username;
+  },
+
+  getFilename: function getFilename(aURLSpec)
+  {
+    var filename = "";
+    var uri = this._getURI(aURLSpec);
+    if (uri)
+    {
+      var url = uri.QueryInterface(Components.interfaces.nsIURL);
+      if (url)
+        filename = url.fileName;
+    }
+
+    return filename ? filename : "";
+  },
+
+  stripUsernamePassword: function stripUsernamePassword(aURLSpec, usernameObj, passwordObj)
+  {
+    var urlspec = TrimString(aURLSpec);
+    if (!urlspec || this.isUrlAboutBlank(urlspec))
+      return urlspec;
+
+    if (usernameObj)
+      usernameObj.value = "";
+    if (passwordObj)
+      passwordObj.value = "";
+
+    // "@" must exist else we will never detect username or password
+    var atIndex = aURLSpec.indexOf("@");
+    if (atIndex > 0)
+    {
+      try {
+        var IOService = this.getIOService();
+        if (!IOService)
+          return urlspec;
+
+        var uri = IOService.newURI(urlspec, null, null);
+        var username = uri.username;
+        var password = uri.password;
+
+        if (usernameObj && username)
+          usernameObj.value = username;
+        if (passwordObj && password)
+          passwordObj.value = password;
+        if (username)
+        {
+          var usernameStart = urlspec.indexOf(username);
+          if (usernameStart != -1)
+            return urlspec.slice(0, usernameStart) + urlspec.slice(atIndex+1);
+        }
+      } catch (e) { dump (e)+"\n"; }
+    }
+    return urlspec;
+  },
+
+  stripPassword: function stripPassword(aURLSpec, passwordObj)
+  {
+    var urlspec = TrimString(aURLSpec);
+    if (!urlspec || this.isUrlAboutBlank(urlspec))
+      return urlspec;
+
+    if (passwordObj)
+      passwordObj.value = "";
+
+    // "@" must exist else we will never detect password
+    var atIndex = urlspec.indexOf("@");
+    if (atIndex > 0)
+    {
+      try {
+        var IOService = this.getIOService();
+        if (!IOService)
+          return urlspec;
+
+        var password = IOService.newURI(urlspec, null, null).password;
+
+        if (passwordObj && password)
+          passwordObj.value = password;
+        if (password)
+        {
+          // Find last ":" before "@"
+          var colon = urlspec.lastIndexOf(":", atIndex);
+          if (colon != -1)
+          {
+            // Include the "@"
+            return urlspec.slice(0, colon) + urlspec.slice(atIndex);
+          }
+        }
+      } catch (e) { dump (e)+"\n"; }
+    }
+    return urlspec;
+  },
+
+  // Version to use when you have an nsIURI object
+  stripUsernamePasswordFromURI: function stripUsernamePasswordFromURI(aURI)
+  {
+    var urlspec = "";
+    if (aURI)
+    {
+      try {
+        urlspec = aURI.spec;
+        var userPass = aURI.userPass;
+        if (userPass)
+        {
+          start = urlspec.indexOf(userPass);
+          urlspec = urlspec.slice(0, start) + urlspec.slice(start+userPass.length+1);
+        }
+      } catch (e) { dump (e)+"\n"; }    
+    }
+    return urlspec;
+  },
+
+  insertUsernameIntoUrl: function insertUsernameIntoUrl(aURLSpec, aUserName)
+  {
+    if (!aURLSpec || !aUserName)
+      return aURLSpec;
+
+    try {
+      var ioService = this.getIOService();
+      var URI = ioService.newURI(aURLSpec, this.getCurrentEditor().documentCharacterSet, null);
+      URI.username = aUserName;
+      return URI.spec;
+    } catch (e) { dump (e)+"\n"; }
+
+    return aURLSpec;
+  },
+
+  getOS: function getOS()
+  {
+    if (this.mOS)
+      return this.mOS;
+
+    var platform = navigator.platform.toLowerCase();
+
+    if (platform.indexOf("win") != -1)
+      this.mOS = this.gWin;
+    else if (platform.indexOf("mac") != -1)
+      this.mOS = this.gMac;
+    else if (platform.indexOf("unix") != -1 || platform.indexOf("linux") != -1 || platform.indexOf("sun") != -1)
+      this.mOS = this.gUNIX;
+    else
+      this.mOS = "";
+    // Add other tests?
+
+    return this.mOS;
+  },
+
+  getFileProtocolHandler: function getFileProtocolHandler()
+  {
+    try {
+      var ios = this.getIOService();
+      var handler = ios.getProtocolHandler("file");
+      return handler.QueryInterface(Components.interfaces.nsIFileProtocolHandler);
+    }
+    catch (e) { dump (e)+"\n"; }
+    return null;
+  }
+
+};
+
+
diff --git a/base/content/bluegriffon/xul/aboutDialog.xul b/base/content/bluegriffon/xul/aboutDialog.xul
new file mode 100644 (file)
index 0000000..4fa495d
--- /dev/null
@@ -0,0 +1,93 @@
+<?xml version="1.0"?> <!-- -*- Mode: HTML -*- --> 
+
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla Firebird about dialog.
+#
+# The Initial Developer of the Original Code is
+# Blake Ross (blaker@netscape.com).
+# Portions created by the Initial Developer are Copyright (C) 2002
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Daniel Glazman <daniel.glazman@disruptive-innovations.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the LGPL or the GPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK ***** -->
+
+#filter substitution
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> 
+<?xml-stylesheet href="chrome://bluegriffon/content/aboutDialog.css" type="text/css"?> 
+
+<!DOCTYPE window [
+<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
+%brandDTD;
+<!ENTITY % aboutDialogDTD SYSTEM "chrome://bluegriffon/locale/aboutDialog.dtd" >
+%aboutDialogDTD;
+]>
+
+<dialog xmlns:html="http://www.w3.org/1999/xhtml"
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        id="aboutDialog"
+        windowtype="Composer:About"
+        onload="init(event);" onunload="uninit(event);"
+#ifdef XP_MACOSX
+        buttons="extra2"
+        align="end"
+#else
+        title="&aboutDialog.title;"
+        buttons="accept,extra2"
+#endif
+        creditslabel="&copyright;"
+        aboutlabel="&aboutLink;"
+        persist="screenX screenY"
+        screenX="24" screenY="24">
+    
+  <script type="application/x-javascript" src="chrome://bluegriffon/content/js/aboutDialog.js"/>
+
+  <deck id="modes" flex="1">
+    <vbox id="clientBox">
+      <hbox>
+        <image src="chrome://bluegriffon/content/about-logo.png"/>
+      </hbox>
+
+      <label id="version" value="&aboutVersion; @APP_VERSION@"/>
+
+      <description id="copyright">&copyrightText;</description>
+      <vbox id="detailsBox" align="center" flex="1">
+        <spacer flex="1"/>
+        <description id="userAgent"/>
+      </vbox>
+    </vbox>
+    <vbox flex="1" id="creditsBox">
+      <iframe id="creditsIframe" src="about:blank" flex="1"/>
+    </vbox>    
+  </deck>
+  <separator class="groove" id="groove"/>
+
+
+</dialog>
+
diff --git a/base/content/bluegriffon/xul/bluegriffon.xul b/base/content/bluegriffon/xul/bluegriffon.xul
new file mode 100644 (file)
index 0000000..6efb184
--- /dev/null
@@ -0,0 +1,194 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://bluegriffon/skin/bluegriffon.css" type="text/css"?>
+
+#include overlays.inc
+
+<!DOCTYPE window SYSTEM "chrome://bluegriffon/locale/bluegriffon.dtd">
+
+<window
+  id     = "Bluegriffon"
+  windowtype = "bluegriffon"
+  title  = "&window.title;"
+  width  = "800"
+  height = "600"
+  persist="screenX screenY width height"
+  onload = "Startup()"
+  onunload = "Shutdown()"
+  xmlns  = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+#include scripts.inc
+
+#include sets.inc
+
+#include menubar.inc
+
+  <toolbox class="toolbox-top" id="MainToolbox" mode="full">
+#include maintoolbarpalette.inc
+    <toolbar id="MainToolbar" class="toolbar-primary chromeclass-toolbar"
+             toolbarname="Main"
+             fullscreentoolbar="true"
+             persist="iconsize,mode"
+             iconsize="small"
+             mode="full"
+             context="main-toolbar-context-menu"
+             customizable="true"
+#ifdef XP_MACOSX
+             defaultset="newButton,openButton,saveButton,stopButton,spacer,tableButton,spring,throbber-box"/>
+#else
+             defaultset="newButton,spacer,openButton,spacer,saveButton,stopButton,spacer,tableButton,spring,throbber-box,spacer"/>
+#endif
+    <toolbarset id="customMainToolbars" context="format-toolbar-context-menu"/>
+  </toolbox>
+
+  <toolbox class="toolbox-top" id="FormatToolbox" mode="full">
+#include formatbarpalette.inc
+    <toolbar id="FormatToolbar" class="chromeclass-toolbar"
+             toolbarname="&formatToolbar.name;"
+             fullscreentoolbar="true"
+             persist="iconsize,mode"
+             iconsize="small"
+             mode="full"
+             context="format-toolbar-context-menu"
+             customizable="true"
+             defaultset="spacer,ParagraphSelectBox,separator,emButton,strongButton,codeButton,separator,boldButton,italicButton,underlineButton,separator,ulButton,olButton,separator,align-left-button,align-center-button,align-right-button,align-justify-button,separator,indentButton,outdentButton"/>
+    <toolbar id="FormatToolbar2" class="chromeclass-toolbar"
+             toolbarname="&formatToolbar2.name;"
+             fullscreentoolbar="true"
+             persist="iconsize,mode"
+             iconsize="small"
+             mode="full"
+             context="format-toolbar-context-menu"
+             customizable="true"
+             defaultset="spacer,ClassButtonsBox,FontFaceSelectBox,separator,dtButton,ddButton"/>
+    <toolbarset id="customFormatToolbars" context="format-toolbar-context-menu"/>
+  </toolbox>
+
+  <!-- XXX the following sidebaritems element is here only for test purposes
+       will be removed later -->
+  <sidebaritems id="sidebaritems">
+    <sidebaritem id="sidebaritem-glazman" name="glazman" src="http://glazman.org" title="Glazou's cave"/>
+    <sidebaritem id="sidebaritem-blank"   name="blank" src="about:blank" title="Blanc de blanc"/>
+    <sidebaritem id="sidebaritem-inria"   name="inria" src="http://www.inria.fr" title="Inria.fr"/>
+  </sidebaritems>
+
+  <hbox flex="1">
+    <sidebar id="sidebar1" sidebaritems="" persist="sidebaritems"/>
+    <splitter id="splitter1" collapse="before" resizebefore="closest"
+              oncommand="document.persist('splitter1', 'state');">
+#ifndef XP_MACOSX
+      <grippy/>
+#endif
+    </splitter>
+    <vbox flex="1">
+       <hbox flex="1">
+               <vbox id="helperButtons">
+                       <spacer flex="1"/>
+                       <image id="infoButton" observes="cmd_renderedHTMLEnabler"
+                                                onclick="ToggleSplitter(this, 'splitterSourceView');"/>
+               </vbox>
+               <vbox flex="1">
+          <tabeditor flex="1" id="tabeditor" visibility="hidden"/>
+          <splitter id="splitterSourceView" collapse="after"
+                    state="collapsed"
+                    observes="cmd_renderedHTMLEnabler">
+#ifndef XP_MACOSX
+            <grippy observes="cmd_renderedHTMLEnabler"/>
+#endif
+          </splitter>
+          <deck id="sourceTreeDeck" flex="1"/>
+        </vbox>
+      </hbox>
+      <hbox id="propertiesBar"/>
+      <structurebar id="structurebar" orient="horizontal">
+        <spacer id="structbarflexer" flex="1"/>
+      </structurebar>
+    </vbox>
+    <splitter id="splitter2" collapse="after" resizeafter="closest"
+              oncommand="document.persist('splitter2', 'state');">
+#ifndef XP_MACOSX
+      <grippy/>
+#endif
+    </splitter>
+    <sidebar id="sidebar2" sidebaritems="" persist="sidebaritems"/>
+  </hbox>
+
+#ifdef TOOLBAR_CUSTOMIZATION_SHEET
+  <panel id="customizeToolbarSheetPopup" noautohide="true">
+    <iframe id="customizeToolbarSheetIFrame"
+            style="width: 635px; height: 400px;"
+            hidden="true"/>
+  </panel>
+#endif
+
+  <statusbar id="statusbar">
+    <deck flex="1" id="statusbarDeck">
+      <hbox id="editorBar" align="center">
+        <label id="editorBarLabel" value="BlueGriffon"/>
+        <spacer flex="1"/>
+        <statusbarpanel id="zoomPanel">
+          <spinbuttons onup="BGZoomManager.enlarge(this.nextSibling)"
+                       ondown="BGZoomManager.reduce(this.nextSibling)"/>
+          <menulist id="menulist-zoompanel"
+                    observes="cmd_renderedHTMLEnabler"
+                    editable="true"
+                    tooltiptext="&setZoomFactor.label;"
+                    value="100%"
+                    sizetopopup="none"
+                    onkeyup="BGZoomManager.onKeyUp(event, this)"
+                    oncommand="BGZoomManager.applyZoomValue(this)">
+            <menupopup id="menupopup-zoompanel"
+                       onpopupshowing="BGZoomManager.fillZoomValues(this)">
+              <menuitem label="dummy"/>
+            </menupopup>
+          </menulist>
+
+        </statusbarpanel>
+      </hbox>
+      <hbox id="progressBar" align="center">
+        <statusbarpanel id="status" label="" crop="end" flex="1"/>
+        <spacer flex="1"/>
+        <progressmeter id="progress" mode="determined" value="0%" style="display: none"/>
+        <statusbarpanel id="security" label="" style="display: none"/>
+      </hbox>
+    </deck>
+  </statusbar>
+</window>
diff --git a/base/content/bluegriffon/xul/colourPicker.xul b/base/content/bluegriffon/xul/colourPicker.xul
new file mode 100644 (file)
index 0000000..3a11b71
--- /dev/null
@@ -0,0 +1,186 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is Mozilla.org
+   -
+   - The Initial Developer of the Original Code is
+   - Linspire Inc..
+   - Portions created by the Initial Developer are Copyright (C) 2003
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (glazman@disruptive-innovations.com), on behalf of Linspire Inc.
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://bluegriffon/skin/colourPicker.css" type="text/css"?>
+
+<!DOCTYPE dialog SYSTEM "chrome://bluegriffon/locale/colourPicker.dtd" >
+<dialog
+    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+    xmlns:html="http://www.w3.org/1999/xhtml"
+    onload="StartUp();"
+    ondialogaccept="return onAccept();"
+    ondialogcancel="return onCancelColor();"
+    persist="screenX screenY"
+    screenX="24" screenY="24"> 
+
+  <script type="application/javascript" src="chrome://bluegriffon/content/utils/dgid.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/js/colourPicker.js"/>
+
+  <broadcaster id="args" value=""/>
+  <spacer id="location" offsetY="50" persist="offsetX offsetY"/>
+
+  <hbox id="TableOrCellGroup" align="center" collapsed="true">
+    <label control="CellOrTableGroup" value="&background.label;" accesskey="&background.accessKey;"/>
+    <radiogroup id="CellOrTableGroup" orient="horizontal">
+      <radio id="TableRadio" label="&table.label;" accesskey="&table.accessKey;"/>
+      <radio id="CellRadio"  label="&cell.label;"  accesskey="&cell.accessKey;"/>
+    </radiogroup>
+  </hbox>
+
+  <hbox>
+    <vbox>
+      <html:div style="position: relative;">
+        <html:img id="hueAndSaturationImg" src="chrome://bluegriffon/content/hsPanel.png"
+                  style="width: 200px; height: 200px; max-width: 200px; max-height: 200px; border: inset thin; margin: 8px" />
+        <html:img id="hueAndSaturationCrosshair"
+                  src="chrome://bluegriffon/content/colourPickerCrosshair.gif" style="position: absolute; top: 35px; left: 65px" />
+      </html:div>
+      <spacer class="spacer" />
+      <html:div style="position: relative; height: 34px;">
+        <html:img id="brightnessImg"
+                  src="chrome://bluegriffon/content/brightness.png" style="width: 200px; height: 25px; border: inset thin; margin-left: 8px; margin-right: 8px" />
+        <html:img id="brightnessArrow"
+                  src="chrome://bluegriffon/content/colourPickerArrow.gif" style="position: absolute; bottom: 0px; left: 35px" />
+      </html:div>
+      <grid>
+        <columns><column/><column/><column/><column/><column/><column/><column/></columns>
+        <rows>
+          <row align="center">
+            <label value="&hue.label;"
+                   id="hueLabel"
+                   control="hue"/>
+            <textbox size="3"
+                     id="hue"
+                     oninput="onTextboxValueChanged(this, 'hue')"/>
+            <spinbuttons onup="IncreaseTextboxValue('hue', 359)"
+                         ondown="DecreaseTextboxValue('hue', 0)"/>
+            <spacer class="spacer"/>
+            <label value="&red.label;"
+                   control="red"
+                   id="redLabel" />
+            <textbox size="3"
+                     id="red" 
+                     oninput="onTextboxValueChanged(this, 'red')"/>
+            <spinbuttons onup="IncreaseTextboxValue('red', 255)"
+                         ondown="DecreaseTextboxValue('red', 0)"/>
+          </row>
+          <row align="center">
+            <label value="&saturation.label;"
+                   control="saturation"
+                   id="saturationLabel" />
+            <textbox size="3"
+                     id="saturation" 
+                     oninput="onTextboxValueChanged(this, 'saturation')"/>
+            <spinbuttons onup="IncreaseTextboxValue('saturation', 100)"
+                         ondown="DecreaseTextboxValue('saturation', 0)"/>
+            <spacer class="spacer"/>
+            <label value="&green.label;"
+                   control="green"
+                   id="greenLabel" />
+            <textbox size="3"
+                     id="green" 
+                     oninput="onTextboxValueChanged(this, 'green')"/>
+            <spinbuttons onup="IncreaseTextboxValue('green', 255)"
+                         ondown="DecreaseTextboxValue('green', 0)"/>
+          </row>
+          <row align="center">
+            <label value="&brightness.label;"
+                   control="brightness"
+                   id="brightnessLabel" />
+            <textbox size="3"
+                     id="brightness" 
+                     oninput="onTextboxValueChanged(this, 'brightness')"/>
+            <spinbuttons onup="IncreaseTextboxValue('brightness', 255)"
+                         ondown="DecreaseTextboxValue('brightness', 0)"/>
+            <spacer class="spacer"/>
+            <label value="&blue.label;"
+                   control="blue"
+                   id="blueLabel" />
+            <textbox size="3"
+                     id="blue" 
+                     oninput="onTextboxValueChanged(this, 'blue')"/>
+            <spinbuttons onup="IncreaseTextboxValue('blue', 255)"
+                         ondown="DecreaseTextboxValue('blue', 0)"/>
+          </row>
+        </rows>
+      </grid>
+        
+    </vbox>
+
+    <vbox>
+      <label value="&predef.label;" />
+      <colorpicker id="colorpicker"
+                   onselect="SelectColor();"/>
+      <spacer flex="1"/>
+      <button id="LastPickedButton" crop="right" oncommand="SelectLastPickedColor();">
+        <spacer id="LastPickedColor"
+                    LastTextColor="" LastBackgroundColor=""
+                    persist="LastTextColor LastBackgroundColor"/>
+        <label value="&lastPickedColor.label;" accesskey="&lastPickedColor.accessKey;" flex="1" style="text-align: center;"/>
+      </button>
+      <hbox>
+             <grid>
+               <columns><column/><column/></columns>
+               <rows>
+                 <row align="center">
+                   <label value="&hexColor.label;"
+                          control="hexColour"
+                          id="hexColourLabel" />
+                   <textbox size="7" id="hexColour"/>
+                 </row>
+                 <row align="center">
+                   <label value="&nameColor.label;"
+                          control="nameColour" 
+                          id="nameColourLabel" />
+                   <textbox size="7"
+                            id="nameColour"
+                            oninput="onNamedColourChanged(this)"/>
+                 </row>
+               </rows>
+             </grid>
+        <html:p flex="1" id="swatch">   </html:p>
+      </hbox>
+      <checkbox label="&transparency.label;"
+                id="transparencyCheckbox"
+                oncommand="ToggleTransparency(this)"/>
+    </vbox>
+  </hbox>
+
+</dialog>
diff --git a/base/content/bluegriffon/xul/customizeToolbarSheet.xul b/base/content/bluegriffon/xul/customizeToolbarSheet.xul
new file mode 100644 (file)
index 0000000..19ffac4
--- /dev/null
@@ -0,0 +1,121 @@
+<?xml version="1.0"?> 
+
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla Communicator client code, released
+# March 31, 1998.
+#
+# The Initial Developer of the Original Code is
+# Netscape Communications Corporation.
+# Portions created by the Initial Developer are Copyright (C) 1998-1999
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   David Hyatt (hyatt@apple.com)
+#   Blake Ross (blaker@netscape.com)
+#   Asaf Romano <mozilla.mano@sent.com>
+#   Daniel Glazman <daniel.glazman@disruptive-innovations.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+<!DOCTYPE dialog [
+<!ENTITY % customizeToolbarDTD SYSTEM "chrome://global/locale/customizeToolbar.dtd">
+  %customizeToolbarDTD;
+]>
+
+<?xml-stylesheet href="chrome://bluegriffon/skin/mainToolbar.css" type="text/css"?>
+<?xml-stylesheet href="chrome://global/content/customizeToolbar.css" type="text/css"?>
+<?xml-stylesheet href="chrome://global/skin/customizeToolbar.css" type="text/css"?>
+
+<window id="CustomizeToolbarSheet"
+        title="&dialog.title;"
+        style="&dialog.style;"
+        onload="gCustomizeToolbarSheet.init();"
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+  <script type="application/x-javascript"
+          src="chrome://global/content/customizeToolbar.js"/>
+  <script type="application/x-javascript"
+          src="chrome://global/content/nsDragAndDrop.js"/>
+  <script type="application/x-javascript"
+          src="chrome://bluegriffon/content/js/customizeToolbarSheet.js"/>
+
+  <stringbundle id="stringBundle"
+                src="chrome://global/locale/customizeToolbar.properties"/>
+
+  <keyset id="CustomizeToolbarSheetKeyset">
+    <key id="cmd_close_sheet"
+         keycode="VK_ESCAPE"
+         oncommand="finishToolbarCustomization();"/>
+    <key id="cmd_close_sheet" keycode="VK_RETURN"
+         oncommand="finishToolbarCustomization();"/>
+    <key id="cmd_close_sheet" keycode="VK_ENTER"
+         oncommand="finishToolbarCustomization();"/>
+  </keyset>
+
+  <vbox id="main-box" flex="1">
+    <label id="instructions" value="&instructions.description;"/>
+
+    <vbox flex="1" id="palette-box"
+          ondraggesture="nsDragAndDrop.startDrag(event, dragStartObserver);"
+          ondragover="nsDragAndDrop.dragOver(event, paletteDNDObserver);"
+          ondragdrop="nsDragAndDrop.drop(event, paletteDNDObserver);"/>
+
+    <box align="center">
+      <label value="&show.label;"/>
+      <menulist id="modelist"
+                value="icons"
+                oncommand="updateToolbarMode(this.value);">
+        <menupopup>
+          <menuitem value="full" label="&iconsAndText.label;"/>
+          <menuitem value="icons" label="&icons.label;"/>
+          <menuitem value="text" label="&text.label;"/>
+        </menupopup>
+      </menulist>
+
+      <checkbox id="smallicons"
+                oncommand="updateIconSize(this.checked);"
+                label="&useSmallIcons.label;"/>
+    
+      <button label="&addNewToolbar.label;"
+              oncommand="addNewToolbar();"
+              icon="add"/>
+      <button label="&restoreDefaultSet.label;"
+              oncommand="restoreDefaultSet();"
+              icon="refresh"/>
+    </box>
+
+    <separator class="groove"/>
+
+    <hbox align="center" pack="end">
+      <button label="&saveChanges.label;"
+              id="donebutton"
+              oncommand="finishToolbarCustomization();"
+              default="true"
+              icon="close"/>
+    </hbox>
+  </vbox>
+</window>
diff --git a/base/content/bluegriffon/xul/formatbarpalette.inc b/base/content/bluegriffon/xul/formatbarpalette.inc
new file mode 100644 (file)
index 0000000..8b341ae
--- /dev/null
@@ -0,0 +1,141 @@
+  <toolbarpalette id="FormatToolbarPalette">
+
+      <toolbarbutton id="boldButton" type="checkbox" autoCheck="false" observes="cmd_bold" label="&boldToolbarCmd.label;"
+                     tooltiptext="&boldToolbarCmd.tooltip;">
+        <observes element="cmd_bold" type="checkbox" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_bold')"/>
+      </toolbarbutton>
+
+      <toolbarbutton id="italicButton" type="checkbox" autoCheck="false" observes="cmd_italic" label="&italicToolbarCmd.label;"
+                     tooltiptext="&italicToolbarCmd.tooltip;">
+        <observes element="cmd_italic" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_italic')"/>
+      </toolbarbutton>
+
+      <toolbarbutton id="underlineButton" type="checkbox" autoCheck="false" observes="cmd_underline" label="&underlineToolbarCmd.label;"
+                     tooltiptext="&underlineToolbarCmd.tooltip;">
+        <observes element="cmd_underline" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_underline')"/>
+      </toolbarbutton>
+    
+      <toolbarbutton id="strongButton" type="checkbox" autoCheck="false" observes="cmd_strong" label="&strongToolbarCmd.label;"
+                     tooltiptext="&strongToolbarCmd.tooltip;">
+        <observes element="cmd_strong" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_strong')"/>
+      </toolbarbutton>
+    
+      <toolbarbutton id="emButton" type="checkbox" autoCheck="false" observes="cmd_em" label="&emToolbarCmd.label;"
+                     tooltiptext="&emToolbarCmd.tooltip;">
+        <observes element="cmd_em" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_em')"/>
+      </toolbarbutton>
+
+      <toolbarbutton id="codeButton" type="checkbox" autoCheck="false" observes="cmd_code" label="&codeToolbarCmd.label;"
+                     tooltiptext="&codeToolbarCmd.tooltip;">
+        <observes element="cmd_code" type="checkbox" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_code')"/>
+      </toolbarbutton>
+
+      <toolbaritem id="ParagraphSelectBox">
+        <menulist class="toolbar-focustarget" id="ParagraphSelect" observes="cmd_renderedHTMLEnabler"
+                  tooltiptext="&ParagraphSelect.tooltip;" crop="right">
+          <observes element="cmd_paragraphState" attribute="state" onbroadcast="onParagraphFormatChange(this.parentNode, 'cmd_paragraphState')"/>
+          <menupopup id="ParagraphPopup" oncommand="ComposerCommands.doStatefulCommand('cmd_paragraphState', event.target.value)">
+            <!-- TODO : add an onpopupshowing handler to hide the body text
+                        choice in strict mode -->
+            <menuitem label="&bodyTextCmd.label;"            value=""/>
+            <menuitem label="&paragraphParagraphCmd.label;"  value="p"/>
+            <menuitem label="&heading1Cmd.label;"            value="h1"/>
+            <menuitem label="&heading2Cmd.label;"            value="h2"/>
+            <menuitem label="&heading3Cmd.label;"            value="h3"/>
+            <menuitem label="&heading4Cmd.label;"            value="h4"/>
+            <menuitem label="&heading5Cmd.label;"            value="h5"/>
+            <menuitem label="&heading6Cmd.label;"            value="h6"/>
+            <menuitem label="&paragraphAddressCmd.label;"    value="address"/>
+            <menuitem label="&paragraphPreformatCmd.label;"  value="pre"/>
+            <menuseparator />
+            <menuitem label="&genericContainerCmd.label;"    value="div"/>
+          </menupopup>
+        </menulist>
+      </toolbaritem>
+
+    <toolbarbutton id="ulButton" type="radio" group="lists" autoCheck="false" observes="cmd_ul"
+                   tooltiptext="&unorderedList.tooltip;" label="&unorderedList.label;">
+        <observes element="cmd_ul" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_ul')"/>
+    </toolbarbutton>
+
+    <toolbarbutton id="olButton" type="radio" group="lists" autoCheck="false" observes="cmd_ol"
+                   tooltiptext="&orderedList.tooltip;" label="&orderedList.label;">
+        <observes element="cmd_ol" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_ol')"/>
+    </toolbarbutton>
+
+    <toolbarbutton id="align-left-button" type="radio" group="align" autoCheck="false"
+                   observes="cmd_renderedHTMLEnabler"
+                   oncommand="ComposerCommands.doStatefulCommand('cmd_align', 'left')"
+                   tooltiptext="&alignLeft.tooltip;" label="&alignLeft.label;" >
+      <observes element="cmd_align" attribute="state" 
+                onbroadcast="ComposerCommands.onStateButtonUpdate(this.parentNode, 'cmd_align', 'left')" />
+    </toolbarbutton>
+
+    <toolbarbutton id="align-center-button" type="radio" group="align" autoCheck="false"
+                   observes="cmd_renderedHTMLEnabler"
+                   oncommand="ComposerCommands.doStatefulCommand('cmd_align', 'center')"
+                   tooltiptext="&alignCenter.tooltip;" label="&alignCenter.label;" >
+      <observes element="cmd_align" attribute="state" 
+                onbroadcast="ComposerCommands.onStateButtonUpdate(this.parentNode, 'cmd_align', 'center')"/>
+    </toolbarbutton>
+
+    <toolbarbutton id="align-right-button" type="radio" group="align" autoCheck="false"
+                   observes="cmd_renderedHTMLEnabler"
+                   oncommand="ComposerCommands.doStatefulCommand('cmd_align', 'right')"
+                   tooltiptext="&alignRight.tooltip;" label="&alignRight.label;" >
+      <observes element="cmd_align" attribute="state"
+                onbroadcast="ComposerCommands.onStateButtonUpdate(this.parentNode, 'cmd_align', 'right')"/>
+    </toolbarbutton>
+
+    <toolbarbutton id="align-justify-button" type="radio" group="align" autoCheck="false"
+                   observes="cmd_renderedHTMLEnabler"
+                   oncommand="ComposerCommands.doStatefulCommand('cmd_align', 'justify')"
+                   tooltiptext="&alignJustify.tooltip;" label="&alignJustify.label;" >
+      <observes element="cmd_align" attribute="state"
+                onbroadcast="ComposerCommands.onStateButtonUpdate(this.parentNode, 'cmd_align', 'justify')"/>
+    </toolbarbutton>
+
+    <toolbarbutton id="indentButton" observes="cmd_indent" label="&indentToolbarCmd.label;"
+                   tooltiptext="&indentToolbarCmd.tooltip;"/>
+
+    <toolbarbutton id="outdentButton" observes="cmd_outdent" label="&outdentToolbarCmd.label;"
+                   tooltiptext="&outdentToolbarCmd.tooltip;"/>
+
+    <toolbarbutton id="ddButton" type="radio" group="lists" autoCheck="false" observes="cmd_dd"
+                   tooltiptext="&definitionDescription.tooltip;" label="&definitionDescription.label;">
+        <observes element="cmd_dd" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_dd')"/>
+    </toolbarbutton>
+
+    <toolbarbutton id="dtButton" type="radio" group="lists" autoCheck="false" observes="cmd_dt"
+                   tooltiptext="&definitionTitle.tooltip;" label="&definitionTitle.label;">
+        <observes element="cmd_dt" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_dt')"/>
+    </toolbarbutton>
+
+    <toolbaritem id="FontFaceSelectBox">
+      <menulist class="toolbar-focustarget" observes="cmd_renderedHTMLEnabler"
+                id="FontFaceSelect" tooltiptext="&FontFaceSelect.tooltip;" crop="right">
+        <observes element="cmd_fontFace" attribute="state" onbroadcast="onFontFaceChange(this.parentNode, 'cmd_fontFace')"/>
+        <menupopup id="FontFacePopup" oncommand="ComposerCommands.doStatefulCommand('cmd_fontFace', event.target.value)" onpopupshowing="initFontFaceMenu(this);">
+          <menuitem label="&fontVarWidth.label;"      value=""/>
+          <menuitem label="&fontFixedWidth.label;"    value="tt"/>
+          <menuseparator/>
+          <menuitem label="&fontHelveticaFont.label;" value="Helvetica, Arial, sans-serif"/>
+          <menuitem label="&fontTimes.label;"         value="Times New Roman, Times, serif"/>
+          <menuitem label="&fontCourier.label;"       value="Courier New, Courier, monospace"/>
+          <menuseparator/>
+        </menupopup>
+      </menulist>
+    </toolbaritem>
+
+    <toolbaritem id="ClassButtonsBox">
+      <menulist class="toolbar-focustarget" id="ClassSelect"
+                observes="cmd_renderedHTMLEnabler"
+                tooltiptext="&applyClassToSelectionCmd.tooltip;">
+        <observes element="cmd_class" attribute="state" onbroadcast="onClassChange(this.parentNode, 'cmd_class')"/>
+        <menupopup id="ClassPopup" oncommand="ComposerCommands.doStatefulCommand('cmd_class', event.target.value)" onpopupshowing="initClassMenu(this, true);">
+          <menuitem label="&noClass.label;" id="NoClassMenuItem"/>
+        </menupopup>
+      </menulist>
+    </toolbaritem>
+
+  </toolbarpalette>
diff --git a/base/content/bluegriffon/xul/maintoolbarpalette.inc b/base/content/bluegriffon/xul/maintoolbarpalette.inc
new file mode 100644 (file)
index 0000000..90d91e9
--- /dev/null
@@ -0,0 +1,42 @@
+  <toolbarpalette id="ComposerToolbarPalette">
+
+      <toolbarbutton id="newButton"
+                     label="&newMenu.label;" type="menu-button"
+                     oncommand="NewDocument(event);"
+                     tooltiptext="&newToolbarCmd.tooltip;">
+        <menupopup>
+          <menuitem label="&newTab.label;"          oncommand="NewDocument(event);" default="true"/>
+          <menuitem label="&newWindow.label;"       oncommand="NewDocumentInNewWindow(event);"/>
+          <menuseparator/>
+          <menuitem label="&newOtherCmd.label;"     oncommand=""/>
+        </menupopup>
+      </toolbarbutton>
+
+      <toolbarbutton id="openButton"
+                     label="&openMenu.label;" type="menu-button"
+                     oncommand="OpenLocation(event, 'tab');"
+                     tooltiptext="&openMenu.tooltip;">
+        <menupopup>
+          <menuitem label="&openTab.label;"          oncommand="OpenLocation(event, 'tab');" default="true"/>
+          <menuitem label="&openWindow.label;"       oncommand="OpenLocation(event, 'window');"/>
+        </menupopup>
+      </toolbarbutton>
+
+      <toolbarbutton id="saveButton" class="toolbarbutton-1" observes="cmd_save"
+                     tooltiptext="&saveToolbarCmd.tooltip;"/>
+
+      <toolbarbutton id="stopButton"
+                     label="&stopButton.label;"
+                     class="toolbarbutton-1"
+                     tooltiptext="&stopButton.tooltip;"
+                     command="cmd_stopLoading"/>
+
+      <toolbarbutton id="tableButton" class="toolbarbutton-1"
+                     label="&tableToolbarCmd.label;" observes="cmd_table"
+                     tooltiptext="&tableToolbarCmd.tooltip;"/>
+
+      <toolbaritem id="throbber-box"  align="center" pack="center">
+        <image id="composer-throbber" tooltiptext="&throbber.tooltip;" onclick="AboutComposer()"/>
+      </toolbaritem> 
+
+    </toolbarpalette>
diff --git a/base/content/bluegriffon/xul/menubar.inc b/base/content/bluegriffon/xul/menubar.inc
new file mode 100644 (file)
index 0000000..d208edb
--- /dev/null
@@ -0,0 +1,75 @@
+  <menubar id="composer-main-menubar" class="chromeclass-menubar">
+
+    <menu id="fileMenu" label="&fileMenu.label;" accesskey="&fileMenu.accesskey;">
+      <menupopup id="fileMenu_popup">
+        <menuitem label="&newMenu.label;" accesskey="&newMenu.accesskey;" key="key_newNavigator"
+                  command="cmd_new"/>
+        <menuitem label="&newWizardMenu.label;"
+                  command="cmd_newWizard"/>
+        <menu id="menu_RecentFiles" accesskey="&filerecentmenu.accesskey;" label="&fileRecentMenu.label;"
+              onpopupshowing="RecentPagesHandler.buildRecentPagesMenu();">
+          <menupopup id="menupopup_RecentFiles"
+                      oncommand="OpenFile(event.target.getAttribute('value'), true);"/>
+            <!-- menuitems appended at runtime -->
+        </menu>
+
+        <menuseparator/>
+        <menuitem id="saveMenuitem" accesskey="&filesave.accesskey;" key="savekb" observes="cmd_save"/>
+        <menuitem accesskey="&filesaveas.accesskey;" observes="cmd_saveAs"/>
+
+#ifndef XP_MACOSX
+        <menuseparator/>
+        <menuitem label="&quit.label;" accesskey="&quit.accesskey;" oncommand="goQuitApplication()"/>
+#endif
+      </menupopup>
+    </menu>
+
+    <menu id="editMenu"   label="&editMenu.label;"   accesskey="&editMenu.accesskey;">
+      <menupopup id="editMenuPopup"/>
+    </menu>
+
+    <menu id="viewMenu"   label="&viewMenu.label;"   accesskey="&viewMenu.accesskey;">
+      <menupopup id="viewMenuPopup">
+        <menu label="&viewToolbars.label;">
+          <menupopup id="viewToolbarsPopup"
+                     onpopupshowing="BGToolbarManager.listToolbars(this)"/>
+        </menu>
+        <menuitem label="&viewStatusbar.label;"
+                  oncommand="BGToolbarManager.goToggleToolbar('statusbar')" />
+        <menuseparator/>
+        <menuitem label="&fullScreen.label;" accesskey="&fullScreen.accesskey;"
+                  key="key_fullScreen" command="cmd_fullScreen"/>
+      </menupopup>
+    </menu>
+
+    <menu id="insertMenu" label="&insertMenu.label;" accesskey="&insertMenu.accesskey;">
+      <menupopup id="insertMenuPopup"/>
+    </menu>
+
+    <menu id="formatMenu" label="&formatMenu.label;" accesskey="&formatMenu.accesskey;">
+      <menupopup id="formatMenuPopup"/>
+    </menu>
+
+    <menu id="tableMenu" label="&tableMenu.label;" accesskey="&tableMenu.accesskey;">
+      <menupopup id="tableMenuPopup"/>
+    </menu>
+
+    <menu id="toolsMenu" label="&toolsMenu.label;" accesskey="&toolsMenu.accesskey;">
+      <menupopup id="toolsPopup">
+        <menuitem id="menu_cleanup" observes="cmd_cleanup"/>
+        <menuseparator/>
+        <menuitem label="Extensions"  oncommand="OpenExtensionsManager()"/>
+        <menuseparator/>
+        <menuitem label="&consoleMenu.label;"  oncommand="OpenConsole()"/>
+        <menuitem id="menu_inspector" label="DOMI" command="Tasks:Inspector"/>
+        <menuitem label="Venkman" oncommand="start_venkman()"/>
+      </menupopup>
+    </menu>
+
+    <menu id="helpMenu" label="&helpMenu.label;" accesskey="&helpMenu.accesskey;">
+      <menupopup id="helpMenuPopup">
+        <menuitem label="&aboutComposer.label;" oncommand="AboutComposer()"/>
+      </menupopup>
+    </menu>
+
+  </menubar>
diff --git a/base/content/bluegriffon/xul/overlays.inc b/base/content/bluegriffon/xul/overlays.inc
new file mode 100644 (file)
index 0000000..f9e4680
--- /dev/null
@@ -0,0 +1 @@
+<?xul-overlay href="chrome://bluegriffon/content/xul/propertiesDeck.xul"?>
diff --git a/base/content/bluegriffon/xul/propertiesDeck.xul b/base/content/bluegriffon/xul/propertiesDeck.xul
new file mode 100644 (file)
index 0000000..0a2533a
--- /dev/null
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+
+<!DOCTYPE overlay SYSTEM "chrome://bluegriffon/locale/propertiesDeck.dtd">
+
+<overlay
+  id     = "propertiesOverlay"
+  xmlns  = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+  <hbox id="propertiesBar">
+
+
+  </hbox>
+  
+</overlay>
diff --git a/base/content/bluegriffon/xul/scripts.inc b/base/content/bluegriffon/xul/scripts.inc
new file mode 100644 (file)
index 0000000..86fee4a
--- /dev/null
@@ -0,0 +1,31 @@
+  <script type="application/javascript" src="chrome://bluegriffon/content/utils/dgid.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/utils/global.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/utils/urls.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/utils/notifiers.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/utils/l10n.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/utils/prompter.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/utils/editorUtils.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/utils/css.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/utils/fileUtils.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/js/bluegriffon.js"/>
+  <script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
+  <script type="application/javascript" src="chrome://global/content/nsDragAndDrop.js"/>
+  <script type="application/javascript" src="chrome://global/content/nsTransferable.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/js/customize.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/js/commands.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/js/colourPickerHelper.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/js/activeSourceView.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/js/zoomManager.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/js/recentPages.js"/>
+  <script type="application/javascript" src="chrome://bluegriffon/content/js/toolbars.js"/>
+
+  <script type="application/javascript" src="chrome://diavolo/content/tokeniser.js"/>
+  <script type="application/javascript" src="chrome://diavolo/content/highlighter.js"/>
+  <script type="application/javascript" src="chrome://diavolo/content/editor.js"/>
+  <script type="application/javascript" src="chrome://diavolo/content/grammar.js"/>
+  <script type="application/javascript" src="chrome://diavolo/content/selector.js"/>
+  <script type="application/javascript" src="chrome://diavolo/content/codecompletion.js"/>
+  
+  <script type="application/x-javascript" src="chrome://inspector/content/hooks.js"/>
+  
+       <script src="chrome://venkman/content/venkman-overlay.js"/>
diff --git a/base/content/bluegriffon/xul/sets.inc b/base/content/bluegriffon/xul/sets.inc
new file mode 100644 (file)
index 0000000..a7af262
--- /dev/null
@@ -0,0 +1,108 @@
+<broadcasterset id="broadcasterset">
+  <command id="cmd_fullScreen"   oncommand="goDoCommand('cmd_fullScreen')"/>
+</broadcasterset>
+
+<keyset id="mainKeySet">
+  <key id="key_fullScreen" keycode="VK_F11"             command="cmd_fullScreen"/>
+  <key id="savekb"         key="&filesave.keybinding;"  observes="cmd_save" modifiers="accel"/>
+</keyset>
+
+<commandset id="webNavigationItems"
+            commandupdater="true"
+            events="navigation"
+            oncommandupdate="ComposerCommands.goUpdateComposerMenuItems(this)">
+  <command id="cmd_stopLoading" disabled="true" oncommand="goDoCommand('cmd_stopLoading')"/>
+  <command id="cmd_new"                         oncommand="goDoCommand('cmd_new')"/>
+  <command id="cmd_newWizard"                   oncommand="goDoCommand('cmd_newWizard')"/>
+
+  <command id="Tasks:Inspector"   oncommand="inspectDOMDocument();"/>
+  <command id="Tasks:InspectPage" oncommand="inspectDOMDocument(_content.document);"/>
+</commandset>
+
+<commandset id="commonEditorMenuItems"
+            commandupdater="true"
+            events="create"
+            oncommandupdate="ComposerCommands.goUpdateComposerMenuItems(this)">
+  <command id="cmd_open"         oncommand="goDoCommand('cmd_open')"/>
+</commandset>
+
+<commandset id="composerMenuItems"
+            commandupdater="true"
+            events="create,style,mode_switch"
+            oncommandupdate="ComposerCommands.goUpdateComposerMenuItems(this)">
+  <command id="cmd_table"            oncommand="goDoCommand('cmd_table')"/>
+</commandset>
+
+<commandset id="composerStyleMenuItems"
+            commandupdater="true"
+            events="create,style,mode_switch"
+            oncommandupdate="ComposerCommands.goUpdateComposerMenuItems(this)">
+  <command id="cmd_bold"         state="false"     oncommand="ComposerCommands.doStyleUICommand('cmd_bold')"/>
+  <command id="cmd_italic"       state="false"     oncommand="ComposerCommands.doStyleUICommand('cmd_italic')"/>
+  <command id="cmd_underline"    state="false"     oncommand="ComposerCommands.doStyleUICommand('cmd_underline')"/>
+  <command id="cmd_strong"       state="false"     oncommand="ComposerCommands.doStyleUICommand('cmd_strong')"/>
+  <command id="cmd_em"           state="false"     oncommand="ComposerCommands.doStyleUICommand('cmd_em')"/>
+  <command id="cmd_code"         state="false"     oncommand="ComposerCommands.doStyleUICommand('cmd_code')"/>
+
+  <command id="cmd_paragraphState" state=""        oncommand="ComposerCommands.doStatefulCommand('cmd_paragraphState', event.target.value)"/>
+  <command id="cmd_fontFace"     state=""          oncommand="ComposerCommands.doStatefulCommand('cmd_fontFace', event.target.value)"/>
+  <command id="cmd_class"        state=""          oncommand="ComposerCommands.doStatefulCommand('cmd_class', event.target.value)"/>
+  <command id="cmd_renderedHTMLEnabler"/>
+  <command id="cmd_ul"           state="false"     oncommand="ComposerCommands.doStyleUICommand('cmd_ul')"/>
+  <command id="cmd_ol"           state="false"     oncommand="ComposerCommands.doStyleUICommand('cmd_ol')"/>
+  <command id="cmd_align"        state="left"      oncommand="ComposerCommands.doStatefulCommand('cmd_align', event.target.value)"/>
+
+  <command id="cmd_dd"           state="false"     oncommand="ComposerCommands.doStyleUICommand('cmd_dd')"/>
+  <command id="cmd_dt"           state="false"     oncommand="ComposerCommands.doStyleUICommand('cmd_dt')"/>
+
+  <command id="cmd_indent"                         oncommand="goDoCommand('cmd_indent')"/>
+  <command id="cmd_outdent"                        oncommand="goDoCommand('cmd_outdent')"/>
+
+</commandset>
+
+<commandset id="selectionBasedCommands"
+            commandupdater="true"
+            events="style,create"
+            oncommandupdate="ComposerCommands.updateSelectionBased(this, event)">
+  <command id="cmd_selectionChanged"/>
+</commandset>
+
+<commandset id="composerSaveMenuItems"
+            commandupdater="true"
+            events="create,style,save"
+            oncommandupdate="ComposerCommands.goUpdateComposerMenuItems(this)">
+  <command id="cmd_save"           label="&saveCmd.label;"           oncommand="goDoCommand('cmd_save')"/>
+  <command id="cmd_saveAs"         label="&saveAsCmd.label;"         oncommand="goDoCommand('cmd_saveAs')"/>
+</commandset>
+
+<commandset id="composerEditMenuItems"
+            commandupdater="true"
+            events="create, mode_switch"
+            oncommandupdate="ComposerCommands.goUpdateComposerMenuItems(this)">
+  <command id="cmd_cleanup"         oncommand="goDoCommand('cmd_cleanup')"      label="&markupCleanerCmd.label;" accesskey="&markupcleaner.accesskey;"/>
+</commandset>
+
+<keyset id="editorKeys">
+  <key id="key_newNavigator" key="n" modifiers="control" />
+</keyset>
+
+<popupset id="editorPopupSet">
+  <popup id="main-toolbar-context-menu">
+    <menuitem oncommand="CustomizeToolbar('MainToolbox');" id="CustomizeMainToolbar" label="&customizeToolbar.label;" accesskey="&customizeToolbar.accesskey;"/>
+  </popup>
+  <popup id="format-toolbar-context-menu">
+    <menuitem oncommand="CustomizeToolbar('FormatToolbox');" id="CustomizeFormatToolbar" label="&customizeToolbar.label;" accesskey="&customizeToolbar.accesskey;"/>
+  </popup>
+  <popup id="structureBarContextMenu">
+    <menuitem label="&elementLanguage.label;"
+              accesskey="&elementLanguage.accesskey;"
+              oncommand="ShowLanguageDialog(event)" />
+  </popup>
+</popupset>
+
+<stringbundleset id="languageSet">
+  <stringbundle id="bundleRegions"      src="chrome://global/locale/regionNames.properties"/>
+  <stringbundle id="bundleLanguages"    src="chrome://global/locale/languageNames.properties"/>
+  <stringbundle id="bundlePreferences"  src="chrome://bluegriffon/locale/language.properties"/>
+  <stringbundle id="bundleAccepted"     src="resource://gre/res/language.properties"/>
+</stringbundleset>
diff --git a/base/jar.mn b/base/jar.mn
new file mode 100644 (file)
index 0000000..80fa5c4
--- /dev/null
@@ -0,0 +1,114 @@
+bluegriffon.jar:\r
+% content   bluegriffon          %content/bluegriffon/\r
+% style  chrome://global/content/customizeToolbar.xul    chrome://global/skin/\r
+% style  chrome://global/content/customizeToolbar.xul    chrome://bluegriffon/skin/bluegriffon.css\r
+% style  chrome://global/content/customizeToolbar.xul    chrome://bluegriffon/skin/editorFormat.css\r
+% content venkman jar:venkman.jar!/content/venkman/ contentaccessible=yes\r
+% locale venkman en-US jar:venkman.jar!/locale/en-US/venkman/\r
+  content/bluegriffon/about-logo.png  (content/bluegriffon/about-logo.png)
+  content/bluegriffon/aboutDialog.css  (content/bluegriffon/aboutDialog.css)
+  content/bluegriffon/bindings/cssToggler.xml  (content/bluegriffon/bindings/cssToggler.xml)
+  content/bluegriffon/bindings/ecolorpicker.xml  (content/bluegriffon/bindings/ecolorpicker.xml)\r
+  content/bluegriffon/bindings/filepickerbutton.css  (content/bluegriffon/bindings/filepickerbutton.css)
+  content/bluegriffon/bindings/filepickerbutton.xml  (content/bluegriffon/bindings/filepickerbutton.xml)
+  content/bluegriffon/bindings/multistate.css  (content/bluegriffon/bindings/multistate.css)
+  content/bluegriffon/bindings/multistate.xml  (content/bluegriffon/bindings/multistate.xml)
+  content/bluegriffon/bindings/rulers.xml  (content/bluegriffon/bindings/rulers.xml)
+  content/bluegriffon/bindings/sidebar.css  (content/bluegriffon/bindings/sidebar.css)
+  content/bluegriffon/bindings/sidebar.xml  (content/bluegriffon/bindings/sidebar.xml)
+  content/bluegriffon/bindings/structurebar.css  (content/bluegriffon/bindings/structurebar.css)
+  content/bluegriffon/bindings/structurebar.xml  (content/bluegriffon/bindings/structurebar.xml)
+  content/bluegriffon/bindings/tabeditor.xml  (content/bluegriffon/bindings/tabeditor.xml)
+  content/bluegriffon/blanks/strict.html  (content/bluegriffon/blanks/strict.html)
+  content/bluegriffon/blanks/strict.xhtml  (content/bluegriffon/blanks/strict.xhtml)
+  content/bluegriffon/blanks/transitional.html  (content/bluegriffon/blanks/transitional.html)
+  content/bluegriffon/blanks/transitional.xhtml  (content/bluegriffon/blanks/transitional.xhtml)
+  content/bluegriffon/brightness.png  (content/bluegriffon/brightness.png)
+  content/bluegriffon/colourPickerArrow.gif  (content/bluegriffon/colourPickerArrow.gif)
+  content/bluegriffon/colourPickerCrosshair.gif  (content/bluegriffon/colourPickerCrosshair.gif)
+  content/bluegriffon/credits.xhtml  (content/bluegriffon/credits.xhtml)
+  content/bluegriffon/DI.png  (content/bluegriffon/DI.png)
+  content/bluegriffon/dialogs/insertTable.js  (content/bluegriffon/dialogs/insertTable.js)
+  content/bluegriffon/dialogs/insertTable.xul  (content/bluegriffon/dialogs/insertTable.xul)
+  content/bluegriffon/dialogs/languages.js  (content/bluegriffon/dialogs/languages.js)
+  content/bluegriffon/dialogs/languages.xul  (content/bluegriffon/dialogs/languages.xul)
+  content/bluegriffon/dialogs/markupCleaner.js  (content/bluegriffon/dialogs/markupCleaner.js)
+  content/bluegriffon/dialogs/markupCleaner.xul  (content/bluegriffon/dialogs/markupCleaner.xul)
+  content/bluegriffon/dialogs/openLocation.js  (content/bluegriffon/dialogs/openLocation.js)
+  content/bluegriffon/dialogs/openLocation.xul  (content/bluegriffon/dialogs/openLocation.xul)
+  content/bluegriffon/dialogs/newPageWizard.js  (content/bluegriffon/dialogs/newPageWizard.js)
+* content/bluegriffon/dialogs/newPageWizard.xul  (content/bluegriffon/dialogs/newPageWizard.xul)\r
+  content/bluegriffon/dialogs/standaloneSidebar.js  (content/bluegriffon/dialogs/standaloneSidebar.js)
+  content/bluegriffon/dialogs/standaloneSidebar.xul  (content/bluegriffon/dialogs/standaloneSidebar.xul)
+  content/bluegriffon/EditorContent.css  (content/bluegriffon/EditorContent.css)
+  content/bluegriffon/EditorOverride.css  (content/bluegriffon/EditorOverride.css)
+  content/bluegriffon/hsPanel.png  (content/bluegriffon/hsPanel.png)
+* content/bluegriffon/js/aboutDialog.js  (content/bluegriffon/js/aboutDialog.js)
+  content/bluegriffon/js/activeSourceView.js  (content/bluegriffon/js/activeSourceView.js)
+* content/bluegriffon/js/bluegriffon.js  (content/bluegriffon/js/bluegriffon.js)
+  content/bluegriffon/js/col.js  (content/bluegriffon/js/col.js)
+  content/bluegriffon/js/colourPicker.js  (content/bluegriffon/js/colourPicker.js)
+  content/bluegriffon/js/colourPickerHelper.js  (content/bluegriffon/js/colourPickerHelper.js)
+* content/bluegriffon/js/commands.js  (content/bluegriffon/js/commands.js)
+* content/bluegriffon/js/customize.js  (content/bluegriffon/js/customize.js)
+  content/bluegriffon/js/languages.js  (content/bluegriffon/js/languages.js)
+  content/bluegriffon/js/markupCleaner.js  (content/bluegriffon/js/markupCleaner.js)
+  content/bluegriffon/js/propertiesDeck.js  (content/bluegriffon/js/propertiesDeck.js)
+  content/bluegriffon/js/recentPages.js  (content/bluegriffon/js/recentPages.js)
+  content/bluegriffon/js/toolbars.js  (content/bluegriffon/js/toolbars.js)
+  content/bluegriffon/js/zoomManager.js  (content/bluegriffon/js/zoomManager.js)
+#ifdef TOOLBAR_CUSTOMIZATION_SHEET\r
+*  content/bluegriffon/js/customizeToolbarSheet.js          (content/bluegriffon/js/customizeToolbarSheet.js)\r
+#endif\r
+  content/bluegriffon/sourceViewTemplate.html  (content/bluegriffon/sourceViewTemplate.html)
+  content/bluegriffon/utils/colors.js  (content/bluegriffon/utils/colors.js)
+  content/bluegriffon/utils/css.js  (content/bluegriffon/utils/css.js)
+  content/bluegriffon/utils/dgid.js  (content/bluegriffon/utils/dgid.js)
+* content/bluegriffon/utils/editorUtils.js  (content/bluegriffon/utils/editorUtils.js)
+  content/bluegriffon/utils/fileUtils.js  (content/bluegriffon/utils/fileUtils.js)
+* content/bluegriffon/utils/global.js  (content/bluegriffon/utils/global.js)
+  content/bluegriffon/utils/l10n.js  (content/bluegriffon/utils/l10n.js)
+  content/bluegriffon/utils/notifiers.js  (content/bluegriffon/utils/notifiers.js)
+  content/bluegriffon/utils/prompter.js  (content/bluegriffon/utils/prompter.js)
+  content/bluegriffon/utils/urls.js  (content/bluegriffon/utils/urls.js)
+* content/bluegriffon/xul/aboutDialog.xul  (content/bluegriffon/xul/aboutDialog.xul)
+* content/bluegriffon/xul/bluegriffon.xul  (content/bluegriffon/xul/bluegriffon.xul)
+  content/bluegriffon/xul/colourPicker.xul  (content/bluegriffon/xul/colourPicker.xul)
+  content/bluegriffon/xul/propertiesDeck.xul  (content/bluegriffon/xul/propertiesDeck.xul)\r
+  content/bluegriffon/utils/login.js  (content/bluegriffon/utils/login.js)\r
+\r
+bluegriffon-locale.jar:\r
+% locale    bluegriffon    en-US    %locale/en-US/bluegriffon/\r
+% locale  branding  en-US    %locale/en-US/branding/\r
+  locale/en-US/bluegriffon/aboutDialog.dtd  (locale/en-US/bluegriffon/aboutDialog.dtd)
+  locale/en-US/bluegriffon/bluegriffon.dtd  (locale/en-US/bluegriffon/bluegriffon.dtd)
+  locale/en-US/bluegriffon/bluegriffon.properties  (locale/en-US/bluegriffon/bluegriffon.properties)
+  locale/en-US/bluegriffon/colourPicker.dtd  (locale/en-US/bluegriffon/colourPicker.dtd)
+  locale/en-US/bluegriffon/credits.dtd  (locale/en-US/bluegriffon/credits.dtd)
+  locale/en-US/bluegriffon/cssToggler.dtd  (locale/en-US/bluegriffon/cssToggler.dtd)
+  locale/en-US/bluegriffon/filepickerbutton.dtd  (locale/en-US/bluegriffon/filepickerbutton.dtd)
+  locale/en-US/bluegriffon/filePicking.dtd  (locale/en-US/bluegriffon/filePicking.dtd)
+  locale/en-US/bluegriffon/insertTable.dtd  (locale/en-US/bluegriffon/insertTable.dtd)
+  locale/en-US/bluegriffon/language.properties  (locale/en-US/bluegriffon/language.properties)
+  locale/en-US/bluegriffon/languages.dtd  (locale/en-US/bluegriffon/languages.dtd)
+  locale/en-US/bluegriffon/markupCleaner.dtd  (locale/en-US/bluegriffon/markupCleaner.dtd)
+  locale/en-US/bluegriffon/openLocation.dtd  (locale/en-US/bluegriffon/openLocation.dtd)
+  locale/en-US/bluegriffon/openLocation.properties  (locale/en-US/bluegriffon/openLocation.properties)
+  locale/en-US/bluegriffon/newPageWizard.dtd  (locale/en-US/bluegriffon/newPageWizard.dtd)\r
+  locale/en-US/bluegriffon/newPageWizard.properties  (locale/en-US/bluegriffon/newPageWizard.properties)\r
+  locale/en-US/bluegriffon/propertiesDeck.dtd  (locale/en-US/bluegriffon/propertiesDeck.dtd)
+  locale/en-US/bluegriffon/sidebar.dtd  (locale/en-US/bluegriffon/sidebar.dtd)
+  locale/en-US/bluegriffon/standaloneSidebar.dtd  (locale/en-US/bluegriffon/standaloneSidebar.dtd)
+  locale/en-US/bluegriffon/structurebar.dtd  (locale/en-US/bluegriffon/structurebar.dtd)
+  locale/en-US/bluegriffon/tabeditor.dtd  (locale/en-US/bluegriffon/tabeditor.dtd)
+  locale/en-US/bluegriffon/tabeditor.properties  (locale/en-US/bluegriffon/tabeditor.properties)\r
+       locale/en-US/bluegriffon/masterPasswordQuery.properties (locale/en-US/bluegriffon/masterPasswordQuery.properties)\r
+  \r
+* locale/en-US/branding/brand.dtd  (locale/en-US/branding/brand.dtd)
+  locale/en-US/branding/brand.properties  (locale/en-US/branding/brand.properties)
+\r
+#ifdef TOOLBAR_CUSTOMIZATION_SHEET\r
+toolkit.jar:\r
+*+      content/global/customizeToolbar.xul           (content/bluegriffon/xul/customizeToolbarSheet.xul)\r
+#endif\r
+\r
diff --git a/base/locale/en-US/bluegriffon/aboutDialog.dtd b/base/locale/en-US/bluegriffon/aboutDialog.dtd
new file mode 100644 (file)
index 0000000..4fe99c8
--- /dev/null
@@ -0,0 +1,6 @@
+<!ENTITY aboutDialog.title      "About &brandFullName;">
+<!ENTITY copyright              "Credits">
+<!ENTITY aboutLink              "&lt; About &brandFullName;">
+<!ENTITY aboutVersion           "version">
+<!ENTITY copyrightText          "&#169;1998-2008 Disruptive Innovations and Contributors. All Rights Reserved.">
+<!ENTITY cmdClose.macKey        "W">
diff --git a/base/locale/en-US/bluegriffon/bluegriffon.dtd b/base/locale/en-US/bluegriffon/bluegriffon.dtd
new file mode 100644 (file)
index 0000000..1878f76
--- /dev/null
@@ -0,0 +1,180 @@
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<!ENTITY window.title           "BlueGriffon">
+
+<!ENTITY fileMenu.label         "File">
+<!ENTITY fileMenu.accesskey     "f">
+<!ENTITY newMenu.label                    "New">
+<!ENTITY newMenu.accesskey                "n">
+
+<!ENTITY newWizardMenu.label              "New wizard">
+
+<!ENTITY editMenu.label                   "Edit">
+<!ENTITY editMenu.accesskey               "e">
+
+<!ENTITY viewMenu.label                   "View">
+<!ENTITY viewMenu.accesskey               "v">
+<!ENTITY fullScreen.label                 "Full screen">
+<!ENTITY fullScreen.accesskey             "f">
+<!ENTITY customizeToolbar.label           "Customize">
+<!ENTITY customizeToolbar.accesskey       "c">
+
+<!ENTITY insertMenu.label                 "Insert">
+<!ENTITY insertMenu.accesskey             "i">
+
+<!ENTITY formatMenu.label                 "Format">
+<!ENTITY formatMenu.accesskey             "o">
+
+<!ENTITY tableMenu.label                  "Table">
+<!ENTITY tableMenu.accesskey              "b">
+
+<!ENTITY toolsMenu.label                  "Tools">
+<!ENTITY toolsMenu.accesskey              "t">
+<!ENTITY consoleMenu.label                "JavaScript Console">
+
+<!ENTITY helpMenu.label                   "Help">
+<!ENTITY helpMenu.accesskey               "h">
+<!ENTITY aboutComposer.label              "About BlueGriffon">
+
+<!ENTITY throbber.tooltip                 "BlueGriffon">
+
+<!ENTITY newMenu.label                    "New">
+<!ENTITY newToolbarCmd.tooltip            "Create a new page">
+<!ENTITY newTab.label                     "Page in New Tab">
+<!ENTITY newWindow.label                  "Page in New Window">
+<!ENTITY newOtherCmd.label                "More Options...">
+
+<!ENTITY openMenu.label                   "Open">
+<!ENTITY openMenu.tooltip                 "Open an existing page">
+<!ENTITY openTab.label                    "Open in a New Tab">
+<!ENTITY openWindow.label                 "Open in a New Window">
+
+<!ENTITY quit.label                       "Quit">
+<!ENTITY quit.accesskey                   "q">
+
+<!ENTITY stopButton.label                 "Stop">
+<!ENTITY stopButton.tooltip               "Stop loading the page">
+
+<!ENTITY boldToolbarCmd.tooltip           "Bold">
+<!ENTITY boldToolbarCmd.label             "Bold">
+<!ENTITY italicToolbarCmd.tooltip         "Italic">
+<!ENTITY italicToolbarCmd.label           "Italic">
+<!ENTITY underlineToolbarCmd.tooltip      "Underline">
+<!ENTITY underlineToolbarCmd.label        "Underline">
+<!ENTITY strongToolbarCmd.tooltip         "Strong emphasis">
+<!ENTITY strongToolbarCmd.label           "Strong emphasis">
+<!ENTITY emToolbarCmd.tooltip             "Emphasis">
+<!ENTITY emToolbarCmd.label               "Emphasis">
+<!ENTITY codeToolbarCmd.label             "Code">
+<!ENTITY codeToolbarCmd.tooltip           "Code">
+
+<!ENTITY ParagraphSelect.tooltip "Choose a paragraph format">
+<!-- Shared in Paragraph, and Toolbar menulist -->
+<!ENTITY bodyTextCmd.label "Body Text">
+<!ENTITY paragraphParagraphCmd.label "Paragraph">  
+<!ENTITY heading1Cmd.label "Heading 1">
+<!ENTITY heading2Cmd.label "Heading 2">
+<!ENTITY heading3Cmd.label "Heading 3">
+<!ENTITY heading4Cmd.label "Heading 4">
+<!ENTITY heading5Cmd.label "Heading 5">
+<!ENTITY heading6Cmd.label "Heading 6">
+<!ENTITY paragraphAddressCmd.label "Address">
+<!ENTITY paragraphPreformatCmd.label "Preformat">
+<!ENTITY genericContainerCmd.label "Generic container (div)">
+
+<!ENTITY unorderedList.tooltip "Unordered list">
+<!ENTITY orderedList.tooltip "Ordered list">
+<!ENTITY unorderedList.label "Unordered list">
+<!ENTITY orderedList.label "Ordered list">
+
+<!ENTITY alignLeft.tooltip "Align left">
+<!ENTITY alignCenter.tooltip "Align center">
+<!ENTITY alignRight.tooltip "Align right">
+<!ENTITY alignJustify.tooltip "Align justified">
+<!ENTITY alignLeft.label "Align left">
+<!ENTITY alignCenter.label "Align center">
+<!ENTITY alignRight.label "Align right">
+<!ENTITY alignJustify.label "Align justified">
+
+<!ENTITY indentToolbarCmd.tooltip "Indent text">
+<!ENTITY indentToolbarCmd.label "Indent">
+
+<!ENTITY outdentToolbarCmd.tooltip "Outdent text">
+<!ENTITY outdentToolbarCmd.label "Outdent">
+
+<!ENTITY definitionDescription.tooltip "Definition description">
+<!ENTITY definitionDescription.label "Definition description">
+<!ENTITY definitionTitle.tooltip "Definition title">
+<!ENTITY definitionTitle.label "Definition title">
+
+<!ENTITY FontFaceSelect.tooltip "Choose a font">
+<!ENTITY fontVarWidth.label "Variable width">
+<!ENTITY fontFixedWidth.label "Fixed width">
+<!ENTITY fontHelveticaFont.label "Helvetica, Arial">
+<!ENTITY fontTimes.label "Times">
+<!ENTITY fontCourier.label "Courier">
+
+<!ENTITY applyClassToSelectionCmd.tooltip "Apply a class to the selection">
+<!ENTITY noClass.label "(no class)">
+
+<!ENTITY tableToolbarCmd.label "Table">
+<!ENTITY tableToolbarCmd.tooltip "Insert new table or edit selected table's properties">
+
+<!ENTITY saveCmd.label "Save">
+<!ENTITY saveToolbarCmd.tooltip "Save file to a local location">
+<!ENTITY filesave.accesskey "s">
+<!ENTITY filesave.keybinding "s">
+<!ENTITY saveAsCmd.label "Save As...">
+<!ENTITY filesaveas.accesskey "A">
+
+<!ENTITY setZoomFactor.label "Set zoom factor">
+
+<!ENTITY fileRecentMenu.label "Recent Pages">
+<!ENTITY filerecentmenu.accesskey "r">
+
+<!ENTITY markupCleanerCmd.label "Markup cleaner">
+<!ENTITY markupcleaner.accesskey "m">
+
+<!ENTITY viewToolbars.label "Toolbars">
+<!ENTITY viewStatusbar.label "Status bar">
+
+<!ENTITY formatToolbar.name "Format (primary)">
+<!ENTITY formatToolbar2.name "Format (secondary)">
+
+<!ENTITY elementLanguage.label "Language">
+<!ENTITY elementLanguage.accesskey "L">
diff --git a/base/locale/en-US/bluegriffon/bluegriffon.properties b/base/locale/en-US/bluegriffon/bluegriffon.properties
new file mode 100644 (file)
index 0000000..963c668
--- /dev/null
@@ -0,0 +1,18 @@
+titleModifier=BlueGriffon
+# in the following string, %t represents the title of the page or its URL
+# and %b the titleModifier above
+titleFormat=%S - %S
+Unknown=[Unknown]
+NoClassAvailable=(no class)
+NoIdAvailable=(no ID)
+DocumentTitle=Page Title
+NeedDocTitle=Please enter a title for the current page.
+DocTitleHelp=This identifies the page in the window title and bookmarks.
+ExportToText=Export to Text
+SaveDocumentAs=Save Page As
+XHTMLfiles=XHTML Files
+untitled=untitled
+SaveDocument=Save Page
+SaveFileFailed=Saving file failed!
+ExportToText=Export to Text
+
diff --git a/base/locale/en-US/bluegriffon/colourPicker.dtd b/base/locale/en-US/bluegriffon/colourPicker.dtd
new file mode 100644 (file)
index 0000000..de9a98a
--- /dev/null
@@ -0,0 +1,66 @@
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is Nvu.
+   -
+   - The Initial Developer of the Original Code is
+   - Linspire Inc..
+   - Portions created by the Initial Developer are Copyright (C) 2004
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (glazman@disruptive-innovations.com), on behalf of Linspire Inc.
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<!ENTITY previewColour.label     "Preview:">
+<!ENTITY dialog.title            "Color Picker">
+
+<!ENTITY predef.label            "Predefined colors:">
+<!ENTITY rgb.label               "RGB">
+<!ENTITY hsb.label               "HSB">
+
+<!ENTITY red.label               "R:">
+<!ENTITY green.label             "G:">
+<!ENTITY blue.label              "B:">
+
+<!ENTITY hue.label               "H:">
+<!ENTITY saturation.label        "S:">
+<!ENTITY brightness.label        "B:">
+
+<!ENTITY transparency.label       "Transparent">
+
+<!ENTITY background.label "Background for:">
+<!ENTITY background.accessKey "B">
+<!ENTITY table.label "Table">
+<!ENTITY table.accessKey "T">
+<!ENTITY cell.label "Cell(s)">
+<!ENTITY cell.accessKey "C">
+
+<!ENTITY lastPickedColor.label "Last-picked color">
+<!ENTITY lastPickedColor.accessKey "L">
+
+<!ENTITY hexColor.label            "Hex:">
+<!ENTITY nameColor.label           "Name:">
diff --git a/base/locale/en-US/bluegriffon/credits.dtd b/base/locale/en-US/bluegriffon/credits.dtd
new file mode 100644 (file)
index 0000000..ab16923
--- /dev/null
@@ -0,0 +1,35 @@
+<!ENTITY brandMotto       "You've never really edited a web site before.">
+<!ENTITY credit.leads     "Engineering Leads">
+<!ENTITY credit.contributors "Contributors">
+<!ENTITY credit.core      "Core Development Posse">
+<!ENTITY credit.gecko     "Gecko Layout Engine">
+<!ENTITY credit.thanks    "Special Thanks To">
+
+<!-- localization credits look like this: -->
+<!--
+<!ENTITY credit.translation
+  "<h3>Translators</h3><ul><li>Name Here</li></ul>">
+-->
+<!ENTITY credit.translation "">
+
+<!ENTITY credit.visuals     "Visual Design Coordinator">
+<!ENTITY credit.theme       "Theme Design">
+<!ENTITY credit.brand       "Brand Identity">
+<!ENTITY credit.web         "Web Design">
+<!ENTITY credit.update      "Mozilla Update">
+<!ENTITY credit.qalead      "Quality Assurance Lead">
+<!ENTITY credit.qa          "Quality Assurance">
+<!ENTITY credit.build       "Build and Release">
+<!ENTITY credit.infra       "Infrastructure Support">
+<!ENTITY credit.support     "Support Resources">
+<!ENTITY credit.manage      "Project Management">
+<!ENTITY credit.marketleads "Marketing Leads">
+<!ENTITY credit.market      "Marketing">
+<!ENTITY credit.creators    "Created By">
+<!ENTITY credit.memory      "In Fond Memory Of">
+<!ENTITY credit.poweredByGecko "Powered by Gecko&trade;">
+<!ENTITY credit.reviews     "Code reviews">
+
+<!ENTITY license.and "and">
+
+<!ENTITY tm.part0 "is a registered trademark of">
\ No newline at end of file
diff --git a/base/locale/en-US/bluegriffon/cssToggler.dtd b/base/locale/en-US/bluegriffon/cssToggler.dtd
new file mode 100644 (file)
index 0000000..e78a68c
--- /dev/null
@@ -0,0 +1,52 @@
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2008
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+   
+<!ENTITY cssPolicy.label "CSS policy:">
+
+<!ENTITY htmlAttr.label "Set HTML attributes only">
+<!ENTITY inlineStyles.label "Set CSS inline styles when possible">
+<!ENTITY cssRules.label "Set CSS rules or inline styles when possible">
+<!ENTITY reuseExistingStyle.label "Reuse existing style rules">
+
+<!ENTITY styleRule.label "CSS Selector">
+<!ENTITY mandatoryId.description "You must provide an ID or class for the element:">
+<!ENTITY pickOne.button "Pick one for me">
+
+<!ENTITY existingId.alert "Error: this ID already exists in your document">
+
+<!ENTITY classList.label "Class:">
+<!ENTITY idList.label "ID:">
diff --git a/base/locale/en-US/bluegriffon/filePicking.dtd b/base/locale/en-US/bluegriffon/filePicking.dtd
new file mode 100644 (file)
index 0000000..1bcf44f
--- /dev/null
@@ -0,0 +1 @@
+<!ENTITY chooseFile.button "Choose file">
diff --git a/base/locale/en-US/bluegriffon/filepickerbutton.dtd b/base/locale/en-US/bluegriffon/filepickerbutton.dtd
new file mode 100644 (file)
index 0000000..9245aac
--- /dev/null
@@ -0,0 +1 @@
+<!ENTITY filepickerbutton.tooltip "Choose file">
diff --git a/base/locale/en-US/bluegriffon/insertTable.dtd b/base/locale/en-US/bluegriffon/insertTable.dtd
new file mode 100644 (file)
index 0000000..4c34595
--- /dev/null
@@ -0,0 +1,64 @@
+<!--
+   - The contents of this file are subject to the Netscape Public
+   - License Version 1.1 (the "License"); you may not use this file
+   - except in compliance with the License. You may obtain a copy of
+   - the License at http://www.mozilla.org/NPL/
+   -  
+   - Software distributed under the License is distributed on an "AS
+   - IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+   - implied. See the License for the specific language governing
+   - rights and limitations under the License.
+   -  
+   - The Original Code is Mozilla Communicator client code, released
+   - March 31, 1998.
+   - 
+   - The Initial Developer of the Original Code is Netscape
+   - Communications Corporation. Portions created by Netscape are
+   - Copyright (C) 1998-2000 Netscape Communications Corporation. All
+   - Rights Reserved.
+   - 
+   - Contributor(s): 
+  -->
+
+<!-- Window title -->
+<!ENTITY windowTitle.label "Insert Table">
+
+<!ENTITY size.label "Size">
+<!ENTITY numRowsEditField.label "Rows:">
+<!ENTITY numRowsEditField.accessKey "R">
+<!ENTITY numColumnsEditField.label "Columns:">
+<!ENTITY numColumnsEditField.accessKey "C">
+<!ENTITY widthEditField.label "Width:">
+<!ENTITY widthEditField.accessKey "W">
+<!ENTITY borderEditField.label "Border:">
+<!ENTITY borderEditField.accessKey "B">
+<!ENTITY borderEditField.tooltip "Type a number for the table's border, or type zero (0) for no border">
+<!ENTITY pixels.label "pixels">
+
+<!ENTITY quicklyTab.label "Quickly">
+<!ENTITY preciselyTab.label "Precisely">
+<!ENTITY cellTab.label "Cell">
+
+<!ENTITY horizAlignment.label "Horiz. alignment:">
+<!ENTITY unspecifiedHAlignment.label "Unspecified">
+<!ENTITY leftHAlignment.label "Left">
+<!ENTITY centerHAlignment.label "Center">
+<!ENTITY rightHAlignment.label "Right">
+
+<!ENTITY vertAlignment.label "Vert. alignment:">
+<!ENTITY unspecifiedVAlignment.label "Unspecified">
+<!ENTITY topVAlignment.label "Top">
+<!ENTITY middleVAlignment.label "Middle">
+<!ENTITY bottomVAlignment.label "Bottom">
+
+<!ENTITY textWrapping.label "Text wrapping:">
+<!ENTITY wrapWrapping.label "Wrap">
+<!ENTITY nowrapWrapping.label "Don't wrap">
+
+<!ENTITY cellSpacing.label "Cellspacing">
+<!ENTITY cellPadding.label "Cellpadding">
+
+<!ENTITY cssExtras.label "CSS extra properties">
+<!ENTITY collapseBorders.label "Collapse all borders">
+<!ENTITY hideEmptyCells.label "Hide empty cells (will not apply to editing view)">
+<!ENTITY fixedLayout.label "Use fixed table layout">
diff --git a/base/locale/en-US/bluegriffon/language.properties b/base/locale/en-US/bluegriffon/language.properties
new file mode 100644 (file)
index 0000000..1a6e36f
--- /dev/null
@@ -0,0 +1,7 @@
+# LOCALIZATION NOTE: Next two strings are for language name representations with
+#   and without the region.
+#   e.g. languageRegionCodeFormat : "French/Canada  [fr-ca]" languageCodeFormat : "French  [fr]"
+#   %1$S = language name, %2$S = region name, %3$S = language-region code
+languageRegionCodeFormat=%1$S/%2$S  [%3$S]
+#   %1$S = language name, %2$S = language-region code
+languageCodeFormat=%1$S  [%2$S]
diff --git a/base/locale/en-US/bluegriffon/languages.dtd b/base/locale/en-US/bluegriffon/languages.dtd
new file mode 100644 (file)
index 0000000..4c92e94
--- /dev/null
@@ -0,0 +1,10 @@
+<!ENTITY window.title "Select a language">
+
+<!ENTITY languagesList.label  "Languages:">
+<!ENTITY examples.label "e.g.: en-bz, ar-jo">
+<!ENTITY others.label "Others:">
+<!ENTITY others.accesskey "O">
+
+<!ENTITY clearSubtree.label "Clear language information for children">
+
+<!ENTITY currentLanguage.label "Current language is:">
diff --git a/base/locale/en-US/bluegriffon/markupCleaner.dtd b/base/locale/en-US/bluegriffon/markupCleaner.dtd
new file mode 100644 (file)
index 0000000..21f7112
--- /dev/null
@@ -0,0 +1,48 @@
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is Nvu.
+   -
+   - The Initial Developer of the Original Code is
+   - Linspire Inc..
+   - Portions created by the Initial Developer are Copyright (C) 2004
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman <glazman@disruptive-innovations.com>, on behalf of Linspire Inc.
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<!ENTITY window.title "Markup cleaner">
+
+<!ENTITY trailingBR.label "Remove trailing &lt;br&gt;">
+<!ENTITY emptyBlocks.label "Remove empty blocks">
+<!ENTITY emptyCells.label "Remove alignment on empty table cells">
+<!ENTITY nestedLists.label "Fix nested lists">
+
+<!ENTITY cleanUp.label "Clean up">
+
+<!ENTITY actionColumnHeader.label "Action">
+<!ENTITY reportColumnHeader.label "Report">
diff --git a/base/locale/en-US/bluegriffon/masterPasswordQuery.properties b/base/locale/en-US/bluegriffon/masterPasswordQuery.properties
new file mode 100644 (file)
index 0000000..cb47489
--- /dev/null
@@ -0,0 +1,5 @@
+windowTitle=Master password
+query=You have not set a Master Password yet. Do you want to create a Master Password?
+yesButton=Yes
+noButton=No
+
diff --git a/base/locale/en-US/bluegriffon/newPageWizard.dtd b/base/locale/en-US/bluegriffon/newPageWizard.dtd
new file mode 100644 (file)
index 0000000..9014edd
--- /dev/null
@@ -0,0 +1,133 @@
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<!ENTITY window.title "New Document Wizard">
+
+<!ENTITY pageTitle.label "Title:">
+<!ENTITY pageAuthor.label "Author:">
+<!ENTITY pageDescription.label "Description:">
+<!ENTITY pageTitle.accesskey "T">
+<!ENTITY pageAuthor.accesskey "A">
+<!ENTITY pageDescription.accesskey "D">
+<!ENTITY pageKeywords.label "Keywords:">
+<!ENTITY pageKeywords.accesskey "K">
+<!ENTITY language.label "Language:">
+<!ENTITY language.accesskey "L">
+
+<!ENTITY selectLanguage.label "Select a language">
+
+<!ENTITY backgroundImage.label "Background Image:">
+<!ENTITY backgroundImage.accesskey "B">
+
+<!ENTITY filepickerForBgImage.title "Select a background image">
+<!ENTITY pagePreview.label "Preview:">
+
+<!ENTITY useSystemColors.label "Reader's defaults colors (Don't set colors in page)">
+<!ENTITY userDefinedColors.label "Use custom colors:">
+
+<!ENTITY backgroundColor.label "Background:">
+<!ENTITY backgroundColor.accesskey "B">
+<!ENTITY textColor.label "Text:">
+<!ENTITY textColor.accesskey "T">
+<!ENTITY linksColor.label "Links:">
+<!ENTITY linksColor.accesskey "L">
+<!ENTITY activeLinksColor.label "Active Links:">
+<!ENTITY activeLinksColor.accesskey "A">
+<!ENTITY visitedLinksColor.label "Visited Links:">
+<!ENTITY visitedLinksColor.accesskey "V">
+<!ENTITY underlineLinks.label "Underline links">
+
+<!ENTITY relativeURLForBgImage.label "URL is relative to page location">
+
+<!ENTITY generalTab.label "General document properties">
+<!ENTITY colorsTab.label "Colors and backgrounds">
+<!ENTITY styleTab.label "Style">
+<!ENTITY advancedTab.label "Advanced">
+
+<!ENTITY unsavedPage.label "[New page, not saved yet]">
+<!ENTITY noPageLastModified.label "[No information]">
+
+<!ENTITY normalText.preview "Normal text">
+<!ENTITY links.preview "Links">
+<!ENTITY activeLinks.preview "Active links">
+<!ENTITY visitedLinks.preview "Visited links">
+
+<!ENTITY makeColorsDefault.label "Make the above my default settings">
+
+<!ENTITY bgTab.label "Document background">
+
+<!ENTITY layoutsTab.label "Page layouts">
+<!ENTITY usePageLayout.checkbox "Apply a predefined CSS layout">
+<!ENTITY oneColumn100.label "1 column, 100&#37;">
+<!ENTITY twoColumns5050.label "2 columns, 50&#37;/50&#37;">
+<!ENTITY twoColumns6633.label "2 columns, 66&#37;/33&#37;">
+<!ENTITY twoColumns3366.label "2 columns, 33&#37;/66&#37;">
+<!ENTITY twoColumns7525.label "2 columns, 75&#37;/25&#37;">
+<!ENTITY twoColumns2575.label "2 columns, 25&#37;/75&#37;">
+<!ENTITY threeColumns333333.label "3 columns, 33&#37;/33&#37;/33&#37;">
+<!ENTITY threeColumns502525.label "3 columns, 50&#37;/25&#37;/25&#37;">
+<!ENTITY threeColumns252550.label "3 columns, 25&#37;/25&#37;/50&#37;">
+<!ENTITY fourColumns25252525.label "4 columns, 25&#37;/25&#37;/25&#37;/25&#37;">
+
+<!ENTITY layoutType.label "Width:">
+<!ENTITY layoutType.accesskey "W">
+<!ENTITY layout100percent.label "Full width">
+<!ENTITY layout750px.label "750px">
+<!ENTITY layout950px.label "950px">
+<!ENTITY layout974px.label "974px">
+<!ENTITY layoutSubtype.label "Sidebar:">
+<!ENTITY layoutSubtype.accesskey "S">
+<!ENTITY noSidebar.label "None">
+<!ENTITY left160Sidebar.label "Left 160px">
+<!ENTITY left180Sidebar.label "Left 180px">
+<!ENTITY left300Sidebar.label "Left 300px">
+<!ENTITY right180Sidebar.label "Right 180px">
+<!ENTITY right240Sidebar.label "Right 240px">
+<!ENTITY right300Sidebar.label "Right 300px">
+<!ENTITY loremIpsum.label "Include 'lorem ipsum' dummy content">
+<!ENTITY loremIpsum.accesskey "I">
+<!ENTITY newRow.label "New row">
+<!ENTITY removeRow.label "Remove">
+
+<!ENTITY tile.label "Tile:">
+<!ENTITY tile.accesskey "T">
+<!ENTITY scrolling.label "Scrolling:">
+<!ENTITY scrolling.accesskey "S">
+<!ENTITY scrollWithPage.label "With the page">
+<!ENTITY noScrolling.label "No scrolling">
+<!ENTITY horizPosition.label "Horiz:">
+<!ENTITY vertPosition.label "Vert:">
diff --git a/base/locale/en-US/bluegriffon/newPageWizard.properties b/base/locale/en-US/bluegriffon/newPageWizard.properties
new file mode 100644 (file)
index 0000000..5eca36c
--- /dev/null
@@ -0,0 +1,4 @@
+loremIpsum=Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sit amet metus. Nunc quam elit, posuere nec, auctor in, rhoncus quis, dui. Aliquam erat volutpat. Ut dignissim, massa sit amet dignissim cursus, quam lacus feugiat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sit amet metus. Nunc quam elit, posuere nec, auctor in, rhoncus quis, dui. Aliquam erat volutpat. Ut dignissim, massa sit amet dignissim cursus, quam lacus feugiat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sit amet metus. Nunc quam elit, posuere nec, auctor in, rhoncus quis, dui. Aliquam erat volutpat. Ut dignissim, massa sit amet dignissim cursus, quam lacus feugiat.
+header=PAGE HEADER
+footer=FOOTER
+nav=NAVIGATION PANE
diff --git a/base/locale/en-US/bluegriffon/openLocation.dtd b/base/locale/en-US/bluegriffon/openLocation.dtd
new file mode 100644 (file)
index 0000000..b74163e
--- /dev/null
@@ -0,0 +1,50 @@
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is Mozilla Composer.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<!ENTITY window.title "Open a file or template">
+
+<!ENTITY enterLocation.label "Enter the web location (URL) of the file/template, or choose a local one:">
+<!ENTITY enterLocation.accesskey "E">
+
+<!ENTITY chooseFile.label "Choose File...">
+<!ENTITY chooseFile.accesskey "C">
+
+<!ENTITY createIn.label "Create in a">
+<!ENTITY inATab.label "Tab">
+<!ENTITY inATab.accesskey "T">
+<!ENTITY inAWindow.label "Window">
+<!ENTITY inAWindow.accesskey "W">
diff --git a/base/locale/en-US/bluegriffon/openLocation.properties b/base/locale/en-US/bluegriffon/openLocation.properties
new file mode 100644 (file)
index 0000000..8a901ed
--- /dev/null
@@ -0,0 +1,2 @@
+chooseFileDialogTitle=Choose a file
+templateFilter=HTML Templates
diff --git a/base/locale/en-US/bluegriffon/pageProperties.dtd b/base/locale/en-US/bluegriffon/pageProperties.dtd
new file mode 100644 (file)
index 0000000..bbd01d9
--- /dev/null
@@ -0,0 +1,33 @@
+<!ENTITY window.title "Document properties">
+
+<!ENTITY pageLocation.label "Location:">
+<!ENTITY pageLastModified.label "Last Modified:">
+<!ENTITY pageTitle.label "Title:">
+<!ENTITY pageAuthor.label "Author:">
+<!ENTITY pageDescription.label "Description:">
+<!ENTITY pageTitle.accesskey "T">
+<!ENTITY pageAuthor.accesskey "A">
+<!ENTITY pageDescription.accesskey "D">
+<!ENTITY pageKeywords.label "Keywords:">
+<!ENTITY pageKeywords.accesskey "K">
+
+<!ENTITY backgroundImage.label "Background Image:">
+<!ENTITY backgroundImage.accesskey "B">
+
+<!ENTITY filepickerForBgImage.title "Select a background image">
+<!ENTITY pagePreview.label "Preview:">
+
+<!ENTITY useSystemColors.label "Reader's defaults colors (Don't set colors in page)">
+<!ENTITY userDefinedColors.label "Use custom colors:">
+
+<!ENTITY backgroundColor.label "Background:">
+<!ENTITY textColor.label "Text:">
+<!ENTITY linksColor.label "Links:">
+<!ENTITY activeLinksColor.label "Active Links:">
+<!ENTITY visitedLinksColor.label "Visited Links:">
+
+<!ENTITY relativeURLForBgImage.label "URL is relative to page location">
+
+<!ENTITY generalTab.label "General">
+<!ENTITY styleTab.label "Style">
+<!ENTITY advancedTab.label "Advanced">
diff --git a/base/locale/en-US/bluegriffon/pagePropertiesPreview.html b/base/locale/en-US/bluegriffon/pagePropertiesPreview.html
new file mode 100644 (file)
index 0000000..b17673f
--- /dev/null
@@ -0,0 +1,14 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r
+<html>\r
+<head>\r
+  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">\r
+  <style>p[id] { margin: 0px; }</style>\r
+  <title></title>\r
+</head>\r
+<body>\r
+  <p>Normal text will look like this !</p>\r
+  <p id="links">Links will look like this !<br>\r
+  <p id="visited">Visited will look like this !<br>\r
+  <p id="active">Active Links will look like this !</p>\r
+</body>\r
+</html>\r
diff --git a/base/locale/en-US/bluegriffon/propertiesDeck.dtd b/base/locale/en-US/bluegriffon/propertiesDeck.dtd
new file mode 100644 (file)
index 0000000..71eef76
--- /dev/null
@@ -0,0 +1 @@
+<!ENTITY foo "foo">
diff --git a/base/locale/en-US/bluegriffon/sidebar.dtd b/base/locale/en-US/bluegriffon/sidebar.dtd
new file mode 100644 (file)
index 0000000..15bf14d
--- /dev/null
@@ -0,0 +1,50 @@
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<!ENTITY sidebar.title           "Sidebar">
+<!ENTITY actions.label           "actions">
+
+<!ENTITY closeMenu.label         "Close">
+<!ENTITY closeMenu.accesskey     "c">
+
+<!ENTITY detachMenu.label        "Detach">
+<!ENTITY detachMenu.accesskey    "t">
+
+<!ENTITY addSidebarContent.label "Add">
+<!ENTITY addSidebarContent.tooltip    "Add more content to this sidebar">
+
+<!ENTITY closeSidebar.tooltip    "Close sidebar">
diff --git a/base/locale/en-US/bluegriffon/standaloneSidebar.dtd b/base/locale/en-US/bluegriffon/standaloneSidebar.dtd
new file mode 100644 (file)
index 0000000..d1f4a54
--- /dev/null
@@ -0,0 +1,40 @@
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<!ENTITY reattachMenu.label "Reattach">
+<!ENTITY intoFirstSidebar.label "To left sidebar">
+<!ENTITY intoSecondSidebar.label "To right sidebar">
diff --git a/base/locale/en-US/bluegriffon/structurebar.dtd b/base/locale/en-US/bluegriffon/structurebar.dtd
new file mode 100644 (file)
index 0000000..284bbb5
--- /dev/null
@@ -0,0 +1 @@
+<!ENTITY structureBar.title "Structure">
diff --git a/base/locale/en-US/bluegriffon/tabeditor.dtd b/base/locale/en-US/bluegriffon/tabeditor.dtd
new file mode 100644 (file)
index 0000000..ad1464c
--- /dev/null
@@ -0,0 +1,38 @@
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is Mozilla Composer.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<!ENTITY untitledDocument.label "Untitled document">
diff --git a/base/locale/en-US/bluegriffon/tabeditor.properties b/base/locale/en-US/bluegriffon/tabeditor.properties
new file mode 100644 (file)
index 0000000..2e65efe
--- /dev/null
@@ -0,0 +1 @@
+a
\ No newline at end of file
diff --git a/base/locale/en-US/branding/brand.dtd b/base/locale/en-US/branding/brand.dtd
new file mode 100644 (file)
index 0000000..b614862
--- /dev/null
@@ -0,0 +1,42 @@
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+#expand <!ENTITY  lang.version          "__MOZILLA_LOCALE_VERSION__">
+<!ENTITY  brandShortName        "BlueGriffon">
+<!ENTITY  brandFullName         "BlueGriffon">
+<!ENTITY  vendorShortName       "Disruptive Innovations">
+<!ENTITY  sidebarName           "Sidebar">
diff --git a/base/locale/en-US/branding/brand.properties b/base/locale/en-US/branding/brand.properties
new file mode 100644 (file)
index 0000000..b9073f9
--- /dev/null
@@ -0,0 +1,4 @@
+brandShortName=BlueGriffon
+brandFullName=BlueGriffon
+vendorShortName=Disruptive Innovations
+sidebarName=Sidebar
diff --git a/build.mk b/build.mk
new file mode 100644 (file)
index 0000000..2c52fd2
--- /dev/null
+++ b/build.mk
@@ -0,0 +1,66 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is the Mozilla build system.
+#
+# The Initial Developer of the Original Code is
+# the Mozilla Foundation <http://www.mozilla.org/>.
+# Portions created by the Initial Developer are Copyright (C) 2006
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Benjamin Smedberg <benjamin@smedbergs.us> (Initial Code)
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+ifndef LIBXUL_SDK
+include $(topsrcdir)/toolkit/toolkit-tiers.mk
+endif
+
+TIERS += app
+
+ifdef MOZ_EXTENSIONS
+tier_app_dirs += extensions
+endif
+
+ifdef MOZ_BRANDING_DIRECTORY
+tier_app_dirs += $(MOZ_BRANDING_DIRECTORY)
+endif
+
+tier_app_dirs += \
+       bluegriffon \
+       $(NULL)
+
+installer:
+       @echo "BlueGriffon doesn't have an installer yet."
+       @exit 1
+
+package:
+       @$(MAKE) -C bluegriffon/installer
+
+install::
+       @echo "BlueGriffon can't be installed directly."
+       @exit 1
+
diff --git a/config/mozconfig.linux b/config/mozconfig.linux
new file mode 100644 (file)
index 0000000..2983dac
--- /dev/null
@@ -0,0 +1,31 @@
+# sh
+# Build configuration script for LINUX
+#
+# See http://developer.mozilla.org/en/Configuring_Build_Options for build options.
+#
+# you should copy this file into the src/ directory of Mozilla, under the name .mozconfig
+
+ac_add_options  --enable-application=bluegriffon
+
+# Comment out the following lines for an optimized build
+#mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/binaries-opt
+#ac_add_options --enable-optimize
+#ac_add_options --enable-strip
+#ac_add_options --disable-debug
+#ac_add_options --disable-tests
+
+# Comment out the following lines for a debug build
+#mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/binaries-debug
+#ac_add_options --disable-optimize
+#ac_add_options --enable-debug
+#ac_add_options --enable-tests
+
+ac_add_options --with-default-mozilla-five-home=/usr/lib/bluegriffon
+mk_add_options MOZ_MAKE_FLAGS=-j2
+
+# x11
+ac_add_options  --enable-toolkit=cairo-gtk2
+ac_add_options  --enable-xft
+ac_add_options  --disable-freetype2
+
+ac_add_options --disable-crashreporter
diff --git a/config/mozconfig.macosx b/config/mozconfig.macosx
new file mode 100644 (file)
index 0000000..33b8a38
--- /dev/null
@@ -0,0 +1,34 @@
+# sh
+# Build configuration script for MacOSX
+#
+# See http://developer.mozilla.org/en/Configuring_Build_Options for build options.
+#
+
+ac_add_options  --enable-application=bluegriffon
+
+# Comment out the following lines for an optimized build
+#mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/binaries-opt
+#ac_add_options --enable-optimize
+#ac_add_options --enable-strip
+#ac_add_options --disable-debug
+#ac_add_options --disable-tests
+
+# Comment out the following lines for a debug build
+#mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/binaries-debug
+#ac_add_options --disable-optimize
+#ac_add_options --enable-debug
+#ac_add_options --enable-tests
+
+mk_add_options MOZ_MAKE_FLAGS=-j2
+
+#ac_add_options  --with-pthreads
+
+ac_add_options  --enable-default-toolkit=mac
+ac_add_options  --enable-macos-target=10.2
+ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.2.8.sdk
+ac_add_options --enable-prebinding
+
+# Note: Only include icon for mac, windows and os2
+ac_add_options --enable-image-decoders=default,-xbm
+
+ac_add_options --disable-crashreporter
diff --git a/config/mozconfig.win b/config/mozconfig.win
new file mode 100644 (file)
index 0000000..bf408fb
--- /dev/null
@@ -0,0 +1,36 @@
+# sh
+# Build configuration script for Windows
+#
+# See http://developer.mozilla.org/en/Configuring_Build_Options for build options.
+#
+
+ac_add_options  --enable-application=bluegriffon
+
+# Copy files from C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT
+# to a new directory which has no whitespace in its path, and indicates this path
+# into this variable:
+#WIN32_REDIST_DIR=/c/apps/vc9_redist
+
+# Comment out the following lines for an optimized build
+#mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/binaries-opt
+#ac_add_options --enable-optimize
+#ac_add_options --enable-strip
+#ac_add_options --disable-debug
+#ac_add_options --disable-tests
+
+# Comment out the following lines for a debug build
+#mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/binaries-debug
+#ac_add_options --disable-optimize
+#ac_add_options --enable-debug
+#ac_add_options --enable-tests
+
+mk_add_options MOZ_MAKE_FLAGS=-j2
+
+# If you have Vista, comment the following line
+ac_add_options --disable-vista-sdk-requirements
+
+ac_add_options --disable-installer
+ac_add_options --disable-javaxpcom
+ac_add_options --disable-activex
+ac_add_options --disable-activex-scripting
+ac_add_options --disable-crashreporter
diff --git a/config/netwerkProtocolFtp.patch b/config/netwerkProtocolFtp.patch
new file mode 100644 (file)
index 0000000..a4bfcbc
--- /dev/null
@@ -0,0 +1,534 @@
+diff -r 51249e968f24 netwerk/protocol/ftp/public/nsIFTPChannel.idl
+--- a/netwerk/protocol/ftp/public/nsIFTPChannel.idl    Mon Nov 24 11:36:44 2008 +0100
++++ b/netwerk/protocol/ftp/public/nsIFTPChannel.idl    Wed Jan 14 18:15:50 2009 +0100
+@@ -37,12 +37,41 @@
+ #include "nsISupports.idl"
++interface nsIURI;
++
+ /**
+  * This interface may be used to determine if a channel is a FTP channel.
+  */
+-[scriptable, uuid(2315d831-8b40-446a-9138-fe09ebb1b720)]
++[scriptable, uuid(deb19f2a-ad32-47c4-85f4-b799fd7f1e51)]
+ interface nsIFTPChannel : nsISupports
+ {
++  /**
++   * This method prepares the channel for the deletion of a file. The
++   * deletion itself will be performed when the channel is opened,
++   * synchronously or not.
++   */
++  void deleteFile();
++
++  /**
++   * This method prepares the channel for the creation of a new directory.
++   * The creation itself will be performed when the channel is opened,
++   * synchronously or not.
++   */
++  void createDirectory();
++
++  /**
++   * This method prepares the channel for the removal of a directory.
++   * The removal itself will be performed when the channel is opened,
++   * synchronously or not.
++   */
++  void removeDirectory();
++
++  /*
++   * This method prepares the channel for renaming. The renaming itself
++   * will be performed when the channel is opened,
++   * synchronously or not.
++   */
++  void renameTo(in nsIURI aNewURI);
+ };
+ /**
+diff -r 51249e968f24 netwerk/protocol/ftp/src/nsFTPChannel.cpp
+--- a/netwerk/protocol/ftp/src/nsFTPChannel.cpp        Mon Nov 24 11:36:44 2008 +0100
++++ b/netwerk/protocol/ftp/src/nsFTPChannel.cpp        Wed Jan 14 18:15:50 2009 +0100
+@@ -154,6 +154,14 @@
+         return NS_ERROR_OUT_OF_MEMORY;
+     NS_ADDREF(state);
++    (void) state->ScheduleForFileDeletion(mScheduledForDELE);
++    (void) state->ScheduleForDirCreation(mScheduledForMKD);
++    (void) state->ScheduleForDirRemoval(mScheduledForRMD);
++    (void) state->ScheduleForRenaming(mScheduledForRNFR, mScheduledNewURI);
++
++    // clear all schedules for future use of the channel
++    ClearSchedules(PR_FALSE);
++
+     nsresult rv = state->Init(this);
+     if (NS_FAILED(rv)) {
+         NS_RELEASE(state);
+@@ -197,3 +205,38 @@
+     }
+     aResult = mFTPEventSink;
+ }
++
++//-----------------------------------------------------------------------------
++
++NS_IMETHODIMP
++nsFtpChannel::DeleteFile()
++{
++  ClearSchedules(PR_TRUE);
++  mScheduledForDELE = PR_TRUE;
++  return NS_OK;
++}
++
++NS_IMETHODIMP
++nsFtpChannel::CreateDirectory()
++{
++  ClearSchedules(PR_TRUE);
++  mScheduledForMKD = PR_TRUE;
++  return NS_OK;
++}
++
++NS_IMETHODIMP
++nsFtpChannel::RemoveDirectory()
++{
++  ClearSchedules(PR_TRUE);
++  mScheduledForRMD = PR_TRUE;
++  return NS_OK;
++}
++
++NS_IMETHODIMP
++nsFtpChannel::RenameTo(nsIURI * aNewURI)
++{
++  ClearSchedules(PR_TRUE);
++  mScheduledForRNFR = PR_TRUE;
++  mScheduledNewURI = aNewURI;
++  return NS_OK;
++}
+diff -r 51249e968f24 netwerk/protocol/ftp/src/nsFTPChannel.h
+--- a/netwerk/protocol/ftp/src/nsFTPChannel.h  Mon Nov 24 11:36:44 2008 +0100
++++ b/netwerk/protocol/ftp/src/nsFTPChannel.h  Wed Jan 14 18:15:50 2009 +0100
+@@ -80,11 +80,16 @@
+     NS_DECL_NSIUPLOADCHANNEL
+     NS_DECL_NSIRESUMABLECHANNEL
+     NS_DECL_NSIPROXIEDCHANNEL
++    NS_DECL_NSIFTPCHANNEL
+     
+     nsFtpChannel(nsIURI *uri, nsIProxyInfo *pi)
+         : mProxyInfo(pi)
+         , mStartPos(0)
+         , mResumeRequested(PR_FALSE)
++        , mScheduledForDELE(PR_FALSE)
++        , mScheduledForMKD(PR_FALSE)
++        , mScheduledForRMD(PR_FALSE)
++        , mScheduledForRNFR(PR_FALSE)
+     {
+         SetURI(uri);
+     }
+@@ -121,6 +126,21 @@
+                                        nsIChannel** channel);
+     virtual PRBool GetStatusArg(nsresult status, nsString &statusArg);
+     virtual void OnCallbacksChanged();
++    inline void ClearSchedules(PRBool aWarnings) {
++      if (aWarnings && mScheduledForDELE)
++        NS_WARNING("Cancelling previously scheduled FTP file deletion");
++      if (aWarnings && mScheduledForMKD)
++        NS_WARNING("Cancelling previously scheduled FTP directory creation");
++      if (aWarnings && mScheduledForRMD)
++        NS_WARNING("Cancelling previously scheduled FTP directory removal");
++      if (aWarnings && mScheduledForRNFR)
++        NS_WARNING("Cancelling previously scheduled FTP file renaming");
++      mScheduledForDELE = PR_FALSE;
++      mScheduledForMKD  = PR_FALSE;
++      mScheduledForRMD  = PR_FALSE;
++      mScheduledForRNFR = PR_FALSE;
++      mScheduledNewURI = nsnull;
++    }
+ private:
+     nsCOMPtr<nsIProxyInfo>    mProxyInfo; 
+@@ -129,6 +149,13 @@
+     PRUint64                  mStartPos;
+     nsCString                 mEntityID;
+     PRPackedBool              mResumeRequested;
++
++    PRPackedBool              mScheduledForDELE;
++    PRPackedBool              mScheduledForMKD;
++    PRPackedBool              mScheduledForRMD;
++    PRPackedBool              mScheduledForRNFR;
++
++    nsCOMPtr<nsIURI>          mScheduledNewURI;
+ };
+ #endif /* nsFTPChannel_h___ */
+diff -r 51249e968f24 netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp
+--- a/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp       Mon Nov 24 11:36:44 2008 +0100
++++ b/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp       Wed Jan 14 18:15:50 2009 +0100
+@@ -1,4 +1,4 @@
+-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
++/* -*- Mode: C+; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+ /* vim:set tw=80 ts=4 sts=4 sw=4 et cin: */
+ /* ***** BEGIN LICENSE BLOCK *****
+  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+@@ -637,6 +637,96 @@
+             break;
+             
++// DELE
++          case FTP_S_DELE:
++            rv = S_dele();
++
++            if (NS_FAILED(rv))
++                mInternalError = rv;
++            
++            MoveToNextState(FTP_R_DELE);
++            break;
++            
++          case FTP_R_DELE:
++            mState = R_dele();
++
++            if (FTP_ERROR == mState)
++                mInternalError = NS_ERROR_FAILURE;
++
++            break;
++            
++// MKD        
++          case FTP_S_MKD:
++            rv = S_mkd();
++
++            if (NS_FAILED(rv))
++                mInternalError = rv;
++            
++            MoveToNextState(FTP_R_MKD);
++            break;
++            
++          case FTP_R_MKD:
++            mState = R_mkd();
++
++            if (FTP_ERROR == mState)
++                mInternalError = NS_ERROR_FAILURE;
++
++            break;
++            
++// RMD        
++          case FTP_S_RMD:
++            rv = S_rmd();
++
++            if (NS_FAILED(rv))
++                mInternalError = rv;
++            
++            MoveToNextState(FTP_R_RMD);
++            break;
++            
++          case FTP_R_RMD:
++            mState = R_rmd();
++
++            if (FTP_ERROR == mState)
++                mInternalError = NS_ERROR_FAILURE;
++
++            break;
++            
++// RNFR
++          case FTP_S_RNFR:
++            rv = S_rnfr();
++
++            if (NS_FAILED(rv))
++                mInternalError = rv;
++            
++            MoveToNextState(FTP_R_RNFR);
++            break;
++            
++          case FTP_R_RNFR:
++            mState = R_rnfr();
++
++            if (FTP_ERROR == mState)
++                mInternalError = NS_ERROR_FAILURE;
++
++            break;
++
++// RNTO
++          case FTP_S_RNTO:
++            rv = S_rnto();
++
++            if (NS_FAILED(rv))
++                mInternalError = rv;
++            
++            MoveToNextState(FTP_R_RNTO);
++            break;
++            
++          case FTP_R_RNTO:
++            mState = R_rnto();
++
++            if (FTP_ERROR == mState)
++                mInternalError = NS_ERROR_FAILURE;
++
++            break;
++            
+           default:
+             ;
+             
+@@ -963,10 +1053,20 @@
+ FTP_STATE
+ nsFtpState::R_cwd() {
+     if (mResponseCode/100 == 2) {
+-        if (mAction == PUT)
++        switch (mAction) {
++          case PUT:
+             return FTP_S_STOR;
+-        
+-        return FTP_S_LIST;
++          case DEL:
++            return FTP_S_DELE;
++          case MKDIR:
++            return FTP_S_MKD;
++          case RMDIR:
++            return FTP_S_RMD;
++          case RENAME:
++            return FTP_S_RNFR;
++          default:
++            return FTP_S_LIST;
++        }
+     }
+     
+     return FTP_ERROR;
+@@ -1354,6 +1454,15 @@
+         port = ((PRInt32) (p0<<8)) + p1;
+     }
++
++    if (mAction == DEL) 
++        return FTP_S_DELE;
++    if (mAction == MKDIR)
++        return FTP_S_MKD;
++    if (mAction == RMDIR)
++        return FTP_S_RMD;
++    if (mAction == RENAME)
++        return FTP_S_RNFR;
+     PRBool newDataConn = PR_TRUE;
+     if (mDataTransport) {
+@@ -1604,11 +1713,12 @@
+     nsresult rv;
+     nsCAutoString path;
+-    nsCOMPtr<nsIURL> url = do_QueryInterface(mChannel->URI());
++    mURI = mChannel->URI();
++    nsCOMPtr<nsIURL> url = do_QueryInterface(mURI);
+     if (url) {
+         rv = url->GetFilePath(path);
+     } else {
+-        rv = mChannel->URI()->GetPath(path);
++        rv = mURI->GetPath(path);
+     }
+     if (NS_FAILED(rv))
+         return rv;
+@@ -2217,3 +2327,123 @@
+         free(p);
+     return rv;
+ }
++
++nsresult
++nsFtpState::SingleAbsolutePathCommand(FTP_ACTION aAction)
++{
++    NS_ASSERTION(mAction == aAction, "Wrong state to be here");
++    
++    nsCOMPtr<nsIURL> url = do_QueryInterface(mURI);
++    NS_ASSERTION(url, "I thought you were a nsStandardURL");
++
++    nsCAutoString str;
++    str.Append(mPwd);
++    str.Append(mPath);
++
++    NS_ASSERTION(!str.IsEmpty(), "What does it mean to deal with a empty path");
++
++    if (mServerType == FTP_VMS_TYPE)
++        ConvertFilespecToVMS(str);
++
++    NS_UnescapeURL(str);
++    switch(aAction) {
++      case DEL:
++        str.Insert("DELE ", 0);
++        break;
++      case MKDIR:
++        str.Insert("MKD ", 0);
++        break;
++      case RMDIR:
++        str.Insert("RMD ", 0);
++        break;
++      case RENAME:
++        str.Insert("RNFR ", 0);
++        break;
++      default:
++        // we never hit this
++        break;
++    }
++    str.Append(CRLF);
++
++    return SendFTPCommand(str);
++}
++
++
++nsresult
++nsFtpState::S_dele() {
++    return SingleAbsolutePathCommand(DEL);
++}
++
++FTP_STATE
++nsFtpState::R_dele() {
++    if (mResponseCode/100 == 2) {
++        //(DONE)
++        mNextState = FTP_COMPLETE;
++        return FTP_COMPLETE;
++    }
++
++   return FTP_ERROR;
++}
++
++nsresult
++nsFtpState::S_mkd() {
++  return SingleAbsolutePathCommand(MKDIR);
++}
++
++FTP_STATE
++nsFtpState::R_mkd() {
++   return R_dele();
++}
++
++nsresult
++nsFtpState::S_rmd() {
++    return SingleAbsolutePathCommand(RMDIR);
++}
++
++FTP_STATE
++nsFtpState::R_rmd() {
++   return R_dele();
++}
++
++nsresult
++nsFtpState::S_rnfr() {
++    return SingleAbsolutePathCommand(RENAME);
++}
++
++FTP_STATE
++nsFtpState::R_rnfr() {
++   if (mResponseCode/100 > 3)
++     return FTP_ERROR;
++
++   return FTP_S_RNTO;
++}
++
++nsresult
++nsFtpState::S_rnto() {
++    nsCAutoString sizeBuf;
++    mNewURI->GetPath(sizeBuf);
++
++    NS_UnescapeURL(sizeBuf);
++ 
++    sizeBuf.Insert(mPwd,0);
++
++    if (mServerType == FTP_VMS_TYPE)
++      ConvertFilespecToVMS(sizeBuf);
++    sizeBuf.Insert("RNTO ",0);
++    sizeBuf.Append(CRLF);
++
++    return SendFTPCommand(sizeBuf);
++}
++
++FTP_STATE
++nsFtpState::R_rnto() {
++    if (mResponseCode/100 == 2) {
++        //(DONE)
++        mNextState = FTP_COMPLETE;
++        // the renaming went well, let's update the channel's URI
++        mChannel->SetURI(mNewURI);
++        return FTP_COMPLETE;
++    }
++
++   return FTP_ERROR;
++}
+diff -r 51249e968f24 netwerk/protocol/ftp/src/nsFtpConnectionThread.h
+--- a/netwerk/protocol/ftp/src/nsFtpConnectionThread.h Mon Nov 24 11:36:44 2008 +0100
++++ b/netwerk/protocol/ftp/src/nsFtpConnectionThread.h Wed Jan 14 18:15:50 2009 +0100
+@@ -104,11 +104,16 @@
+     FTP_S_STOR, FTP_R_STOR,
+     FTP_S_LIST, FTP_R_LIST,
+     FTP_S_PASV, FTP_R_PASV,
+-    FTP_S_PWD,  FTP_R_PWD
+-} FTP_STATE;
++    FTP_S_PWD,  FTP_R_PWD,
++    FTP_S_DELE, FTP_R_DELE,
++    FTP_S_MKD,  FTP_R_MKD,
++    FTP_S_RMD,  FTP_R_RMD,
++    FTP_S_RNFR, FTP_R_RNFR,
++    FTP_S_RNTO, FTP_R_RNTO}
++FTP_STATE;
+ // higher level ftp actions
+-typedef enum _FTP_ACTION {GET, PUT} FTP_ACTION;
++typedef enum _FTP_ACTION {GET, PUT, DEL, MKDIR, RMDIR, RENAME} FTP_ACTION;
+ class nsFtpChannel;
+@@ -143,6 +148,29 @@
+     nsFtpState();
+     nsresult Init(nsFtpChannel *channel);
++    inline void ScheduleForFileDeletion(PRBool aEnabled) {
++      if (aEnabled)
++        mAction = DEL;
++    }
++    
++    inline void ScheduleForDirCreation(PRBool aEnabled) {
++      if (aEnabled)
++        mAction = MKDIR;
++    }
++
++    inline void ScheduleForDirRemoval(PRBool aEnabled) {
++      if (aEnabled)
++        mAction = RMDIR;
++    }
++
++    inline void ScheduleForRenaming(PRBool aEnabled, nsIURI * aNewURI) {
++      if (aEnabled)
++      {
++        mAction = RENAME;
++        mNewURI = aNewURI;
++      }
++    }
++
+ protected:
+     // Notification from nsBaseContentStream::AsyncWait
+     virtual void OnCallbackPending();
+@@ -169,6 +197,14 @@
+     nsresult        S_stor(); FTP_STATE       R_stor();
+     nsresult        S_pasv(); FTP_STATE       R_pasv();
+     nsresult        S_pwd();  FTP_STATE       R_pwd();
++
++    nsresult        S_dele(); FTP_STATE       R_dele();
++    nsresult        S_mkd();  FTP_STATE       R_mkd();
++    nsresult        S_rmd();  FTP_STATE       R_rmd();
++
++    nsresult        S_rnfr(); FTP_STATE       R_rnfr();
++    nsresult        S_rnto(); FTP_STATE       R_rnto();
++
+     // END: STATE METHODS
+     ///////////////////////////////////
+@@ -186,6 +222,7 @@
+     nsresult BuildStreamConverter(nsIStreamListener** convertStreamListener);
+     nsresult SetContentType();
+     nsresult ConvertUTF8PathToCharset(const nsACString &aCharset);
++    nsresult SingleAbsolutePathCommand(FTP_ACTION aAction);
+     /**
+      * This method is called to kick-off the FTP state machine.  mState is
+@@ -271,10 +308,13 @@
+     nsresult            mInternalError; // represents internal state errors
+         // ****** URI vars
++    nsCOMPtr<nsIURI>       mURI; 
+     PRInt32                mPort;       // the port to connect to
+     nsString               mFilename;   // url filename (if any)
+     nsCString              mPath;       // the url's path
+     nsCString              mPwd;        // login Path
++
++    nsCOMPtr<nsIURI>       mNewURI;     // the requested new path if we rename
+         // ****** other vars
+     nsCOMPtr<nsITransport>        mDataTransport;
diff --git a/config/version.txt b/config/version.txt
new file mode 100644 (file)
index 0000000..49d5957
--- /dev/null
@@ -0,0 +1 @@
+0.1
diff --git a/confvars.sh b/confvars.sh
new file mode 100644 (file)
index 0000000..fdcedba
--- /dev/null
@@ -0,0 +1,51 @@
+#! /bin/sh
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla Build System
+#
+# The Initial Developer of the Original Code is
+# Ben Turner <mozilla@songbirdnest.com>
+#
+# Portions created by the Initial Developer are Copyright (C) 2007
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+MOZ_APP_NAME=bluegriffon
+MOZ_APP_DISPLAYNAME=BlueGriffon
+MOZ_APP_VERSION=`cat $topsrcdir/$MOZ_BUILD_APP/config/version.txt`
+
+#MOZ_ENABLE_LIBXUL=1
+MOZ_NO_XPCOM_OBSOLETE=1
+MOZ_UPDATER=1
+MOZ_INSTALLER=1
+MOZ_STANDALONE_COMPOSER=1
+MOZ_NO_ACTIVEX_SUPPORT=1
+MOZ_ACTIVEX_SCRIPTING_SUPPORT=
+MOZ_JAVAXPCOM=
+MOZ_CRASHREPORTER=
diff --git a/doc/BUILD.txt b/doc/BUILD.txt
new file mode 100644 (file)
index 0000000..6ff3a3b
--- /dev/null
@@ -0,0 +1,39 @@
+How to build BlueGriffon
+------------------------
+
+- Install all tools needed to build BlueGriffon. Read http://developer.mozilla.org/en/Build_Documentation
+
+- Get the sources of XulRunner (Mozilla trunk)
+
+  - download : http://developer.mozilla.org/en/Mozilla_Source_Code_(HTTP%2f%2fFTP)
+  - or with Mercurial : http://developer.mozilla.org/en/Mozilla_Source_Code_(Mercurial)
+
+  You should have a src/ directory which contains all files.
+
+
+- Get sources of BlueGriffon, and install it into a bluegriffon/ directory inside the src/ directory of mozilla
+
+   cd src/
+   svn checkout http://sources.disruptive-innovations.com/bluegriffon/trunk  bluegriffon
+
+- copy one of the bluegriffon/config/mozconfig.* file to the src/ directory, and rename it to .mozconfig
+
+  example, on Linux : cp bluegriffon/config/mozconfig.linux .mozconfig
+
+- edit the .mozconfig file: you may have to change some options, according to your configuration
+  See http://developer.mozilla.org/en/Configuring_Build_Options
+
+- In the src/ directory, run
+    make -f client.mk build
+
+- if you didn't touch MOZ_OBJDIR content in the .mozconfig file,
+  then you should have a binaries-opt directory. Go into it or go into the directory
+  you indicates into MOZ_OBJDIR variable.
+
+cd binaries-opt
+
+- then go into the dist/bin/ directory and launch 
+
+cd dist/bin/
+./bluegriffon
+
diff --git a/doc/bg.png b/doc/bg.png
new file mode 100644 (file)
index 0000000..dd9320f
Binary files /dev/null and b/doc/bg.png differ
diff --git a/doc/colorPicker.html b/doc/colorPicker.html
new file mode 100644 (file)
index 0000000..0c40231
--- /dev/null
@@ -0,0 +1,382 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+   <meta http-equiv="content-type"
+         content="text/html; charset=us-ascii" />
+
+   <title>Color Picker</title>
+   <link rel="stylesheet"
+         href="doc.css"
+         type="text/css" />
+</head>
+
+<body>
+   <div class="header">
+      Composer: developers
+   </div>
+
+   <div id="navBar">
+      <a href="index.html">Index</a> &gt; <a href=
+      "colorPicker.html">ColorPickerHelper</a>
+   </div>
+
+   <h1>Color Picker</h1>
+
+   <p><img style=
+   "margin-left: 1em; width: 232px; height: 206px; float: right;"
+        alt="Color picker"
+        src="colorPicker.png" />Composer has a helper for simple
+        and convenient usage of its new color picker inside a
+        sidebar or extension. This helper allows to create
+        persistent color objects that carry information for a given
+        system color, for example the foreground color, the page's
+        background color, table cells' background color and so
+        on.</p>
+
+   <p style="clear: both;">The object is</p>
+   <pre><span class="objectName">ColorPickerHelper</span>
+   
+  <span class="methodName">newPersistentColorObject:</span> function(aColorObjectId)
+  <span class="methodName">cleanPersistentColorObject</span>: function(aColorObjectId)
+  <span class="methodName">getCurrentColor</span>: function(aColorObjectId)
+  <span class="methodName">setLastPickedColor</span>: function(aColorObjectId, aColor)
+  <span class="methodName">isCancelled</span>: function(aColorObjectId)
+  <span class="methodName">openColorPicker</span>: function(aColorObjectId, aWindowTitle, aShowTransparency)</pre>
+
+   <ol class="readonly"
+       id="mozToc">
+      <!--mozToc h2 1-->
+
+      <li><a href="#mozTocId73209">Create a new persistent color
+      object</a></li>
+
+      <li><a href="#mozTocId303492">Delete a persistent color
+      object</a></li>
+
+      <li><a href="#mozTocId464951">Retrieve the selected color in
+      a color object</a></li>
+
+      <li><a href="#mozTocId299067">Set the last picked color for a
+      given color object</a></li>
+
+      <li><a href="#mozTocId400897">Show the color picker</a></li>
+
+      <li><a href="#mozTocId400897">Check if the color picker was
+      cancelled</a></li>
+
+      <li><a href="#mozTocId303457">Example</a></li>
+   </ol>
+
+   <h2><a class="mozTocH2"
+      name="mozTocId73209"
+      id="mozTocId73209"></a>Create a new persistent color
+      object</h2>
+
+   <div class="section">
+      <table style="text-align: left;"
+             class="methodTable"
+             border="1"
+             cellpadding="2"
+             cellspacing="2">
+         <tbody>
+            <tr>
+               <th>Method name</th>
+
+               <td><code>newPersistentColorObject</code></td>
+            </tr>
+
+            <tr>
+               <th>Parameters</th>
+
+               <td>
+                  <ol>
+                     <li><code>aColorObjectId</code>, a unique
+                     string identifying the color object</li>
+                  </ol>
+               </td>
+            </tr>
+
+            <tr>
+               <th>Return value</th>
+
+               <td><code>null</code> in case of error or failure,
+               the color object otherwise</td>
+            </tr>
+         </tbody>
+      </table>
+
+      <p>List of predefined color object identifiers:</p>
+
+      <ul>
+         <li>"<code>TextColor</code>" : color of the text</li>
+
+         <li>"<code>PageBackgroundColor</code>" : background color
+         of the document</li>
+
+         <li>"<code>TableBackgroundColor</code>" : background of a
+         table</li>
+
+         <li>"<code>TableCellBackgroundColor</code>" : background
+         of a table cell</li>
+
+         <li>"<code>BorderColor</code>" : color of a border or
+         outline applied to an element</li>
+      </ul>
+   </div>
+
+   <h2><a class="mozTocH2"
+      name="mozTocId303492"
+      id="mozTocId303492"></a>Delete a persistent color object</h2>
+
+   <div class="section">
+      <table class="methodTable"
+             style="text-align: left;"
+             border="1"
+             cellpadding="2"
+             cellspacing="2">
+         <tbody>
+            <tr>
+               <th>Method name</th>
+
+               <td><code>cleanPersistentColorObject</code></td>
+            </tr>
+
+            <tr>
+               <th>Parameters</th>
+
+               <td>
+                  <ol>
+                     <li><code>aColorObjectId</code>, a unique
+                     string identifying the color object</li>
+                  </ol>
+               </td>
+            </tr>
+
+            <tr>
+               <th>Return value</th>
+
+               <td><code><span style=
+               "font-family: Arial,Helvetica,sans-serif;">no return
+               value</span></code></td>
+            </tr>
+         </tbody>
+      </table>
+   </div>
+
+   <h2><a class="mozTocH2"
+      name="mozTocId464951"
+      id="mozTocId464951"></a>Retrieve the selected color in a
+      color object</h2>
+
+   <div class="section">
+      <table style="text-align: left;"
+             class="methodTable"
+             border="1"
+             cellpadding="2"
+             cellspacing="2">
+         <tbody>
+            <tr>
+               <th>Method name</th>
+
+               <td><code>getCurrentColor</code></td>
+            </tr>
+
+            <tr>
+               <th>Parameters</th>
+
+               <td>
+                  <ol>
+                     <li><code>aColorObjectId</code>, a unique
+                     string identifying the color object</li>
+                  </ol>
+               </td>
+            </tr>
+
+            <tr>
+               <th>Return value</th>
+
+               <td><code>null</code> in case of error or failure
+               (for instance if the corresponding color object does
+               not exist), the selected color in the corresponding
+               color object otherwise</td>
+            </tr>
+         </tbody>
+      </table>
+   </div>
+
+   <h2><a class="mozTocH2"
+      name="mozTocId299067"
+      id="mozTocId299067"></a>Set the last picked color for a given
+      color object</h2>
+
+   <div class="section">
+      <table class="methodTable"
+             style="text-align: left;"
+             border="1"
+             cellpadding="2"
+             cellspacing="2">
+         <tbody>
+            <tr>
+               <th>Method name</th>
+
+               <td><code>setLastPickedColor</code></td>
+            </tr>
+
+            <tr>
+               <th>Parameters</th>
+
+               <td>
+                  <ol>
+                     <li><code>aColorObjectId</code>, a unique
+                     string identifying the color object</li>
+
+                     <li><code>aColor</code>, a color (see the
+                     <a href=
+                     "http://www.w3.org/TR/1998/REC-CSS2-19980512/syndata.html#color-units">
+                     CSS definition of a color</a>)</li>
+                  </ol>
+               </td>
+            </tr>
+
+            <tr>
+               <th>Return value</th>
+
+               <td><code>null</code> in case of error or failure,
+               the color <code>aColor</code> otherwise</td>
+            </tr>
+         </tbody>
+      </table>
+   </div>
+
+   <h2><a class="mozTocH2"
+      name="mozTocId400897"
+      id="mozTocId400897"></a>Show the color picker</h2>
+
+   <div class="section">
+      <table class="methodTable"
+             style="text-align: left;"
+             border="1"
+             cellpadding="2"
+             cellspacing="2">
+         <tbody>
+            <tr>
+               <th>Method name</th>
+
+               <td><code>openColorPicker</code></td>
+            </tr>
+
+            <tr>
+               <th>Parameters</th>
+
+               <td>
+                  <ol>
+                     <li><code>aColorObjectId</code>, a unique
+                     string identifying the color object ; if the
+                     color object for this identifier does not
+                     already exist, a new color object is created
+                     for that identifier</li>
+
+                     <li>
+                     <code>aWindowTitle</code><code><span style="font-family: Arial,Helvetica,sans-serif;">,</span></code>
+                     a title for the color picker dialog</li>
+
+                     <li><code>aShowTransparency</code>, a boolean
+                     being true if the checkbox allowing to set the
+                     color "transparent" has to be shown (for CSS
+                     backgrounds for instance)</li>
+                  </ol>
+               </td>
+            </tr>
+
+            <tr>
+               <th>Return value</th>
+
+               <td><code>null</code> in case of error or failure,
+               the color object otherwise</td>
+            </tr>
+         </tbody>
+      </table>
+
+      <p>It is possible to check if the color picker was closed by
+      the user on a Cancel action using the following method:</p>
+   </div>
+
+   <h2><a class="mozTocH2"
+      name="mozTocId400897"
+      id="mozTocId400897"></a>Check if the color picker was
+      cancelled</h2>
+
+   <div class="section">
+      <table class="methodTable"
+             style="text-align: left;"
+             border="1"
+             cellpadding="2"
+             cellspacing="2">
+         <tbody>
+            <tr>
+               <th>Method name</th>
+
+               <td><code>isCancelled</code></td>
+            </tr>
+
+            <tr>
+               <th>Parameters</th>
+
+               <td>
+                  <ol>
+                     <li><code>aColorObjectId</code>, a unique
+                     string identifying the color object</li>
+                  </ol>
+               </td>
+            </tr>
+
+            <tr>
+               <th>Return value</th>
+
+               <td><code><span style=
+               "font-family: Arial,Helvetica,sans-serif;">returns a
+               boolean is the last color picked shown for the color
+               object identifier was cancelled ; if there is no
+               color object for this identifier, an exception
+               NS_ERROR_NULL_POINTER is thrown</span></code></td>
+            </tr>
+         </tbody>
+      </table>
+   </div>
+
+   <h2><a class="mozTocH2"
+      name="mozTocId303457"
+      id="mozTocId303457"></a>Example</h2>
+
+   <div class="section">
+      <pre>const kTEMPLATE_COLUMN_BG_COLOR = <code>"TemplateColumnBgColor";</code>
+var colorHelper = window.top.ColorPickerHelper;
+if (colorHelper.<code>newPersistentColorObject(</code>kTEMPLATE_COLUMN_BG_COLOR<code>))
+{
+  colorHelper.openColorPicker( </code>kTEMPLATE_COLUMN_BG_COLOR<code>,
+                               "Set the background color for the column",
+                               true);
+  if (colorHelper.isCancelled(</code>kTEMPLATE_COLUMN_BG_COLOR))
+    return;
+  SetTemplateBgColor(colorHelper.getCurrentColor(kTEMPLATE_COLUMN_BG_COLOR));
+}</pre>
+   </div>
+   <hr style="width: 100%; height: 2px;" />
+
+   <h4>History</h4>
+
+   <div class="section history">
+      <dl>
+         <dt>Last Update:</dt>
+
+         <dd>2007-oct-26, 12:53pm CEST</dd>
+
+         <dt>2007-oct-26, 12:53pm CEST</dt>
+
+         <dd>initial revision (dglazman)</dd>
+      </dl>
+   </div>
+</body>
+</html>
diff --git a/doc/colorPicker.png b/doc/colorPicker.png
new file mode 100644 (file)
index 0000000..65d4f5b
Binary files /dev/null and b/doc/colorPicker.png differ
diff --git a/doc/doc.css b/doc/doc.css
new file mode 100644 (file)
index 0000000..f783544
--- /dev/null
@@ -0,0 +1,47 @@
+/* Generated by CaScadeS, a stylesheet editor for Mozilla Composer */
+
+  pre { border-style: groove;
+    border-width: 1px;
+    padding: 0.5em;
+    background-color: rgb(218, 218, 174);
+    margin-left: 2em;
+    margin-right: 2em;
+    }
+
+  .methodTable { margin-left: 2em;
+    margin-right: 2em;
+    border-collapse: collapse;
+    font-size: smaller;
+    }
+
+  body { font-family: Arial,Helvetica,sans-serif;
+    }
+
+  div.section { margin-left: 2em;
+    padding-left: 1em;
+    border-left-style: outset;
+    }
+
+  .methodTable th { width: 125px;
+    }
+
+  .objectName { font-weight: bold;
+    font-size: larger;
+    text-decoration: underline;
+    }
+
+  .methodName { font-weight: bold;
+    }
+
+  .history dt { font-weight: bold;
+    }
+
+  .header { font-size: 50px;
+    line-height: 100px;
+    color: rgb(207, 207, 0);
+    background-image: url(bg.png);
+    background-attachment: fixed;
+    background-repeat: no-repeat;
+    padding-left: 1em;
+    }
+
diff --git a/doc/index.html b/doc/index.html
new file mode 100644 (file)
index 0000000..dd58e87
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+   <meta http-equiv="content-type"\r
+         content="text/html; charset=us-ascii" />\r
+\r
+   <title>Developing a sidebar for Composer</title>\r
+   <link rel="stylesheet"\r
+         href="doc.css"\r
+         type="text/css" />\r
+</head>\r
+\r
+<body>\r
+   <div class="header">\r
+      Composer: developers\r
+   </div>\r
+\r
+   <div id="navBar">\r
+      <a href="index.html">Index</a>\r
+   </div><br />\r
+\r
+   <dl>\r
+      <dt>C</dt>\r
+\r
+      <dd><a href="colorPicker.html">Color Picker</a></dd>\r
+\r
+      <dt>D</dt>\r
+\r
+      <dd><a href="sidebarcontent.html">Developing a sidebar for\r
+      Composer</a></dd>\r
+   </dl>\r
+   <hr style="width: 100%; height: 2px;" />\r
+\r
+   <h4>History</h4>\r
+\r
+   <div class="section history">\r
+      <dl>\r
+         <dt>Last Update:</dt>\r
+\r
+         <dd>2007-oct-29, 10:18am CEST</dd>\r
+\r
+         <dt>2007-oct-29, 10:18am CEST</dt>\r
+\r
+         <dd>initial revision (dglazman)</dd>\r
+      </dl>\r
+   </div>\r
+</body>\r
+</html>\r
diff --git a/doc/notifiers.html b/doc/notifiers.html
new file mode 100644 (file)
index 0000000..cd0a8ba
--- /dev/null
@@ -0,0 +1,202 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+\r
+<head>\r
+  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />\r
+\r
+  \r
+  <title>notifiers</title>\r
+\r
+</head>\r
+\r
+<body>\r
+<h3>Notifiers</h3>\r
+<p>BlueGriffon provides extension developers with an object allowing to register listeners for any kind of events. This object is NotifierUtils:</p>\r
+<h4>Register a BlueGriffon event callback</h4>\r
+<table style="text-align: left;" class="methodTable" border="1" cellpadding="2" cellspacing="2">\r
+\r
+         <tbody>\r
+\r
+            <tr>\r
+\r
+               <th>Method name</th>\r
+\r
+\r
+               <td><code>addNotifierCallback</code></td>\r
+\r
+            </tr>\r
+\r
+\r
+            <tr>\r
+\r
+               <th>Parameters</th>\r
+\r
+\r
+               <td>\r
+                  \r
+      <ol>\r
+        <li><code>aEventName,</code> a string representing the event</li>\r
+        <li><code>aListener</code>, a function</li>\r
+        <li><code>aContext</code>, an object to be user in the listener as local context</li>\r
+      </ol>\r
+\r
+               </td>\r
+\r
+            </tr>\r
+\r
+\r
+            <tr>\r
+\r
+               <th>Return value</th>\r
+\r
+\r
+               <td>no return value ; dumps an error on console if listener cannot be registered</td>\r
+\r
+            </tr>\r
+\r
+         \r
+  </tbody>\r
+      \r
+</table>\r
+<h4>Dispatch a BlueGriffon event</h4>\r
+<p>To dispatch an event use the following method:</p>\r
+<table style="text-align: left;" class="methodTable" border="1" cellpadding="2" cellspacing="2">\r
+\r
+         <tbody>\r
+\r
+            <tr>\r
+\r
+               <th>Method name</th>\r
+\r
+\r
+               <td><code>notify</code></td>\r
+\r
+            </tr>\r
+\r
+\r
+            <tr>\r
+\r
+               <th>Parameters</th>\r
+\r
+\r
+               <td>\r
+                  \r
+      <ol>\r
+        <li><code>aEventName,</code> a string representing the event<span style="font-family: monospace;"></span></li>\r
+        <li>all other arguments will be passed to the listeners for this event</li>\r
+      </ol>\r
+\r
+               </td>\r
+\r
+            </tr>\r
+\r
+\r
+            <tr>\r
+\r
+               <th>Return value</th>\r
+\r
+\r
+               <td>no return value ; dumps an error on console if no event of that name is registered or if a listener throws an exception</td>\r
+\r
+            </tr>\r
+\r
+         \r
+  </tbody>\r
+      \r
+</table>\r
+<h4>Remove&nbsp;a BlueGriffon event callback</h4>\r
+<table style="text-align: left;" class="methodTable" border="1" cellpadding="2" cellspacing="2">\r
+\r
+         <tbody>\r
+\r
+            <tr>\r
+\r
+               <th>Method name</th>\r
+\r
+\r
+               <td><code>removeNotifierCallback</code></td>\r
+\r
+            </tr>\r
+\r
+\r
+            <tr>\r
+\r
+               <th>Parameters</th>\r
+\r
+\r
+               <td>\r
+                  \r
+      <ol>\r
+        <li><code>aEventName,</code> a string representing the event</li>\r
+        <li><code>aListener</code>, a function</li>\r
+      </ol>\r
+\r
+               </td>\r
+\r
+            </tr>\r
+\r
+\r
+            <tr>\r
+\r
+               <th>Return value</th>\r
+\r
+\r
+               <td>no return value ; dumps an error on console if\r
+no event of that name is registered or if &nbsp;that listener is not\r
+registered as callback for that event name</td>\r
+\r
+            </tr>\r
+\r
+         \r
+  </tbody>\r
+      \r
+</table>\r
+<h4>Clean all BlueGriffon event callback for a given event name</h4>\r
+<table style="text-align: left;" class="methodTable" border="1" cellpadding="2" cellspacing="2">\r
+\r
+         <tbody>\r
+\r
+            <tr>\r
+\r
+               <th>Method name</th>\r
+\r
+\r
+               <td><code>cleanNotifier</code></td>\r
+\r
+            </tr>\r
+\r
+\r
+            <tr>\r
+\r
+               <th>Parameters</th>\r
+\r
+\r
+               <td>\r
+                  \r
+      <ol>\r
+        <li><code>aEventName,</code> a string representing the event<span style="font-family: monospace;"></span></li>\r
+      </ol>\r
+\r
+               </td>\r
+\r
+            </tr>\r
+\r
+\r
+            <tr>\r
+\r
+               <th>Return value</th>\r
+\r
+\r
+               <td>no return value</td>\r
+\r
+            </tr>\r
+\r
+         \r
+  </tbody>\r
+      \r
+</table>\r
+<h4>Example</h4>\r
+<pre>var EditorScrolledNotifier =&nbsp; {<br />&nbsp; startup: function EditorScrolledNotifier_startup()<br />&nbsp; {<br />&nbsp;&nbsp;&nbsp; var tabeditor = document.getElementById("tabeditor");<br />&nbsp;&nbsp;&nbsp; tabeditor.addEventListener("scroll", this.onEditorScrolled, false);<br />&nbsp; },<br /><br />&nbsp; shutdown: function EditorScrolledNotifier_shutdown()<br />&nbsp; {<br />&nbsp;&nbsp;&nbsp; var tabeditor = document.getElementById("tabeditor");<br />&nbsp;&nbsp;&nbsp; tabeditor.removeEventListener("scroll", this.onEditorScrolled, false);<br />&nbsp; },<br /><br />&nbsp; onEditorScrolled: function EditorScrolledNotifier_onEditorScrolled(aEvent)<br />&nbsp; {<br />&nbsp;&nbsp;&nbsp; NotifierUtils.notify("editorScrolled", EditorUtils.getCurrentEditorElement());<br />&nbsp; }<br />};<br /><br />EditorScrolledNotifier .startup();<br /><br />.....<br /><br />&nbsp; &lt;constructor&gt;<br />&nbsp;&nbsp;&nbsp; &lt;![CDATA[<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NotifierUtils.addNotifierCallback("editorScrolled", this.onEditorScrolled, this);<br />&nbsp;&nbsp;&nbsp; ]]&gt;<br />&nbsp; &lt;/constructor&gt;<br /><br />&nbsp; &lt;destructor&gt;<br />&nbsp;&nbsp;&nbsp; &lt;![CDATA[<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NotifierUtils.removeNotifierCallback("editorScrolled", this.onEditorScrolled);<br />&nbsp;&nbsp;&nbsp; ]]&gt;<br />&nbsp; &lt;/destructor&gt;<br /><br />&nbsp; &lt;method name="onEditorScrolled"&gt;<br />&nbsp;&nbsp;&nbsp; &lt;param name="aEditor"/&gt;<br />&nbsp;&nbsp;&nbsp; &lt;body&gt;<br />&nbsp;&nbsp;&nbsp; &lt;![CDATA[<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var elt = this.getSelectionForEditor(aEditor);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.refreshRulerForElement(elt);<br />&nbsp;&nbsp;&nbsp; ]]&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/body&gt;<br />&nbsp; &lt;/method&gt;</pre>\r
+</body>\r
+\r
+</html>\r
diff --git a/doc/sidebarcontent.html b/doc/sidebarcontent.html
new file mode 100644 (file)
index 0000000..bc9788f
--- /dev/null
@@ -0,0 +1,100 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\r
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+   <meta http-equiv="content-type"\r
+         content="text/html; charset=us-ascii" />\r
+\r
+   <title>Developing a sidebar for Composer</title>\r
+   <link rel="stylesheet"\r
+         href="doc.css"\r
+         type="text/css" />\r
+</head>\r
+\r
+<body>\r
+   <div class="header">\r
+      Composer: developers\r
+   </div>\r
+\r
+   <div id="navBar">\r
+      <a href="index.html">Index</a> &gt; <a href=\r
+      "sidebarcontent.html">Developing a sidebar for Composer</a>\r
+   </div>\r
+\r
+   <h1>Developing a sidebar for Composer</h1>\r
+\r
+   <p>To offer new sidebar content to Composer users, you have to\r
+   distribute your application as an installable extension to\r
+   Composer, a *.xpi file.</p>\r
+\r
+   <p>The application id for Composer is\r
+   <code>{8fa6f1b4-7ed3-4895-bac6-01f1cc206ab3}</code> .</p>\r
+\r
+   <ol class="readonly"\r
+       id="mozToc">\r
+      <!--mozToc h2 1 h3 2-->\r
+\r
+      <li><a href="#mozTocId287073">How to register a new\r
+      sidebar</a></li>\r
+\r
+      <li><a href="#mozTocId290755">Make your sidebar observe\r
+      editor events</a></li>\r
+   </ol>\r
+\r
+   <h2><a class="mozTocH2"\r
+      name="mozTocId287073"\r
+      id="mozTocId287073"></a>How to register a new sidebar</h2>\r
+\r
+   <p>Your extension should add elements to\r
+   chrome://bluegriffon/content/xul/bluegriffon.xul through a XUL overlay\r
+   :</p>\r
+\r
+   <ul>\r
+      <li>append a new <code>sidebaritem</code> element to\r
+      <code>&lt;sidebaritems id="sidebaritems"&gt;</code></li>\r
+\r
+      <li>that element must have an ID, unique in the ID name space\r
+      of bluegriffon.xul</li>\r
+\r
+      <li>that element must have a <code>name</code> attribute,\r
+      representing your sidebar content ; that sidebar should be a\r
+      NAME ; it is recommended that the ID and that attribute have\r
+      the same value</li>\r
+\r
+      <li>that element must have a <code>src</code> attribute,\r
+      containing the URL of the document to be shown in your\r
+      sidebar content; this is typically going to be a chrome URL\r
+      in your XPI</li>\r
+\r
+      <li>that element can have a&nbsp;<code>title</code>\r
+      containing a (possibly localized) string representing the\r
+      sidebar item. That string will be used in the sidebar to list\r
+      the available sidebar items or title the visible sidebar\r
+      items. If absent, the value of the <code>name</code>\r
+      attribute is used.</li>\r
+   </ul>\r
+\r
+   <h2><a class="mozTocH2"\r
+      name="mozTocId290755"\r
+      id="mozTocId290755"></a>Make your sidebar observe editor\r
+      events</h2>\r
+\r
+   <p>TBD</p>\r
+   <hr style="width: 100%; height: 2px;" />\r
+\r
+   <h4>History</h4>\r
+\r
+   <div class="section history">\r
+      <dl>\r
+         <dt>Last Update:</dt>\r
+\r
+         <dd>2007-oct-29, 10:18am CEST</dd>\r
+\r
+         <dt>2007-oct-29, 10:18am CEST</dt>\r
+\r
+         <dd>initial revision (dglazman)</dd>\r
+      </dl>\r
+   </div>\r
+</body>\r
+</html>\r
diff --git a/extensions/Makefile.in b/extensions/Makefile.in
new file mode 100644 (file)
index 0000000..3bf6e6c
--- /dev/null
@@ -0,0 +1,48 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla.org
+#
+# The Initial Developer of the Original Code is
+# Netscape Communications Corporation.
+# Portions created by the Initial Developer are Copyright (C) 2003
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Daniel Glazman (daniel@glazman.org), on behalf of Lindows.com
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH          = ../..
+topsrcdir      = @top_srcdir@
+srcdir = @srcdir@
+VPATH          = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+DIRS += diavolo jQuery
+
+include $(topsrcdir)/config/rules.mk
+
diff --git a/extensions/diavolo/Makefile.in b/extensions/diavolo/Makefile.in
new file mode 100644 (file)
index 0000000..562bb8b
--- /dev/null
@@ -0,0 +1,46 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla.org
+#
+# The Initial Developer of the Original Code is
+# Netscape Communications Corporation.
+# Portions created by the Initial Developer are Copyright (C) 2003
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Daniel Glazman (daniel@glazman.org), on behalf of Lindows.com
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH          = ../../..
+topsrcdir      = @top_srcdir@
+srcdir = @srcdir@
+VPATH          = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+include $(topsrcdir)/config/rules.mk
+
diff --git a/extensions/diavolo/content/EditorOverride.css b/extensions/diavolo/content/EditorOverride.css
new file mode 100644 (file)
index 0000000..fa10797
--- /dev/null
@@ -0,0 +1,96 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998-1999
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+*|* {
+  -moz-user-modify: read-write;
+}
+
+/* Styles to alter look of things in the Editor content window 
+ *  that should NOT be removed when we display in completely WYSIWYG 
+ *  "Browser Preview" mode.
+ *  Anything that should change, like appearance of table borders
+ *  and Named Anchors, should be placed in EditorContent.css instead of here.
+*/
+
+/* Primary cursor is text I-beam */
+
+::-moz-canvas, a:link {
+  cursor: text;
+}
+
+/* Use default arrow over objects with size that 
+   are selected when clicked on.
+   Override the browser's pointer cursor over links
+*/
+
+img, img[usemap], area,
+object, object[usemap], 
+applet, hr, button, input, isindex, textarea, select,
+a:link img, a:visited img, a:active img,
+a[name]:-moz-only-whitespace {
+  cursor: default;
+}
+
+a:visited, a:active {
+  cursor: text;
+}
+
+/* Prevent clicking on links from going to link */
+a:link img, a:visited img {
+  -moz-user-input: none;
+}
+
+/* We suppress user/author's prefs for link underline, 
+   so we must set explicitly. This isn't good!
+*/
+a:link {
+  text-decoration: underline -moz-anchor-decoration;
+  color: -moz-hyperlinktext;
+}
+
+/* XXX Still need a better way of blocking other events to these widgets */
+select {
+  -moz-user-select: none !important;
+  -moz-user-input: auto !important;
+  -moz-user-focus: none !important;
+}
+
+option {
+  -moz-user-select: none !important;
+}
+
+
diff --git a/extensions/diavolo/content/codecompletion.js b/extensions/diavolo/content/codecompletion.js
new file mode 100644 (file)
index 0000000..17e291c
--- /dev/null
@@ -0,0 +1,408 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Diavolo.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006-2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+function DiavoloCodeCompletionEngine(aEditorCore)
+{
+  this.init(aEditorCore);
+}
+
+DiavoloCodeCompletionEngine.prototype = {
+
+  kIOServiceCID      : "@mozilla.org/network/io-service;1",
+  kFileInputStreamCID: "@mozilla.org/network/file-input-stream;1",
+  kScriptableInputCID: "@mozilla.org/scriptableinputstream;1",
+  kUnicodeConverterCID: "@mozilla.org/intl/scriptableunicodeconverter",
+
+  nsIIOService            : Components.interfaces.nsIIOService,
+  nsIFileInputStream      : Components.interfaces.nsIFileInputStream,
+  nsIScriptableInputStream: Components.interfaces.nsIScriptableInputStream,
+  nsIScriptableUnicodeConverter: Components.interfaces.nsIScriptableUnicodeConverter,
+
+  mCodeCompletionGrammar: null,
+
+  mEditorCore: null,
+  mDocument: null,
+
+  mLastPopupNode: null,
+
+  convertToUnicode: function(aCharset, aSrc )
+  {
+    // http://lxr.mozilla.org/mozilla/source/intl/uconv/idl/nsIScriptableUConv.idl
+    var unicodeConverter = Components.classes[this.kUnicodeConverterCID]
+                             .createInstance(this.nsIScriptableUnicodeConverter);
+    unicodeConverter.charset = aCharset;
+    return unicodeConverter.ConvertToUnicode( aSrc );
+  },
+
+  init: function init(aEditorCore)
+  {
+    this.mEditorCore = aEditorCore;
+    this.mDocument = aEditorCore.document;
+
+    // Get the grammar file
+    var urlspec="chrome://diavolo/content/cssCompletion.xml";
+    var ioService = Components.classes[this.kIOServiceCID]
+                      .getService(this.nsIIOService);
+
+    // Get the baseURI
+    var url = ioService.newURI(urlspec, null, null);
+
+    var chann = ioService.newChannelFromURI(url);
+    var inputStream = Components.classes[this.kFileInputStreamCID]
+                        .createInstance(this.nsIFileInputStream);
+    var sis = Components.classes[this.kScriptableInputCID]
+                .createInstance(this.nsIScriptableInputStream);
+
+    sis.init(chann.open());
+    var str = sis.read(sis.available());
+    sis.close();
+    str = this.convertToUnicode("UTF-8",str);
+    var parser = new DOMParser();
+    this.mCodeCompletionGrammar = parser.parseFromString(str, "text/xml");
+    
+    this.mDocument.addEventListener("keyup",
+       function(){ var scope = this; return function(event) { scope.interceptKeyUp(event)} }.apply(this),
+       true);
+    this.mDocument.addEventListener("keypress",
+       function(){ var scope = this; return function(event) { scope.interceptKeyPress(event)} }.apply(this),
+       true);
+
+    var selection;
+    try {
+        selection = this.mEditorCore.selection;
+        if (!selection) return null;
+    }
+    catch (e) { return null; }
+
+    selection.QueryInterface(Components.interfaces.nsISelectionPrivate);
+    selection.addSelectionListener(this);
+  },
+
+  shutdown: function shutdown()
+  {
+    this.mDocument.removeEventListener("keyup",
+       function(){ var scope = this; return function(event) { scope.interceptKeyUp(event)} }.apply(this),
+       true);
+    this.mDocument.removeEventListener("keypress",
+       function(){ var scope = this; return function(event) { scope.interceptKeyPress(event)} }.apply(this),
+       true);
+    var selection;
+    try {
+        selection = this.mEditorCore.selection;
+        if (!selection) return null;
+    }
+    catch (e) { return null; }
+
+    selection.QueryInterface(Components.interfaces.nsISelectionPrivate);
+    selection.removeSelectionListener(this);  },
+
+  interceptKeyPress: function interceptKeyPress(aEvent)
+  {
+    var keyCode  = aEvent.keyCode;
+    var charCode = aEvent.charCode;
+    var altKey   = aEvent.altKey;
+    var ctrlKey  = aEvent.ctrlKey;
+    var metaKey  = aEvent.metaKey;
+    var shiftKey = aEvent.shiftKey;
+    var selection = this.mEditorCore.selection;
+    
+    var node = selection.anchorNode;
+    if (node && node.nodeType == Node.TEXT_NODE)
+    {
+      var value = node.data;
+
+      var p = node.parentNode.wrappedJSObject;
+      var type = p.className;
+      var completion = this.mCodeCompletionGrammar.getElementById(type);
+
+      if (!completion)
+      {
+        if (this.mLastPopupNode && this.mLastPopupNode.hidePopup)
+          this.mLastPopupNode.hidePopup();
+        this.mLastPopupNode = null;
+        return;
+      }
+
+      var choices = p.mChoices;
+      var selectedIndex = choices.selectedIndex;
+      var choicesLength = choices.length;
+      var preventDefault = false;
+
+      switch (keyCode)
+      {
+        case KeyEvent.DOM_VK_UP:
+          if (!p.isVisible)
+            return;
+          if (selectedIndex)
+            choices.selectedIndex = selectedIndex - 1;
+          preventDefault = true;
+          break;
+        case KeyEvent.DOM_VK_DOWN:
+          if (!p.isVisible)
+            return;
+          if (selectedIndex < choicesLength - 1)
+            choices.selectedIndex = selectedIndex + 1;
+          preventDefault = true;
+          break;
+        case KeyEvent.DOM_VK_PAGE_UP:
+          if (!p.isVisible)
+            return;
+          choices.selectedIndex = Math.max(selectedIndex - 4, 0);
+          preventDefault = true;
+          break;
+        case KeyEvent.DOM_VK_PAGE_DOWN:
+          if (!p.isVisible)
+            return;
+          choices.selectedIndex = Math.min(selectedIndex + 4, choicesLength - 1);
+          preventDefault = true;
+          break;
+        case KeyEvent.DOM_VK_ESCAPE:
+          if (!p.isVisible)
+            return;
+          p.hidePopup();
+          this.mLastPopupNode = null;
+          preventDefault = true;
+          break;
+
+        case KeyEvent.DOM_VK_TAB:
+          if (!p.isVisible || selectedIndex == -1)
+            return;
+          this.mEditorCore.beginTransaction();
+          this.mEditorCore.deleteNode(node);
+          this.mEditorCore instanceof Components.interfaces.nsIPlaintextEditor;
+          this.mEditorCore.insertText(choices.value);
+          this.mEditorCore.endTransaction();
+          p.hidePopup();
+          preventDefault = true;
+          break;
+        default:
+          break;
+      }
+      if (preventDefault)
+        aEvent.preventDefault();
+    }
+  },
+
+  interceptKeyUp: function interceptKeyPress(aEvent)
+  {
+    var keyCode  = aEvent.keyCode;
+    var charCode = aEvent.charCode;
+    var altKey   = aEvent.altKey;
+    var ctrlKey  = aEvent.ctrlKey;
+    var metaKey  = aEvent.metaKey;
+    var shiftKey = aEvent.shiftKey;
+    var selection = this.mEditorCore.selection;
+
+    switch (keyCode)
+    {
+      case KeyEvent.DOM_VK_UP:
+      case KeyEvent.DOM_VK_DOWN:
+      case KeyEvent.DOM_VK_LEFT:
+      case KeyEvent.DOM_VK_RIGHT:
+      case KeyEvent.DOM_VK_PAGE_UP:
+      case KeyEvent.DOM_VK_PAGE_DOWN:
+      case KeyEvent.DOM_VK_HOME:
+      case KeyEvent.DOM_VK_END:
+      case KeyEvent.DOM_VK_ESCAPE:
+      case KeyEvent.DOM_VK_TAB:
+        break;
+
+      default:
+        var node = selection.anchorNode;
+        var forcePopup = (keyCode == 32 &&
+                          ctrlKey && !shiftKey && !altKey && !metaKey);
+        if (node && node.nodeType == Node.TEXT_NODE)
+          this.showCompletionPopup(node, selection, forcePopup)
+        break;
+    }
+  },
+
+  showCompletionPopup: function showCompletionPopup(node, selection, forcePopup)
+  {
+    var p = node.parentNode.wrappedJSObject;
+    var choices = p.mChoices;
+    var value = node.data;
+
+    if (this.mLastPopupNode == p)
+    {
+      var options = choices.options;
+      var length = value.length;
+      var foundMatch = -1;
+      for (var i = 0 ; i < options.length; i++)
+      {
+        var text = options.item(i).text;
+        if (text == value) 
+        {
+          p.hidePopup();
+          this.mLastPopupNode = null;
+          return;
+        }
+        else if (value < text && foundMatch == -1) 
+        {
+          // select the closest suggestion
+          foundMatch = i;
+        }
+      }
+      if (foundMatch != -1)
+        choices.selectedIndex = foundMatch;
+
+      return;
+    }
+
+    var selectedIndex = choices.selectedIndex;
+    var choicesLength = choices.length;
+
+    var type = p.className;
+    var completion = this.mCodeCompletionGrammar.getElementById(type);
+
+    if (!completion)
+    {
+      if (this.mLastPopupNode && this.mLastPopupNode.hidePopup)
+        this.mLastPopupNode.hidePopup();
+      this.mLastPopupNode = null;
+      return;
+    }
+
+    var suggestionsArray = [];
+
+    var contexts = completion.getElementsByTagName("context");
+    if (contexts && contexts.length) 
+    {
+      var c = contexts.item(0);
+
+      var always = completion.getElementsByTagName("always");
+      if (always && always.length)
+      {
+        if (this.pushSuggestions(always[0], suggestionsArray, value) && !forcePopup)
+          return;
+      }
+
+      var name = c.getAttribute("name");
+      var n = p.previousSibling;
+      while (n && n.getAttribute("class") != name) 
+        n = n.previousSibling;
+      if (n) 
+      {
+        var origin = n.textContent;
+        var groups = completion.getElementsByTagName("suggestiongroup");
+        var suggestionGroupFound = false;
+        for (var i = 0; i < groups.length; i++)
+        {
+          var g = groups[i];
+          if (g.getAttribute("forcontext") == origin)
+          {
+            // match !!!
+            completion = g;
+            suggestionGroupFound = true;
+            break;
+          }
+        }
+        if (!suggestionGroupFound)
+          completion = null;
+      }
+    }
+
+    if (completion)
+    {
+      var suggestions = completion.getElementsByTagName("suggestion");
+      if (this.pushSuggestions(completion, suggestionsArray, value) && !forcePopup)
+        return;
+    }
+    else if (!suggestionsArray.length)
+      return;
+
+    suggestionsArray.sort();
+    var suggestionFound = false;
+    for (var i = 0; i < suggestionsArray.length; i++)
+    {
+      p.addChoice(suggestionsArray[i], p.mChoices);
+       if (!suggestionFound && value < suggestionsArray[i])
+       {
+               choices.selectedIndex = i;
+               suggestionFound = true;
+       }
+    }
+
+    p.showPopup(this.completeToken, this);
+
+    this.mLastPopupNode = p;
+  },
+
+
+  completeToken: function completeToken(aElt, aValue, aScope)
+  {
+    aScope.mEditorCore.beginTransaction();
+    aScope.mEditorCore.deleteNode(aElt);
+    aScope.mEditorCore instanceof Components.interfaces.nsIPlaintextEditor;
+    aScope.mEditorCore.insertText(aValue);
+    aScope.mEditorCore.endTransaction();
+  },
+
+  notifySelectionChanged: function notifySelectionChanged(aDocument, aSelection, aReason)
+  {
+    if (aSelection.isCollapsed) 
+    {
+      var node = aSelection.anchorNode;
+      if (node.nodeType == Node.TEXT_NODE &&
+          node.parentNode.nodeName.toLowerCase() == "span")
+      {
+        var p = node.parentNode;
+        if (this.mLastPopupNode && this.mLastPopupNode != p)
+        {
+          if (this.mLastPopupNode.hidePopup)
+            this.mLastPopupNode.hidePopup();
+          this.mLastPopupNode = null;
+        }
+        //this.showCompletionPopup(node, aSelection);
+      }
+
+    }
+  },
+
+  pushSuggestions: function pushSuggestions(aElt, aSuggestionsArray, aValue)
+  {
+    var suggestions = aElt.getElementsByTagName("suggestion");
+    for (var i = 0; i < suggestions.length; i++)
+    {
+      var item = suggestions.item(i).getAttribute("value");
+      if (item == aValue)
+        return true;
+      aSuggestionsArray.push(item);
+    }
+    return false;
+  }
+};
diff --git a/extensions/diavolo/content/completionPopup.xml b/extensions/diavolo/content/completionPopup.xml
new file mode 100644 (file)
index 0000000..d478772
--- /dev/null
@@ -0,0 +1,115 @@
+<?xml version="1.0"?>
+
+
+<bindings id="completionBindings"
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:html="http://www.w3.org/1999/xhtml"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
+
+  <binding id="popup">
+    <content>
+      <html:div anonid="ChoicePopup" style="z-index: 2; display: none; position: absolute; color: black; top: 1.2em"><html:select size="4" style="-moz-user-select: none !important;background-color: #e0e0e0; font-size: smaller" /></html:div>
+      <children/>
+    </content>
+    <implementation>
+
+      <field name="mSelectionSetter">null</field>
+      <field name="mDiavoloCodeCompletionEngine">null</field>
+      <field name="mVisible">false</field>
+
+      <property name="mPopup">
+        <getter>
+        <![CDATA[
+          return document.getAnonymousElementByAttribute(this, "anonid", "ChoicePopup");
+        ]]>
+        </getter>
+      </property>
+      
+      <property name="isVisible">
+        <getter>
+        <![CDATA[
+          return this.mVisible;
+        ]]>
+        </getter>
+      </property>
+
+      <property name="mChoices">
+        <getter>
+        <![CDATA[
+          return this.mPopup.firstChild;
+        ]]>
+        </getter>
+      </property>
+
+      <method name="addChoice">
+        <parameter name="name"/>
+        <parameter name="parent"/>
+        <body>
+          <![CDATA[
+            var choice = document.createElement("option");
+            choice.innerHTML = name;
+            choice.onclick = this.selectChoice;
+            parent.appendChild(choice);
+          ]]>
+        </body>
+      </method>
+
+      <method name="hidePopup">
+        <body>
+          <![CDATA[
+            var choices = this.mChoices;
+            for (var j = choices.length - 1; j >= 0; j--)
+              choices.remove(j);
+            this.mPopup.style.display = "none";
+            this.mVisible = false;
+          ]]>
+        </body>
+      </method>
+
+      <method name="selectChoice">
+        <parameter name="event"/>
+        <body>
+          <![CDATA[
+            var property = event.target.value;
+            var boundElt = this.parentNode.parentNode.parentNode;
+            //boundElt.innerHTML = property;
+
+            if (boundElt.mSelectionSetter)
+              boundElt.mSelectionSetter(boundElt.firstChild, property, boundElt.mDiavoloCodeCompletionEngine);
+            boundElt.hidePopup();
+            //boundElt.focus();
+          ]]>
+        </body>
+      </method>
+      <method name="showPopup">
+        <parameter name="aSelectionSetter"/>
+        <parameter name="aDiavoloCodeCompletionEngine"/>
+        <body>
+          <![CDATA[
+            this.mSelectionSetter = aSelectionSetter;
+            this.mDiavoloCodeCompletionEngine = aDiavoloCodeCompletionEngine;
+            var x = 0
+            var y = 15;
+            var n = this;
+            while (n)
+            {
+              x += n.offsetLeft;
+              y += n.offsetTop;
+              n  = n.offsetParent;
+            }
+
+            this.mPopup.style.setProperty("left", x + "px", "");
+            this.mPopup.style.setProperty("top", y + "px", "");
+
+            this.mPopup.style.display = "block";
+            this.mVisible = true;
+          ]]>
+        </body>
+      </method>
+    </implementation>
+
+  </binding>
+
+
+</bindings>
diff --git a/extensions/diavolo/content/css.css b/extensions/diavolo/content/css.css
new file mode 100644 (file)
index 0000000..14c2942
--- /dev/null
@@ -0,0 +1,97 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Diavolo.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006-2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+body {
+  background-color: white;
+}
+
+.CDO,.CDC {
+  font-style: italic;
+}
+
+.property {
+  color: red;
+}
+.value {
+  color: #0000cd;
+}
+
+.begin-pseudo-selector,
+.colon-pseudo,
+.end-pseudo-selector,
+.pseudo-selector {
+  color: #336666;
+}
+.funcnotation-value { color: #cc33cc; }
+
+.class-selector,
+.period-class {
+  color: #ff6600;
+}
+
+.attribute-name { color: #666666; }
+.attribute-value,.value[token="STRING"] { color : #cc33cc; }
+.openbracket, .closebracket { color: #666666; }
+
+.type { color: #993200; }
+.namespace { color: #993399 }
+.ID { color: #772100; }
+
+.comment { color: #009900; }
+
+.media { color: rgb(204, 102, 0); }
+
+.at-media,
+.at-charset,
+.at-fontface,
+.at-import,
+.at-namespace,
+.at-page { color: rgb(51, 102, 102); }
+
+.url-call, .function-call { color: #009900; }
+.url-value[token="STRING"] { color : #cc33cc; }
+.url-value[token="URL"] { color : #aa11aa; }
+
+*[error="true"] {
+  border-bottom: red dotted 1px;
+}
+
+.importance { font-style: italic; }
+
+.SKIPUNTIL { border-bottom: lime dotted 1px; }
+
diff --git a/extensions/diavolo/content/css.xml b/extensions/diavolo/content/css.xml
new file mode 100644 (file)
index 0000000..c264ecc
--- /dev/null
@@ -0,0 +1,999 @@
+<?xml version="1.0"?>\r
+\r
+<!-- ***** BEGIN LICENSE BLOCK *****\r
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1\r
+   -\r
+   - The contents of this file are subject to the Mozilla Public License Version\r
+   - 1.1 (the "License"); you may not use this file except in compliance with\r
+   - the License. You may obtain a copy of the License at\r
+   - http://www.mozilla.org/MPL/\r
+   -\r
+   - Software distributed under the License is distributed on an "AS IS" basis,\r
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\r
+   - for the specific language governing rights and limitations under the\r
+   - License.\r
+   -\r
+   - The Original Code is Diavolo.\r
+   -\r
+   - The Initial Developer of the Original Code is\r
+   - Disruptive Innovations SARL\r
+   - Portions created by the Initial Developer are Copyright (C) 2006-2008\r
+   - the Initial Developer. All Rights Reserved.\r
+   -\r
+   - Contributor(s):\r
+   -   Daniel Glazman (glazman@disruptive-innovations.com), Original author\r
+   -\r
+   - Alternatively, the contents of this file may be used under the terms of\r
+   - either the GNU General Public License Version 2 or later (the "GPL"), or\r
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),\r
+   - in which case the provisions of the GPL or the LGPL are applicable instead\r
+   - of those above. If you wish to allow use of your version of this file only\r
+   - under the terms of either the GPL or the LGPL, and not to allow others to\r
+   - use your version of this file under the terms of the MPL, indicate your\r
+   - decision by deleting the provisions above and replace them with the notice\r
+   - and other provisions required by the LGPL or the GPL. If you do not delete\r
+   - the provisions above, a recipient may use your version of this file under\r
+   - the terms of any one of the MPL, the GPL or the LGPL.\r
+   -\r
+   - ***** END LICENSE BLOCK ***** -->\r
+\r
+<!DOCTYPE grammar [\r
+ <!ATTLIST context id ID #IMPLIED>\r
+]>\r
+\r
+<grammar name="css">\r
+  <deftokens>\r
+    <deftoken regexp="s" name="whitespace"/>\r
+    <deftoken regexp="comment" name="comment"/>\r
+\r
+    <deftoken string="=" name="EQUALS"/>\r
+    <deftoken string="~=" name="INCLUDES"/>\r
+    <deftoken string="|=" name="DASHMATCH"/>\r
+    <deftoken string="*=" name="STARMATCH"/>\r
+    <deftoken string="^=" name="CIRCMATCH"/>\r
+    <deftoken string="$=" name="DOLLARMATCH"/>\r
+    <deftoken string="{" name="LBRACE"/>\r
+    <deftoken string="+" name="PLUS"/>\r
+    <deftoken string=">" name="GREATER"/>\r
+    <deftoken string="~" name="TILDA"/>\r
+    <deftoken string="," name="COMMA"/>\r
+    <deftoken string="!" name="BANG"/>\r
+    <deftoken string="}" name="RBRACE"/>\r
+    <deftoken string=";" name="SEMICOLON"/>\r
+    <deftoken string="|" name="VBAR"/>\r
+    <deftoken string="." name="PERIOD"/>\r
+    <deftoken string=":" name="COLON"/>\r
+    <deftoken string="[" name="LBRACKET"/>\r
+    <deftoken string="]" name="RBRACKET"/>\r
+    <deftoken string=")" name="RPAREN"/>\r
+    <deftoken string="/" name="SLASH"/>\r
+    <deftoken string="*" name="STAR"/>\r
+\r
+    <deftoken string="important" name="IMPORTANT"/>\r
+\r
+    <deftoken regexp="dimension" name="DIMENSION"/>\r
+    <deftoken regexp="percentage" name="PERCENTAGE"/>\r
+    <deftoken regexp="num" name="NUMBER"/>\r
+    <deftoken regexp="hashmatch" name="HASHMATCH"/>\r
+    <deftoken regexp="atimport" name="IMPORT_SYM"/>\r
+    <deftoken regexp="atpage" name="PAGE_SYM"/>\r
+    <deftoken regexp="atmedia" name="MEDIA_SYM"/>\r
+    <deftoken regexp="atcharset" name="CHARSET_SYM"/>\r
+    <deftoken regexp="atnamespace" name="NAMESPACE_SYM"/>\r
+    <deftoken regexp="atfontface" name="FONTFACE_SYM"/>\r
+    <deftoken regexp="function" name="FUNCTION"/>\r
+    <deftoken regexp="ident" name="IDENT"/>\r
+    <deftoken string="&lt;!--" name="CDO"/>\r
+    <deftoken string="--&gt;" name="CDC"/>\r
+    <deftoken regexp="string" name="STRING"/>\r
+    <deftoken string="url(" name="URI"/>\r
+    <deftoken regexp="url" name="URL"/>\r
+    <deftoken regexp="invalid" name="INVALID"/>\r
+  </deftokens>\r
+  <regexps>\r
+    <option type="case-insensitive"/>\r
+\r
+    <regexp name="s" value="[ \t\r\n\f\u00a0]+"/>\r
+    <regexp name="h" value="[0-9a-f]"/>\r
+    <regexp name="nonascii" value="[\200-\377]"/>\r
+    <regexp name="unicode" value="\\{h}{1,6}(\r\n|[ \t\r\n\f])?"/>\r
+    <regexp name="escape" value="{unicode}|\\[^\r\n\f0-9a-f]"/>\r
+    <regexp name="nmstart" value="[_a-z]|{nonascii}|{escape}"/>\r
+    <regexp name="nmchar" value="[_a-z0-9-]|{nonascii}|{escape}"/>\r
+    <regexp name="string1" value='\"([^\n\r\f\\"]|\\{nl}|{escape})*\"'/>\r
+    <regexp name="string2" value="\'([^\n\r\f\\']|\\{nl}|{escape})*\'"/>\r
+    <regexp name="invalid1" value='\"([^\n\r\f\\"]|\\{nl}|{escape})*'/>\r
+    <regexp name="invalid2" value="\'([^\n\r\f\\']|\\{nl}|{escape})*"/>\r
+\r
+    <regexp name="comment" value="\/\*[^*]*\*+([^/*][^*]*\*+)*\/"/>\r
+    <regexp name="ident" value="-?{nmstart}{nmchar}*"/>\r
+    <regexp name="name" value="{nmchar}+"/>\r
+    <regexp name="num" value="[0-9]*\.[0-9]+|[0-9]+"/>\r
+    <regexp name="string" value="{string1}|{string2}"/>\r
+    <regexp name="invalid" value="{invalid1}|{invalid2}"/>\r
+    <regexp name="url" value="([!#$%&amp;*-~]|{nonascii}|{escape})+"/>\r
+    <regexp name="w" value="{s}?"/>\r
+    <regexp name="nl" value="\n|\r\n|\r|\f"/>\r
+\r
+    <regexp name="A" value="a|\\0{0,4}(41|61)(\r\n|[ \t\r\n\f])?"/>\r
+    <regexp name="C" value="c|\\0{0,4}(43|63)(\r\n|[ \t\r\n\f])?"/>\r
+    <regexp name="D" value="d|\\0{0,4}(44|64)(\r\n|[ \t\r\n\f])?"/>\r
+    <regexp name="E" value="e|\\0{0,4}(45|65)(\r\n|[ \t\r\n\f])?"/>\r
+    <regexp name="F" value="f|\\0{0,4}(46|66)(\r\n|[ \t\r\n\f])?"/>\r
+    <regexp name="G" value="g|\\0{0,4}(47|67)(\r\n|[ \t\r\n\f])?|\\g"/>\r
+    <regexp name="H" value="h|\\0{0,4}(48|68)(\r\n|[ \t\r\n\f])?|\\h"/>\r
+    <regexp name="I" value="i|\\0{0,4}(49|69)(\r\n|[ \t\r\n\f])?|\\i"/>\r
+    <regexp name="J" value="j|\\0{0,4}(4a|6a)(\r\n|[ \t\r\n\f])?|\\i"/>\r
+    <regexp name="K" value="k|\\0{0,4}(4b|6b)(\r\n|[ \t\r\n\f])?|\\k"/>\r
+    <regexp name="L" value="l|\\0{0,4}(4c|6c)(\r\n|[ \t\r\n\f])?|\\k"/>\r
+    <regexp name="M" value="m|\\0{0,4}(4d|6d)(\r\n|[ \t\r\n\f])?|\\m"/>\r
+    <regexp name="N" value="n|\\0{0,4}(4e|6e)(\r\n|[ \t\r\n\f])?|\\n"/>\r
+    <regexp name="O" value="o|\\0{0,4}(4f|6f)(\r\n|[ \t\r\n\f])?|\\o"/>\r
+    <regexp name="P" value="p|\\0{0,4}(50|70)(\r\n|[ \t\r\n\f])?|\\p"/>\r
+    <regexp name="Q" value="q|\\0{0,4}(51|71)(\r\n|[ \t\r\n\f])?|\\q"/>\r
+    <regexp name="R" value="r|\\0{0,4}(52|72)(\r\n|[ \t\r\n\f])?|\\r"/>\r
+    <regexp name="S" value="s|\\0{0,4}(53|73)(\r\n|[ \t\r\n\f])?|\\s"/>\r
+    <regexp name="T" value="t|\\0{0,4}(54|74)(\r\n|[ \t\r\n\f])?|\\t"/>\r
+    <regexp name="U" value="u|\\0{0,4}(55|75)(\r\n|[ \t\r\n\f])?|\\u"/>\r
+    <regexp name="V" value="v|\\0{0,4}(56|76)(\r\n|[ \t\r\n\f])?|\\v"/>\r
+    <regexp name="W" value="w|\\0{0,4}(57|77)(\r\n|[ \t\r\n\f])?|\\w"/>\r
+    <regexp name="X" value="x|\\0{0,4}(58|78)(\r\n|[ \t\r\n\f])?|\\x"/>\r
+    <regexp name="Y" value="y|\\0{0,4}(59|79)(\r\n|[ \t\r\n\f])?|\\y"/>\r
+    <regexp name="Z" value="z|\\0{0,4}(5a|7a)(\r\n|[ \t\r\n\f])?|\\z"/>\r
+\r
+\r
+    <regexp name="hashmatch" value="#{name}"/>\r
+\r
+    <regexp name="atimport" value="@{I}{M}{P}{O}{R}{T}"/>\r
+    <regexp name="atpage"   value="@{P}{A}{G}{E}"/>\r
+    <regexp name="atmedia"  value="@{M}{E}{D}{I}{A}"/>\r
+    <regexp name="atcharset" value="@{C}{H}{A}{R}{S}{E}{T}"/>\r
+    <regexp name="atnamespace" value="@{N}{A}{M}{E}{S}{P}{A}{C}{E}"/>\r
+    <regexp name="atfontface" value="@{F}{O}{N}{T}-{F}{A}{C}{E}"/>\r
+\r
+    <regexp name="dimension" value="(\+|\-)?{num}{ident}"/>\r
+\r
+    <regexp name="percentage" value="(\+|\-)?{num}%"/>\r
+\r
+    <regexp name="function" value="{ident}\("/>\r
+  </regexps>\r
+\r
+  <styleset>\r
+    <style role="CDO"                   value="font-style: italic"/>\r
+    <style role="CDC"                   value="font-style: italic"/>\r
+    <style role="property"              value="color: red"/>\r
+    <style role="value"                 value="color: #0000cd"/>\r
+    <style role="begin-pseudo-selector" value="color: #336666"/>\r
+    <style role="end-pseudo-selector"   value="color: #336666"/>\r
+    <style role="colon-pseudo"          value="color: #336666"/>\r
+    <style role="pseudo-selector"       value="color: #336666"/>\r
+    <style role="funcnotation-value"    value="color: #cc33cc"/>\r
+    <style role="class-selector"        value="color: #ff6600"/>\r
+    <style role="period-class"          value="color: #ff6600"/>\r
+    <style role="attribute-name"        value="color: #666666"/>\r
+    <style role="attribute-value"       value="color: #cc33cc"/>\r
+    <style role="value" forToken="STRING" value="color: #cc33cc"/>\r
+    <style role="attribute-name"        value="color: #666666"/>\r
+    <style role="open-bracket"          value="color: #666666"/>\r
+    <style role="close-bracket"         value="color: #666666"/>\r
+    <style role="type"                  value="color: #993200"/>\r
+    <style role="namespace"             value="color: #993399"/>\r
+    <style role="ID"                    value="color: #772100"/>\r
+    <style role="comment"               value="color: #009900"/>\r
+    <style role="media"                 value="color: rgb(204,102,0)"/>\r
+    <style role="at-media"              value="color: rgb(51,102,102)"/>\r
+    <style role="at-charset"            value="color: rgb(51,102,102)"/>\r
+    <style role="at-fontface"           value="color: rgb(51,102,102)"/>\r
+    <style role="at-import"             value="color: rgb(51,102,102)"/>\r
+    <style role="at-namespace"          value="color: rgb(51,102,102)"/>\r
+    <style role="at-page"               value="color: rgb(51,102,102)"/>\r
+    <style role="url-call"              value="color: #009900"/>\r
+    <style role="function-call"         value="color: #009900"/>\r
+    <style role="url-value" forToken="STRING" value="color: #cc33cc"/>\r
+    <style role="url-value" forToken="URL"    value="color: #aa11aa"/>\r
+    <style role="importance"            value="font-style: italic"/>\r
+  \r
+    <errorstyle     value="border-bottom: red dotted 1px;"/>\r
+    <skipuntilstyle value="border-bottom: lime dotted 1px;"/>\r
+  </styleset>\r
+\r
+  <contexts>\r
+    \r
+    <!-- START OF STYLESHEET, CDO STILL POSSIBLE -->\r
+    <context id="INIT0">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="CDO" role="cdo" expecting="INIT"/>\r
+\r
+      <token type="CHARSET_SYM"                 role="at-charset"   expecting="charset-rule-descriptor"/>\r
+      <token type="IMPORT_SYM"                  role="at-import"    expecting="import-rule-descriptor"/>\r
+      <token type="MEDIA_SYM"                   role="at-media"     expecting="media-rule-descriptor"/>\r
+      <token type="NAMESPACE_SYM"               role="at-namespace" expecting="namespace-rule-descriptor"/>\r
+      <token type="PAGE_SYM"                    role="at-page"      expecting="page-rule-descriptor"/>\r
+      <token type="FONTFACE_SYM"                role="at-fontface"  expecting="fontFace-rule-descriptor"/>\r
+    \r
+      <token type="IDENT"  lookahead="VBAR"     role="namespace" expecting="namespace-separator"/>\r
+      <token type="IDENT"                       role="type"      expecting="selector-context1"/>\r
+      <token type="STAR"   lookahead="VBAR"     role="namespace" expecting="namespace-separator"/>\r
+      <token type="STAR"                        role="type"      expecting="selector-context1"/>\r
+      <token type="VBAR"                        role="vbar"      expecting="element-name"/>\r
+      <token type="COLON"                       role="colon-pseudo" expecting="pseudo-selector"/>\r
+      <token type="PERIOD"                      role="period-class" expecting="class-selector"/>\r
+      <token type="LBRACKET"                    role="openbracket" expecting="attribute-selector"/>\r
+      <token type="HASHMATCH"                   role="ID"        expecting="selector-context1"/>\r
+    </context>\r
+    \r
+    <!-- START OF STYLESHEET, CDO ALREADY FOUND -->\r
+    <context id="INIT">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="CHARSET_SYM"                 role="at-charset"   expecting="charset-rule-descriptor"/>\r
+      <token type="IMPORT_SYM"                  role="at-import"    expecting="import-rule-descriptor"/>\r
+      <token type="MEDIA_SYM"                   role="at-media"     expecting="media-rule-descriptor"/>\r
+      <token type="NAMESPACE_SYM"               role="at-namespace" expecting="namespace-rule-descriptor"/>\r
+      <token type="PAGE_SYM"                    role="at-page"      expecting="page-rule-descriptor"/>\r
+      <token type="FONTFACE_SYM"                role="at-fontface"  expecting="fontFace-rule-descriptor"/>\r
+    \r
+      <token type="IDENT"  lookahead="VBAR"     role="namespace" expecting="namespace-separator"/>\r
+      <token type="IDENT"                       role="type"      expecting="selector-context1"/>\r
+      <token type="STAR"   lookahead="VBAR"     role="namespace" expecting="namespace-separator"/>\r
+      <token type="STAR"                        role="type"      expecting="selector-context1"/>\r
+      <token type="VBAR"                        role="vbar"      expecting="element-name"/>\r
+      <token type="COLON"                       role="colon-pseudo" expecting="pseudo-selector"/>\r
+      <token type="PERIOD"                      role="period-class" expecting="class-selector"/>\r
+      <token type="LBRACKET"                    role="openbracket" expecting="attribute-selector"/>\r
+      <token type="HASHMATCH"                   role="ID"        expecting="selector-context1"/>\r
+    \r
+      <token type="CDC" role="cdc" />\r
+    \r
+    </context>\r
+    \r
+    <!-- @charset at-rule -->\r
+    \r
+    <context id="charset-rule-descriptor">\r
+      <error skipuntil="SEMICOLON" expecting="INIT"/>\r
+       <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="STRING" role="charset" expecting="end-at-rule"/>\r
+    </context>\r
+    \r
+    <context id="end-at-rule">\r
+      <error skipuntil="SEMICOLON" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="SEMICOLON" role="semicolon" expecting="INIT"/>\r
+    </context>\r
+    \r
+    <!-- ============================================= -->\r
+    <!-- IMPORT AT-RULE -->\r
+    <!-- ============================================= -->\r
+    \r
+    <context id="import-rule-descriptor">\r
+      <error skipuntil="SEMICOLON" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="STRING" role="imported-url" expecting="import-rule-part2"/>\r
+      <token type="URI"    role="url-call"     expecting="import-rule-url-value"/>\r
+    </context>\r
+\r
+    <context id="import-rule-url-value">\r
+      <error skipuntil="SEMICOLON" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="STRING" role="url-value" expecting="import-rule-url-rparen"/>\r
+      <token type="URL"    role="url-value" expecting="import-rule-url-rparen"/>\r
+    </context>\r
+\r
+    <context id="import-rule-url-rparen">\r
+      <error skipuntil="SEMICOLON" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="RPAREN" role="url-call" expecting="import-rule-part2"/>\r
+    </context>\r
+\r
+\r
+    <context id="import-rule-part2">\r
+      <error skipuntil="SEMICOLON" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="SEMICOLON" role="semicolon" expecting="INIT"/>\r
+      <token type="IDENT"     role="media" expecting="import-rule-part3"/>\r
+    </context>\r
+\r
+    <context id="import-rule-part3">\r
+      <error skipuntil="SEMICOLON" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="COMMA" role="comma" expecting="import-rule-part2"/>\r
+    </context>\r
+    \r
+    <!-- ============================================= -->\r
+    <!-- NAMESPACE AT-RULE -->\r
+    <!-- ============================================= -->\r
+    \r
+    <context id="namespace-rule-descriptor">\r
+      <error skipuntil="SEMICOLON" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="URI"   role="url-call" expecting="namespace-rule-url-value"/>\r
+      <token type="IDENT" role="namespace" expecting="namespace-rule-context1"/>\r
+    </context>\r
+\r
+    <context id="namespace-rule-url-value">\r
+      <error skipuntil="SEMICOLON" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="STRING"  role="url-value" expecting="namespace-rule-url-rparen"/>\r
+      <token type="URL"     role="url-value" expecting="namespace-rule-url-rparen"/>\r
+    </context>\r
+\r
+    <context id="namespace-rule-url-rparen">\r
+      <error skipuntil="SEMICOLON" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="RPAREN"  role="url-call" expecting="end-at-rule"/>\r
+    </context>\r
+\r
+    <context id="namespace-rule-context1">\r
+      <error skipuntil="SEMICOLON" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="URI"   role="url-call" expecting="namespace-rule-url-value"/>\r
+    </context>\r
+    \r
+    <!-- ============================================= -->\r
+    <!-- PAGE AT-RULE -->\r
+    <!-- ============================================= -->\r
+    \r
+    <context id="page-rule-descriptor">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="IDENT"       role="page-selector" expecting="open-page-block"/>\r
+      <token type="COLON"       role="colon-pseudo"  expecting="page-pseudo"/>\r
+      <token type="LBRACE"      role="openbrace"     expecting="declaration-context1"/>\r
+    </context>\r
+    \r
+    <context id="open-page-block">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="LBRACE" role="openbrace" expecting="declaration-context1"/>\r
+    </context>\r
+    \r
+    <context id="page-pseudo">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="IDENT" role="page-selector" expecting="open-page-block"/>\r
+    </context>\r
+    \r
+    <!-- ============================================= -->\r
+    <!-- FONT-FACE AT-RULE -->\r
+    <!-- ============================================= -->\r
+    \r
+    <context id="fontFace-rule-descriptor">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="LBRACE" role="openbrace" expecting="declaration-context1"/>\r
+    </context>\r
+    \r
+    <!-- ============================================= -->\r
+    <!-- SELECTORS -->\r
+    <!-- ============================================= -->\r
+    \r
+    <context id="namespace-separator">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="VBAR" role="vbar" expecting="element-name"/>\r
+    </context>\r
+    \r
+    <context id="element-name">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="STAR"  role="type" expecting="selector-context1"/>\r
+      <token type="IDENT" role="type"         expecting="selector-context1"/>\r
+    </context>\r
+    \r
+    <context id="pseudo-selector">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <token type="COLON"    role="colon-pseudo"    expecting="pseudo-selector2"/>\r
+      <token type="FUNCTION" role="pseudo-selector" expecting="funcnotation-value2"/>\r
+      <token type="IDENT"    role="pseudo-selector" expecting="selector-context1"/>\r
+    </context>\r
+    \r
+    <context id="pseudo-selector2">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <token type="IDENT"    role="pseudo-selector" expecting="selector-context1"/>\r
+    </context>\r
+    \r
+    <context id="funcnotation-value2">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="RPAREN" role="end-pseudo-selector" expecting="selector-context1"/>\r
+      <token type=""       role="funcnotation-value" expecting="funcnotation-value2"/>\r
+    </context>\r
+    \r
+    <context id="class-selector">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <token type="IDENT" role="class-selector" expecting="selector-context1"/>\r
+    </context>\r
+    \r
+    <context id="attribute-selector">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+\r
+      <token type="IDENT"  lookahead="VBAR"     role="namespace" expecting="attr-namespace-separator"/>\r
+      <token type="IDENT"                       role="attribute-name" expecting="attribute-context1"/>\r
+\r
+      <token type="STAR"   lookahead="VBAR"     role="namespace" expecting="attr-namespace-separator"/>\r
+      <token type="VBAR"                        role="vbar"      expecting="attr-namespace-attrname"/>\r
+    </context>\r
+\r
+    <context id="attr-namespace-separator">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+\r
+      <token type="VBAR" role="vbar" expecting="attr-namespace-attrname"/>\r
+    </context>\r
+\r
+    <context id="attr-namespace-attrname">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+\r
+      <token type="IDENT" role="attribute-name" expecting="attribute-context1"/>\r
+    </context>\r
+\r
+    <context id="attribute-context1">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="RBRACKET"      role="closebracket"       expecting="selector-context1"/>\r
+      <token type="EQUALS"        role="attribute-matching" expecting="attribute-value"/>\r
+      <token type="INCLUDES"      role="attribute-matching" expecting="attribute-value"/>\r
+      <token type="DASHMATCH"     role="attribute-matching" expecting="attribute-value"/>\r
+      <token type="CIRCMATCH"     role="attribute-matching" expecting="attribute-value"/>\r
+      <token type="DOLLARMATCH"   role="attribute-matching" expecting="attribute-value"/>\r
+      <token type="STARMATCH"     role="attribute-matching" expecting="attribute-value"/>\r
+    </context>\r
+    \r
+    <context id="attribute-value">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="IDENT"  role="attribute-value" expecting="end-attribute-selector"/>\r
+      <token type="STRING" role="attribute-value" expecting="end-attribute-selector"/>\r
+    </context>\r
+    \r
+    <context id="end-attribute-selector">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="RBRACKET"  role="closebracket"       expecting="selector-context1"/>\r
+    </context>\r
+    \r
+    <context id="selector-context1">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="comment" />\r
+      </ignore>\r
+    \r
+      <token type="whitespace"                      expecting="selector-context2"/>\r
+      <token type="GREATER"     role="combinator"   expecting="selector-context3"/>\r
+      <token type="PLUS"        role="combinator"   expecting="selector-context3"/>\r
+      <token type="TILDA"       role="combinator"   expecting="selector-context3"/>\r
+    \r
+      <token type="LBRACE"      role="openbrace"    expecting="declaration-context1"/>\r
+      <token type="COMMA"       role="grouping"     expecting="selector-context3"/>\r
+    \r
+      <token type="COLON"       role="colon-pseudo" expecting="pseudo-selector"/>\r
+      <token type="PERIOD"      role="period-class" expecting="class-selector"/>\r
+      <token type="LBRACKET"    role="openbracket"  expecting="attribute-selector"/>\r
+      <token type="HASHMATCH"   role="ID"           expecting="selector-context1"/>\r
+    </context>\r
+    \r
+    <context id="selector-context2">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+    \r
+      <token type="GREATER"     role="combinator"   expecting="selector-context3"/>\r
+      <token type="PLUS"        role="combinator"   expecting="selector-context3"/>\r
+      <token type="TILDA"       role="combinator"   expecting="selector-context3"/>\r
+      <token type="LBRACE"      role="openbrace"    expecting="declaration-context1"/>\r
+    \r
+      <token type="IDENT"  lookahead="VBAR"     role="namespace" expecting="namespace-separator"/>\r
+      <token type="IDENT"                       role="type"      expecting="selector-context1"/>\r
+      <token type="STAR"   lookahead="VBAR"     role="type"      expecting="namespace-separator"/>\r
+      <token type="STAR"                        role="type"      expecting="selector-context1"/>\r
+      <token type="VBAR"                        role="vbar"      expecting="element-name"/>\r
+      <token type="COLON"                       role="colon-pseudo" expecting="pseudo-selector"/>\r
+      <token type="PERIOD"                      role="period-class" expecting="class-selector"/>\r
+      <token type="LBRACKET"                    role="openbracket" expecting="attribute-selector"/>\r
+      <token type="HASHMATCH"                   role="ID"        expecting="selector-context1"/>\r
+    </context>\r
+    \r
+    <context id="selector-context3">\r
+      <error skipuntil="RBRACE" expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+    \r
+      <token type="IDENT"  lookahead="VBAR"     role="namespace" expecting="namespace-separator"/>\r
+      <token type="IDENT"                       role="type"      expecting="selector-context1"/>\r
+      <token type="STAR"   lookahead="VBAR"     role="namespace" expecting="namespace-separator"/>\r
+      <token type="STAR"                        role="type"      expecting="selector-context1"/>\r
+      <token type="VBAR"                        role="vbar"      expecting="element-name"/>\r
+      <token type="COLON"                       role="colon-pseudo" expecting="pseudo-selector"/>\r
+      <token type="PERIOD"                      role="period-class" expecting="class-selector"/>\r
+      <token type="LBRACKET"                    role="openbracket" expecting="attribute-selector"/>\r
+      <token type="HASHMATCH"                   role="ID"        expecting="selector-context1"/>\r
+    </context>\r
+    \r
+    <!-- ============================================= -->\r
+    <!-- DECLARATIONS -->\r
+    <!-- ============================================= -->\r
+    \r
+    <context id="declaration-context1">\r
+      <error skipuntil="SEMICOLON" expecting="declaration-context1"/>\r
+      <error skipuntil="RBRACE"    expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="SEMICOLON"    role="semicolon" expecting="declaration-context1"/>\r
+      <token type="IDENT"        role="property"  expecting="declaration-separator"/>\r
+      <token type="RBRACE"       role="closebrace" expecting="INIT"/>\r
+    </context>\r
+    \r
+    <context id="declaration-separator">\r
+      <error skipuntil="SEMICOLON" expecting="declaration-context1"/>\r
+      <error skipuntil="RBRACE"    expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="COLON"  role="colon" expecting="declaration-value1"/>\r
+    </context>\r
+    \r
+    <context id="declaration-value1">\r
+      <error skipuntil="RBRACE"    expecting="INIT"/>\r
+      <error skipuntil="SEMICOLON" expecting="declaration-context1"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="PERCENTAGE" role="value" expecting="declaration-value2"/>\r
+      <token type="DIMENSION"  role="value" expecting="declaration-value2"/>\r
+      <token type="NUMBER"     role="value" expecting="declaration-value2"/>\r
+      <token type="HASHMATCH"  role="value" expecting="declaration-value2"/>\r
+      <token type="URI"        role="url-call" expecting="declaration-url-value"/>\r
+      <token type="STRING"     role="value" expecting="declaration-value2"/>\r
+      <token type="FUNCTION"   role="function-call" expecting="function-value2"/>\r
+      <token type="IDENT"      role="value" expecting="declaration-value2"/>\r
+    </context>\r
+\r
+    <context id="declaration-url-value">\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="STRING"  role="url-value" expecting="declaration-rule-url-rparen"/>\r
+      <token type="URL"     role="url-value" expecting="declaration-rule-url-rparen"/>\r
+    </context>\r
+\r
+    <context id="declaration-rule-url-rparen">\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="RPAREN"  role="url-call" expecting="declaration-value2"/>\r
+    </context>\r
+    \r
+    <context id="declaration-value2">\r
+      <error skipuntil="RBRACE"    expecting="INIT"/>\r
+      <error skipuntil="SEMICOLON" expecting="declaration-context1"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="SEMICOLON"  role="semicolon" expecting="declaration-context1"/>\r
+      <token type="RBRACE"     role="closebrace" expecting="INIT"/>\r
+    \r
+      <token type="SLASH"      role="slash" expecting="declaration-value1"/>\r
+      <token type="COMMA"      role="valuedelimiter" expecting="declaration-value1"/>\r
+    \r
+      <token type="BANG"       role="bang"  expecting="declaration-importance"/>\r
+    \r
+      <token type="PERCENTAGE" role="value" expecting="declaration-value2"/>\r
+      <token type="DIMENSION"  role="value" expecting="declaration-value2"/>\r
+      <token type="NUMBER"     role="value" expecting="declaration-value2"/>\r
+      <token type="HASHMATCH"  role="value" expecting="declaration-value2"/>\r
+      <token type="URI"        role="url-call" expecting="declaration-url-value"/>\r
+      <token type="STRING"     role="value" expecting="declaration-value2"/>\r
+      <token type="FUNCTION"   role="function-call" expecting="function-value2"/>\r
+      <token type="IDENT"      role="value" expecting="declaration-value2"/>\r
+    </context>\r
+    \r
+    <context id="declaration-importance">\r
+      <error skipuntil="RBRACE"    expecting="INIT"/>\r
+      <error skipuntil="SEMICOLON" expecting="declaration-context1"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+    \r
+      <token type="IMPORTANT" role="importance" expecting="declaration-end"/>\r
+    </context>\r
+    \r
+    <context id="declaration-end">\r
+      <error skipuntil="RBRACE"    expecting="INIT"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+    \r
+      <token type="SEMICOLON"  role="semicolon" expecting="declaration-context1"/>\r
+    </context>\r
+    \r
+    <context id="function-value2">\r
+      <error skipuntil="RBRACE"    expecting="INIT"/>\r
+      <error skipuntil="SEMICOLON" expecting="declaration-context1"/>\r
+      <ignore>\r
+        <type name="whitespace" />\r
+        <type name="comment" />\r
+      </ignore>\r
+      <token type="RPAREN" role="function-call"  expecting="declaration-value2"/>\r
+      <token type=""       role="function-value" expecting="function-value2"/>\r
+    </context>\r
+\r
+  </contexts>\r
+\r
+  <!-- ============================================= -->\r
+  <!-- MEDIA AT-RULE -->\r
+  <!-- ============================================= -->\r
+  \r
+  <context id="media-rule-descriptor">\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="IDENT" role="media" expecting="media-context1"/>\r
+  </context>\r
+  \r
+  <context id="media-context1">\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="LBRACE"    role="openbrace" expecting="style-rule-only"/>\r
+    <token type="COMMA"     role="grouping"  expecting="media-rule-descriptor"/>\r
+  </context>\r
+  \r
+  <context id="style-rule-only">\r
+    <error skipuntil="RBRACE" expecting="style-rule-only"/>\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="IDENT"  lookahead="VBAR"     role="namespace" expecting="M-namespace-separator"/>\r
+    <token type="IDENT"                       role="type"      expecting="M-selector-context1"/>\r
+    <token type="STAR"   lookahead="VBAR"     role="namespace" expecting="M-namespace-separator"/>\r
+    <token type="STAR"                        role="type"      expecting="M-selector-context1"/>\r
+    <token type="VBAR"                        role="vbar"      expecting="M-element-name"/>\r
+    <token type="COLON"                       role="colon-pseudo" expecting="M-pseudo-selector"/>\r
+    <token type="PERIOD"                      role="period-class" expecting="M-class-selector"/>\r
+    <token type="LBRACKET"                    role="openbracket" expecting="M-attribute-selector"/>\r
+    <token type="HASHMATCH"                   role="ID"        expecting="M-selector-context1"/>\r
+  \r
+    <token type="RBRACE"                      role="closebrace" expecting="INIT"/>\r
+  \r
+  </context>\r
+  \r
+  <!-- ============================================= -->\r
+  <!-- SELECTORS IN MEDIA AT-RULE -->\r
+  <!-- ============================================= -->\r
+  \r
+  <context id="M-namespace-separator">\r
+    <error skipuntil="RBRACE" expecting="INIT"/>\r
+    <ignore>\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="VBAR" role="vbar" expecting="M-element-name"/>\r
+  </context>\r
+  \r
+  <context id="M-element-name">\r
+    <error skipuntil="RBRACE" expecting="INIT"/>\r
+    <ignore>\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="STAR"  role="type" expecting="M-selector-context1"/>\r
+    <token type="IDENT" role="type" expecting="M-selector-context1"/>\r
+  </context>\r
+  \r
+  <context id="M-pseudo-selector">\r
+    <error skipuntil="RBRACE" expecting="INIT"/>\r
+    <token type="COLON"    role="colon-pseudo"    expecting="M-pseudo-selector2"/>\r
+    <token type="FUNCTION" role="pseudo-selector" expecting="M-funcnotation-value2"/>\r
+    <token type="IDENT"    role="pseudo-selector" expecting="M-selector-context1"/>\r
+  </context>\r
+  \r
+  <context id="M-pseudo-selector2">\r
+    <error skipuntil="RBRACE" expecting="INIT"/>\r
+    <token type="IDENT"    role="pseudo-selector" expecting="M-selector-context1"/>\r
+  </context>\r
+  \r
+  <context id="M-funcnotation-value2">\r
+    <error skipuntil="RBRACE" expecting="INIT"/>\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="RPAREN"    role="end-pseudo-selector" expecting="M-selector-context2"/>\r
+    <token type=""          role="funcnotation-value"  expecting="M-funcnotation-value"/>\r
+  </context>\r
+  \r
+  <context id="M-class-selector">\r
+    <error skipuntil="RBRACE" expecting="INIT"/>\r
+    <token type="IDENT" role="class-selector" expecting="M-selector-context1"/>\r
+  </context>\r
+  \r
+  <context id="M-attribute-selector">\r
+    <error skipuntil="RBRACE" expecting="INIT"/>\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="IDENT" lookahead="VBAR" role="namespace"      expecting="M-attr-namespace-separator"/>\r
+    <token type="IDENT"                  role="attribute-name" expecting="M-attribute-context1"/>\r
+    <token type="STAR"  lookahead="VBAR" role="namespace"      expecting="M-attr-namespace-separator"/>\r
+    <token type="STAR"                   role="attribute-name" expecting="M-attribute-context1"/>\r
+    <token type="VBAR"                   role="VBAR"           expecting="M-attribute-name"/>\r
+  </context>\r
+  \r
+  <context id="M-attr-namespace-separator">\r
+    <error skipuntil="RBRACE" expecting="INIT"/>\r
+    <token type="VBAR" role="vbar" expecting="M-attribute-name"/>\r
+  </context>\r
+\r
+  <context id="M-attribute-name">\r
+    <error skipuntil="RBRACE" expecting="INIT"/>\r
+    <token type="IDENT" role="attribute-name" expecting="M-attribute-context1"/>\r
+  </context>\r
+\r
+  <context id="M-attribute-context1">\r
+    <error skipuntil="RBRACE" expecting="INIT"/>\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="RBRACKET"      role="closebracket"       expecting="M-selector-context1"/>\r
+    <token type="EQUALS"        role="attribute-matching" expecting="M-attribute-value"/>\r
+    <token type="INCLUDES"      role="attribute-matching" expecting="M-attribute-value"/>\r
+    <token type="DASHMATCH"     role="attribute-matching" expecting="M-attribute-value"/>\r
+    <token type="CIRCMATCH"     role="attribute-matching" expecting="M-attribute-value"/>\r
+    <token type="DOLLARMATCH"   role="attribute-matching" expecting="M-attribute-value"/>\r
+    <token type="STARMATCH"     role="attribute-matching" expecting="M-attribute-value"/>\r
+  </context>\r
+  \r
+  <context id="M-attribute-value">\r
+    <error skipuntil="RBRACE" expecting="INIT"/>\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="IDENT"  role="attribute-value" expecting="M-end-attribute-selector"/>\r
+    <token type="STRING" role="attribute-value" expecting="M-end-attribute-selector"/>\r
+  </context>\r
+  \r
+  <context id="M-end-attribute-selector">\r
+    <error skipuntil="RBRACE" expecting="INIT"/>\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="RBRACKET"  role="closebracket"       expecting="M-selector-context1"/>\r
+  </context>\r
+  \r
+  <context id="M-selector-context1">\r
+    <error skipuntil="RBRACE" expecting="INIT"/>\r
+    <ignore>\r
+      <type name="comment" />\r
+    </ignore>\r
+  \r
+    <token type="whitespace"                      expecting="M-selector-context2"/>\r
+    <token type="GREATER"     role="combinator"   expecting="M-selector-context3"/>\r
+    <token type="PLUS"        role="combinator"   expecting="M-selector-context3"/>\r
+    <token type="TILDA"       role="combinator"   expecting="M-selector-context3"/>\r
+  \r
+    <token type="LBRACE"      role="openbrace"    expecting="M-declaration-context1"/>\r
+    <token type="COMMA"       role="grouping"     expecting="M-selector-context3"/>\r
+  \r
+    <token type="COLON"       role="colon-pseudo" expecting="M-pseudo-selector"/>\r
+    <token type="PERIOD"      role="period-class" expecting="M-class-selector"/>\r
+    <token type="LBRACKET"    role="openbracket"  expecting="M-attribute-selector"/>\r
+    <token type="HASHMATCH"   role="ID"           expecting="M-selector-context1"/>\r
+  </context>\r
+  \r
+  <context id="M-selector-context2">\r
+    <error skipuntil="RBRACE" expecting="INIT"/>\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+\r
+    <token type="LBRACE"      role="openbrace"    expecting="M-declaration-context1"/>\r
+\r
+    <token type="GREATER"     role="combinator"   expecting="M-selector-context3"/>\r
+    <token type="PLUS"        role="combinator"   expecting="M-selector-context3"/>\r
+    <token type="TILDA"       role="combinator"   expecting="M-selector-context3"/>\r
+  \r
+    <token type="IDENT"  lookahead="VBAR"     role="namespace" expecting="M-namespace-separator"/>\r
+    <token type="IDENT"                       role="type"      expecting="M-selector-context1"/>\r
+    <token type="STAR"   lookahead="VBAR"     role="type"      expecting="M-namespace-separator"/>\r
+    <token type="STAR"                        role="type"      expecting="M-selector-context1"/>\r
+    <token type="VBAR"                        role="vbar"      expecting="M-element-name"/>\r
+    <token type="COLON"                       role="colon-pseudo" expecting="M-pseudo-selector"/>\r
+    <token type="PERIOD"                      role="period-class" expecting="M-class-selector"/>\r
+    <token type="LBRACKET"                    role="openbracket" expecting="M-attribute-selector"/>\r
+    <token type="HASHMATCH"                   role="ID"        expecting="M-selector-context1"/>\r
+  </context>\r
+  \r
+  <context id="M-selector-context3">\r
+    <error skipuntil="RBRACE" expecting="INIT"/>\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+  \r
+    <token type="IDENT"  lookahead="VBAR"     role="namespace" expecting="M-namespace-separator"/>\r
+    <token type="IDENT"                       role="type"      expecting="M-selector-context1"/>\r
+    <token type="STAR"   lookahead="VBAR"     role="type"      expecting="M-namespace-separator"/>\r
+    <token type="STAR"                        role="type"      expecting="M-selector-context1"/>\r
+    <token type="VBAR"                        role="vbar"      expecting="M-element-name"/>\r
+    <token type="COLON"                       role="colon-pseudo" expecting="M-pseudo-selector"/>\r
+    <token type="PERIOD"                      role="period-class" expecting="M-class-selector"/>\r
+    <token type="LBRACKET"                    role="openbracket" expecting="M-attribute-selector"/>\r
+    <token type="HASHMATCH"                   role="ID"        expecting="M-selector-context1"/>\r
+  </context>\r
+  \r
+  \r
+  <!-- ============================================= -->\r
+  <!-- DECLARATIONS IN MEDIA AT-RULE -->\r
+  <!-- ============================================= -->\r
+  \r
+  <context id="M-declaration-context1">\r
+    <error skipuntil="SEMICOLON" expecting="M-declaration-context1"/>\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="SEMICOLON"    role="semicolon" expecting="M-declaration-context1"/>\r
+    <token type="IDENT"        role="property"  expecting="M-declaration-separator"/>\r
+    <token type="RBRACE"       role="closebrace" expecting="style-rule-only"/>\r
+  </context>\r
+  \r
+  <context id="M-declaration-separator">\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="COLON"  role="colon" expecting="M-declaration-value1"/>\r
+  </context>\r
+  \r
+  <context id="M-declaration-value1">\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="PERCENTAGE" role="value" expecting="M-declaration-value2"/>\r
+    <token type="DIMENSION"  role="value" expecting="M-declaration-value2"/>\r
+    <token type="NUMBER"     role="value" expecting="M-declaration-value2"/>\r
+    <token type="HASHMATCH"  role="value" expecting="M-declaration-value2"/>\r
+    <token type="URI"        role="url-call" expecting="M-declaration-url-value"/>\r
+    <token type="STRING"     role="value" expecting="M-declaration-value2"/>\r
+    <token type="FUNCTION"   role="function-call" expecting="M-function-value1"/>\r
+    <token type="IDENT"      role="value" expecting="M-declaration-value2"/>\r
+  </context>\r
+\r
+  <context id="M-declaration-url-value">\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="STRING"  role="url-value" expecting="M-declaration-rule-url-rparen"/>\r
+    <token type="URL"     role="url-value" expecting="M-declaration-rule-url-rparen"/>\r
+  </context>\r
+\r
+  <context id="M-declaration-rule-url-rparen">\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="RPAREN"  role="url-call" expecting="M-declaration-value2"/>\r
+  </context>\r
+\r
+  <context id="M-declaration-value2">\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="SEMICOLON"  role="semicolon"  expecting="M-declaration-context1"/>\r
+    <token type="RBRACE"     role="closebrace" expecting="style-rule-only"/>\r
+  \r
+    <token type="SLASH"      role="slash" expecting="M-declaration-value1"/>\r
+    <token type="COMMA"      role="valuedelimiter" expecting="M-declaration-value1"/>\r
+  \r
+    <token type="PERCENTAGE" role="value" expecting="M-declaration-value2"/>\r
+    <token type="DIMENSION"  role="value" expecting="M-declaration-value2"/>\r
+    <token type="NUMBER"     role="value" expecting="M-declaration-value2"/>\r
+    <token type="HASHMATCH"  role="value" expecting="M-declaration-value2"/>\r
+    <token type="URI"        role="url-call" expecting="M-declaration-url-value"/>\r
+    <token type="STRING"     role="value" expecting="M-declaration-value2"/>\r
+    <token type="FUNCTION"   role="function-call" expecting="M-function-value1"/>\r
+    <token type="IDENT"      role="value" expecting="M-declaration-value2"/>\r
+  </context>\r
+  \r
+  <context id="M-function-value1">\r
+    <ignore>\r
+      <type name="whitespace" />\r
+      <type name="comment" />\r
+    </ignore>\r
+    <token type="RPAREN"    role="function-call" expecting="M-declaration-value2"/>\r
+    <token type=""          role="function-value"     expecting="M-function-value1"/>\r
+  </context>\r
+\r
+</grammar>\r
diff --git a/extensions/diavolo/content/cssCompletion.xml b/extensions/diavolo/content/cssCompletion.xml
new file mode 100644 (file)
index 0000000..25ae145
--- /dev/null
@@ -0,0 +1,408 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is Diavolo.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL
+   - Portions created by the Initial Developer are Copyright (C) 2006-2008
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (glazman@disruptive-innovations.com), Original author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<!DOCTYPE codeCompletion [
+ <!ATTLIST type id ID #IMPLIED>
+]>
+
+<codeCompletion name="css">
+
+  <type id="type">
+    <suggestion value="h1" />
+    <suggestion value="h2" />
+    <suggestion value="h3" />
+    <suggestion value="h4" />
+    <suggestion value="h5" />
+    <suggestion value="h6" />
+    <suggestion value="a" />
+    <suggestion value="abbr" />
+    <suggestion value="acronym" />
+    <suggestion value="address" />
+    <suggestion value="applet" />
+    <suggestion value="area" />
+    <suggestion value="b" />
+    <suggestion value="bdo" />
+    <suggestion value="big" />
+    <suggestion value="blockquote" />
+    <suggestion value="body" />
+    <suggestion value="br" />
+    <suggestion value="button" />
+    <suggestion value="caption" />
+    <suggestion value="center" />
+    <suggestion value="cite" />
+    <suggestion value="code" />
+    <suggestion value="col" />
+    <suggestion value="colgroup" />
+    <suggestion value="dd" />
+    <suggestion value="del" />
+    <suggestion value="dfn" />
+    <suggestion value="dir" />
+    <suggestion value="div" />
+    <suggestion value="dl" />
+    <suggestion value="dt" />
+    <suggestion value="em" />
+    <suggestion value="fieldset" />
+    <suggestion value="font" />
+    <suggestion value="form" />
+    <suggestion value="frame" />
+    <suggestion value="frameset" />
+    <suggestion value="hr" />
+    <suggestion value="html" />
+    <suggestion value="iframe" />
+    <suggestion value="img" />
+    <suggestion value="input" />
+    <suggestion value="ins" />
+    <suggestion value="isindex" />
+    <suggestion value="kbd" />
+    <suggestion value="label" />
+    <suggestion value="legend" />
+    <suggestion value="li" />
+    <suggestion value="map" />
+    <suggestion value="menu" />
+    <suggestion value="noframes" />
+    <suggestion value="object" />
+    <suggestion value="ol" />
+    <suggestion value="optgroup" />
+    <suggestion value="option" />
+    <suggestion value="p" />
+    <suggestion value="param" />
+    <suggestion value="pre" />
+    <suggestion value="q" />
+    <suggestion value="s" />
+    <suggestion value="samp" />
+    <suggestion value="select" />
+    <suggestion value="small" />
+    <suggestion value="span" />
+    <suggestion value="strike" />
+    <suggestion value="strong" />
+    <suggestion value="sub" />
+    <suggestion value="sup" />
+    <suggestion value="table" />
+    <suggestion value="tbody" />
+    <suggestion value="td" />
+    <suggestion value="textarea" />
+    <suggestion value="tfoot" />
+    <suggestion value="th" />
+    <suggestion value="thead" />
+    <suggestion value="tr" />
+    <suggestion value="tt" />
+    <suggestion value="u" />
+    <suggestion value="ul" />
+    <suggestion value="var" />
+  </type>
+
+  <type id="property">
+    <suggestion value="azimuth" />
+    <suggestion value="background" />
+    <suggestion value="background-attachment" />
+    <suggestion value="background-color" />
+    <suggestion value="background-image" />
+    <suggestion value="background-position" />
+    <suggestion value="background-repeat" />
+    <suggestion value="border" />
+    <suggestion value="border-collapse" />
+    <suggestion value="border-color" />
+    <suggestion value="border-spacing" />
+    <suggestion value="border-style" />
+    <suggestion value="border-top" />
+    <suggestion value="border-right" />
+    <suggestion value="border-bottom" />
+    <suggestion value="border-left" />
+    <suggestion value="border-top-color" />
+    <suggestion value="border-right-color" />
+    <suggestion value="border-bottom-color" />
+    <suggestion value="border-left-color" />
+    <suggestion value="border-top-style" />
+    <suggestion value="border-right-style" />
+    <suggestion value="border-bottom-style" />
+    <suggestion value="border-left-style" />
+    <suggestion value="border-top-width" />
+    <suggestion value="border-right-width" />
+    <suggestion value="border-bottom-width" />
+    <suggestion value="border-left-width" />
+    <suggestion value="border-width" />
+    <suggestion value="bottom" />
+    <suggestion value="caption-side" />
+    <suggestion value="clear" />
+    <suggestion value="clip" />
+    <suggestion value="color" />
+    <suggestion value="content" />
+    <suggestion value="counter-increment" />
+    <suggestion value="counter-reset" />
+    <suggestion value="cue" />
+    <suggestion value="cue-after" />
+    <suggestion value="cue-before" />
+    <suggestion value="cursor" />
+    <suggestion value="direction" />
+    <suggestion value="display" />
+    <suggestion value="elevation" />
+    <suggestion value="empty-cells" />
+    <suggestion value="float" />
+    <suggestion value="font" />
+    <suggestion value="font-family" />
+    <suggestion value="font-size" />
+    <suggestion value="font-size-adjust" />
+    <suggestion value="font-stretch" />
+    <suggestion value="font-style" />
+    <suggestion value="font-variant" />
+    <suggestion value="font-weight" />
+    <suggestion value="height" />
+    <suggestion value="left" />
+    <suggestion value="letter-spacing" />
+    <suggestion value="line-height" />
+    <suggestion value="list-style" />
+    <suggestion value="list-style-image" />
+    <suggestion value="list-style-position" />
+    <suggestion value="list-style-type" />
+    <suggestion value="margin" />
+    <suggestion value="margin-top" />
+    <suggestion value="margin-right" />
+    <suggestion value="margin-bottom" />
+    <suggestion value="margin-left" />
+    <suggestion value="marker-offset" />
+    <suggestion value="marks" />
+    <suggestion value="max-height" />
+    <suggestion value="max-width" />
+    <suggestion value="min-height" />
+    <suggestion value="min-width" />
+    <suggestion value="orphans" />
+    <suggestion value="outline" />
+    <suggestion value="outline-color" />
+    <suggestion value="outline-style" />
+    <suggestion value="outline-width" />
+    <suggestion value="overflow" />
+    <suggestion value="padding" />
+    <suggestion value="padding-top" />
+    <suggestion value="padding-right" />
+    <suggestion value="padding-bottom" />
+    <suggestion value="padding-left" />
+    <suggestion value="page" />
+    <suggestion value="page-break-after" />
+    <suggestion value="page-break-before" />
+    <suggestion value="page-break-inside" />
+    <suggestion value="pause" />
+    <suggestion value="pause-after" />
+    <suggestion value="pause-before" />
+    <suggestion value="pitch" />
+    <suggestion value="pitch-range" />
+    <suggestion value="play-during" />
+    <suggestion value="position" />
+    <suggestion value="quotes" />
+    <suggestion value="richness" />
+    <suggestion value="right" />
+    <suggestion value="size" />
+    <suggestion value="speak" />
+    <suggestion value="speak-header" />
+    <suggestion value="speak-numeral" />
+    <suggestion value="speak-punctuation" />
+    <suggestion value="speech-after" />
+    <suggestion value="stress" />
+    <suggestion value="table-layout" />
+    <suggestion value="text-align" />
+    <suggestion value="text-decoration" />
+    <suggestion value="text-indent" />
+    <suggestion value="text-shadow" />
+    <suggestion value="text-transform" />
+    <suggestion value="top" />
+    <suggestion value="unicode-bidi" />
+    <suggestion value="vertical-align" />
+    <suggestion value="visibility" />
+    <suggestion value="voice-family" />
+    <suggestion value="volume" />
+    <suggestion value="volume" />
+    <suggestion value="width" />
+    <suggestion value="z-index" />
+  </type>
+
+  <type id="value">
+    <context name="property" />
+
+    <always><suggestion value="inherit" /><suggestion value="initial" /></always>
+
+    <suggestiongroup forcontext="azimuth"><suggestion value="behind" /><suggestion value="center" /><suggestion value="center-left" /><suggestion value="center-right" /><suggestion value="far-left" /><suggestion value="far-right" /><suggestion value="left" /><suggestion value="left-side" /><suggestion value="leftwards" /><suggestion value="right" /><suggestion value="right-side" /><suggestion value="rightwards" /></suggestiongroup>
+    <suggestiongroup forcontext="background-attachment"><suggestion value="fixed" /><suggestion value="scroll" /></suggestiongroup>
+    <suggestiongroup forcontext="background-color"><suggestion value="aqua" /><suggestion value="black" /><suggestion value="blue" /><suggestion value="fuchsia" /><suggestion value="gray" /><suggestion value="green" /><suggestion value="lime" /><suggestion value="maroon" /><suggestion value="navy" /><suggestion value="olive" /><suggestion value="orange" /><suggestion value="purple" /><suggestion value="red" /><suggestion value="silver" /><suggestion value="teal" /><suggestion value="transparent" /><suggestion value="white" /><suggestion value="yellow" /></suggestiongroup>
+    <suggestiongroup forcontext="background-image"><suggestion value="none" /></suggestiongroup>
+    <suggestiongroup forcontext="background-position"><suggestion value="bottom" /><suggestion value="center" /><suggestion value="left" /><suggestion value="right" /><suggestion value="top" /></suggestiongroup>
+    <suggestiongroup forcontext="background-repeat"><suggestion value="no-repeat" /><suggestion value="repeat" /><suggestion value="repeat-x" /><suggestion value="repeat-y" /></suggestiongroup>
+    <suggestiongroup forcontext="border-collapse"><suggestion value="collapse" /><suggestion value="separate" /></suggestiongroup>
+    <suggestiongroup forcontext="border-color"><suggestion value="aqua" /><suggestion value="black" /><suggestion value="blue" /><suggestion value="fuchsia" /><suggestion value="gray" /><suggestion value="green" /><suggestion value="lime" /><suggestion value="maroon" /><suggestion value="navy" /><suggestion value="olive" /><suggestion value="orange" /><suggestion value="purple" /><suggestion value="red" /><suggestion value="silver" /><suggestion value="teal" /><suggestion value="transparent" /><suggestion value="white" /><suggestion value="yellow" /></suggestiongroup>
+    <suggestiongroup forcontext="border-top-color"><suggestion value="aqua" /><suggestion value="black" /><suggestion value="blue" /><suggestion value="fuchsia" /><suggestion value="gray" /><suggestion value="green" /><suggestion value="lime" /><suggestion value="maroon" /><suggestion value="navy" /><suggestion value="olive" /><suggestion value="orange" /><suggestion value="purple" /><suggestion value="red" /><suggestion value="silver" /><suggestion value="teal" /><suggestion value="transparent" /><suggestion value="white" /><suggestion value="yellow" /></suggestiongroup>
+    <suggestiongroup forcontext="border-bottom-color"><suggestion value="aqua" /><suggestion value="black" /><suggestion value="blue" /><suggestion value="fuchsia" /><suggestion value="gray" /><suggestion value="green" /><suggestion value="lime" /><suggestion value="maroon" /><suggestion value="navy" /><suggestion value="olive" /><suggestion value="orange" /><suggestion value="purple" /><suggestion value="red" /><suggestion value="silver" /><suggestion value="teal" /><suggestion value="transparent" /><suggestion value="white" /><suggestion value="yellow" /></suggestiongroup>
+    <suggestiongroup forcontext="border-left-color"><suggestion value="aqua" /><suggestion value="black" /><suggestion value="blue" /><suggestion value="fuchsia" /><suggestion value="gray" /><suggestion value="green" /><suggestion value="lime" /><suggestion value="maroon" /><suggestion value="navy" /><suggestion value="olive" /><suggestion value="orange" /><suggestion value="purple" /><suggestion value="red" /><suggestion value="silver" /><suggestion value="teal" /><suggestion value="transparent" /><suggestion value="white" /><suggestion value="yellow" /></suggestiongroup>
+    <suggestiongroup forcontext="border-right-color"><suggestion value="aqua" /><suggestion value="black" /><suggestion value="blue" /><suggestion value="fuchsia" /><suggestion value="gray" /><suggestion value="green" /><suggestion value="lime" /><suggestion value="maroon" /><suggestion value="navy" /><suggestion value="olive" /><suggestion value="orange" /><suggestion value="purple" /><suggestion value="red" /><suggestion value="silver" /><suggestion value="teal" /><suggestion value="transparent" /><suggestion value="white" /><suggestion value="yellow" /></suggestiongroup>
+    <suggestiongroup forcontext="border-style"><suggestion value="dashed" /><suggestion value="dotted" /><suggestion value="double" /><suggestion value="groove" /><suggestion value="hidden" /><suggestion value="inset" /><suggestion value="none" /><suggestion value="outset" /><suggestion value="ridge" /><suggestion value="solid" /></suggestiongroup>
+    <suggestiongroup forcontext="border-top-style"><suggestion value="dashed" /><suggestion value="dotted" /><suggestion value="double" /><suggestion value="groove" /><suggestion value="hidden" /><suggestion value="inset" /><suggestion value="none" /><suggestion value="outset" /><suggestion value="ridge" /><suggestion value="solid" /></suggestiongroup>
+    <suggestiongroup forcontext="border-bottom-style"><suggestion value="dashed" /><suggestion value="dotted" /><suggestion value="double" /><suggestion value="groove" /><suggestion value="hidden" /><suggestion value="inset" /><suggestion value="none" /><suggestion value="outset" /><suggestion value="ridge" /><suggestion value="solid" /></suggestiongroup>
+    <suggestiongroup forcontext="border-left-style"><suggestion value="dashed" /><suggestion value="dotted" /><suggestion value="double" /><suggestion value="groove" /><suggestion value="hidden" /><suggestion value="inset" /><suggestion value="none" /><suggestion value="outset" /><suggestion value="ridge" /><suggestion value="solid" /></suggestiongroup>
+    <suggestiongroup forcontext="border-right-style"><suggestion value="dashed" /><suggestion value="dotted" /><suggestion value="double" /><suggestion value="groove" /><suggestion value="hidden" /><suggestion value="inset" /><suggestion value="none" /><suggestion value="outset" /><suggestion value="ridge" /><suggestion value="solid" /></suggestiongroup>
+    <suggestiongroup forcontext="bottom"><suggestion value="auto" /></suggestiongroup>
+    <suggestiongroup forcontext="caption-side"><suggestion value="bottom" /><suggestion value="left" /><suggestion value="right" /><suggestion value="top" /></suggestiongroup>
+    <suggestiongroup forcontext="clear"><suggestion value="both" /><suggestion value="left" /><suggestion value="none" /><suggestion value="right" /></suggestiongroup>
+    <suggestiongroup forcontext="color"><suggestion value="aqua" /><suggestion value="black" /><suggestion value="blue" /><suggestion value="fuchsia" /><suggestion value="gray" /><suggestion value="green" /><suggestion value="lime" /><suggestion value="maroon" /><suggestion value="navy" /><suggestion value="olive" /><suggestion value="orange" /><suggestion value="purple" /><suggestion value="red" /><suggestion value="silver" /><suggestion value="teal" /><suggestion value="white" /><suggestion value="yellow" /></suggestiongroup>
+    <suggestiongroup forcontext="content"><suggestion value="open-quote" /><suggestion value="close-quote" /><suggestion value="no-open-quote" /><suggestion value="no-close-quote" /></suggestiongroup>
+    <suggestiongroup forcontext="counter-increment"><suggestion value="none" /></suggestiongroup>
+    <suggestiongroup forcontext="counter-reset"><suggestion value="none" /></suggestiongroup>
+    <suggestiongroup forcontext="cue"><suggestion value="cue-after" /><suggestion value="cue-before" /></suggestiongroup>
+    <suggestiongroup forcontext="cue-after"><suggestion value="none" /></suggestiongroup>
+    <suggestiongroup forcontext="cue-before"><suggestion value="none" /></suggestiongroup>
+    <suggestiongroup forcontext="cursor"><suggestion value="auto" /><suggestion value="crosshair" /><suggestion value="default" /><suggestion value="pointer" /><suggestion value="move" /><suggestion value="e-resize" /><suggestion value="ne-resize" /><suggestion value="nw-resize" /><suggestion value="n-resize" /><suggestion value="se-resize" /><suggestion value="sw-resize" /><suggestion value="s-resize" /><suggestion value="w-resize" /><suggestion value="text" /><suggestion value="wait" /><suggestion value="help" /></suggestiongroup>
+    <suggestiongroup forcontext="direction"><suggestion value="ltr" /><suggestion value="rtl" /></suggestiongroup>
+    <suggestiongroup forcontext="display"><suggestion value="none" /><suggestion value="block" /><suggestion value="inline" /><suggestion value="inline-block" /><suggestion value="inline-table" /><suggestion value="list-item" /><suggestion value="compact" /><suggestion value="run-in" /><suggestion value="marker" />
+                                    <suggestion value="table" /><suggestion value="table-caption" /><suggestion value="table-cell" /><suggestion value="table-column" /><suggestion value="table-column-group" /><suggestion value="table-footer-group" /><suggestion value="table-header-group" /><suggestion value="table-row" /><suggestion value="table-row-group" /></suggestiongroup>
+    <suggestiongroup forcontext="elevation"><suggestion value="above" /><suggestion value="below" /><suggestion value="higher" /><suggestion value="level" /><suggestion value="lower" /></suggestiongroup>
+    <suggestiongroup forcontext="empty-cells"><suggestion value="hide" /><suggestion value="show" /></suggestiongroup>
+    <suggestiongroup forcontext="float"><suggestion value="none" /><suggestion value="left" /><suggestion value="right" /></suggestiongroup>
+    <suggestiongroup forcontext="font-family"><suggestion value="serif" /><suggestion value="sans-serif" /><suggestion value="monospace" /><suggestion value="fantasy" /><suggestion value="cursive" /></suggestiongroup>
+    <suggestiongroup forcontext="font-size"><suggestion value="xx-small" /><suggestion value="x-small" /><suggestion value="small" /><suggestion value="medium" /><suggestion value="large" /><suggestion value="x-large" /><suggestion value="xx-large" /><suggestion value="smaller" /><suggestion value="larger" /></suggestiongroup>
+    <suggestiongroup forcontext="font-size-adjust"><suggestion value="none" /></suggestiongroup>
+    <suggestiongroup forcontext="font-stretch"><suggestion value="normal" /><suggestion value="wider" /><suggestion value="narrower" /><suggestion value="ultra-condensed" /><suggestion value="extra-condensed" /><suggestion value="condensed" /><suggestion value="semi-condensed" /><suggestion value="semi-expanded" /><suggestion value="expanded" /><suggestion value="extra-expanded" /><suggestion value="ultra-expanded" /></suggestiongroup>
+    <suggestiongroup forcontext="font-style"><suggestion value="normal" /><suggestion value="italic" /><suggestion value="oblique" /></suggestiongroup>
+    <suggestiongroup forcontext="font-variant"><suggestion value="normal" /><suggestion value="small-caps" /></suggestiongroup>
+    <suggestiongroup forcontext="font-weight"><suggestion value="normal" /><suggestion value="bold" /><suggestion value="bolder" /><suggestion value="lighter" /></suggestiongroup>
+    <suggestiongroup forcontext="height"><suggestion value="auto" /></suggestiongroup>
+    <suggestiongroup forcontext="left"><suggestion value="auto" /></suggestiongroup>
+    <suggestiongroup forcontext="letter-spacing"><suggestion value="normal" /></suggestiongroup>
+    <suggestiongroup forcontext="line-height"><suggestion value="normal" /></suggestiongroup>
+    <suggestiongroup forcontext="list-style-image"><suggestion value="none" /></suggestiongroup>
+    <suggestiongroup forcontext="list-style-position"><suggestion value="inside" /><suggestion value="outside" /></suggestiongroup>
+    <suggestiongroup forcontext="list-style-type"><suggestion value="none" /><suggestion value="disc" /><suggestion value="circle" /><suggestion value="square" /><suggestion value="decimal" /><suggestion value="decimal-leading-zero" /><suggestion value="lower-roman" /><suggestion value="upper-roman" /><suggestion value="lower-greek" /><suggestion value="upper-greek" /><suggestion value="lower-alpha" /><suggestion value="upper-alpha" /><suggestion value="lower-latin" /><suggestion value="upper-latin" /><suggestion value="hebrew" /><suggestion value="armenian" /><suggestion value="georgian" /><suggestion value="cjk-ideographic" /><suggestion value="hiragana" /><suggestion value="katakana" /><suggestion value="hiragana-iroha" /><suggestion value="katakana-iroha" /></suggestiongroup>
+    <suggestiongroup forcontext="marker-offser"><suggestion value="auto" /></suggestiongroup>
+    <suggestiongroup forcontext="marks"><suggestion value="crop" /><suggestion value="cross" /><suggestion value="none" /></suggestiongroup>
+    <suggestiongroup forcontext="max-height"><suggestion value="none" /></suggestiongroup>
+    <suggestiongroup forcontext="max-width"><suggestion value="none" /></suggestiongroup>
+    <suggestiongroup forcontext="outline-color"><suggestion value="invert" /><suggestion value="aqua" /><suggestion value="black" /><suggestion value="blue" /><suggestion value="fuchsia" /><suggestion value="gray" /><suggestion value="green" /><suggestion value="lime" /><suggestion value="maroon" /><suggestion value="navy" /><suggestion value="olive" /><suggestion value="orange" /><suggestion value="purple" /><suggestion value="red" /><suggestion value="silver" /><suggestion value="teal" /><suggestion value="white" /><suggestion value="yellow" /></suggestiongroup>
+    <suggestiongroup forcontext="outline-style"><suggestion value="dashed" /><suggestion value="dotted" /><suggestion value="double" /><suggestion value="groove" /><suggestion value="hidden" /><suggestion value="inset" /><suggestion value="none" /><suggestion value="outset" /><suggestion value="ridge" /><suggestion value="solid" /></suggestiongroup>
+    <suggestiongroup forcontext="overflow"><suggestion value="auto" /><suggestion value="hidden" /><suggestion value="scroll" /><suggestion value="visible" /></suggestiongroup>
+    <suggestiongroup forcontext="page-break-after"><suggestion value="auto" /><suggestion value="always" /><suggestion value="avoid" /><suggestion value="left" /><suggestion value="right" /></suggestiongroup>
+    <suggestiongroup forcontext="page-break-before"><suggestion value="auto" /><suggestion value="always" /><suggestion value="avoid" /><suggestion value="left" /><suggestion value="right" /></suggestiongroup>
+    <suggestiongroup forcontext="page-break-inside"><suggestion value="auto" /><suggestion value="avoid" /></suggestiongroup>
+    <suggestiongroup forcontext="pitch"><suggestion value="x-low" /><suggestion value="low" /><suggestion value="medium" /><suggestion value="high" /><suggestion value="x-high" /></suggestiongroup>
+    <suggestiongroup forcontext="play-during"><suggestion value="mix" /><suggestion value="repeat" /><suggestion value="auto" /><suggestion value="none" /></suggestiongroup>
+    <suggestiongroup forcontext="position"><suggestion value="static" /><suggestion value="relative" /><suggestion value="absolute" /><suggestion value="fixed" /></suggestiongroup>
+    <suggestiongroup forcontext="quotes"><suggestion value="none" /></suggestiongroup>
+    <suggestiongroup forcontext="right"><suggestion value="auto" /></suggestiongroup>
+    <suggestiongroup forcontext="size"><suggestion value="portrait" /><suggestion value="landscape" /></suggestiongroup>
+    <suggestiongroup forcontext="speak"><suggestion value="normal" /><suggestion value="none" /><suggestion value="spell-out" /></suggestiongroup>
+    <suggestiongroup forcontext="speak-header"><suggestion value="once" /><suggestion value="always" /></suggestiongroup>
+    <suggestiongroup forcontext="speak-numeral"><suggestion value="digits" /><suggestion value="continuous" /></suggestiongroup>
+    <suggestiongroup forcontext="speak-punctuation"><suggestion value="code" /><suggestion value="none" /></suggestiongroup>
+    <suggestiongroup forcontext="speech-rate"><suggestion value="x-slow" /><suggestion value="slow" /><suggestion value="medium" /><suggestion value="fast" /><suggestion value="x-fast" /><suggestion value="faster" /><suggestion value="slower" /></suggestiongroup>
+    <suggestiongroup forcontext="table-layout"><suggestion value="auto" /><suggestion value="fixed" /></suggestiongroup>
+    <suggestiongroup forcontext="text-align"><suggestion value="left" /><suggestion value="right" /><suggestion value="center" /><suggestion value="justify" /></suggestiongroup>
+    <suggestiongroup forcontext="text-decoration"><suggestion value="none" /><suggestion value="underline" /><suggestion value="overline" /><suggestion value="line-through" /><suggestion value="blink" /></suggestiongroup>
+    <suggestiongroup forcontext="text-shadow"><suggestion value="invert" /><suggestion value="aqua" /><suggestion value="black" /><suggestion value="blue" /><suggestion value="fuchsia" /><suggestion value="gray" /><suggestion value="green" /><suggestion value="lime" /><suggestion value="maroon" /><suggestion value="navy" /><suggestion value="olive" /><suggestion value="orange" /><suggestion value="purple" /><suggestion value="red" /><suggestion value="silver" /><suggestion value="teal" /><suggestion value="white" /><suggestion value="yellow" /></suggestiongroup>
+    <suggestiongroup forcontext="text-transform"><suggestion value="capitalize" /><suggestion value="uppercase" /><suggestion value="lowercase" /><suggestion value="none" /></suggestiongroup>
+    <suggestiongroup forcontext="top"><suggestion value="auto" /></suggestiongroup>
+    <suggestiongroup forcontext="unicode-bidi"><suggestion value="normal" /><suggestion value="embed" /><suggestion value="bidi-override" /></suggestiongroup>
+    <suggestiongroup forcontext="vertical-align"><suggestion value="baseline" /><suggestion value="sub" /><suggestion value="super" /><suggestion value="top" /><suggestion value="text-top" /><suggestion value="middle" /><suggestion value="bottom" /><suggestion value="text-bottom" /></suggestiongroup>
+    <suggestiongroup forcontext="visibility"><suggestion value="visible" /><suggestion value="hidden" /><suggestion value="collapse" /></suggestiongroup>
+    <suggestiongroup forcontext="voice-family"><suggestion value="male" /><suggestion value="female" /><suggestion value="child" /></suggestiongroup>
+    <suggestiongroup forcontext="volume"><suggestion value="silent" /><suggestion value="x-soft" /><suggestion value="soft" /><suggestion value="medium" /><suggestion value="loud" /><suggestion value="x-loud" /></suggestiongroup>
+    <suggestiongroup forcontext="white-space"><suggestion value="normal" /><suggestion value="pre" /><suggestion value="nowrap" /></suggestiongroup>
+    <suggestiongroup forcontext="width"><suggestion value="auto" /></suggestiongroup>
+    <suggestiongroup forcontext="word-spacing"><suggestion value="normal" /></suggestiongroup>
+    <suggestiongroup forcontext="z-index"><suggestion value="auto" /></suggestiongroup>
+  </type>
+
+  <type id="pseudo-selector">
+    <suggestion value="root"/>
+    <suggestion value="nth-child"/>
+    <suggestion value="nth-last-child"/>
+    <suggestion value="nth-last-of-type"/>
+    <suggestion value="nth-of-type"/>
+    <suggestion value="first-child"/>
+    <suggestion value="last-child"/>
+    <suggestion value="first-of-type"/>
+    <suggestion value="last-of-type"/>
+    <suggestion value="only-child"/>
+    <suggestion value="only-of-type"/>
+    <suggestion value="empty"/>
+    <suggestion value="link"/>
+    <suggestion value="visited"/>
+    <suggestion value="active"/>
+    <suggestion value="hover"/>
+    <suggestion value="focus"/>
+    <suggestion value="target"/>
+    <suggestion value="lang("/>
+    <suggestion value="enabled"/>
+    <suggestion value="disabled"/>
+    <suggestion value="checked"/>
+    <suggestion value="first-line"/>
+    <suggestion value="first-letter"/>
+    <suggestion value="selection"/>
+    <suggestion value="before"/>
+    <suggestion value="after"/>
+  </type>
+
+  <type id="colon-pseudo">
+    <suggestion value=":root"/>
+    <suggestion value=":nth-child"/>
+    <suggestion value=":nth-last-child"/>
+    <suggestion value=":nth-last-of-type"/>
+    <suggestion value=":nth-of-type"/>
+    <suggestion value=":first-child"/>
+    <suggestion value=":last-child"/>
+    <suggestion value=":first-of-type"/>
+    <suggestion value=":last-of-type"/>
+    <suggestion value=":only-child"/>
+    <suggestion value=":only-of-type"/>
+    <suggestion value=":empty"/>
+    <suggestion value=":link"/>
+    <suggestion value=":visited"/>
+    <suggestion value=":active"/>
+    <suggestion value=":hover"/>
+    <suggestion value=":focus"/>
+    <suggestion value=":target"/>
+    <suggestion value=":lang("/>
+    <suggestion value=":enabled"/>
+    <suggestion value=":disabled"/>
+    <suggestion value=":checked"/>
+    <suggestion value=":first-line"/>
+    <suggestion value=":first-letter"/>
+    <suggestion value=":selection"/>
+    <suggestion value=":before"/>
+    <suggestion value=":after"/>
+  </type>
+
+  <type id="bang">
+    <suggestion value="!important"/>
+  </type>
+
+</codeCompletion>
diff --git a/extensions/diavolo/content/editor.js b/extensions/diavolo/content/editor.js
new file mode 100644 (file)
index 0000000..9e9c285
--- /dev/null
@@ -0,0 +1,736 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Diavolo.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006-2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+function DiavoloEditor(aSourceString, aGrammarURL, aXULElement)
+{
+  this.init(aSourceString, aGrammarURL, aXULElement);
+}
+
+DiavoloEditor.prototype = {
+  
+  mHighlighter: null,
+  mEditor: null,
+  mEditorCore: null,
+  mEditActionListener: null,
+
+  mCodeCompletionEngine: null,
+
+  init: function(aSourceString, aGrammarURL, aXULElement)
+  {
+    if (aXULElement.localName != "editor") return;
+    this.mHighlighter = new DiavoloHighlighter(aSourceString,
+                                               aGrammarURL,
+                                               aXULElement);
+    if (!this.mHighlighter)
+      return;
+    this.mEditor = aXULElement;
+
+    this.startup();
+  },
+
+  startup: function()
+  {
+    this.mEditorCore = this.mEditor.getEditor(this.mEditor.contentWindow);
+
+    this.mEditorCore instanceof Components.interfaces.nsIHTMLEditor;
+
+    this.mEditorCore instanceof Components.interfaces.nsIHTMLAbsPosEditor;
+    this.mEditorCore.absolutePositioningEnabled = false;
+
+    this.mEditorCore instanceof Components.interfaces.nsIHTMLInlineTableEditor;
+    this.mEditorCore.inlineTableEditingEnabled = false;
+
+    this.mEditorCore instanceof Components.interfaces.nsIHTMLObjectResizer;
+    this.mEditorCore.objectResizingEnabled = false;
+
+    this.mEditActionListener = new DiavoloEditActionListener(this.mEditorCore, this.mHighlighter);
+    this.mEditorCore.addEditActionListener(this.mEditActionListener);
+    this.mEditorCore.addEditorObserver(this.mEditActionListener);
+    this.mEditorCore.addInsertionListener(this.mEditActionListener);
+
+    this.mCodeCompletionEngine = new DiavoloCodeCompletionEngine(this.mEditorCore);
+
+    this.mEditorCore.transactionManager.AddListener(this.mEditActionListener);
+
+  },
+
+  shutdown: function shutdown()
+  {
+    this.mEditorCore.removeEditActionListener(this.mEditActionListener);
+    this.mEditorCore.removeEditorObserver(this.mEditActionListener);
+    this.mEditorCore.removeInsertionListener(this.mEditActionListener);
+
+    this.mCodeCompletionEngine.shutdown();
+
+    this.mEditorCore.transactionManager.RemoveListener(this.mEditActionListener); 
+  },
+
+/********************* PUBLIC **************************/
+
+  textContent: function textContent()
+  {
+    return this.mHighlighter._textContent(this.mHighlighter.mElement.firstChild);
+  },
+
+  clear: function clear()
+  {
+    this.mEditorCore.selectAll();
+    this.mEditorCore.deleteSelection(0);
+  }
+};
+
+
+
+
+function DiavoloEditActionListener(aDiavoloEditorCore, aHighlighter)
+{
+  this.mDiavoloEditorCore = aDiavoloEditorCore;
+  this.mHighlighter = aHighlighter;
+}
+
+DiavoloEditActionListener.prototype = {
+
+  mDiavoloEditorCore: null,
+  mHighlighter: null,
+  mRefreshNode: null,
+  mRefreshAllDoc: false,
+
+  mBatch: false,
+  mRefreshing: false,
+
+  mUndoing: false,
+  mRedoing: false,
+  mSecondUndoing: false,
+  mSecondRedoing: false,
+
+  mTextNodesToDelete: [],
+
+  mSecondaryRefresh: false,
+  mSecondaryRefreshNode: null,
+
+  /*
+   * BEGIN nsITransactionListener
+   */
+  willUndo: function(aManager, aTransaction)
+  {
+    // we want to keep track of the fact we started undoing something...
+    this.mUndoing = true;
+    return false;
+  },
+
+  willRedo: function(aManager, aTransaction)
+  {
+    // and of course, same thing when we redo something...
+    this.mRedoing = true;
+    return false;
+  },
+
+  // we don't care about the rest
+  willDo: function(aManager, aTransaction) { return false; },
+  didDo: function(aManager, aTransaction, aDoResult) { },
+  didUndo: function(aManager, aTransaction, aUndoResult) { },
+  didRedo: function(aManager, aTransaction, aRedoResult) { },
+  willBeginBatch: function(aManager) { return false; },
+  didBeginBatch: function(aManager, aResult) { },
+  willEndBatch: function(aManager) { return false; },
+  didEndBatch: function(aManager, aResult) { },
+  willMerge: function(aManager, aTopTransaction, aTransactionToMerge) { return false; },
+  didMerge: function(aManager, aTopTransaction, aTransactionToMerge, aDidMerge, aMergeResult) { },
+  /*
+   * END nsITransactionListener
+   */
+
+
+  startBatch: function()
+  {
+    // we want to know if the editor started doing transactions 
+    this.mBatch = true;
+  },
+  
+  /*
+   * BEGIN nsIEditActionListener 
+   */
+  WillCreateNode: function WillCreateNode(aTag, aParent, aPosition)
+  {
+    if (this.mRefreshing) return;
+    this.startBatch();
+  },
+
+  DidCreateNode: function DidCreateNode(aTag, aNode, aParent, 
+  aPosition, aResult)
+  {
+    if (this.mRefreshing) return;
+    // we created a new node, let's refresh from the previous sibling
+    this.refreshFrom(aNode.previousSibling);
+  },
+
+  WillInsertNode: function WillInsertNode(aNode, aParent, aPosition)
+  {
+    if (this.mRefreshing) return;
+    this.startBatch();
+  },
+
+  DidInsertNode: function DidInsertNode(aNode, aParent, aPosition, aResult)
+  {
+    if (this.mRefreshing) return;
+    // we inserted a node, let's refresh from the previous sibling
+    this.refreshFrom(aNode.previousSibling);
+  },
+
+  WillDeleteNode: function WillDeleteNode(aChild)
+  {
+    if (this.mRefreshing) return;
+    // if the node we deleted is a text node, let's refresh from the node
+    // preceding its parent element ; from the previous sibling otherwise
+
+    if (aChild.nodeType == Node.TEXT_NODE)
+      this.refreshFrom(aChild.parentNode.previousSibling);
+    else
+      this.refreshFrom(aChild.previousSibling);
+
+    
+    this.startBatch();
+  },
+
+  DidDeleteNode: function DidDeleteNode(aChild, aResult)
+  {
+  },
+
+  WillSplitNode: function WillSplitNode(aExistingRightNode, aOffset)
+  {
+    if (this.mRefreshing) return;
+    this.startBatch();
+  },
+
+  DidSplitNode: function DidSplitNode(aExistingRightNode, aOffset, aNewLeftNode, aResult)
+  {
+    if (this.mRefreshing) return;
+    // we have split a node in two, let's refresh from the left hand side result node
+    this.refreshFrom(aNewLeftNode);
+    
+  },
+
+  WillJoinNodes: function WillJoinNodes(aLeftNode, aRightNode, aParent)
+  {
+    if (this.mRefreshing) return;
+    this.startBatch();
+  },
+
+  DidJoinNodes: function DidJoinNodes(aLeftNode, aRightNode, aParent, aResult)
+  {
+  },
+
+  WillInsertText: function WillInsertText(aTextNode, aOffset, aString)
+  {
+    if (this.mRefreshing) return;
+    this.startBatch();
+  },
+
+  DidInsertText: function DidInsertText(aTextNode, aOffset, aString, aResult)
+  {
+    if (this.mRefreshing) return;
+    // we inserted text into an existing text node, let's refresh from
+    // the parent element
+    this.refreshFrom(aTextNode.parentNode);
+  },
+
+  WillDeleteText: function WillDeleteText(aTextNode, aOffset, aLength)
+  {
+    if (this.mRefreshing) return;
+    this.startBatch();
+  },
+
+  DidDeleteText: function DidDeleteText(aTextNode, aOffset, aLength, aResult)
+  {
+    if (this.mRefreshing) return;
+    // we deleted text, let's refresh from the node preceding the text's
+    // parent element
+    this.refreshFrom(aTextNode.parentNode.previousSibling);
+    // if the resulting text is empty, we must remove the parent element
+    if (!aTextNode.data)
+    {
+      this.mRefreshing = true;
+      this.mHighlighter.preserveSelection();
+      this.mHighlighter.mIHTMLEditor.deleteNode(aTextNode.parentNode);
+      this.mHighlighter.restoreSelection();
+      this.mRefreshing = false;
+    }
+  },
+
+  WillDeleteSelection: function WillDeleteSelection(aSelection)
+  {
+    if (this.mRefreshing) return;
+    this.startBatch();
+  },
+
+  DidDeleteSelection: function DidDeleteSelection(aSelection)
+  {
+    if (this.mRefreshing) return;
+    // we deleted a selection, let's refresh from the start node
+    var n = aSelection.anchorNode;
+    var p = n.parentNode;
+    if (n.nodeType == Node.TEXT_NODE &&
+        p.nodeName.toLowerCase() == "span")
+      n = p;
+    this.refreshFrom(n);
+  },
+
+  /*
+   * END nsIEditActionListener 
+   */
+
+  /*
+   * BEGIN nsIEditorObserver
+   */
+  EditAction: function EditAction()
+  {
+    // this method is called *AFTER* all user actions in the editor
+    // so that's where we refresh the source view based on the data
+    // stored by the EditorObserver
+
+    if (this.mRefreshing) return;
+    var refreshLines = false;
+    if (this.mRedoing)
+    {
+      // we just called Redo
+      if (!this.mSecondRedoing)
+      {
+        // and it was really a user action, not our own call below
+        this.mSecondRedoing = true;
+        this.mDiavoloEditorCore.redo(1);
+        this.mSecondRedoing = false;
+      }
+      this.mBatch = false;
+      this.mRedoing = false;
+      this.mUndoing = false;
+      this.mRefreshNode = null;
+      refreshLines = true;
+    }
+    else if (this.mUndoing) 
+    {
+      // we just called Undo
+      if (!this.mSecondUndoing)
+      {
+        // and it was really a user action, not our own call below
+        this.mSecondUndoing = true;
+        this.mDiavoloEditorCore.undo(1);
+        this.mSecondUndoing = false;
+      }
+      this.mBatch = false;
+      this.mRedoing = false;
+      this.mUndoing = false;
+      this.mRefreshNode = null;
+      refreshLines = true;
+    }
+
+    if (refreshLines)
+    {
+      var brs = this.mHighlighter.mElement.getElementsByTagName("br");
+      var lines = brs.length;
+      if (brs && brs.length && brs[brs.length - 1].nextSibling)
+        lines++;
+
+      this.mHighlighter.mElement.wrappedJSObject.update(lines);
+      return;
+    }
+
+    if (!this.mRefreshNode || this.mRefreshAllDoc)
+    {
+      this.mRefreshAllDoc = false;
+      // we have to refresh node at all... So if the user did something
+      // let's refresh the whole document
+      if (this.mBatch)
+      {
+        this.preRefresh();
+        if (this.mSecondaryRefresh)
+        {
+          this.refresh(this.mSecondaryRefreshNode);
+          this.mSecondaryRefresh = false;
+        }
+        this.refresh(this.mHighlighter.mElement.firstChild);
+        this.postRefresh();
+      }
+        
+    }
+    else
+    {
+      if (this.mRefreshNode.nodeType == Node.ELEMENT_NODE)
+      {
+        this.preRefresh();
+        if (this.mSecondaryRefresh)
+        {
+          this.refresh(this.mSecondaryRefreshNode);
+          this.mSecondaryRefresh = false;
+        }
+        this.refresh(this.mRefreshNode);
+        this.postRefresh();
+      }
+        
+      else if (this.mRefreshNode.nodeType == Node.TEXT_NODE)
+      {
+        this.preRefresh();
+        if (this.mSecondaryRefresh)
+        {
+          this.refresh(this.mSecondaryRefreshNode);
+          this.mSecondaryRefresh = false;
+        }
+        this.refresh(this.mRefreshNode.parentNode);
+        this.postRefresh();
+      }
+    }
+
+    // clear the refresh node
+    this.mRefreshNode = null;
+  },
+
+  /*
+   * END nsIEditorObserver
+   */
+
+  notifyOfInsertion: function notifyOfInsertion(mimeType,
+                         contentSourceURL,
+                         sourceDocument,
+                         willDeleteSelection,
+                         docFragment,
+                         contentStartNode,
+                         contentStartOffset,
+                         contentEndNode,
+                         contentEndOffset,
+                         insertionPointNode,
+                         insertionPointOffset,
+                         continueWithInsertion)
+  {
+    
+
+    var node = insertionPointNode.value;
+    if (node.nodeType == Node.TEXT_NODE)
+    {
+      if (node.parentNode != this.mHighlighter.mElement)
+        this.mSecondaryRefreshNode = node.parentNode;
+      else if (node.previousSibling)
+        this.mSecondaryRefreshNode = node.previousSibling;
+      else
+        this.mSecondaryRefreshNode = this.mHighlighter.mElement.firstChild;
+    }
+    else
+    {
+      var offset = insertionPointOffset.value;
+      if (offset)
+      {
+        this.mSecondaryRefreshNode = node.childNodes.item(offset - 1);
+      }
+      else
+        this.mSecondaryRefreshNode = null;
+    }
+    this.mSecondaryRefresh = true;
+    continueWithInsertion.value = true;
+  },
+
+
+  QueryInterface : function(aIID)
+  {
+    if (aIID.equals(Components.interfaces.nsIEditActionListener)
+     || aIID.equals(Components.interfaces.nsIContentFilter)
+     || aIID.equals(Components.interfaces.nsIEditorObserver)
+     || aIID.equals(Components.interfaces.nsISupports)
+     || aIID.equals(Components.interfaces.nsITransactionListener)
+     || aIID.equals(Components.interfaces.nsISupportsWeakReference))
+      return this;
+    throw Components.results.NS_NOINTERFACE;
+  },
+
+  /*********************************************/
+  /*********************************************/
+  /*********************************************/
+
+  refreshFrom: function refreshFrom(aNode)
+  {
+    if (this.mRefreshAllDoc)
+      return;
+    if (aNode && aNode.nodeName.toLowerCase() == "body" &&
+        !aNode.firstChild)
+    {
+      // seems we have nothing at all in the body, we need to insert a br
+      this.mDiavoloEditorCore.insertHTML("<br>");
+      this.mRefreshNode = aNode.firstChild;
+      this.mRefreshAllDoc = true;
+      return;
+    }
+
+    while (aNode &&
+           aNode.nodeName.toLowerCase() != "span")
+      aNode = aNode.previousSibling;
+    // if user actions cause multiple refresh nodes, keep only the first
+    // one in document traversal order
+    if (aNode) 
+    {
+      if (!this.mRefreshNode ||
+          this.mRefreshNode.compareDocumentPosition(aNode) == Node.DOCUMENT_POSITION_PRECEDING) 
+        this.mRefreshNode = aNode;
+    }
+    else 
+    {
+      this.mRefreshAllDoc = true;
+    }
+      
+  },
+
+  isBR: function isBR(aNode)
+  {
+    return (aNode.nodeType == Node.ELEMENT_NODE &&
+            aNode.nodeName.toLowerCase() == "br");
+  },
+
+  preRefresh: function preRefresh()
+  {
+    // first let's preserve the selection
+    this.mHighlighter.preserveSelection();
+
+    // we want to aggregate all the changes we're going to make to the
+    // document into one single transaction
+    this.mDiavoloEditorCore.setShouldTxnSetSelection(false);
+    this.mDiavoloEditorCore.beginTransaction();
+
+    // find all BR elements standing inside a SPAN ; split those
+    // spans in two and make the BR a child of the BODY
+    var badBrs = this.mHighlighter.mElement.getElementsByTagName("br");
+
+    var lines = badBrs.length;
+    if (badBrs && badBrs.length && badBrs[badBrs.length - 1].nextSibling)
+      lines++;
+    this.mHighlighter.mElement.wrappedJSObject.update(lines);
+
+    for (var i = 0; i < badBrs.length; i++)
+    {
+      var br = badBrs[i];
+      var parent = br.parentNode;
+      if (parent.nodeName.toLowerCase() != "span")
+        continue;
+
+      this.mRefreshing = true;
+
+      // we need to split the span in two and move the
+      // br one level up in the tree
+      var res = {value: null };
+      var offset = this.mHighlighter.getIndexOfNode(parent, br); 
+      this.mDiavoloEditorCore.splitNode(parent, offset, res);
+      // delete the lhs spam if it's now empty
+      if (!res.value.firstChild)
+        this.mDiavoloEditorCore.deleteNode(res.value);
+      // at this point we have one span with what was before the BR
+      // and a second one with the BR and what followed it
+      var p = br.parentNode.parentNode;
+      offset = this.mHighlighter.getIndexOfNode(p, br.parentNode);
+      // now we move the spam
+      this.mDiavoloEditorCore.deleteNode(br);
+      this.mDiavoloEditorCore.insertNode(br, p, offset);
+      // delete the rhs span if it's now empty
+      if (!parent.firstChild)
+       this.mDiavoloEditorCore.deleteNode(parent);
+      
+      this.mRefreshing = false;
+    }
+
+    // sanity check, do we still have empty spans in the document ?
+    var badSpans = this.mHighlighter.mDoc.evaluate("//span[not(node())]",
+                               this.mHighlighter.mDoc.documentElement,
+                               null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null)
+    for (var i = 0; i < badSpans.snapshotLength; i++) 
+    {
+      // yep so remove them !
+      var span = badSpans.snapshotItem(i);
+      this.mDiavoloEditorCore.deleteNode(span);
+    }
+  },
+
+  refresh: function refresh(aNode)
+  {
+    // sanity check
+    if (!aNode || !aNode.parentNode)
+      return;
+    // where do we _really_ refresh from ?
+    // we need to skip error and partial tokens. CRs too...
+    var currentNode = aNode.previousSibling;
+    while (currentNode && currentNode.previousSibling &&
+           (currentNode.nodeType != Node.ELEMENT_NODE
+            || currentNode.getAttribute("error")
+            || currentNode.getAttribute("partial")
+            || this.isBR(currentNode)))
+      currentNode = currentNode.previousSibling;
+    // if the result is null, well, uh let's go back to the only node
+    // we have here
+    if (!currentNode)
+      currentNode = aNode;
+
+    // get source string starting at aNode
+    // we can't use |body.textContent| because it does not give us
+    // a \n for BR elements... Unfortunately...
+    var sourceString = this.mHighlighter._textContent(currentNode);
+
+    // ok now we have the node from where we want to refresh and
+    // the corresponding portion of the source code. We need a
+    // context expectation...
+    aNode = currentNode.previousSibling;
+    // let's skip ignored nodes
+    while (aNode && aNode.getAttribute("ignored"))
+      aNode = aNode.previousSibling;
+    var expecting = "";
+    if (aNode)
+      expecting = aNode.getAttribute("expecting");
+    // if we have no context expectation, let's assume we're at the
+    // beginning of the document 
+    if (!expecting)
+      expecting = this.mHighlighter.getTokenizer().getGrammar().mFirstContextId;
+
+    // we want kNODES_TO_GO clean tokens before we say the document
+    // is refreshed
+    this.mHighlighter.mNodesToGo = this.mHighlighter.kNODES_TO_GO;
+
+    var tokenizer = this.mHighlighter.mTokenizer;
+    //var context = tokenizer.mGrammar.getElementById(expecting);
+    this.mHighlighter.mLastIndex = 0;
+    this.mHighlighter.mCharsToConsume = 0;
+    this.mHighlighter.mInsertBeforeNode = currentNode;
+
+    // we have a callback for each token or error reported
+    this.mHighlighter.mInsertionCallback = this.tokenizerInsertionCallback;
+
+    // we don't want our changes to the document to trigger again
+    // a refresh
+    this.mRefreshing = true;
+
+    // let's dance baby !
+
+    this.mHighlighter.checkContext(this.mHighlighter, sourceString, expecting);
+  },
+  
+  postRefresh: function postRefresh()
+  {
+    // finalize the aggregation of all transactions
+    this.mDiavoloEditorCore.setShouldTxnSetSelection(true);
+    this.mDiavoloEditorCore.endTransaction();
+    // go back to the normal state of the editor
+    this.mRefreshing = false;
+    this.mBatch = false;
+    // and restore the caret's poisition
+    this.mHighlighter.restoreSelection();
+  },
+
+  tokenizerInsertionCallback: function tokenizerInsertionCallback(aHighlighter,
+                                                                  aTokenizer)
+  {
+    var node = aHighlighter.mInsertBeforeNode;
+    if (!node)
+      return false;
+    if (aHighlighter.mCharsToConsume <= 0)
+      aHighlighter.mCharsToConsume += node.textContent.length;
+    var oldNode = node.previousSibling; // always exists
+    if (!oldNode)
+      return false;
+    aHighlighter.mCharsToConsume -= oldNode.textContent.length;
+    //dump(aHighlighter.mCharsToConsume + ": " + oldNode.textContent + " | " + node.textContent + "\n");
+    if (oldNode.nodeName.toLowerCase() != node.nodeName.toLowerCase())
+    {
+      aHighlighter.mNodesToGo = aHighlighter.kNODES_TO_GO;
+    }
+    else if (oldNode.nodeName.toLowerCase() == "br")
+    {}
+    else if (oldNode.getAttribute("token") != node.getAttribute("token") ||
+             oldNode.getAttribute("context") != node.getAttribute("context") ||
+             oldNode.getAttribute("expecting") != node.getAttribute("expecting") ||
+             oldNode.getAttribute("partial") != node.getAttribute("partial") ||
+             oldNode.getAttribute("ignored") != node.getAttribute("ignored") ||
+             oldNode.getAttribute("error") != node.getAttribute("error") ||
+             oldNode.textContent.length != node.textContent.length)
+    {
+      aHighlighter.mNodesToGo = aHighlighter.kNODES_TO_GO;
+    }
+    else
+    {
+      if (node.getAttribute("error"))
+      {
+        // let's check if we're back on same error...
+        if (node.getAttribute("skipuntil") == oldNode.getAttribute("skipuntil"))
+          aHighlighter.mNodesToGo = 0;
+        else
+          aHighlighter.mNodesToGo = aHighlighter.kNODES_TO_GO;
+      }
+      else if (!oldNode.getAttribute("partial"))
+        aHighlighter.mNodesToGo--;
+    }
+  
+    
+    if (aHighlighter.mCharsToConsume <= 0)
+    {
+      aHighlighter.mInsertBeforeNode = node.nextSibling;
+      if (node.nodeName.toLowerCase() == "br" &&
+          node.previousSibling.nodeName.toLowerCase() == "br")
+      {
+        var attributes = node.attributes;
+        for (var i = 0; i < attributes.length; i++)
+        {
+          var attr = attributes.item(i);
+          node.previousSibling.setAttribute(attr.nodeName, attr.nodeValue);
+        }
+      }
+      aHighlighter.mIHTMLEditor.deleteNode(node);
+      if (aHighlighter.mCharsToConsume < 0)
+      {
+        var charsToConsume = aHighlighter.mCharsToConsume;
+        do {
+          charsToConsume += aHighlighter.mInsertBeforeNode.textContent.length;
+          if (charsToConsume <= 0)
+          {
+            var node = aHighlighter.mInsertBeforeNode.nextSibling;
+            aHighlighter.mCharsToConsume = charsToConsume;
+            aHighlighter.mIHTMLEditor.deleteNode(aHighlighter.mInsertBeforeNode);
+            aHighlighter.mInsertBeforeNode = node;
+          }
+        }
+        while (charsToConsume < 0 && aHighlighter.mInsertBeforeNode);
+
+      }
+    }
+
+    return (aHighlighter.mNodesToGo <= 0 &&
+            aHighlighter.mCharsToConsume == 0);
+  }
+  
+  
+
+};
+
diff --git a/extensions/diavolo/content/grammar.js b/extensions/diavolo/content/grammar.js
new file mode 100644 (file)
index 0000000..85bc349
--- /dev/null
@@ -0,0 +1,443 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Diavolo.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006-2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+function DiavoloGrammar(aChromeURL)
+{
+  this.init(aChromeURL);
+}
+
+DiavoloGrammar.prototype = {
+  
+  kIOServiceCID      : "@mozilla.org/network/io-service;1",
+  kFileInputStreamCID: "@mozilla.org/network/file-input-stream;1",
+  kScriptableInputCID: "@mozilla.org/scriptableinputstream;1",
+  kUnicodeConverterCID: "@mozilla.org/intl/scriptableunicodeconverter",
+
+  nsIIOService            : Components.interfaces.nsIIOService,
+  nsIFileInputStream      : Components.interfaces.nsIFileInputStream,
+  nsIScriptableInputStream: Components.interfaces.nsIScriptableInputStream,
+  nsIScriptableUnicodeConverter: Components.interfaces.nsIScriptableUnicodeConverter,
+
+  kSTRING_TOKEN: 0,
+  kREGEXP_TOKEN: 1,
+
+  mChromeURL: "",
+  mName: "",
+
+  mGrammarDocument: null,
+
+  mContexts: {},
+  mRegExps: {},
+  mDeftokens: {},
+  mRoles: {},
+  mStyles: [],
+  mErrorStyle: "",
+  mSkipuntilStyle: "",
+
+  mFirstContextId: null,
+
+  // options
+  mCaseInsensitive: false,
+
+  mResolver: new RegExp("\{[a-zA-Z][a-zA-Z0-9]*\}", "g"),
+
+  getGrammarName: function()
+  {
+    return this.mName;
+  },
+
+  getDeftokens: function()
+  {
+    return this.mDeftokens;
+  },
+
+  isCaseInsensitive: function()
+  {
+    return this.mCaseInsensitive;
+  },
+
+  convertToUnicode: function(aCharset, aSrc )
+  {
+    // http://lxr.mozilla.org/mozilla/source/intl/uconv/idl/nsIScriptableUConv.idl
+    var unicodeConverter = Components.classes[this.kUnicodeConverterCID]
+                             .createInstance(this.nsIScriptableUnicodeConverter);
+    unicodeConverter.charset = aCharset;
+    return unicodeConverter.ConvertToUnicode( aSrc );
+  },
+
+  init: function(aChromeURL)
+  {
+    this.mChromeURL = aChromeURL;
+    
+    // Get the grammar file
+    // var urlspec="chrome://diavolo/content/css.xml";
+    var ioService = Components.classes[this.kIOServiceCID]
+                      .getService(this.nsIIOService);
+
+    // Get the baseURI
+    var url = ioService.newURI(aChromeURL, null, null);
+
+    var chann = ioService.newChannelFromURI(url);
+    var inputStream = Components.classes[this.kFileInputStreamCID]
+                        .createInstance(this.nsIFileInputStream);
+    var sis = Components.classes[this.kScriptableInputCID]
+                .createInstance(this.nsIScriptableInputStream);
+
+    sis.init(chann.open());
+    var str = sis.read(sis.available());
+    sis.close();
+    str = this.convertToUnicode("UTF-8",str);
+    var parser = new DOMParser();
+    this.mGrammarDocument = parser.parseFromString(str, "text/xml");
+
+    this.mName = this.mGrammarDocument.documentElement.getAttribute("name");
+
+    this.initRegExps();
+    this.getContexts();
+    this.initStyles();
+
+    // cleanup
+    this.mRegExps = null;
+    this.mGrammarDocument = null;
+  },
+
+  initRegExps: function()
+  {
+    var regexps = this.mGrammarDocument.getElementsByTagName("regexp");
+    var length = regexps.length;
+    for (var i = 0; i < length; i++)
+    {
+      var r     = regexps.item(i);
+      var name  = r.getAttribute("name");
+      var value = r.getAttribute("value");
+
+      this.mRegExps[name] = {value: value, resolved: false};
+    }
+
+    this.resolveAllRegexps();
+    this.getOptions();
+    this.resolveDeftokens();
+  },
+
+  resolveAllRegexps: function()
+  {
+    for (var i in this.mRegExps)
+      this.resolveRegexp(i);
+  },
+
+  resolveRegexp: function(aName)
+  {
+      if (!this.mRegExps[aName].resolved)
+      {
+        var value = this.mRegExps[aName].value;
+        var match = value.match(this.mResolver);
+        if (match)
+        {
+          for (var j = 0; j < match.length; j++)
+          {
+            var m = match[j];
+            var subRegexp = m.substring(1, m.length - 1);
+            this.resolveRegexp(subRegexp);
+
+            var r = new RegExp( "\{" + subRegexp + "\}", "g" )
+            value = value.replace(r, "(" + this.mRegExps[subRegexp].value + ")");
+          }
+          this.mRegExps[aName].value = value;
+        }
+        this.mRegExps[aName].resolved = true;
+      }
+  },
+
+  getOptions: function()
+  {
+    var options = this.mGrammarDocument.getElementsByTagName("option");
+    var length = options.length;
+    for (var i = 0; i < length; i++)
+    {
+      var option = options.item(i);
+      var type = option.getAttribute("type");
+      switch (type)
+      {
+        case "case-insensitive":
+          this.mCaseInsensitive = true;
+          break;
+        default:
+          break;
+      }
+    }
+  },
+
+  resolveDeftokens: function()
+  {
+    var deftokens = this.mGrammarDocument.getElementsByTagName("deftoken");
+    var length = deftokens.length;
+    for (var i = 0; i < length; i++)
+    {
+      var t = deftokens.item(i);
+      var name = t.getAttribute("name");
+      var type, value;
+      if (t.hasAttribute("string"))
+      {
+        type = this.kSTRING_TOKEN;
+        value = t.getAttribute("string");        
+      }
+      else
+      {
+        type = this.kREGEXP_TOKEN;
+        value = new RegExp(this.mRegExps[t.getAttribute("regexp")].value,
+                           this.mCaseInsensitive ? "iy" : "y");
+      }
+      this.mDeftokens[name] = { type: type, value: value};
+    }
+  },
+
+  getNextToken: function getNextToken(aSourceString, aLastIndex)
+  {
+    if (aLastIndex >= aSourceString.length)
+      return null;
+    var tokens = this.mDeftokens;
+    var tokenFound = false;
+    var tokenName = "";
+    var tokenString = "";
+    for (var i in tokens)
+    {
+      var token = tokens[i];
+      switch (token.type)
+      {
+        case this.kSTRING_TOKEN:
+          {
+            var s = token.value;
+            var l = s.length;
+            if (aSourceString.substr(aLastIndex, l) == s)
+            {
+              tokenName = i;
+              tokenString = s;
+              tokenFound = true;
+            }
+          }
+          break;
+        case this.kREGEXP_TOKEN:
+          {
+            var r = token.value;
+            r.lastIndex = aLastIndex;
+            var result = r.exec(aSourceString); 
+            if (result)
+            {
+              tokenName = i;
+              tokenString = result[0];
+              tokenFound = true;
+            }
+          }
+          break;
+        default: // we should never reach this
+          break;
+      }
+      if (tokenFound)
+        break;
+    }
+    if (tokenFound)
+      return {name: tokenName, string: tokenString, error: false};
+    return {name: "", string: aSourceString[aLastIndex], error: true};
+  },
+
+  getContexts: function getContexts()
+  {
+    var contexts = this.mGrammarDocument.getElementsByTagName("context");
+
+    if (contexts.length)
+      this.mFirstContextId = contexts.item(0).getAttribute("id");
+
+    for (var k = 0; k < contexts.length; k++) 
+    {
+      var c = contexts.item(k);
+      var contextName = c.getAttribute("id");
+      this.mContexts[contextName] = {};
+      // get all error handlers
+      var skipuntils = {};
+      var errorsElts = c.getElementsByTagName("error");
+      for (var i = 0; i < errorsElts.length; i++) 
+      {
+        var e = errorsElts.item(i);
+        skipuntils[e.getAttribute("skipuntil")] = e.getAttribute("expecting");
+      }
+      this.mContexts[contextName].skipuntils = skipuntils;
+
+      // now find all tokens to ignore in this context
+      var ignores = {};
+      var ignoreElts = c.getElementsByTagName("ignore");
+      
+      if (ignoreElts && ignoreElts.length) 
+      {
+        
+        if (ignoreElts.length > 1) 
+          dump("more than one <ignore> element found in context " + contextName + "\n")
+        var ignoreElt = ignoreElts.item(0);
+        var typeElts = ignoreElt.getElementsByTagName("type");
+        for (var i = 0; i < typeElts.length; i++) 
+        {
+          var t = typeElts.item(i);
+          ignores[t.getAttribute("name")] = true;
+        }
+      }
+      this.mContexts[contextName].ignores = ignores;
+
+      // and now finally tokens
+      var tokens = [];
+      var tokenElts = c.getElementsByTagName("token");
+      for (var i = 0; i < tokenElts.length; i++) 
+      {
+        t = tokenElts.item(i);
+        var ttype = t.getAttribute("type");
+        var tlookahead = t.hasAttribute("lookahead") ? t.getAttribute("lookahead") : null;
+        var trole = t.getAttribute("role");
+        var texpecting = t.getAttribute("expecting");
+        tokens.push({
+          type: ttype,
+          lookahead: tlookahead,
+          role: trole,
+          expecting: texpecting
+        });
+        // we need to keep track of all roles for color management
+        if (!(trole in this.mRoles))
+          this.mRoles[trole] = true;
+      }
+      this.mContexts[contextName].tokens = tokens;
+    }
+  },
+
+  initStyles: function initStyles()
+  {
+    var stylesets = this.mGrammarDocument.getElementsByTagName("styleset");
+    if (!stylesets || !stylesets.length)
+      return;
+    var styles = stylesets[0].getElementsByTagName("style");
+    for (var i = 0; i < styles.length; i++)
+    {
+      var s = styles.item(i);
+      var role = s.getAttribute("role");
+      var forToken = s.hasAttribute("forToken")
+                     ? s.getAttribute("forToken")
+                     : "";
+      var value = s.getAttribute("value");
+
+      this.mStyles.push( { role:     role,
+                           forToken: forToken,
+                           value:    value }); 
+    }
+
+    var errorstyles = stylesets[0].getElementsByTagName("errorstyle");
+    if (errorstyles && errorstyles.length)
+    {
+      this.mErrorStyle = errorstyles[0].getAttribute("value"); 
+    }
+
+    var skipuntilstyles = stylesets[0].getElementsByTagName("skipuntilstyle");
+    if (skipuntilstyles && skipuntilstyles.length)
+    {
+      this.mSkipuntilStyle = skipuntilstyles[0].getAttribute("value"); 
+    }
+  },
+
+  buildStylesheet: function buildStylesheet()
+  {
+    var cssText = "";
+
+    cssText += "*[error='true'] {" + this.mErrorStyle + "}\n";
+    cssText += ".SKIPUNTIL {" + this.mSkipuntilStyle + "}\n";
+
+    for (var i = 0; i < this.mStyles.length; i++)
+    {
+      var s = this.mStyles[i];
+      cssText += "." + s.role
+                     + (s.forToken ? "[token='" + s.forToken + "']"
+                                   : "")
+                     + " {"
+                     + s.value
+                     + "}\n"; 
+    }
+
+    return cssText;
+  },
+
+  getRoles: function getRoles()
+  {
+    var res = [];
+    for (var i in this.mRoles)
+      res.push(i);
+    return res;
+  },
+
+  getTokens: function getTokens()
+    {
+    var res = [];
+    for (var i in this.mDeftokens)
+      res.push(i);
+    return res;
+  },
+
+  getStyles: function getStyles(aRole, aForToken)
+  {
+    return this.mStyles;
+  },
+
+  setStyles: function setStyles(aStyles)
+  {
+    this.mStyles = aStyles;
+  },
+
+  getErrorStyle: function getErrorStyle()
+  {
+    return this.mErrorStyle;
+  },
+  
+  setErrorStyle: function setErrorStyle(aStyle)
+  {
+    this.mErrorStyle = aStyle;
+  },
+  
+  getSkipuntilStyle: function getSkipuntilStyle()
+  {
+    return this.mSkipuntilStyle;
+  },
+  
+  setSkipuntilStyle: function setSkipuntilStyle(aStyle)
+  {
+    this.mSkipuntilStyle = aStyle;
+  }
+  
+};
+
diff --git a/extensions/diavolo/content/highlighter.js b/extensions/diavolo/content/highlighter.js
new file mode 100644 (file)
index 0000000..5045470
--- /dev/null
@@ -0,0 +1,615 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Diavolo.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006-2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+function DiavoloHighlighter(aSourceString, aGrammarURL, aEditor)
+{
+  this.init(aSourceString, aGrammarURL, aEditor);
+}
+
+DiavoloHighlighter.prototype= {
+
+  kHTML_NAMESPACE: "http://www.w3.org/1999/xhtml",
+
+  mTokenizer: null,
+  mFirstContext: null,
+  mLastIndex: 0,
+
+  mElement: null,
+  mEditor: null,
+  mDoc: null,
+  mIHTMLEditor: null,
+
+  mInsertBeforeNode: null,
+  mInsertionCallback: null,
+
+  kNODES_TO_GO: 4,
+  mNodesToGo: 0,
+
+  mCharsToConsume: 0,
+
+  mSelEndContainer: null,
+  mSelEndOffset: 0,
+  mGlobalOffset: 0,
+
+  getIndexOfNode: function getIndexOfNode(aParent, aNode)
+  {
+    if (aNode)
+    {
+      // the following 3 lines are an excellent suggestion from Neil Rashbrook
+      var range = aNode.ownerDocument.createRange();
+      range.selectNode(aNode);
+      return range.startOffset;
+    }
+    return aParent.childNodes.length - 1;
+  },
+
+  installStylesheet: function installStylesheet()
+  {
+    // apply the stylesheet for the document
+    var head = this.mDoc.getElementsByTagName("head").item(0);
+    var styleElts = head.getElementsByTagName("style");
+    for (var i = styleElts.length - 1 ; i >= 0; i--)
+    {
+      head.removeChild(styleElts[i]);
+    }
+
+    var style = this.mDoc.createElementNS(this.kHTML_NAMESPACE, "style");
+    style.setAttribute("type", "text/css");
+    var styles = this.mTokenizer.mGrammar.buildStylesheet() +
+                 "span { -moz-binding: url('chrome://diavolo/content/completionPopup.xml#popup'); }" +
+                 "option { -moz-user-select: text !important; -moz-user-input: auto ! important; font-size: smaller; }" +
+                 "div[anonid='ChoicePopup'] select { -moz-user-select: none !important; \
+                           -moz-user-input: auto !important; \
+                           -moz-user-focus: none !important; }";
+    var text = this.mDoc.createTextNode(styles);
+    style.appendChild(text);
+    head.appendChild(style);
+  },
+
+  init: function(aSourceString, aGrammarURL, aXULElement)
+  {
+    if (!aXULElement || aXULElement.localName != "editor")
+      return;
+
+
+    this.mEditor = aXULElement;
+    this.mDoc = aXULElement.contentDocument;
+    this.mElement = this.mDoc.body;
+
+    // WARNING the following line is workaround for bug 442686
+    this.mDoc.body.style.whiteSpace = "pre-wrap";
+
+    this.mDoc.body.style.fontFamily = "-moz-fixed";
+    // apply our binding for line numbering
+    this.mDoc.body.style.MozBinding = "url('chrome://diavolo/content/linenumbering.xml#linenumbering')";
+    
+    this.mIHTMLEditor = aXULElement.getHTMLEditor(aXULElement.contentWindow);
+    // disable spell checker if any
+    try {
+      var spc =  this.mIHTMLEditor.getInlineSpellChecker(false);
+      if (spc)
+        spc.enableRealTimeSpell = false;
+    }
+    catch(e) {}
+
+    // the following line is absolutely mandatory or the editor will react
+    // strangely until it gets the focus... call that a bug in the editor...
+    aXULElement.focus();
+
+    // starting from here, we want all changes we make to the edited doc
+    // to be merged into one single Undo/Redo transaction
+    this.mIHTMLEditor.beginTransaction();
+
+    // create a tokenizer for our grammar
+    this.mTokenizer = new DiavoloTokenizer(aGrammarURL);
+    if (!this.mTokenizer)
+      return null;
+
+    this.installStylesheet();
+    
+    // we start parsing aSourceString from the first char
+    this.mLastIndex = 0;
+    this.mInsertBeforeNode = null;
+    // and since we're not refreshing, no callback on changes
+    this.mInsertionCallback = null;
+
+    // let's dance !
+    this.checkContext(this, aSourceString,
+                      this.getTokenizer().getGrammar().mFirstContextId);
+
+
+    // we're done ; let's close the aggregated transaction we started above 
+    this.mIHTMLEditor.endTransaction();
+
+    // We have to deal with a weird case here... The selection
+    // is originally after the last span of the document and
+    // before the trailing special <br> the editor adds...
+    // That's bad and we want the caret to be placed at the end
+    // of the text node child of the last span if any, and right
+    // before the last <br> is there's no span in the document.
+    var child = this.mElement.lastChild;
+    while (child && child.nodeName.toLowerCase() != "span")
+      child = child.previousSibling;
+    if (child)
+    {
+      child = child.lastChild; // this is the last text node in the span
+      this.mIHTMLEditor.selection.collapse(child, child.data.length);
+    }
+    else
+    {
+      var n = this.mElement.childNodes.length;
+      this.mIHTMLEditor.selection.collapse(this.mElement, n -1);
+    }
+
+    // how many lines to we have in our source code ?
+    var n = 1;
+    try {
+      n = aSourceString.match( /\n/g ).length + 1;
+    }
+    catch(e) {}
+
+    // let's update line numbering.
+    // we need to let a few cycles pass because of the line numbering XBL
+    // otherwise it's not applied yet :-(
+    setTimeout(this.postCreate, 100, this.mIHTMLEditor.rootElement, n);
+  },
+
+  postCreate: function postCreate(aElt, aLines)
+  {
+    // update the line numbering
+    aElt.wrappedJSObject.update(aLines);
+  },
+
+  getTokenizer: function getTokenizer()
+  {
+    return this.mTokenizer;
+  },
+
+  checkContext: function checkContext(aH, aSourceString, contextName)
+  {
+    // sanity check
+    for (var foo = 0; contextName; foo++)
+    {
+      var aCtx = aH.getTokenizer().getGrammar().mContexts[contextName];
+
+      var ignoreSkipUntil = null;
+      var ignoreExpecting = aH.getTokenizer().getGrammar().mFirstContextId;
+
+      var nextToken;
+
+      var ignoredToken = true;
+      do {
+        // get the next token in |aSourceString| at position
+        // |this.mLastIndex|
+        nextToken = aH.getTokenizer().getNextToken(aSourceString, aH.mLastIndex);
+        // if the result is null, we have hit the boundaries of the string so
+        // let's go shopping
+        if (!nextToken)
+          return;
+
+        // we do not have a real token, the tokenizer only returned the next
+        // char on the stack and said it can't understand it ; since an error
+        // cannot be an ignored token, we break here
+        if (nextToken.error)
+          break;
+
+        // is our current token ignored ?
+        ignoredToken = (nextToken.name in aCtx.ignores);
+        if (ignoredToken)
+        {
+          // yes, it's ignored ; first let's update the stack
+          aH.mLastIndex += nextToken.string.length;
+          // and report an ignored token
+          if (aH.reportToken(nextToken.name,
+                               nextToken.string,
+                               null,
+                               null,
+                               contextName,
+                               false, // not partial at this time
+                               true)) // token ignored
+            return ;
+
+        }
+        // of course, we loop until the next token is not ignored...
+      }
+      while (ignoredToken);
+
+      // at this point, we have either an error or a token
+      // let's find all the tokens accepted in the current context
+
+      // clear the next context
+
+      var nextContextID = null;
+      if (!nextToken.error)
+      {
+        for (var i = 0; !nextContextID && i < aCtx.tokens.length; i++)
+        {
+          var ctxToken = aCtx.tokens[i];
+          var nextToken = aH.getTokenizer().getNextTokenAs(aSourceString,
+                                                           aH.mLastIndex,
+                                                           ctxToken.type);
+          if (!nextToken)
+            return;
+          if (!nextToken.error)
+          {
+            // we found a possible token for this context
+            // let's check if we need to look ahead
+            var consume = true;
+            if (ctxToken.lookahead)
+            {
+              // yep, look ahead needed, let's get another token without
+              // updating this.mLastIndex
+              var lookaheadTokenName = ctxToken.lookahead;
+              var lToken = aH.getTokenizer().getNextTokenAs(aSourceString,
+                                                            aH.mLastIndex + nextToken.string.length,
+                                                            lookaheadTokenName); 
+              consume = (lToken && !lToken.error);
+              // do we have a match in the current context ?
+            }
+            if (consume)
+            {
+              // yes we do, let's report the token
+              if (aH.reportToken(nextToken.name,
+                                   nextToken.string,
+                                   ctxToken.role,
+                                   ctxToken.expecting,
+                                   contextName,
+                                   false,
+                                   false))
+                return;
+              if (ctxToken.expecting)
+              {
+                nextContextID = ctxToken.expecting;
+                aH.mLastIndex += nextToken.string.length;
+              }
+              else
+                return;
+            }
+
+          }
+        }
+      }
+
+      if (!nextContextID) // we did not consume, we're in an error loop
+      {
+        var skipuntils = " ";
+        for (i in aCtx.skipuntils)
+          skipuntils += i + " ";
+        try {
+          nextToken = aH.getTokenizer().getNextToken(aSourceString, aH.mLastIndex);
+          var skipuntilTokenFound = false;
+          var expecting = contextName;
+          do {
+            if (!nextToken)
+            {
+              // we reached the end of source string
+              return;
+            }
+
+            aH.mLastIndex += nextToken.string.length;
+            if (nextToken.name in aCtx.skipuntils)
+            {
+              skipuntilTokenFound = true;
+
+              expecting = aCtx.skipuntils[nextToken.name];
+              nextContextID = expecting;
+              if (aH.reportToken(nextToken.name,
+                                   nextToken.string,
+                                   "SKIPUNTIL",
+                                   expecting,
+                                   contextName,
+                                   false,
+                                   false))
+                return;
+            }
+            else
+            {
+              if (aH.reportError(nextToken.name,
+                                   nextToken.string,
+                                   null,
+                                   expecting,
+                                   skipuntils,
+                                   false))
+                return;
+              nextToken = aH.getTokenizer().getNextToken(aSourceString, aH.mLastIndex);
+            }
+          }
+          while (!skipuntilTokenFound);
+        }
+        catch(e) {}
+      }
+
+      contextName = nextContextID;
+    }
+  },
+
+  reportToken: function reportToken(aName, aString, aRole, aExpecting,
+                                    aCtxName, aPartial, aIgnored)
+  {
+    var stopAfterReport = false;
+    
+    if (!this.mElement || !aString)
+      return stopAfterReport;
+    // do we have more than one line in our token ?
+    var lines = aString.split( /\r\n|\n/g );
+    var doc = this.mElement.ownerDocument;
+    if (lines.length == 1)
+    {
+      // one line only
+      if (this.mInsertBeforeNode && this.mInsertBeforeNode.nodeType == Node.ELEMENT_NODE)
+      {
+        var n = this.mInsertBeforeNode;
+        // is our new token exactly the one we originally had after the
+        // recent changes?
+        if (aString == n.textContent &&
+            aName == n.getAttribute("token") &&
+            aCtxName == n.getAttribute("context") &&
+            aExpecting == n.getAttribute("expecting") &&
+            aPartial == n.hasAttribute("partial") &&
+            !aIgnored && !n.hasAttribute("ignored") &&
+            (aRole ? aRole : aName) == n.getAttribute("class"))
+        {
+          // yes, and it's not ignored ; do nothing and early way out
+          this.mInsertBeforeNode = this.mInsertBeforeNode.nextSibling;
+          // one "clean" token less to go
+          this.mNodesToGo--;
+          return (!this.mNodesToGo);
+        }
+      }
+
+      // create a new span for our token
+      var offset = this.getIndexOfNode(this.mElement, this.mInsertBeforeNode);
+      // and insert it before our insertion point
+      var span = this.mIHTMLEditor.createNode("span", this.mElement, offset);
+      this.mIHTMLEditor.setAttribute(span, "token", aName);
+      this.mIHTMLEditor.setAttribute(span, "context", aCtxName);
+      if (aExpecting)
+        this.mIHTMLEditor.setAttribute(span, "expecting", aExpecting);
+      if (aPartial)
+        this.mIHTMLEditor.setAttribute(span, "partial", "true");
+      if (aIgnored)
+        this.mIHTMLEditor.setAttribute(span, "ignored", "true");
+      if (aRole)
+        this.mIHTMLEditor.setAttribute(span, "class", aRole);
+      else
+        this.mIHTMLEditor.setAttribute(span, "class", aName);
+
+      var s = doc.createTextNode(aString);
+      this.mIHTMLEditor.insertNode(s, span, 0);
+
+      // if we're refreshing, call our callback on token insertion
+      if (this.mInsertionCallback)
+        stopAfterReport = this.mInsertionCallback(this, this.mTokenizer);
+    }
+    else
+    {
+      // it's a multiline token, we're going to split it into multiple
+      // spans and BRs carrying partial="true"
+      for (var i = 0; i < lines.length; i++)
+      {
+        var line = lines[i];
+        if (line)
+        {
+          if (this.reportToken(aName, line, aRole, aExpecting, aCtxName,
+                               (i != 0), aIgnored))
+            return true;
+        }
+        if (i != lines.length - 1)
+        {
+          var offset = this.getIndexOfNode(this.mElement, this.mInsertBeforeNode);
+          var brNode = doc.createElementNS(this.kHTML_NAMESPACE, "br");
+          this.mIHTMLEditor.insertNode(brNode, this.mElement, offset);
+          brNode.setAttribute("token", aName);
+          brNode.setAttribute("context", aCtxName);
+          if (aExpecting)
+            brNode.setAttribute("expecting", aExpecting);
+          if (aPartial)
+            brNode.setAttribute("partial", "true");
+          if (aIgnored)
+            brNode.setAttribute("ignored", "true");
+
+          if (this.mInsertionCallback)
+            stopAfterReport |= this.mInsertionCallback(this, this.mTokenizer);
+        }
+      }
+    }
+    return stopAfterReport;
+  },
+
+  reportError: function reportError(aName, aString, aRole, aExpecting,
+                                    aSkipuntil, aPartial)
+  {
+    // just like reportToken() but we insert elements with error="true"
+
+    var stopAfterReport = false;
+    if (!this.mElement || !aString)
+      return stopAfterReport;
+    var lines = aString.split( /\r\n|\n/g );
+    var doc = this.mElement.ownerDocument;
+    if (lines.length == 1)
+    {
+      var span = doc.createElementNS(this.kHTML_NAMESPACE, "span");
+      if (aRole)
+        span.className = aRole;
+      else
+        span.className = aName;
+      span.setAttribute("token", aName);
+      if (aExpecting)
+        span.setAttribute("expecting", aExpecting);
+      if (aPartial)
+        span.setAttribute("partial", "true");
+      if(aSkipuntil)
+        span.setAttribute("skipuntil", aSkipuntil)
+      span.setAttribute("error", "true");
+      
+      var s = doc.createTextNode(aString);
+      span.appendChild(s);
+      var offset = this.getIndexOfNode(this.mElement, this.mInsertBeforeNode);
+      this.mIHTMLEditor.insertNode(span, this.mElement, offset);
+      if (this.mInsertionCallback)
+        stopAfterReport = this.mInsertionCallback(this, this.mTokenizer);
+    }
+    else
+    {
+      for (var i = 0; i < lines.length; i++)
+      {
+        var line = lines[i];
+        if (line)
+        {
+          this.reportError(aName, line, aRole, aExpecting, aSkipuntil, true);
+        }
+        if (i != lines.length - 1)
+        {
+          var offset = this.getIndexOfNode(this.mElement, this.mInsertBeforeNode);
+          this.mIHTMLEditor.insertNode(doc.createElementNS(this.kHTML_NAMESPACE, "br"), this.mElement, offset);
+          if (this.mInsertionCallback)
+            stopAfterReport |= this.mInsertionCallback(this, this.mTokenizer);
+        }
+      }
+    }
+    return stopAfterReport;
+  },
+
+  preserveSelection: function preserveSelection()
+  {
+    // let's preserve the caret's position ; after edit changes,
+    // the selection is always collapsed
+
+    // we're going to preserve it counting the chars from the
+    // beginning of the document up to the caret, just like in
+    // a plaintext editor ; BRs count for "\n" so 1 char.
+    var range = this.mIHTMLEditor.selection.getRangeAt(0);
+    this.mSelEndContainer   = range.endContainer;
+    this.mSelEndOffset      = range.endOffset;
+    this.mGlobalOffset = 0; 
+
+    if (this.mSelEndContainer.nodeType == Node.TEXT_NODE)
+    {
+      if (this.mSelEndContainer.parentNode.nodeName.toLowerCase() != "body")
+        this.mSelEndContainer = this.mSelEndContainer.parentNode;
+      this.mGlobalOffset = this.mSelEndOffset;
+    }
+    else
+    {
+      var children = this.mSelEndContainer.childNodes;
+      var l = children.length;
+      for (var i = 0; i < l && i < this.mSelEndOffset; i++)
+      {
+        var child = children.item(i);
+        switch (child.nodeType)
+        {
+          case Node.TEXT_NODE:
+            this.mGlobalOffset += child.data.length;
+            break;
+          case Node.ELEMENT_NODE:
+            if (child.nodeName.toLowerCase() == "br")
+              this.mGlobalOffset++;
+            else
+              this.mGlobalOffset += child.textContent.length;
+            break;
+          default:
+            break;
+        }
+      }
+      if (this.mSelEndContainer.nodeName.toLowerCase() == "body")
+        return;
+    }
+
+    var node = this.mSelEndContainer.previousSibling;
+    while (node)
+    {
+      if (node.nodeName.toLowerCase() == "br")
+        this.mGlobalOffset += 1;
+      else
+        this.mGlobalOffset += node.textContent.length;
+      node = node.previousSibling;
+    }
+  },
+
+  restoreSelection: function restoreSelection()
+  {
+    // let's restore the caret at our previous position using the
+    // char offset we stored in restoreSelection()
+    var node = this.mElement.firstChild;
+    var offset = 0;
+    while (node &&
+           ((node.nodeName.toLowerCase() == "br") ? 1 : node.textContent.length) < this.mGlobalOffset)
+    {
+      if (node.nodeName.toLowerCase() == "br")
+        this.mGlobalOffset--;
+      else
+        this.mGlobalOffset -= node.textContent.length;
+      node = node.nextSibling;
+    }
+    if (node)
+    {
+      if (node.nodeName.toLowerCase() == "span") 
+        this.mIHTMLEditor.selection.collapse(node.firstChild, this.mGlobalOffset);
+      else if (node.nodeType == Node.TEXT_NODE) 
+      {
+        this.mIHTMLEditor.selection.collapse(node, this.mGlobalOffset);
+      }
+      else // this is a BR element
+        if (this.mGlobalOffset)
+          this.mIHTMLEditor.setCaretAfterElement(node);
+        else
+          this.mIHTMLEditor.beginningOfDocument();
+    }
+  },
+
+
+  _textContent: function _textContent(aNode)
+  {
+    // get source string starting at aNode
+    // we can't use |body.textContent| because it does not give us
+    // a \n for BR elements... Unfortunately...
+    var sourceString = "";
+    while (aNode)
+    {
+      if (aNode.nodeName.toLowerCase() == "br")
+      {
+        if (aNode.nextSibling)
+          sourceString += "\n";
+      }
+      else
+        sourceString += aNode.textContent; 
+      aNode = aNode.nextSibling;
+    }
+    return sourceString;
+  }
+
+};
diff --git a/extensions/diavolo/content/linenumbering.css b/extensions/diavolo/content/linenumbering.css
new file mode 100644 (file)
index 0000000..b69a426
--- /dev/null
@@ -0,0 +1,65 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Diavolo.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006-2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+[anonid="linenumbers"] {
+  width: 6ex;
+  color: rgb(102, 102, 102);
+  background-color: rgb(204, 204, 204);
+  text-align: right;
+  padding-left: 1ex;
+  padding-right: 1ex;
+  -moz-user-select: none;
+  -moz-user-select: none;
+  cursor: pointer;
+}
+
+[anonid="sourcecontent"] {
+  white-space: pre;
+  font-family: -moz-fixed;
+}
+
+pre {
+  margin: 0px;
+  padding: 0px ;
+  min-width : 100%;
+  -moz-user-select: none;
+}
+
+pre:hover {
+  background-color: #404040;
+  color: white;
+}
diff --git a/extensions/diavolo/content/linenumbering.xml b/extensions/diavolo/content/linenumbering.xml
new file mode 100644 (file)
index 0000000..4ab3b50
--- /dev/null
@@ -0,0 +1,105 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is Diavolo.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL
+   - Portions created by the Initial Developer are Copyright (C) 2006-2008
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (glazman@disruptive-innovations.com), Original author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<bindings id="linenumberingBindings"
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:html="http://www.w3.org/1999/xhtml"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
+
+  <binding id="linenumbering">
+
+    <resources>
+      <stylesheet src="chrome://diavolo/content/linenumbering.css"/>
+    </resources>
+
+    <content><html:table anonid="table"><html:tbody><html:tr><html:td xbl:inherits="style=numberingstyle" valign="top" anonid="linenumbers" max="1"><html:pre>1.</html:pre></html:td><html:td valign="top" anonid="sourcecontent"><children/></html:td></html:tr></html:tbody></html:table></content>
+
+    <implementation>
+
+      <property name="mNumbers"
+                readonly="true"
+                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'table').firstChild.firstChild.firstChild" />
+
+
+      <method name="update">
+        <parameter name="aMax"/>
+        <body>
+        <![CDATA[
+          var n = this.mNumbers;
+          var max = parseInt(n.getAttribute("max"));
+
+          if (aMax > max)
+          {
+            for (var i = max + 1 ; i <= aMax; i++)
+            {
+              var t = document.createTextNode(i + ".");
+              var p = document.createElement("pre");
+
+              p.appendChild(t);
+              n.appendChild(p);
+            }
+          }
+          else if (aMax < max)
+          {
+            if (!aMax) aMax = 1;
+            for (var i = max ; i > aMax; i--)
+            {
+              if (n.lastChild) n.removeChild(n.lastChild);
+            }
+          }
+          n.setAttribute("max", aMax);
+        ]]>
+        </body>
+      </method>
+
+    </implementation>
+
+    <handlers>
+      <handler event="mousedown" phase="capturing">
+        <![CDATA[
+          var elt = event.target;
+          if (elt.nodeName.toLowerCase() == "p")
+            alert(elt.textContent);
+        ]]>
+      </handler>
+    </handlers>
+
+  </binding>
+</bindings>
diff --git a/extensions/diavolo/content/selector.js b/extensions/diavolo/content/selector.js
new file mode 100644 (file)
index 0000000..624afe1
--- /dev/null
@@ -0,0 +1,125 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Diavolo.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006-2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+function DiavoloSelector(aDiavoloEditor)
+{
+  this.init(aDiavoloEditor);
+}
+
+DiavoloSelector.prototype = {
+  
+  mDiavoloEditor: null,
+
+  mSelecting: false,
+  mStartOffset: -1,
+  mEndOffset: -1,
+
+  init: function init(aDiavoloEditor)
+  {
+    this.mDiavoloEditor = aDiavoloEditor;
+  },
+
+  selectLine: function selectLine(e)
+  {
+    if (!this.mDiavoloEditor)
+      return;
+    var node = e.originalTarget;
+    if (node.localName.toLowerCase() != "pre")
+      return;
+
+    this.mSelecting = true;
+    
+    var line = parseInt(e.originalTarget.textContent);
+    var startOffset = -1;
+    var endOffset = -1;
+    var offset = 0;
+    var node = this.mDiavoloEditor.mHighlighter.mElement.firstChild;
+    var currentLine = 1;
+    while (currentLine <= line)
+    {
+      if (line == currentLine)
+      {
+        if (startOffset == -1)
+          startOffset = offset;
+        endOffset = offset;
+      }
+      if (node.nodeName.toLowerCase() == "br")
+        currentLine++;
+
+      node = node.nextSibling;
+      offset++;
+
+    }
+    if (startOffset == -1 || endOffset == -1)
+      return;
+
+    if (this.mStartOffset == -1)
+      this.mStartOffset = startOffset;
+
+    this.mEndOffset = endOffset;
+
+    if (this.mEndOffset >= this.mStartOffset)
+    {
+      startOffset = this.mStartOffset;
+      endOffset = this.mEndOffset + 1;
+    }
+    else
+    {
+      startOffset = this.mEndOffset;
+      endOffset = this.mStartOffset+1;
+    }
+
+    this.mDiavoloEditor.mEditorCore.selection.collapse(this.mDiavoloEditor.mHighlighter.mElement,
+                                                       startOffset);
+    this.mDiavoloEditor.mEditorCore.selection.extend(this.mDiavoloEditor.mHighlighter.mElement,
+                                                       endOffset);
+  },
+
+  extendSelection: function extendSelection(e)
+  {
+    if (this.mSelecting)
+      this.selectLine(e);
+  },
+
+  stopSelectLine: function stopSelectLine(e)
+  {
+    this.mSelecting = false;
+    this.mStartOffset = -1;
+    this.mEndOffset = -1;
+  }
+
+}
diff --git a/extensions/diavolo/content/sourceeditor.xml b/extensions/diavolo/content/sourceeditor.xml
new file mode 100644 (file)
index 0000000..13924d2
--- /dev/null
@@ -0,0 +1,179 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is Diavolo.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL
+   - Portions created by the Initial Developer are Copyright (C) 2006-2008
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (glazman@disruptive-innovations.com), Original author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<bindings id="sourceeditorBindings"
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:html="http://www.w3.org/1999/xhtml"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
+
+  <binding id="sourceeditor">
+
+    <content>
+      <xul:editor flex="1" anonid="editor" editortype="html" type="content-primary"
+                  onmousedown="this.parentNode.mSelector.selectLine(event, this)"
+                  onmouseover="this.parentNode.mSelector.extendSelection(event, this)"
+                  onmouseup="this.parentNode.mSelector.stopSelectLine(event, this)"
+                  />
+    </content>
+
+    <implementation>
+
+      <!-- ******************************************************
+           * CONSTRUCTOR AND DESTRUCTOR
+           ****************************************************** -->
+
+      <destructor>
+        <![CDATA[
+          if (this.mEditor)
+            this.mEditor.shutdown();
+        ]]>
+      </destructor>
+
+      <!-- ******************************************************
+           * FIELDS AND PROPERTIES
+           ****************************************************** -->
+
+      <field name="mSelector">null</field>
+      <field name="mEditor">null</field>
+
+      <property name="mXULEditor"
+                readonly="true"
+                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'editor')" />
+
+      <property name="editorCore"
+                readonly="true"
+                onget="return this.mEditor.mEditorCore" />
+
+      <property name="roles"
+                readonly="true"
+                onget="return this.mEditor.mHighlighter.mTokenizer.mGrammar.getRoles()" />
+
+      <property name="tokens"
+                readonly="true"
+                onget="return this.mEditor.mHighlighter.mTokenizer.mGrammar.getTokens()" />
+
+      <property name="textContent">
+        <getter>
+          return this.mEditor.textContent();
+        </getter>
+        <setter>
+          <![CDATA[
+            this.mEditor.clear();
+            this.editorCore.QueryInterface(Components.interfaces.nsIPlaintextEditor)
+              .insertText(val);
+          ]]>
+        </setter>
+      </property>
+
+      <property name="styles">
+        <getter>
+          return this.mEditor.mHighlighter.mTokenizer.mGrammar.getStyles();
+        </getter>
+        <setter>
+          <![CDATA[
+            this.mEditor.mHighlighter.mTokenizer.mGrammar.getStyles(val);
+            this.mEditor.mHighlighter.installStylesheet();
+          ]]>
+        </setter>
+      </property>
+
+      <property name="errorStyle">
+        <getter>
+          return this.mEditor.mHighlighter.mTokenizer.mGrammar.getErrorStyle();
+        </getter>
+        <setter>
+          <![CDATA[
+            this.mEditor.mHighlighter.mTokenizer.mGrammar.setErrorStyle(val);
+          ]]>
+        </setter>
+      </property>
+
+      <property name="skipuntilStyle">
+        <getter>
+          return this.mEditor.mHighlighter.mTokenizer.mGrammar.getSkipuntilStyle();
+        </getter>
+        <setter>
+          <![CDATA[
+            this.mEditor.mHighlighter.mTokenizer.mGrammar.setSkipuntilStyle(val);
+          ]]>
+        </setter>
+      </property>
+
+      <!-- ******************************************************
+           * PRIVATE METHODS
+           ****************************************************** -->
+
+      <!-- ******************************************************
+           * PUBLIC METHODS
+           ****************************************************** -->
+
+      <method name="init">
+        <body>
+        <![CDATA[
+          this.mXULEditor.makeEditable("html", false);
+          if (!this.hasAttribute("grammarURL"))
+            return;
+
+          this.mEditor = new DiavoloEditor("",
+                                           this.getAttribute("grammarURL"),
+                                           this.mXULEditor);
+          this.editorCore instanceof Components.interfaces.nsIEditorStyleSheets;
+          this.editorCore.replaceOverrideStyleSheet("chrome://diavolo/content/EditorOverride.css");
+
+          this.mXULEditor.docShell.allowJavascript = true;
+
+          this.mSelector = new DiavoloSelector(this.mEditor);
+          this.mXULEditor.contentWindow.focus();
+        ]]>
+        </body>
+      </method>
+
+      <method name="clear">
+        <body>
+        <![CDATA[
+          this.mEditor.clear();
+        ]]>
+        </body>
+      </method>
+
+    </implementation>
+
+  </binding>
+</bindings>
diff --git a/extensions/diavolo/content/tokeniser.js b/extensions/diavolo/content/tokeniser.js
new file mode 100644 (file)
index 0000000..88c1cb3
--- /dev/null
@@ -0,0 +1,158 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Diavolo.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006-2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+function DiavoloTokenizer(aURLspec)
+{
+  this.init(aURLspec);
+}
+
+DiavoloTokenizer.prototype = {
+
+  mGrammar: null,
+
+  init: function(aURLspec)
+  {
+    // Get the grammar file
+    this.mGrammar = new DiavoloGrammar(aURLspec);
+  },
+
+  getGrammar: function getGrammar()
+  {
+    return this.mGrammar;
+  },
+
+  getNextToken: function getNextToken(aSourceString, aLastIndex)
+  {
+    if (aLastIndex >= aSourceString.length)
+      return null;
+    var tokens = this.getGrammar().getDeftokens();
+    var tokenFound = false;
+    var tokenName = "";
+    var tokenString = "";
+    for (var i in tokens)
+    {
+      var token = tokens[i];
+      switch (token.type)
+      {
+        case this.getGrammar().kSTRING_TOKEN:
+          {
+            var s = token.value;
+            var l = s.length;
+            if (aSourceString.substr(aLastIndex, l) == s)
+            {
+              tokenName = i;
+              tokenString = s;
+              tokenFound = true;
+            }
+          }
+          break;
+        case this.getGrammar().kREGEXP_TOKEN:
+          {
+            var r = token.value;
+            r.lastIndex = aLastIndex;
+            var result = r.exec(aSourceString); 
+            if (result)
+            {
+              tokenName = i;
+              tokenString = result[0];
+              tokenFound = true;
+            }
+          }
+          break;
+        default: // we should not ever reach this
+          break;
+      }
+      if (tokenFound)
+        break;
+    }
+    if (tokenFound)
+      return {name: tokenName, string: tokenString, error: false};
+    return {name: "", string: aSourceString[aLastIndex], error: true};
+  },
+
+  getNextTokenAs: function getNextTokenAs(aSourceString, aLastIndex, aTokenName)
+  {
+    if (aLastIndex >= aSourceString.length)
+      return null;
+    if (!aTokenName)
+      return this.getNextToken(aSourceString, aLastIndex);
+
+    var tokens = this.getGrammar().getDeftokens();
+    var tokenFound = false;
+    var tokenName = "";
+    var tokenString = "";
+    if (!(aTokenName in tokens))
+      return null;
+
+    var token = tokens[aTokenName];
+    switch (token.type)
+    {
+      case this.getGrammar().kSTRING_TOKEN:
+        {
+          var s = token.value;
+          var l = s.length;
+          if (aSourceString.substr(aLastIndex, l) == s)
+          {
+            tokenName = aTokenName;
+            tokenString = s;
+            tokenFound = true;
+          }
+        }
+        break;
+      case this.getGrammar().kREGEXP_TOKEN:
+        {
+          var r = token.value;
+          r.lastIndex = aLastIndex;
+          var result = r.exec(aSourceString); 
+          if (result)
+          {
+            tokenName = aTokenName;
+            tokenString = result[0];
+            tokenFound = true;
+          }
+        }
+        break;
+      default: // we should not ever reach this
+        break;
+    }
+
+    if (tokenFound)
+      return {name: tokenName, string: tokenString, error: false};
+    return {name: "", string: "", error:true};
+  }
+};
+
diff --git a/extensions/diavolo/jar.mn b/extensions/diavolo/jar.mn
new file mode 100644 (file)
index 0000000..ca8c4df
--- /dev/null
@@ -0,0 +1,16 @@
+diavolo.jar:
+% content   diavolo                            %content/diavolo/
+  content/diavolo/css.xml        (content/css.xml)
+  content/diavolo/css.css        (content/css.css)
+  content/diavolo/tokeniser.js        (content/tokeniser.js)
+  content/diavolo/highlighter.js        (content/highlighter.js)
+  content/diavolo/editor.js        (content/editor.js)
+  content/diavolo/linenumbering.xml        (content/linenumbering.xml)
+  content/diavolo/linenumbering.css        (content/linenumbering.css)
+  content/diavolo/grammar.js        (content/grammar.js)
+  content/diavolo/selector.js        (content/selector.js)
+  content/diavolo/sourceeditor.xml        (content/sourceeditor.xml)
+  content/diavolo/codecompletion.js        (content/codecompletion.js)
+  content/diavolo/cssCompletion.xml        (content/cssCompletion.xml)
+  content/diavolo/completionPopup.xml        (content/completionPopup.xml)
+  content/diavolo/EditorOverride.css        (content/EditorOverride.css)
diff --git a/extensions/jQuery/MIT-LICENSE.txt b/extensions/jQuery/MIT-LICENSE.txt
new file mode 100644 (file)
index 0000000..d4215f0
--- /dev/null
@@ -0,0 +1,20 @@
+Copyright (c) 2008 John Resig, http://jquery.com/
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/extensions/jQuery/Makefile.in b/extensions/jQuery/Makefile.in
new file mode 100644 (file)
index 0000000..5bdfe67
--- /dev/null
@@ -0,0 +1,52 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is BlueGriffon
+#
+# The Initial Developer of the Original Code is
+# Disruptive Innovations SARL.
+# Portions created by the Initial Developer are Copyright (C) 2009
+# the Initial Developer. All Rights Reserved.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH          = ../../..
+topsrcdir      = @top_srcdir@
+srcdir = @srcdir@
+VPATH          = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+MODULE = jquery
+USE_EXTENSION_MANIFEST = 1
+
+XPI_NAME    = jquery
+INSTALL_EXTENSION_ID  = jquery@bluegriffon.com
+XPI_PKGNAME   = jquery
+  
+DIST_FILES = install.rdf
+
+include $(topsrcdir)/config/rules.mk
+
diff --git a/extensions/jQuery/content/jquery.min.js b/extensions/jQuery/content/jquery.min.js
new file mode 100644 (file)
index 0000000..82b98e1
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * jQuery 1.2.6 - New Wave Javascript
+ *
+ * Copyright (c) 2008 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
+ * $Rev: 5685 $
+ */
+(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else
+return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
+return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else
+selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
+return(this[0].value||"").replace(/\r/g,"");}return undefined;}if(value.constructor==Number)value+='';return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else
+this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
+return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
+jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){var src=target[name],copy=options[name];if(target===copy)continue;if(deep&&copy&&typeof copy=="object"&&!copy.nodeType)target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)target[name]=copy;}return target;};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else
+script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!==undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object)if(callback.apply(object[name],args)===false)break;}else
+for(;i<length;)if(callback.apply(object[i++],args)===false)break;}else{if(length==undefined){for(name in object)if(callback.call(object[name],name,object[name])===false)break;}else
+for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
+jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}if(name=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem+='';if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
+ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&&notxml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else
+while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]===elem)return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++])if(elem.nodeType!=8)first[pos++]=elem;}else
+while(elem=second[i++])first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)if(!inv!=!callback(elems[i],i))ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)ret[ret.length]=value;}return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
+for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i<args.length)jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
+jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.ready);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!='string')return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else
+xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
+jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
+for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
+s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
+e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})();
\ No newline at end of file
diff --git a/extensions/jQuery/install.rdf b/extensions/jQuery/install.rdf
new file mode 100644 (file)
index 0000000..d16664b
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+  
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+  <Description about="urn:mozilla:install-manifest">
+    <em:id>jquery@bluegriffon.com</em:id>
+    <em:version>1.2.6</em:version>
+  
+    <em:targetApplication>
+      <!-- BlueGriffon -->
+      <Description>
+        <em:id>{8fa6f1b4-7ed3-4895-bac6-01f1cc206ab3}</em:id>
+        <em:minVersion>0.1pre</em:minVersion>
+        <em:maxVersion>1.0</em:maxVersion>
+      </Description>
+    </em:targetApplication>
+  
+    <!-- front-end metadata -->
+    <em:name>jQuery</em:name>
+    <em:description>jQuery package for BlueGriffon</em:description>
+    <em:creator>Disruptive Innovations SARL</em:creator>
+    <em:homepageURL>http://www.disruptive-innovations.com/</em:homepageURL>
+
+    <em:file>
+      <Description about="jquery.jar">
+        <em:package>content/</em:package>
+      </Description>
+    </em:file>
+
+  </Description>
+</RDF>
diff --git a/extensions/jQuery/jar.mn b/extensions/jQuery/jar.mn
new file mode 100644 (file)
index 0000000..f1ec2da
--- /dev/null
@@ -0,0 +1,3 @@
+jquery.jar:
+% content   jquery         %content/
+  content/jquery.min.js    (content/jquery.min.js)
diff --git a/installer/Makefile.in b/installer/Makefile.in
new file mode 100644 (file)
index 0000000..bf6dd9a
--- /dev/null
@@ -0,0 +1,66 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is McCoy.
+#
+# The Initial Developer of the Original Code is
+# the Mozilla Foundation <http://www.mozilla.org/>.
+# Portions created by the Initial Developer are Copyright (C) 2007
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Dave Townsend <dtownsend@oxymoronical.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH          = ../..
+topsrcdir      = @top_srcdir@
+srcdir         = @srcdir@
+VPATH          = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+NO_PKG_FILES = \
+       $(MOZ_APP_NAME)-config \
+       $(MOZ_APP_NAME)-bin.elf \
+       regchrome* \
+       regxpcom* \
+       xpcshell* \
+       xpidl* \
+       xpt_dump* \
+       xpt_link* \
+       crashreporter.* \
+       bloaturls.txt \
+       run-mozilla.sh \
+       nsinstall \
+       $(NULL)
+
+include $(topsrcdir)/config/rules.mk
+
+ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
+_BINPATH = /$(_APPNAME)/Contents/Resources
+endif
+
+include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
diff --git a/makefiles.sh b/makefiles.sh
new file mode 100644 (file)
index 0000000..09f4fa8
--- /dev/null
@@ -0,0 +1,48 @@
+#! /bin/sh
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is the the Mozilla build system
+#
+# The Initial Developer of the Original Code is
+# Ben Turner <mozilla@songbirdnest.com>
+#
+# Portions created by the Initial Developer are Copyright (C) 2007
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+add_makefiles "
+bluegriffon/Makefile
+bluegriffon/app/Makefile
+bluegriffon/base/Makefile
+bluegriffon/extensions/Makefile
+bluegriffon/installer/Makefile
+bluegriffon/sidebars/Makefile
+bluegriffon/src/Makefile
+bluegriffon/themes/Makefile
+"
diff --git a/modules/Makefile.in b/modules/Makefile.in
new file mode 100644 (file)
index 0000000..1a7fde8
--- /dev/null
@@ -0,0 +1,48 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla.org
+#
+# The Initial Developer of the Original Code is
+# Netscape Communications Corporation.
+# Portions created by the Initial Developer are Copyright (C) 2003
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Daniel Glazman (daniel@glazman.org), on behalf of Lindows.com
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH          = ../..
+topsrcdir      = @top_srcdir@
+srcdir = @srcdir@
+VPATH          = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+EXTRA_JS_MODULES = colourPickerHelper.jsm
+
+include $(topsrcdir)/config/rules.mk
+
diff --git a/modules/colourPickerHelper.jsm b/modules/colourPickerHelper.jsm
new file mode 100644 (file)
index 0000000..278ca31
--- /dev/null
@@ -0,0 +1,85 @@
+var EXPORTED_SYMBOLS = ["ColorPickerHelper"];
+
+
+var ColorPickerHelper = {
+
+// MEMBERS
+
+  mPersistentColorObjects: {},
+  mColorPickerPanelObject: {},
+
+// CONSTANTS
+
+  kCOLOUR_PICKER_URL: "chrome://bluegriffon/content/xul/colourPicker.xul",
+
+// PUBLIC
+
+  newPersistentColorObject: function(aColorObjectId)
+  {
+    if (!aColorObjectId)
+      return null;
+
+    if (this.mPersistentColorObjects[aColorObjectId])
+      return this.mPersistentColorObjects[aColorObjectId];
+
+    var newColorObject = { currentColor: "",
+                           lastPickedColor: "",
+                           cancelled: false };
+    this.mPersistentColorObjects[aColorObjectId] = newColorObject;
+    return newColorObject;
+  },
+
+  cleanPersistentColorObject: function(aColorObjectId)
+  {
+    if (!aColorObjectId)
+      return;
+
+    if (this.mPersistentColorObjects[aColorObjectId])
+      delete this.mPersistentColorObjects[aColorObjectId];
+  },
+
+  getCurrentColor: function(aColorObjectId)
+  {
+    if (!aColorObjectId || !this.mPersistentColorObjects[aColorObjectId])
+      return null;
+    return this.mPersistentColorObjects[aColorObjectId].currentColor;
+  },
+
+  setLastPickedColor: function(aColorObjectId, aColor)
+  {
+    if (!aColorObjectId || !this.mPersistentColorObjects[aColorObjectId])
+      return null;
+    this.mPersistentColorObjects[aColorObjectId].lastPickedColor = aColor;
+    return aColor;
+  },
+
+  isCancelled: function(aColorObjectId)
+  {
+    if (!aColorObjectId || !this.mPersistentColorObjects[aColorObjectId])
+      throw Components.results.NS_ERROR_NULL_POINTER;
+    return this.mPersistentColorObjects[aColorObjectId].cancelled;
+  },
+
+  openColorPicker: function(aWindow, aColorObjectId, aWindowTitle, aShowTransparency)
+  {
+    if (!aColorObjectId)
+      return null;
+
+    var colorObject = this.newPersistentColorObject(aColorObjectId);
+    this._resetCancelledFlag(colorObject);
+
+    aWindow.openDialog(this.kCOLOUR_PICKER_URL,
+                      "_blank",
+                      "chrome,close,titlebar,modal",
+                      colorObject, aWindowTitle, aShowTransparency);
+    return colorObject;
+  },
+
+  // PRIVATE
+
+  _resetCancelledFlag: function(aColorObject)
+  {
+    aColorObject.cancelled = false;
+  }
+
+};
diff --git a/readme.html b/readme.html
new file mode 100644 (file)
index 0000000..7c56844
--- /dev/null
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r
+<html>\r
+<head>\r
+\r
+   \r
+  <meta content="text/html; charset=us-ascii" http-equiv="content-type">\r
+\r
+\r
+   \r
+   \r
+  <title>Building BlueGriffon</title>\r
+  <style type="text/css">\r
+     body { font-family: Arial,Helvetica,sans-serif;\r
+       }\r
+   </style>\r
+  <meta content="Disruptive Innovations SARL" name="author">\r
+</head>\r
+\r
+\r
+\r
+<body>\r
+\r
+   \r
+<h1>BlueGriffon</h1>\r
+\r
+\r
+   \r
+<p>The new xulrunner-based Web editor</p>\r
+\r
+</body>\r
+</html>\r
diff --git a/sidebars/Makefile.in b/sidebars/Makefile.in
new file mode 100644 (file)
index 0000000..cd8374d
--- /dev/null
@@ -0,0 +1,48 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla.org
+#
+# The Initial Developer of the Original Code is
+# Netscape Communications Corporation.
+# Portions created by the Initial Developer are Copyright (C) 2003
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Daniel Glazman (daniel@glazman.org), on behalf of Lindows.com
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH          = ../..
+topsrcdir      = @top_srcdir@
+srcdir = @srcdir@
+VPATH          = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+DIRS += projectManager
+
+include $(topsrcdir)/config/rules.mk
+
diff --git a/sidebars/projectManager/Makefile.in b/sidebars/projectManager/Makefile.in
new file mode 100644 (file)
index 0000000..385d66b
--- /dev/null
@@ -0,0 +1,46 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla.org
+#
+# The Initial Developer of the Original Code is
+# Netscape Communications Corporation.
+# Portions created by the Initial Developer are Copyright (C) 2003
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Daniel Glazman (daniel@glazman.org), on behalf of Lindows.com
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH    = ../../..
+topsrcdir  = @top_srcdir@
+srcdir  = @srcdir@
+VPATH    = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+include $(topsrcdir)/config/rules.mk
+
diff --git a/sidebars/projectManager/content/bluegriffonOverlay.js b/sidebars/projectManager/content/bluegriffonOverlay.js
new file mode 100644 (file)
index 0000000..18ec801
--- /dev/null
@@ -0,0 +1,116 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+ var ProjectsManager = {
+
+  currentProjects: [],
+
+  getDBConn: function webchunks_getDBConn()
+  {
+    var file = Components.classes["@mozilla.org/file/directory_service;1"]
+                         .getService(Components.interfaces.nsIProperties)
+                         .get("ProfD", Components.interfaces.nsIFile);
+    file.append("webprojects.sqlite");
+    
+    var storageService = Components.classes["@mozilla.org/storage/service;1"]
+                            .getService(Components.interfaces.mozIStorageService);
+    return storageService.openDatabase(file);
+  },
+
+  init: function()
+  {
+    var mDBConn = this.getDBConn();    
+    mDBConn.executeSimpleSQL("CREATE TABLE IF NOT EXISTS 'projects' ('id' INTEGER PRIMARY KEY NOT NULL, \
+'name' VARCHAR NOT NULL, \
+'url' VARCHAR NOT NULL, \
+'storageChoice' VARCHAR NOT NULL, \
+'localStoreHome' VARCHAR NOT NULL, \
+'hostname' VARCHAR NOT NULL, \
+'rootpath' VARCHAR NOT NULL, \
+'user' VARCHAR NOT NULL, \
+'pathhtml' VARCHAR NOT NULL, \
+'pathmedia' VARCHAR NOT NULL, \
+'pathJS' VARCHAR NOT NULL, \
+'pathCSS' VARCHAR NOT NULL)");
+    mDBConn.close();
+
+  },
+
+  loadProjectsFromDB: function()
+  {
+    this.currentProjects = [];
+
+    var dbConn = this.getDBConn();
+    var statement = dbConn.createStatement("SELECT * from projects");
+    
+    while (statement.executeStep()) {
+      var id = statement.getInt32(0);
+      var name = statement.getString(1);
+      var url = statement.getString(2);
+      var storageChoice = statement.getString(3);
+      var localStoreHome = statement.getString(4);
+      var hostname = statement.getString(5);
+      var rootpath = statement.getString(6);
+      var user = statement.getString(7);
+      var pathhtml = statement.getString(8);
+      var pathmedia = statement.getString(9);
+      var pathJS = statement.getString(10);
+      var pathCSS = statement.getString(11);
+  
+      this.currentProjects.push( {
+        id: id,
+        name: name,
+        url: url,
+        storageChoice: storageChoice,
+        localStoreHome: localStoreHome,
+        hostname: hostname,
+        rootpath: rootpath,
+        user: user,
+        pathhtml: pathhtml,
+        pathmedia: pathmedia,
+        pathJS: pathJS,
+        pathCSS: pathCSS
+      });
+    }
+  
+    statement.finalize();
+    dbConn.close();
+
+  }
+};
+
+ProjectsManager.init();
diff --git a/sidebars/projectManager/content/bluegriffonOverlay.xul b/sidebars/projectManager/content/bluegriffonOverlay.xul
new file mode 100644 (file)
index 0000000..6700e04
--- /dev/null
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is Composer.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2008
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<!DOCTYPE overlay [
+  <!ENTITY % bluegriffonOverlayDTD SYSTEM "chrome://projectmanager/locale/bluegriffonOverlay.dtd">
+  %bluegriffonOverlayDTD;
+]>
+
+<overlay id="projectmanagerOverlay"
+         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+  <script type="application/x-javascript"  src="chrome://projectmanager/content/bluegriffonOverlay.js"/>
+  
+  <sidebaritems id="sidebaritems">
+    <sidebaritem id="sidebaritem-projectmanager"
+                 src="chrome://projectmanager/content/projectManager.xul"
+                 name="projectmanager"
+                 title="&projectmanager.label;"/>
+  </sidebaritems>
+
+</overlay>         
+
diff --git a/sidebars/projectManager/content/ftpDirParser.js b/sidebars/projectManager/content/ftpDirParser.js
new file mode 100644 (file)
index 0000000..2e182de
--- /dev/null
@@ -0,0 +1,358 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Nvu.
+ *
+ * The Initial Developer of the Original Code is
+ * Linspire Inc..
+ * Portions created by the Initial Developer are Copyright (C) 2004
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman (glazman@disruptive-innovations.com), on behalf of Linspire Inc.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+const DI_CTRID              = "@mozilla.org/dirIndex;1";
+const cnsIDirIndex          = Components.interfaces.nsIDirIndex;
+
+const FILENAME_ENTRY        = 1;
+const DESCRIPTION_ENTRY     = 2;
+const CONTENT_LENGTH_ENTRY  = 3;
+const LAST_MODIFIED_ENTRY   = 4;
+const CONTENT_TYPE_ENTRY    = 5;
+const FILE_TYPE_ENTRY       = 6;
+const UNKNOWN_ENTRY         = 7;
+
+const UNKNOWN_TOKEN         = 0;
+const WS_TOKEN              = 1;
+const EOL_TOKEN             = 2;
+
+// PUBLIC
+// this is the function you have to call to retrieve an FTP dir,
+// parse its contents and feed it to a callback; requestData
+// is your own data, the parser does not deal with it.
+// the callback takes 3 parameters : a string for the URL,
+// an nsIDirIndex and your requestData
+
+function FTPDirParser(url, requestData,
+                      entryCallback, endCallback, errorCallback)
+{
+  this.url            = url;
+  this.callback       = entryCallback;
+  this.rqData         = requestData;
+  this.endCallback    = endCallback;
+  this.errorCallback  = errorCallback;
+
+  this.comment = "";
+
+  this.dataIndex = 0;
+  this.nextToken = UNKNOWN_TOKEN;
+
+  loadURL(url, this);
+
+}
+
+// PUBLIC
+// unescapes all %xx contained into a string
+function ecmaUnescape(str)
+{
+    function replaceEscapes(seq)
+    {
+        var ary = seq.match(/([\da-f]{1,2})(.*)|u([\da-f]{1,4})/);
+        if (!ary)
+            return "<ERROR>";
+
+        if (ary[1])
+        {
+            // two digit escape, possibly with cruft after
+            rv = String.fromCharCode(parseInt(ary[1], 16)) + ary[2];
+        }
+        else
+        {
+            // four digits, no cruft
+            rv = String.fromCharCode(parseInt(ary[3], 16));
+        }
+
+        return rv;
+    };
+
+    // Replace the escape sequences %X, %XX, %uX, %uXX, %uXXX, and %uXXXX with
+    // the characters they represent, where X is a hexadecimal digit.
+    // See section B.2.2 of ECMA-262 rev3 for more information.
+    return str.replace(/%u?([\da-f]{1,4})/ig, replaceEscapes);
+}
+
+
+function UnEscape(s)
+{
+  var u = "", l = s.length, i;
+  for (i = 0; i < l; i++)
+  {
+    var c = s[i];
+    if (c == "%")
+    {
+      c = String.fromCharCode(Number("0x" + s.substr(i+1, 2)));
+      i += 2;
+    }
+    u += c;
+  }
+  return u;
+}
+
+// PRIVATE
+// parse the first 3 chars of a header line
+// returns the header code if ok or 0
+
+FTPDirParser.prototype.getHeaderToken =
+function (data)
+{
+  if (this.dataIndex < data.length - 3)
+  {
+    var substr = data.substr(this.dataIndex, 3);
+
+    if (data[this.dataIndex+3] == ":" &&
+        (substr == "100" ||
+         substr == "101" ||
+         substr == "102" ||
+         substr == "200" ||
+         substr == "201" ||
+         substr == "300" ||
+         substr == "301"))
+    {
+      this.dataIndex += 4;
+      return Number(substr);
+    }
+  }
+  this.dataIndex++;
+  return 0;
+}
+
+// PRIVATE
+// skip whitespaces
+
+FTPDirParser.prototype.skipWS =
+function (data)
+{
+  while (this.dataIndex < data.length &&
+         data[this.dataIndex] == " ")
+    this.dataIndex++
+}
+
+// PRIVATE
+// skip everything until end of line
+
+FTPDirParser.prototype.skipEndOfLine =
+function (data)
+{
+  while (this.dataIndex < data.length &&
+         data[this.dataIndex] != "\r" &&
+         data[this.dataIndex] != "\n")
+    this.dataIndex++
+  while (this.dataIndex < data.length && (
+         data[this.dataIndex] == "\r" ||
+         data[this.dataIndex] == "\n"))
+    this.dataIndex++
+}
+
+// PRIVATE
+// store everything until end of line into comment
+
+FTPDirParser.prototype.getCommentLine =
+function (data)
+{
+  this.skipWS(data);
+  while (this.dataIndex < data.length &&
+         data[this.dataIndex] != "\r" &&
+         data[this.dataIndex] != "\n")
+  {
+    this.comment += data[this.dataIndex];
+    this.dataIndex++;
+  }
+  this.skipEndOfLine(data);
+} 
+
+// PRIVATE
+// parse a 200 line containing the format of 201 lines
+// stores it into this.entries array
+
+FTPDirParser.prototype.getFormat =
+function (data)
+{
+  var token;
+
+  // in case of multiple 200 lines, keep only last one...
+  delete this.entries;
+  this.entries = new Array();
+
+  while (data[this.dataIndex] != "\r" &&
+         data[this.dataIndex] != "\n")
+  {
+    this.skipWS(data);
+    token = "";
+    while (this.dataIndex < data.length &&
+           data[this.dataIndex] != " " &&
+           data[this.dataIndex] != "\r" &&
+           data[this.dataIndex] != "\n")
+    {
+      token += data[this.dataIndex];
+      this.dataIndex++;
+    }
+    token = token.toLowerCase();
+    if (token == "filename")
+      this.entries.push(FILENAME_ENTRY);
+    else if (token == "description")
+      this.entries.push(DESCRIPTION_ENTRY);
+    else if (token == "content-length")
+      this.entries.push(CONTENT_LENGTH_ENTRY);
+    else if (token == "description")
+      this.entries.push(LAST_MODIFIED_ENTRY);
+    else if (token == "last-modified")
+      this.entries.push(LAST_MODIFIED_ENTRY);
+    else if (token == "content-type")
+      this.entries.push(CONTENT_TYPE_ENTRY);
+    else if (token == "file-type")
+      this.entries.push(FILE_TYPE_ENTRY);
+    else 
+      this.entries.push(UNKNOWN_ENTRY);
+
+  }
+  this.skipEndOfLine(data);
+}
+
+// PRIVATE
+// parse a 201 line according to a previously parsed 200 line
+// returns an nsIDirIndex instance
+
+FTPDirParser.prototype.getDataLine =
+function (data)
+{
+  var numberFields = this.entries.length;
+  var l = data.length;
+  var i;
+  var dirIndex = 
+    Components.classes[DI_CTRID].createInstance(cnsIDirIndex);
+
+  for (i = 0; i < numberFields; i++)
+  {
+    this.skipWS(data);
+    var token = "";
+    if (data[this.dataIndex] == '"')
+    {
+      this.dataIndex++;
+      while (this.dataIndex < l &&
+             data[this.dataIndex] != '"')
+      {
+        token += data[this.dataIndex];
+        this.dataIndex++;
+      }
+      this.dataIndex++;
+    }
+    else
+    {
+      while (this.dataIndex < l &&
+             data[this.dataIndex] != " ")
+      {
+        token += data[this.dataIndex];
+        this.dataIndex++;
+      }
+    }
+
+    switch (this.entries[i])
+    {
+      case FILENAME_ENTRY:
+        dirIndex.location = L10NUtils.convertStringToUTF8(UnEscape(token)) ||
+                            UnEscape(token);
+        break;
+      case DESCRIPTION_ENTRY:
+        // we do nothing here, we use the nsIDirIndex description attribute
+        // for the last-modified date
+        break;
+      case CONTENT_LENGTH_ENTRY:
+        dirIndex.size = Number(token);
+        break;
+      case LAST_MODIFIED_ENTRY:
+        dirIndex.description = UnEscape(token);
+        break;
+      case CONTENT_TYPE_ENTRY:
+        dirIndex.contentType = UnEscape(token);
+        break;
+      case FILE_TYPE_ENTRY:
+        if (token == "FILE")
+          dirIndex.type = cnsIDirIndex.TYPE_FILE;
+        else if (token == "DIRECTORY")
+          dirIndex.type = cnsIDirIndex.TYPE_DIRECTORY;
+        else if (token == "SYMBOLIC-LINK")
+          dirIndex.type = cnsIDirIndex.TYPE_SYMLINK;
+        else
+          dirIndex.type = cnsIDirIndex.TYPE_UNKNOWN; // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+        break;
+      default:
+        break;      
+    }
+  }
+  this.skipEndOfLine(data);
+  return dirIndex;
+}
+
+// PRIVATE
+// parses all the data coming from an async list of an FTP dir
+// calls the provided callback on entries
+
+FTPDirParser.prototype.parseData =
+function (data, requestData)
+{
+   var token;
+   while (this.dataIndex < data.length)
+   {
+     token = this.getHeaderToken(data);
+     switch (token)
+     {
+     case 100:
+     case 300:
+       this.skipEndOfLine(data);
+       break;
+     case 101:
+     case 102:
+       this.getCommentLine(data);
+       breal;
+     case 200:
+       this.getFormat(data);
+       break;
+     case 201:
+       var dirEntry = this.getDataLine(data);
+
+       if (this.callback)
+       {
+         this.callback(this.url, dirEntry, this.rqData);
+       }
+       break;
+     default:
+       // error, but are we supposed to run this?
+       break
+     }
+   }
+}
+
diff --git a/sidebars/projectManager/content/ftpProgressListener.js b/sidebars/projectManager/content/ftpProgressListener.js
new file mode 100644 (file)
index 0000000..6f9290c
--- /dev/null
@@ -0,0 +1,126 @@
+const FTP_DEL    = 0;
+const FTP_MKDIR  = 1;
+const FTP_RMDIR  = 2;
+const FTP_RENAME = 3;
+
+function progressListener(aChannel, aAction, aUrl, aNewURI, aRequestData)
+{
+  this.startup(aChannel, aAction, aUrl, aNewURI, aRequestData);
+}
+
+progressListener.prototype =
+{
+
+  mChannel : null,
+  mAction : null,
+  mUrl : null,
+  mNewURI : null,
+  mRequestData : null,
+
+  startup : function(aChannel, aAction, aUrl, aNewURI, aRequestData)
+  {
+    mChannel = aChannel;
+    mAction = aAction;
+    mUrl = aUrl;
+    mNewURI = aNewURI;
+    mRequestData = aRequestData;
+  },
+
+  onStatus : function(aRequest, aContext, aStatus, aStatusArg)
+  {
+    if (aStatus == 4915228)
+    {
+      if (!gError)
+      {
+        switch (mAction)
+        {
+          case FTP_DEL:
+          case FTP_RMDIR:
+            DeleteSelectedItem(mRequestData);
+            break;
+          case FTP_MKDIR:
+            AppendNewRemoteDir(mUrl, mRequestData);
+            break;
+          case FTP_RENAME:
+            RenameTo(mNewURI, mRequestData);
+            break;
+          default:
+            break;
+        }
+      }
+      // close the channel
+      mChannel.cancel(0x804b0002); // NS_BINDING_ABORTED
+      OnFtpEnd(null);
+    }
+  },
+
+  onProgress : function(aRequest, aContext,
+                        aProgress, aProgressMax)
+  {
+  },
+
+  QueryInterface : function(aIID)
+  {
+    if (aIID.equals(Components.interfaces.nsIProgressEventSink)
+    || aIID.equals(Components.interfaces.nsISupports)
+    || aIID.equals(Components.interfaces.nsIFTPEventSink)
+    || aIID.equals(Components.interfaces.nsIInterfaceRequestor)
+    || aIID.equals(Components.interfaces.nsISupports)
+    || aIID.equals(Components.interfaces.nsISupportsWeakReference)
+    || aIID.equals(Components.interfaces.nsIPrompt)
+    || aIID.equals(Components.interfaces.nsIAuthPrompt))
+      return this;
+    throw Components.results.NS_NOINTERFACE;
+  },
+
+  getInterface : function(aIID)
+  {
+    if (aIID.equals(Components.interfaces.nsIProgressEventSink)
+    || aIID.equals(Components.interfaces.nsISupports)
+    || aIID.equals(Components.interfaces.nsIFTPEventSink)
+    || aIID.equals(Components.interfaces.nsIInterfaceRequestor)
+    || aIID.equals(Components.interfaces.nsISupports)
+    || aIID.equals(Components.interfaces.nsISupportsWeakReference)
+    || aIID.equals(Components.interfaces.nsIPrompt)
+    || aIID.equals(Components.interfaces.nsIAuthPrompt))
+      return this;
+    throw Components.results.NS_NOINTERFACE;
+  },
+
+// nsIPrompt
+  alert : function(dlgTitle, text)
+  {
+    var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
+                        .getService(Components.interfaces.nsIPromptService);
+    promptService.alert(window, dlgTitle, text);
+    gError = true;
+  },
+  alertCheck : function(dialogTitle, text, checkBoxLabel, checkObj)
+  {
+  },
+  confirm : function(dlgTitle, text)
+  {
+  },
+  confirmCheck : function(dlgTitle, text, checkBoxLabel, checkObj)
+  {
+  },
+  confirmEx : function(dlgTitle, text, btnFlags, btn0Title, btn1Title, btn2Title, checkBoxLabel, checkVal)
+  {
+  },
+  prompt : function(dlgTitle, text, inoutText, checkBoxLabel, checkObj)
+  {
+  },
+  promptPassword : function(dlgTitle, text, pwObj, checkBoxLabel, savePWObj)
+  {
+  },
+  promptUsernameAndPassword : function(dlgTitle, text, userObj, pwObj, checkBoxLabel, savePWObj)
+  {
+  },
+  select : function(dlgTitle, text, count, selectList, outSelection)
+  {
+  },
+
+  OnFTPControlLog : function(server, msg)
+  {
+  },
+}
diff --git a/sidebars/projectManager/content/localDirParser.js b/sidebars/projectManager/content/localDirParser.js
new file mode 100755 (executable)
index 0000000..edb48eb
--- /dev/null
@@ -0,0 +1,122 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+function GetLocalFileFromURLSpec(url)
+{
+  return GetFileFromURLSpec(url).QueryInterface(Components.interfaces.nsILocalFile);
+}
+
+function GetFileFromURLSpec(url)
+{
+  var fileHandler = UrlUtils.getFileProtocolHandler();
+  return fileHandler.getFileFromURLSpec(url);
+}
+
+function OpenLocalDirectory(aUrl, aRQdata)
+{
+  ShowThrobber(true);
+  var localFile = GetLocalFileFromURLSpec(aUrl);
+
+  var firstNonDirEntry = null;
+  
+  var dirEntries = localFile.directoryEntries;
+  var directoryEntries = new Array();
+  var fileEntries      = new Array();
+  while (dirEntries.hasMoreElements())
+  {
+    var fileEntry = dirEntries.getNext().QueryInterface(Components.interfaces.nsIFile);
+    var rv = AddLocalDirSubdirs(aUrl, fileEntry, aRQdata, directoryEntries, fileEntries,
+                                firstNonDirEntry);
+    if (!firstNonDirEntry)
+      firstNonDirEntry = rv;
+  }
+  ShowThrobber(false);
+}
+
+
+function AddLocalDirSubdirs(aUrl, aDirEntry, aRQdata, aDirectoryEntries, aFileEntries, aFirstNonDirEntry)
+{
+  var name = aDirEntry.leafName;
+  var tc = aRQdata.getElementsByTagName("treechildren");
+  var treechildren = null;
+  if (tc && tc.length)
+    treechildren = tc.item(0);
+  else
+  {
+    treechildren = document.createElement("treechildren");
+    aRQdata.appendChild(treechildren);
+  }
+
+  var size = aDirEntry.fileSize;
+  var lastModifiedDate = new Date(aDirEntry.lastModifiedTime);
+  var isDir = aDirEntry.isDirectory();
+
+  var treeitem = document.createElement("treeitem");
+  var treerow = document.createElement("treerow");
+  var treecell1 = document.createElement("treecell");
+  var treecell2 = document.createElement("treecell");
+  var treecell3 = document.createElement("treecell");
+  treecell1.setAttribute("label", name);
+  treecell2.setAttribute("label", isDir ? "" : size);
+  treecell3.setAttribute("label", GetNormalizedDate(lastModifiedDate));
+  treeitem.setAttribute("lastModifiedTime", aDirEntry.lastModifiedTime);
+
+  treerow.appendChild(treecell1);
+  treerow.appendChild(treecell2);
+  treerow.appendChild(treecell3);
+  treeitem.appendChild(treerow);
+  treeitem.setAttribute("name", name);
+
+  var rv = null;
+  treeitem.setAttribute("parentDir", aUrl);
+  if (aDirEntry.isDirectory())
+  {
+    treeitem.setAttribute("container", "true");
+    treeitem.setAttribute("localStoreHome", aUrl + name + "/");
+
+    treechildren.insertBefore(treeitem, aFirstNonDirEntry);
+  }
+  else
+  {
+    treeitem.setAttribute("localStoreHome", aUrl + name);
+    treechildren.appendChild(treeitem);
+    rv = treeitem;
+  }
+
+  return rv;
+}
+
diff --git a/sidebars/projectManager/content/projectManager.js b/sidebars/projectManager/content/projectManager.js
new file mode 100644 (file)
index 0000000..26dd68d
--- /dev/null
@@ -0,0 +1,841 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2008-2009
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var gMain = null;
+
+// cf. netwerk/bas/public/nsNetError.h
+const ERROR_FTP_LOGIN  = 2152398869;
+const ERROR_FTP_CWD    = 2152398870;
+const ERROR_FTP_PASV   = 2152398871;
+const ERROR_FTP_PWD    = 2152398872;
+const ERROR_FTP_LIST   = 2152398873;
+
+function GetDBConn()
+{
+  var file = Components.classes["@mozilla.org/file/directory_service;1"]
+                       .getService(Components.interfaces.nsIProperties)
+                       .get("ProfD", Components.interfaces.nsIFile);
+  file.append("webprojects.sqlite");
+  
+  var storageService = Components.classes["@mozilla.org/storage/service;1"]
+                          .getService(Components.interfaces.mozIStorageService);
+  return storageService.openDatabase(file);
+}
+
+function Startup()
+{
+  GetUIElements();
+  ShowThrobber(true);
+
+  if (window.top &&
+      "NotifierUtils" in window.top)
+    gMain = window.top;
+  else if (window.top && window.top.opener &&
+           "NotifierUtils" in window.top.opener)
+    gMain = window.top.opener;
+
+  if (!gMain)
+    return;
+
+  ListProjects();
+  ShowThrobber(false);
+}
+
+function ListProjects()
+{
+  var PM = gMain.ProjectsManager;
+  PM.loadProjectsFromDB();
+  var projects = PM.currentProjects;
+
+  for (var i = 0; i < projects.length; i++) {
+    var p = projects[i];
+
+    var id             = p.id;
+    var name           = p.name;
+    var url            = p.url;
+    var storageChoice  = p.storageChoice;
+    var localStoreHome = p.localStoreHome;
+    var hostname       = p.hostname;
+    var rootpath       = p.rootpath;
+    var user           = p.user;
+    var pathhtml       = p.pathhtml;
+    var pathmedia      = p.pathmedia;
+    var pathJS         = p.pathJS;
+    var pathCSS        = p.pathCSS;
+
+    var treeitem = document.createElement("treeitem");
+    var treerow = document.createElement("treerow");
+    var treecell = document.createElement("treecell");
+    treecell.setAttribute("label", name);
+    treerow.appendChild(treecell);
+    treeitem.appendChild(treerow);
+    treeitem.setAttribute("container", "true");
+
+    treeitem.setAttribute("projectid", id);
+    treeitem.setAttribute("localStoreHome", localStoreHome);
+    treeitem.setAttribute("url", url);
+    treeitem.setAttribute("storageChoice", storageChoice);
+    treeitem.setAttribute("hostname", hostname);
+    treeitem.setAttribute("rootpath", rootpath);
+    treeitem.setAttribute("user", user);
+    treeitem.setAttribute("pathhtml", pathhtml);
+    treeitem.setAttribute("pathmedia", pathmedia);
+    treeitem.setAttribute("pathJS", pathJS);
+    treeitem.setAttribute("pathCSS", pathCSS);
+
+    treeitem.setAttribute("name", name);
+
+    gDialog.tableProjectsChildren.appendChild(treeitem);
+  }
+
+  gDialog.tableProjects.addEventListener("DOMAttrModified", onContainerOpened, false);
+
+}
+
+function Shutdown()
+{
+  gDialog.tableProjects.removeEventListener("DOMAttrModified", onContainerOpened, false);
+}
+
+function onContainerOpened(aEvent)
+{
+  var treeitem = aEvent.target;
+  var attrChange = aEvent.attrChange;
+  var attrName = aEvent.attrName;
+  var newValue = aEvent.newValue;
+  if (attrName != "open" || newValue == "false")
+    return;
+
+  var tc = treeitem.getElementsByTagName("treechildren");
+  if (treeitem.getAttribute("localStoreHome")) // LOCAL
+  {
+    if (!tc || !tc.length)
+      OpenLocalDirectory(treeitem.getAttribute("localStoreHome"), aEvent.target);
+  }
+  else // REMOTE SITE
+  {
+    if (tc && tc.length)
+      return;
+
+    var url = GetRemoteUrl(treeitem);
+    ShowThrobber(true);
+    var foo = new FTPDirParser(url,
+                               treeitem,
+                               AddFTPDirSubdirs, OnFtpEnd, OnFtpError);
+  }
+  
+}
+
+function GetRemoteUrl(aTreeItem)
+{
+  var hostname = aTreeItem.getAttribute("hostname");
+  var user = aTreeItem.getAttribute("user");
+  var rootpath = aTreeItem.getAttribute("rootpath");
+  var password = LoginUtils.findPassword("ftp://" + hostname,
+                                         null,
+                                         "bluegriffon",
+                                         user);
+
+  return "ftp://" + (user ? user + ":" + password + "@" : "") +
+         hostname +
+         (rootpath[0] == '/' ? "" : "/") +
+         rootpath;
+}
+
+function AddFTPDirSubdirs(url, dirEntry, aRQdata)
+{
+  var name = dirEntry.location
+  var size = dirEntry.size;
+  var lastModifiedDate = new Date(dirEntry.description);
+  var type = dirEntry.type;
+
+  var tc = aRQdata.getElementsByTagName("treechildren");
+  var treechildren = null;
+  if (tc && tc.length)
+    treechildren = tc.item(0);
+  else
+  {
+    treechildren = document.createElement("treechildren");
+    aRQdata.appendChild(treechildren);
+  }
+
+  var isDir = (type == Components.interfaces.nsIDirIndex.TYPE_DIRECTORY);
+  var hostname = aRQdata.getAttribute("hostname");
+  var rootpath = (aRQdata.getAttribute("rootpath") + "/" + name);
+  var user = aRQdata.getAttribute("user");
+
+  var treeitem = document.createElement("treeitem");
+  var treerow = document.createElement("treerow");
+  var treecell1 = document.createElement("treecell");
+  var treecell2 = document.createElement("treecell");
+  var treecell3 = document.createElement("treecell");
+  treecell1.setAttribute("label", name);
+  treecell2.setAttribute("label", isDir ? "" : size);
+  treecell3.setAttribute("label", GetNormalizedDate(lastModifiedDate));
+  treeitem.setAttribute("lastModifiedTime", lastModifiedDate);
+
+  treerow.appendChild(treecell1);
+  treerow.appendChild(treecell2);
+  treerow.appendChild(treecell3);
+  treeitem.appendChild(treerow);
+  treeitem.setAttribute("name", name);
+  treeitem.setAttribute("hostname", hostname);
+  treeitem.setAttribute("rootpath", rootpath);
+  treeitem.setAttribute("user", user);
+
+  if (isDir)
+  {
+    treeitem.setAttribute("container", "true");
+
+    var child = treechildren.firstChild;
+    while (child &&
+           child.getAttribute("name") <= name &&
+           child.hasAttribute("container"))
+      child = child.nextSibling;
+    
+    treechildren.insertBefore(treeitem, child);
+  }
+  else
+  {
+    treechildren.appendChild(treeitem);
+  }
+}
+
+function OnFtpEnd(aReqData)
+{
+  ShowThrobber(false);
+}
+
+function OnFtpError(aUrl, aStatus)
+{
+  ShowThrobber(false);
+  var message = "";
+  if (status == ERROR_FTP_LOGIN)
+    message = gDialog.projectManagerBundle.getString("FtpLoginError");
+  else if (status == ERROR_FTP_CWD)
+    message = gDialog.projectManagerBundle.getString("FtpCwdError");
+  else
+    message = gDialog.projectManagerBundle.getString("FtpUnknownError");
+
+  PromptUtils.alertWithTitle("FTP", message, window.top);
+
+}
+
+function OpenAddProjectDialog()
+{
+  window.openDialog("chrome://projectmanager/content/projectProperties.xul", "",
+                    "modal, centerscreen, resizable=no", null);
+}
+
+function RefreshEntry()
+{
+  var tree = gDialog.tableProjects;
+  var contentView = tree.contentView;
+  var view = tree.view;
+  var index = view.selection.currentIndex;
+  var treeitem = contentView.getItemAtIndex(index);
+  if (treeitem.getAttribute("container") == "true")
+  {
+    var tc = treeitem.getElementsByTagName("treechildren");
+    if (tc && tc.length)
+      treeitem.removeChild(tc.item(0));
+    if (treeitem.getAttribute("localStoreHome"))
+      OpenLocalDirectory(treeitem.getAttribute("localStoreHome"), treeitem);
+    else
+    {
+      var hostname = treeitem.getAttribute("hostname");
+      var user = treeitem.getAttribute("user");
+      var rootpath = treeitem.getAttribute("rootpath");
+      var password = LoginUtils.findPassword("ftp://" + hostname,
+                                             null,
+                                             "bluegriffon",
+                                             user);
+  
+      var url = "ftp://" + (user ? user + ":" + password + "@" : "") +
+                hostname + "/" + rootpath;
+  
+      ShowThrobber(true);
+      var foo = new FTPDirParser(url,
+                                 treeitem,
+                                 AddFTPDirSubdirs, OnFtpEnd, OnFtpError);
+    }
+  }
+  else if (treeitem.getAttribute("localStoreHome"))
+  {
+    var localFile = GetLocalFileFromURLSpec(treeitem.getAttribute("localStoreHome"));
+    if (!localFile)
+    {
+      treeitem.parentNode.removeChild(treeitem);
+      return;
+    }
+    var fileEntry = localFile.QueryInterface(Components.interfaces.nsIFile);
+    var size = localFile.fileSize;
+    var lastModifiedDate = new Date(localFile.lastModifiedTime);
+    var isDir = localFile.isDirectory();
+
+    var treerow = treeitem.firstChild;
+    deleteAllChildren(treerow);
+    var treecell1 = document.createElement("treecell");
+    var treecell2 = document.createElement("treecell");
+    var treecell3 = document.createElement("treecell");
+    treecell1.setAttribute("label", treeitem.getAttribute("name"));
+    treecell2.setAttribute("label", isDir ? "" : size);
+    treecell3.setAttribute("label", GetNormalizedDate(lastModifiedDate));
+    treerow.appendChild(treecell1);
+    treerow.appendChild(treecell2);
+    treerow.appendChild(treecell3);
+    treeitem.setAttribute("lastModifiedTime", localFile.lastModifiedTime);
+  }
+}
+
+function GetNormalizedDate(aDate)
+{
+  var rv = aDate.getFullYear() + "-";
+
+  var month = aDate.getMonth() + 1;
+  rv += gDialog.projectManagerBundle.getString("month" + month) + "-";
+
+  var day = aDate.getDate();
+  rv += ((day < 10) ? "0" + day : day) + " ";
+
+  var hours = aDate.getHours();
+  rv += ((hours < 10) ? "0" + hours : hours) + ":";
+  var mns = aDate.getMinutes();
+  rv += ((mns < 10) ? "0" + mns : mns) + ":";
+  var secs = aDate.getSeconds();
+  rv += ((secs < 10) ? "0" + secs : secs);
+
+  return rv;
+}
+
+function OnDblCLick()
+{
+  var tree = gDialog.tableProjects;
+  var contentView = tree.contentView;
+  var view = tree.view;
+  var count = view.selection.count;
+  if (!count) // no selection...
+    return;
+
+  var index = view.selection.currentIndex;
+  var treeitem = contentView.getItemAtIndex(index);
+
+  if (treeitem.hasAttribute("container")) // it's a folder
+    return;
+
+  var spec = treeitem.getAttribute("localStoreHome");
+  if (!spec)
+    spec = GetRemoteUrl(treeitem);
+  var uri = UrlUtils.newURI(spec);
+  var extension = uri.QueryInterface(Components.interfaces.nsIURL).fileExtension;
+  ActionCaller(spec, extension);
+}
+
+function ActionCaller(aSpec, aExt)
+{
+  ShowThrobber(true);
+  switch (aExt)
+  {
+    case "html":
+    case "htm":
+      gMain.OpenFile(aSpec, true);
+      break;
+    default:
+      UrlUtils.makeRelativeUrl(aSpec);
+      break;
+  }
+  ShowThrobber(false);
+}
+
+function ShowThrobber(aShow)
+{
+  if (!gDialog.ProjectThrobberButton)
+    return;
+  if (aShow)
+  {
+    gDialog.ProjectThrobberButton.removeAttribute("hidden");
+    gDialog.tableProjects.disabled = true;
+    gDialog.tableProjects.style.cursor = "wait";
+  }
+  else
+  {
+    gDialog.ProjectThrobberButton.setAttribute("hidden", "true");
+    gDialog.tableProjects.disabled = false;
+    gDialog.tableProjects.style.cursor = "auto";
+  }
+}
+
+function DeleteFileOrDir()
+{
+  if (!PromptUtils.confirm(gDialog.projectManagerBundle.getString("ConfirmDeletion"),
+                           gDialog.projectManagerBundle.getString("SureToDelete")))
+    return;
+
+  var tree = gDialog.tableProjects;
+  var contentView = tree.contentView;
+  var view = tree.view;
+  if (!view.selection.count)
+    return;
+  var index = view.selection.currentIndex;
+  var treeitem = contentView.getItemAtIndex(index);
+
+  // is the user trying to delete a project ?
+  if (treeitem.parentNode.parentNode.nodeName.toLowerCase() == "tree")
+  {
+    alert("project deletion requested");
+  }
+  else if (treeitem.getAttribute("localStoreHome"))
+  {
+    if (treeitem.hasAttribute("container")) // is it a directory ?
+      RemoveLocalDir(treeitem.getAttribute("localStoreHome"), treeitem);
+    else
+      RemoveLocalFile(treeitem.getAttribute("localStoreHome"), treeitem);
+  }
+  else
+  {
+    var hostname = treeitem.getAttribute("hostname");
+    var user = treeitem.getAttribute("user");
+    var rootpath = treeitem.getAttribute("rootpath");
+    var password = LoginUtils.findPassword("ftp://" + hostname,
+                                           null,
+                                           "bluegriffon",
+                                           user);
+
+    var url = "ftp://" + (user ? user + ":" + password + "@" : "") +
+              hostname + "/" + rootpath;
+
+    ShowThrobber(true);
+    if (treeitem.hasAttribute("container")) // is it a directory ?
+      removeDirURLAsync(url, treeitem);
+    else
+      deleteURLAsync(url, treeitem);
+  }
+}
+
+function RemoveLocalFile(aSpec, aTreeitem)
+{
+  if (PromptUtils.confirm(gDialog.projectManagerBundle.getString("ConfirmDeletion"),
+                          gDialog.projectManagerBundle.getString("SureToDelete")))
+  {
+    if (IsFileUrl(aSpec)) // sanity check
+    {
+      var localFile = GetLocalFileFromURLSpec(aSpec);
+      localFile.remove(false);
+      DeleteSelectedItem(aTreeitem);
+    }
+  }
+}
+
+function DeleteSelectedItem(aItem)
+{
+  aItem.parentNode.removeChild(aItem);
+}
+
+function IsFileUrl(url)
+{
+  return (url.substr(0,4) == "file");
+}
+
+function RemoveLocalDir(aSpec, aTreeitem)
+{
+  if (PromptUtils.confirm(gDialog.projectManagerBundle.getString("ConfirmDirRemoval"),
+                          gDialog.projectManagerBundle.getString("SureToRemoveDir")))
+  {
+    if (IsFileUrl(aSpec)) // sanity check
+    {
+      var localFile = GetLocalFileFromURLSpec(aSpec);
+      var dirEntries = localFile.directoryEntries;
+      var removeAll = false;
+      if (dirEntries.hasMoreElements())
+      {
+        while (dirEntries.hasMoreElements())
+          var junk = dirEntries.getNext();
+
+        if (PromptUtils.confirm(gDialog.projectManagerBundle.getString("RemoveDirAlert"),
+                                gDialog.projectManagerBundle.getString("DirNotEmptyAlert")))
+          removeAll = true;
+
+      }
+      localFile.remove(removeAll);
+      aTreeitem.parentNode.removeChild(aTreeitem);
+    }
+  }
+}
+
+function TweakTableProjectsPopup()
+{
+  NotifierUtils.notify("treePopupShowing");
+
+  var tree = gDialog.tableProjects;
+  var contentView = tree.contentView;
+  var view = tree.view;
+  if (!view.selection.count) // No selection yet in the tree
+  {
+    SetEnabledElement(gDialog.refreshMenuItem, false);
+    SetEnabledElement(gDialog.deleteMenuItem, false);
+    SetEnabledElement(gDialog.newDirMenuItem, false);
+    SetEnabledElement(gDialog.renameMenuItem, false);
+    return;
+  }
+  var index = view.selection.currentIndex;
+  var treeitem = contentView.getItemAtIndex(index);
+
+  // the selection is a project, not a file or a dir
+  if (treeitem.parentNode.parentNode.nodeName.toLowerCase() == "tree")
+  {
+    SetEnabledElement(gDialog.refreshMenuItem, true);
+    SetEnabledElement(gDialog.deleteMenuItem, false);
+    SetEnabledElement(gDialog.newDirMenuItem, true);
+    SetEnabledElement(gDialog.renameMenuItem, false);
+    return;
+  }
+
+  // finally, we have a file or a dir selected in the tree
+  SetEnabledElement(gDialog.refreshMenuItem, true);
+  SetEnabledElement(gDialog.deleteMenuItem, true);
+  SetEnabledElement(gDialog.newDirMenuItem, true);
+  SetEnabledElement(gDialog.renameMenuItem, true);
+
+}
+
+function MakeNewDir()
+{
+  var tree = gDialog.tableProjects;
+  var contentView = tree.contentView;
+  var view = tree.view;
+  if (!view.selection.count)
+    return;
+
+  var index = view.selection.currentIndex;
+  var treeitem = contentView.getItemAtIndex(index);
+
+  if (!treeitem.hasAttribute("container"))
+    treeitem = treeitem.parentNode.parentNode;
+
+  var result = {value:null};
+  if (PromptUtils.prompt(window,
+                         gDialog.projectManagerBundle.getString("ConfirmDirCreation"),
+                         gDialog.projectManagerBundle.getString("EnterDirName"),
+                         result))
+  {
+    var url = treeitem.getAttribute("localStoreHome");
+    if (IsFileUrl(url))
+    {
+      file = GetFileFromURLSpec(url);
+      file.append(result.value);
+      file.create(1, 755);
+      url += result.value;
+      AppendNewLocalDir(url, file.leafName, treeitem);
+    }
+    else
+    {
+      url = GetRemoteUrl(treeitem) + "/" + result.value;
+      var URL = GetURLFromUrl(url);
+      createDirURLAsync(url, URL.filePath, treeitem, false);
+    }
+  }
+}
+
+function Rename()
+{
+  var tree = gDialog.tableProjects;
+  var contentView = tree.contentView;
+  var view = tree.view;
+  if (!view.selection.count)
+    return;
+
+  var index = view.selection.currentIndex;
+  var treeitem = contentView.getItemAtIndex(index);
+  var name = treeitem.getAttribute("name");
+
+  var result = {value: name};
+  if (PromptUtils.prompt(window,
+                         gDialog.projectManagerBundle.getString("FileOrDirRenaming"),
+                         gDialog.projectManagerBundle.getString("FileOrDirRenamingPrompt"),
+                         result) &&
+      name != result.value)
+  {
+    // ok, user did not cancel and we have a new name for the file/directory
+    var parentDir = treeitem.getAttribute("parentDir");
+    if (treeitem.getAttribute("localStoreHome")) // LOCAL
+    {
+      var localFile = GetLocalFileFromURLSpec(treeitem.getAttribute("localStoreHome"));
+      try {
+        localFile.moveTo(null, result.value);
+      }
+      catch(e) {
+        // something wrent wrong, we can't rename that file or dir
+        PromptUtils.alertWithTitle(gDialog.projectManagerBundle.getString("Rename"),
+                                   gDialog.projectManagerBundle.getString("ErrorOnRename"),
+                                   window);
+        return;
+      }
+
+      var newName = parentDir + result.value;
+      if (treeitem.hasAttribute("container"))
+        newName += "/";
+      treeitem.setAttribute("localStoreHome", newName);
+      treeitem.setAttribute("name", result.value);
+
+      var mainCell = treeitem.firstChild.firstChild;
+      var dateCell = mainCell.nextSibling.nextSibling;
+      mainCell.setAttribute("label", result.value);
+    }
+    else
+    {
+      var url = GetRemoteUrl(treeitem);
+      var URL = GetURLFromUrl(url);
+      // do we deal with a UTF-8 name or a special charset like windows1252 ?
+      if (L10NUtils.convertStringToUTF8(url))
+      {
+        url = URL.spec;
+      }
+      /*else
+      {
+        URL.fileName = "";
+        url = URL.spec + escape(treeitem.getAttribute("name"));
+      }*/
+      URL.fileName = result.value;
+      ShowThrobber(true);
+      renameURLAsync(url, URL, treeitem);
+    }
+  }
+}
+
+function RenameTo(aNewURI, aTreeitem)
+{
+  var filename = L10NUtils.convertStringToUTF8(unescape(aNewURI.fileName)) ||
+                 unescape(aNewURI.fileName);
+  aTreeitem.setAttribute("rootpath", aTreeitem.parentNode.parentNode.getAttribute("rootpath") + "/" + filename);
+
+  var mainCell = aTreeitem.firstChild.firstChild;
+  var dateCell = mainCell.nextSibling.nextSibling;
+  mainCell.setAttribute("label", filename);
+  aTreeitem.setAttribute("name", filename);
+}
+
+function GetURLFromUrl(url)
+{
+  try {
+    var URL = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURL);
+    URL.spec = url;
+    return URL;
+  } catch (e) {
+    return null;
+  }
+}
+
+function AppendNewLocalDir(aSpec, aFileName, aTreeitem)
+{
+  var treechildren = null;
+  if (aTreeitem.lastChild &&
+      aTreeitem.lastChild.nodeName.toLowerCase() == "treechildren")
+    treechildren = aTreeitem.lastChild
+  else
+  {
+    treechildren = document.createElement("treechildren");
+    aTreeitem.appendChild(treechildren);
+  }
+
+  var child = treechildren.firstChild;
+  while (child &&
+         child.getAttribute("localStoreHome") <= aSpec &&
+         child.hasAttribute("container"))
+    child = child.nextSibling;
+
+  var treeitem = document.createElement("treeitem");
+  var treerow = document.createElement("treerow");
+  var treecell1 = document.createElement("treecell");
+  var treecell2 = document.createElement("treecell");
+  var treecell3 = document.createElement("treecell");
+  treecell1.setAttribute("label", aFileName);
+  treecell2.setAttribute("label", "");
+  var lastModTime = new Date();
+  treecell3.setAttribute("label", GetNormalizedDate(lastModTime));
+  treeitem.setAttribute("lastModifiedTime", lastModTime);
+
+  treerow.appendChild(treecell1);
+  treerow.appendChild(treecell2);
+  treerow.appendChild(treecell3);
+  treeitem.appendChild(treerow);
+  treeitem.setAttribute("name", aFileName);
+
+  treeitem.setAttribute("container", "true");
+  treeitem.setAttribute("localStoreHome", aSpec + "/");
+
+  treechildren.insertBefore(treeitem, child);
+
+  var tree = gDialog.tableProjects;
+  var contentView = tree.contentView;
+  var view = tree.view;
+
+  var index = contentView.getIndexOfItem(treeitem);
+  view.selection.select(index);
+}
+
+function StopFtpConnection()
+{
+  DropFtpConnection();
+  ForgetAboutLastFtpRequest();
+  ShowThrobber(false);
+}
+
+function AppendNewRemoteDir(aSpec, aTreeitem)
+{
+  var URL = GetURLFromUrl(aSpec);
+  var fileName = L10NUtils.convertStringToUTF8(unescape(URL.fileName)) ||
+                 unescape(URL.fileName);
+  var rootpath = aTreeitem.getAttribute("rootpath") + "/" + fileName;
+
+  var hostname = aTreeitem.getAttribute("hostname");
+  var user = aTreeitem.getAttribute("user");
+
+  var treechildren = null;
+  if (aTreeitem.lastChild &&
+      aTreeitem.lastChild.nodeName.toLowerCase() == "treechildren")
+    treechildren = aTreeitem.lastChild
+  else
+  {
+    treechildren = document.createElement("treechildren");
+    aTreeitem.appendChild(treechildren);
+  }
+
+  var child = treechildren.firstChild;
+  while (child &&
+         child.getAttribute("rootpath") <= rootpath &&
+         child.hasAttribute("container"))
+    child = child.nextSibling;
+
+  var treeitem = document.createElement("treeitem");
+  var treerow = document.createElement("treerow");
+  var treecell1 = document.createElement("treecell");
+  var treecell2 = document.createElement("treecell");
+  var treecell3 = document.createElement("treecell");
+  treecell1.setAttribute("label", fileName);
+  treecell2.setAttribute("label", "");
+  var lastModTime = new Date();
+  treecell3.setAttribute("label", GetNormalizedDate(lastModTime));
+  treeitem.setAttribute("lastModifiedTime", lastModTime);
+
+  treerow.appendChild(treecell1);
+  treerow.appendChild(treecell2);
+  treerow.appendChild(treecell3);
+  treeitem.appendChild(treerow);
+  treeitem.setAttribute("name", fileName);
+  treeitem.setAttribute("hostname", hostname);
+  treeitem.setAttribute("rootpath", rootpath);
+  treeitem.setAttribute("user", user);
+  treeitem.setAttribute("container", "true");
+
+  treechildren.insertBefore(treeitem, child);
+
+  var tree = gDialog.tableProjects;
+  var contentView = tree.contentView;
+  var view = tree.view;
+
+  var index = contentView.getIndexOfItem(treeitem);
+  view.selection.select(index);
+}
+
+function OnTreeSelect()
+{
+  var tree = gDialog.tableProjects;
+  var contentView = tree.contentView;
+  var view = tree.view;
+  if (!view.selection.count) // No selection yet in the tree
+  {
+    SetEnabledElement(gDialog.ProjectMinusButton, false);
+    SetEnabledElement(gDialog.ProjectConfigButton, false);
+    return;
+  }
+  var index = view.selection.currentIndex;
+  var treeitem = contentView.getItemAtIndex(index);
+
+  // the selection is a project, not a file or a dir
+  if (treeitem.parentNode.parentNode.nodeName.toLowerCase() == "tree")
+  {
+    SetEnabledElement(gDialog.ProjectMinusButton, true);
+    SetEnabledElement(gDialog.ProjectConfigButton, true);
+    return;
+  }
+
+  // finally, we have a file or a dir selected in the tree
+  SetEnabledElement(gDialog.ProjectMinusButton, false);
+  SetEnabledElement(gDialog.ProjectConfigButton, false);
+}
+
+function GetSelectedTreeitem(aTree)
+{
+  var contentView = aTree.contentView;
+  var view = aTree.view;
+  var index = view.selection.currentIndex;
+  return contentView.getItemAtIndex(index);
+}
+
+function DeleteProject()
+{
+  var treeitem = GetSelectedTreeitem(gDialog.tableProjects);
+
+  // confirmation needed to delete the project...
+  var bundle = gDialog.projectManagerBundle;
+  var title  = bundle.getString("DeleteProject");
+  var msg    = bundle.getString("ConfirmProjectDeletion");
+  var ok     = bundle.getString("DeleteOk");
+  var cancel = bundle.getString("DeleteCancel");
+  
+  if (PromptUtils.confirmWithTitle(title, msg, ok, cancel))
+  {
+    treeitem.parentNode.removeChild(treeitem);
+
+    var dbConn = GetDBConn();
+    var statement = dbConn.createStatement("DELETE FROM 'projects' WHERE name=?1");
+  
+    statement.bindUTF8StringParameter(0, treeitem.getAttribute("name"));
+     
+    statement.execute();
+    statement.finalize();
+  
+    dbConn.close();
+  }
+}
+
+function OpenConfigProjectDialog()
+{
+  var treeitem = GetSelectedTreeitem(gDialog.tableProjects);
+  window.openDialog("chrome://projectmanager/content/projectProperties.xul", "",
+                    "modal, centerscreen, resizable=no", treeitem);
+}
diff --git a/sidebars/projectManager/content/projectManager.xul b/sidebars/projectManager/content/projectManager.xul
new file mode 100644 (file)
index 0000000..7bdeb9a
--- /dev/null
@@ -0,0 +1,151 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is Composer.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2006
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://projectmanager/skin/projectManager.css" type="text/css"?>
+<?xml-stylesheet href="chrome://bluegriffon/skin/listboxBg.css" type="text/css"?>
+
+<!DOCTYPE page [
+  <!ENTITY % projectManagerDTD SYSTEM "chrome://projectmanager/locale/projectManager.dtd">
+  %projectManagerDTD;
+]>
+
+<page id         = "projectManager"
+      xmlns      = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+      xmlns:html = "http://www.w3.org/1999/xhtml"
+      onload     = "Startup()"
+      orient     = "vertical"
+      onunload   = "Shutdown()">
+
+  <script type="application/x-javascript"  src="chrome://bluegriffon/content/utils/dgid.js"/>
+  <script type="application/x-javascript"  src="chrome://bluegriffon/content/utils/global.js"/>
+  <script type="application/x-javascript"  src="chrome://projectmanager/content/projectManager.js"/>
+  <script type="application/x-javascript"  src="chrome://bluegriffon/content/utils/login.js"/>
+  <script type="application/x-javascript"  src="chrome://bluegriffon/content/utils/urls.js"/>
+  <script type="application/x-javascript"  src="chrome://bluegriffon/content/utils/editorUtils.js"/>
+  <script type="application/x-javascript"  src="chrome://bluegriffon/content/utils/prompter.js"/>
+  <script type="application/x-javascript"  src="chrome://bluegriffon/content/utils/notifiers.js"/>
+  <script type="application/x-javascript"  src="chrome://bluegriffon/content/utils/l10n.js"/>
+  <script type="application/x-javascript"  src="chrome://projectmanager/content/ftpDirParser.js"/>
+  <script type="application/x-javascript"  src="chrome://projectmanager/content/localDirParser.js"/>
+  <script type="application/x-javascript"  src="chrome://projectmanager/content/url-loader.js"/>
+  <script type="application/x-javascript"  src="chrome://projectmanager/content/ftpProgressListener.js"/>
+
+  <stringbundle id="projectManagerBundle" src="chrome://projectmanager/locale/projectManager.properties"/>
+
+  <popupset id="projectManagerPopupSet">
+    <popup id="tableProjectsPopup"
+           onpopupshowing="TweakTableProjectsPopup(); ">
+      <menuitem label="&refresh.label;"
+                id="refreshMenuItem"
+                accesskey="&refresh.accesskey;"
+                oncommand="RefreshEntry()"/>
+      <menuseparator/>
+      <menuitem label="&delete.label;"
+                id="deleteMenuItem"
+                accesskey="&delete.accesskey;"
+                oncommand="DeleteFileOrDir()"/>
+      <menuseparator/>
+      <menuitem label="&newDir.label;"
+                id="newDirMenuItem"
+                accesskey="&newDir.accesskey;"
+                oncommand="MakeNewDir()"/>
+      <menuitem label="&rename.label;"
+                id="renameMenuItem"
+                accesskey="&rename.accesskey;"
+                oncommand="Rename()"/>
+    </popup>
+  </popupset>
+
+#ifndef XP_MACOSX
+  <hbox id="ProjectMgrBox">
+    <toolbarbutton id="ProjectPlusButton"
+                   oncommand="OpenAddProjectDialog()"/>
+    <toolbarbutton disabled="true"
+                   oncommand="DeleteProject()"
+                   id="ProjectMinusButton"/>
+    <toolbarbutton disabled="true"
+                   oncommand="OpenConfigProjectDialog()"
+                   id="ProjectConfigButton"/>
+    <spacer flex="1"/>
+    <toolbarbutton hidden="true"
+                   oncommand="StopFtpConnection()"
+                   id="ProjectThrobberButton"
+                   />
+  </hbox>
+#endif
+  <tree id="tableProjects" flex="1" enableColumnDrag="true"
+        seltype="single"
+        onselect="OnTreeSelect();"
+        context="tableProjectsPopup">
+    <treecols id="treecols">
+      <treecol id="siteTreecol" persist="width ordinal hidden" 
+               label="&projects.column;" flex="1" primary="true"/>
+      <splitter class="tree-splitter"/>
+      <treecol id="sizeTreecol" persist="width ordinal hidden" 
+               label="&size.column;"/>
+      <splitter class="tree-splitter"/>
+      <treecol id="lastModifiedTreecol" persist="width ordinal hidden" 
+               label="&lastModified.column;"/>
+   </treecols>
+    <treechildren id="tableProjectsChildren"
+        ondblclick="OnDblCLick()"/>
+  </tree>
+#ifdef XP_MACOSX
+  <hbox id="ProjectMgrBox" class="listboxBg">
+    <toolbarbutton class="listboxBgPlusButton"
+                   id="ProjectPlusButton"
+                   oncommand="OpenAddProjectDialog()"/>
+    <toolbarbutton class="listboxBgMinusButton"
+                   disabled="true"
+                   id="ProjectMinusButton"
+                   oncommand="DeleteProject()"/>
+    <toolbarbutton class="listboxBgConfigButton"
+                   disabled="true"
+                   oncommand="OpenConfigProjectDialog()"
+                   id="ProjectConfigButton"/>
+    <spacer flex="1"/>
+    <toolbarbutton class="listboxBgThrobberButton"
+                   hidden="true"
+                   oncommand="StopFtpConnection()"
+                   id="ProjectThrobberButton"
+                   />
+  </hbox>
+#endif
+</page>
diff --git a/sidebars/projectManager/content/projectProperties.js b/sidebars/projectManager/content/projectProperties.js
new file mode 100644 (file)
index 0000000..4cdc0f5
--- /dev/null
@@ -0,0 +1,195 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2008-2009
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+var gMain = null;
+var gModifiedTreeItem = null;
+var gModifiedProjectId = -1;
+
+function Startup()
+{
+  if (!window.arguments.length)
+    return;
+
+  var modifiedTreeItem = window.arguments[0];
+  gModifiedTreeItem = modifiedTreeItem;
+
+  GetUIElements();
+
+  if (modifiedTreeItem)
+  {
+    var localStoreHome = modifiedTreeItem.getAttribute("localStoreHome");
+    var url            = modifiedTreeItem.getAttribute("url");
+    var storageChoice  = modifiedTreeItem.getAttribute("storageChoice");
+    var hostname       = modifiedTreeItem.getAttribute("hostname");
+    var rootpath       = modifiedTreeItem.getAttribute("rootpath");
+    var user           = modifiedTreeItem.getAttribute("user");
+    var pathhtml       = modifiedTreeItem.getAttribute("pathhtml");
+    var pathmedia      = modifiedTreeItem.getAttribute("pathmedia");
+    var pathJS         = modifiedTreeItem.getAttribute("pathJS");
+    var pathCSS        = modifiedTreeItem.getAttribute("pathCSS");
+    var name           = modifiedTreeItem.getAttribute("name");
+    gModifiedProjectId = modifiedTreeItem.getAttribute("projectid");
+    // HAVE TO QUERY PASSWORD...
+    var password = LoginUtils.findPassword("ftp://" + hostname,
+                                           null,
+                                           "bluegriffon",
+                                           user);
+
+    gDialog.projectNameBox.value = name;
+    gDialog.urlBox.value = url;
+    gDialog.storageChoice.value = storageChoice;
+    gDialog.localStoreHomeBox.value = localStoreHome;
+    gDialog.hostnameBox.value = hostname;
+    gDialog.rootpathBox.value = rootpath;
+    gDialog.userBox.value = user;
+    gDialog.passwordBox.value = password;
+    gDialog.pathhtmlBox.value = pathhtml;
+    gDialog.pathmediaBox.value = pathmedia;
+    gDialog.pathJSBox.value = pathJS;
+    gDialog.pathCSSBox.value = pathCSS;
+  }
+  else
+    SetEnabledElement(document.documentElement.getButton("accept"), false);
+
+  gMain = window.opener;
+}
+
+function onProjectNameChanged(aElt)
+{
+  var name = aElt.value;
+  var okButton = document.documentElement.getButton("accept");
+  if (!name)
+  {
+    SetEnabledElement(okButton, false);
+    return;
+  }
+
+  var projects = gMain.gDialog.tableProjectsChildren.childNodes;
+  var found = false;
+  for (var i = 0 ; !found && i < projects.length; i++)
+  {
+    var p = projects[i];
+    found = (p.getAttribute("name") == name);
+  }
+  SetEnabledElement(okButton, !found);
+}
+
+function Apply()
+{
+  var name = gDialog.projectNameBox.value;
+  var url = gDialog.urlBox.value;
+  var storageChoice = gDialog.storageChoice.value;
+  var localStoreHome = gDialog.localStoreHomeBox.value;
+  var hostname = gDialog.hostnameBox.value;
+  var rootpath = gDialog.rootpathBox.value;
+  var user = gDialog.userBox.value;
+  var password = gDialog.passwordBox.value;
+  var pathhtml = gDialog.pathhtmlBox.value;
+  var pathmedia = gDialog.pathmediaBox.value;
+  var pathJS = gDialog.pathJSBox.value;
+  var pathCSS = gDialog.pathCSSBox.value;
+
+  if (storageChoice != "local" && hostname && user && password)
+  {
+    var ftpUrl = "ftp://" + hostname;
+    LoginUtils.addLogin(ftpUrl, user, password);
+  }
+
+  var dbConn = gMain.GetDBConn();
+  var statement;
+  if (gModifiedTreeItem)
+  {
+    statement = dbConn.createStatement("UPDATE 'projects' SET name=?1,\
+url=?2,\
+storageChoice=?3,\
+localStoreHome=?4,\
+hostname=?5,\
+rootpath=?6,\
+user=?7,\
+pathhtml=?8,\
+pathmedia=?9,\
+pathJS=?10,\
+pathCSS=?11 WHERE id=?12");
+    statement.bindUTF8StringParameter(11, gModifiedProjectId);
+  }
+  else
+  {
+    statement = dbConn.createStatement("INSERT INTO 'projects' ('name','url','storageChoice','localStoreHome','hostname','rootpath','user','pathhtml','pathmedia','pathJS','pathCSS') VALUES(?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11)");
+  }
+  statement.bindUTF8StringParameter(0, name);
+  statement.bindUTF8StringParameter(1, url);
+  statement.bindUTF8StringParameter(2, storageChoice);
+  statement.bindUTF8StringParameter(3, localStoreHome);
+  statement.bindUTF8StringParameter(4, hostname);
+  statement.bindUTF8StringParameter(5, rootpath);
+  statement.bindUTF8StringParameter(6, user);
+  statement.bindUTF8StringParameter(7, pathhtml);
+  statement.bindUTF8StringParameter(8, pathmedia);
+  statement.bindUTF8StringParameter(9, pathJS);
+  statement.bindUTF8StringParameter(10, pathCSS);
+
+  statement.execute();
+  statement.finalize();
+
+  dbConn.close();
+
+  deleteAllChildren(gMain.gDialog.tableProjectsChildren);
+  gMain.ListProjects();
+}
+
+function onStorageChoice(aElt)
+{
+  switch (aElt.value)
+  {
+    case "ftp":
+      gDialog.localStoreGroupbox.setAttribute("hidden", "true");
+      gDialog.ftpAccessGroupbox.removeAttribute("hidden");
+      break;
+    case "copy":
+      gDialog.ftpAccessGroupbox.removeAttribute("hidden");
+      gDialog.localStoreGroupbox.removeAttribute("hidden");
+      break;
+    case "local":
+      gDialog.ftpAccessGroupbox.setAttribute("hidden", "true");
+      gDialog.localStoreGroupbox.removeAttribute("hidden");
+      break;
+
+    default: break; // should never happen
+  }
+
+  window.sizeToContent();
+}
\ No newline at end of file
diff --git a/sidebars/projectManager/content/projectProperties.xul b/sidebars/projectManager/content/projectProperties.xul
new file mode 100644 (file)
index 0000000..40c038b
--- /dev/null
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is BlueGriffon.
+   -
+   - The Initial Developer of the Original Code is
+   - Disruptive Innovations SARL.
+   - Portions created by the Initial Developer are Copyright (C) 2008
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Daniel Glazman (daniel.glazman@disruptive-innovations.com), Original Author
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://projectmanager/skin/projectProperties.css" type="text/css"?>
+
+<!DOCTYPE page [
+  <!ENTITY % projectManagerDTD SYSTEM "chrome://projectmanager/locale/projectProperties.dtd">
+  <!ENTITY % filePickingDTD SYSTEM "chrome://bluegriffon/locale/filePicking.dtd" >
+  %projectManagerDTD;
+  %filePickingDTD;
+]>
+
+<dialog id         = "projectProperties"
+        title      = "&window.title;"
+        xmlns      = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        xmlns:html = "http://www.w3.org/1999/xhtml"
+        persist    = "screenX screenY"
+        onload     = "Startup()"
+        orient     = "vertical"
+        ondialogaccept = "Apply()">
+
+  <script type="application/x-javascript"  src="chrome://bluegriffon/content/utils/dgid.js"/>
+  <script type="application/x-javascript"  src="chrome://bluegriffon/content/utils/global.js"/>
+  <script type="application/x-javascript"  src="chrome://bluegriffon/content/utils/prompter.js"/>
+  <script type="application/x-javascript"  src="chrome://bluegriffon/content/utils/l10n.js"/>
+  <script type="application/x-javascript"  src="chrome://projectmanager/content/projectProperties.js"/>
+  <script type="application/x-javascript"  src="chrome://bluegriffon/content/utils/login.js"/>
+
+  <hbox align="center">
+    <label value="&projectName.label;"
+           accesskey="&projectName.accesskey;"
+           control="projectNameBox"/>
+    <textbox flex="1"
+             id="projectNameBox"
+             oninput="onProjectNameChanged(this)"/>
+  </hbox>
+
+  <groupbox>
+    <caption label="&remoteSiteInformation.caption;"/>
+    <label value="&url.label;"
+           accesskey="&url.accesskey;"
+           control="urlBox"/>
+    <textbox flex="1" id="urlBox"/>
+  </groupbox>
+
+  <radiogroup orient="horizontal"
+              class="indent"
+              id="storageChoice"
+              onselect="onStorageChoice(this)">
+    <radio label="&ftpAccess.label;"
+           accesskey="&ftpAccess.accesskey;"
+           selected="true"
+           value="ftp"/>
+    <radio label="&localCopy.label;"
+           hidden="true"
+           accesskey="&localCopy.accesskey;"
+           value="copy"/>
+    <radio label="&localStore.label;"
+           accesskey="&localStore.accesskey;"
+           value="local"/>
+  </radiogroup>
+
+  <groupbox id="localStoreGroupbox" hidden="true">
+    <caption label="&localStore.label;"/>
+    <hbox align="center">
+      <label value="&localStoreHome.label;"
+             id="localStoreHomeBoxController"
+             accesskey="&localStoreHome.accesskey;"
+             control="localStoreHomeBox"/>
+      <textbox id="localStoreHomeBox" flex="1"/>
+      <filepickerbutton id="filepickerbutton"
+                        mode="2"
+                        control="localStoreHomeBox"
+                        title="&filepickerForLocalStoreHome.title;"/>
+    </hbox>
+  </groupbox>
+
+  <groupbox id="ftpAccessGroupbox">
+    <caption label="&ftpAccess.label;"/>
+    <grid>
+      <columns><column/><column flex="1"/></columns>
+      <rows>
+        <row align="center">
+          <label value="&hostname.label;"
+                 id="hostnameBoxController"
+                 accesskey="&hostname.accesskey;"
+                 control="hostnameBox"/>
+          <textbox id="hostnameBox"/>
+        </row>
+        <row align="center">
+          <label value="&rootpath.label;"
+                 accesskey="&rootpath.accesskey;"
+                 control="rootpathBox"/>
+          <textbox id="rootpathBox"/>
+        </row>
+        <row align="center">
+          <label value="&user.label;"
+                 accesskey="&user.accesskey;"
+                 control="userBox"/>
+          <textbox id="userBox"/>
+        </row>
+        <row align="center">
+          <label value="&password.label;"
+                 accesskey="&password.accesskey;"
+                 control="passwordBox"/>
+          <textbox type="password" id="passwordBox"/>
+        </row>
+      </rows>
+    </grid>
+  </groupbox>
+
+  <groupbox>
+    <caption label="&directories.caption;"/>
+    <grid>
+      <columns><column/><column flex="1"/></columns>
+      <rows>
+        <row align="center">
+          <label value="&pathhtml.label;"
+                 accesskey="&pathhtml.accesskey;"
+                 control="pathhtmlBox"/>
+          <textbox id="pathhtmlBox"/>
+        </row>
+        <row align="center">
+          <label value="&pathmedia.label;"
+                 accesskey="&pathmedia.accesskey;"
+                 control="pathmediaBox"/>
+          <textbox id="pathmediaBox"/>
+        </row>
+        <row align="center">
+          <label value="&pathJS.label;"
+                 accesskey="&pathJS.accesskey;"
+                 control="pathJSBox"/>
+          <textbox id="pathJSBox"/>
+        </row>
+        <row align="center">
+          <label value="&pathCSS.label;"
+                 accesskey="&pathCSS.accesskey;"
+                 control="pathCSSBox"/>
+          <textbox id="pathCSSBox"/>
+        </row>
+      </rows>
+    </grid>
+
+  </groupbox>
+</dialog>
+
diff --git a/sidebars/projectManager/content/url-loader.js b/sidebars/projectManager/content/url-loader.js
new file mode 100755 (executable)
index 0000000..ed7855a
--- /dev/null
@@ -0,0 +1,248 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Nvu.
+ *
+ * The Initial Developer of the Original Code is
+ * Linspire Inc..
+ * Portions created by the Initial Developer are Copyright (C) 2003-2005
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman (glazman@disruptive-innovations.com), original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+
+const IOSERVICE_CTRID           = "@mozilla.org/network/io-service;1";
+const cnsIIOService             = Components.interfaces.nsIIOService;
+const SIS_CTRID                 = "@mozilla.org/scriptableinputstream;1"
+const cnsIScriptableInputStream = Components.interfaces.nsIScriptableInputStream;
+const cnsIChannel               = Components.interfaces.nsIChannel;
+const cnsIInputStream           = Components.interfaces.nsIInputStream;
+const cnsIRequest               = Components.interfaces.nsIRequest;
+const cnsIDirectoryListing      = Components.interfaces.nsIDirectoryListing;
+
+var gError;
+var gCurrentChannel;
+
+function _getChannelForURL (url)
+{
+    var serv = Components.classes[IOSERVICE_CTRID].getService(cnsIIOService);
+    if (!serv)
+        return null;
+    
+    return serv.newChannel(url, "UTF-8", null);
+
+}
+
+function StreamListener(channel, url, observer)
+{
+    this.channel = channel;
+    this.data = "";
+    this.url = url;
+    this.observer = observer;
+}
+
+StreamListener.prototype.onStartRequest =
+function (request, context)
+{
+}
+
+StreamListener.prototype.onStopRequest =
+function (request, context, status)
+{
+    // close the channel
+    this.channel.cancel(0x804b0002); // NS_BINDING_ABORTED
+
+    if (this.observer &&
+        typeof this.observer.onComplete == "function")
+        this.observer.onComplete (this.data, this.url, status);
+}
+
+StreamListener.prototype.onDataAvailable =
+function (request, context, inStr, sourceOffset, count)
+{
+    // dump ("onDataAvailable(): " + count + "\n");
+    // sometimes the inStr changes between onDataAvailable calls, so we
+    // can't cache it.
+    /*var sis = 
+        Components.classes[SIS_CTRID].createInstance(cnsIScriptableInputStream);
+    sis.init(inStr);
+    var str = sis.read(count);*/
+    var sis = Components.classes['@mozilla.org/binaryinputstream;1']
+                            .createInstance(Components.interfaces.nsIBinaryInputStream);
+    sis.setInputStream(inStr);
+    var str = sis.readBytes(count);
+
+    this.data += str;
+}
+
+
+
+function loadURLAsync (url, observer)
+{
+  var chan = _getChannelForURL (url);
+  chan.loadFlags |= cnsIRequest.LOAD_BYPASS_CACHE;
+  
+  chan.contentType = "application/http-index-format";
+  gCurrentChannel = chan;
+
+  return chan.asyncOpen (new StreamListener (chan, url, observer), null);
+}
+
+function newFileInputStream(file, buffered)
+{
+  const PR_RDONLY = 0x1;
+  var stream =
+      Components.classes["@mozilla.org/network/file-input-stream;1"].
+      createInstance(Components.interfaces.nsIFileInputStream);
+  stream.init(file, PR_RDONLY, 0, 0);
+  if (!buffered)
+    return stream;
+
+  var buffer =
+      Components.classes["@mozilla.org/network/buffered-input-stream;1"].
+      createInstance(Components.interfaces.nsIBufferedInputStream);
+  buffer.init(stream, 4096);
+  return buffer;
+}
+
+function StoreURLAsync (aURLSpec, aFile, observer)
+{
+  var chan = _getChannelForURL (aURLSpec);
+  chan.loadFlags |= cnsIRequest.LOAD_BYPASS_CACHE;
+  
+  // chan.contentType = "application/http-index-format";
+  gCurrentChannel = chan;
+
+  var uploadstream = newFileInputStream(aFile, true);
+
+  chan.QueryInterface(Components.interfaces.nsIUploadChannel);
+  chan.setUploadStream(uploadstream, "", aFile.fileSize);
+
+  return chan.asyncOpen (new StreamListener (chan, aURLSpec, observer), null);
+}
+
+function loadURL(url, caller)
+{
+  function onComplete(data, url, status)
+    {
+      if (status == Components.results.NS_OK)
+      {
+        if (caller.parseData)
+          caller.parseData(data, caller.rqData);
+        if (caller.endCallback)
+          caller.endCallback(caller.rqData);
+      }
+      else if (caller.errorCallback)
+        caller.errorCallback(url, status);
+    };
+
+  loadURLAsync (url, { onComplete: onComplete });
+}
+
+/*******************************/
+
+function deleteURLAsync (url, treeitem)
+{
+  var chan = _getChannelForURL (url);
+  chan.loadFlags |= cnsIRequest.LOAD_BYPASS_CACHE;
+
+  chan instanceof Components.interfaces.nsIFTPChannel;
+  var p = new progressListener(chan, FTP_DEL, url, null, treeitem)
+  chan.notificationCallbacks = p.QueryInterface(Components.interfaces.nsIInterfaceRequestor) ;
+  chan.deleteFile();
+  gError = false;
+
+  gCurrentChannel = chan;
+
+  return chan.asyncOpen (new StreamListener (chan, url, null), null);
+}
+
+function removeDirURLAsync (url, treeitem)
+{
+  var chan = _getChannelForURL (url);
+  chan.loadFlags |= cnsIRequest.LOAD_BYPASS_CACHE;
+
+  chan instanceof Components.interfaces.nsIFTPChannel;
+  var p = new progressListener(chan, FTP_RMDIR, url, null, treeitem)
+  chan.notificationCallbacks = p.QueryInterface(Components.interfaces.nsIInterfaceRequestor) ;
+  chan.removeDirectory();
+  gError = false;
+
+  gCurrentChannel = chan;
+
+  return chan.asyncOpen (new StreamListener (chan, url, null), null);
+}
+
+function createDirURLAsync (url, aDirName, aRequestData, aEnableNotifs)
+{
+  var chan = _getChannelForURL (url);
+  chan.loadFlags |= cnsIRequest.LOAD_BYPASS_CACHE;
+
+  chan instanceof Components.interfaces.nsIFTPChannel;
+  if (aEnableNotifs)
+  {
+         var p = new progressListener(chan, FTP_MKDIR, url, aDirName, aRequestData)
+         chan.notificationCallbacks = p.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
+  }
+  chan.createDirectory();
+  gError = false;
+
+  gCurrentChannel = chan;
+
+  return chan.asyncOpen (new StreamListener (chan, url, null), null);
+}
+
+function renameURLAsync(url, aNewURI, aRequestData)
+{
+  var chan = _getChannelForURL(url);
+  chan.loadFlags |= cnsIRequest.LOAD_BYPASS_CACHE;
+
+  chan instanceof Components.interfaces.nsIFTPChannel;
+  var p = new progressListener(chan, FTP_RENAME, url, aNewURI, aRequestData)
+  chan.notificationCallbacks = p.QueryInterface(Components.interfaces.nsIInterfaceRequestor) ;
+  chan.renameTo(aNewURI);
+  gError = false;
+
+  gCurrentChannel = chan;
+
+  return chan.asyncOpen (new StreamListener (chan, url, null), null);
+}
+
+/**************************************/
+
+function DropFtpConnection()
+{
+  if (gCurrentChannel)
+    gCurrentChannel.cancel(0x804b0002); // NS_BINDING_ABORTED
+}
+
+function ForgetAboutLastFtpRequest()
+{
+  gCurrentChannel = null;
+}
+
diff --git a/sidebars/projectManager/jar.mn b/sidebars/projectManager/jar.mn
new file mode 100644 (file)
index 0000000..f1e0f47
--- /dev/null
@@ -0,0 +1,29 @@
+
+projectmanager.jar:
+% content   projectmanager          %content/projectmanager/
+% skin    projectmanager    classic/1.0 %skin/classic/projectmanager/
+% overlay   chrome://bluegriffon/content/xul/bluegriffon.xul    chrome://projectmanager/content/bluegriffonOverlay.xul
+  content/projectmanager/bluegriffonOverlay.xul      (content/bluegriffonOverlay.xul)
+  content/projectmanager/bluegriffonOverlay.js      (content/bluegriffonOverlay.js)
+*  content/projectmanager/projectManager.xul        (content/projectManager.xul)
+  content/projectmanager/projectManager.js          (content/projectManager.js)
+  content/projectmanager/projectProperties.xul      (content/projectProperties.xul)
+  content/projectmanager/projectProperties.js       (content/projectProperties.js)
+* content/projectmanager/localDirParser.js          (content/localDirParser.js)
+  content/projectmanager/ftpDirParser.js            (content/ftpDirParser.js)
+  content/projectmanager/url-loader.js              (content/url-loader.js)
+  content/projectmanager/ftpProgressListener.js     (content/ftpProgressListener.js)
+*  skin/classic/projectmanager/projectManager.css    (skin/projectManager.css)
+  skin/classic/projectmanager/projectProperties.css (skin/projectProperties.css)
+  skin/classic/projectmanager/plus.png              (skin/plus.png)
+  skin/classic/projectmanager/minus.png             (skin/minus.png)
+  skin/classic/projectmanager/config.png            (skin/config.png)
+  skin/classic/projectmanager/minus-disabled.png    (skin/minus-disabled.png)
+  skin/classic/projectmanager/config-disabled.png   (skin/config-disabled.png)
+
+projectmanager-locale.jar:
+% locale    projectmanager    en-US    %locale/en-US/projectmanager/
+  locale/en-US/projectmanager/bluegriffonOverlay.dtd    (locale/en-US/bluegriffonOverlay.dtd)
+  locale/en-US/projectmanager/projectManager.dtd        (locale/en-US/projectManager.dtd)
+  locale/en-US/projectmanager/projectManager.properties (locale/en-US/projectManager.properties)
+  locale/en-US/projectmanager/projectProperties.dtd     (locale/en-US/projectProperties.dtd)
diff --git a/sidebars/projectManager/locale/en-US/bluegriffonOverlay.dtd b/sidebars/projectManager/locale/en-US/bluegriffonOverlay.dtd
new file mode 100644 (file)
index 0000000..cb1087c
--- /dev/null
@@ -0,0 +1 @@
+<!ENTITY projectmanager.label "Project Manager">
diff --git a/sidebars/projectManager/locale/en-US/projectManager.dtd b/sidebars/projectManager/locale/en-US/projectManager.dtd
new file mode 100644 (file)
index 0000000..006237d
--- /dev/null
@@ -0,0 +1,18 @@
+<!ENTITY viewUASheets.label "View UA StyleSheets">
+
+<!ENTITY projects.column "Projects">
+<!ENTITY size.column "Size">
+<!ENTITY lastModified.column "Last modified">
+
+<!ENTITY refresh.label "Refresh">
+<!ENTITY refresh.accesskey "R">
+
+<!ENTITY delete.label "Delete">
+<!ENTITY delete.accesskey "D">
+
+<!ENTITY newDir.label "New folder">
+<!ENTITY newDir.accesskey "N">
+
+<!ENTITY rename.label "Rename">
+<!ENTITY rename.accesskey "m">
+
diff --git a/sidebars/projectManager/locale/en-US/projectManager.properties b/sidebars/projectManager/locale/en-US/projectManager.properties
new file mode 100644 (file)
index 0000000..ff546d0
--- /dev/null
@@ -0,0 +1,38 @@
+month1=jan
+month2=feb
+month3=mar
+month4=apr
+month5=may
+month6=jun
+month7=jul
+month8=aug
+month9=sep
+month10=oct
+month11=nov
+month12=dec
+
+FtpLoginError=Login incorrect
+FtpCwdError=No directory
+FtpUnknownError=FTP connection failed
+NoSiteAvailable=No publish site available
+ChooseSite=Choose a site
+ConfirmDeletion=Delete File : confirmation?
+SureToDelete=Are you sure you want to delete this file?
+ConfirmDirCreation=Create a new directory?
+EnterDirName=Please enter a directory name
+ConfirmRenaming=Rename a file or directory?
+EnterNewName=Please enter the new name
+ConfirmDirRemoval=Remove directory : confirmation?
+SureToRemoveDir=Are you sure you want to remove this directory?
+RemoveDirAlert=Remove directory : alert
+DirNotEmptyAlert=This directory is not empty. Do you want to delete its contents too?
+
+FileOrDirRenaming=Rename a file or directory
+FileOrDirRenamingPrompt=Please enter the new name for the file or directory:
+Rename=Rename
+ErrorOnRename=Cannot rename file !
+
+DeleteProject=Delete Project
+ConfirmProjectDeletion=Are you sure you want to delete this project? 
+DeleteOk=Delete Project
+DeleteCancel=Cancel
diff --git a/sidebars/projectManager/locale/en-US/projectProperties.dtd b/sidebars/projectManager/locale/en-US/projectProperties.dtd
new file mode 100644 (file)
index 0000000..5b2a178
--- /dev/null
@@ -0,0 +1,39 @@
+<!ENTITY window.title "Project properties">
+
+<!ENTITY projectName.label "Project name:">
+<!ENTITY projectName.accesskey "P">
+
+<!ENTITY remoteSiteInformation.caption "Remote Site Information">
+<!ENTITY url.label "HTTP address of your home page (e.g. http://www.example.com)">
+<!ENTITY url.accesskey "a">
+
+<!ENTITY ftpAccess.caption "FTP Access">
+<!ENTITY hostname.label "Host name:">
+<!ENTITY hostname.accesskey "n">
+<!ENTITY rootpath.label "Path from root:">
+<!ENTITY rootpath.accesskey "r">
+<!ENTITY user.label "User:">
+<!ENTITY user.accesskey "U">
+<!ENTITY password.label "Password:">
+<!ENTITY password.accesskey "w">
+
+<!ENTITY directories.caption "Directories">
+<!ENTITY pathhtml.label "Path to HTML:">
+<!ENTITY pathmedia.label "Path to Media:">
+<!ENTITY pathJS.label "Path to JavaScript:">
+<!ENTITY pathCSS.label "Path to CSS and Themes:">
+<!ENTITY pathhtml.accesskey "H">
+<!ENTITY pathmedia.accesskey "M">
+<!ENTITY pathJS.accesskey "J">
+<!ENTITY pathCSS.accesskey "C">
+
+<!ENTITY ftpAccess.label "Remote site (FTP)">
+<!ENTITY ftpAccess.accesskey "F">
+<!ENTITY localCopy.label "Local copy of a remote site">
+<!ENTITY localCopy.accesskey "c">
+<!ENTITY localStore.label "Local storage">
+<!ENTITY localStore.accesskey "L">
+<!ENTITY localStoreHome.label "Local storage's root:">
+<!ENTITY localStoreHome.accesskey "s">
+<!ENTITY filepickerForLocalStoreHome.title "Select directory">
diff --git a/sidebars/projectManager/skin/config-disabled.png b/sidebars/projectManager/skin/config-disabled.png
new file mode 100644 (file)
index 0000000..0c38cf5
Binary files /dev/null and b/sidebars/projectManager/skin/config-disabled.png differ
diff --git a/sidebars/projectManager/skin/config.png b/sidebars/projectManager/skin/config.png
new file mode 100644 (file)
index 0000000..46d76c5
Binary files /dev/null and b/sidebars/projectManager/skin/config.png differ
diff --git a/sidebars/projectManager/skin/minus-disabled.png b/sidebars/projectManager/skin/minus-disabled.png
new file mode 100644 (file)
index 0000000..2ff5e41
Binary files /dev/null and b/sidebars/projectManager/skin/minus-disabled.png differ
diff --git a/sidebars/projectManager/skin/minus.png b/sidebars/projectManager/skin/minus.png
new file mode 100644 (file)
index 0000000..31dab63
Binary files /dev/null and b/sidebars/projectManager/skin/minus.png differ
diff --git a/sidebars/projectManager/skin/plus.png b/sidebars/projectManager/skin/plus.png
new file mode 100644 (file)
index 0000000..52300d1
Binary files /dev/null and b/sidebars/projectManager/skin/plus.png differ
diff --git a/sidebars/projectManager/skin/projectManager.css b/sidebars/projectManager/skin/projectManager.css
new file mode 100644 (file)
index 0000000..ec201fc
--- /dev/null
@@ -0,0 +1,82 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Composer.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+@namespace html url("http://www.w3.org/1999/xhtml");
+
+tree {
+%ifdef XP_MACOSX
+  margin: 4px 4px 0px 4px;
+%else
+  margin: 0px 4px 4px 4px;
+%endif
+}
+
+#ProjectMgrBox {
+%ifdef XP_MACOSX
+  margin: 0px 4px 4px 4px;
+%else
+  margin: 4px 4px 0px 4px;
+%endif
+}
+
+%ifndef XP_MACOSX
+#ProjectPlusButton {
+  list-style-image: url("chrome://projectmanager/skin/plus.png");
+}
+
+#ProjectMinusButton {
+  list-style-image: url("chrome://projectmanager/skin/minus.png");
+}
+
+#ProjectMinusButton[disabled="true"] {
+  list-style-image: url("chrome://projectmanager/skin/minus-disabled.png");
+}
+
+#ProjectConfigButton {
+  list-style-image: url("chrome://projectmanager/skin/config.png");
+}
+
+#ProjectConfigButton[disabled="true"] {
+  list-style-image: url("chrome://projectmanager/skin/config-disabled.png");
+}
+
+#ProjectThrobberButton {
+  list-style-image: url("chrome://projectmanager/skin/loading_16.png");
+}
+%endif
+
diff --git a/sidebars/projectManager/skin/projectProperties.css b/sidebars/projectManager/skin/projectProperties.css
new file mode 100644 (file)
index 0000000..c82dfab
--- /dev/null
@@ -0,0 +1,3 @@
+filepickerbutton {
+  -moz-binding: url('chrome://bluegriffon/content/bindings/filepickerbutton.xml#filepickerbutton');
+}
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644 (file)
index 0000000..7fe052b
--- /dev/null
@@ -0,0 +1,25 @@
+# ***** BEGIN LICENSE BLOCK *****
+#
+# FloatingProperties for Nvu.
+#
+# (c) Copyright Disruptive Innovations SARL 2005
+# All Rights Reserved.
+#
+# ***** END LICENSE BLOCK *****
+
+
+DEPTH   = ../..
+topsrcdir = @top_srcdir@
+srcdir    = @srcdir@
+VPATH   = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+XPIDL_MODULE = dibgutils
+
+XPIDLSRCS   = diITextNodeChangedTxn.idl \
+              diIAttrChangedTxn.idl \
+              diIAttrNameChangedTxn.idl \
+              $(NULL)
+
+include $(topsrcdir)/config/rules.mk
diff --git a/src/diIAttrChangedTxn.idl b/src/diIAttrChangedTxn.idl
new file mode 100644 (file)
index 0000000..332cf1b
--- /dev/null
@@ -0,0 +1,21 @@
+
+
+#include "nsISupports.idl"
+#include "domstubs.idl"
+
+interface nsIDOMNode;
+
+/**
+ *
+ */
+[scriptable, uuid(0adb1d92-8131-4bcd-b216-ec8246b7e0a4)]
+interface diIAttrChangedTxn: nsISupports
+{
+
+
+  nsIDOMNode getNode();
+  wstring getAttributeName();
+  wstring getOldData();
+  wstring getNewData();
+};
+
diff --git a/src/diIAttrNameChangedTxn.idl b/src/diIAttrNameChangedTxn.idl
new file mode 100644 (file)
index 0000000..e86d041
--- /dev/null
@@ -0,0 +1,19 @@
+
+
+#include "nsISupports.idl"
+#include "domstubs.idl"
+
+interface nsIDOMNode;
+
+/**
+ *
+ */
+[scriptable, uuid(7b881ce7-1c17-430e-b8d5-d960ad25bf05)]
+interface diIAttrNameChangedTxn: nsISupports
+{
+
+
+  nsIDOMNode getNode();
+  wstring getNewAttributeName();
+};
+
diff --git a/src/diITextNodeChangedTxn.idl b/src/diITextNodeChangedTxn.idl
new file mode 100644 (file)
index 0000000..3430588
--- /dev/null
@@ -0,0 +1,20 @@
+
+
+#include "nsISupports.idl"
+#include "domstubs.idl"
+
+interface nsIDOMNode;
+
+/**
+ *
+ */
+[scriptable, uuid(19971632-1063-4ee9-add3-908c570a33a9)]
+interface diITextNodeChangedTxn: nsISupports
+{
+
+
+  nsIDOMNode getNode();
+  wstring getOldData();
+  wstring getNewData();
+};
+
diff --git a/themes/Makefile.in b/themes/Makefile.in
new file mode 100644 (file)
index 0000000..a2118fb
--- /dev/null
@@ -0,0 +1,57 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is BlueGriffon.
+#
+# The Initial Developer of the Original Code is
+# Disruptive Innovations SARL.
+# Portions created by the Initial Developer are Copyright (C) 2003
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Daniel Glazman (daniel.glazman@disruptive-innovations.com)
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH          = ../..
+topsrcdir      = @top_srcdir@
+srcdir = @srcdir@
+VPATH          = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+DEFINES += \
+       -DAPP_NAME=$(MOZ_APP_DISPLAYNAME) \
+       -DAPP_VERSION=$(MOZ_APP_VERSION) \
+       $(NULL)
+
+ifneq (,$(filter mac cocoa, $(MOZ_WIDGET_TOOLKIT)))
+DIRS = mac
+else
+DIRS = win
+endif
+
+include $(topsrcdir)/config/rules.mk
+
diff --git a/themes/mac/Makefile.in b/themes/mac/Makefile.in
new file mode 100644 (file)
index 0000000..395226b
--- /dev/null
@@ -0,0 +1,51 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is BlueGriffon.
+#
+# The Initial Developer of the Original Code is
+# Disruptive Innovations SARL.
+# Portions created by the Initial Developer are Copyright (C) 2003
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Daniel Glazman (daniel.glazman@disruptive-innovations.com)
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH          = ../../..
+topsrcdir      = @top_srcdir@
+srcdir = @srcdir@
+VPATH          = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+DEFINES += \
+       -DAPP_NAME=$(MOZ_APP_DISPLAYNAME) \
+       -DAPP_VERSION=$(MOZ_APP_VERSION) \
+       $(NULL)
+
+include $(topsrcdir)/config/rules.mk
+
diff --git a/themes/mac/classic/backgroundImage.png b/themes/mac/classic/backgroundImage.png
new file mode 100755 (executable)
index 0000000..ac35514
Binary files /dev/null and b/themes/mac/classic/backgroundImage.png differ
diff --git a/themes/mac/classic/backgroundPosition.png b/themes/mac/classic/backgroundPosition.png
new file mode 100755 (executable)
index 0000000..35cdf1b
Binary files /dev/null and b/themes/mac/classic/backgroundPosition.png differ
diff --git a/themes/mac/classic/bluegriffon.css b/themes/mac/classic/bluegriffon.css
new file mode 100644 (file)
index 0000000..2429db6
--- /dev/null
@@ -0,0 +1,144 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@import url("chrome://bluegriffon/content/bindings/sidebar.css");
+@import url("chrome://bluegriffon/content/bindings/structurebar.css");
+@import url("chrome://bluegriffon/skin/mainToolbar.css");
+@import url("chrome://bluegriffon/skin/formatToolbar.css");
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+@namespace svg url("http://www.w3.org/2000/svg");
+
+tabeditor {
+  -moz-binding: url('chrome://bluegriffon/content/bindings/tabeditor.xml#tabeditor');
+}
+
+tabeditor[visibility="hidden"]  tabs,
+tabeditor[visibility="hidden"]  tabpanels
+{
+  visibility: hidden;
+}
+
+tabeditor[visibility="hidden"] {
+  background-color: rgb(128,128,128);
+}
+
+sidebar {
+  width: 200px;
+}
+
+sourceeditor {
+  -moz-binding: url('chrome://diavolo/content/sourceeditor.xml#sourceeditor');
+}
+
+hruler {
+  -moz-binding: url('chrome://bluegriffon/content/bindings/rulers.xml#hruler');
+}
+
+vruler {
+  -moz-binding: url('chrome://bluegriffon/content/bindings/rulers.xml#vruler');
+}
+
+.menuitem-iconic .menu-iconic-left {
+  display: -moz-box !important;
+}
+
+
+#infoButton {
+  list-style-image: url('chrome://bluegriffon/skin/icons/information.png');
+  width: 16px;
+  height: 16px;
+}
+
+#infoButton:hover {
+  list-style-image: url('chrome://bluegriffon/skin/icons/information-hover.png'); 
+}
+
+#infoButton[disabled="true"],
+#infoButton[disabled="true"]:hover {
+  list-style-image: url('chrome://bluegriffon/skin/icons/information-disabled.png'); 
+}
+
+#helperButtons {
+  border-right: threedshadow 1px solid;
+  padding: 2px;
+}
+
+#treeSourceView
+{
+  background-color: white;
+}
+
+grippy[disabled="true"] {
+  display: none;
+}
+
+/******* ZOOM *******/
+
+#menulist-zoompanel {
+  max-width: 7em;
+}
+
+#CustomizeToolbarSheet > #main-box {
+  border-top: none !important;
+  border-left: 2px solid;
+  border-right: 2px solid;
+  border-bottom: 3px solid;
+  -moz-border-right-colors: -moz-mac-menushadow ThreeDLightShadow  !important;
+  -moz-border-bottom-colors: -moz-mac-menushadow -moz-mac-menushadow ThreeDShadow  !important;
+  -moz-border-left-colors: ThreeDLightShadow ThreeDHighlight !important;
+}
+
+/********* splitters **********/
+
+#splitter1 {
+  border-right: thin solid silver;
+  border-left: thin solid silver;
+}
+
+#splitter2 {
+  border-left: thin solid silver;
+  border-right: thin solid silver;
+}
+
+
+
+
+
+
+
+
diff --git a/themes/mac/classic/bluegriffon.ico b/themes/mac/classic/bluegriffon.ico
new file mode 100644 (file)
index 0000000..55a275b
Binary files /dev/null and b/themes/mac/classic/bluegriffon.ico differ
diff --git a/themes/mac/classic/bluegriffonDialogs.css b/themes/mac/classic/bluegriffonDialogs.css
new file mode 100644 (file)
index 0000000..7fa5962
--- /dev/null
@@ -0,0 +1,4 @@
+csstoggler {
+  -moz-binding: url('chrome://bluegriffon/content/bindings/cssToggler.xml#cssToggler');
+  -moz-box-orient: vertical;
+}
diff --git a/themes/mac/classic/colourPicker.css b/themes/mac/classic/colourPicker.css
new file mode 100644 (file)
index 0000000..a5a10eb
--- /dev/null
@@ -0,0 +1,65 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Nvu
+ *
+ * The Initial Developer of the Original Code is
+ * Linspire Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2004
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman (glazman@disruptive-innovations.com), on behalf of Linspire Inc.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+@namespace html url("http://www.w3.org/1999/xhtml");
+
+#redImg, #greenImg, #blueImg,
+#hueImg, #saturationImg, #brightnessImg {
+  border: 1px solid black;
+  cursor: crosshair;
+}
+
+#saturationImg {
+  background-color: transparent;
+}
+
+html|*#swatch {
+  width: 30px;
+  height: 67px;
+  min-width: 34px;
+  min-height: 67px;
+       margin: 4px;
+  border: 1px solid black;
+}
+
+#LastPickedColor {
+  width: 17px;
+  height: 13px; 
+  border: 1px inset #CCCCCC;
+  margin: 1px 2px 2px 4px;
+}
diff --git a/themes/mac/classic/config-disabled.png b/themes/mac/classic/config-disabled.png
new file mode 100644 (file)
index 0000000..6f19511
Binary files /dev/null and b/themes/mac/classic/config-disabled.png differ
diff --git a/themes/mac/classic/config.png b/themes/mac/classic/config.png
new file mode 100644 (file)
index 0000000..d106906
Binary files /dev/null and b/themes/mac/classic/config.png differ
diff --git a/themes/mac/classic/cssToggler.css b/themes/mac/classic/cssToggler.css
new file mode 100644 (file)
index 0000000..d1921f9
--- /dev/null
@@ -0,0 +1,52 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+*[anonid="prefBox"],
+*[anonid="childrenBox"],
+*[anonid="idBox"] {
+  font-size: smaller;
+}
+
+*[anonid="existingIdAlert"] {
+  color: red;
+}
+
+.hiddenAlert {
+  visibility: hidden;
+}
diff --git a/themes/mac/classic/ecolorpicker.css b/themes/mac/classic/ecolorpicker.css
new file mode 100644 (file)
index 0000000..5d82346
--- /dev/null
@@ -0,0 +1,86 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998-1999
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/* ===== colorpicker.css ================================================
+  == Styles used by the XUL colorpicker element.
+  ======================================================================= */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+/* ::::: colorpicker button ::::: */
+/* colorpicker button */
+
+ecolorpicker {
+  width: 38px;
+  height: 24px;
+  border: 1px solid #a7a7a7;
+  background-color: ThreeDFace;
+  padding: 3px;
+  -moz-appearance: button-bevel;
+}
+
+ecolorpicker:hover:active {
+       background-color: darkblue;
+}
+
+.colorpicker-button-colorbox {
+  border: 1px solid #000000;
+}
+
+/* ::::: colorpicker tiles ::::: */
+
+.colorpickertile {
+  width                 : 20px;
+  height                : 20px;
+  margin                : 1px;
+}
+
+.colorpickertile[selected="true"] {
+  border : 1px outset #C0C0C0;
+
+}
+
+.colorpickertile[hover="true"] {
+  border : 1px dotted #A7A7A7;
+}
+
+.cp-light[hover="true"] {
+  border : 1px dotted #000000;
+}
+
+
diff --git a/themes/mac/classic/formatToolbar.css b/themes/mac/classic/formatToolbar.css
new file mode 100644 (file)
index 0000000..b0e0395
--- /dev/null
@@ -0,0 +1,224 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#FormatToolbox .toolbarbutton-text {
+  display: none;
+}
+
+#FormatToolbox toolbarbutton {
+  margin: 2px;
+  -moz-appearance: none;
+  
+}
+
+#FormatToolbox toolbarbutton .toolbarbutton-icon {
+  margin: 2px ! important;
+}
+
+#FormatToolbox toolbarbutton:not([disabled]):hover {
+  background-color: #ffcc66 ! important;
+}
+
+#FormatToolbox toolbarbutton[checked="true"] {
+  background-color: orange ! important;
+  background-image: none ! important;
+  padding: 0px ! important;
+  opacity: 1 !important;
+}
+
+#CustomizeToolbarWindow toolbarbutton,
+#CustomizeToolbarWindow toolbarpalette {
+  -moz-box-orient: vertical;
+}
+
+toolbaritem  menulist {
+  min-height: 20px ! important
+}
+
+/****** EM ******/
+
+#emButton {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/em.png");
+}
+
+#emButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/em-disabled.png");
+}
+
+/****** STRONG ******/
+
+#strongButton {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/strong.png");
+}
+
+#strongButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/strong-disabled.png");
+}
+
+/****** BOLD ******/
+
+#boldButton{
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/bold.png");
+}
+
+#boldButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/bold-disabled.png");
+}
+
+/****** ITALIC ******/
+
+#italicButton{
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/italic.png");
+}
+
+#italicButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/italic-disabled.png");
+}
+
+/****** UNDERLINE ******/
+
+#underlineButton{
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/underline.png");
+}
+
+#underlineButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/underline-disabled.png");
+}
+
+/****** UL ******/
+
+#ulButton{
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/ul.png");
+}
+
+#ulButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/ul-disabled.png");
+}
+
+/****** OL *****/
+
+#olButton{
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/ol.png");
+}
+
+#olButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/ol-disabled.png");
+}
+
+/****** ALIGN ******/
+
+#align-left-button {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/align-left.png");
+}
+
+#align-left-button[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/align-left-disabled.png");
+}
+
+#align-center-button {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/align-center.png");
+}
+
+#align-center-button[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/align-center-disabled.png");
+}
+
+#align-right-button {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/align-right.png");
+}
+
+#align-right-button[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/align-right-disabled.png");
+}
+
+#align-justify-button {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/align-justify.png");
+}
+
+#align-justify-button[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/align-justify-disabled.png");
+}
+
+/****** INDENT ******/
+
+#indentButton {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/indent.png");
+}
+
+#indentButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/indent-disabled.png");
+}
+
+/****** OUTDENT ******/
+
+#outdentButton {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/outdent.png");
+}
+
+#outdentButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/outdent-disabled.png");
+}
+
+/****** DD ******/
+
+#ddButton {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/dd.png");
+}
+
+#ddButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/dd-disabled.png");
+}
+
+/****** DT ******/
+
+#dtButton {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/dt.png");
+}
+
+#dtButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/dt-disabled.png");
+}
+
+/****** CODE ******/
+
+#codeButton{
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/code.png");
+}
+
+#codeButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/code-disabled.png");
+}
diff --git a/themes/mac/classic/formatToolbar/Thumbs.db b/themes/mac/classic/formatToolbar/Thumbs.db
new file mode 100644 (file)
index 0000000..6e12cc7
Binary files /dev/null and b/themes/mac/classic/formatToolbar/Thumbs.db differ
diff --git a/themes/mac/classic/formatToolbar/align-center-disabled.png b/themes/mac/classic/formatToolbar/align-center-disabled.png
new file mode 100644 (file)
index 0000000..f4b26b4
Binary files /dev/null and b/themes/mac/classic/formatToolbar/align-center-disabled.png differ
diff --git a/themes/mac/classic/formatToolbar/align-center.png b/themes/mac/classic/formatToolbar/align-center.png
new file mode 100644 (file)
index 0000000..5b38170
Binary files /dev/null and b/themes/mac/classic/formatToolbar/align-center.png differ
diff --git a/themes/mac/classic/formatToolbar/align-justify-disabled.png b/themes/mac/classic/formatToolbar/align-justify-disabled.png
new file mode 100644 (file)
index 0000000..e9eaac3
Binary files /dev/null and b/themes/mac/classic/formatToolbar/align-justify-disabled.png differ
diff --git a/themes/mac/classic/formatToolbar/align-justify.png b/themes/mac/classic/formatToolbar/align-justify.png
new file mode 100644 (file)
index 0000000..75e707c
Binary files /dev/null and b/themes/mac/classic/formatToolbar/align-justify.png differ
diff --git a/themes/mac/classic/formatToolbar/align-left-disabled.png b/themes/mac/classic/formatToolbar/align-left-disabled.png
new file mode 100644 (file)
index 0000000..76f01cc
Binary files /dev/null and b/themes/mac/classic/formatToolbar/align-left-disabled.png differ
diff --git a/themes/mac/classic/formatToolbar/align-left.png b/themes/mac/classic/formatToolbar/align-left.png
new file mode 100644 (file)
index 0000000..0407f13
Binary files /dev/null and b/themes/mac/classic/formatToolbar/align-left.png differ
diff --git a/themes/mac/classic/formatToolbar/align-right-disabled.png b/themes/mac/classic/formatToolbar/align-right-disabled.png
new file mode 100644 (file)
index 0000000..539a449
Binary files /dev/null and b/themes/mac/classic/formatToolbar/align-right-disabled.png differ
diff --git a/themes/mac/classic/formatToolbar/align-right.png b/themes/mac/classic/formatToolbar/align-right.png
new file mode 100644 (file)
index 0000000..fd9e11d
Binary files /dev/null and b/themes/mac/classic/formatToolbar/align-right.png differ
diff --git a/themes/mac/classic/formatToolbar/bold-disabled.png b/themes/mac/classic/formatToolbar/bold-disabled.png
new file mode 100644 (file)
index 0000000..51f9f4c
Binary files /dev/null and b/themes/mac/classic/formatToolbar/bold-disabled.png differ
diff --git a/themes/mac/classic/formatToolbar/bold.png b/themes/mac/classic/formatToolbar/bold.png
new file mode 100644 (file)
index 0000000..0055e12
Binary files /dev/null and b/themes/mac/classic/formatToolbar/bold.png differ
diff --git a/themes/mac/classic/formatToolbar/code-disabled.png b/themes/mac/classic/formatToolbar/code-disabled.png
new file mode 100644 (file)
index 0000000..2f25d35
Binary files /dev/null and b/themes/mac/classic/formatToolbar/code-disabled.png differ
diff --git a/themes/mac/classic/formatToolbar/code.png b/themes/mac/classic/formatToolbar/code.png
new file mode 100644 (file)
index 0000000..648fd8c
Binary files /dev/null and b/themes/mac/classic/formatToolbar/code.png differ
diff --git a/themes/mac/classic/formatToolbar/dd-disabled.gif b/themes/mac/classic/formatToolbar/dd-disabled.gif
new file mode 100644 (file)
index 0000000..efb748f
Binary files /dev/null and b/themes/mac/classic/formatToolbar/dd-disabled.gif differ
diff --git a/themes/mac/classic/formatToolbar/dd-disabled.png b/themes/mac/classic/formatToolbar/dd-disabled.png
new file mode 100644 (file)
index 0000000..9a61808
Binary files /dev/null and b/themes/mac/classic/formatToolbar/dd-disabled.png differ
diff --git a/themes/mac/classic/formatToolbar/dd.gif b/themes/mac/classic/formatToolbar/dd.gif
new file mode 100644 (file)
index 0000000..c27f18b
Binary files /dev/null and b/themes/mac/classic/formatToolbar/dd.gif differ
diff --git a/themes/mac/classic/formatToolbar/dd.png b/themes/mac/classic/formatToolbar/dd.png
new file mode 100644 (file)
index 0000000..993af5f
Binary files /dev/null and b/themes/mac/classic/formatToolbar/dd.png differ
diff --git a/themes/mac/classic/formatToolbar/dt-disabled.gif b/themes/mac/classic/formatToolbar/dt-disabled.gif
new file mode 100644 (file)
index 0000000..7224d7e
Binary files /dev/null and b/themes/mac/classic/formatToolbar/dt-disabled.gif differ
diff --git a/themes/mac/classic/formatToolbar/dt-disabled.png b/themes/mac/classic/formatToolbar/dt-disabled.png
new file mode 100644 (file)
index 0000000..480adb5
Binary files /dev/null and b/themes/mac/classic/formatToolbar/dt-disabled.png differ
diff --git a/themes/mac/classic/formatToolbar/dt.gif b/themes/mac/classic/formatToolbar/dt.gif
new file mode 100644 (file)
index 0000000..eef8bff
Binary files /dev/null and b/themes/mac/classic/formatToolbar/dt.gif differ
diff --git a/themes/mac/classic/formatToolbar/dt.png b/themes/mac/classic/formatToolbar/dt.png
new file mode 100644 (file)
index 0000000..cacc860
Binary files /dev/null and b/themes/mac/classic/formatToolbar/dt.png differ
diff --git a/themes/mac/classic/formatToolbar/em-disabled.png b/themes/mac/classic/formatToolbar/em-disabled.png
new file mode 100644 (file)
index 0000000..aeadcc2
Binary files /dev/null and b/themes/mac/classic/formatToolbar/em-disabled.png differ
diff --git a/themes/mac/classic/formatToolbar/em.png b/themes/mac/classic/formatToolbar/em.png
new file mode 100644 (file)
index 0000000..8ca7553
Binary files /dev/null and b/themes/mac/classic/formatToolbar/em.png differ
diff --git a/themes/mac/classic/formatToolbar/indent-disabled.png b/themes/mac/classic/formatToolbar/indent-disabled.png
new file mode 100644 (file)
index 0000000..36c7c58
Binary files /dev/null and b/themes/mac/classic/formatToolbar/indent-disabled.png differ
diff --git a/themes/mac/classic/formatToolbar/indent.png b/themes/mac/classic/formatToolbar/indent.png
new file mode 100644 (file)
index 0000000..0ac95ec
Binary files /dev/null and b/themes/mac/classic/formatToolbar/indent.png differ
diff --git a/themes/mac/classic/formatToolbar/italic-disabled.png b/themes/mac/classic/formatToolbar/italic-disabled.png
new file mode 100644 (file)
index 0000000..6b7101b
Binary files /dev/null and b/themes/mac/classic/formatToolbar/italic-disabled.png differ
diff --git a/themes/mac/classic/formatToolbar/italic.png b/themes/mac/classic/formatToolbar/italic.png
new file mode 100644 (file)
index 0000000..9c8f95b
Binary files /dev/null and b/themes/mac/classic/formatToolbar/italic.png differ
diff --git a/themes/mac/classic/formatToolbar/ol-disabled.png b/themes/mac/classic/formatToolbar/ol-disabled.png
new file mode 100644 (file)
index 0000000..9256811
Binary files /dev/null and b/themes/mac/classic/formatToolbar/ol-disabled.png differ
diff --git a/themes/mac/classic/formatToolbar/ol.png b/themes/mac/classic/formatToolbar/ol.png
new file mode 100644 (file)
index 0000000..3696025
Binary files /dev/null and b/themes/mac/classic/formatToolbar/ol.png differ
diff --git a/themes/mac/classic/formatToolbar/outdent-disabled.png b/themes/mac/classic/formatToolbar/outdent-disabled.png
new file mode 100644 (file)
index 0000000..69614d5
Binary files /dev/null and b/themes/mac/classic/formatToolbar/outdent-disabled.png differ
diff --git a/themes/mac/classic/formatToolbar/outdent.png b/themes/mac/classic/formatToolbar/outdent.png
new file mode 100644 (file)
index 0000000..185ab47
Binary files /dev/null and b/themes/mac/classic/formatToolbar/outdent.png differ
diff --git a/themes/mac/classic/formatToolbar/strong-disabled.png b/themes/mac/classic/formatToolbar/strong-disabled.png
new file mode 100644 (file)
index 0000000..af141ca
Binary files /dev/null and b/themes/mac/classic/formatToolbar/strong-disabled.png differ
diff --git a/themes/mac/classic/formatToolbar/strong.png b/themes/mac/classic/formatToolbar/strong.png
new file mode 100644 (file)
index 0000000..43e7acc
Binary files /dev/null and b/themes/mac/classic/formatToolbar/strong.png differ
diff --git a/themes/mac/classic/formatToolbar/ul-disabled.png b/themes/mac/classic/formatToolbar/ul-disabled.png
new file mode 100644 (file)
index 0000000..ea959de
Binary files /dev/null and b/themes/mac/classic/formatToolbar/ul-disabled.png differ
diff --git a/themes/mac/classic/formatToolbar/ul.png b/themes/mac/classic/formatToolbar/ul.png
new file mode 100644 (file)
index 0000000..93f8c21
Binary files /dev/null and b/themes/mac/classic/formatToolbar/ul.png differ
diff --git a/themes/mac/classic/formatToolbar/underline-disabled.png b/themes/mac/classic/formatToolbar/underline-disabled.png
new file mode 100644 (file)
index 0000000..48ead25
Binary files /dev/null and b/themes/mac/classic/formatToolbar/underline-disabled.png differ
diff --git a/themes/mac/classic/formatToolbar/underline.png b/themes/mac/classic/formatToolbar/underline.png
new file mode 100644 (file)
index 0000000..6bba7bd
Binary files /dev/null and b/themes/mac/classic/formatToolbar/underline.png differ
diff --git a/themes/mac/classic/icons/Thumbs.db b/themes/mac/classic/icons/Thumbs.db
new file mode 100644 (file)
index 0000000..d451c82
Binary files /dev/null and b/themes/mac/classic/icons/Thumbs.db differ
diff --git a/themes/mac/classic/icons/bold-disabled.png b/themes/mac/classic/icons/bold-disabled.png
new file mode 100644 (file)
index 0000000..8168c74
Binary files /dev/null and b/themes/mac/classic/icons/bold-disabled.png differ
diff --git a/themes/mac/classic/icons/bold-hover.png b/themes/mac/classic/icons/bold-hover.png
new file mode 100644 (file)
index 0000000..25137c3
Binary files /dev/null and b/themes/mac/classic/icons/bold-hover.png differ
diff --git a/themes/mac/classic/icons/bold.png b/themes/mac/classic/icons/bold.png
new file mode 100644 (file)
index 0000000..a70f809
Binary files /dev/null and b/themes/mac/classic/icons/bold.png differ
diff --git a/themes/mac/classic/icons/btn3.png b/themes/mac/classic/icons/btn3.png
new file mode 100644 (file)
index 0000000..e7e8133
Binary files /dev/null and b/themes/mac/classic/icons/btn3.png differ
diff --git a/themes/mac/classic/icons/close-button.png b/themes/mac/classic/icons/close-button.png
new file mode 100644 (file)
index 0000000..c7aed27
Binary files /dev/null and b/themes/mac/classic/icons/close-button.png differ
diff --git a/themes/mac/classic/icons/filePicking-hover.png b/themes/mac/classic/icons/filePicking-hover.png
new file mode 100644 (file)
index 0000000..0e73e72
Binary files /dev/null and b/themes/mac/classic/icons/filePicking-hover.png differ
diff --git a/themes/mac/classic/icons/filePicking.png b/themes/mac/classic/icons/filePicking.png
new file mode 100644 (file)
index 0000000..ec4b1bd
Binary files /dev/null and b/themes/mac/classic/icons/filePicking.png differ
diff --git a/themes/mac/classic/icons/information-disabled.png b/themes/mac/classic/icons/information-disabled.png
new file mode 100644 (file)
index 0000000..b98a868
Binary files /dev/null and b/themes/mac/classic/icons/information-disabled.png differ
diff --git a/themes/mac/classic/icons/information-hover.png b/themes/mac/classic/icons/information-hover.png
new file mode 100644 (file)
index 0000000..32ad65f
Binary files /dev/null and b/themes/mac/classic/icons/information-hover.png differ
diff --git a/themes/mac/classic/icons/information.png b/themes/mac/classic/icons/information.png
new file mode 100644 (file)
index 0000000..f30135c
Binary files /dev/null and b/themes/mac/classic/icons/information.png differ
diff --git a/themes/mac/classic/icons/loading.gif b/themes/mac/classic/icons/loading.gif
new file mode 100644 (file)
index 0000000..c91e58e
Binary files /dev/null and b/themes/mac/classic/icons/loading.gif differ
diff --git a/themes/mac/classic/icons/modified.gif b/themes/mac/classic/icons/modified.gif
new file mode 100644 (file)
index 0000000..d09fdd2
Binary files /dev/null and b/themes/mac/classic/icons/modified.gif differ
diff --git a/themes/mac/classic/icons/new.png b/themes/mac/classic/icons/new.png
new file mode 100644 (file)
index 0000000..b7f1ad6
Binary files /dev/null and b/themes/mac/classic/icons/new.png differ
diff --git a/themes/mac/classic/icons/newstop.png b/themes/mac/classic/icons/newstop.png
new file mode 100644 (file)
index 0000000..7e76996
Binary files /dev/null and b/themes/mac/classic/icons/newstop.png differ
diff --git a/themes/mac/classic/icons/open.png b/themes/mac/classic/icons/open.png
new file mode 100644 (file)
index 0000000..296c255
Binary files /dev/null and b/themes/mac/classic/icons/open.png differ
diff --git a/themes/mac/classic/icons/stop.png b/themes/mac/classic/icons/stop.png
new file mode 100644 (file)
index 0000000..5e25255
Binary files /dev/null and b/themes/mac/classic/icons/stop.png differ
diff --git a/themes/mac/classic/icons/twistyClosed.png b/themes/mac/classic/icons/twistyClosed.png
new file mode 100644 (file)
index 0000000..f80319b
Binary files /dev/null and b/themes/mac/classic/icons/twistyClosed.png differ
diff --git a/themes/mac/classic/icons/twistyOpen.png b/themes/mac/classic/icons/twistyOpen.png
new file mode 100644 (file)
index 0000000..8680124
Binary files /dev/null and b/themes/mac/classic/icons/twistyOpen.png differ
diff --git a/themes/mac/classic/insertTable.css b/themes/mac/classic/insertTable.css
new file mode 100644 (file)
index 0000000..2af2c12
--- /dev/null
@@ -0,0 +1,35 @@
+*#sizeSelector label {
+  width: 2em;
+  margin: 0px ! important;
+}
+
+*#sizeSelector:not([disabled]) label:hover,
+*#sizeSelector label.selected {
+  background-color: rgb(10,36,106) ! important;
+}
+
+*#sizeSelector[disabled] label.selected {
+  background-color: silver ! important;
+}
+
+*#sizeSelector label {
+  border: 2px ridge !important;
+}
+
+*#sizeSelector[disabled] label {
+  border: silver 2px ridge !important;
+}
+
+#widthPixelOrPercentMenulist {
+  min-width: 10em;
+}
+
+tabbox textbox {
+  max-width: 5em;
+}
+
+.spinbuttons-button {
+  min-height: 8px ! important;
+}
+
+
diff --git a/themes/mac/classic/languages.css b/themes/mac/classic/languages.css
new file mode 100644 (file)
index 0000000..c00a17f
--- /dev/null
@@ -0,0 +1,3 @@
+#currentLanguageBox {
+  font-weight: bold;
+}
diff --git a/themes/mac/classic/layouts/full1.png b/themes/mac/classic/layouts/full1.png
new file mode 100755 (executable)
index 0000000..15728d1
Binary files /dev/null and b/themes/mac/classic/layouts/full1.png differ
diff --git a/themes/mac/classic/layouts/full10.png b/themes/mac/classic/layouts/full10.png
new file mode 100755 (executable)
index 0000000..e7400ee
Binary files /dev/null and b/themes/mac/classic/layouts/full10.png differ
diff --git a/themes/mac/classic/layouts/full11.png b/themes/mac/classic/layouts/full11.png
new file mode 100755 (executable)
index 0000000..07595d5
Binary files /dev/null and b/themes/mac/classic/layouts/full11.png differ
diff --git a/themes/mac/classic/layouts/full12.png b/themes/mac/classic/layouts/full12.png
new file mode 100755 (executable)
index 0000000..2a43327
Binary files /dev/null and b/themes/mac/classic/layouts/full12.png differ
diff --git a/themes/mac/classic/layouts/full13.png b/themes/mac/classic/layouts/full13.png
new file mode 100755 (executable)
index 0000000..41fd832
Binary files /dev/null and b/themes/mac/classic/layouts/full13.png differ
diff --git a/themes/mac/classic/layouts/full14.png b/themes/mac/classic/layouts/full14.png
new file mode 100755 (executable)
index 0000000..d009af9
Binary files /dev/null and b/themes/mac/classic/layouts/full14.png differ
diff --git a/themes/mac/classic/layouts/full15.png b/themes/mac/classic/layouts/full15.png
new file mode 100755 (executable)
index 0000000..3e6e6e3
Binary files /dev/null and b/themes/mac/classic/layouts/full15.png differ
diff --git a/themes/mac/classic/layouts/full16.png b/themes/mac/classic/layouts/full16.png
new file mode 100755 (executable)
index 0000000..3ac7ab2
Binary files /dev/null and b/themes/mac/classic/layouts/full16.png differ
diff --git a/themes/mac/classic/layouts/full17.png b/themes/mac/classic/layouts/full17.png
new file mode 100755 (executable)
index 0000000..e86cc4b
Binary files /dev/null and b/themes/mac/classic/layouts/full17.png differ
diff --git a/themes/mac/classic/layouts/full18.png b/themes/mac/classic/layouts/full18.png
new file mode 100755 (executable)
index 0000000..74917e2
Binary files /dev/null and b/themes/mac/classic/layouts/full18.png differ
diff --git a/themes/mac/classic/layouts/full19.png b/themes/mac/classic/layouts/full19.png
new file mode 100755 (executable)
index 0000000..e276933
Binary files /dev/null and b/themes/mac/classic/layouts/full19.png differ
diff --git a/themes/mac/classic/layouts/full2.png b/themes/mac/classic/layouts/full2.png
new file mode 100755 (executable)
index 0000000..c627b40
Binary files /dev/null and b/themes/mac/classic/layouts/full2.png differ
diff --git a/themes/mac/classic/layouts/full20.png b/themes/mac/classic/layouts/full20.png
new file mode 100755 (executable)
index 0000000..082f54d
Binary files /dev/null and b/themes/mac/classic/layouts/full20.png differ
diff --git a/themes/mac/classic/layouts/full21.png b/themes/mac/classic/layouts/full21.png
new file mode 100755 (executable)
index 0000000..f7346e3
Binary files /dev/null and b/themes/mac/classic/layouts/full21.png differ
diff --git a/themes/mac/classic/layouts/full22.png b/themes/mac/classic/layouts/full22.png
new file mode 100644 (file)
index 0000000..48ed39e
Binary files /dev/null and b/themes/mac/classic/layouts/full22.png differ
diff --git a/themes/mac/classic/layouts/full23.png b/themes/mac/classic/layouts/full23.png
new file mode 100644 (file)
index 0000000..b896217
Binary files /dev/null and b/themes/mac/classic/layouts/full23.png differ
diff --git a/themes/mac/classic/layouts/full24.png b/themes/mac/classic/layouts/full24.png
new file mode 100644 (file)
index 0000000..5acce38
Binary files /dev/null and b/themes/mac/classic/layouts/full24.png differ
diff --git a/themes/mac/classic/layouts/full25.png b/themes/mac/classic/layouts/full25.png
new file mode 100644 (file)
index 0000000..81d26da
Binary files /dev/null and b/themes/mac/classic/layouts/full25.png differ
diff --git a/themes/mac/classic/layouts/full26.png b/themes/mac/classic/layouts/full26.png
new file mode 100644 (file)
index 0000000..97b0079
Binary files /dev/null and b/themes/mac/classic/layouts/full26.png differ
diff --git a/themes/mac/classic/layouts/full27.png b/themes/mac/classic/layouts/full27.png
new file mode 100644 (file)
index 0000000..9910f55
Binary files /dev/null and b/themes/mac/classic/layouts/full27.png differ
diff --git a/themes/mac/classic/layouts/full28.png b/themes/mac/classic/layouts/full28.png
new file mode 100644 (file)
index 0000000..8ab6021
Binary files /dev/null and b/themes/mac/classic/layouts/full28.png differ
diff --git a/themes/mac/classic/layouts/full29.png b/themes/mac/classic/layouts/full29.png
new file mode 100644 (file)
index 0000000..4e39d5b
Binary files /dev/null and b/themes/mac/classic/layouts/full29.png differ
diff --git a/themes/mac/classic/layouts/full3.png b/themes/mac/classic/layouts/full3.png
new file mode 100755 (executable)
index 0000000..85fc86b
Binary files /dev/null and b/themes/mac/classic/layouts/full3.png differ
diff --git a/themes/mac/classic/layouts/full30.png b/themes/mac/classic/layouts/full30.png
new file mode 100644 (file)
index 0000000..a3023ca
Binary files /dev/null and b/themes/mac/classic/layouts/full30.png differ
diff --git a/themes/mac/classic/layouts/full31.png b/themes/mac/classic/layouts/full31.png
new file mode 100644 (file)
index 0000000..f7e1bba
Binary files /dev/null and b/themes/mac/classic/layouts/full31.png differ
diff --git a/themes/mac/classic/layouts/full32.png b/themes/mac/classic/layouts/full32.png
new file mode 100644 (file)
index 0000000..7b0ff9f
Binary files /dev/null and b/themes/mac/classic/layouts/full32.png differ
diff --git a/themes/mac/classic/layouts/full33.png b/themes/mac/classic/layouts/full33.png
new file mode 100644 (file)
index 0000000..9b04da9
Binary files /dev/null and b/themes/mac/classic/layouts/full33.png differ
diff --git a/themes/mac/classic/layouts/full34.png b/themes/mac/classic/layouts/full34.png
new file mode 100644 (file)
index 0000000..18a89b1
Binary files /dev/null and b/themes/mac/classic/layouts/full34.png differ
diff --git a/themes/mac/classic/layouts/full35.png b/themes/mac/classic/layouts/full35.png
new file mode 100644 (file)
index 0000000..cc9dbd3
Binary files /dev/null and b/themes/mac/classic/layouts/full35.png differ
diff --git a/themes/mac/classic/layouts/full36.png b/themes/mac/classic/layouts/full36.png
new file mode 100644 (file)
index 0000000..a393319
Binary files /dev/null and b/themes/mac/classic/layouts/full36.png differ
diff --git a/themes/mac/classic/layouts/full37.png b/themes/mac/classic/layouts/full37.png
new file mode 100644 (file)
index 0000000..cb43684
Binary files /dev/null and b/themes/mac/classic/layouts/full37.png differ
diff --git a/themes/mac/classic/layouts/full38.png b/themes/mac/classic/layouts/full38.png
new file mode 100644 (file)
index 0000000..fcdcde5
Binary files /dev/null and b/themes/mac/classic/layouts/full38.png differ
diff --git a/themes/mac/classic/layouts/full39.png b/themes/mac/classic/layouts/full39.png
new file mode 100644 (file)
index 0000000..03183a9
Binary files /dev/null and b/themes/mac/classic/layouts/full39.png differ
diff --git a/themes/mac/classic/layouts/full4.png b/themes/mac/classic/layouts/full4.png
new file mode 100755 (executable)
index 0000000..62f5408
Binary files /dev/null and b/themes/mac/classic/layouts/full4.png differ
diff --git a/themes/mac/classic/layouts/full40.png b/themes/mac/classic/layouts/full40.png
new file mode 100644 (file)
index 0000000..eac06e7
Binary files /dev/null and b/themes/mac/classic/layouts/full40.png differ
diff --git a/themes/mac/classic/layouts/full41.png b/themes/mac/classic/layouts/full41.png
new file mode 100644 (file)
index 0000000..428f3e6
Binary files /dev/null and b/themes/mac/classic/layouts/full41.png differ
diff --git a/themes/mac/classic/layouts/full42.png b/themes/mac/classic/layouts/full42.png
new file mode 100644 (file)
index 0000000..57ec43f
Binary files /dev/null and b/themes/mac/classic/layouts/full42.png differ
diff --git a/themes/mac/classic/layouts/full5.png b/themes/mac/classic/layouts/full5.png
new file mode 100755 (executable)
index 0000000..b31389c
Binary files /dev/null and b/themes/mac/classic/layouts/full5.png differ
diff --git a/themes/mac/classic/layouts/full6.png b/themes/mac/classic/layouts/full6.png
new file mode 100755 (executable)
index 0000000..abc3068
Binary files /dev/null and b/themes/mac/classic/layouts/full6.png differ
diff --git a/themes/mac/classic/layouts/full7.png b/themes/mac/classic/layouts/full7.png
new file mode 100755 (executable)
index 0000000..08348a4
Binary files /dev/null and b/themes/mac/classic/layouts/full7.png differ
diff --git a/themes/mac/classic/layouts/full8.png b/themes/mac/classic/layouts/full8.png
new file mode 100755 (executable)
index 0000000..26fa9aa
Binary files /dev/null and b/themes/mac/classic/layouts/full8.png differ
diff --git a/themes/mac/classic/layouts/full9.png b/themes/mac/classic/layouts/full9.png
new file mode 100755 (executable)
index 0000000..a393187
Binary files /dev/null and b/themes/mac/classic/layouts/full9.png differ
diff --git a/themes/mac/classic/layouts/layouts.mn b/themes/mac/classic/layouts/layouts.mn
new file mode 100644 (file)
index 0000000..6cda203
--- /dev/null
@@ -0,0 +1,42 @@
+skin/classic/bluegriffon/layouts/full1.png  (skin/classic/bluegriffon/layouts/full1.png)
+skin/classic/bluegriffon/layouts/full10.png  (skin/classic/bluegriffon/layouts/full10.png)
+skin/classic/bluegriffon/layouts/full11.png  (skin/classic/bluegriffon/layouts/full11.png)
+skin/classic/bluegriffon/layouts/full12.png  (skin/classic/bluegriffon/layouts/full12.png)
+skin/classic/bluegriffon/layouts/full13.png  (skin/classic/bluegriffon/layouts/full13.png)
+skin/classic/bluegriffon/layouts/full14.png  (skin/classic/bluegriffon/layouts/full14.png)
+skin/classic/bluegriffon/layouts/full15.png  (skin/classic/bluegriffon/layouts/full15.png)
+skin/classic/bluegriffon/layouts/full16.png  (skin/classic/bluegriffon/layouts/full16.png)
+skin/classic/bluegriffon/layouts/full17.png  (skin/classic/bluegriffon/layouts/full17.png)
+skin/classic/bluegriffon/layouts/full18.png  (skin/classic/bluegriffon/layouts/full18.png)
+skin/classic/bluegriffon/layouts/full19.png  (skin/classic/bluegriffon/layouts/full19.png)
+skin/classic/bluegriffon/layouts/full2.png  (skin/classic/bluegriffon/layouts/full2.png)
+skin/classic/bluegriffon/layouts/full20.png  (skin/classic/bluegriffon/layouts/full20.png)
+skin/classic/bluegriffon/layouts/full21.png  (skin/classic/bluegriffon/layouts/full21.png)
+skin/classic/bluegriffon/layouts/full22.png  (skin/classic/bluegriffon/layouts/full22.png)
+skin/classic/bluegriffon/layouts/full23.png  (skin/classic/bluegriffon/layouts/full23.png)
+skin/classic/bluegriffon/layouts/full24.png  (skin/classic/bluegriffon/layouts/full24.png)
+skin/classic/bluegriffon/layouts/full25.png  (skin/classic/bluegriffon/layouts/full25.png)
+skin/classic/bluegriffon/layouts/full26.png  (skin/classic/bluegriffon/layouts/full26.png)
+skin/classic/bluegriffon/layouts/full27.png  (skin/classic/bluegriffon/layouts/full27.png)
+skin/classic/bluegriffon/layouts/full28.png  (skin/classic/bluegriffon/layouts/full28.png)
+skin/classic/bluegriffon/layouts/full29.png  (skin/classic/bluegriffon/layouts/full29.png)
+skin/classic/bluegriffon/layouts/full3.png  (skin/classic/bluegriffon/layouts/full3.png)
+skin/classic/bluegriffon/layouts/full30.png  (skin/classic/bluegriffon/layouts/full30.png)
+skin/classic/bluegriffon/layouts/full31.png  (skin/classic/bluegriffon/layouts/full31.png)
+skin/classic/bluegriffon/layouts/full32.png  (skin/classic/bluegriffon/layouts/full32.png)
+skin/classic/bluegriffon/layouts/full33.png  (skin/classic/bluegriffon/layouts/full33.png)
+skin/classic/bluegriffon/layouts/full34.png  (skin/classic/bluegriffon/layouts/full34.png)
+skin/classic/bluegriffon/layouts/full35.png  (skin/classic/bluegriffon/layouts/full35.png)
+skin/classic/bluegriffon/layouts/full36.png  (skin/classic/bluegriffon/layouts/full36.png)
+skin/classic/bluegriffon/layouts/full37.png  (skin/classic/bluegriffon/layouts/full37.png)
+skin/classic/bluegriffon/layouts/full38.png  (skin/classic/bluegriffon/layouts/full38.png)
+skin/classic/bluegriffon/layouts/full39.png  (skin/classic/bluegriffon/layouts/full39.png)
+skin/classic/bluegriffon/layouts/full4.png  (skin/classic/bluegriffon/layouts/full4.png)
+skin/classic/bluegriffon/layouts/full40.png  (skin/classic/bluegriffon/layouts/full40.png)
+skin/classic/bluegriffon/layouts/full41.png  (skin/classic/bluegriffon/layouts/full41.png)
+skin/classic/bluegriffon/layouts/full42.png  (skin/classic/bluegriffon/layouts/full42.png)
+skin/classic/bluegriffon/layouts/full5.png  (skin/classic/bluegriffon/layouts/full5.png)
+skin/classic/bluegriffon/layouts/full6.png  (skin/classic/bluegriffon/layouts/full6.png)
+skin/classic/bluegriffon/layouts/full7.png  (skin/classic/bluegriffon/layouts/full7.png)
+skin/classic/bluegriffon/layouts/full8.png  (skin/classic/bluegriffon/layouts/full8.png)
+skin/classic/bluegriffon/layouts/full9.png  (skin/classic/bluegriffon/layouts/full9.png)
diff --git a/themes/mac/classic/listboxBg.css b/themes/mac/classic/listboxBg.css
new file mode 100644 (file)
index 0000000..3073e06
--- /dev/null
@@ -0,0 +1,104 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+hbox.listboxBg {
+       max-height: 21px;
+       background-image: url("chrome://bluegriffon/skin/listboxBg.png");
+       border-left: thin solid silver;
+       border-right: thin solid silver;
+       border-bottom: thin solid silver;
+       margin: 0px;
+}
+
+hbox.listboxBg toolbarbutton {
+       -moz-box-orient: horizontal;
+       max-height: 21px;
+       min-height: 21px;
+       padding: 0px 3px; margin: 0px;
+       border-right: thin solid silver;
+       font-weight: bold;
+}
+
+hbox.listboxBg spacer[flex="1"] ~ toolbarbutton {
+  border-left: thin solid silver;
+  border-right: 0px none;
+}
+
+hbox.listboxBg toolbarbutton:not([disabled]):active:hover {
+       background-image: url("chrome://bluegriffon/skin/listboxBgActive.png");
+}
+
+listbox.listboxBg {
+       margin: 0px;
+}
+
+hbox.listboxBg .toolbarbutton-menu-dropmarker,
+hbox.listboxBg .toolbarbutton-text {
+       display: none;
+}
+
+hbox.listboxBg .toolbarbutton-icon {
+       margin: 0px 3px;
+}
+
+hbox.listboxBg .listboxBgPlusButton {
+       list-style-image: url("chrome://bluegriffon/skin/plus.png")
+}
+
+hbox.listboxBg .listboxBgPlusButton[disabled] {
+       list-style-image: url("chrome://bluegriffon/skin/plus-disabled.png")
+}
+
+hbox.listboxBg .listboxBgMinusButton {
+       list-style-image: url("chrome://bluegriffon/skin/minus.png")
+}
+
+hbox.listboxBg .listboxBgMinusButton[disabled] {
+       list-style-image: url("chrome://bluegriffon/skin/minus-disabled.png")
+}
+
+hbox.listboxBg .listboxBgConfigButton {
+       list-style-image: url("chrome://bluegriffon/skin/config.png")
+}
+
+hbox.listboxBg .listboxBgConfigButton[disabled] {
+       list-style-image: url("chrome://bluegriffon/skin/config-disabled.png")
+}
+
+hbox.listboxBg .listboxBgThrobberButton {
+  list-style-image: url("chrome://global/skin/icons/loading_16.png");
+}
diff --git a/themes/mac/classic/listboxBg.png b/themes/mac/classic/listboxBg.png
new file mode 100644 (file)
index 0000000..91698ec
Binary files /dev/null and b/themes/mac/classic/listboxBg.png differ
diff --git a/themes/mac/classic/listboxBgActive.png b/themes/mac/classic/listboxBgActive.png
new file mode 100644 (file)
index 0000000..ee37d79
Binary files /dev/null and b/themes/mac/classic/listboxBgActive.png differ
diff --git a/themes/mac/classic/mainToolbar.css b/themes/mac/classic/mainToolbar.css
new file mode 100644 (file)
index 0000000..8a8cc25
--- /dev/null
@@ -0,0 +1,116 @@
+
+#MainToolbar {
+  padding: 4px;
+}
+
+#MainToolbar toolbarbutton,
+#CustomizeToolbarWindow toolbarbutton,
+#CustomizeToolbarSheet toolbarbutton {
+  -moz-image-region: rect(0px 32px 32px 0px);
+  -moz-box-orient: vertical;
+}
+
+#MainToolbar .toolbarbutton-icon {
+  margin: 2px;
+}
+
+#MainToolbar .toolbarbutton-text {
+  padding-bottom: 4px;
+}
+
+#MainToolbar[mode="icons"] .toolbarbutton-text {
+  display: none;
+}
+
+#MainToolbar[mode="text"] .toolbarbutton-icon,
+#MainToolbar[mode="text"] #composer-throbber {
+  display: none;
+}
+
+#MainToolbar[mode="text"] .toolbarbutton-text {
+  padding: 4px;
+}
+
+#MainToolbar toolbarbutton:hover,
+#MainToolbar toolbarbutton:hover:active {
+  -moz-image-region: rect(32px 32px 64px 0px);
+}
+
+#MainToolbar toolbarbutton[disabled="true"]
+{
+  -moz-image-region: rect(64px 32px 96px 0px);
+}
+
+#newButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/new.png");
+}
+
+#openButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/open.png");
+}
+
+#stopButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/stop.png");
+}
+
+#tableButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/table.png");
+}
+
+#saveButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/save.png");
+}
+
+/************ SMALL ICONS **************/
+
+#MainToolbar[iconsize="small"] toolbarbutton {
+  -moz-image-region: rect(0px 24px 24px 0px);
+}
+
+#MainToolbar[iconsize="small"] toolbarbutton:hover,
+#MainToolbar[iconsize="small"] toolbarbutton:hover:active {
+  -moz-image-region: rect(24px 24px 48px 0px);
+}
+
+#MainToolbar[iconsize="small"] toolbarbutton[disabled="true"]
+{
+  -moz-image-region: rect(48px 24px 72px 0px);
+}
+
+#MainToolbar[iconsize="small"] #newButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/small/new.png");
+}
+
+#MainToolbar[iconsize="small"] #openButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/small/open.png");
+}
+
+#MainToolbar[iconsize="small"] #stopButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/small/stop.png");
+}
+
+#MainToolbar[iconsize="small"] #tableButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/small/table.png");
+}
+
+#MainToolbar[iconsize="small"] #saveButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/small/save.png");
+}
+
+/***************** THROBBER **************/
+
+#composer-throbber {
+  list-style-image: url('chrome://bluegriffon/skin/mainToolbar/logo.png');
+}
+
+#composer-throbber:hover {
+  list-style-image: url('chrome://bluegriffon/skin/mainToolbar/logo-hover.png');
+}
+
+#MainToolbar[iconsize="small"] #composer-throbber {
+  list-style-image: url('chrome://bluegriffon/skin/mainToolbar/small/logo.png');
+}
+
+#MainToolbar[iconsize="small"] #composer-throbber:hover {
+  list-style-image: url('chrome://bluegriffon/skin/mainToolbar/small/logo-hover.png');
+}
diff --git a/themes/mac/classic/mainToolbar/anchor.png b/themes/mac/classic/mainToolbar/anchor.png
new file mode 100644 (file)
index 0000000..0eb0362
Binary files /dev/null and b/themes/mac/classic/mainToolbar/anchor.png differ
diff --git a/themes/mac/classic/mainToolbar/browser.png b/themes/mac/classic/mainToolbar/browser.png
new file mode 100644 (file)
index 0000000..3a3cc0d
Binary files /dev/null and b/themes/mac/classic/mainToolbar/browser.png differ
diff --git a/themes/mac/classic/mainToolbar/copy.png b/themes/mac/classic/mainToolbar/copy.png
new file mode 100644 (file)
index 0000000..2c6d738
Binary files /dev/null and b/themes/mac/classic/mainToolbar/copy.png differ
diff --git a/themes/mac/classic/mainToolbar/cut.png b/themes/mac/classic/mainToolbar/cut.png
new file mode 100644 (file)
index 0000000..a890382
Binary files /dev/null and b/themes/mac/classic/mainToolbar/cut.png differ
diff --git a/themes/mac/classic/mainToolbar/find.png b/themes/mac/classic/mainToolbar/find.png
new file mode 100644 (file)
index 0000000..f8c0c81
Binary files /dev/null and b/themes/mac/classic/mainToolbar/find.png differ
diff --git a/themes/mac/classic/mainToolbar/form.png b/themes/mac/classic/mainToolbar/form.png
new file mode 100644 (file)
index 0000000..88754dc
Binary files /dev/null and b/themes/mac/classic/mainToolbar/form.png differ
diff --git a/themes/mac/classic/mainToolbar/hline.png b/themes/mac/classic/mainToolbar/hline.png
new file mode 100644 (file)
index 0000000..f85339a
Binary files /dev/null and b/themes/mac/classic/mainToolbar/hline.png differ
diff --git a/themes/mac/classic/mainToolbar/image.png b/themes/mac/classic/mainToolbar/image.png
new file mode 100644 (file)
index 0000000..b9a0f4d
Binary files /dev/null and b/themes/mac/classic/mainToolbar/image.png differ
diff --git a/themes/mac/classic/mainToolbar/link.png b/themes/mac/classic/mainToolbar/link.png
new file mode 100644 (file)
index 0000000..cfdeef4
Binary files /dev/null and b/themes/mac/classic/mainToolbar/link.png differ
diff --git a/themes/mac/classic/mainToolbar/logo-hover.png b/themes/mac/classic/mainToolbar/logo-hover.png
new file mode 100644 (file)
index 0000000..f600d60
Binary files /dev/null and b/themes/mac/classic/mainToolbar/logo-hover.png differ
diff --git a/themes/mac/classic/mainToolbar/logo.png b/themes/mac/classic/mainToolbar/logo.png
new file mode 100644 (file)
index 0000000..f27ac8d
Binary files /dev/null and b/themes/mac/classic/mainToolbar/logo.png differ
diff --git a/themes/mac/classic/mainToolbar/new.png b/themes/mac/classic/mainToolbar/new.png
new file mode 100644 (file)
index 0000000..b7f1ad6
Binary files /dev/null and b/themes/mac/classic/mainToolbar/new.png differ
diff --git a/themes/mac/classic/mainToolbar/open.png b/themes/mac/classic/mainToolbar/open.png
new file mode 100644 (file)
index 0000000..296c255
Binary files /dev/null and b/themes/mac/classic/mainToolbar/open.png differ
diff --git a/themes/mac/classic/mainToolbar/paste.png b/themes/mac/classic/mainToolbar/paste.png
new file mode 100644 (file)
index 0000000..989e092
Binary files /dev/null and b/themes/mac/classic/mainToolbar/paste.png differ
diff --git a/themes/mac/classic/mainToolbar/preview.png b/themes/mac/classic/mainToolbar/preview.png
new file mode 100644 (file)
index 0000000..6f9c1ae
Binary files /dev/null and b/themes/mac/classic/mainToolbar/preview.png differ
diff --git a/themes/mac/classic/mainToolbar/print.png b/themes/mac/classic/mainToolbar/print.png
new file mode 100644 (file)
index 0000000..aa79b65
Binary files /dev/null and b/themes/mac/classic/mainToolbar/print.png differ
diff --git a/themes/mac/classic/mainToolbar/publish.png b/themes/mac/classic/mainToolbar/publish.png
new file mode 100644 (file)
index 0000000..cd801a7
Binary files /dev/null and b/themes/mac/classic/mainToolbar/publish.png differ
diff --git a/themes/mac/classic/mainToolbar/save.png b/themes/mac/classic/mainToolbar/save.png
new file mode 100644 (file)
index 0000000..f4ee142
Binary files /dev/null and b/themes/mac/classic/mainToolbar/save.png differ
diff --git a/themes/mac/classic/mainToolbar/small/anchor.png b/themes/mac/classic/mainToolbar/small/anchor.png
new file mode 100644 (file)
index 0000000..a69a48a
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/anchor.png differ
diff --git a/themes/mac/classic/mainToolbar/small/browser.png b/themes/mac/classic/mainToolbar/small/browser.png
new file mode 100644 (file)
index 0000000..153dac4
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/browser.png differ
diff --git a/themes/mac/classic/mainToolbar/small/copy.png b/themes/mac/classic/mainToolbar/small/copy.png
new file mode 100644 (file)
index 0000000..0fc44ea
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/copy.png differ
diff --git a/themes/mac/classic/mainToolbar/small/cut.png b/themes/mac/classic/mainToolbar/small/cut.png
new file mode 100644 (file)
index 0000000..a078392
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/cut.png differ
diff --git a/themes/mac/classic/mainToolbar/small/find.png b/themes/mac/classic/mainToolbar/small/find.png
new file mode 100644 (file)
index 0000000..768bb6c
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/find.png differ
diff --git a/themes/mac/classic/mainToolbar/small/form.png b/themes/mac/classic/mainToolbar/small/form.png
new file mode 100644 (file)
index 0000000..9fa9153
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/form.png differ
diff --git a/themes/mac/classic/mainToolbar/small/hline.png b/themes/mac/classic/mainToolbar/small/hline.png
new file mode 100644 (file)
index 0000000..5446577
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/hline.png differ
diff --git a/themes/mac/classic/mainToolbar/small/image.png b/themes/mac/classic/mainToolbar/small/image.png
new file mode 100644 (file)
index 0000000..1a43169
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/image.png differ
diff --git a/themes/mac/classic/mainToolbar/small/link.png b/themes/mac/classic/mainToolbar/small/link.png
new file mode 100644 (file)
index 0000000..7674d6c
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/link.png differ
diff --git a/themes/mac/classic/mainToolbar/small/logo-hover.png b/themes/mac/classic/mainToolbar/small/logo-hover.png
new file mode 100644 (file)
index 0000000..544b108
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/logo-hover.png differ
diff --git a/themes/mac/classic/mainToolbar/small/logo.png b/themes/mac/classic/mainToolbar/small/logo.png
new file mode 100644 (file)
index 0000000..f5c6d78
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/logo.png differ
diff --git a/themes/mac/classic/mainToolbar/small/new.png b/themes/mac/classic/mainToolbar/small/new.png
new file mode 100644 (file)
index 0000000..ab8aec3
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/new.png differ
diff --git a/themes/mac/classic/mainToolbar/small/open.png b/themes/mac/classic/mainToolbar/small/open.png
new file mode 100644 (file)
index 0000000..26a00bc
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/open.png differ
diff --git a/themes/mac/classic/mainToolbar/small/paste.png b/themes/mac/classic/mainToolbar/small/paste.png
new file mode 100644 (file)
index 0000000..68abca7
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/paste.png differ
diff --git a/themes/mac/classic/mainToolbar/small/preview.png b/themes/mac/classic/mainToolbar/small/preview.png
new file mode 100644 (file)
index 0000000..ad9d548
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/preview.png differ
diff --git a/themes/mac/classic/mainToolbar/small/print.png b/themes/mac/classic/mainToolbar/small/print.png
new file mode 100644 (file)
index 0000000..00b67e5
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/print.png differ
diff --git a/themes/mac/classic/mainToolbar/small/publish.png b/themes/mac/classic/mainToolbar/small/publish.png
new file mode 100644 (file)
index 0000000..2b77d7b
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/publish.png differ
diff --git a/themes/mac/classic/mainToolbar/small/save.png b/themes/mac/classic/mainToolbar/small/save.png
new file mode 100644 (file)
index 0000000..0950806
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/save.png differ
diff --git a/themes/mac/classic/mainToolbar/small/spell.png b/themes/mac/classic/mainToolbar/small/spell.png
new file mode 100644 (file)
index 0000000..6aa8f3a
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/spell.png differ
diff --git a/themes/mac/classic/mainToolbar/small/stop.png b/themes/mac/classic/mainToolbar/small/stop.png
new file mode 100644 (file)
index 0000000..aaec508
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/stop.png differ
diff --git a/themes/mac/classic/mainToolbar/small/table.png b/themes/mac/classic/mainToolbar/small/table.png
new file mode 100644 (file)
index 0000000..2778f82
Binary files /dev/null and b/themes/mac/classic/mainToolbar/small/table.png differ
diff --git a/themes/mac/classic/mainToolbar/spell.png b/themes/mac/classic/mainToolbar/spell.png
new file mode 100644 (file)
index 0000000..660d132
Binary files /dev/null and b/themes/mac/classic/mainToolbar/spell.png differ
diff --git a/themes/mac/classic/mainToolbar/stop.png b/themes/mac/classic/mainToolbar/stop.png
new file mode 100644 (file)
index 0000000..5e25255
Binary files /dev/null and b/themes/mac/classic/mainToolbar/stop.png differ
diff --git a/themes/mac/classic/mainToolbar/table.png b/themes/mac/classic/mainToolbar/table.png
new file mode 100644 (file)
index 0000000..69d8fd2
Binary files /dev/null and b/themes/mac/classic/mainToolbar/table.png differ
diff --git a/themes/mac/classic/minus-disabled.png b/themes/mac/classic/minus-disabled.png
new file mode 100644 (file)
index 0000000..ccc0290
Binary files /dev/null and b/themes/mac/classic/minus-disabled.png differ
diff --git a/themes/mac/classic/minus.png b/themes/mac/classic/minus.png
new file mode 100644 (file)
index 0000000..5285a5f
Binary files /dev/null and b/themes/mac/classic/minus.png differ
diff --git a/themes/mac/classic/newPageWizard.css b/themes/mac/classic/newPageWizard.css
new file mode 100644 (file)
index 0000000..e0d1433
--- /dev/null
@@ -0,0 +1,79 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#pagePreview {
+       background-color: white;
+       border: thin ridge silver;
+       margin-left: 1em;
+}
+
+.larger {
+       font-size: larger;
+}
+
+filepickerbutton {
+  -moz-binding: url('chrome://bluegriffon/content/bindings/filepickerbutton.xml#filepickerbutton');
+}
+
+#backgroundPositionBox {
+  width: 99px;
+       height: 99px;
+       background-image: url('chrome://bluegriffon/skin/backgroundPosition.png');
+       background-position: 50% 50%;
+       background-color: transparent;
+       -moz-appearance: none;}
+
+#backgroundImageBox {
+  width: 99px;
+       height: 99px;
+       background-image: url('chrome://bluegriffon/skin/backgroundImage.png');
+       background-repeat: no-repeat;
+  background-color: white;
+       background-position: 50% 50%;
+}
+
+stack {
+       border: 1px ridge #888;
+}
+
+#LayoutRows row {
+       border: 2px groove #d0d0d0;
+}
+
+ecolorpicker {
+       -moz-binding: url("chrome://bluegriffon/content/bindings/ecolorpicker.xml#ecolorpicker");
+}
diff --git a/themes/mac/classic/pageProperties.css b/themes/mac/classic/pageProperties.css
new file mode 100644 (file)
index 0000000..13afbfe
--- /dev/null
@@ -0,0 +1,36 @@
+filepickerbutton {
+  -moz-binding: url('chrome://bluegriffon/content/bindings/filepickerbutton.xml#filepickerbutton');
+}
+
+#removeBackground {
+  list-style-image: url("chrome://bluegriffon/skin/icons/close-button.png");
+  -moz-image-region: rect(0px 16px 16px 0px);
+  padding: 0px;
+  min-width: 0px;
+  margin: 0px;
+}
+
+#pagePreview {
+  margin: 2px 4px;
+  margin-left: 1em;
+  border: 2px solid;
+  -moz-border-top-colors: ThreeDShadow ThreeDDarkShadow;
+  -moz-border-right-colors: ThreeDHighlight ThreeDLightShadow;
+  -moz-border-bottom-colors: ThreeDHighlight ThreeDLightShadow;
+  -moz-border-left-colors: ThreeDShadow ThreeDDarkShadow;
+}
+
+.larger {
+  font-size: larger;
+}
+
+/*.colorpicker-button-colorbox[disabled="true"] {
+ border-color: GrayText;
+ background-color: transparent ! important;
+}*/
+
+#removeBackground .toolbarbutton-icon {
+  min-width: 0px;
+  padding: 0px;
+  margin: 2px ! important;
+}
diff --git a/themes/mac/classic/plus-disabled.png b/themes/mac/classic/plus-disabled.png
new file mode 100644 (file)
index 0000000..2716015
Binary files /dev/null and b/themes/mac/classic/plus-disabled.png differ
diff --git a/themes/mac/classic/plus.png b/themes/mac/classic/plus.png
new file mode 100644 (file)
index 0000000..42d410f
Binary files /dev/null and b/themes/mac/classic/plus.png differ
diff --git a/themes/mac/classic/refresh.png b/themes/mac/classic/refresh.png
new file mode 100644 (file)
index 0000000..9c9c747
Binary files /dev/null and b/themes/mac/classic/refresh.png differ
diff --git a/themes/mac/classic/rulers.css b/themes/mac/classic/rulers.css
new file mode 100644 (file)
index 0000000..e5b086b
--- /dev/null
@@ -0,0 +1,43 @@
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+@namespace svg url("http://www.w3.org/2000/svg");
+
+svg|text {
+  stroke-width: 4px;
+  font-family: -moz-fixed;
+  font-variant: normal;
+  line-height: normal;
+  font-size: small ! important;
+  dominant-baseline: middle;
+  text-anchor: middle;
+  color: white;
+}
+
+hruler[disabled], vruler[disabled]  { display: none;}
+hruler, vruler      { display: -moz-box;
+                     background-color: transparent;
+                   }
+
+hruler {
+  stroke-width: 4px;
+  font-family: -moz-fixed;
+  font-style: bold;
+  font-variant: normal;
+  line-height: normal;
+  font-size: x-small;
+  height: 16px;
+  width: 100%;
+  margin: 2px 0px;
+  position: absolute;
+}
+vruler {
+  stroke-width: 4px;
+  font-family: -moz-fixed;
+  font-style: bold;
+  font-variant: normal;
+  line-height: normal;
+  font-size: x-small;
+  width: 16px;
+  margin: 0px 2px;
+  /*position: absolute;*/
+}
+
diff --git a/themes/mac/classic/sidebar.css b/themes/mac/classic/sidebar.css
new file mode 100644 (file)
index 0000000..315c2a5
--- /dev/null
@@ -0,0 +1,79 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+label {
+}
+
+.titlebox {
+  padding-left: 0.5em;
+  font-size: smaller;
+       border-bottom: thin groove black;
+}
+
+.sidebar-closebutton > .toolbarbutton-icon {
+  -moz-margin-end: 0px !important;
+  -moz-padding-end: 2px !important;
+  -moz-padding-start: 2px !important;
+}
+
+.sidebar-closebutton {
+  list-style-image: url("chrome://global/skin/icons/close.png");
+  -moz-appearance: none;
+  -moz-image-region: rect(0px, 14px, 14px, 0px);
+  padding: 4px 2px;
+  border: none !important;
+}
+
+.sidebar-closebutton:hover {
+  -moz-image-region: rect(0px, 28px, 14px, 14px);
+}
+
+.sidebar-closebutton:hover:active {
+  -moz-image-region: rect(0px, 42px, 14px, 28px);
+}
+
+/*.sidebar-morebutton {
+  border: thin groove;
+  -moz-border-radius: 3px;
+  -moz-margin-end: 4px;
+}*/
+
+.sidebar-morebutton > .toolbarbutton-menu-dropmarker {
+  -moz-margin-start: 2px;
+}
diff --git a/themes/mac/classic/sidebarcontent.css b/themes/mac/classic/sidebarcontent.css
new file mode 100644 (file)
index 0000000..4d08e1e
--- /dev/null
@@ -0,0 +1,69 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+.sidebarcontent-name {
+  font-weight: bold;
+}
+
+label {
+  font-size: smaller;
+}
+
+.titlebox {
+  padding-left: 1em;
+  background-color: #A0A0A0;
+}
+
+.sidebar-arrowbutton {
+  border: thin groove;
+  -moz-border-radius: 3px;
+  -moz-margin-end: 4px;
+}
+
+.sidebar-arrowbutton > .toolbarbutton-menu-dropmarker {
+  -moz-margin-start: 2px;
+}
+
+hbox[anonid="titlebox"]:-moz-drag-over {
+  /*border-top: 3px black solid;*/
+}
+
+label[anonid="name"] {
+  cursor: move ! important;
+}
diff --git a/themes/mac/classic/standaloneSidebar.css b/themes/mac/classic/standaloneSidebar.css
new file mode 100644 (file)
index 0000000..394c9ac
--- /dev/null
@@ -0,0 +1,47 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+#mainMenu {
+  font-size: smaller;
+  background-color: #A0A0A0;
+}
+
+.toolbarbutton-menu-dropmarker {
+  -moz-margin-start: 2px;
+}
diff --git a/themes/mac/classic/structurebar.css b/themes/mac/classic/structurebar.css
new file mode 100644 (file)
index 0000000..4a2751d
--- /dev/null
@@ -0,0 +1,40 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+.selected {
+  font-weight: bold;
+}
diff --git a/themes/mac/classic/tab-bkgnd.png b/themes/mac/classic/tab-bkgnd.png
new file mode 100644 (file)
index 0000000..acf39e6
Binary files /dev/null and b/themes/mac/classic/tab-bkgnd.png differ
diff --git a/themes/mac/classic/tabeditor-tabs-bkgnd.png b/themes/mac/classic/tabeditor-tabs-bkgnd.png
new file mode 100644 (file)
index 0000000..1f80c83
Binary files /dev/null and b/themes/mac/classic/tabeditor-tabs-bkgnd.png differ
diff --git a/themes/mac/classic/tabeditor.css b/themes/mac/classic/tabeditor.css
new file mode 100644 (file)
index 0000000..18085a6
--- /dev/null
@@ -0,0 +1,163 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+/* ----- INACTIVE WINDOW ----- */
+
+#Bluegriffon:not([active="true"]).tabeditor-strip {
+  background-color: #e2e2e2;
+}
+
+#Bluegriffon:not([active="true"]) .tabeditor-tab {
+  color: #575757;
+}
+
+#Bluegriffon:not([active="true"]) .tabeditor-tab[selected="true"] {
+  background-color: -moz-mac-chrome-inactive;
+}
+
+
+/* ::::: tabeditor ::::: */
+
+tabeditor > tabbox {
+  margin: 0;
+}
+
+.tab-icon-image {
+  width: 16px;
+  height: 16px;
+  list-style-image: url("chrome://global/skin/tree/item-grayscale.png");
+  opacity: 0.6;
+  margin-top: 2px;
+}
+
+.tabeditor-tab[selected="true"] > .tab-icon-image {
+  list-style-image: url("chrome://global/skin/tree/item.png");
+}
+
+.tabeditor-tab[busy] > .tab-icon-image {
+  list-style-image: url("chrome://global/skin/icons/loading_16.png") !important;
+}
+
+.tabeditor-tab:hover > .tab-icon-image,
+.tabeditor-tab[selected="true"] > .tab-icon-image {
+  opacity: 1;
+}
+
+.tab-text {
+  margin-top: 3px;
+  margin-bottom: 0;
+  font: message-box;
+  font-weight: bold;
+  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
+}
+
+.tabeditor-tab {
+  -moz-appearance: none;
+  -moz-border-radius: 0 0 6px 6px;
+  color: #222;
+  margin-bottom: 1px;
+  -moz-margin-end: 1px;
+  padding: 0 5px;
+  border-style: none solid solid;
+  border-width: 3px;
+  -moz-border-right-colors: rgba(0, 0, 0, .08) rgba(0, 0, 0, .17) rgba(180, 180, 180, .29);
+  -moz-border-bottom-colors: rgba(0, 0, 0, .08) rgba(0, 0, 0, .17) rgba(180, 180, 180, .29);
+  -moz-border-left-colors: rgba(0, 0, 0, .08) rgba(0, 0, 0, .17) rgba(180, 180, 180, .29);
+  -moz-background-clip: padding;
+  min-width: 1px !important;
+  text-align: center;
+  height: 24px;
+}
+
+.tabeditor-tab:not([selected="true"]) {
+  background-image: url("chrome://bluegriffon/skin/tab-bkgnd.png");
+}
+
+.tabeditor-tab[selected="true"] {
+  -moz-user-focus: normal;
+  padding: 0 6px 1px;
+  border-width: 2px;
+  -moz-border-left-colors: rgba(0, 0, 0, .1) rgba(0, 0, 0, .2);
+  -moz-border-bottom-colors: rgba(0, 0, 0, .1) rgba(0, 0, 0, .2);
+  -moz-border-right-colors: rgba(0, 0, 0, .1) rgba(0, 0, 0, .2);
+  background-color: -moz-mac-chrome-active;
+}
+
+.tabeditor-tab[selected="true"]:focus > .tab-text {
+  outline: 2px solid #4F8EC9;
+  outline-offset: -2px;
+  -moz-outline-radius: 3px;
+}
+
+.tabeditor-tab[selected="true"],
+.tabeditor-tab:hover {
+  color: #000000;
+}
+
+.tabeditor-strip {
+  margin-top: -1px;
+  border-bottom: 1px solid #404040;
+  background-color: #9B9B9B;
+}
+
+.tabeditor-tabs {
+  border: none;
+  -moz-box-pack: center;
+  -moz-box-align: center;
+  background: url("chrome://bluegriffon/skin/tabeditor-tabs-bkgnd.png") repeat-x;
+  height: 25px;
+  margin-bottom: 0;
+}
+
+.tabs-left {
+  display: -moz-box;
+  width: 3px;
+}
+
+.tabeditor-tabs[overflow="true"] .tabs-left {
+  display: none;
+}
+
+tabeditor > tabbox > tabpanels {
+  -moz-appearance: none !important;
+}
+
+
+
+
diff --git a/themes/mac/jar.mn b/themes/mac/jar.mn
new file mode 100644 (file)
index 0000000..b8ce2d9
--- /dev/null
@@ -0,0 +1,129 @@
+bluegriffon.jar:
+% skin    bluegriffon    classic/1.0 %skin/classic/bluegriffon/
+% skin   venkman modern/1.0 jar:venkman.jar!/skin/modern/venkman/
+  skin/classic/bluegriffon/bluegriffon.css  (classic/bluegriffon.css)
+  skin/classic/bluegriffon/bluegriffon.ico  (classic/bluegriffon.ico)
+  skin/classic/bluegriffon/bluegriffonDialogs.css  (classic/bluegriffonDialogs.css)
+  skin/classic/bluegriffon/colourPicker.css  (classic/colourPicker.css)
+  skin/classic/bluegriffon/cssToggler.css  (classic/cssToggler.css)
+  skin/classic/bluegriffon/formatToolbar/align-center-disabled.png  (classic/formatToolbar/align-center-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/align-center.png  (classic/formatToolbar/align-center.png)
+  skin/classic/bluegriffon/formatToolbar/align-justify-disabled.png  (classic/formatToolbar/align-justify-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/align-justify.png  (classic/formatToolbar/align-justify.png)
+  skin/classic/bluegriffon/formatToolbar/align-left-disabled.png  (classic/formatToolbar/align-left-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/align-left.png  (classic/formatToolbar/align-left.png)
+  skin/classic/bluegriffon/formatToolbar/align-right-disabled.png  (classic/formatToolbar/align-right-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/align-right.png  (classic/formatToolbar/align-right.png)
+  skin/classic/bluegriffon/formatToolbar/bold-disabled.png  (classic/formatToolbar/bold-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/bold.png  (classic/formatToolbar/bold.png)
+  skin/classic/bluegriffon/formatToolbar/code-disabled.png  (classic/formatToolbar/code-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/code.png  (classic/formatToolbar/code.png)
+  skin/classic/bluegriffon/formatToolbar/dd-disabled.gif  (classic/formatToolbar/dd-disabled.gif)
+  skin/classic/bluegriffon/formatToolbar/dd-disabled.png  (classic/formatToolbar/dd-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/dd.gif  (classic/formatToolbar/dd.gif)
+  skin/classic/bluegriffon/formatToolbar/dd.png  (classic/formatToolbar/dd.png)
+  skin/classic/bluegriffon/formatToolbar/dt-disabled.gif  (classic/formatToolbar/dt-disabled.gif)
+  skin/classic/bluegriffon/formatToolbar/dt-disabled.png  (classic/formatToolbar/dt-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/dt.gif  (classic/formatToolbar/dt.gif)
+  skin/classic/bluegriffon/formatToolbar/dt.png  (classic/formatToolbar/dt.png)
+  skin/classic/bluegriffon/formatToolbar/em-disabled.png  (classic/formatToolbar/em-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/em.png  (classic/formatToolbar/em.png)
+  skin/classic/bluegriffon/formatToolbar/indent-disabled.png  (classic/formatToolbar/indent-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/indent.png  (classic/formatToolbar/indent.png)
+  skin/classic/bluegriffon/formatToolbar/italic-disabled.png  (classic/formatToolbar/italic-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/italic.png  (classic/formatToolbar/italic.png)
+  skin/classic/bluegriffon/formatToolbar/ol-disabled.png  (classic/formatToolbar/ol-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/ol.png  (classic/formatToolbar/ol.png)
+  skin/classic/bluegriffon/formatToolbar/outdent-disabled.png  (classic/formatToolbar/outdent-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/outdent.png  (classic/formatToolbar/outdent.png)
+  skin/classic/bluegriffon/formatToolbar/strong-disabled.png  (classic/formatToolbar/strong-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/strong.png  (classic/formatToolbar/strong.png)
+  skin/classic/bluegriffon/formatToolbar/ul-disabled.png  (classic/formatToolbar/ul-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/ul.png  (classic/formatToolbar/ul.png)
+  skin/classic/bluegriffon/formatToolbar/underline-disabled.png  (classic/formatToolbar/underline-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/underline.png  (classic/formatToolbar/underline.png)
+  skin/classic/bluegriffon/formatToolbar.css  (classic/formatToolbar.css)
+  skin/classic/bluegriffon/icons/bold-disabled.png  (classic/icons/bold-disabled.png)
+  skin/classic/bluegriffon/icons/bold-hover.png  (classic/icons/bold-hover.png)
+  skin/classic/bluegriffon/icons/bold.png  (classic/icons/bold.png)
+  skin/classic/bluegriffon/icons/btn3.png  (classic/icons/btn3.png)
+  skin/classic/bluegriffon/icons/close-button.png  (classic/icons/close-button.png)
+  skin/classic/bluegriffon/icons/filePicking.png  (classic/icons/filePicking.png)
+  skin/classic/bluegriffon/icons/filePicking-hover.png  (classic/icons/filePicking-hover.png)
+  skin/classic/bluegriffon/icons/information-disabled.png  (classic/icons/information-disabled.png)
+  skin/classic/bluegriffon/icons/information-hover.png  (classic/icons/information-hover.png)
+  skin/classic/bluegriffon/icons/information.png  (classic/icons/information.png)
+  skin/classic/bluegriffon/icons/loading.gif  (classic/icons/loading.gif)
+  skin/classic/bluegriffon/icons/modified.gif  (classic/icons/modified.gif)
+  skin/classic/bluegriffon/icons/new.png  (classic/icons/new.png)
+  skin/classic/bluegriffon/icons/newstop.png  (classic/icons/newstop.png)
+  skin/classic/bluegriffon/icons/open.png  (classic/icons/open.png)
+  skin/classic/bluegriffon/icons/stop.png  (classic/icons/stop.png)
+  skin/classic/bluegriffon/icons/twistyClosed.png  (classic/icons/twistyClosed.png)
+  skin/classic/bluegriffon/icons/twistyOpen.png  (classic/icons/twistyOpen.png)
+  skin/classic/bluegriffon/insertTable.css  (classic/insertTable.css)
+  skin/classic/bluegriffon/languages.css  (classic/languages.css)
+  skin/classic/bluegriffon/backgroundImage.png  (classic/backgroundImage.png)
+  skin/classic/bluegriffon/backgroundPosition.png  (classic/backgroundPosition.png)
+  skin/classic/bluegriffon/mainToolbar/anchor.png  (classic/mainToolbar/anchor.png)
+  skin/classic/bluegriffon/mainToolbar/browser.png  (classic/mainToolbar/browser.png)
+  skin/classic/bluegriffon/mainToolbar/copy.png  (classic/mainToolbar/copy.png)
+  skin/classic/bluegriffon/mainToolbar/cut.png  (classic/mainToolbar/cut.png)
+  skin/classic/bluegriffon/mainToolbar/find.png  (classic/mainToolbar/find.png)
+  skin/classic/bluegriffon/mainToolbar/form.png  (classic/mainToolbar/form.png)
+  skin/classic/bluegriffon/mainToolbar/hline.png  (classic/mainToolbar/hline.png)
+  skin/classic/bluegriffon/mainToolbar/image.png  (classic/mainToolbar/image.png)
+  skin/classic/bluegriffon/mainToolbar/link.png  (classic/mainToolbar/link.png)
+  skin/classic/bluegriffon/mainToolbar/logo-hover.png  (classic/mainToolbar/logo-hover.png)
+  skin/classic/bluegriffon/mainToolbar/logo.png  (classic/mainToolbar/logo.png)
+  skin/classic/bluegriffon/mainToolbar/new.png  (classic/mainToolbar/new.png)
+  skin/classic/bluegriffon/mainToolbar/open.png  (classic/mainToolbar/open.png)
+  skin/classic/bluegriffon/mainToolbar/paste.png  (classic/mainToolbar/paste.png)
+  skin/classic/bluegriffon/mainToolbar/preview.png  (classic/mainToolbar/preview.png)
+  skin/classic/bluegriffon/mainToolbar/print.png  (classic/mainToolbar/print.png)
+  skin/classic/bluegriffon/mainToolbar/publish.png  (classic/mainToolbar/publish.png)
+  skin/classic/bluegriffon/mainToolbar/save.png  (classic/mainToolbar/save.png)
+  skin/classic/bluegriffon/mainToolbar/small/anchor.png  (classic/mainToolbar/small/anchor.png)
+  skin/classic/bluegriffon/mainToolbar/small/browser.png  (classic/mainToolbar/small/browser.png)
+  skin/classic/bluegriffon/mainToolbar/small/copy.png  (classic/mainToolbar/small/copy.png)
+  skin/classic/bluegriffon/mainToolbar/small/cut.png  (classic/mainToolbar/small/cut.png)
+  skin/classic/bluegriffon/mainToolbar/small/find.png  (classic/mainToolbar/small/find.png)
+  skin/classic/bluegriffon/mainToolbar/small/form.png  (classic/mainToolbar/small/form.png)
+  skin/classic/bluegriffon/mainToolbar/small/hline.png  (classic/mainToolbar/small/hline.png)
+  skin/classic/bluegriffon/mainToolbar/small/image.png  (classic/mainToolbar/small/image.png)
+  skin/classic/bluegriffon/mainToolbar/small/link.png  (classic/mainToolbar/small/link.png)
+  skin/classic/bluegriffon/mainToolbar/small/logo-hover.png  (classic/mainToolbar/small/logo-hover.png)
+  skin/classic/bluegriffon/mainToolbar/small/logo.png  (classic/mainToolbar/small/logo.png)
+  skin/classic/bluegriffon/mainToolbar/small/new.png  (classic/mainToolbar/small/new.png)
+  skin/classic/bluegriffon/mainToolbar/small/open.png  (classic/mainToolbar/small/open.png)
+  skin/classic/bluegriffon/mainToolbar/small/paste.png  (classic/mainToolbar/small/paste.png)
+  skin/classic/bluegriffon/mainToolbar/small/preview.png  (classic/mainToolbar/small/preview.png)
+  skin/classic/bluegriffon/mainToolbar/small/print.png  (classic/mainToolbar/small/print.png)
+  skin/classic/bluegriffon/mainToolbar/small/publish.png  (classic/mainToolbar/small/publish.png)
+  skin/classic/bluegriffon/mainToolbar/small/save.png  (classic/mainToolbar/small/save.png)
+  skin/classic/bluegriffon/mainToolbar/small/spell.png  (classic/mainToolbar/small/spell.png)
+  skin/classic/bluegriffon/mainToolbar/small/stop.png  (classic/mainToolbar/small/stop.png)
+  skin/classic/bluegriffon/mainToolbar/small/table.png  (classic/mainToolbar/small/table.png)
+  skin/classic/bluegriffon/mainToolbar/spell.png  (classic/mainToolbar/spell.png)
+  skin/classic/bluegriffon/mainToolbar/stop.png  (classic/mainToolbar/stop.png)
+  skin/classic/bluegriffon/mainToolbar/table.png  (classic/mainToolbar/table.png)
+  skin/classic/bluegriffon/mainToolbar.css  (classic/mainToolbar.css)
+  skin/classic/bluegriffon/newPageWizard.css  (classic/newPageWizard.css)
+  skin/classic/bluegriffon/listboxBg.css  (classic/listboxBg.css)
+  skin/classic/bluegriffon/rulers.css  (classic/rulers.css)
+  skin/classic/bluegriffon/sidebar.css  (classic/sidebar.css)
+  skin/classic/bluegriffon/sidebarcontent.css  (classic/sidebarcontent.css)
+  skin/classic/bluegriffon/standaloneSidebar.css  (classic/standaloneSidebar.css)
+  skin/classic/bluegriffon/structurebar.css  (classic/structurebar.css)
+  skin/classic/bluegriffon/tabeditor.css  (classic/tabeditor.css)
+  skin/classic/bluegriffon/listboxBg.png      (classic/listboxBg.png)
+  skin/classic/bluegriffon/listboxBgActive.png      (classic/listboxBgActive.png)
+  skin/classic/bluegriffon/plus.png      (classic/plus.png)
+  skin/classic/bluegriffon/minus.png      (classic/minus.png)
+  skin/classic/bluegriffon/config.png      (classic/config.png)
+  skin/classic/bluegriffon/plus-disabled.png      (classic/plus-disabled.png)
+  skin/classic/bluegriffon/minus-disabled.png      (classic/minus-disabled.png)
+  skin/classic/bluegriffon/config-disabled.png      (classic/config-disabled.png)
+  skin/classic/bluegriffon/ecolorpicker.css       (classic/ecolorpicker.css)
+  skin/classic/bluegriffon/tab-bkgnd.png      (classic/tab-bkgnd.png)
+  skin/classic/bluegriffon/tabeditor-tabs-bkgnd.png      (classic/tabeditor-tabs-bkgnd.png)
diff --git a/themes/win/Makefile.in b/themes/win/Makefile.in
new file mode 100644 (file)
index 0000000..395226b
--- /dev/null
@@ -0,0 +1,51 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is BlueGriffon.
+#
+# The Initial Developer of the Original Code is
+# Disruptive Innovations SARL.
+# Portions created by the Initial Developer are Copyright (C) 2003
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Daniel Glazman (daniel.glazman@disruptive-innovations.com)
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH          = ../../..
+topsrcdir      = @top_srcdir@
+srcdir = @srcdir@
+VPATH          = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+DEFINES += \
+       -DAPP_NAME=$(MOZ_APP_DISPLAYNAME) \
+       -DAPP_VERSION=$(MOZ_APP_VERSION) \
+       $(NULL)
+
+include $(topsrcdir)/config/rules.mk
+
diff --git a/themes/win/classic/backgroundImage.png b/themes/win/classic/backgroundImage.png
new file mode 100755 (executable)
index 0000000..ac35514
Binary files /dev/null and b/themes/win/classic/backgroundImage.png differ
diff --git a/themes/win/classic/backgroundPosition.png b/themes/win/classic/backgroundPosition.png
new file mode 100755 (executable)
index 0000000..35cdf1b
Binary files /dev/null and b/themes/win/classic/backgroundPosition.png differ
diff --git a/themes/win/classic/bluegriffon.css b/themes/win/classic/bluegriffon.css
new file mode 100644 (file)
index 0000000..4f95f84
--- /dev/null
@@ -0,0 +1,144 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@import url("chrome://bluegriffon/content/bindings/sidebar.css");
+@import url("chrome://bluegriffon/content/bindings/structurebar.css");
+@import url("chrome://bluegriffon/skin/mainToolbar.css");
+@import url("chrome://bluegriffon/skin/formatToolbar.css");
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+@namespace svg url("http://www.w3.org/2000/svg");
+
+tabeditor {
+  -moz-binding: url('chrome://bluegriffon/content/bindings/tabeditor.xml#tabeditor');
+}
+
+tabeditor[visibility="hidden"]  tabs,
+tabeditor[visibility="hidden"]  tabpanels
+{
+  visibility: hidden;
+}
+
+tabeditor[visibility="hidden"] {
+  background-color: rgb(128,128,128);
+}
+
+sidebar {
+  width: 200px;
+}
+
+sourceeditor {
+  -moz-binding: url('chrome://diavolo/content/sourceeditor.xml#sourceeditor');
+}
+
+hruler {
+  -moz-binding: url('chrome://bluegriffon/content/bindings/rulers.xml#hruler');
+}
+
+vruler {
+  -moz-binding: url('chrome://bluegriffon/content/bindings/rulers.xml#vruler');
+}
+
+.menuitem-iconic .menu-iconic-left {
+  display: -moz-box !important;
+}
+
+
+#infoButton {
+  list-style-image: url('chrome://bluegriffon/skin/icons/information.png');
+  width: 16px;
+  height: 16px;
+}
+
+#infoButton:hover {
+  list-style-image: url('chrome://bluegriffon/skin/icons/information-hover.png'); 
+}
+
+#infoButton[disabled="true"],
+#infoButton[disabled="true"]:hover {
+  list-style-image: url('chrome://bluegriffon/skin/icons/information-disabled.png'); 
+}
+
+#helperButtons {
+  border-right: threedshadow 1px solid;
+  padding: 2px;
+}
+
+#treeSourceView
+{
+  background-color: white;
+}
+
+grippy[disabled="true"] {
+  display: none;
+}
+
+/******* ZOOM *******/
+
+#menulist-zoompanel {
+  max-width: 5em;
+}
+
+#CustomizeToolbarSheet > #main-box {
+  border-top: none !important;
+  border-left: 2px solid;
+  border-right: 2px solid;
+  border-bottom: 3px solid;
+  -moz-border-right-colors: -moz-mac-menushadow ThreeDLightShadow  !important;
+  -moz-border-bottom-colors: -moz-mac-menushadow -moz-mac-menushadow ThreeDShadow  !important;
+  -moz-border-left-colors: ThreeDLightShadow ThreeDHighlight !important;
+}
+
+/********* splitters **********/
+
+#splitter1 {
+  border-right: thin solid silver;
+  border-left: thin solid silver;
+}
+
+#splitter2 {
+  border-left: thin solid silver;
+  border-right: thin solid silver;
+}
+
+
+
+
+
+
+
+
diff --git a/themes/win/classic/bluegriffon.ico b/themes/win/classic/bluegriffon.ico
new file mode 100644 (file)
index 0000000..55a275b
Binary files /dev/null and b/themes/win/classic/bluegriffon.ico differ
diff --git a/themes/win/classic/bluegriffonDialogs.css b/themes/win/classic/bluegriffonDialogs.css
new file mode 100644 (file)
index 0000000..7fa5962
--- /dev/null
@@ -0,0 +1,4 @@
+csstoggler {
+  -moz-binding: url('chrome://bluegriffon/content/bindings/cssToggler.xml#cssToggler');
+  -moz-box-orient: vertical;
+}
diff --git a/themes/win/classic/colourPicker.css b/themes/win/classic/colourPicker.css
new file mode 100644 (file)
index 0000000..a5a10eb
--- /dev/null
@@ -0,0 +1,65 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Nvu
+ *
+ * The Initial Developer of the Original Code is
+ * Linspire Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2004
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman (glazman@disruptive-innovations.com), on behalf of Linspire Inc.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+@namespace html url("http://www.w3.org/1999/xhtml");
+
+#redImg, #greenImg, #blueImg,
+#hueImg, #saturationImg, #brightnessImg {
+  border: 1px solid black;
+  cursor: crosshair;
+}
+
+#saturationImg {
+  background-color: transparent;
+}
+
+html|*#swatch {
+  width: 30px;
+  height: 67px;
+  min-width: 34px;
+  min-height: 67px;
+       margin: 4px;
+  border: 1px solid black;
+}
+
+#LastPickedColor {
+  width: 17px;
+  height: 13px; 
+  border: 1px inset #CCCCCC;
+  margin: 1px 2px 2px 4px;
+}
diff --git a/themes/win/classic/config-disabled.png b/themes/win/classic/config-disabled.png
new file mode 100644 (file)
index 0000000..6f19511
Binary files /dev/null and b/themes/win/classic/config-disabled.png differ
diff --git a/themes/win/classic/config.png b/themes/win/classic/config.png
new file mode 100644 (file)
index 0000000..d106906
Binary files /dev/null and b/themes/win/classic/config.png differ
diff --git a/themes/win/classic/cssToggler.css b/themes/win/classic/cssToggler.css
new file mode 100644 (file)
index 0000000..d1921f9
--- /dev/null
@@ -0,0 +1,52 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+*[anonid="prefBox"],
+*[anonid="childrenBox"],
+*[anonid="idBox"] {
+  font-size: smaller;
+}
+
+*[anonid="existingIdAlert"] {
+  color: red;
+}
+
+.hiddenAlert {
+  visibility: hidden;
+}
diff --git a/themes/win/classic/ecolorpicker.css b/themes/win/classic/ecolorpicker.css
new file mode 100644 (file)
index 0000000..eb4767b
--- /dev/null
@@ -0,0 +1,99 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998-1999
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/* ===== colorpicker.css ================================================
+  == Styles used by the XUL colorpicker element.
+  ======================================================================= */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+/* ::::: colorpicker button ::::: */
+/* colorpicker button */
+
+ecolorpicker {
+  width: 38px;
+  height: 24px;
+  border: 2px solid;
+  -moz-border-top-colors: ThreeDLightShadow ThreeDHighlight;
+  -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow;
+  -moz-border-bottom-colors: ThreeDDarkShadow ThreeDShadow;
+  -moz-border-left-colors: ThreeDLightShadow ThreeDHighlight;
+  background-color: ThreeDFace;
+  padding: 3px;
+}
+
+ecolorpicker:not([disabled]):focus {
+  -moz-border-top-colors: ThreeDDarkShadow ThreeDHighlight;
+  -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow;
+  -moz-border-bottom-colors: ThreeDDarkShadow ThreeDShadow;
+  -moz-border-left-colors: ThreeDDarkShadow ThreeDHighlight;
+}
+
+ecolorpicker:not([disabled]):active:hover {
+  -moz-border-top-colors: ThreeDDarkShadow ThreeDShadow;
+  -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow;
+  -moz-border-bottom-colors: ThreeDDarkShadow ThreeDShadow;
+  -moz-border-left-colors: ThreeDDarkShadow ThreeDShadow;
+}
+
+.colorpicker-button-colorbox {
+  border: 1px solid #000000;
+}
+
+/* ::::: colorpicker tiles ::::: */
+
+.colorpickertile {
+  width                 : 20px;
+  height                : 20px;
+  margin                : 1px;
+}
+
+.colorpickertile[selected="true"] {
+  border : 1px outset #C0C0C0;
+
+}
+
+.colorpickertile[hover="true"] {
+  border : 1px dotted #A7A7A7;
+}
+
+.cp-light[hover="true"] {
+  border : 1px dotted #000000;
+}
+
+
diff --git a/themes/win/classic/formatToolbar.css b/themes/win/classic/formatToolbar.css
new file mode 100644 (file)
index 0000000..b0e0395
--- /dev/null
@@ -0,0 +1,224 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#FormatToolbox .toolbarbutton-text {
+  display: none;
+}
+
+#FormatToolbox toolbarbutton {
+  margin: 2px;
+  -moz-appearance: none;
+  
+}
+
+#FormatToolbox toolbarbutton .toolbarbutton-icon {
+  margin: 2px ! important;
+}
+
+#FormatToolbox toolbarbutton:not([disabled]):hover {
+  background-color: #ffcc66 ! important;
+}
+
+#FormatToolbox toolbarbutton[checked="true"] {
+  background-color: orange ! important;
+  background-image: none ! important;
+  padding: 0px ! important;
+  opacity: 1 !important;
+}
+
+#CustomizeToolbarWindow toolbarbutton,
+#CustomizeToolbarWindow toolbarpalette {
+  -moz-box-orient: vertical;
+}
+
+toolbaritem  menulist {
+  min-height: 20px ! important
+}
+
+/****** EM ******/
+
+#emButton {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/em.png");
+}
+
+#emButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/em-disabled.png");
+}
+
+/****** STRONG ******/
+
+#strongButton {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/strong.png");
+}
+
+#strongButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/strong-disabled.png");
+}
+
+/****** BOLD ******/
+
+#boldButton{
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/bold.png");
+}
+
+#boldButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/bold-disabled.png");
+}
+
+/****** ITALIC ******/
+
+#italicButton{
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/italic.png");
+}
+
+#italicButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/italic-disabled.png");
+}
+
+/****** UNDERLINE ******/
+
+#underlineButton{
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/underline.png");
+}
+
+#underlineButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/underline-disabled.png");
+}
+
+/****** UL ******/
+
+#ulButton{
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/ul.png");
+}
+
+#ulButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/ul-disabled.png");
+}
+
+/****** OL *****/
+
+#olButton{
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/ol.png");
+}
+
+#olButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/ol-disabled.png");
+}
+
+/****** ALIGN ******/
+
+#align-left-button {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/align-left.png");
+}
+
+#align-left-button[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/align-left-disabled.png");
+}
+
+#align-center-button {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/align-center.png");
+}
+
+#align-center-button[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/align-center-disabled.png");
+}
+
+#align-right-button {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/align-right.png");
+}
+
+#align-right-button[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/align-right-disabled.png");
+}
+
+#align-justify-button {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/align-justify.png");
+}
+
+#align-justify-button[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/align-justify-disabled.png");
+}
+
+/****** INDENT ******/
+
+#indentButton {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/indent.png");
+}
+
+#indentButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/indent-disabled.png");
+}
+
+/****** OUTDENT ******/
+
+#outdentButton {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/outdent.png");
+}
+
+#outdentButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/outdent-disabled.png");
+}
+
+/****** DD ******/
+
+#ddButton {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/dd.png");
+}
+
+#ddButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/dd-disabled.png");
+}
+
+/****** DT ******/
+
+#dtButton {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/dt.png");
+}
+
+#dtButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/dt-disabled.png");
+}
+
+/****** CODE ******/
+
+#codeButton{
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/code.png");
+}
+
+#codeButton[disabled="true"] {
+  list-style-image: url("chrome://bluegriffon/skin/formatToolbar/code-disabled.png");
+}
diff --git a/themes/win/classic/formatToolbar/Thumbs.db b/themes/win/classic/formatToolbar/Thumbs.db
new file mode 100644 (file)
index 0000000..6e12cc7
Binary files /dev/null and b/themes/win/classic/formatToolbar/Thumbs.db differ
diff --git a/themes/win/classic/formatToolbar/align-center-disabled.png b/themes/win/classic/formatToolbar/align-center-disabled.png
new file mode 100644 (file)
index 0000000..f4b26b4
Binary files /dev/null and b/themes/win/classic/formatToolbar/align-center-disabled.png differ
diff --git a/themes/win/classic/formatToolbar/align-center.png b/themes/win/classic/formatToolbar/align-center.png
new file mode 100644 (file)
index 0000000..5b38170
Binary files /dev/null and b/themes/win/classic/formatToolbar/align-center.png differ
diff --git a/themes/win/classic/formatToolbar/align-justify-disabled.png b/themes/win/classic/formatToolbar/align-justify-disabled.png
new file mode 100644 (file)
index 0000000..e9eaac3
Binary files /dev/null and b/themes/win/classic/formatToolbar/align-justify-disabled.png differ
diff --git a/themes/win/classic/formatToolbar/align-justify.png b/themes/win/classic/formatToolbar/align-justify.png
new file mode 100644 (file)
index 0000000..75e707c
Binary files /dev/null and b/themes/win/classic/formatToolbar/align-justify.png differ
diff --git a/themes/win/classic/formatToolbar/align-left-disabled.png b/themes/win/classic/formatToolbar/align-left-disabled.png
new file mode 100644 (file)
index 0000000..76f01cc
Binary files /dev/null and b/themes/win/classic/formatToolbar/align-left-disabled.png differ
diff --git a/themes/win/classic/formatToolbar/align-left.png b/themes/win/classic/formatToolbar/align-left.png
new file mode 100644 (file)
index 0000000..0407f13
Binary files /dev/null and b/themes/win/classic/formatToolbar/align-left.png differ
diff --git a/themes/win/classic/formatToolbar/align-right-disabled.png b/themes/win/classic/formatToolbar/align-right-disabled.png
new file mode 100644 (file)
index 0000000..539a449
Binary files /dev/null and b/themes/win/classic/formatToolbar/align-right-disabled.png differ
diff --git a/themes/win/classic/formatToolbar/align-right.png b/themes/win/classic/formatToolbar/align-right.png
new file mode 100644 (file)
index 0000000..fd9e11d
Binary files /dev/null and b/themes/win/classic/formatToolbar/align-right.png differ
diff --git a/themes/win/classic/formatToolbar/bold-disabled.png b/themes/win/classic/formatToolbar/bold-disabled.png
new file mode 100644 (file)
index 0000000..51f9f4c
Binary files /dev/null and b/themes/win/classic/formatToolbar/bold-disabled.png differ
diff --git a/themes/win/classic/formatToolbar/bold.png b/themes/win/classic/formatToolbar/bold.png
new file mode 100644 (file)
index 0000000..0055e12
Binary files /dev/null and b/themes/win/classic/formatToolbar/bold.png differ
diff --git a/themes/win/classic/formatToolbar/code-disabled.png b/themes/win/classic/formatToolbar/code-disabled.png
new file mode 100644 (file)
index 0000000..2f25d35
Binary files /dev/null and b/themes/win/classic/formatToolbar/code-disabled.png differ
diff --git a/themes/win/classic/formatToolbar/code.png b/themes/win/classic/formatToolbar/code.png
new file mode 100644 (file)
index 0000000..648fd8c
Binary files /dev/null and b/themes/win/classic/formatToolbar/code.png differ
diff --git a/themes/win/classic/formatToolbar/dd-disabled.gif b/themes/win/classic/formatToolbar/dd-disabled.gif
new file mode 100644 (file)
index 0000000..efb748f
Binary files /dev/null and b/themes/win/classic/formatToolbar/dd-disabled.gif differ
diff --git a/themes/win/classic/formatToolbar/dd-disabled.png b/themes/win/classic/formatToolbar/dd-disabled.png
new file mode 100644 (file)
index 0000000..9a61808
Binary files /dev/null and b/themes/win/classic/formatToolbar/dd-disabled.png differ
diff --git a/themes/win/classic/formatToolbar/dd.gif b/themes/win/classic/formatToolbar/dd.gif
new file mode 100644 (file)
index 0000000..c27f18b
Binary files /dev/null and b/themes/win/classic/formatToolbar/dd.gif differ
diff --git a/themes/win/classic/formatToolbar/dd.png b/themes/win/classic/formatToolbar/dd.png
new file mode 100644 (file)
index 0000000..993af5f
Binary files /dev/null and b/themes/win/classic/formatToolbar/dd.png differ
diff --git a/themes/win/classic/formatToolbar/dt-disabled.gif b/themes/win/classic/formatToolbar/dt-disabled.gif
new file mode 100644 (file)
index 0000000..7224d7e
Binary files /dev/null and b/themes/win/classic/formatToolbar/dt-disabled.gif differ
diff --git a/themes/win/classic/formatToolbar/dt-disabled.png b/themes/win/classic/formatToolbar/dt-disabled.png
new file mode 100644 (file)
index 0000000..480adb5
Binary files /dev/null and b/themes/win/classic/formatToolbar/dt-disabled.png differ
diff --git a/themes/win/classic/formatToolbar/dt.gif b/themes/win/classic/formatToolbar/dt.gif
new file mode 100644 (file)
index 0000000..eef8bff
Binary files /dev/null and b/themes/win/classic/formatToolbar/dt.gif differ
diff --git a/themes/win/classic/formatToolbar/dt.png b/themes/win/classic/formatToolbar/dt.png
new file mode 100644 (file)
index 0000000..cacc860
Binary files /dev/null and b/themes/win/classic/formatToolbar/dt.png differ
diff --git a/themes/win/classic/formatToolbar/em-disabled.png b/themes/win/classic/formatToolbar/em-disabled.png
new file mode 100644 (file)
index 0000000..aeadcc2
Binary files /dev/null and b/themes/win/classic/formatToolbar/em-disabled.png differ
diff --git a/themes/win/classic/formatToolbar/em.png b/themes/win/classic/formatToolbar/em.png
new file mode 100644 (file)
index 0000000..8ca7553
Binary files /dev/null and b/themes/win/classic/formatToolbar/em.png differ
diff --git a/themes/win/classic/formatToolbar/indent-disabled.png b/themes/win/classic/formatToolbar/indent-disabled.png
new file mode 100644 (file)
index 0000000..36c7c58
Binary files /dev/null and b/themes/win/classic/formatToolbar/indent-disabled.png differ
diff --git a/themes/win/classic/formatToolbar/indent.png b/themes/win/classic/formatToolbar/indent.png
new file mode 100644 (file)
index 0000000..0ac95ec
Binary files /dev/null and b/themes/win/classic/formatToolbar/indent.png differ
diff --git a/themes/win/classic/formatToolbar/italic-disabled.png b/themes/win/classic/formatToolbar/italic-disabled.png
new file mode 100644 (file)
index 0000000..6b7101b
Binary files /dev/null and b/themes/win/classic/formatToolbar/italic-disabled.png differ
diff --git a/themes/win/classic/formatToolbar/italic.png b/themes/win/classic/formatToolbar/italic.png
new file mode 100644 (file)
index 0000000..9c8f95b
Binary files /dev/null and b/themes/win/classic/formatToolbar/italic.png differ
diff --git a/themes/win/classic/formatToolbar/ol-disabled.png b/themes/win/classic/formatToolbar/ol-disabled.png
new file mode 100644 (file)
index 0000000..9256811
Binary files /dev/null and b/themes/win/classic/formatToolbar/ol-disabled.png differ
diff --git a/themes/win/classic/formatToolbar/ol.png b/themes/win/classic/formatToolbar/ol.png
new file mode 100644 (file)
index 0000000..3696025
Binary files /dev/null and b/themes/win/classic/formatToolbar/ol.png differ
diff --git a/themes/win/classic/formatToolbar/outdent-disabled.png b/themes/win/classic/formatToolbar/outdent-disabled.png
new file mode 100644 (file)
index 0000000..69614d5
Binary files /dev/null and b/themes/win/classic/formatToolbar/outdent-disabled.png differ
diff --git a/themes/win/classic/formatToolbar/outdent.png b/themes/win/classic/formatToolbar/outdent.png
new file mode 100644 (file)
index 0000000..185ab47
Binary files /dev/null and b/themes/win/classic/formatToolbar/outdent.png differ
diff --git a/themes/win/classic/formatToolbar/strong-disabled.png b/themes/win/classic/formatToolbar/strong-disabled.png
new file mode 100644 (file)
index 0000000..af141ca
Binary files /dev/null and b/themes/win/classic/formatToolbar/strong-disabled.png differ
diff --git a/themes/win/classic/formatToolbar/strong.png b/themes/win/classic/formatToolbar/strong.png
new file mode 100644 (file)
index 0000000..43e7acc
Binary files /dev/null and b/themes/win/classic/formatToolbar/strong.png differ
diff --git a/themes/win/classic/formatToolbar/ul-disabled.png b/themes/win/classic/formatToolbar/ul-disabled.png
new file mode 100644 (file)
index 0000000..ea959de
Binary files /dev/null and b/themes/win/classic/formatToolbar/ul-disabled.png differ
diff --git a/themes/win/classic/formatToolbar/ul.png b/themes/win/classic/formatToolbar/ul.png
new file mode 100644 (file)
index 0000000..93f8c21
Binary files /dev/null and b/themes/win/classic/formatToolbar/ul.png differ
diff --git a/themes/win/classic/formatToolbar/underline-disabled.png b/themes/win/classic/formatToolbar/underline-disabled.png
new file mode 100644 (file)
index 0000000..48ead25
Binary files /dev/null and b/themes/win/classic/formatToolbar/underline-disabled.png differ
diff --git a/themes/win/classic/formatToolbar/underline.png b/themes/win/classic/formatToolbar/underline.png
new file mode 100644 (file)
index 0000000..6bba7bd
Binary files /dev/null and b/themes/win/classic/formatToolbar/underline.png differ
diff --git a/themes/win/classic/icons/Thumbs.db b/themes/win/classic/icons/Thumbs.db
new file mode 100644 (file)
index 0000000..d451c82
Binary files /dev/null and b/themes/win/classic/icons/Thumbs.db differ
diff --git a/themes/win/classic/icons/bold-disabled.png b/themes/win/classic/icons/bold-disabled.png
new file mode 100644 (file)
index 0000000..8168c74
Binary files /dev/null and b/themes/win/classic/icons/bold-disabled.png differ
diff --git a/themes/win/classic/icons/bold-hover.png b/themes/win/classic/icons/bold-hover.png
new file mode 100644 (file)
index 0000000..25137c3
Binary files /dev/null and b/themes/win/classic/icons/bold-hover.png differ
diff --git a/themes/win/classic/icons/bold.png b/themes/win/classic/icons/bold.png
new file mode 100644 (file)
index 0000000..a70f809
Binary files /dev/null and b/themes/win/classic/icons/bold.png differ
diff --git a/themes/win/classic/icons/btn3.png b/themes/win/classic/icons/btn3.png
new file mode 100644 (file)
index 0000000..e7e8133
Binary files /dev/null and b/themes/win/classic/icons/btn3.png differ
diff --git a/themes/win/classic/icons/close-button.png b/themes/win/classic/icons/close-button.png
new file mode 100644 (file)
index 0000000..c7aed27
Binary files /dev/null and b/themes/win/classic/icons/close-button.png differ
diff --git a/themes/win/classic/icons/filePicking-hover.png b/themes/win/classic/icons/filePicking-hover.png
new file mode 100644 (file)
index 0000000..0e73e72
Binary files /dev/null and b/themes/win/classic/icons/filePicking-hover.png differ
diff --git a/themes/win/classic/icons/filePicking.png b/themes/win/classic/icons/filePicking.png
new file mode 100644 (file)
index 0000000..ec4b1bd
Binary files /dev/null and b/themes/win/classic/icons/filePicking.png differ
diff --git a/themes/win/classic/icons/information-disabled.png b/themes/win/classic/icons/information-disabled.png
new file mode 100644 (file)
index 0000000..b98a868
Binary files /dev/null and b/themes/win/classic/icons/information-disabled.png differ
diff --git a/themes/win/classic/icons/information-hover.png b/themes/win/classic/icons/information-hover.png
new file mode 100644 (file)
index 0000000..32ad65f
Binary files /dev/null and b/themes/win/classic/icons/information-hover.png differ
diff --git a/themes/win/classic/icons/information.png b/themes/win/classic/icons/information.png
new file mode 100644 (file)
index 0000000..f30135c
Binary files /dev/null and b/themes/win/classic/icons/information.png differ
diff --git a/themes/win/classic/icons/loading.gif b/themes/win/classic/icons/loading.gif
new file mode 100644 (file)
index 0000000..c91e58e
Binary files /dev/null and b/themes/win/classic/icons/loading.gif differ
diff --git a/themes/win/classic/icons/modified.gif b/themes/win/classic/icons/modified.gif
new file mode 100644 (file)
index 0000000..d09fdd2
Binary files /dev/null and b/themes/win/classic/icons/modified.gif differ
diff --git a/themes/win/classic/icons/new.png b/themes/win/classic/icons/new.png
new file mode 100644 (file)
index 0000000..b7f1ad6
Binary files /dev/null and b/themes/win/classic/icons/new.png differ
diff --git a/themes/win/classic/icons/newstop.png b/themes/win/classic/icons/newstop.png
new file mode 100644 (file)
index 0000000..7e76996
Binary files /dev/null and b/themes/win/classic/icons/newstop.png differ
diff --git a/themes/win/classic/icons/open.png b/themes/win/classic/icons/open.png
new file mode 100644 (file)
index 0000000..296c255
Binary files /dev/null and b/themes/win/classic/icons/open.png differ
diff --git a/themes/win/classic/icons/stop.png b/themes/win/classic/icons/stop.png
new file mode 100644 (file)
index 0000000..5e25255
Binary files /dev/null and b/themes/win/classic/icons/stop.png differ
diff --git a/themes/win/classic/icons/twistyClosed.png b/themes/win/classic/icons/twistyClosed.png
new file mode 100644 (file)
index 0000000..f80319b
Binary files /dev/null and b/themes/win/classic/icons/twistyClosed.png differ
diff --git a/themes/win/classic/icons/twistyOpen.png b/themes/win/classic/icons/twistyOpen.png
new file mode 100644 (file)
index 0000000..8680124
Binary files /dev/null and b/themes/win/classic/icons/twistyOpen.png differ
diff --git a/themes/win/classic/insertTable.css b/themes/win/classic/insertTable.css
new file mode 100644 (file)
index 0000000..2af2c12
--- /dev/null
@@ -0,0 +1,35 @@
+*#sizeSelector label {
+  width: 2em;
+  margin: 0px ! important;
+}
+
+*#sizeSelector:not([disabled]) label:hover,
+*#sizeSelector label.selected {
+  background-color: rgb(10,36,106) ! important;
+}
+
+*#sizeSelector[disabled] label.selected {
+  background-color: silver ! important;
+}
+
+*#sizeSelector label {
+  border: 2px ridge !important;
+}
+
+*#sizeSelector[disabled] label {
+  border: silver 2px ridge !important;
+}
+
+#widthPixelOrPercentMenulist {
+  min-width: 10em;
+}
+
+tabbox textbox {
+  max-width: 5em;
+}
+
+.spinbuttons-button {
+  min-height: 8px ! important;
+}
+
+
diff --git a/themes/win/classic/languages.css b/themes/win/classic/languages.css
new file mode 100644 (file)
index 0000000..c00a17f
--- /dev/null
@@ -0,0 +1,3 @@
+#currentLanguageBox {
+  font-weight: bold;
+}
diff --git a/themes/win/classic/layouts/full1.png b/themes/win/classic/layouts/full1.png
new file mode 100755 (executable)
index 0000000..15728d1
Binary files /dev/null and b/themes/win/classic/layouts/full1.png differ
diff --git a/themes/win/classic/layouts/full10.png b/themes/win/classic/layouts/full10.png
new file mode 100755 (executable)
index 0000000..e7400ee
Binary files /dev/null and b/themes/win/classic/layouts/full10.png differ
diff --git a/themes/win/classic/layouts/full11.png b/themes/win/classic/layouts/full11.png
new file mode 100755 (executable)
index 0000000..07595d5
Binary files /dev/null and b/themes/win/classic/layouts/full11.png differ
diff --git a/themes/win/classic/layouts/full12.png b/themes/win/classic/layouts/full12.png
new file mode 100755 (executable)
index 0000000..2a43327
Binary files /dev/null and b/themes/win/classic/layouts/full12.png differ
diff --git a/themes/win/classic/layouts/full13.png b/themes/win/classic/layouts/full13.png
new file mode 100755 (executable)
index 0000000..41fd832
Binary files /dev/null and b/themes/win/classic/layouts/full13.png differ
diff --git a/themes/win/classic/layouts/full14.png b/themes/win/classic/layouts/full14.png
new file mode 100755 (executable)
index 0000000..d009af9
Binary files /dev/null and b/themes/win/classic/layouts/full14.png differ
diff --git a/themes/win/classic/layouts/full15.png b/themes/win/classic/layouts/full15.png
new file mode 100755 (executable)
index 0000000..3e6e6e3
Binary files /dev/null and b/themes/win/classic/layouts/full15.png differ
diff --git a/themes/win/classic/layouts/full16.png b/themes/win/classic/layouts/full16.png
new file mode 100755 (executable)
index 0000000..3ac7ab2
Binary files /dev/null and b/themes/win/classic/layouts/full16.png differ
diff --git a/themes/win/classic/layouts/full17.png b/themes/win/classic/layouts/full17.png
new file mode 100755 (executable)
index 0000000..e86cc4b
Binary files /dev/null and b/themes/win/classic/layouts/full17.png differ
diff --git a/themes/win/classic/layouts/full18.png b/themes/win/classic/layouts/full18.png
new file mode 100755 (executable)
index 0000000..74917e2
Binary files /dev/null and b/themes/win/classic/layouts/full18.png differ
diff --git a/themes/win/classic/layouts/full19.png b/themes/win/classic/layouts/full19.png
new file mode 100755 (executable)
index 0000000..e276933
Binary files /dev/null and b/themes/win/classic/layouts/full19.png differ
diff --git a/themes/win/classic/layouts/full2.png b/themes/win/classic/layouts/full2.png
new file mode 100755 (executable)
index 0000000..c627b40
Binary files /dev/null and b/themes/win/classic/layouts/full2.png differ
diff --git a/themes/win/classic/layouts/full20.png b/themes/win/classic/layouts/full20.png
new file mode 100755 (executable)
index 0000000..082f54d
Binary files /dev/null and b/themes/win/classic/layouts/full20.png differ
diff --git a/themes/win/classic/layouts/full21.png b/themes/win/classic/layouts/full21.png
new file mode 100755 (executable)
index 0000000..f7346e3
Binary files /dev/null and b/themes/win/classic/layouts/full21.png differ
diff --git a/themes/win/classic/layouts/full22.png b/themes/win/classic/layouts/full22.png
new file mode 100644 (file)
index 0000000..48ed39e
Binary files /dev/null and b/themes/win/classic/layouts/full22.png differ
diff --git a/themes/win/classic/layouts/full23.png b/themes/win/classic/layouts/full23.png
new file mode 100644 (file)
index 0000000..b896217
Binary files /dev/null and b/themes/win/classic/layouts/full23.png differ
diff --git a/themes/win/classic/layouts/full24.png b/themes/win/classic/layouts/full24.png
new file mode 100644 (file)
index 0000000..5acce38
Binary files /dev/null and b/themes/win/classic/layouts/full24.png differ
diff --git a/themes/win/classic/layouts/full25.png b/themes/win/classic/layouts/full25.png
new file mode 100644 (file)
index 0000000..81d26da
Binary files /dev/null and b/themes/win/classic/layouts/full25.png differ
diff --git a/themes/win/classic/layouts/full26.png b/themes/win/classic/layouts/full26.png
new file mode 100644 (file)
index 0000000..97b0079
Binary files /dev/null and b/themes/win/classic/layouts/full26.png differ
diff --git a/themes/win/classic/layouts/full27.png b/themes/win/classic/layouts/full27.png
new file mode 100644 (file)
index 0000000..9910f55
Binary files /dev/null and b/themes/win/classic/layouts/full27.png differ
diff --git a/themes/win/classic/layouts/full28.png b/themes/win/classic/layouts/full28.png
new file mode 100644 (file)
index 0000000..8ab6021
Binary files /dev/null and b/themes/win/classic/layouts/full28.png differ
diff --git a/themes/win/classic/layouts/full29.png b/themes/win/classic/layouts/full29.png
new file mode 100644 (file)
index 0000000..4e39d5b
Binary files /dev/null and b/themes/win/classic/layouts/full29.png differ
diff --git a/themes/win/classic/layouts/full3.png b/themes/win/classic/layouts/full3.png
new file mode 100755 (executable)
index 0000000..85fc86b
Binary files /dev/null and b/themes/win/classic/layouts/full3.png differ
diff --git a/themes/win/classic/layouts/full30.png b/themes/win/classic/layouts/full30.png
new file mode 100644 (file)
index 0000000..a3023ca
Binary files /dev/null and b/themes/win/classic/layouts/full30.png differ
diff --git a/themes/win/classic/layouts/full31.png b/themes/win/classic/layouts/full31.png
new file mode 100644 (file)
index 0000000..f7e1bba
Binary files /dev/null and b/themes/win/classic/layouts/full31.png differ
diff --git a/themes/win/classic/layouts/full32.png b/themes/win/classic/layouts/full32.png
new file mode 100644 (file)
index 0000000..7b0ff9f
Binary files /dev/null and b/themes/win/classic/layouts/full32.png differ
diff --git a/themes/win/classic/layouts/full33.png b/themes/win/classic/layouts/full33.png
new file mode 100644 (file)
index 0000000..9b04da9
Binary files /dev/null and b/themes/win/classic/layouts/full33.png differ
diff --git a/themes/win/classic/layouts/full34.png b/themes/win/classic/layouts/full34.png
new file mode 100644 (file)
index 0000000..18a89b1
Binary files /dev/null and b/themes/win/classic/layouts/full34.png differ
diff --git a/themes/win/classic/layouts/full35.png b/themes/win/classic/layouts/full35.png
new file mode 100644 (file)
index 0000000..cc9dbd3
Binary files /dev/null and b/themes/win/classic/layouts/full35.png differ
diff --git a/themes/win/classic/layouts/full36.png b/themes/win/classic/layouts/full36.png
new file mode 100644 (file)
index 0000000..a393319
Binary files /dev/null and b/themes/win/classic/layouts/full36.png differ
diff --git a/themes/win/classic/layouts/full37.png b/themes/win/classic/layouts/full37.png
new file mode 100644 (file)
index 0000000..cb43684
Binary files /dev/null and b/themes/win/classic/layouts/full37.png differ
diff --git a/themes/win/classic/layouts/full38.png b/themes/win/classic/layouts/full38.png
new file mode 100644 (file)
index 0000000..fcdcde5
Binary files /dev/null and b/themes/win/classic/layouts/full38.png differ
diff --git a/themes/win/classic/layouts/full39.png b/themes/win/classic/layouts/full39.png
new file mode 100644 (file)
index 0000000..03183a9
Binary files /dev/null and b/themes/win/classic/layouts/full39.png differ
diff --git a/themes/win/classic/layouts/full4.png b/themes/win/classic/layouts/full4.png
new file mode 100755 (executable)
index 0000000..62f5408
Binary files /dev/null and b/themes/win/classic/layouts/full4.png differ
diff --git a/themes/win/classic/layouts/full40.png b/themes/win/classic/layouts/full40.png
new file mode 100644 (file)
index 0000000..eac06e7
Binary files /dev/null and b/themes/win/classic/layouts/full40.png differ
diff --git a/themes/win/classic/layouts/full41.png b/themes/win/classic/layouts/full41.png
new file mode 100644 (file)
index 0000000..428f3e6
Binary files /dev/null and b/themes/win/classic/layouts/full41.png differ
diff --git a/themes/win/classic/layouts/full42.png b/themes/win/classic/layouts/full42.png
new file mode 100644 (file)
index 0000000..57ec43f
Binary files /dev/null and b/themes/win/classic/layouts/full42.png differ
diff --git a/themes/win/classic/layouts/full5.png b/themes/win/classic/layouts/full5.png
new file mode 100755 (executable)
index 0000000..b31389c
Binary files /dev/null and b/themes/win/classic/layouts/full5.png differ
diff --git a/themes/win/classic/layouts/full6.png b/themes/win/classic/layouts/full6.png
new file mode 100755 (executable)
index 0000000..abc3068
Binary files /dev/null and b/themes/win/classic/layouts/full6.png differ
diff --git a/themes/win/classic/layouts/full7.png b/themes/win/classic/layouts/full7.png
new file mode 100755 (executable)
index 0000000..08348a4
Binary files /dev/null and b/themes/win/classic/layouts/full7.png differ
diff --git a/themes/win/classic/layouts/full8.png b/themes/win/classic/layouts/full8.png
new file mode 100755 (executable)
index 0000000..26fa9aa
Binary files /dev/null and b/themes/win/classic/layouts/full8.png differ
diff --git a/themes/win/classic/layouts/full9.png b/themes/win/classic/layouts/full9.png
new file mode 100755 (executable)
index 0000000..a393187
Binary files /dev/null and b/themes/win/classic/layouts/full9.png differ
diff --git a/themes/win/classic/layouts/layouts.mn b/themes/win/classic/layouts/layouts.mn
new file mode 100644 (file)
index 0000000..6cda203
--- /dev/null
@@ -0,0 +1,42 @@
+skin/classic/bluegriffon/layouts/full1.png  (skin/classic/bluegriffon/layouts/full1.png)
+skin/classic/bluegriffon/layouts/full10.png  (skin/classic/bluegriffon/layouts/full10.png)
+skin/classic/bluegriffon/layouts/full11.png  (skin/classic/bluegriffon/layouts/full11.png)
+skin/classic/bluegriffon/layouts/full12.png  (skin/classic/bluegriffon/layouts/full12.png)
+skin/classic/bluegriffon/layouts/full13.png  (skin/classic/bluegriffon/layouts/full13.png)
+skin/classic/bluegriffon/layouts/full14.png  (skin/classic/bluegriffon/layouts/full14.png)
+skin/classic/bluegriffon/layouts/full15.png  (skin/classic/bluegriffon/layouts/full15.png)
+skin/classic/bluegriffon/layouts/full16.png  (skin/classic/bluegriffon/layouts/full16.png)
+skin/classic/bluegriffon/layouts/full17.png  (skin/classic/bluegriffon/layouts/full17.png)
+skin/classic/bluegriffon/layouts/full18.png  (skin/classic/bluegriffon/layouts/full18.png)
+skin/classic/bluegriffon/layouts/full19.png  (skin/classic/bluegriffon/layouts/full19.png)
+skin/classic/bluegriffon/layouts/full2.png  (skin/classic/bluegriffon/layouts/full2.png)
+skin/classic/bluegriffon/layouts/full20.png  (skin/classic/bluegriffon/layouts/full20.png)
+skin/classic/bluegriffon/layouts/full21.png  (skin/classic/bluegriffon/layouts/full21.png)
+skin/classic/bluegriffon/layouts/full22.png  (skin/classic/bluegriffon/layouts/full22.png)
+skin/classic/bluegriffon/layouts/full23.png  (skin/classic/bluegriffon/layouts/full23.png)
+skin/classic/bluegriffon/layouts/full24.png  (skin/classic/bluegriffon/layouts/full24.png)
+skin/classic/bluegriffon/layouts/full25.png  (skin/classic/bluegriffon/layouts/full25.png)
+skin/classic/bluegriffon/layouts/full26.png  (skin/classic/bluegriffon/layouts/full26.png)
+skin/classic/bluegriffon/layouts/full27.png  (skin/classic/bluegriffon/layouts/full27.png)
+skin/classic/bluegriffon/layouts/full28.png  (skin/classic/bluegriffon/layouts/full28.png)
+skin/classic/bluegriffon/layouts/full29.png  (skin/classic/bluegriffon/layouts/full29.png)
+skin/classic/bluegriffon/layouts/full3.png  (skin/classic/bluegriffon/layouts/full3.png)
+skin/classic/bluegriffon/layouts/full30.png  (skin/classic/bluegriffon/layouts/full30.png)
+skin/classic/bluegriffon/layouts/full31.png  (skin/classic/bluegriffon/layouts/full31.png)
+skin/classic/bluegriffon/layouts/full32.png  (skin/classic/bluegriffon/layouts/full32.png)
+skin/classic/bluegriffon/layouts/full33.png  (skin/classic/bluegriffon/layouts/full33.png)
+skin/classic/bluegriffon/layouts/full34.png  (skin/classic/bluegriffon/layouts/full34.png)
+skin/classic/bluegriffon/layouts/full35.png  (skin/classic/bluegriffon/layouts/full35.png)
+skin/classic/bluegriffon/layouts/full36.png  (skin/classic/bluegriffon/layouts/full36.png)
+skin/classic/bluegriffon/layouts/full37.png  (skin/classic/bluegriffon/layouts/full37.png)
+skin/classic/bluegriffon/layouts/full38.png  (skin/classic/bluegriffon/layouts/full38.png)
+skin/classic/bluegriffon/layouts/full39.png  (skin/classic/bluegriffon/layouts/full39.png)
+skin/classic/bluegriffon/layouts/full4.png  (skin/classic/bluegriffon/layouts/full4.png)
+skin/classic/bluegriffon/layouts/full40.png  (skin/classic/bluegriffon/layouts/full40.png)
+skin/classic/bluegriffon/layouts/full41.png  (skin/classic/bluegriffon/layouts/full41.png)
+skin/classic/bluegriffon/layouts/full42.png  (skin/classic/bluegriffon/layouts/full42.png)
+skin/classic/bluegriffon/layouts/full5.png  (skin/classic/bluegriffon/layouts/full5.png)
+skin/classic/bluegriffon/layouts/full6.png  (skin/classic/bluegriffon/layouts/full6.png)
+skin/classic/bluegriffon/layouts/full7.png  (skin/classic/bluegriffon/layouts/full7.png)
+skin/classic/bluegriffon/layouts/full8.png  (skin/classic/bluegriffon/layouts/full8.png)
+skin/classic/bluegriffon/layouts/full9.png  (skin/classic/bluegriffon/layouts/full9.png)
diff --git a/themes/win/classic/listboxBg.css b/themes/win/classic/listboxBg.css
new file mode 100644 (file)
index 0000000..5dbf17f
--- /dev/null
@@ -0,0 +1,97 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+hbox.listboxBg {
+       max-height: 21px;
+       background-image: url("chrome://bluegriffon/skin/listboxBg.png");
+       border-left: thin solid silver;
+       border-right: thin solid silver;
+       border-bottom: thin solid silver;
+       margin: 0px;
+}
+
+hbox.listboxBg toolbarbutton {
+       -moz-box-orient: horizontal;
+       max-height: 21px;
+       min-height: 21px;
+       padding: 0px 3px; margin: 0px;
+       border-right: thin solid silver;
+       font-weight: bold;
+}
+
+hbox.listboxBg toolbarbutton:not([disabled]):active:hover {
+       background-image: url("chrome://bluegriffon/skin/listboxBgActive.png");
+}
+
+listbox.listboxBg {
+       margin: 0px;
+}
+
+hbox.listboxBg .toolbarbutton-menu-dropmarker,
+hbox.listboxBg .toolbarbutton-text {
+       display: none;
+}
+
+hbox.listboxBg .toolbarbutton-icon {
+       margin: 0px 3px;
+}
+
+hbox.listboxBg .listboxBgPlusButton {
+       list-style-image: url("chrome://bluegriffon/skin/plus.png")
+}
+
+hbox.listboxBg .listboxBgPlusButton[disabled] {
+       list-style-image: url("chrome://bluegriffon/skin/plus-disabled.png")
+}
+
+hbox.listboxBg .listboxBgMinusButton {
+       list-style-image: url("chrome://bluegriffon/skin/minus.png")
+}
+
+hbox.listboxBg .listboxBgMinusButton[disabled] {
+       list-style-image: url("chrome://bluegriffon/skin/minus-disabled.png")
+}
+
+hbox.listboxBg .listboxBgConfigButton {
+       list-style-image: url("chrome://bluegriffon/skin/config.png")
+}
+
+hbox.listboxBg .listboxBgConfigButton[disabled] {
+       list-style-image: url("chrome://bluegriffon/skin/config-disabled.png")
+}
+
+
diff --git a/themes/win/classic/listboxBg.png b/themes/win/classic/listboxBg.png
new file mode 100644 (file)
index 0000000..91698ec
Binary files /dev/null and b/themes/win/classic/listboxBg.png differ
diff --git a/themes/win/classic/listboxBgActive.png b/themes/win/classic/listboxBgActive.png
new file mode 100644 (file)
index 0000000..ee37d79
Binary files /dev/null and b/themes/win/classic/listboxBgActive.png differ
diff --git a/themes/win/classic/mainToolbar.css b/themes/win/classic/mainToolbar.css
new file mode 100644 (file)
index 0000000..8a8cc25
--- /dev/null
@@ -0,0 +1,116 @@
+
+#MainToolbar {
+  padding: 4px;
+}
+
+#MainToolbar toolbarbutton,
+#CustomizeToolbarWindow toolbarbutton,
+#CustomizeToolbarSheet toolbarbutton {
+  -moz-image-region: rect(0px 32px 32px 0px);
+  -moz-box-orient: vertical;
+}
+
+#MainToolbar .toolbarbutton-icon {
+  margin: 2px;
+}
+
+#MainToolbar .toolbarbutton-text {
+  padding-bottom: 4px;
+}
+
+#MainToolbar[mode="icons"] .toolbarbutton-text {
+  display: none;
+}
+
+#MainToolbar[mode="text"] .toolbarbutton-icon,
+#MainToolbar[mode="text"] #composer-throbber {
+  display: none;
+}
+
+#MainToolbar[mode="text"] .toolbarbutton-text {
+  padding: 4px;
+}
+
+#MainToolbar toolbarbutton:hover,
+#MainToolbar toolbarbutton:hover:active {
+  -moz-image-region: rect(32px 32px 64px 0px);
+}
+
+#MainToolbar toolbarbutton[disabled="true"]
+{
+  -moz-image-region: rect(64px 32px 96px 0px);
+}
+
+#newButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/new.png");
+}
+
+#openButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/open.png");
+}
+
+#stopButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/stop.png");
+}
+
+#tableButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/table.png");
+}
+
+#saveButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/save.png");
+}
+
+/************ SMALL ICONS **************/
+
+#MainToolbar[iconsize="small"] toolbarbutton {
+  -moz-image-region: rect(0px 24px 24px 0px);
+}
+
+#MainToolbar[iconsize="small"] toolbarbutton:hover,
+#MainToolbar[iconsize="small"] toolbarbutton:hover:active {
+  -moz-image-region: rect(24px 24px 48px 0px);
+}
+
+#MainToolbar[iconsize="small"] toolbarbutton[disabled="true"]
+{
+  -moz-image-region: rect(48px 24px 72px 0px);
+}
+
+#MainToolbar[iconsize="small"] #newButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/small/new.png");
+}
+
+#MainToolbar[iconsize="small"] #openButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/small/open.png");
+}
+
+#MainToolbar[iconsize="small"] #stopButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/small/stop.png");
+}
+
+#MainToolbar[iconsize="small"] #tableButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/small/table.png");
+}
+
+#MainToolbar[iconsize="small"] #saveButton {
+  list-style-image: url("chrome://bluegriffon/skin/mainToolbar/small/save.png");
+}
+
+/***************** THROBBER **************/
+
+#composer-throbber {
+  list-style-image: url('chrome://bluegriffon/skin/mainToolbar/logo.png');
+}
+
+#composer-throbber:hover {
+  list-style-image: url('chrome://bluegriffon/skin/mainToolbar/logo-hover.png');
+}
+
+#MainToolbar[iconsize="small"] #composer-throbber {
+  list-style-image: url('chrome://bluegriffon/skin/mainToolbar/small/logo.png');
+}
+
+#MainToolbar[iconsize="small"] #composer-throbber:hover {
+  list-style-image: url('chrome://bluegriffon/skin/mainToolbar/small/logo-hover.png');
+}
diff --git a/themes/win/classic/mainToolbar/anchor.png b/themes/win/classic/mainToolbar/anchor.png
new file mode 100644 (file)
index 0000000..0eb0362
Binary files /dev/null and b/themes/win/classic/mainToolbar/anchor.png differ
diff --git a/themes/win/classic/mainToolbar/browser.png b/themes/win/classic/mainToolbar/browser.png
new file mode 100644 (file)
index 0000000..3a3cc0d
Binary files /dev/null and b/themes/win/classic/mainToolbar/browser.png differ
diff --git a/themes/win/classic/mainToolbar/copy.png b/themes/win/classic/mainToolbar/copy.png
new file mode 100644 (file)
index 0000000..2c6d738
Binary files /dev/null and b/themes/win/classic/mainToolbar/copy.png differ
diff --git a/themes/win/classic/mainToolbar/cut.png b/themes/win/classic/mainToolbar/cut.png
new file mode 100644 (file)
index 0000000..a890382
Binary files /dev/null and b/themes/win/classic/mainToolbar/cut.png differ
diff --git a/themes/win/classic/mainToolbar/find.png b/themes/win/classic/mainToolbar/find.png
new file mode 100644 (file)
index 0000000..f8c0c81
Binary files /dev/null and b/themes/win/classic/mainToolbar/find.png differ
diff --git a/themes/win/classic/mainToolbar/form.png b/themes/win/classic/mainToolbar/form.png
new file mode 100644 (file)
index 0000000..88754dc
Binary files /dev/null and b/themes/win/classic/mainToolbar/form.png differ
diff --git a/themes/win/classic/mainToolbar/hline.png b/themes/win/classic/mainToolbar/hline.png
new file mode 100644 (file)
index 0000000..f85339a
Binary files /dev/null and b/themes/win/classic/mainToolbar/hline.png differ
diff --git a/themes/win/classic/mainToolbar/image.png b/themes/win/classic/mainToolbar/image.png
new file mode 100644 (file)
index 0000000..b9a0f4d
Binary files /dev/null and b/themes/win/classic/mainToolbar/image.png differ
diff --git a/themes/win/classic/mainToolbar/link.png b/themes/win/classic/mainToolbar/link.png
new file mode 100644 (file)
index 0000000..cfdeef4
Binary files /dev/null and b/themes/win/classic/mainToolbar/link.png differ
diff --git a/themes/win/classic/mainToolbar/logo-hover.png b/themes/win/classic/mainToolbar/logo-hover.png
new file mode 100644 (file)
index 0000000..f600d60
Binary files /dev/null and b/themes/win/classic/mainToolbar/logo-hover.png differ
diff --git a/themes/win/classic/mainToolbar/logo.png b/themes/win/classic/mainToolbar/logo.png
new file mode 100644 (file)
index 0000000..f27ac8d
Binary files /dev/null and b/themes/win/classic/mainToolbar/logo.png differ
diff --git a/themes/win/classic/mainToolbar/new.png b/themes/win/classic/mainToolbar/new.png
new file mode 100644 (file)
index 0000000..b7f1ad6
Binary files /dev/null and b/themes/win/classic/mainToolbar/new.png differ
diff --git a/themes/win/classic/mainToolbar/open.png b/themes/win/classic/mainToolbar/open.png
new file mode 100644 (file)
index 0000000..296c255
Binary files /dev/null and b/themes/win/classic/mainToolbar/open.png differ
diff --git a/themes/win/classic/mainToolbar/paste.png b/themes/win/classic/mainToolbar/paste.png
new file mode 100644 (file)
index 0000000..989e092
Binary files /dev/null and b/themes/win/classic/mainToolbar/paste.png differ
diff --git a/themes/win/classic/mainToolbar/preview.png b/themes/win/classic/mainToolbar/preview.png
new file mode 100644 (file)
index 0000000..6f9c1ae
Binary files /dev/null and b/themes/win/classic/mainToolbar/preview.png differ
diff --git a/themes/win/classic/mainToolbar/print.png b/themes/win/classic/mainToolbar/print.png
new file mode 100644 (file)
index 0000000..aa79b65
Binary files /dev/null and b/themes/win/classic/mainToolbar/print.png differ
diff --git a/themes/win/classic/mainToolbar/publish.png b/themes/win/classic/mainToolbar/publish.png
new file mode 100644 (file)
index 0000000..cd801a7
Binary files /dev/null and b/themes/win/classic/mainToolbar/publish.png differ
diff --git a/themes/win/classic/mainToolbar/save.png b/themes/win/classic/mainToolbar/save.png
new file mode 100644 (file)
index 0000000..f4ee142
Binary files /dev/null and b/themes/win/classic/mainToolbar/save.png differ
diff --git a/themes/win/classic/mainToolbar/small/anchor.png b/themes/win/classic/mainToolbar/small/anchor.png
new file mode 100644 (file)
index 0000000..a69a48a
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/anchor.png differ
diff --git a/themes/win/classic/mainToolbar/small/browser.png b/themes/win/classic/mainToolbar/small/browser.png
new file mode 100644 (file)
index 0000000..153dac4
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/browser.png differ
diff --git a/themes/win/classic/mainToolbar/small/copy.png b/themes/win/classic/mainToolbar/small/copy.png
new file mode 100644 (file)
index 0000000..0fc44ea
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/copy.png differ
diff --git a/themes/win/classic/mainToolbar/small/cut.png b/themes/win/classic/mainToolbar/small/cut.png
new file mode 100644 (file)
index 0000000..a078392
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/cut.png differ
diff --git a/themes/win/classic/mainToolbar/small/find.png b/themes/win/classic/mainToolbar/small/find.png
new file mode 100644 (file)
index 0000000..768bb6c
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/find.png differ
diff --git a/themes/win/classic/mainToolbar/small/form.png b/themes/win/classic/mainToolbar/small/form.png
new file mode 100644 (file)
index 0000000..9fa9153
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/form.png differ
diff --git a/themes/win/classic/mainToolbar/small/hline.png b/themes/win/classic/mainToolbar/small/hline.png
new file mode 100644 (file)
index 0000000..5446577
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/hline.png differ
diff --git a/themes/win/classic/mainToolbar/small/image.png b/themes/win/classic/mainToolbar/small/image.png
new file mode 100644 (file)
index 0000000..1a43169
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/image.png differ
diff --git a/themes/win/classic/mainToolbar/small/link.png b/themes/win/classic/mainToolbar/small/link.png
new file mode 100644 (file)
index 0000000..7674d6c
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/link.png differ
diff --git a/themes/win/classic/mainToolbar/small/logo-hover.png b/themes/win/classic/mainToolbar/small/logo-hover.png
new file mode 100644 (file)
index 0000000..544b108
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/logo-hover.png differ
diff --git a/themes/win/classic/mainToolbar/small/logo.png b/themes/win/classic/mainToolbar/small/logo.png
new file mode 100644 (file)
index 0000000..f5c6d78
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/logo.png differ
diff --git a/themes/win/classic/mainToolbar/small/new.png b/themes/win/classic/mainToolbar/small/new.png
new file mode 100644 (file)
index 0000000..ab8aec3
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/new.png differ
diff --git a/themes/win/classic/mainToolbar/small/open.png b/themes/win/classic/mainToolbar/small/open.png
new file mode 100644 (file)
index 0000000..26a00bc
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/open.png differ
diff --git a/themes/win/classic/mainToolbar/small/paste.png b/themes/win/classic/mainToolbar/small/paste.png
new file mode 100644 (file)
index 0000000..68abca7
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/paste.png differ
diff --git a/themes/win/classic/mainToolbar/small/preview.png b/themes/win/classic/mainToolbar/small/preview.png
new file mode 100644 (file)
index 0000000..ad9d548
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/preview.png differ
diff --git a/themes/win/classic/mainToolbar/small/print.png b/themes/win/classic/mainToolbar/small/print.png
new file mode 100644 (file)
index 0000000..00b67e5
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/print.png differ
diff --git a/themes/win/classic/mainToolbar/small/publish.png b/themes/win/classic/mainToolbar/small/publish.png
new file mode 100644 (file)
index 0000000..2b77d7b
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/publish.png differ
diff --git a/themes/win/classic/mainToolbar/small/save.png b/themes/win/classic/mainToolbar/small/save.png
new file mode 100644 (file)
index 0000000..0950806
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/save.png differ
diff --git a/themes/win/classic/mainToolbar/small/spell.png b/themes/win/classic/mainToolbar/small/spell.png
new file mode 100644 (file)
index 0000000..6aa8f3a
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/spell.png differ
diff --git a/themes/win/classic/mainToolbar/small/stop.png b/themes/win/classic/mainToolbar/small/stop.png
new file mode 100644 (file)
index 0000000..aaec508
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/stop.png differ
diff --git a/themes/win/classic/mainToolbar/small/table.png b/themes/win/classic/mainToolbar/small/table.png
new file mode 100644 (file)
index 0000000..2778f82
Binary files /dev/null and b/themes/win/classic/mainToolbar/small/table.png differ
diff --git a/themes/win/classic/mainToolbar/spell.png b/themes/win/classic/mainToolbar/spell.png
new file mode 100644 (file)
index 0000000..660d132
Binary files /dev/null and b/themes/win/classic/mainToolbar/spell.png differ
diff --git a/themes/win/classic/mainToolbar/stop.png b/themes/win/classic/mainToolbar/stop.png
new file mode 100644 (file)
index 0000000..5e25255
Binary files /dev/null and b/themes/win/classic/mainToolbar/stop.png differ
diff --git a/themes/win/classic/mainToolbar/table.png b/themes/win/classic/mainToolbar/table.png
new file mode 100644 (file)
index 0000000..69d8fd2
Binary files /dev/null and b/themes/win/classic/mainToolbar/table.png differ
diff --git a/themes/win/classic/minus-disabled.png b/themes/win/classic/minus-disabled.png
new file mode 100644 (file)
index 0000000..ccc0290
Binary files /dev/null and b/themes/win/classic/minus-disabled.png differ
diff --git a/themes/win/classic/minus.png b/themes/win/classic/minus.png
new file mode 100644 (file)
index 0000000..5285a5f
Binary files /dev/null and b/themes/win/classic/minus.png differ
diff --git a/themes/win/classic/newPageWizard.css b/themes/win/classic/newPageWizard.css
new file mode 100644 (file)
index 0000000..e0d1433
--- /dev/null
@@ -0,0 +1,79 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#pagePreview {
+       background-color: white;
+       border: thin ridge silver;
+       margin-left: 1em;
+}
+
+.larger {
+       font-size: larger;
+}
+
+filepickerbutton {
+  -moz-binding: url('chrome://bluegriffon/content/bindings/filepickerbutton.xml#filepickerbutton');
+}
+
+#backgroundPositionBox {
+  width: 99px;
+       height: 99px;
+       background-image: url('chrome://bluegriffon/skin/backgroundPosition.png');
+       background-position: 50% 50%;
+       background-color: transparent;
+       -moz-appearance: none;}
+
+#backgroundImageBox {
+  width: 99px;
+       height: 99px;
+       background-image: url('chrome://bluegriffon/skin/backgroundImage.png');
+       background-repeat: no-repeat;
+  background-color: white;
+       background-position: 50% 50%;
+}
+
+stack {
+       border: 1px ridge #888;
+}
+
+#LayoutRows row {
+       border: 2px groove #d0d0d0;
+}
+
+ecolorpicker {
+       -moz-binding: url("chrome://bluegriffon/content/bindings/ecolorpicker.xml#ecolorpicker");
+}
diff --git a/themes/win/classic/pageProperties.css b/themes/win/classic/pageProperties.css
new file mode 100644 (file)
index 0000000..13afbfe
--- /dev/null
@@ -0,0 +1,36 @@
+filepickerbutton {
+  -moz-binding: url('chrome://bluegriffon/content/bindings/filepickerbutton.xml#filepickerbutton');
+}
+
+#removeBackground {
+  list-style-image: url("chrome://bluegriffon/skin/icons/close-button.png");
+  -moz-image-region: rect(0px 16px 16px 0px);
+  padding: 0px;
+  min-width: 0px;
+  margin: 0px;
+}
+
+#pagePreview {
+  margin: 2px 4px;
+  margin-left: 1em;
+  border: 2px solid;
+  -moz-border-top-colors: ThreeDShadow ThreeDDarkShadow;
+  -moz-border-right-colors: ThreeDHighlight ThreeDLightShadow;
+  -moz-border-bottom-colors: ThreeDHighlight ThreeDLightShadow;
+  -moz-border-left-colors: ThreeDShadow ThreeDDarkShadow;
+}
+
+.larger {
+  font-size: larger;
+}
+
+/*.colorpicker-button-colorbox[disabled="true"] {
+ border-color: GrayText;
+ background-color: transparent ! important;
+}*/
+
+#removeBackground .toolbarbutton-icon {
+  min-width: 0px;
+  padding: 0px;
+  margin: 2px ! important;
+}
diff --git a/themes/win/classic/plus-disabled.png b/themes/win/classic/plus-disabled.png
new file mode 100644 (file)
index 0000000..2716015
Binary files /dev/null and b/themes/win/classic/plus-disabled.png differ
diff --git a/themes/win/classic/plus.png b/themes/win/classic/plus.png
new file mode 100644 (file)
index 0000000..42d410f
Binary files /dev/null and b/themes/win/classic/plus.png differ
diff --git a/themes/win/classic/rulers.css b/themes/win/classic/rulers.css
new file mode 100644 (file)
index 0000000..e5b086b
--- /dev/null
@@ -0,0 +1,43 @@
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+@namespace svg url("http://www.w3.org/2000/svg");
+
+svg|text {
+  stroke-width: 4px;
+  font-family: -moz-fixed;
+  font-variant: normal;
+  line-height: normal;
+  font-size: small ! important;
+  dominant-baseline: middle;
+  text-anchor: middle;
+  color: white;
+}
+
+hruler[disabled], vruler[disabled]  { display: none;}
+hruler, vruler      { display: -moz-box;
+                     background-color: transparent;
+                   }
+
+hruler {
+  stroke-width: 4px;
+  font-family: -moz-fixed;
+  font-style: bold;
+  font-variant: normal;
+  line-height: normal;
+  font-size: x-small;
+  height: 16px;
+  width: 100%;
+  margin: 2px 0px;
+  position: absolute;
+}
+vruler {
+  stroke-width: 4px;
+  font-family: -moz-fixed;
+  font-style: bold;
+  font-variant: normal;
+  line-height: normal;
+  font-size: x-small;
+  width: 16px;
+  margin: 0px 2px;
+  /*position: absolute;*/
+}
+
diff --git a/themes/win/classic/sidebar.css b/themes/win/classic/sidebar.css
new file mode 100644 (file)
index 0000000..315c2a5
--- /dev/null
@@ -0,0 +1,79 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+label {
+}
+
+.titlebox {
+  padding-left: 0.5em;
+  font-size: smaller;
+       border-bottom: thin groove black;
+}
+
+.sidebar-closebutton > .toolbarbutton-icon {
+  -moz-margin-end: 0px !important;
+  -moz-padding-end: 2px !important;
+  -moz-padding-start: 2px !important;
+}
+
+.sidebar-closebutton {
+  list-style-image: url("chrome://global/skin/icons/close.png");
+  -moz-appearance: none;
+  -moz-image-region: rect(0px, 14px, 14px, 0px);
+  padding: 4px 2px;
+  border: none !important;
+}
+
+.sidebar-closebutton:hover {
+  -moz-image-region: rect(0px, 28px, 14px, 14px);
+}
+
+.sidebar-closebutton:hover:active {
+  -moz-image-region: rect(0px, 42px, 14px, 28px);
+}
+
+/*.sidebar-morebutton {
+  border: thin groove;
+  -moz-border-radius: 3px;
+  -moz-margin-end: 4px;
+}*/
+
+.sidebar-morebutton > .toolbarbutton-menu-dropmarker {
+  -moz-margin-start: 2px;
+}
diff --git a/themes/win/classic/sidebarcontent.css b/themes/win/classic/sidebarcontent.css
new file mode 100644 (file)
index 0000000..4d08e1e
--- /dev/null
@@ -0,0 +1,69 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+.sidebarcontent-name {
+  font-weight: bold;
+}
+
+label {
+  font-size: smaller;
+}
+
+.titlebox {
+  padding-left: 1em;
+  background-color: #A0A0A0;
+}
+
+.sidebar-arrowbutton {
+  border: thin groove;
+  -moz-border-radius: 3px;
+  -moz-margin-end: 4px;
+}
+
+.sidebar-arrowbutton > .toolbarbutton-menu-dropmarker {
+  -moz-margin-start: 2px;
+}
+
+hbox[anonid="titlebox"]:-moz-drag-over {
+  /*border-top: 3px black solid;*/
+}
+
+label[anonid="name"] {
+  cursor: move ! important;
+}
diff --git a/themes/win/classic/standaloneSidebar.css b/themes/win/classic/standaloneSidebar.css
new file mode 100644 (file)
index 0000000..394c9ac
--- /dev/null
@@ -0,0 +1,47 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+#mainMenu {
+  font-size: smaller;
+  background-color: #A0A0A0;
+}
+
+.toolbarbutton-menu-dropmarker {
+  -moz-margin-start: 2px;
+}
diff --git a/themes/win/classic/structurebar.css b/themes/win/classic/structurebar.css
new file mode 100644 (file)
index 0000000..4a2751d
--- /dev/null
@@ -0,0 +1,40 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+.selected {
+  font-weight: bold;
+}
diff --git a/themes/win/classic/tab-active-bkgnd.png b/themes/win/classic/tab-active-bkgnd.png
new file mode 100644 (file)
index 0000000..6030278
Binary files /dev/null and b/themes/win/classic/tab-active-bkgnd.png differ
diff --git a/themes/win/classic/tab-bkgnd.png b/themes/win/classic/tab-bkgnd.png
new file mode 100644 (file)
index 0000000..34cbf61
Binary files /dev/null and b/themes/win/classic/tab-bkgnd.png differ
diff --git a/themes/win/classic/tab-hover-bkgnd.png b/themes/win/classic/tab-hover-bkgnd.png
new file mode 100644 (file)
index 0000000..75d2fba
Binary files /dev/null and b/themes/win/classic/tab-hover-bkgnd.png differ
diff --git a/themes/win/classic/tabeditor-tabs-bkgnd.png b/themes/win/classic/tabeditor-tabs-bkgnd.png
new file mode 100644 (file)
index 0000000..eb8e901
Binary files /dev/null and b/themes/win/classic/tabeditor-tabs-bkgnd.png differ
diff --git a/themes/win/classic/tabeditor.css b/themes/win/classic/tabeditor.css
new file mode 100644 (file)
index 0000000..c38527e
--- /dev/null
@@ -0,0 +1,125 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is BlueGriffon.
+ *
+ * The Initial Developer of the Original Code is
+ * Disruptive Innovations SARL.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Original author
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+/* ::::: tabs ::::: */
+/* Tabstrip */
+.tabeditor-tabs {
+  -moz-appearance: -moz-win-browsertabbar-toolbox;
+  background: -moz-dialog url("chrome://bluegriffon/skin/tabeditor-tabs-bkgnd.png") repeat-x;
+}
+
+.tabs-container:not([overflow="true"]) {
+  -moz-padding-start: 3px;
+}
+
+/* Tabs */
+.tabeditor-tab {
+  -moz-appearance: none;
+  background: url("chrome://bluegriffon/skin/tab-bkgnd.png") repeat-x;
+  margin: 3px 0px 4px;
+  padding: 0px 1px 1px 0px;
+  border: 2px solid;
+  border-right-width: 1px;
+  border-bottom: none;
+  -moz-border-radius-topleft: 2px;
+  -moz-border-radius-topright: 2px;
+  -moz-border-top-colors: ThreeDShadow rgba(255,255,255,.3);
+  -moz-border-right-colors: rgba(0,0,0,.1);
+  -moz-border-left-colors: ThreeDShadow rgba(255,255,255,.3);
+}
+
+.tabeditor-tab:hover,
+.tabeditor-tab[selected="true"] {
+  border-width: 1px;
+  -moz-border-radius-topleft: 4px;
+  -moz-border-radius-topright: 4px;
+  -moz-border-top-colors: ThreeDShadow;
+  -moz-border-right-colors: ThreeDShadow;
+  -moz-border-left-colors: ThreeDShadow;
+}
+
+.tabeditor-tab:not([selected="true"]):hover {
+  margin: 2px 0px 4px;
+  padding: 2px 1px 1px;
+  background-image: url("chrome://bluegriffon/skin/tab-hover-bkgnd.png");
+}
+
+.tabeditor-tab[selected="true"] {
+  margin: 2px 0px 3px;
+  padding: 1px;
+  background-image: url("chrome://bluegriffon/skin/tab-active-bkgnd.png");
+  background-color: -moz-dialog;
+  font-weight: bold;
+}
+
+.tabeditor-tab[busy] > .tab-icon-image {
+  list-style-image: url("chrome://global/skin/icons/loading_16.png") !important;
+}
+
+.tab-icon-image {
+  margin-top: 1px;
+  -moz-margin-start: 7px;
+  -moz-margin-end: 3px;
+  width: 16px;
+  height: 16px;
+  list-style-image: url("chrome://global/skin/icons/folder-item.png");
+  -moz-image-region: rect(0px, 16px, 16px, 0px);
+}
+
+.tabs-bottom {
+  height: 4px;
+  margin: 0px;
+  background: -moz-dialog url("chrome://bluegriffon/skin/tabstrip-bottom.png") repeat;
+  border-top: 1px solid threedshadow;
+  border-bottom: 1px solid threedshadow;
+}
+
+tabpanels {
+  -moz-appearance: none;
+}
+
+/* tabeditor-tab focus ring */
+.tab-text {
+  border: 1px dotted transparent;
+}
+
+.tabeditor-tab[selected="true"]:focus > .tab-text {
+  border: 1px dotted -moz-DialogText;
+}
+
diff --git a/themes/win/classic/tabstrip-bottom.png b/themes/win/classic/tabstrip-bottom.png
new file mode 100644 (file)
index 0000000..945f42d
Binary files /dev/null and b/themes/win/classic/tabstrip-bottom.png differ
diff --git a/themes/win/jar.mn b/themes/win/jar.mn
new file mode 100644 (file)
index 0000000..39018c5
--- /dev/null
@@ -0,0 +1,132 @@
+bluegriffon.jar:
+% skin    bluegriffon    classic/1.0 %skin/classic/bluegriffon/
+% skin   venkman modern/1.0 jar:venkman.jar!/skin/modern/venkman/
+  skin/classic/bluegriffon/bluegriffon.css  (classic/bluegriffon.css)
+  skin/classic/bluegriffon/bluegriffon.ico  (classic/bluegriffon.ico)
+  skin/classic/bluegriffon/bluegriffonDialogs.css  (classic/bluegriffonDialogs.css)
+  skin/classic/bluegriffon/colourPicker.css  (classic/colourPicker.css)
+  skin/classic/bluegriffon/cssToggler.css  (classic/cssToggler.css)
+  skin/classic/bluegriffon/formatToolbar/align-center-disabled.png  (classic/formatToolbar/align-center-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/align-center.png  (classic/formatToolbar/align-center.png)
+  skin/classic/bluegriffon/formatToolbar/align-justify-disabled.png  (classic/formatToolbar/align-justify-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/align-justify.png  (classic/formatToolbar/align-justify.png)
+  skin/classic/bluegriffon/formatToolbar/align-left-disabled.png  (classic/formatToolbar/align-left-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/align-left.png  (classic/formatToolbar/align-left.png)
+  skin/classic/bluegriffon/formatToolbar/align-right-disabled.png  (classic/formatToolbar/align-right-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/align-right.png  (classic/formatToolbar/align-right.png)
+  skin/classic/bluegriffon/formatToolbar/bold-disabled.png  (classic/formatToolbar/bold-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/bold.png  (classic/formatToolbar/bold.png)
+  skin/classic/bluegriffon/formatToolbar/code-disabled.png  (classic/formatToolbar/code-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/code.png  (classic/formatToolbar/code.png)
+  skin/classic/bluegriffon/formatToolbar/dd-disabled.gif  (classic/formatToolbar/dd-disabled.gif)
+  skin/classic/bluegriffon/formatToolbar/dd-disabled.png  (classic/formatToolbar/dd-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/dd.gif  (classic/formatToolbar/dd.gif)
+  skin/classic/bluegriffon/formatToolbar/dd.png  (classic/formatToolbar/dd.png)
+  skin/classic/bluegriffon/formatToolbar/dt-disabled.gif  (classic/formatToolbar/dt-disabled.gif)
+  skin/classic/bluegriffon/formatToolbar/dt-disabled.png  (classic/formatToolbar/dt-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/dt.gif  (classic/formatToolbar/dt.gif)
+  skin/classic/bluegriffon/formatToolbar/dt.png  (classic/formatToolbar/dt.png)
+  skin/classic/bluegriffon/formatToolbar/em-disabled.png  (classic/formatToolbar/em-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/em.png  (classic/formatToolbar/em.png)
+  skin/classic/bluegriffon/formatToolbar/indent-disabled.png  (classic/formatToolbar/indent-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/indent.png  (classic/formatToolbar/indent.png)
+  skin/classic/bluegriffon/formatToolbar/italic-disabled.png  (classic/formatToolbar/italic-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/italic.png  (classic/formatToolbar/italic.png)
+  skin/classic/bluegriffon/formatToolbar/ol-disabled.png  (classic/formatToolbar/ol-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/ol.png  (classic/formatToolbar/ol.png)
+  skin/classic/bluegriffon/formatToolbar/outdent-disabled.png  (classic/formatToolbar/outdent-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/outdent.png  (classic/formatToolbar/outdent.png)
+  skin/classic/bluegriffon/formatToolbar/strong-disabled.png  (classic/formatToolbar/strong-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/strong.png  (classic/formatToolbar/strong.png)
+  skin/classic/bluegriffon/formatToolbar/ul-disabled.png  (classic/formatToolbar/ul-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/ul.png  (classic/formatToolbar/ul.png)
+  skin/classic/bluegriffon/formatToolbar/underline-disabled.png  (classic/formatToolbar/underline-disabled.png)
+  skin/classic/bluegriffon/formatToolbar/underline.png  (classic/formatToolbar/underline.png)
+  skin/classic/bluegriffon/formatToolbar.css  (classic/formatToolbar.css)
+  skin/classic/bluegriffon/icons/bold-disabled.png  (classic/icons/bold-disabled.png)
+  skin/classic/bluegriffon/icons/bold-hover.png  (classic/icons/bold-hover.png)
+  skin/classic/bluegriffon/icons/bold.png  (classic/icons/bold.png)
+  skin/classic/bluegriffon/icons/btn3.png  (classic/icons/btn3.png)
+  skin/classic/bluegriffon/icons/close-button.png  (classic/icons/close-button.png)
+  skin/classic/bluegriffon/icons/filePicking.png  (classic/icons/filePicking.png)
+  skin/classic/bluegriffon/icons/filePicking-hover.png  (classic/icons/filePicking-hover.png)
+  skin/classic/bluegriffon/icons/information-disabled.png  (classic/icons/information-disabled.png)
+  skin/classic/bluegriffon/icons/information-hover.png  (classic/icons/information-hover.png)
+  skin/classic/bluegriffon/icons/information.png  (classic/icons/information.png)
+  skin/classic/bluegriffon/icons/loading.gif  (classic/icons/loading.gif)
+  skin/classic/bluegriffon/icons/modified.gif  (classic/icons/modified.gif)
+  skin/classic/bluegriffon/icons/new.png  (classic/icons/new.png)
+  skin/classic/bluegriffon/icons/newstop.png  (classic/icons/newstop.png)
+  skin/classic/bluegriffon/icons/open.png  (classic/icons/open.png)
+  skin/classic/bluegriffon/icons/stop.png  (classic/icons/stop.png)
+  skin/classic/bluegriffon/icons/twistyClosed.png  (classic/icons/twistyClosed.png)
+  skin/classic/bluegriffon/icons/twistyOpen.png  (classic/icons/twistyOpen.png)
+  skin/classic/bluegriffon/insertTable.css  (classic/insertTable.css)
+  skin/classic/bluegriffon/languages.css  (classic/languages.css)
+  skin/classic/bluegriffon/backgroundImage.png  (classic/backgroundImage.png)
+  skin/classic/bluegriffon/backgroundPosition.png  (classic/backgroundPosition.png)
+  skin/classic/bluegriffon/mainToolbar/anchor.png  (classic/mainToolbar/anchor.png)
+  skin/classic/bluegriffon/mainToolbar/browser.png  (classic/mainToolbar/browser.png)
+  skin/classic/bluegriffon/mainToolbar/copy.png  (classic/mainToolbar/copy.png)
+  skin/classic/bluegriffon/mainToolbar/cut.png  (classic/mainToolbar/cut.png)
+  skin/classic/bluegriffon/mainToolbar/find.png  (classic/mainToolbar/find.png)
+  skin/classic/bluegriffon/mainToolbar/form.png  (classic/mainToolbar/form.png)
+  skin/classic/bluegriffon/mainToolbar/hline.png  (classic/mainToolbar/hline.png)
+  skin/classic/bluegriffon/mainToolbar/image.png  (classic/mainToolbar/image.png)
+  skin/classic/bluegriffon/mainToolbar/link.png  (classic/mainToolbar/link.png)
+  skin/classic/bluegriffon/mainToolbar/logo-hover.png  (classic/mainToolbar/logo-hover.png)
+  skin/classic/bluegriffon/mainToolbar/logo.png  (classic/mainToolbar/logo.png)
+  skin/classic/bluegriffon/mainToolbar/new.png  (classic/mainToolbar/new.png)
+  skin/classic/bluegriffon/mainToolbar/open.png  (classic/mainToolbar/open.png)
+  skin/classic/bluegriffon/mainToolbar/paste.png  (classic/mainToolbar/paste.png)
+  skin/classic/bluegriffon/mainToolbar/preview.png  (classic/mainToolbar/preview.png)
+  skin/classic/bluegriffon/mainToolbar/print.png  (classic/mainToolbar/print.png)
+  skin/classic/bluegriffon/mainToolbar/publish.png  (classic/mainToolbar/publish.png)
+  skin/classic/bluegriffon/mainToolbar/save.png  (classic/mainToolbar/save.png)
+  skin/classic/bluegriffon/mainToolbar/small/anchor.png  (classic/mainToolbar/small/anchor.png)
+  skin/classic/bluegriffon/mainToolbar/small/browser.png  (classic/mainToolbar/small/browser.png)
+  skin/classic/bluegriffon/mainToolbar/small/copy.png  (classic/mainToolbar/small/copy.png)
+  skin/classic/bluegriffon/mainToolbar/small/cut.png  (classic/mainToolbar/small/cut.png)
+  skin/classic/bluegriffon/mainToolbar/small/find.png  (classic/mainToolbar/small/find.png)
+  skin/classic/bluegriffon/mainToolbar/small/form.png  (classic/mainToolbar/small/form.png)
+  skin/classic/bluegriffon/mainToolbar/small/hline.png  (classic/mainToolbar/small/hline.png)
+  skin/classic/bluegriffon/mainToolbar/small/image.png  (classic/mainToolbar/small/image.png)
+  skin/classic/bluegriffon/mainToolbar/small/link.png  (classic/mainToolbar/small/link.png)
+  skin/classic/bluegriffon/mainToolbar/small/logo-hover.png  (classic/mainToolbar/small/logo-hover.png)
+  skin/classic/bluegriffon/mainToolbar/small/logo.png  (classic/mainToolbar/small/logo.png)
+  skin/classic/bluegriffon/mainToolbar/small/new.png  (classic/mainToolbar/small/new.png)
+  skin/classic/bluegriffon/mainToolbar/small/open.png  (classic/mainToolbar/small/open.png)
+  skin/classic/bluegriffon/mainToolbar/small/paste.png  (classic/mainToolbar/small/paste.png)
+  skin/classic/bluegriffon/mainToolbar/small/preview.png  (classic/mainToolbar/small/preview.png)
+  skin/classic/bluegriffon/mainToolbar/small/print.png  (classic/mainToolbar/small/print.png)
+  skin/classic/bluegriffon/mainToolbar/small/publish.png  (classic/mainToolbar/small/publish.png)
+  skin/classic/bluegriffon/mainToolbar/small/save.png  (classic/mainToolbar/small/save.png)
+  skin/classic/bluegriffon/mainToolbar/small/spell.png  (classic/mainToolbar/small/spell.png)
+  skin/classic/bluegriffon/mainToolbar/small/stop.png  (classic/mainToolbar/small/stop.png)
+  skin/classic/bluegriffon/mainToolbar/small/table.png  (classic/mainToolbar/small/table.png)
+  skin/classic/bluegriffon/mainToolbar/spell.png  (classic/mainToolbar/spell.png)
+  skin/classic/bluegriffon/mainToolbar/stop.png  (classic/mainToolbar/stop.png)
+  skin/classic/bluegriffon/mainToolbar/table.png  (classic/mainToolbar/table.png)
+  skin/classic/bluegriffon/mainToolbar.css  (classic/mainToolbar.css)
+  skin/classic/bluegriffon/newPageWizard.css  (classic/newPageWizard.css)
+  skin/classic/bluegriffon/listboxBg.css  (classic/listboxBg.css)
+  skin/classic/bluegriffon/rulers.css  (classic/rulers.css)
+  skin/classic/bluegriffon/sidebar.css  (classic/sidebar.css)
+  skin/classic/bluegriffon/sidebarcontent.css  (classic/sidebarcontent.css)
+  skin/classic/bluegriffon/standaloneSidebar.css  (classic/standaloneSidebar.css)
+  skin/classic/bluegriffon/structurebar.css  (classic/structurebar.css)
+  skin/classic/bluegriffon/tabeditor.css  (classic/tabeditor.css)
+  skin/classic/bluegriffon/listboxBg.png      (classic/listboxBg.png)
+  skin/classic/bluegriffon/listboxBgActive.png      (classic/listboxBgActive.png)
+  skin/classic/bluegriffon/plus.png      (classic/plus.png)
+  skin/classic/bluegriffon/minus.png      (classic/minus.png)
+  skin/classic/bluegriffon/config.png      (classic/config.png)
+  skin/classic/bluegriffon/plus-disabled.png      (classic/plus-disabled.png)
+  skin/classic/bluegriffon/minus-disabled.png      (classic/minus-disabled.png)
+  skin/classic/bluegriffon/config-disabled.png      (classic/config-disabled.png)
+  skin/classic/bluegriffon/ecolorpicker.css       (classic/ecolorpicker.css)
+  skin/classic/bluegriffon/tab-active-bkgnd.png       (classic/tab-active-bkgnd.png)
+  skin/classic/bluegriffon/tab-bkgnd.png              (classic/tab-bkgnd.png)
+  skin/classic/bluegriffon/tab-hover-bkgnd.png        (classic/tab-hover-bkgnd.png)
+  skin/classic/bluegriffon/tabeditor-tabs-bkgnd.png   (classic/tabeditor-tabs-bkgnd.png)
+  skin/classic/bluegriffon/tabstrip-bottom.png        (classic/tabstrip-bottom.png)