User talk:Sarah

From Bahaiworks
(Redirected from User talk:David)

Reproofing[edit]

Hi David... I've been reproofing the parts of SW that I did not review myself, and have as the remainder of my goal, to reproof volumes 3 and 4. As I am without my normal computer again, could I ask you to upload to bahaimedia the PDFs for these two volumes so I can move the content to the Text subpages without leaving the main issue page with a missing PDF? Brettz9 (talk) 09:07, 5 September 2015 (UTC)

I just happened to have finished Volume 3: http://bahai.media/Category:SW_Volume_3
btw, this is the quickest way to get the pdf url for the page: http://bahai.media/index.php?title=User:David/Sandbox&action=edit
I have added the /Text pages to the rest of the volume 3 issues, so you or I would only need to copy the body of the text and transfer it over. I also created a script which can do this automatically for the rest of the volumes as the PDF's become available. Also, don't forget to remove the "original scans" and all those images too, as they will be deleted. David (talk) 19:20, 5 September 2015 (UTC)


New question[edit]

1. Sorry I asked you this before, and you are welcome to change your mind, but what is your current priority on MUHJ 63-86 proofing?

It seems like I easily get side-tracked by new projects, like I rediscovered bots. I used a protection script to make every page of sacred text or book like lights of guidance semi-protected. Then the page-creation script to make U.S._Supplement and National_Bahá’í_Review, there are probably more to explore like adding categories to pages that didn't have any before. I'd like to test out the OCR quality for the two previous publications with /Text pages and enable searching through those too. It's more fun for me to add new text like this than to work on MUHJ... perhaps the add-page bot can finish up MUHJ for me as I still have most the text on my computer. It won't be this week though as it's finals week. As for other tasks I'm working on, I'm going back through every issue of Baha'i News to get the text for the /Text page, I'm also using Adobe to OCR the pdf files because adobe straightens pages during that process, so it's mostly aesthetic improvements. That requires a lot of re-uploading too. Also, my goal is to get rid of all the images on bahai.media in the star of the west category and replace them with pdf documents, then to replicate the user-experience on Star of the West that Baha'i News has with text going on the /text page. I think there is a lot of value in presenting the text in pdf format initially as you see the original styling and formatting which imo is just as cool as the text. (While low on my to-do list, I think there is similar work to be done for Baha'i World).

2. Where is your missing publications category (or page)? (I wanted to make sure U.S. Supplement 91 (1965) was there, assuming its being missing is indicative of you not having it, as well as NBR 102 (July 1976) and 112 (April 1980)). I'm not aware of any others (besides the publications with many issues missing like World Order).

Here: http://bahai.media/Category:Missing_publications (Though I realized many many issues of Baha'i News should be listed there but aren't).
Sorry--can you remind me how they are showing up there if they are missing? Just the original is missing or there are pages within the scan that are missing? Brettz9 (talk) 02:21, 30 August 2015 (UTC)
What's showing up there are category pages, so even if I don't have an issue there is still a category for it because I'm using the old scans as a placeholder. However, for USS and NBR I did not do unique categories for every issue (though NBR might get them eventually), categories exist for every issue when the issues have pictures and I want to be able to show all images from a given issue in one category. NBC has pictures, so I may eventually move to one issue=one category in the future. Anyway, if you want to get something into the missing publications category from USS or NBR you'll need to create the file page on bahai.media as if you had the image. So if Supplement3 was missing you'd create a page called Supplement3.pdf and put it into the category missing publications. Files have page containers and images, you can even remove the page container without removing the image if you wanted, you're kind of doing the reverse, creating the page container without the image (pdf). here is an example. I did NBR already, you can see it at the bottom of the missing categories page.

3. Were you going to be doing all the linking from BN to NBR and Supplement issues? Just want to know whether that needs to be its own to-do or whether that is part and parcel to your process of adding the issues.

I'd like to compare the NBR and USS issues side-by-side with the Baha'i News issue they were attached to so that I can see if there was any relationship between them, or if they were joined out of convenience with regards to distribution. If there is no relationship between them, I wouldn't bother linking them.
Would you be open to me doing them? I think if they were bundled together that it would make sense to have them explicitly connected. Brettz9 (talk) 02:21, 30 August 2015 (UTC)
I'm not really happy with how I'm presenting inserts on Baha'i News right now, perhaps if you wanted to rework template:inserts to remove the pdf file thumbnails and make it links instead that would make it more palatable to present lots of files there.

4. Were you still going to do Lua highlighting? (This is not critical for me, but was the one remaining to-do on your end that I can remember.)

