25 October 2008

Reusing Custom Page Styles With @-moz-document

After using the Firefox Stylish add-in to increase the contrast between the text and background colours of domains, I wanted to apply the same rule to different domains. In this case, I want to reuse the text colour of P elements in two or more domains.

Open a Stylish script and note that it has a sequence of @-moz-document definitions, for example:

@-moz-document domain(addons.mozilla.org) {
  p { color : black; }
}

@-moz-document domain(msdn.com) {
  p { color : black; }
}

The @-moz-document rule can accept a comma-separated URL list, so I can re-use my style definition like this:

@-moz-document domain(addons.mozilla.org), domain(msdn.com) {
  p { color : black; }
}

See Also

04 October 2008

NetBeans and WinCVS local repository

On my Vista computer, I have a local CVS repository for version control in this folder: C:\Users\<user>\Documents\Repository. I checked out a module using WinCVS 2.0.2.4 Build 4, so the module's CVSROOT is C:\Users\<user>\Documents\Repository. When I start any CVS operation in NetBeans 6.1, the operation is queued and hangs, or NetBeans reports this error: The pipe has been ended.

If you look into the NetBeans log file, C:\Users\<user>\AppData\Local\Temp\outputN (where N is a number), you can find the following entry: cvs [server aborted]: C:\Users\<user>\Documents\Repository: no such repository.

Here's a workaround using CVSNT 2.0.51d.

First, add a repository name in the CVSNT Service. For me, I use Repository:

  1. Open Windows' Control Panel.
  2. Select the CVS for NT icon. Windows should open the CVSNT applet (in Vista, you have to confirm that you allow this legacy CPL applet to run).
  3. In the Status Service tab, stop CVS Service and CVS Lock Service.
  4. Select the Repositories tab.
  5. Press the Add button to create a new repository name. The Edit Repository dialog should appear.
  6. Set Location: = C:\Users\<user>\Documents\Repository.
  7. Set Name: = /Repository.
  8. Press the OK button save your repository name and close the Edit Repository dialog.
  9. Select the Service Status tab and start the CVS service.
  10. In the Status Service tab, start CVS Service and CVS Lock Service.
  11. Press the OK button to save your settings and close the CVSNT applet.

Second, edit all CVS/ROOT files in your project and replace the folder path with: :local:/Repository.

This entry tells NetBeans to use the :local: protocol to find Repository. However, WinCVS does not understand the :local: protocol, so you can't use WinCVS to maintain your project any more.