You are Here: grep sailormoon * /Sailormoon.org /Site Scheme Development /Scheme Help!
Scheme Help!
file info for fileID 2759 
Scheme Help!
Topic Owner: josh
Topic: Report anything broken with the any schemes here. Note: the white background issue with icons should be fixed. Post any problems you can find with the fix we've implemented.

This topic is also for users that aren't on the scheme making team yet, and are trying to make their first scheme or have general questions about or need of advice for making schemes.

Users are encouraged to help eachother out, as staff may not always have time to respond to questions that don't post an immediate threat to the usability of the website.
Maximum Posts: 50
Greatest Hits: Top 10 posts in this topic
The new scheme system allows for the inclusion of JavaScript into the schemes. I'll briefly look at what can be done using JavaScript to modify things the scheme otherwise wouldn't have access to.

The vt220 scheme at indievisible was designed to be a text-only scheme. The scheme is more of an example and test-bed than something many users would consider using. The intent of the scheme was to demonstrate what can be done, rather than what should be done. But, it provides an interesting example.

The first thing that was necessary in the scheme was to turn off the processing of img tags by the browser, this prevents the images from being requested (and 404's returned) after the first time the css file is processed.

A single line in the scheme's sytle.css file takes care of this:

img { display: none; }

The problem is that this completely removes the images from the page. Which makes many of the links that the images represent invisible.

The new scheme system allows the entire layout to be modified via two files: standard.xml and modal.xml. The standard.xml file controls how the page looks normally, the modal.xml files controls how special-purpose pages (confirmation screens, mostly) look. These are simply XHTML pages with a few additional tags thrown in.

As you can see from those two files, the layout for this scheme is exceedingly simple. Other than some JavaScript it can be put together in a mater of minutes. The <crescent ... tags take care of getting and displaying all the page specific information. The crescent finder takes care of looking through the layout file and filling in those crescent tags with the data they request.

Let's look at the JavaScript, since that is what makes this scheme special. The script contains a single function, crescent_main, that is called by the documents onLoad handler (in JavaScript's use of the term). Pay attention to the XHTML "body" tag to see how to hook a script in.

The first thing the function does is to get a list of 'img' tags in the document. Since we are called after the document is loaded, we can be sure that all the img tags are in place.

function crescent_main() {
var imgs = document.getElementsByTagName('img');

The images are stored in an array named imgs. A "for loop" is used to step through each of these images in the array. You'll note that in the XML file any less-than or greater-than operators must be encoded using the ampersand-lt-semicolon notation to allow Crescent to properly parse the file.

for (i=0; i < imgs.length; i++) {

For each img tag, a span tag is created. Initially these tags are just floating outside the document. We will put them into their place in a moment.

var newSpan = document.createElement('span');

Next, we get the alt tag from the current image and put into a variable named 'alt'. If the alt variable matches a pre-defined list of strings, it is rewritten. This is just to make the text-only screen look a bit closer to how the graphical versions looked.

var alt = imgs[i].alt.toString();
if (alt == "spacer") alt = " ";
if (alt == "levelicon") alt = " ";
if (alt == "delete article") alt = " X ";
if (alt == "file info") alt = " i";
if (alt == "Add to favorites") alt = " +";
if (alt == "Remove from favorites") alt = " -";
if (alt == "expand") alt = ">";
if (alt == "collapse") alt = "^";

Next, the alt variable is turned into text for document and put in the span tag we created earlier.

newSpan.appendChild(document.createTextNode(alt));

The next step is to set the display property of the image to "none." This was taken care of in the css. But I'm repeating it here just to be safe in case the css is modified in the future. Originally I was attempting to delete the entire tag from the document. But, due to the way JavaScript works, this caused the for loop to skip every other image. The alternate solution, replacing the img tag with the new span tag also was buggy in some browsers. This works well, even if it is less than ideal.

imgs[i].style.display = 'none';

The next step is to get the parent node of the img tag. This allows us to put our new span tag in the same place as the img tag. We append our new tag and close the loop and function.

if (imgs[i].parentNode) {
if (imgs[i].parentNode.className) {
newSpan.className = imgs[i].parentNode.className;
}
imgs[i].parentNode.appendChild(newSpan);
}
}
}


The final function looks like this:

function crescent_main() {
var imgs = document.getElementsByTagName('img');

for (i=0; i < imgs.length; i++) {
var newSpan = document.createElement('span');

var alt = imgs[i].alt.toString();
if (alt == "spacer") alt = " ";
if (alt == "levelicon") alt = " ";
if (alt == "delete article") alt = " X ";
if (alt == "file info") alt = " i";
if (alt == "Add to favorites") alt = " +";
if (alt == "Remove from favorites") alt = " -";
if (alt == "expand") alt = ">";
if (alt == "collapse") alt = "^";
newSpan.appendChild(document.createTextNode(alt));

imgs[i].style.display = 'none';
if (imgs[i].parentNode) {
if (imgs[i].parentNode.className) {
newSpan.className = imgs[i].parentNode.className;
}
imgs[i].parentNode.appendChild(newSpan);
}
}
}


Using JavaScript to rewrite the Crescent pages will allow schemes to go beyond simply changing colors and images, and even relocating page elements. The new scheme system will eventually allow for schemes to completely change how users interact with the site. The only limit is browser functionality and scheme maker ability.
signature image
  Cheru : What version of opera are you using, and has the problem gone away yet? There might be an issue with the script we're using to detect your browser. The script should only be going out to MSIE 5.5+ and MSIE 6.0+
  Cheru : Just trying to gather information so I can figure out why it's breaking in your browser. Still not working properly? Do you happen to know if your version of opera reports itself as internet explorer or not?
  Cheru : I think I may have figured it out. Do they work now?