It seems like it can be done manually with

<syntaxhighlight lang="lua">
..
</syntaxhighlight>

but I'm not sure how to do it automatically. This is the only reference which talks about it, but I'm not sure what to do. David (talk) 21:18, 29 August 2015 (UTC)

I see there are instructions at https://www.mediawiki.org/wiki/Extension:Scribunto#Integrating_extensions
Did it work? Module:Arguments
Yeah, awesome, thanks! Brettz9 (talk) 03:27, 30 August 2015 (UTC)

Amazon[edit]

I've received the item from Amazon. Brettz9 (talk) 05:55, 29 August 2015 (UTC)

Great, once you have email back I'll need the serial number and 2 of the access codes displayed on the front. When you get the first code wait 30 seconds before getting the second. David (talk) 08:04, 29 August 2015 (UTC)

National Baha'i Review[edit]

At least in looking at http://bahai.works/Baha'i_News/Issue_442 , I don't see the NBR inserts, as are scanned at http://www.h-net.org/~bahai/diglib/Periodicals/NBR/National_Bahai_Review.htm . Were you planning to add these? Brettz9 (talk) 20:47, 28 August 2015 (UTC)

I have some physical copies but have not scanned them yet. However, the copies above seem just fine, so I'd guess there is no reason to scan them again. There is also the "US Supplement" which I have copies of but have not scanned either. To a certain extent I don't think it makes sense in a digital presentation to group all these supplements and inserts together with their original Baha'i News issue, except on the Baha'i News page to provide a link to them perhaps. I'd favor having a new page for Baha'i Review, US Supplement, and the Inserts too. David (talk) 21:38, 28 August 2015 (UTC)
Sounds reasonable to me if there is at least a link or something to draw attention to the connection. Btw, the site I mentioned appears to indicate that two of the issues are missing from its collection, so you'd presumably want to scan those if you had them. Brettz9 (talk) 22:50, 28 August 2015 (UTC)
I did check, unfortunately all the ones I have are early 1-50 in the series, none of the missing ones. Will have to expand my "missing publications" category. David (talk) 22:52, 28 August 2015 (UTC)

There are buckets in my s3 account for Baha'i Review, US Supplement and Baha'i Bulletin now, which contain all those files. I can Upload them in bulk to bahai.media and then using this it might be possible to bulk add the pages here in one go. David (talk) 23:24, 28 August 2015 (UTC)

Special character insert[edit]

What do you think about adding an extension to all our wikis: https://www.mediawiki.org/wiki/Extension:CharInsert  ?

I think it is a lot to expect editors to know how to get special transliterated characters without a graphical way to obtain them... Brettz9 (talk) 04:01, 28 August 2015 (UTC)

I've updated it, and am experimenting with its options now. David (talk) 04:34, 28 August 2015 (UTC)
I've added a "Bahai" character set for the edit tools menu, you can add useful things there yourself by going here MediaWiki:Edittools. David (talk) 04:51, 28 August 2015 (UTC)
Sweet! Nice set-up you did too--I just added ú for the like so Mah-Ku and Huququ'llah. Btw, does the Geshi extension let you configure syntax highlighting for the Lua modules too? Not a big deal, but thought I'd ask while the config may be more fresh in your mind... Brettz9 (talk) 07:37, 28 August 2015 (UTC)

Yes, and I'll figure that out.

And, btw, strictly speaking the underlining of transliterated characters should probably be done at the Unicode level with a combining character like this: K&#x0332;h&#x0332;, to appear like this: K̲h̲ . That is because underlining in this case is not structural so it should not be done via the HTML <u> tag (and it is not formatting, so it should not be in CSS either), but is rather part of the characters. One practical difference is that when you copy-paste somewhere without formatting, it will still paste the underlining if the underlining is done via Unicode instead of HTML. The only problem is that I'm not sure how good browser support is on these combining diacritics. It looks good on the Mac I am on now, but before at least in Windows in Firefox it looked a little misaligned. Actually, if you only use the "u" template for characters, we could modify the template code I think (possibly using Lua I guess) to add the combining diacritic (called "Combining low line") to each passed character. When I may be back with my old system, I might also try out the fonts at http://www.fileformat.info/info/unicode/char/332/fontsupport.htm to see if they work ok with the low line character. Updated: Brettz9 (talk) 05:55, 29 August 2015 (UTC)

Btw I got a bot running so any actions performed by these scripts can be automated now. Also, let's figure out the underlining, I'd love to use your method, but it looks very mis-aligned on Chrome/Windows. David (talk) 19:53, 28 August 2015 (UTC)

