Memory Alpha
Advertisement
Memory Alpha
Talk page help
Memory Alpha talk pages are for improving the article only.
For general discussion, please visit Memory Alpha's Discussions feature, or join the chat on Discord.


Suggested move to 'Monobook.js'[]

This may need to be moved to "monobook.js" soon since common won't be used for the new skin and there won't be any other skins in use.

Also, regarding the recent edit by Cid, I actually find the lightbox to useful, outside of galleries, since thumbs still have a direct link to the file in one click. That said, I'm sure any discussion about this will most likely be pretty one sided in favor of it being kept off, so if anyone else wants it on, now wold be the time to speak up; I'm not going to carry this one by myself. - Archduk3 10:10, October 5, 2010 (UTC)

One big problem with this no longer being used is that it breaks a large number of things that we do want used here on MA (collapsible stuff). If the new skin cannot support those, we have a huge issue. And please start logging in to post stuff. -- sulfur 10:16, October 5, 2010 (UTC)

I wasn't logged in because it's talking awhile to do that now for some reason, simply faster to just type out my sig template if I'm only going to leave a comment.

The new skin will support things at "wikia.js", just not anything in common. Most of the js stuff is going to need to be tested (again) to see if it's actually working with the skin, and some of it won't need to be moved over at all. Of course, with the js not working at all, the new skin is actually completely unusable, so that's not really a concern right now anyway. :) - Archduk3 10:42, October 5, 2010 (UTC)

This file is now included in newskin as well, so it should not be moved. -- Cid Highwind 13:36, November 26, 2010 (UTC)

Suggestion to enhance 'Appearances' script[]

If we prefix the 'Appearances' script with the following line, this will lead to all episode lists in 'Appearances' sections automatically being annotated as "class=appear".

$(':header:contains("Appearances")+ul').wrap('<div class="appear" />');

This would a) get rid of all remaining cases where an 'Appearances' section has not been manually tagged as such yet, and b) allow us to eventually even remove the manual tags again - not a bad thing because they most likely don't mean anything to the average contributor, anyway. What do you think? -- Cid Highwind 13:36, November 26, 2010 (UTC)

Some comments (and replies) from IRC:

  • 'References' sections make use of the same script (example: Andorian), as do 'Star Trek credits' sections on actor pages (example: Andrew Steven Harris).
    • The above script can of course be enhanced to deal with a number of different situations. We should decide which of those can be considered a "standard", and add those to the script.
    • For all others, adding the div manually (as happens now) will still be an option.
  • The above does not work if there's text between the section header and the list (example: James T. Kirk).
    • Correct. Again, if this is a "standard situation", the script could perhaps be enhanced to deal with it. Alternatively, the additional text could be removed where it is unnecessary, and the div be added manually where it has to stay for whatever reasons.

-- Cid Highwind 15:24, November 26, 2010 (UTC)

Lightbox[]

I commented out the code that disabeled lightbox, since without it there is no way to reach the image description page for images in the sidebar. We must always have a way for users to reach the copyright information. - Archduk3 20:59, February 16, 2011 (UTC)

I do have an issue with us not disabling it, and being forced to re-enable it because of a bug in Wikia's code. I especially have an issue with it being done arbitrarily without discussion. This is something that Wikia should be fixing, or else they should not offer the disabling option in their documented code. -- sulfur 21:11, February 16, 2011 (UTC)

I especially have a problem with any "consensus" that was reached without record or even a notice that a discussion was going on so the community could participate. Since it was added without an on-site discussion, it shouldn't have been there in the first place, so removing it wasn't done anymore "arbitrarily" then adding it was. None of that even covers that it's having us break fair-use by having images where there is no link to the copyright information, so we simply can't disable the feature the way we have been. If our host is the problem, we can change hosts or wait for it to be fixed, but we can not continue with what we have been doing, and never should have done in the first place. - Archduk3 21:26, February 16, 2011 (UTC)

