Stylish 0.2.1 (Now with repository!)

Talk about add-ons and extension development.
Locked
lordmedikit
Posts: 447
Joined: August 1st, 2003, 9:18 am

Post by lordmedikit »

One really nice thing for this extension to do would be to let people create css files like the js ones for greasemonkey and then 'install' them into stylish - is this being taken into consideration?
old np
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old np »

You can already do that. When you select text or open a CSS file, you get a context menu option to add it to Stylish.
lordmedikit
Posts: 447
Joined: August 1st, 2003, 9:18 am

Post by lordmedikit »

OK, I admit I didn't know that, thanks.

What I am really suggesting though is a bit more specific.

In greasemonkey the js files it accepts have to follow this pattern extensionname.user.js

What I'm suggesting for Stylish is that we have filename.content.css which will then make it apply to websites and filename.chrome.css for modifications to the chrome. If a file is opened with either of these extensions then a little bar would pop up (like the popup blocker bar - see how greasemonkey does this) and it would have a button to 'install' the css, otherwise nothing would happen with other css files.

Bad idea?
lordmedikit
Posts: 447
Joined: August 1st, 2003, 9:18 am

Post by lordmedikit »

Just to add to that, basically what I'm suggesting would give people like me a clearer framework for releasing our css files for stylish (imo).
old np
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old np »

Seems like a little much to me. How often do users visit CSS files anyway?

Stylish 0.2 does include a status bar icon and I could make "Add File to Stylish..." show there too to make it more obvious. As for a framework for releasing files, one of the future features I plan is to let comments in a certain format become metadata for the style. For example,

Code: Select all

/* Stylish metadata
    @description Make everything blue
    @author Mr. Bar
*/
* { color: blue;}

would automatically plug the description and author fields, so it could be installed without requiring an extra prompt.
lordmedikit
Posts: 447
Joined: August 1st, 2003, 9:18 am

Post by lordmedikit »

Well basically, it would work the same a greasemonkey so you would give a link to filename.content.css (as an example). The user would then click on the link, firefox would open up the css file as if it were a webpage (try this) and at the top of the file there would be the install bar with the install button so the user would find it easy to know what to do.

Here is a screen of what I mean:

Image

Also included in the screen is nice way to make the right click menu work if you're interested.

It's just a suggestion though (that I think would make it easier for users). What I'm most concerned about is some type of metadata for the file and being able to specify whether it should apply to the chrome or content.

(Sorry about the image dimensions)
old np
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old np »

- Stylish 0.2 will have a similar status bar icon menu.
- The "install bar" will not be a feature in 0.2, but I will consider it for future versions.
- With the current Gecko interfaces, there's no way to specify that a style applies to chrome only or content only. You do have the ability to specify XUL or HTML with CSS namespaces, though, and inserting the default namespace declaration is included in 0.2.
lordmedikit
Posts: 447
Joined: August 1st, 2003, 9:18 am

Post by lordmedikit »

Thank you very much.

I think you're doing a great job :).
Motohiko
Posts: 65
Joined: November 22nd, 2003, 8:05 pm
Location: Japan
Contact:

Post by Motohiko »

Hello. all!

I want to add feature to import user stylesheets (userChrome.css and userContent.css). My proposal is 'Wizard'. These are some screenshots.


I want your opinions:
  • I'm not native English speaker. Please correct wording.
  • Currently in the Wizard, there is no option to specify newly created style name. I think this is not needed because the manager will launch after importing. Is it OK?
  • I don't add launch wizard button or menu in main style manager.
  • If you import one stylesheet 2 times, there will be 2 entries in style manager. Adding to old one is difficult because you can change its name.
  • This uses preference 'extensions.{46551EC9-40F0-4e47-8E18-8E5CF550CFB8}.launchwizard'. I've never heard of the recommended usage of preference keys for extensions. np, do you agree with this or change it to something like 'extensions.stylish.launchwizard'? I don't think preference keys need to be readable. And I think 'extensions.stylish' is unsafe because extension names may confrict.
old np
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old np »

I think it's important to allow the user to split up their current userChrome/userContent entries into many Stylish entries. Just importing the entire file into a single entry is contrary to one of the main features of Stylish - being able to manage each customization individually. I think you should bring up a dialog that contains the text of one of the files, allow the user to select and add the selection as a Stylish entry.
********
Posts: 947
Joined: August 24th, 2005, 12:23 pm

Post by ******** »

i think i'll wait for stylish 0.2.

then i'll definitely import my over-bloated userChrome.css

btw, do userChrome.css and userContent.css still work when Stylish is enabled?

and when is stylish 0.2 going to be released?
old np
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old np »

Yes and Sunday.

Just to be clear - importing user*.css won't be included as a part of 0.2. A whole bunch of other goodies will be, though.
Motohiko
Posts: 65
Joined: November 22nd, 2003, 8:05 pm
Location: Japan
Contact:

Post by Motohiko »

Just a quick note.

Stylish v0.2 beta has a new feature, instant applying. But it seems to be broken with non-ascii characters.
RDF datasources are stored in UTF-8, and if web pages are not written in UTF-8, and non-ascii characters are used in styles (especially content property), broken characters are shown.
Reload the web page, we can get correct result.

I'm trying to make a patch for this, but have trouble with nsIScriptableUnicodeConverter.
UTF-8 to UTF-16 conversion doesn't work (throws NS_ERROR_UNEXPECTED). Converting to other charsets seems to work.
old np
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old np »

Send me the code so we can have two sets of eyes looking at it. Thanks for the help.
Motohiko
Posts: 65
Joined: November 22nd, 2003, 8:05 pm
Location: Japan
Contact:

Post by Motohiko »

OK, I resolve the issue.

Code: Select all

--- content/stylishCommon.js.bak   2005-12-21 13:42:58.000000000 +0900
+++ content/stylishCommon.js   2005-12-31 07:47:30.000000000 +0900
@@ -95,6 +95,7 @@
          stylesheetLink.type = "text/css";
          stylesheetLink.rel = "stylesheet";
          stylesheetLink.href = cssURL;
+         stylesheetLink.charset = "UTF-8";
 
          //we can't use xml processing instructions because then they'd get put into the DOM and some code in the codebase assumes that no processing instructions are in the DOM <https://bugzilla.mozilla.org/show_bug.cgi?id=319654>. so let's use html:link and try to put it in an appropriate place
          var nodeToAppendTo = null;
Locked