I don't think there is anything further we can do if it is still showing misaligned since it must be some kind of font problem--unless we were to either find a font likely to be on the user's system which displayed it better (I think on Windows it is "Arial Unicode MS" which supports the most Unicode characters, and IIRC, it doesn't help with alignment) or used the CSS @font-face rule to have users download a specific font we know to display well. I would think that should work well (as I recall, some Baha'i might have even designed a font for this purpose), but it would require the user waiting to download the font upon the first site visit, and maybe if fonts are removed when the cache is removed.


javascript[edit]

Btw, did you follow my explanations below on jQuery? FYI, $(function () {}); can also be expressed as $(document).ready(function () {}); (as I see is used in Edittools.js) Brettz9 (talk) 20:08, 28 August 2015 (UTC)

I will look at this too, actually, after looking, I'm not sure what change to make. The javascript is still not loading for anonymous users without the reference from Common.js, however, Edittools does work fine... David (talk) 21:43, 28 August 2015 (UTC)
No need to make any changes--just seeing if you followed what I was saying in answer to your question. As far as the need for an explicit loading for pdfpagebn, although I can't say why this is the case, I do see from the source code, that, for logged out users, pdfpagebn is also being loaded along with Edittools in the edit page (though I know it is not needed there), but neither is being loaded by default on the article pages. So it appears it is not related to how the pdfpagebn gadget is defined but rather, either in how it is designated to be loaded or it is always required to be explicit in article pages. Brettz9 (talk) 23:12, 28 August 2015 (UTC)

Well it seems like the change you made fixed it! The line on Common.js is no longer necessary and the pdf page selection box is now appearing for anonymous users. Was it just the $? David (talk) 23:16, 28 August 2015 (UTC)

Out of contact[edit]

Hi David--will probably be out of email contact for about a week--I am on a Mac now and am not bothering to dig up my old passwords, etc. to set up my mail, etc. I will try to get back to you hopefully sometime next week. I might do a little work on this site though to keep me busy... Brettz9 (talk) 02:18, 26 August 2015 (UTC)

Ok. The only outstanding question I was wondering about is if a template has a value like {{mytemplate |value=1234}}, can the javascript called from MediaWiki:Common.js access that value? This would enable usage of the "pdfpage" javascript everywhere without regard to page names or file names. You would in theory just say |filename=something.pdf and then MediaWiki:Common.js says "look for filename value, and plug that into the URL"? David (talk) 02:49, 26 August 2015 (UTC)
Template variables don't seem to be automatically exposed (in looking over https://www.mediawiki.org/wiki/Manual:Interface/JavaScript and https://doc.wikimedia.org/mediawiki-core/master/js/ ) but you should be able to just create a hidden empty element (like <span style="display:none;" id="hookForCommonJS">{{{value}}}</span>) which the JavaScript could be changed to look for by its ID. Brettz9 (talk) 19:15, 26 August 2015 (UTC)
Okay, in the mean time I'm attempting to implement Gadgets which have some benefits. The primary one being control over who sees what javascript, and performance benefits of resource loader. See Special:Gadgets for my first test, though it's not going as expected. I've left some notes in MediaWiki:Common.js. Eventually I'd like to move most code from Common.js into a gadget. This also gives users who are logged in the ability to remove features we add, instead of forcing every new feature on every one. David (talk) 22:37, 26 August 2015 (UTC)
That seems like a good idea in using Gadgets or at least modularizing the code. I am not concerned about who sees what JavaScript, as client-side JS is always delivered client-side which can be viewed by users. One thing which would make life easier is https://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi . It says it has been bundled since MW 1.21, but I don't see it on your Special:Version page, and unlike Wiktionary's Common.js, bahai.works is not getting syntax highlighting out of the box which it seems the Geshi extension is needed for. Sorry, but my current environment is really not good for debugging. Please let me know if you have other questions though. Brettz9 (talk) 23:47, 26 August 2015 (UTC)
Bundled extensions are installed but not enabled by default. I have added it here and if it works okay I'll put that and Gadgets on all other sites. David (talk) 00:00, 27 August 2015 (UTC)
Nevermind, it did not work. A blank page resulted on .js/.css pages. Will try again later David (talk) 00:04, 27 August 2015 (UTC)
It's working and enabled now David (talk) 02:57, 27 August 2015 (UTC)
Great! FYI, the following code (which is called by the scary complicated-sounding term, an "Immediately-Invoked Function Expression (IIFE)")...
(function () {
// ... rest of code goes here
}());
... protects the code outside of it to some degree--assuming you use "var" when declaring new variables inside the IIFE. If you don't encapsulate the code in such a function (or if you don't use "var" within such a function), in traditional browser JavaScript, if you assign a value to such variables, they will automatically become "global variables", and any other scripts already relying on such a global with that same name outside of your script will be messed up. So, if you move code to its own module, you should also encapsulate that code within its own IIFE. Brettz9 (talk) 06:05, 27 August 2015 (UTC)