For what it's worth, I don't consider that "consensus-avoiding" argument to be valid. While the change may not have been discussed here, it's actually not an arbitrary change to the site behaviour - it is reverting an arbitrary change that was introduced by Wikia. I've started some tests to fix the issue, as Wikia seems to be unwilling to do it - but as soon as one fix works, I'm going to get rid of lightboxes again. -- Cid Highwind 23:27, February 16, 2011 (UTC)
I now reverted that last change, to investigate current behaviour of this feature - and found that it already seems to work as we want it to work (in standard thumbnails, in sidebars) with the sole exception of the diff view. If this is the case, I consider the problem with not linking to the description page pretty minor, actually - because diffs are not really a too public view of any page. Are there other circumstances under which image linking fails? Please list them here, so that I can have a look at it.
What I did stumble upon is something else, most probably related: In standard view (Earth), image linking works but the automated "appearances" folding doesn't - in diff view (Earth diff), it's the other way around. Somehow, one or the other script fails. -- Cid Highwind 10:06, February 17, 2011 (UTC)
With the last code change, this seems to also be fixed in diffs and for non-thumb images (which I found lacking after my last comment). There are now two similar changes in the "smallish changes" section, the former of which might be unnecessary now... -- Cid Highwind 11:15, February 17, 2011 (UTC)

In Firefox all images except those in galleries were going to the image page directly instead of the image description page, but this might have something to do with the problem that "File" and "Template" don't appear either. Regardless, the images work now, so there isn't a copyright problem; though your invalidation of dissension on a closed, recordless vote, regardless of whatever rational, is the oligarchy bullshit behavior we get accused of, so all discussions that will change site behavior, or revert it, should happen on site from now on. - Archduk3 14:32, February 17, 2011 (UTC)

Go button[]

I got this off of central, where people seem to think that adding this to the site's js instead of your personal js would be a TOU violation. I've read the TOU, and I don't see how adding to the functionality of the site is a violation, since this in no way "limit[s] the functionality" of any part of the UI, nor does it "intentionally block, remove, or otherwise obstruct the proper functioning and view of advertisements, and/or user interface and functionality by other users...that would prevent the proper display or function of advertisements and/or user interface and functionality". In fact, adding this button restores the basic function of the search bar, and in no way is intended to "interfere or attempt to interfere with the proper working of the Site". If someone from wikia intends to remove this as a TOU violation, I expect them to explain why in full before they do. - Archduk3 21:52, May 7, 2012 (UTC)

It is a ToU violation. It changes basic system stuff that Wikia desires to be cross-platform. The JS on central also doesn't quite work properly. -- sulfur 22:25, May 7, 2012 (UTC)

The TOU is a legal document, and since it in no way mentions "cross-platform continuity", there is no requirement for it. The wording of the TOU was just changed recently too, but I couldn't find anything in either version that makes this a TOU violation. I expect some part of the TOU to be used to explain how this a violation, not some "internal memo" or "corporate statement" that isn't actually binding to the user base. The TOU simply doesn't forbid adding functionality that doesn't remove some other function, and that is what this is doing. That said, I haven't had any issue with this, beyond not knowing if this is actually needed for monobook. What isn't working properly? - Archduk3 22:46, May 7, 2012 (UTC)

We encountered the issue with a broken taskbar, the broken Special:Activity, and so forth. They will bitch at us about this. Trust me. I've been there often enough with it. In addition, this removes "functionality" that Wikia desires. -- sulfur 23:48, May 7, 2012 (UTC)

Let them complain if they want. I'm not doing this because I think they won't notice or won't complain, I'm doing it because I don't think it violates the TOU, something wikia hasn't even claimed yet as far as I know. All I did was preemptively point out that I don't see how this is a TOU violation as some users have suggested at central. If it is a violation, I don't think wanting for it to be explained here, in detail for the record, how this violates the TOU as written is asking for too much either. Based on the wording of the TOU, I don't see how restoring this functionality as an option is a violation, and I'm not going to edit in fear of wikia's response to the things I do. Wikia employees have come here and done things that were "wrong" before, and reverting this without explanation would be the wrong thing to do. - Archduk3 00:24, May 8, 2012 (UTC)