Wow, this is really frustrating. Try again now?
The standard.xml and modal.xml files ONLY work on beta.sailormoon.org right now. If you are using www.sailormoon.org, then they are not used at all. Secondly, if you don't have on then the server will cache the file and any changes you make won't show up for 20 minutes. I also think that no-cache isn't working so that may be a problem too. It worked in my testing, but who knows...

signature image
I think the same person made both schemes.
signature image
I'm not exactly sure why that would make you uneasy. but since it does, I'm sure we can get animanga to remove their scheme since we had ours first. I'm sure they'd understand.
I'm loving myself sick at the moment, and I'm making you sick too. ;D
"I'm not exactly sure why that would make you uneasy. but since it does, I'm sure we can get animanga to remove their scheme since we had ours first. I'm sure they'd understand." Are you sure of that? Because I'm pretty sure the Animanga scheme came first...
It didn't go over-looked. We've known since the day the plastic scheme showed up here that it was similar to AD's default scheme.

It is a user created scheme and not an official one. Since the person who made the scheme is on staff over at AD, I can only assume that they own the copyright on it. If you are "uneasy" about copyright issues, please contact the scheme owner.

I rather like the fact that someone can improve upon the AD scheme so radically by taking advantage of the new scheme system.

I'm pretty sure that the "old scheme system" version in use at AD predates the plastic scheme here. But, contact the owner to find out for sure.
signature image
The Plastic scheme is one of Endy's schemes. Just ask him (sailorcosmos/lemonlime) about it, if there's an issue.
signature image
If, in fact, Josh is the rightful copyright owner on both schemes then there is no issue at all. It's his scheme and he can submit it for use at any number of crescent sites.

If he is not the copyright owner, then whoever that is will need to send Josh a request for him to quit distributing the scheme. We (sailormoon.org) do not claim any copyrights on user created schemes. But, we are given (implicit) permission to use them by the person who submits them.

Since this scheme was actually uploaded to our server that permission is a bit more explicit. Actually, since it was uploaded to our servers as part of the development we can claim that it is a "work for hire" and we own the copyright on it. But, I hate that very idea. I think people who do work should own their work so I will insist that the creator owns the scheme. I pretty much insist that everyone who works on crescent related projects maintain their own copyrights and release the work for all to use under a liberal (BSD/ISC) license.

If there is a concern, please take it to Josh. I'm sure he'll assert that he owns the copyright and is free to distribute the scheme as he sees fit. If another crescent site has an issue with that, then perhaps they should not use a scheme they don't have exclusive rights to.
signature image
Sorry I haven't be very available in the last week or so. I'm taking Japanese finals this week and my sister is visiting me here in Japan so I'm pretty much swamped.

I'm sorry that I wasn't here to put your mind at ease... I was, in fact, the developer of both the Animanga and the Plastic scheme here. The animanga scheme did come first, and then I modified it and wrote a new layout for the scheme here. They are actually nearly the same scheme package. I made all the icons from scratch, so I own the copyright on them. Sorry for the confusion, and I hope that everything is clear now. :-D

PS: I'm glad you like the color scheme! It makes me happy too! ^_^
Josh: I think we should require that all schemes have a LICENSE file in them that details who owns the scheme and how it can be used. If this stink came up over one that obviously was created by the same person (come on, you are on staff at both sites!) then this could be a problem any time the same/similar scheme(s) appears on multiple sites.

The sailormoon.org "classic" and "fancypants" schemes are copyright Jen and may not be used on other sites. The office space scheme is also copyright Jen but we released it under the normal Crescent license so anyone can use it/modify it/whatever.

I'll try to get template licenses up soon. I've got a paper and sermon this week and two papers next week, so it may be a while before I can get to it. I see three license templates:

(1) All Rights reserved, for use on only one site.
(2) All Rights reserved except redistribute/use. Leave the copyright line and notice in tact. Any site can use the scheme but may not modify it (except maybe to suit their configuration, no substance changes). I expect this to be the most used one.
(3) BSD/ISC/Crescent license, Copyright remains with creator, permission to modify, distribute and use granted to everyone. For example schemes or non-specific schemes, like VT220, which I will release under the Crescent license.

For the record, anyone may look at any scheme and reverse-engineer it to get ideas. As long as they don't copy the code looking to see how things are done is always fair game. This is US copyright law. Unless a license file is included, you MUST assume "All rights reserved. Do not redistribute or use without permission." Submitting the scheme for approval is granting use permission, but not redistribution permission (which is fuzzy for a scheme, I know).
signature image
I totally agree on the license idea. If I had any kind of experience with licenses at all other than the basic limitations of various Opensource licenses that are out there...

I definitely want to get that put into my schemes so we can avoid any confusion in the future.
the link to the default scheme zip in the FAQ doesn't work. it gives me a 404 error. sad! where do i find this elusive creature?
signature image omg
double you tea pants
when did this come back?
i can't remember my old username ~ fuzzy
sisterfish, Kitsu and I'll get right on that!
I need to get Josh access to the server... I just need to decide which server. I'm trying, slowly, to get my home server out of the mix as much as possible.
signature image
In the meantime, scot, can I simply email you the blank zip?
spacer
Favorites
File Search
Recent Friends
The following users have been online in the last 10 minutes:
guest  
There have been 1 users in the last 10 minutes.