Okay, I think I've added it properly to MediaWiki:Gadget-pdfpagebn.js. What would be the purpose of a $ before that however, as in the example here? David (talk) 06:43, 27 August 2015 (UTC)

$ is a shorthand for the jQuery object, jQuery being a code library which makes JavaScript much easier to write, especially when supporting older browsers. The jQuery object can be used for various different purposes. It can obtain an element by using a CSS selector (e.g., $('#myID') retrieves the element with a "myID" ID), it can create HTML (e.g., $('<div>')), and in the case you cite, it adds an event listener--i.e., it adds the specified function which will be called on the "DOMContentLoaded" event, i.e., the event fired by the browser to indicate that the whole document has loaded (i.e., the DOM tree that you see in the inspector has been built), but not necessarily all the images. If you put a <script> in the <head>, for example, the <body> and its contents won't be ready yet, so you have to listen for the DOMContentLoaded event before you can do something with those body elements. Alternative to listening for that event, one can just put the <script> at the very end of the body which achieves pretty much the same effect since we can also access all prior content in the body and has the advantage that we don't need extra code to listen for the DOMContentLoaded event. Some purists think that all <script> tags should go in the head, however. Brettz9 (talk) 07:12, 27 August 2015 (UTC)
Oh, and also, if you'll notice, the function added to listen to the DOMContentLoaded event does not immediately execute--i.e., it doesn't have the "()" at the end. And it shouldn't because when you add a listener, you are asking it to fire when the event occurs, not at that immediate moment. Brettz9 (talk) 07:14, 27 August 2015 (UTC)
And 3rd, btw, after looking at https://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_%28users%29 , I don't think there is anything I have to do to make it more ResourceLoader friendly--except that I see that what I told you about globals doesn't hold in this case--Mediawiki's module loader automatically treats resources in their own scope, meaning that we didn't need the IIFE after all (though it doesn't really hurt either). If we were just adding another <script> tag to the document we would have needed the IIFE. Brettz9 (talk) 07:30, 27 August 2015 (UTC)

Suriy-i-Haykal[edit]

I think that would work well, I like what was done with the chapters of the Suriy-i-Haykal, it works better than what I did. I think that doing something similar for big tablets would be good, creating separate pages for every hundred paragraphs, but only listing the first page under the categories. Have you read the Suriy-i-Haykal? It is invigorating and awesome. RuhiWarrior19 22:16, 2 January 2008 (MST)

Reading[edit]

It is hard to read long text on the screen, but we have it in San-Serif, which makes it ten thousand times easier. Also, changing skins on the mediawiki might allow easier readability, so if there were a way for non-members to acces the skins... RuhiWarrior19 09:19, 3 January 2008 (MST)

david[edit]

David, I am afraid I am going to have to mostly retire from here as well. I may drop in to help from time to time, but I am going to try and focus my online energy on my new blog http://seventyandtwo.wordpress.com. Sorry, and I love the project(s).

Allah'u'abha! RuhiWarrior19 10:35, 21 January 2008 (MST)

Star of the West, etc.[edit]

Is it possible you could allow Table of Contents to show up optionally? When I saw you added headings for at least the first issue of Star of the West, I got excited about the possibility to view headings at a glance since it gives a good idea of the contents at a bird's-eye view. Yes, it's possible with an add-on like https://addons.mozilla.org/en-US/firefox/addon/7203/ , but I think it is a convenient option to allow to the readers...

Also, as an idea for OCR, you might consider using the OCR'd text from the CD-ROM; if you can't get access from Chad Jones, you could use a macro program to automatically copy its contents into a text file and then proofread that (or have people proofread it) before posting. Brettz9 02:02, 5 June 2010 (UTC)