Hi all -- we've discussed this code with several teams in the company, and the consensus is that it's interfering with the intended design, which is meant to have a single button and be consistent across the Wikia network (so users can see the same search tool on each wiki). Preventing proper display of user interface is a TOU issue.
Today, we made an announcement about some changes we're making to better reach our common goals with search: adding a personal preference for "go" search, adding redirect support to search suggestions, and speeding up search suggestion responsiveness (you can read about these in the blue update box of this blog post).
However, since the search field is a critical part of Wikia functionality, changing it for all users is a violation of our Terms of Use, and we need to ask you to remove your code for this wiki. (You're welcome to keep using it in your personal view.)
Please take care of this before Monday -- thanks! --Dopp WikiaStaff.png (help forum | blog) 19:43, May 11, 2012 (UTC)

Removed[]

/*******************************************************************************
** Single variables for site-wide behavior
*******************************************************************************/

//View images in a "Lightbox", or by going to the image description page?
window.wgEnableImageLightboxExt = false;

$().ready( function() {

//Change back thumbnail behaviour, let click on image lead to description page
$('figure.thumb').each(function(i){
  var iurl = $(this).children('.details').attr('href');
  $(this).children('.image').attr('href',iurl);
});



//Make non-thumb images and images in diffs behave correctly, too
$('a.image[href^="http"]').attr('href',function(){
  var imgtitle = $(this).attr('data-image-name');
  return "/wiki/File:"+imgtitle;
});

Image stuff that hasn't work in awhile now (at least in Oasis), and I suspect may be the cause of the "File:Undefined" errors. - Archduk3 04:01, August 20, 2014 (UTC)

Fixing the display of non-image files[]

Hi, all. Yesterday, I got an idea when reading this. PDF files on Fandom wikis display as the Adobe icon on their file description pages instead of showing the file itself like other file formats do. Furthermore, it is impossible to embed PDFs on pages – you just have to link to the PDF. This isn't an issue for MA, as there are only thirty-one PDFs on MA, all of which are candidates for deletion.

However, a comment on the deletion discussion for the aforementioned PDFs inspired me to see if there was a way to fix this with JavaScript, and I was more than successful. Today, I wrote several relatively simple script that (1) replace the Adobe icon shown on PDF file description pages with a small widget displaying the PDF, (2) do the same for categories with contain PDFs, and (3) allow for PDF widgets to be added to pages.

As I mentioned, none of this is very useful at the moment, as there are virtually no PDFs on MA. However, there is a reason I decided to write this post aside from the potential of PDFs becoming more common on MA in the future. While I was working on the PDF scripts, I remembered that audio files display as broken image links in categories instead of as an audio player like they do on file pages and when included elsewhere. I decided to adapt my PDF-correction script to fix the display of audio files in categories.

My first proposal is that we add my audio file script to the wiki's JavaScript. The JavaScript is as follows:

/* Display audio files in categories */

const soundFile = $('.ns-14 [data-image-key$=".ogg"]');

soundFile.each(correctAudioFiles);

function correctAudioFiles(){
  $(this).after('<audio src="/wiki/Special:Redirect/file/'+$(this).attr('data-image-key')+'" controls>');
  $(this).remove();
}

My second proposal is that we add my PDF scripts either to the the site's main JavaScript file or as a gadget or series of gadgets. For the moment, these scripts aren't really very useful at all, as the only PDFs we have will almost certainly be deleted before long. However, they could become more useful if more PDFs are uploaded in the future and have a reason to stay.

The JavaScript for PDFs on file pages is as follows:

/* Display PDFs on PDF file pages */

const adobeIcon = $('.ns-6 [src="/resources-ucp/mw139/resources/assets/file-type-icons/fileicon-pdf.png"]').parent();

adobeIcon.parent().prepend('<embed src="/wiki/Special:Redirect/file/'+mw.config.get("wgTitle")+'" width="250" height="auto">');
adobeIcon.remove();

The JavaScript for PDFs in categories is shown below (some CSS is required for this, which is shown below the JavaScript):

/* Display PDFs in categories */

const adobeCatIcon = $('.ns-14 [data-image-key$=".pdf"]');

adobeCatIcon.each(removeAdobeIcon);

function removeAdobeIcon(){
  const fileName = $(this).attr('data-image-key');
  $(this).after('<embed src="/wiki/Special:Redirect/file/'+fileName+'" width="185" height="185"><div class="thumbcaption pdf-thumbcaption"><a href="/wiki/File:'+fileName+'" class="info-icon pdf-info-icon"><svg><use xlink:href="#wds-icons-info-small"></use></svg></a></div>');
  $(this).parent().addClass('thumb show-info-icon');
  $(this).remove();
}
/* PDF info-icon */

.pdf-thumbcaption{
  width:100%;
  height:100%;
}

.pdf-info-icon{
  bottom:0!important;
}

The JavaScript for enabling PDF widgets is as follows (CSS for this one is shown below the JavaScript, just like the last one):

/* Embed PDF widgets into pages */

const widget = $('.pdf-widget');

widget.each(embedPDFs);

function embedPDFs(){
  const specifiedFile = $(this).attr('data-file');
  const float = $(this).attr('data-float') ? $(this).attr('data-float') : 'right';
  const caption = $(this).attr('data-caption') ? $(this).attr('data-caption').replace(/'''(.+?)'''/g, '<b>$1</b>').replace(/''(.+?)''/g, '<i>$1</i>').replace(/\[\[(.+?)\|(.+?)\]\]/g, '<a href="/wiki/$1">$2</a>').replace(/\[\[(.+?)\]\]/g, '<a href="/wiki/$1">$1</a>') : '';

  $(this).html('<figure class="thumb t'+float+' show-info-icon"><embed src="/wiki/Special:Redirect/file/'+specifiedFile+'" width="174.028" height="auto"><figcaption class="thumbcaption"><a href="/wiki/File:'+specifiedFile+'" class="info-icon pdf-widget-info-icon"><svg><use xlink:href="#wds-icons-info-small"></use></svg></a><p class="caption">'+caption+'</p></figcaption></figure>');
}
/* PDF info-icon */

.pdf-widget-info-icon{
  bottom:135%!important;
}

Using this script, you can embed a PDF in pages via <div class="pdf-widget" data-file="Build The Enterprise D Issue 01.pdf" data-caption="A PDF file"></div>. To change which file you are embedding, change the value of data-file. To change the caption, change the value of data-caption. To shift the widget over to the right side, remove the data-float attribute or set it to right.

To test out these scripts, feel free to copy and paste whichever you wish into your local or global JavaScript file (if you are testing one of the ones which is aided by CSS, don't forget to paste the CSS into your local or global CSS file). You can then navigate to an audio file category (example) to test the first script; a PDF file page (example) to test the second; a category containing PDF files (example, may take some time to load) to test the third; or this page, in which I have embedded two PDF files, to test the fourth.

Sorry that this post got to be so long :) Questions or comments are more than welcome! 🖖 Mr. Starfleet Command (open a channelcontributionsactivity) 21:26, 14 January 2024 (UTC)

As embedding PDFs via that style is ungainly and utterly awful, let's make a template for them with the default being right, and allowing for it to be floating or left. Then that will be somewhat more useful. Template options should be:
  • file=
  • caption=
  • align= (default to "right", allow "left")
-- Sulfur (talk) 22:56, 14 January 2024 (UTC)

Yeah, I was also thinking a template would be a good idea :) That should be pretty easy to make. 🖖 Mr. Starfleet Command (open a channelcontributionsactivity) 00:35, 15 January 2024 (UTC)

I've create the aforementioned template in my user-space. I'll move it into the template namespace if and when the above script is added to our JS file. Sulfur or other users, feel free to make minor edits to the template if you think it should work slightly differently.

Now that the template's been set up, are we going to add the above JS and CSS to the site JS and CSS files? 🖖 Mr. Starfleet Command (open a channelcontributionsactivity) 22:58, 13 March 2024 (UTC)

I'm heading out, but I'll try to get to it tomorrow. Remind me if I forget. :) -- Renegade54 (talk) 14:45, 14 March 2024 (UTC)
Advertisement