Wikibooks:Reading room/Archives/2011/July

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Userboxes

[edit source]

Hello, this is fountain pen. I'm trying to add some columns of user boxes to my personal page, but when I put them in they refuse to form straight columns and look strange, with random blank spaces in between userboxes, even though there are no blank spaces in the code. Any ideas?

--Fountain Pen (discusscontribs) 18:32, 28 June 2011 (UTC)[reply]

P.S. The problem is in the "More About Me" section. The other userboxes on the page are fine. Fountain Pen (discusscontribs) 18:33, 28 June 2011 (UTC)[reply]

Most userboxes are designed to float left by default or right by default (I'd prefer right). They aren't all the same height, so you get those spaces as they bunch up in a weird manner. What you'd want is to line them up in a table. – Adrignola discuss 04:46, 29 June 2011 (UTC)[reply]
I am using Template:Userboxtop --XanaG (discusscontribs) 06:27, 29 June 2011 (UTC)[reply]

I tried both of these ideas, but am still having the same problem. --Fountain Pen (discusscontribs) 17:49, 29 June 2011 (UTC)[reply]

You could also try looking at different user pages and, if you find something similar to what you want to achieve, see what the page source looks like. --XanaG (discusscontribs) 00:07, 30 June 2011 (UTC)[reply]
User Red4tribe has arranged userboxes into three columns on his page, but it does seem to involve quite a lot of low level work. Recent Runes (discusscontribs) 18:26, 30 June 2011 (UTC)[reply]
Of possible interest, w:User:Pi zero#Userboxes (arranged back when I was active there). --Pi zero (discusscontribs) 18:33, 30 June 2011 (UTC)[reply]

I just tried XanaG's idea again, and it worked. I must have just typed it wrong the first time. Thanks for the help.

--Fountain Pen (discusscontribs) 16:24, 2 July 2011 (UTC)[reply]

Number of views of a book

[edit source]

Hello guys! My question is, do you know whether there is a tool like this but which works for Wikibooks too? ---151.75.24.20 (discuss) 06:13, 16 June 2011 (UTC)[reply]

Hmm, at least a top 1000 list is available for wikibooks: from the same site. --Martin Kraus (discusscontribs) 11:14, 16 June 2011 (UTC)[reply]
More details at Wikibooks:Statistics. – Adrignola discuss 13:58, 16 June 2011 (UTC)[reply]
stats.grok.se can be persuaded to give stats for pages on non-wp projects, by fiddling directly with the URL. For example, the stats for page Conlang for June 2011 would be http://stats.grok.se/en.b/201106/Conlang --Pi zero (discusscontribs) 04:16, 17 June 2011 (UTC)[reply]
Page view stat utilities on WP are IMexperience very unreliable. Pages with numerous editors come in as zero.[[User:Geof Bard गीता]] (discusscontribs) 01:18, 4 July 2011 (UTC)[reply]
Interesting. Could you suggest examples? It'd be nice to understand whether the conditions for this ever apply to Wikibooks.
  • June 2011 on the en.wp Village pump (proposals): stats
  • Last month on the en.wb Reading room/Technical Assistance: stats
--Pi zero (discusscontribs) 08:28, 4 July 2011 (UTC)[reply]

jquery help

[edit source]

I coded a kind of tooltip for use in a book. I used these jquery and css codes:

$(".suffix").hover( function() {
  var pos = $(this).position(); // position of the 'suffix'
  $(this).wrap('<div class="tbox" />'); // make 'suffix' a part of 'tbox'
  var tbox = $(this).parent(".tbox");
  $(this).data('title',$(this).attr('title')); 
  var tooltip = $(this).data("title");
  $(this).removeAttr('title'); // remove title to prevent native tooltip
  tbox.append('<span class="tooltip">' + tooltip + "</span>"); // add the tooltip text
  tbox.css( { "display": "block", "left": (pos.left-5) + "px", "top": (pos.top-7) + "px" } ); // set the position of the 'tbox'
  $(this).clone().insertBefore(tbox).attr("id", "csuffix"); // place a clone of the 'suffix' as a placeholder
}, function() {
  var tbox = $(this).parent(".tbox");
  var clone = tbox.prev("#csuffix"); 
  clone.remove(); //remove clone
  $(this).insertBefore(tbox); //replace 'suffix'
  var tbox = $(this).siblings(".tbox"); //tbox is no longer parent
  tbox.remove();
  $(this).attr('title',$(this).data("title")); //replace 'title' for another hover event
} );
.suffix 
{ padding: 1px;
  color: #333;
  font-weight: bold;
}
 
.tbox {
  position: absolute;
  display: none;
  border: 1px solid #bebebe; 
  background: #f0f0f0;
  border-radius: 5px;
  cursor: pointer;
  padding: 6px 3px 6px 0px;
  box-shadow: 0px 1px 5px #ccc;
  -moz-box-shadow: 0px 1px 5px #ccc;
  -webkit-box-shadow: 0px 1px 5px #ccc;
}
 
.tbox .tooltip
{
  border: none;
  display: inline;
  margin: 2px;
  padding-left: 2px;
}
 
 
.tbox .suffix {
  padding: 1px;
  color: #333;
  margin-left: 3px;
  font-weight: bold;
  border: 1px solid #bebebe; 
  padding-top: 2px;
  padding-bottom: 2px;
  background: #f9f9f9;
  box-shadow: inset 1px 1px 5px 0px #ccc;
  -moz-box-shadow: inset 1px 1px 5px 0px #ccc;
  -webkit-box-shadow: inset 1px 1px 5px 0px #ccc;
  border-radius: 3px;
  -moz-border-radius: 3px;
  -webkit-border-radius: 3px;
 
}

In Chrome and Firefox, this code works. But in Internet Explorer, it doesn't work well. Which part of this code is problematic? Please help. Srhat (discusscontribs) 10:45, 3 July 2011 (UTC)[reply]

I believe Internet Explore does not recognize box-shadow and border-radius. Beyond that, I cannot guess without knowing what isn't working for you. --darklama 12:33, 3 July 2011 (UTC)[reply]
Thank you the problem was that Internet Explorer was creating more than one tooltip boxes. I solved the problem by changing the coe with this one:
$(".suffix").hover( function() {
      if (!$(this).parents().hasClass("tbox")) {
         var pos = $(this).position(); // position of the 'suffix'
         $(this).wrap('<div class="tbox" />'); // make 'suffix' a part of 'tbox'
         var tbox = $(this).parent(".tbox");
         $(this).data('title',$(this).attr('title')); 
         var tooltip = $(this).data("title");
         $(this).removeAttr('title'); // remove title to prevent native tooltip
         tbox.append('<span class="tooltip">' + tooltip + "</span>"); // add the tooltip text
         tbox.css( { "display": "block", "left": (pos.left-5) + "px", "top": (pos.top-7) + "px" } ); // set the position of the 'tbox'
         $(this).clone().insertBefore(tbox).attr("id", "csuffix"); // place a clone of the 'suffix' as a placeholder
      }
   }, function() {
      var tbox = $(this).parent(".tbox");
      var clone = tbox.prev("#csuffix"); 
      clone.remove(); //remove clone
      $(this).insertBefore(tbox); //replace 'suffix'
      var tbox = $(this).siblings(".tbox"); //tbox is no longer parent
      tbox.remove();
      $(this).attr('title',$(this).data("title")); //replace 'title' for another hover event
} );

. Srhat (discusscontribs) 12:39, 3 July 2011 (UTC)[reply]

Consider saving the object "$(this)" to a variable "$this" and then use that variable instead of calling the function "$()" multiple times to get the same object. Helder 00:05, 4 July 2011 (UTC)[reply]

Review Book I'm Working On

[edit source]

I've spent some time over the past few months starting the book RAC Attack - Oracle Cluster Database at Home. I finally got conventions for style and layout that were satisfactory to me, and just this morning I finished migrating in all content from the first section of the original book (CC-BY-SA).

At this stage, I'm wondering if some experienced wikibookians have a few minutes to skim over the structure and style choices I've made and pass along any comments?

here are a few highlights of design decisions:

  • flat structure for pages, but a deep structure for page categories (good organization for lots of pages which are coming, but easy to move pages between sections) - note this is automatically accomplished with templates
  • all images are max 550px wide... and i'm pretty sure that copyright information is correct in uploads (check?)
  • templates for top and bottom navigation components; chapter overview pages double as templates for content pages
  • standardized combination of html and wiki-markup to get good spacing and formatting on pages
  • planning to eventually code an updated version of User:Derbeth/javaLatex for PDF and printing (lots of effort, but no love from mwlib.rl/pediapress)
  • planned workflow: initial version of lab handbook is very thoroughly tested; all new pages will go into "BullPen" at first until they are tested by somebody and then moved into an appropriate section of the book

I'd also appreciate any thoughts gleaned from looking directly at the book itself. Thanks!

--ArdentPerf (discusscontribs) 17:37, 12 July 2011 (UTC)[reply]

Why should diagrams and other illustrations be created custom for the book? In fact that requirement is the only thing that makes the convention necessary...
Aside for that the only thing I personally dislike is the use of extra navigation templates but in your case since you aren't using the slash convention it may be required, in any case I would substitute the one used for only a link to the top index and the previous and next page.
Good work... --Panic (discusscontribs) 20:20, 12 July 2011 (UTC)[reply]
The reason I mention diagrams/illustrations being created custom is that I don't want people to upload any non-free media which could have been self-created and released under free license. In other words, all media must be compatible with and uploaded to the commons, unless it's a screenshot which can't be. Right now there are only a few media under this (non-screenshot) category: the cover/title page graphic, the flowchart of the labs, an architectural overview and a vertical arrow from the first content page. Of course it's best to re-use content which has already been uploaded to commons (like the vertical arrow in the first content page). Thanks for the comments! --ArdentPerf (discusscontribs) 17:06, 13 July 2011 (UTC)[reply]

Weird message

[edit source]

For some reason when I acess the page Special:RevisionDelete I'm getting this unrelated warning. Could someone restore the original text of the message? Helder 22:12, 4 July 2011 (UTC)[reply]

Maybe it is enough to use a {{#ifeq:{{FULLPAGENAME}}|Special:Upload|current message|original message}}. Helder 22:15, 4 July 2011 (UTC)[reply]
Yes, that message was modified for people clicking red-linked images at Wikibooks, which points to the local upload form rather than Commons, when we only allow admins/uploaders to upload non-free files locally. It's true that it appears for other permissions errors as well. I've implemented your suggested code and it does appear to work. Thanks! – Adrignola discuss 15:39, 5 July 2011 (UTC)[reply]
Do you know about $wgUploadMissingFileUrl? See e.g. bugzilla:29360. Helder 00:35, 6 July 2011 (UTC)[reply]

Collection extension update

[edit source]

I just wanted to note that the proposal discussed on

Wikibooks:Reading_room/Proposals/2011/March#Define $wgCollectionHierarchyDelimiter = "/" for Wikibooks project(s)

was implemented, closing bug 29648. Now this kind of edit will not be necessary anymore ;-) Helder 14:19, 20 July 2011 (UTC)[reply]

InterWiki templates

[edit source]

On the Subject:Languages there is the best horizontal interWiki template. Can I place the same template on the category Category:Languages ? Or vertical templates more useful in that case? --Averaver (discusscontribs) 15:36, 18 July 2011 (UTC)[reply]

I agree with your idea. It should look neater and save space on the page. I think you can be bold here, and make the change without any more discussion. Recent Runes (discusscontribs) 17:57, 18 July 2011 (UTC)[reply]
Ok. I placed horizontal interWiki template on the category Category:Languages . If no objection for it I will update some other articles and categories on Wikibooks. --Averaver (discusscontribs) 01:57, 19 July 2011 (UTC)[reply]
What is "best" is a mater of opinion. I think Template:Sisterlinks is probably better than Template:Associated Wikimedia because it doesn't use as much screen space and compliments rather than draw attention away from what a page is about. --darklama 16:43, 19 July 2011 (UTC)[reply]
Yes, the information directly relating to the Wikibooks category is probably the main reason to visit the page so the smaller template is preferable. Recent Runes (discusscontribs) 18:36, 19 July 2011 (UTC)[reply]
The Template:Sisterlinks template is similar to the w:Template:Sister project links from Wikipedia. The Template:Associated Wikimedia template is more powerful for manual control of interWiki links. --Averaver (discusscontribs) 07:45, 20 July 2011 (UTC)[reply]
I added a way to manually control interwiki links for each project with the Sisterlinks template too now. --darklama 19:29, 20 July 2011 (UTC)[reply]
Thank you. Could you please place some info about that facility to template's article? --Averaver (discusscontribs) 18:11, 21 July 2011 (UTC)[reply]

Thanks it kinda helped me..! — Preceding unsigned comment added by Engrspaceman (talkcontribs)