I was thinking about that just recently. I removed it by placing __NOTOC__ in the page, remove that and it returns, place __TOC__ on the page and you can get it to show up where ever you want.
Pros: viewing headings like you said, headings are also links so you can copy/paste them for others.
Cons: To me it's quite unsightly and messes with the formatting of the pages most often. You can't get it to be collapsed by default (I think) which would remedy these issues.
Any thoughts? David 14:01, 5 June 2010 (UTC)
Looking at the source code, it appears that if you add a <script/> tag at the end of the <head/> or later and call "toggleToc()", it will collapse it (since the default is to show it). Brettz9 00:13, 6 June 2010 (UTC)
Correction: Wasn't thinking clearly. You can add a <script/> tag anywhere but should not call toggleToc() until an onload event to ensure that the elements are available. Since jQuery is available in Mediawiki, you can just use this:
$(function () {
    toggleToc();
});

Show/hiding page breaks[edit]

Here's some code you could use to show/hide page breaks

<script>
function toggleHR () {
    var hrs = document.getElementsByTagName('hr');
    var tpb = document.getElementById('toggle_page_breaks');
    for (var i=0, hrl = hrs.length; i < hrl; i++) {
        var displayNone = hrs[i].style.display === 'none';
        hrs[i].style.display = displayNone ? 'block': 'none';
        tpb.value = displayNone ? 'Hide page breaks' : 'Show page breaks';
    }
}
</script>
<input type="button" onclick="toggleHR()" value="Hide page breaks" id="toggle_page_breaks" />
Ah, the page break problem... I can see from your other comment about Star of the West that they become quite important since we'd be the only online source for that text.
It is my hope to migrate these to http://bahai-library.com/file.php?file=abdulbaha_star_west , and that would be a logical location since we have many other paginated texts there, but there is only volume 1 done there now, and it is easier to first format on a wiki (no need for manually typing

tags, for example) and then copy the resulting HTML. That being said, of course it would be nice for us to be able to just directly copy the documents including pagination for use on our site, but we could get around that. However, I think you really ought to consider including pagination or at least paragraph anchors if you have not already because it is possible for other sites (e.g., via interwiki links) to target your site if they prefer to read the Writings in wiki format here. Also, I've made a proposal to HTML5 that they allow some extra attributes in the link tag which allows one to specify links in a generic way on any website (e.g., urn:bahai:Kitab-i-Aqdas:par:5) which could then allow the user (possibly prompted by websites) to choose their own handler for these generic links, e.g., allowing that link to lead to Reflib, Bahaitext, Bahai9, etc.). I made a Firefox extension which adds support for these proposed attributes, but the attributes are not standard yet.

Unfortunately I'd built this whole site without them because both reference.bahai.org and bahai-library have them, different publications of the same text can have different page numbers and when I formatted the site by paragraph numbers I had to split pages and do other awkward things, see SV.
Yes, I see. Thankfully in this case, I doubt the reprint altered the pagination, so we have just one version to work with. It would be great to get the page breaks, also for the sake of the TEI proofreading project which I believe has also been recording those page breaks.
What would be very helpful is a toolbox in the whitespace to the right of the text with "Show/hide page breaks, Show/hide external links in the text (eg, links to Bahaikipedia), Printable version, and Available translations of the text" Any idea about how to do all this? David 05:02, 8 June 2010 (UTC)
Yes, making the pages-created-links extension helped me to learn some of the ins-and-outs, so I could do it. But your sentence isn't 100% clear to me about exactly where you want it. In my (I believe default) stylesheet for viewing Bahaitext, this information is not present, though I know the toolbox is present at Bahaikipedia. If you were saying that you want it done like at Bahaikipedia, then I can do this, yes. I don't know how you feel about giving access, but I could make the changes for you too if you're having trouble with access (though there's no rush on my part). In either case, let me know exactly where you want it, and I can send you the code making the customization (and explain it if you like). By the way, I could also allow certain code to denote a page break but where the buttons just collapsed the line break like at Reflib or expanded it like a full page break (as we often do at bahai-library.com) or toggle between 3 different options (the third being hiding it completely). Brettz9 06:09, 8 June 2010 (UTC)
Btw, to add to my post just now, I forgot what you were going to do about making dumps of site content? Brettz9 06:09, 8 June 2010 (UTC)
That would be awesome, thank you. You had asked about the code structure of the site in an email before right? I'm happy to give you access but I thought first I should upgrade all my projects to 1.16 which should be out in the next few weeks. Btw, I finally have access back on my own computer so I can send you more specific information tomorrow. I'll communicate all the rest by email. Thanks again, David 13:24, 8 June 2010 (UTC)


Yes, I remember at least asking about making dumps. That's cool about upgrading. Let me know... Brettz9 02:14, 9 June 2010 (UTC)