User:Drew R. Smith/Sandboxes: Difference between revisions
imported>Drew R. Smith (New page: {{User:Drew R. Smith/Header}} <div style="height: 400px; overflow: auto; padding: 3px; border: 1px solid #aaa;"> {{User:Drew R. Smith/Sandbox}} </div> <div style="height: 400px; overfl...) |
imported>Drew R. Smith No edit summary |
||
Line 1: | Line 1: | ||
{{User:Drew R. Smith/Header}} | {{User:Drew R. Smith/Header}} | ||
==[[User:Drew R. Smith/Sandbox|Sandbox]]== | |||
<div style="height: | <div style="height: 200x200px; overflow: auto; padding: 3px; border: 1px solid #aaa;"> | ||
{{User:Drew R. Smith/Sandbox}} | {{User:Drew R. Smith/Sandbox}} | ||
</div> | </div> | ||
<div style="height: | ==[[User:Drew R. Smith/Sandbox2|Sandbox2]]== | ||
<div style="height: 200x200px; overflow: auto; padding: 3px; border: 1px solid #aaa;"> | |||
{{User:Drew R. Smith/Sandbox2}} | {{User:Drew R. Smith/Sandbox2}} | ||
</div> | </div> | ||
<div style="height: | ==User:Drew R. Smith/Sandbox3|Sandbox3]]== | ||
<div style="height: 200x200px; overflow: auto; padding: 3px; border: 1px solid #aaa;"> | |||
{{User:Drew R. Smith/Sandbox3}} | {{User:Drew R. Smith/Sandbox3}} | ||
</div> | </div> | ||
<div style="height: | ==[[User:Drew R. Smith/Sandbox4|Sandbox4]]== | ||
<div style="height: 200x200px; overflow: auto; padding: 3px; border: 1px solid #aaa;"> | |||
{{User:Drew R. Smith/Sandbox4}} | {{User:Drew R. Smith/Sandbox4}} | ||
</div> | </div> | ||
<div style="height: | ==[[User:Drew R. Smith/Sandbox5|Sandbox5]]== | ||
<div style="height: 200x200px; overflow: auto; padding: 3px; border: 1px solid #aaa;"> | |||
{{User:Drew R. Smith/Sandbox5}} | {{User:Drew R. Smith/Sandbox5}} | ||
</div> | </div> | ||
<div style="height: | ==[[User:Drew R. Smith/Talk Header|Talk Header]]== | ||
<div style="height: 200x200px; overflow: auto; padding: 3px; border: 1px solid #aaa;"> | |||
{{User:Drew R. Smith/Talk Header}} | {{User:Drew R. Smith/Talk Header}} | ||
</div> | </div> | ||
<div style="height: | ==[[User:Drew R. Smith/Hawaii Archive|Talk Page Archive on Hawaii]]== | ||
<div style="height: 200x200px; overflow: auto; padding: 3px; border: 1px solid #aaa;"> | |||
{{User:Drew R. Smith/Hawaii Archive}} | {{User:Drew R. Smith/Hawaii Archive}} | ||
</div> | </div> | ||
<div style="height: | ==[[User:Drew R. Smith/MOSArchive|Talk Page Archive on Manual of Style]]== | ||
<div style="height: 200x200px; overflow: auto; padding: 3px; border: 1px solid #aaa;"> | |||
{{User:Drew R. Smith/MOSArchive}} | {{User:Drew R. Smith/MOSArchive}} | ||
</div> | </div> | ||
<div style="height: | [[User:Drew R. Smith/Templates Archive|Talk Page Archive on Templates]]== | ||
<div style="height: 200x200px; overflow: auto; padding: 3px; border: 1px solid #aaa;"> | |||
{{User:Drew R. Smith/Templates Archive}} | {{User:Drew R. Smith/Templates Archive}} | ||
</div> | </div> | ||
<div style="height: | ==[[User:Drew R. Smith/General Archive|General Talk Page Archive]]== | ||
<div style="height: 200x200px; overflow: auto; padding: 3px; border: 1px solid #aaa;"> | |||
{{User:Drew R. Smith/General Archive}} | {{User:Drew R. Smith/General Archive}} | ||
</div> | </div> | ||
<div style="height: | ==[[User:Drew R. Smith/familytree.js|familytree.js]]== | ||
<div style="height: 200x200px; overflow: auto; padding: 3px; border: 1px solid #aaa;"> | |||
{{User:Drew R. Smith/familytree.js}} | {{User:Drew R. Smith/familytree.js}} | ||
</div> | </div> | ||
<div style="height: | ==[[User:Drew R. Smith/monobook.js|My monobook.js]]== | ||
<div style="height: 200x200px; overflow: auto; padding: 3px; border: 1px solid #aaa;"> | |||
{{User:Drew R. Smith/monobook.js}} | {{User:Drew R. Smith/monobook.js}} | ||
</div> | </div> |
Revision as of 00:56, 7 August 2009
The account of this former contributor was not re-activated after the server upgrade of March 2022.
Sandbox
The account of this former contributor was not re-activated after the server upgrade of March 2022.
Sandbox2
The account of this former contributor was not re-activated after the server upgrade of March 2022.
- REDIRECT Template:Subpage-bottom/NA
User:Drew R. Smith/Sandbox3|Sandbox3]]
The account of this former contributor was not re-activated after the server upgrade of March 2022.
- REDIRECT Template:BotReq/Preloader
Sandbox4
The account of this former contributor was not re-activated after the server upgrade of March 2022.
To make a new page, click here
Sandbox5
The account of this former contributor was not re-activated after the server upgrade of March 2022.
Button 2 |
---|
Text 2 |
Talk Header
The account of this former contributor was not re-activated after the server upgrade of March 2022.
Where Drew lives it is approximately: 06:28
Talk Page Archive on Hawaii
The account of this former contributor was not re-activated after the server upgrade of March 2022.
native Hawaiians
The terms "Hawaiian people" or "people of Hawaii" would seem to encompass the entire group of people who come from Hawaii. If you're writing about native people only, I would avoid those terms. Is there a name that the indigenous people of Hawaii use for themselves (an endonym)? If so, ypu should use that term out of respect for the people you are writing about. Otherwise, I would use "Native Hawaiians" or something like it. --Joe Quick 13:23, 19 June 2009 (UTC)
- Ok, I will move the page. And I don't think there is a name they call themselves (besides locals...), and after going to high school in Hawai`i I probably would have heard it a couple times. No, I think they just call themselves Native Hawai`ians.Drew R. Smith 04:31, 20 June 2009 (UTC)
- Looks like the move went smoothly. Being mainly an anthropology person, this is the type of article that I like to work on. Unfortunately, I don't know much about the Hawaii islands or the people who live there. I'll make sure to contribute to the article if I come across anything significant. --Joe Quick 15:31, 20 June 2009 (UTC)
Hawaiian language
I think you should definitely start an article and I (and others) will certainly have a look at it. I can perhaps make corrections regarding linguistics, but you would otherwise have a lot of freedom with the article because you have some experience of the language. I know very little of the specifics of Hawaiian other than a bit on the phonology. Also, check out Hawaiian Creole (the title is the name linguists use, which I would argue is preferable to the popular 'Hawaiian Pidgin', because HP is not a pidgin). John Stephenson 03:34, 21 June 2009 (UTC)
- Ok, though the title of the Creole article would depend on which creole you are talking about. The old creole was a mix between the Hawaiian language, and some asian languages, and the article would be titled "Hawaiian Creole". The modern creole is actually a mix between the old creole and english, and should be titled "Hawaiian Creole English" with redirects from "Hawaiian Pidgin". Here in Hawaii we just call HCE pidgin though...Drew R. Smith 03:38, 21 June 2009 (UTC)
Hawaiian alphabet
Drew: I use IE 6 as my browser. I know there are later versions ... but I like what I have. In any event, in the second sub-section of Hawaiian alphabet about the letter xOkina, the x does not render as anything but a small square ... which means that it is a character that my browser cannot read. Is there anything you could do about that? Does it render on other browsers? If you can't do anything about it, then so be it. I just thought you might want to know.
As for getting Hawaiian alphabet nominated for approval, I noted in your posting to Larry, that you thought it fit into 2 of our workgroups ... yet its Metadata template only has one category specified, namely Linguistics (added by Howard Berkowitz). It would be helpful if you could add a second valid category because approval nominations must be made Editors in the categories listed in the Metadata template. Adding another valid category means there might be more Editors eligible to nominate your article. (Please note that I said "valid" category.)
Just as background, when I wrote my first few articles, it was over a month before anyone even commented or suggested edits to them ... and it was even longer before someone finally nominated one for approval. So patience is required. As CZ grows, there will be more Editors available.
I hope you find this helpful, Milton Beychok 17:25, 18 June 2009 (UTC)
- I'm not sure what I can do about the character not rendering properly. As outlined in the article, it can be replaced with
'
, or`
, but for the links to work properly I have to use the realʻ
character. Perhaps I can change the links to `Okina. Did that render properly for you? I will wait for your response before making the change.\
- Yes, `Okina renders okay for me. Milton Beychok 17:42, 18 June 2009 (UTC)
- Ok, I'll change it in the article then.Drew R. Smith 17:48, 18 June 2009 (UTC)
- Yes, `Okina renders okay for me. Milton Beychok 17:42, 18 June 2009 (UTC)
- And as for the workgroups, I'm not entirely convinced it belongs in anthropology. True, anthropology has a written language section, but the majority of the workgroup is dedicated to things entirely unrelated.
- There is no doubt in my mind that my article won't be nominated for along time, but I felt it was ready, and wanted to get the ball rolling. I didn't mean to seem impatient.Drew R. Smith 17:32, 18 June 2009 (UTC)
- Also, to answer your question about other browsers; Yes, it renders on all four browsers I use (IE 8, Google Chrome, Firefox, and Opera). On a seperate note, if you ever do decide to upgrade browsers, might I suggest Opera?Drew R. Smith 17:34, 18 June 2009 (UTC)
Ok, I think I changed them all. Could you look over it for me please? It probably sticks out alot more on your browser than it does on mine...Drew R. Smith 17:51, 18 June 2009 (UTC)
I'm still working on it (hawaiian pronunciation). Which browser are you using... the original set-up was atrocious on mine... take careDustin Bowers 05:58, 25 June 2009 (UTC)
- I actually use four of the most commonly used browsers (IE8, Google Chrome, Firefox, and Opera) to make sure my edits look ok. The article was created in IE8 and looked ok in firefox and opera. I did not check google chrome. What browser are you using?Drew R. Smith 06:20, 25 June 2009 (UTC)
- Thats what I'm seeing in IE8...Drew R. Smith 06:23, 25 June 2009 (UTC)
- Ok, thats a little better, but now it just looks like a list. And another thing to note, it looks alright in monobook, nut in pinkwich5, the default skin, the categories appear next to the last table.Drew R. Smith 06:27, 25 June 2009 (UTC)
- I'm using Safari. Some prose around the table would go a long way to reducing the list-itude. We could revitalize the text I deleted for that purpose. Glad we got the ball rolling. Dustin Bowers 07:35, 25 June 2009 (UTC)
- Ok, thats a little better, but now it just looks like a list. And another thing to note, it looks alright in monobook, nut in pinkwich5, the default skin, the categories appear next to the last table.Drew R. Smith 06:27, 25 June 2009 (UTC)
- Thats what I'm seeing in IE8...Drew R. Smith 06:23, 25 June 2009 (UTC)
No worries about ball-dropping. I have been fairly inactive myself. I would be happy to help move this forward. Diphthongs are probably the next target, maybe some fleshing out as needed. Or do you think it is ready now? Dustin Bowers 19:00, 5 August 2009 (UTC)
- Ok, what did you have in mind? If I remember correctly we already have a chart with the diphthongs on it.Drew R. Smith 00:04, 6 August 2009 (UTC)
King K
Righto, Drew, he's on my to-do list for tomorrow - Ro Thorpe 01:46, 6 August 2009 (UTC)
- Ok, thanks. By the way, I haven't heard anyone use "righto" in awhile, and it made me smile. Drew R. Smith 09:43, 6 August 2009 (UTC)
Talk Page Archive on Manual of Style
The account of this former contributor was not re-activated after the server upgrade of March 2022.
Capitalisation Redirects
Drew, you don't need to create redirects for miscapitalisations because searches are case-insensitive. Redirects are only needed for alternative spellings etc, not alternative capitalisations. Caesar Schinas 12:50, 18 June 2009 (UTC)
- Every time I search for an article in caps it takes me to a blank page. I think the first letter is the only one that is case insensitive. Plus, it leaves redlinks whenever it is miscapitalised in articles.Drew R. Smith 13:00, 18 June 2009 (UTC)
- This is true for links like Natural Number, but not if you search for "Natural Number" in the search box at the top of the page. Peter Schmitt 13:15, 18 June 2009 (UTC)
- Odd. A search for Hawaiian Bible, after creation of Hawaiian bible, and before the redirect, gave me a message that no page existed with that name.Drew R. Smith 13:18, 18 June 2009 (UTC)
- If you enter teh name and press "search", it will search for the string you entered, ignoring capitalisation, but it will only show a message at the top saying that a page with the exact title exist if the capitalisation is the same. However, if you enter the name and press "go", it will take you to any page with that name, regardless of capitalisation. Caesar Schinas 13:41, 18 June 2009 (UTC)
- Odd. A search for Hawaiian Bible, after creation of Hawaiian bible, and before the redirect, gave me a message that no page existed with that name.Drew R. Smith 13:18, 18 June 2009 (UTC)
- This is true for links like Natural Number, but not if you search for "Natural Number" in the search box at the top of the page. Peter Schmitt 13:15, 18 June 2009 (UTC)
Categories & Line of succession
Hi Drew, you are contributing here about as long as I. So I am surprised that you do not yet know that categories are used for administrative purpose only. For lists (of kings) /Catalogs subpages to appropriate articles are used. In your case, probably Hawaii/Catalogs/Kings or similar. (See CZ:Categories)
Concerning the "Line of succession" I do not know what CZ policy is. My personal opinion is, that they bloat up a minimum of information that could be given simpler and better in one sentence. Probalbly, in most cases, it need not be given at all: If the corresponding catalog is well-organized and commented an in-text link at an appropriate place (e.g., from "eleventh") would be sufficient and more appropriate.
Peter Schmitt 11:08, 8 August 2009 (UTC)
- I had no idea about the categories. I guess I'll go ahead and tag them with a speedydelete template. Thats a shame though, they're so much easier to use than those catalogue subpages...
- As for the lines of succession, I have always liked having them stand apart from the text. Being able to view all the hawaiian heads of state from Pili to Governorn Linda Lingle is much simpler than having to search the text for a link that may or may not take you where you want to go. Also, the succession box isn't new, nor is it unused. All I did was change it to use the {{box}} template, and make the color customizable. If you go to {{succession box}} and check the "what links here", you can see that many articles already incorporate this.
- I do agree that the succession box is a little bloated, and could stand to be toned down a bit. I'll take a look at it and see what I can do.Drew R. Smith 11:21, 8 August 2009 (UTC)
- I guess that one of the reasons might be that lists should not be merely collected automatically, but be conciously edited and organized by an author (for better value). Maybe someone can tell us more about it?
As far as the succession lines/boxes are concerned, I am curious if and how others will comment them. Peter Schmitt 11:43, 8 August 2009 (UTC)
- I guess that one of the reasons might be that lists should not be merely collected automatically, but be conciously edited and organized by an author (for better value). Maybe someone can tell us more about it?
- I can see the concern with categories. At WP, I've seen articles on one subject end up in categories on a comletely different subject because one of the templates used automatically appends it. In my defense, I was editing and organizing the contents of that category consciously. But again, I can see the issues that could arise, and will stop.
- Again, the succession boxes have been in use long before I got here. I doubt anyone will have much to say, if at all.Drew R. Smith
- On second thought, I'll take a look at the catalog subpage, and see if I can fit the info into that. I do think the successor and predecessor need to be clearly set apart from the text.Drew R. Smith 11:57, 8 August 2009 (UTC)
- Just in case you did not think of this possibility: You can copy the category lists to your sandbox or to a catalog before deleting. And as suggestion, I think, the catalog(s) would best be ordered chronologically or as table (and/or using the r template?). Concerning the succession boxes once more: it was/is just my personal opinion. Peter Schmitt 12:03, 8 August 2009 (UTC)
- I completely agree with you that they should be ordered chronologically. I was going change them as soon as I could figure out how to tweak the DEFAULTSORT: thingy to do what I want. Thanks for the suggestion about copying the lists before deleting them. That gave me the idea of using a blank category (i.e. adding a page to a category, but leaving it blank) so I can get the list without actually creating the category. Then I can just remove the category tags when I'm done with them.
- Concerning the succession boxes once more: I halfway agree with you. ;-) Drew R. Smith 12:10, 8 August 2009 (UTC)
Articles on books...
In response to your question, I don't really collaborate on such articles. Sorry, I just don't have an opinion right now about it. Russell D. Jones 12:53, 19 August 2009 (UTC)
Talk Page Archive on Templates==
The account of this former contributor was not re-activated after the server upgrade of March 2022.
Template:Convert
Hi Drew,
I was just wondering what your eventual intention is for Template:Convert - I see you've been creating a lot of subtemplates for it. How will it eventually work?
Please be sure to document it using {{TlDoc}} once you've finished working on it, including a list of all subtemplates, and then add it to the list at CZ:Templates.
Also, I noticed that you've created a couple of odd pages in different languages, such as Pt:Predefinição:Convert/to(-), which seem to be related to this template - for one thing, we don't have templates (or anything else) in languages other than English at present, and for another, if this page is related to the template it should be in the Template namespace.
I realise you're still working on this, so sorry for coming in in the middle... I'm just interested in what you're doing, as one of the people who currently does most template work/maintenance here.
Thanks! Caesar Schinas 07:10, 13 June 2009 (UTC)
- The template will convert units of measurement from one to the other. Take a look at the article Gobioides broussonnetii to see the markup for using it, and you'll see what I mean. For the most part I am doing a bit of cut and paste from the wikipedia version of the templates. I am intending to change things up, especially as some of the syntax doesn't seem to be taking well here. I didn't notice any similar templates anywhere on CZ, so I figured no one would mind much.Drew R. Smith 07:20, 13 June 2009 (UTC)
- Okay. No, no-one will mind so long as you document the template well, including all subtemplates, add it to CZ:Templates, and clean up after yourself by putting
{{speedydelete|REASON|~~~~}}
on any templates/pages which you created and then eventually don't use. Especially the pages like the Portuguese one I mentioned above. - I also notice that you've copied several other Wikipedia templates - Template:Mbox, Template:Pp-meta, Template:Pp-template, and Template:Documentation (there may be others I haven't noticed...).
- Please bear in mind that we already have our own equivalent of some of these templates such as Template:Documentation, and others quite possibly have no place here - for example we do not use notices which display on the article page itself, other than speedydelete. I'm not sure what Template:Mbox, Template:Pp-meta, and Template:Pp-template, are - but please do look through the templates which we already have before adding more, and consider whether there is a real need for them. In general, we're trying to cut down on the number of templates rather than create more.
- But If you reckon those templates are necessary, by all means go ahead. just be sure to document them well, using {{TlDoc}}.
- Caesar Schinas 07:32, 13 June 2009 (UTC)
- I'm not entirely sure how to do the documentation, but I will figure it out when I'm done with the convert template. The PP templates, and Mbox templates are actually pertaining to page protection, something I don't think we really need here, so I will speedy them when I have completed everything. I didn't realise thats what they were until I was done with it.Drew R. Smith 07:38, 13 June 2009 (UTC)
- The documentation one is neccessary, but since you already have an equivalent, I'll just use that one. Do you now off hand what the name of it is?Drew R. Smith 07:38, 13 June 2009 (UTC)
- Yes, it's {{TlDoc}}. You just put the whole contents of the template in
<noinclude>...</noinclude>
tags, then add<includeonly>{{TlDoc}}</includeonly>
at the end. If you create your new templates using the form at CZ:Templates, this is all done automatically. - Caesar Schinas
- Yes, it's {{TlDoc}}. You just put the whole contents of the template in
- The documentation one is neccessary, but since you already have an equivalent, I'll just use that one. Do you now off hand what the name of it is?Drew R. Smith 07:38, 13 June 2009 (UTC)
- I'm not entirely sure how to do the documentation, but I will figure it out when I'm done with the convert template. The PP templates, and Mbox templates are actually pertaining to page protection, something I don't think we really need here, so I will speedy them when I have completed everything. I didn't realise thats what they were until I was done with it.Drew R. Smith 07:38, 13 June 2009 (UTC)
- Okay. No, no-one will mind so long as you document the template well, including all subtemplates, add it to CZ:Templates, and clean up after yourself by putting
<---Sorry, I was talking about the CZ equivalent of the Template:Documentation that I made.Drew R. Smith 07:45, 13 June 2009 (UTC)
- Well, isn't that it? If not, what is Template:Documentation for? Caesar Schinas 07:49, 13 June 2009 (UTC)
- You know what? I think that is it. Just a fancier version that adds a nice header to the documentation subpage... I'll speedy this one now, so I don't forget...Drew R. Smith 07:56, 13 June 2009 (UTC)
Drew, please see my experiment with the system I was talking about for this at User:Caesar Schinas/Template:Convert. There are a couple of examples of its use at the top of User:Caesar Schinas/sandbox at present. It currently only works for converting some imperial units to some metric ones, but it would be very easy to expand. Caesar Schinas 10:51, 14 June 2009 (UTC)
- Also, another experiment which splits it up into subpages for better maintainability - User:Caesar Schinas/Template:Conv and its subpages, also currently with examples at the top of User:Caesar Schinas/sandbox. Caesar Schinas 14:04, 14 June 2009 (UTC)
Be careful!
Drew, I urge you to be very careful when editing high-use templates such as {{!}} - your edit broke it by introducing a newline after the pipe.
Also, you are creating a vast number of templates which frankly I think are hardly ever going to be used - wouldn't it be better to wait until there is a demand rather than create them just because WP has them? Caesar Schinas 09:59, 13 June 2009 (UTC)
- I understand that I am introducing a high number, however they are all tied together. As for demand, there were already pages that were attempting to use the convert template before I came along.
- The point of the convert template is to simplify life for authors and editors so that instead of having to do the calculations themselves, they can simply use this template to auto convert the units.
- I garuantee I will clean up after myself, and the end result will be that CZ is just a litte bit easier to use. Also, keep in mind that this is a wiki, not paper, so there is no need to worry that I'll "use up all the space".
- I had no idea that I broke the pipe template. All I was trying to do was give the template a documentation so people can know what it is used for. Can you show me exactly what went wrong, and how it should have been done, so I can avoid this kind of problem in the future?Drew R. Smith 10:05, 13 June 2009 (UTC)
- Ok, I looked at the history, and see what you changed to fix it, however I don't understand what difference that makes. Other templates add the noinclude tags on the same line, what makes that one different?Drew R. Smith 10:07, 13 June 2009 (UTC)
- Of course, I realise that you didn't mean to break it... :-) I'm not blaming you at all; we all make mistakes - just saying be very careful on this sort of template. I usually test templates in my sandbox after editing them unless I'm certain that nothing could have gone wrong.
- The problem was that when you added the noinclude tags and TlDoc, you introduced a newline after the pipe character and before the noinclude. I have removed this (and also put the pipe character in includeonly tags so that it doesn't show up on the template page, since there is documentation now. Please see this diff for the change I made to fix it.
- Doh! Now I see it. Wow, that one little thing really screwed up a lot of stuff...Drew R. Smith 10:24, 13 June 2009 (UTC)
- I realise what the convert template is for - I had actually been going to create it myself sometime, but hadn't got round to it yet. I do think that there might be simpler ways of going about it... but since I'm not sure exactly how you're doing it, I'll keep well clear of it until you've finished!
- I don't know what most of the other templates you've created are for - they all have rather cryptic names - but in response to your point that some articles already try to use templates we haven't got; remember that this is othen because those articles are copied from WP. We usually just remove those template calls, unless we think such templates are going to be widely used.
- Anyway, I'll try no to interfere any more until you've finished what you're doing...
- Caesar Schinas 10:16, 13 June 2009 (UTC)
- No no, by all means, if you have concerns, tell me. I'd rather hear them, and possibly save myself some trouble, or better yet save you some trouble, than to "go about my work peacefully". Seriously, lack of constructive criticism was one of the reasons I was looking for something other than wikipedia. They usually have pretty good work, but most users are too into there own projects to give any pointers. Unless you broke something, and then the admins are down your throat.
- Sorry about the rant. Anyway, point being, I want all the feedback I can get. If you bring up a good point as to why I shouldn't make some templates, or why I should scrap the project, or do it another way, I'll listen. Drew R. Smith 10:22, 13 June 2009 (UTC)
(unindent) Alright, well what I had been going to suggest for {{convert}} was to use nested switches within the main template, and perhaps a couple of subpages with unit definitions, rather than subpages for each conversion. I don't know exactly how I'd go about it, but I might play around with this concept in my userspace later (I tend to develop templates in my userspace unless they're reasonably straightforward).
I hope my explanation about {{!}} made sense. If you have any questions please feel free to ask. Caesar Schinas 10:29, 13 June 2009 (UTC)
- I'm not sure what you mean by "nested", but everything else seemes to make sense. I wouldn't really know how to go about that either, which is why I'm just using wikipedia's design (it works for one) and tweak it once I've got it set up.
- As for your explanation of the pipe template, you gave a good explanation, but I had to see the diff before it actually clicked.Drew R. Smith 10:34, 13 June 2009 (UTC)
- By nested switches I mean switches inside other switches, so you might have a switch for the "from" unit and then for each possible value, a switch inside that for the "to" unit. Or something like that. But if you're happy with the way you're doing it - good! Caesar Schinas 10:39, 13 June 2009 (UTC)
- (edit conflict)::Actually, to simplify similar templates down the road, it would be better to leave the switches out in the open. That way other templates that use similar functions can use the same switch, instead of each template having the switch burried inside it somewhere. This also makes it easier to go straight to the problem if something breaks, assuming the person looking for the problem has the syntax knowhow to know what is wrong. If something breaks, and the only repaireman doesn't have a clue, we're screwed with either system! Hopefully this helps.Drew R. Smith 10:41, 13 June 2009 (UTC)
- By nested switches I mean switches inside other switches, so you might have a switch for the "from" unit and then for each possible value, a switch inside that for the "to" unit. Or something like that. But if you're happy with the way you're doing it - good! Caesar Schinas 10:39, 13 June 2009 (UTC)
- Ok, my above post was a little different from what I assumed you meant by nested, but I think it still holds.Drew R. Smith 10:41, 13 June 2009 (UTC)
- Hmmm... I think we're talking about slightly different things. I'm only talking about the actual code which is only used for that template, not stuff which is used in multiple templates. Parts which are used in many templates should, as you say, be in separate templates transcluded onto each template, so long as they will be used in enough different templates to make it worth it. But remember that the more template transclusion going on, the slower the page loads - we already have a bit of a problem with this at CZ due to the way the subpages template works. But don't let me distract you; carry on with your template and then I'll be able to see the final result! :-D Caesar Schinas 10:50, 13 June 2009 (UTC)
Break for ease of use
Actually, I am having a bit of trouble with some of the syntax. Take a look at the page I mentioned again, and you will see this:Template:Rnd/bExpression error: unrecognised word "expression" where a neat little conversion should be. I can't figure out what I did wrong, or if I missed anything. Do you know what causes a message like that?Drew R. Smith 10:55, 13 June 2009 (UTC)
- Well, its caused by an invalid expression in an
{{#expr:...}}
parser function somewhere, but I couldn't say where without studying all of your new templates in depth... which would take a long time! It might be because one of the WP templates you imported relied on another which you haven't imported. This is a problem with WP templates; the tend to be so interdependent that it's hard to copy one without copying loads. I tend to start from scratch rather than copying WP templates directly, though of course I study the WP ones first to see how they work and so forth. - Sorry I can't be more helpful... Caesar Schinas 11:03, 13 June 2009 (UTC)
- I figured as much, which is why I just kept plugging along hoping I would finally hit that magic template that makes the conversion pop into place. Thanks for all the help and advice.Drew R. Smith 11:05, 13 June 2009 (UTC)
I'm finally hitting some of the magic templates. Celsius, and feet work, inches works only in some instances. Its a start!Drew R. Smith 12:03, 13 June 2009 (UTC)
- Ok, I can't go on any longer tongiht. I gotta get some sleep. I'll be back at it tommorow. The following are notes on my progress, and are more for my personal use: I have isolated the problem to a rounding/fraction issue, however the actual problem isn't located in the Template:Rnd series. WP has close to 2000 subpages for the Template:Convert series. I'm going to try to knock out as many of the actual units of measurement conversions so I can find which function templates I missed in the series.
- One other note, I only wanted to make some key conversions, however I can see now that I will have to make every unit right from the start.Drew R. Smith 14:35, 13 June 2009 (UTC)
Conversion of units
Drew, I came to the conclusion quite a while ago that it was more difficult to import WP templates for conversion than just doing the conversions myself. I suggest that you look at these CZ articles I wrote: U.S. customary units and Fahrenheit and Rankine temperatures. For metric units, see SI.
The U.S. and Belize are the only countries that have not converted to the metric system of units. In fact, there are many high school students in other countries who have never heard of the inch, the foot, Fahrenheit temperatures, etc. Milton Beychok 17:57, 13 June 2009 (UTC)
- I'm not too worried about the difficulty in importing it. I'm already at least halfway done, and I really don't mind doing it.
- Im not too sure what the usage of one unit over the other really has to do with it. The U.S. and Belize may be the only ones, but make up a signifcant portion of our readers (US in particular), while the only (native) english speakers who use metric would be England and some other smaller countries. I think having both units would be particularly useful.
- It may be easier to convert it your self than to import the WP conversion templates, but conversions are a repeating phenomina while importing the templates is a singularity. I really dont mind taking on this enormous task when the outcome creates a much easeir to use CZ. I'm also importing all the documentations and instructions on how to use it, so it's not like it won't be used.
- Cheers! Drew R. Smith 02:03, 14 June 2009 (UTC)
-- Answered your message on my talk page. Caesar Schinas 08:11, 14 June 2009 (UTC)
- Please be cautious about inserting conversion templates when, variously, a reference is deliberately approximate, such as "roughly 100 Feet by 100 Feet", or where there may be specialized customary usage, as in many nautical movements. When I "roughly", it was my intention not to go to multiple significant figures. A conversion with two decimal places, "(30.48 metres by 30.48 metres)" simply doesn't fit the situation.
- From sad experience at The Other Place — and I know you haven't done this here — there are places where a customary unit is used in a treaty language (e.g., 200 mile Exclusive Economic Zone), or in a nautical unit such as a nautical mile or a deadweight ton, which has additional constraints that are not expressed in a conversion. A nautical mile maps literally to angular measurement. Howard C. Berkowitz 08:05, 15 June 2009 (UTC)
- All your nautical speak is leaving me horribly lost! However I can change it to show no decimals if that is what is needed. The way it was showing up was a big expression error, so even if the context wasn't quite right I think it still looks better than before.Drew R. Smith 08:10, 15 June 2009 (UTC)
- From sad experience at The Other Place — and I know you haven't done this here — there are places where a customary unit is used in a treaty language (e.g., 200 mile Exclusive Economic Zone), or in a nautical unit such as a nautical mile or a deadweight ton, which has additional constraints that are not expressed in a conversion. A nautical mile maps literally to angular measurement. Howard C. Berkowitz 08:05, 15 June 2009 (UTC)
- Just be cautious when inserting conversion templates into military or nautical text. There may be specific reasons not to convert. A gun caliber may not be just a measurement, but a name. For example, there are articles on various types of 5 inch guns. These are not 127mm guns. In like manner, a 152mm howitzer is not spoken of as a 6 inch. Howard C. Berkowitz 08:24, 15 June 2009 (UTC)
- In like manner, when the text speaks of "approximately" or "generally", and no decimals are used, do not add decimals.
Obviously not for the guns. That would just be silly. I've only been going through and replacing {{convert}} with a template that works. As for the specific instance where the measurement was an aproximation, I will remove the decimals. For future reference, for you or anyone else that reads this, to remove the decimals simply change "precision=x" to "precision=0".Drew R. Smith 08:31, 15 June 2009 (UTC)
- I have fixed the problemDrew R. Smith 08:44, 15 June 2009 (UTC)
- Drew, I've been thinking about this. First, I have never used the {{tl|convert}} template, so, while it's possible someone else substituted it, it was never in something I wrote.
- It didn't look better to me; it wasn't a matter of decimals or not. In the particular example, I spoke of 100 feet square as an approximation. I'd no more metricate an American football field length than I'd express a 1500 meter dash in yards.
- Now, I freely admit I'm sensitive about this subject, to the point that it was one of the reasons that I left WP: people who would metricate as a matter of seeming religion, rather than looking at the way something was used in an article and if there might be reasons for not metricating or metricating in a footnote, using approximations, etc. As you know, guns of a given country may only use one system or the other. Even within a given country, conventions apply: while a .38 Special and a .357 Magnum might seem different diameters, they really are the same; a .357 Magnum revolver can fire both cartridges. Metricating .357 and .38 would lead to confusion.
- In treaties, when only a metric or traditional unit is given, I use the language of the treaty, although I may put the conversion in a footnote. The reality is that people worldwide speak of 12 mile territorial limits and 200 mile Exclusive Economic Zones. There are also reasons why one does not convert traditional nautical units such as nautical miles and knots, because they are part of broader navigational systems that relate to latitude and longitude; those relationships are lost with km unless one also changes the angular measurement.
- As it was pointed out with heat, it may sometimes be worth checking the author before making changes. I would ask that before putting conversion templates into my military and communications articles, you at least ask on the talk page. If there is no reason to stay traditional, I'll be more than happy to change. I think, however, you will find that I fairly commonly metricate, or use both systems, when I believe it to be appropriate. Howard C. Berkowitz 13:09, 18 June 2009 (UTC)
- If you are speaking of RIM 2 Terrier, I did ask you on your talk page, and only made the actual changes in my sandbox. If that isn't what you are talking about, I'm not sure what you are talking about. After our original conversation about the guns, I didn't change any of your articles.Drew R. Smith 13:14, 18 June 2009 (UTC)
- No, COBRA JUDY radar. Howard C. Berkowitz 13:28, 18 June 2009 (UTC)
- Ah, that was part of the original discussion if I recall. Anyway, it was already using {{convert}}, but it was using a parameter from WP that the CZ version doesn't support. That is all I did, is remove that parameter, and when you explained that it was supposed to be a rough conversion, I changed it to reflect that by removing the decimals.Drew R. Smith 13:33, 18 June 2009 (UTC)
- My apologies if I missed the template when I imported from WP; there were other substantial conversions but I may have missed that. In general, I avoid the use of conversion templates, at least in military and engineering, preferring to do appropriate conversions by hand. I can understand your changing a template; I would just ask that templates not be inserted without agreement, as with the Terrier. In the latter case, I'm not sure what problem it solves since I used both metric and American units, although they may well be rounded approximations rather than direct conversions. Howard C. Berkowitz 13:41, 18 June 2009 (UTC)
- There was no problem. The only real visual difference between your hand conversions (besides being rounded) was the use of parinthesis around the second conversion. As I said in my message on your talkpage, if you wanted an exact conversion you can simply change the last parameter to 2 instead of 0. But if you prefer to do it by hand, by all means, I won't interfere.Drew R. Smith 13:47, 18 June 2009 (UTC)
- Just to explain, the parenthesis was deliberate. If the original specification was in one unit and not converted in the primary document, I'll usually parenthesize the conversion, because it may not be official. Howard C. Berkowitz 13:52, 18 June 2009 (UTC)
If I remember correctly, your's wasn't in parinthesis. The template added them.Drew R. Smith 14:08, 18 June 2009 (UTC)
Ombox
Hi Drew,
I see you imported the WP Ombox template. Unless you object, I am going to move it to Template:Message box - at CZ we try not to use cryptic names.
I have actually been standardising the message boxes across CZ templates, with the aim of eventually introducing a template for them, so I hope Ombox is compativle with what I've been doing - I'd been going to start from scratch, and I'd still rather do so.
Also, you should check that all the documentation is applicable to CZ before importingit - the "We are deploying!" section is a case in point... :-p
Caesar Schinas 09:00, 15 June 2009 (UTC)
- Eek. Actually Ombox was supposed to be used for the intricate template. It also has a parameter for an image. It probably won't be compatible, at least not without significant changes. Of course, "significant" is misleading, as there really isn't a whole lot of code behind it. If you want the message boxes to be standard, and without icons, I would just speedy the thing and start from scratch. If you do decide to adapt it to your needs, most of the code is actuall at {{Drew R. Smith 09:11, 15 June 2009 (UTC) }}. As for the name change, I couldn't care either way. Usually cryptic names aren't an attempt to disuise the contents, but rather a byproduct of having a lot of similar templates. For instance, wp has ombox, mbox, and several other box templates that all do pretty much the same thing, except in different namespaces. Since we want message boxes to be the same across all of CZ, "ombox" should be changed to something a little easier to identify.
- Alright; I might just speedydelete it and start from scratch, as you say.
- I do understand the reasons for the cryptic names at WP - they just have too many templates. But here we try to have less. I might just call it Template:Box, and then we can have a parameter which makes it a notice box or a warning box or whatever if we want. Caesar Schinas 09:21, 15 June 2009 (UTC)
Speedydeleting Convert templates
Don't bother putting speedydelete on all those; if you can confirm that everything in Category:Subtemplates_of_Template_Convert wants deleting I'll just do it all at once with a bot. Caesar Schinas 10:58, 15 June 2009 (UTC)
- Yeah, Everything there needs deleting. Same with Rnd and Scinote. Once your bot kills the bulk, I'll go get any stragglers (templates not covered by a category) and speedydelete.Drew R. Smith 11:00, 15 June 2009 (UTC)
- Alright; I'll go ahead. Caesar Schinas 11:00, 15 June 2009 (UTC)
- Sorry about all the trouble.Drew R. Smith 11:11, 15 June 2009 (UTC)
- Okay. I think I've done all I can with the bot; speedy anything I've left. Caesar Schinas 11:19, 15 June 2009 (UTC)
- Theres still Category:Subtemplates of Template Rnd and Category:Subtemplates of Template Scinote. I've been looking through my contribs, and I think everything else would be pretty easy to speedy.Drew R. Smith 11:22, 15 June 2009 (UTC)
- Right; I've done the first. The second doesn't exist... Caesar Schinas 11:26, 15 June 2009 (UTC)
- Sorry, Category:Subtemplates of template scinote. What a difference a capitalization makes.Drew R. Smith 11:29, 15 June 2009 (UTC)
- Done that and a few others I found. Going offline now, but will be back in a couple of hours. Caesar Schinas 11:33, 15 June 2009 (UTC)
- Ok. Again, sorry for the trouble. And thats a pretty neat little toy (your bot). I'm not even going to ask how to get one, because I already know the answer. "You'll put someones eye out!"Drew R. Smith 11:35, 15 June 2009 (UTC)
- Done that and a few others I found. Going offline now, but will be back in a couple of hours. Caesar Schinas 11:33, 15 June 2009 (UTC)
- Sorry, Category:Subtemplates of template scinote. What a difference a capitalization makes.Drew R. Smith 11:29, 15 June 2009 (UTC)
- Right; I've done the first. The second doesn't exist... Caesar Schinas 11:26, 15 June 2009 (UTC)
- Theres still Category:Subtemplates of Template Rnd and Category:Subtemplates of Template Scinote. I've been looking through my contribs, and I think everything else would be pretty easy to speedy.Drew R. Smith 11:22, 15 June 2009 (UTC)
- Okay. I think I've done all I can with the bot; speedy anything I've left. Caesar Schinas 11:19, 15 June 2009 (UTC)
- Sorry about all the trouble.Drew R. Smith 11:11, 15 June 2009 (UTC)
- Alright; I'll go ahead. Caesar Schinas 11:00, 15 June 2009 (UTC)
Template:Convert/doc
I've copied the old contents of Template:Convert/doc to your userspace at User:Drew R. Smith/Template:Convert/doc in case you find it useful when creating the new documentation. Caesar Schinas 13:29, 15 June 2009 (UTC)
- Definitly. I was actually going to use it. I didn't think you were going to delete the old one though, so I was just going to edit it directly. But your way works just as well. Good night.Drew R. Smith 13:33, 15 June 2009 (UTC)
Infoboxes
Drew, Infoboxes should all use the {{Infobox}} template unless there is a compelling reason not to. (Also, there seems to be a general consensus to only include basic details in them on CZ - we use them in a very different way to WP. Not having looked in detail at the ones you've created, I don't know how much detail there is in them, but I thought I'd point this out in case you're just copying WP infoboxes.) Caesar Schinas 13:44, 18 June 2009 (UTC)
- I think I did use the infobox template... As for the details, I did remove alot of minor crap that WP used, but if you think I should take more off, I will.Drew R. Smith 13:50, 18 June 2009 (UTC)
- I was referring to Template:Infobox Bible Translations, in which you have not used the infobox template. I am aware that you did use it in Template:Infobox Writing system (which, by the way, should be called Template:Infobox Writing System...).
- I'll leave it up to you what details to include; I just thought I'd let you know that we use infoboxes differently to WP, since you're new here. If you were already aware of this, forgive me.
- Caesar Schinas 13:54, 18 June 2009 (UTC)
- I wasn't aware, but I do hate how WP uses so many useless details in their infoboxes. You should see their article English bible. Thats the kind of thing that'll give you nightmares...Drew R. Smith 14:10, 18 June 2009 (UTC)
CZ attribution template on WP
Hi Drew, thanks for the {{Cz-cc-by-sa}} template at WP. I made this adjustment on the {{ }}. If you would double check to make sure it's correct. TIA! D. Matt Innis 01:08, 20 June 2009 (UTC)
- Yeah, that looks fine to me. I'm glad someone actually noticed the template!Drew R. Smith 04:29, 20 June 2009 (UTC)
- Good news. It was actually brought to my attention on the constable mailbox and I had just put the cz-gfdl template on it the day before. When I got word that there was a new template I went to put it on, and low and behold, you had been there! For a minute, I thought I had the wrong site, but when I saw the "R." I knew it had to be you :) D. Matt Innis 04:54, 20 June 2009 (UTC)
- Heh, am I already that well known around here?Drew R. Smith 05:05, 20 June 2009 (UTC)
- Sure, everybody knows you! And your the one that I had to move your account to the one with the R. and then blamed you for someone elses mistake :) I still owe you one! D. Matt Innis 05:23, 20 June 2009 (UTC)
- Ah, I see. Well it's always nice to know someone appreciates my work. I've been on WP for quite a while longer than I've been on CZ and it seems like nobody has any idea who I am, despite frequent postings to AN/I, EAR, and the Refdesks. It's a little disconcerting (in a good way) to find out that "everbody knows me". I hope I'm well known more for my good conributions than my bad ones though.Drew R. Smith 05:30, 20 June 2009 (UTC)
- Your work is very much appreciated here. You've caught on quickly and always seem to have such a good attitude, which far outweighs any bad contribution! D. Matt Innis 13:28, 20 June 2009 (UTC)
- Thanks for changing the template following my query in the forums. John Stephenson 03:34, 21 June 2009 (UTC)
- Your work is very much appreciated here. You've caught on quickly and always seem to have such a good attitude, which far outweighs any bad contribution! D. Matt Innis 13:28, 20 June 2009 (UTC)
- Ah, I see. Well it's always nice to know someone appreciates my work. I've been on WP for quite a while longer than I've been on CZ and it seems like nobody has any idea who I am, despite frequent postings to AN/I, EAR, and the Refdesks. It's a little disconcerting (in a good way) to find out that "everbody knows me". I hope I'm well known more for my good conributions than my bad ones though.Drew R. Smith 05:30, 20 June 2009 (UTC)
- Sure, everybody knows you! And your the one that I had to move your account to the one with the R. and then blamed you for someone elses mistake :) I still owe you one! D. Matt Innis 05:23, 20 June 2009 (UTC)
- Heh, am I already that well known around here?Drew R. Smith 05:05, 20 June 2009 (UTC)
- Good news. It was actually brought to my attention on the constable mailbox and I had just put the cz-gfdl template on it the day before. When I got word that there was a new template I went to put it on, and low and behold, you had been there! For a minute, I thought I had the wrong site, but when I saw the "R." I knew it had to be you :) D. Matt Innis 04:54, 20 June 2009 (UTC)
General Talk Page Archive
The account of this former contributor was not re-activated after the server upgrade of March 2022.
Welcome
Welcome to the Citizendium! We hope you will contribute boldly and well. Here are pointers for a quick start. You'll probably want to know how to get started as an author. Just look at CZ:Getting Started for other helpful "startup" links, and CZ:Home for the top menu of community pages. Be sure to stay abreast of events via the Citizendium-L (broadcast) mailing list (do join!) and the blog. Please also join the workgroup mailing list(s) that concern your particular interests. You can test out editing in the sandbox if you'd like. If you need help to get going, the forums is one option. That's also where we discuss policy and proposals. You can ask any constable for help, too. Me, for instance! Just put a note on their "talk" page. Again, welcome and have fun! Roger Lohmann 12:01, 3 June 2009 (UTC)
Specialist editors
Drew, you are touching on a category that has been called "specialist editor". User: Aleta Curry is one for dogs; you might want to consult with her. As you point out, there aren't any articles now, so the author role is more critical than the editor. Editors start coming into their own when there are multiple authors to be guided. I don't remember if there are any Dog articles approved; I don't think my cats want me to know (they have excellent canine friends, but it's clear who is boss).
I happen to do a good deal of work in commercial fishing, or, more specifically, the electronics associated with it. That quite conveniently falls under Engineering, sometimes Computers, and even Military when the systems derive from warfare. Nevertheless, the articles need to be produced first. I could probably use Editor involvement on something like Vessel Monitoring System if I were to take it to Approval.
In writing about actual fisheries and species, however, even if I were a Food Sciences or Biology Editor, I couldn't approve my own articles, such as the early one on quahog. Perhaps if there are more than one author writing about sea creatures, we indeed need an Editor, which could be from one of the workgroups I just named. I'm not uninterested in the problem you cite, but from a very different viewpoint. Living here on Cape Cod, what editor would approve an article on Cod? Howard C. Berkowitz 05:40, 4 June 2009 (UTC)
NDOTW response
Hi Drew, You're welcome. I thought the article covered an interesting topic in an area that doesn't get much coverage on CZ. Shamira Gelbman 15:43, 20 June 2009 (UTC)
Upload Wizard
Hi Drew, I notice that you used the old upload wizard to upload Image:Fubar.jpg (not actually sure if this is a useful image, but...)
May I ask if there was any problem with the new one, that I might fix it if there was?
Thanks... Caesar Schinas 07:21, 22 June 2009 (UTC)
- No, no problem. Usually when I upload an image I create a redlink for it, File:Like this.jpg, and then click the link. It automatically fills in the name of the image, and I find that much easier. I do like the wizard, but my way of uploading files doesn't seem to go through the wizard. Drew R. Smith 07:27, 22 June 2009 (UTC)
- Ah, OK. I must remember to update the instructions for when you click an image redlink. Thanks. Caesar Schinas 07:43, 22 June 2009 (UTC)
- Should be better now. Still better to use the wizard, but... Caesar Schinas 13:58, 22 June 2009 (UTC)
Welcome & reply
Hi Drew, a belated welcome to CZ! I'm always really glad to see new active people. I might have answered more quickly but was travelling and offline for an unusual amount of time.
Milton answered on my behalf correctly (people think they can do that--go figure!--but they usually do so correctly so I don't actually mind). For our policy regarding approval, see CZ:Approval Process. --Larry Sanger 02:41, 23 June 2009 (UTC)
- Hey, no problem on the belated-ness; it happens. It's pretty cool that you're willing to stop by and welcome the new people. It shows, at the very least, that you are a better leader than most. Drew R. Smith 05:38, 23 June 2009 (UTC)
familytree.js
// into a list of parameter lists. The parameters can contain // arbitrarily complex nested wiki syntax like bar and // Template:Foo but this simple strategy of just // counting double brackets and braces should be good enough. // function parse_templates (text, rows) {
var pattern = /([[\]{}])\1|\|||<nowiki>[\S\s]*?<\/nowiki>/ig; var level = 0; var row, start, res;
while ((res = pattern.exec(text)) != null) { if (res[1]) { (res[1]=="[" || res[1]=="{") ? level++ : level--; } if (res[0] == "{{" && level == 1) { row = []; start = res.index + 2; } if (res[0] == "|" && level == 1) { row.push(text.slice(start, res.index)); start = res.index + 1; } if (res[0] == "}}" && level == 0) { row.push(text.slice(start, res.index)); rows.push(row); } } if (level != 0) throw "Mismatched Template:... or ...";
}
function layout_tiles (rows, parts) {
var art = ""; var params = {}; var order = []; var specpat = new RegExp("^((" + Special.join("|") + ")_)\\s*(\\S.*)" );
// Tweak name so it is valid (matches namepat from map_boxes() // and is 2 to 5 characters long) and so it is unique if the // same name is used on several templates with different values. // Then store it in params{} and order[]. // // Could remember mappings in another hash, and change // back to original name on output (if original name not // already used on line). Probably best not to though. // function goodname (name, value) { var res, prefix="", nn;
if (res = name.match(specpat)) { prefix = res[1]; name = res[3]; } nn = alias[name]; if (!nn) { // first encounter on this template nn = name; if (nn.search(/\w.*\w/) == -1 && value.search(/\w.*\w/) > -1) nn = value.toUpperCase(); nn = nn.replace( /[^\w.\/&]/g, "_"); nn = nn.replace( /_*([\W_])[\W_]*/g, "$1"); nn = nn.replace( /^[\W_]*(.{0,4}[^\W_]).*/, "$1"); nn = nn.replace( /^.?$/, "A0001");
var base = nn; var num = 1; while (nn in params && (params[nn] != value || prefix)) { num++; nn = base.slice(0, 5 - String(num).length) + num; } alias[name] = nn; } nn = prefix + nn;
if (! (nn in params)) { order.push(nn); params[nn] = value; } return nn; }
// FRANKLIN = Benjamin Franklin FRANK // FRANKLIN = Frank N. Furter FRAN2 boxstyle_FRANKLIN = red // FRANKLIN = Franklin Richards FRAN3 // FRANKLIN = Frank N. Furter boxstyle_FRANKLIN = blue
for (var r=0; r < rows.length; r++) { var row = rows[r]; var seen = {}; var alias = {}; // mapped to different name on this row?
if (row[0].search(/^\s*(familytree|chart)\s*$/i) == -1) throw "Unrecognized template {{" + row[0] + "}}";
for (var i=0; i < Special.length; i++) alias[Special[i]] = Special[i]; // don't truncate boxstyle
// Pass 1: Do only the assignments first, because if the // same parameter name is used on a previous row with a // different value, then we need to rename this parameter // and its boxes before they are output. // for (var c=1; c < row.length; c++) { var cell = row[c]; var i = cell.indexOf("=");
if (i < 0 || cell == "=") continue;
var name = trim(cell.slice(0,i)); var value = trim(cell.slice(i+1));
if (value.indexOf("\n") >= 0) toss ('Parameter "' + name + '" spans multiple lines.'); value = value.replace(/\n\s*/g, " ");
if (seen[name] && value != seen[name]) throw 'Parameter "' + name + '" has multiple values on template ' + (r+1); seen[name] = value;
goodname(name, value); }
// Pass 2: Now layout the tiles and boxes. // for (var c=1; c < row.length; c++) { var cell = trim(row[c]);
if (istile(cell) && ! (cell in seen)) { art += pad(cell, 2); } else if (cell.indexOf("=") == -1) // it's a BOX { cell = goodname(cell, cell.replace(/_/g, " ")).slice(0,5);
// Don't adjoin a Template:Chart wide cell if can avoid if (cell.length == 4 && /\w$/.test(art)) cell = " " + cell;
art += (" "+cell+" ").substr(cell.length/2, 6); } } art += "\n"; }
// list the parameter values, one per line // TODO: Styles referenced via [1], [2], etc
var param_width = 5; for (var name in params) if (name.length > 8) param_width = 14; // any boxstyle_FOO ?
var param_list = ""; while (name = order.shift()) { param_list += pad(name, param_width) + " = " + (params[name] || "") + "\n"; }
parts.art = art; parts.list = param_list;
}
// Make the art more readable by converting some symbols. // Mainly just fills in --- and ~~~ horizontal lines for now. // 1. Fill in a ~ tile followed by a ~ tile or a box // 2. Fill in a box followed by a ~ tile // TOM - v - SUE becomes TOM ---v--- SUE // function touchup (art) {
art = art.replace( /!/g, "|"); art = art.replace( /([,`^)}*+-]|\b[Xadijqrv]) (?=[.'^({*+-]|[acijlqrv]| ?\w\w)/g, "$1-"); art = art.replace( /([~%#\]]|\b[ADFLVfhy]) (?=[~%#[]|[7ACJKVXehy]| ?\w\w)/g, "$1~"); art = art.replace( /(\w\w ? ?) (?=[.'^({*+-]|[acijlqrv]\b)/g, "$1-"); art = art.replace( /(\w\w ? ?) (?=[~%#[]|[7ACJKVXehy]\b)/g, "$1~"); art = art.replace( /(\w\w ) (-|~)/g, "$1$2$2"); return art;
}
// Trim and pad a multi-line diagram with spaces to its maximum // width, adding a margin on both sides and a 1-line padded // margin above and below. Also tweaks the alignment if most // of the alignment indicators are mis-aligned on odd. // If margin is not given (wiki2art), it depends on the width. // function pad_text (text, margin) {
// trim trailing spaces and leading and trailing lines text = text.replace(/\t/g, " "); // just in case text = text.replace(/ *\r*$/mg, ""); text = text.replace(/^\n*/, "\n"); text = text.replace(/\n*$/, "\n");
// trim indentation if not empty while (text.search(/(^|\n).?\S|^\s*$/) == -1) { text = text.replace(/^ /mg, ""); } var rows = text.split("\n"); var width = 0; var align = 0; var alignpat = /[^\w\s=~&\/\[\].-]|[A-Z0-9]+([\/&._]?[A-Z0-9])+/ig; var res;
for (var i=0; i < rows.length; i++) { width = Math.max(width, rows[i].length);
// Are majority of alignment indicators on odd or even? // while ((res = alignpat.exec(rows[i])) != null) { var len = res[0].length; if (len % 2) // even boxes are ambiguous ((res.index + len/2) & 1) ? align-- : align++; } }
// If formatting for display, center diagram on column 40, but // at least a 4-cell left margin unless close to max width. // The margin gives room to draw another box on the left, and // you can then toggle view twice to indent another 4 cells. // if (margin == null) { margin = Center - width / 2; margin = Math.max(margin & ~1, 8); if (width/2 + margin > Maxwidth) margin = 0; } else if (align < 0) margin++;
margin = pad("", margin); text = "";
for (var i=0; i < rows.length; i++) { text += margin + pad(rows[i], width) + margin + "\n"; } return text;
}
// Pad str with spaces on right to width len, but don't truncate. // function pad (str, len) {
if (str.length < len) str += Array(len - str.length + 1).join(" "); return str;
}
function trim (str) {
return str.replace(/^\s+|\s+$/g, "");
}
function art2wiki()
{
try { var textarea = document.editform.wpTextbox1; var scroll_pos = textarea.scrollTop; var pattern = /\{\{(familytree|chart)\/start[\S\s]*?\{\{\w+\/end}}/ig;
textarea.value = textarea.value.replace(pattern, art2wiki_replace); textarea.removeAttribute("wrap"); textarea.style.display = "inline"; // Firefox work-around textarea.scrollTop = scroll_pos; // Firefox only?
document.editform.wpSave.disabled = false; update_menu ("wiki2art"); if (document.editform.wpSummary.value.search(/^(\/\* .* \*\/)? *$/) == 0) document.editform.wpSummary.value += Summary.replace("%s", Template); } catch (e) { alert ("Could not convert ASCII art because:\n\n" + e); }
}
function art2wiki_replace (text, tmpl) {
var label = {}; var param_rows = [];
Template = tmpl.toLowerCase(); rows = []; boxes = [];
if (text.indexOf("\n") == -1) return text; // don't convert a 1-line legend
// Sanity check, if any lines begin with {{... // if (text.search(/\n\s*\{\{.*\n/) != -1) { toss ("Out of sync; looks like this already is wikitext."); return text; }
var res = text.match(/^(.*}})([\S\s]*)\{\{/); if (res == null) throw "Didn't find end of /start tag on same line";
parse_art (res[2], label,rows); map_boxes (rows, boxes); map_tiles (boxes,rows, param_rows); crop_rows (param_rows); var temps = to_wikitext (label, param_rows); var start = summarize (res[1], boxes.count);
return start + "\n" + temps + "Template:" + tmpl + "/end";
}
// Parse the simple ASCII art, storing the diagram in // rows[] and the labels in label{} // function parse_art (text, label,outrows) {
// remove any rulers or comments (messages) text = text.replace(/^.*1-2-3-4-5-6-7-8-9.*\n/mg, ""); text = text.replace(/^ *\/\/.*/mg, "");
// Parse the name=value definitions into label{}. // We're as flexible as possible, allowing defs // with no RHS, defs in multiple columns, and // defs quickly jotted to the right of the art. // However, a value cannot span lines. And assume // foo===bar is part of the art, where === is ---. // AAA=Freddy overrides AAA=AAA overrides AAA= // text = text.replace(/([^\s=]+) *=(?!=) *(.*?)(\t| (?=.*\w.*=)| *$)/mg, function (str,name,value) { if (! /\w/.test(name)) // art return str; if (! label[name] || label[name] == name && value) label[name] = value; if (value != label[name] && value != name && value) throw 'Parameter "' + name + '" has multiple values.'; return ""; });
// Treat ..... same as ~~~~~ text = text.replace(/\.{3,}/g, function(s){ return s.replace(/./g, "~"); });
text = pad_text(text, 4);
var a = text.slice(0,-1).split("\n"); while (a.length) outrows.push(a.shift());
// At this point, outrows[] should contain the diagram padded // to the maximum width with two extra blank cells on each // side (1 box overlap + 1 neighbor) and with the vertical // lines aligned on the even characters (assuming diagram is // consistent in this).
}
// Find which cells are occupied by boxes, even if the box
// names are real short (must be at least 2 characters) or
// real long. Doing this first makes processing the tiles
// easier. Returns the 2D boxes array.
//
function map_boxes (rows, boxes)
{
var namepat = /[A-Z0-9]+([\/&._]?[A-Z0-9])+/ig; var row, map, res, name, pos;
boxes.count = 0;
for (var i=0; i < rows.length; i++) { row = rows[i]; map = new Array(row.length);
while ((res = namepat.exec(row)) != null) { name = res[0];
// Handle cases where wide Template:Chart tiles look like boxes. // If it looks like they could be tiles, then they're tiles, // else they're boxes. We rely on user to not use ambiguous // box names like a2b2c (though names like a2 and a2b should // actually work as long as they remain aligned on odd). // if (Template == "chart" && res.index % 2 == 0) { while (name.search(/^[a-z]2[^\W_].../) == 0) { name = name.slice(2); res.index += 2; } // Tiles: m2 m2P m2n2 m2n2P Boxes: m2ab m2abc m2Pn2 if (name.search(/^([a-z]2)*.?$/) == 0) continue;
// Also allow convenience shortcut of SPPPRPPPPPP // to be used as alternative to S P R P P P if (name.search(/^(?=.*PPP)([bmnoPSYWMHR]P){3,}.?$/) == 0) continue; }
// Even allow on odd alignment if it's all PPPPPPPPPPPs if (Template == "chart" && name.search(/^P{6,}.$/) == 0) continue;
if (name.length % 2 == 1 && res.index % 2 == 0) toss (name + " is aligned ambiguously"); pos = (res.index + name.length / 2) & ~1; if (map[pos-2]) throw "box [" + name + "] overlaps [" + map[pos-2] + "]";
map[pos-2] = name; map[pos] = name; map[pos+2] = name;
// Blank out the name. If it's a long name (>5) and // a horizontal line joins it, extend the line into // the extra space from shortening the name.
var before = row.slice(0, res.index); var blank = name.replace(/./g, " "); var after = row.slice(res.index + name.length); var half = name.length / 2;
if (res = before.match(/(-|~) ?$/)) blank = Array((half+1)|0).join(res[1]) + blank.slice(half); if (res = after.match(/^ ?(-|~)/)) blank = blank.slice(0,half) + Array((half+1.6)|0).join(res[1]); row = before + blank + after; boxes.count++;
if (row.slice(pos-2, pos+3).search(/[^\s[\]P~=_-]/) >= 0) toss ("A tile overlaps box [" + name + "]"); } boxes.push(map); rows[i] = row; }
}
function map_tiles (boxes,rows, param_rows) {
Tile.invert_symbols();
for (var r=1; r < rows.length-1; r++) { var row = rows[r]; var params = [];
var res = row.match(/^.(..)*?([^\s[\]P~=_-])/); if (res) toss (res[2] + " is mis-aligned on row " + r);
for (var c=2; c < row.length-2; c += 2) { if (boxes[r][c]) { params.push( boxes[r][c] ); c += 4; } else { var t = new Tile(r,c); t.tweak(r-1, c, 0); t.tweak(r+1, c, 2); t.tweak(r, c-2, 3); t.tweak(r, c+2, 1); params.push( t.symbol() ); } } param_rows.push(params); }
}
// Crop unneeded spaces from beginnings and ends of parameter // lists if entire columns are unused. The rows are assumed // to be the same virtual width. If a margin is desired, use
//{{{...}}} | {{{...}}} | ||||||||||
My monobook.js
importScript("User:Drew R. Smith/familytree.js"); importScript("User:Daniel Mietchen/searchbox.js");