Welcome to the Invelos forums. Please read the forum rules before posting.

Read access to our public forums is open to everyone. To post messages, a free registration is required.

If you have an Invelos account, sign in to post.

    Invelos Forums->DVD Profiler: Layouts and Reports Page: 1 2  Previous   Next
HTML Window -> Wikipedia
Author Message
DVD Profiler Unlimited RegistrantRossRoy
Registered: March 13, 2007
Posts: 793
Posted:
PM this userDirect link to this postReply with quote
Quoting pauls42:
Quote:
Another nice change.. (not sure what's actually changed) but I'm sure it must have been nice.. 


I can help you with that. The code is a little cleaner, with 1 left IF statement (doesn't change anything functionally), and maybe other stuff that I have not noticed.

But, you now have the option of having the Wikipedia page load right when the profile is loaded in Profiler, or, if you'd rather keep the load on the system and bandwidth consumption to a minimum, you can have show a clickable link, that will load the Wikipedia page on demand.

Which makes me think of a feature request/or bug (depending how you want to see it). Maybe Profiler should execute/load the HTML Windows' code only when the HTML window gets activated?

Or is it already the case?
 Last edited: by RossRoy
DVD Profiler Unlimited Registrantxyrano
41215.reg 70320.urk
Registered: March 13, 2007
Sweden Posts: 646
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Quoting mikl:
Quote:
Good idea! 
Now, is there a way to hack it so it removes the menu strip on the left, to save some space?

Uhm, with the current security settings in IE7 it is impossible to splice up a web page through javascript.

Quoting RossRoy:
Quote:
Nah! Helps me actually, seeing a master of JavaScript at work.
x  Anything I can do to help, I'll try to do...

You seem to like my little gradient, I've seen you add it to a few of your Windows 
x: Yep, I got it in all my HTML windows 

So that's how to do it! I want to avoid the extra if statement, but I couldn't get this shorthand version to work when I tried it. Time to change my script too!

Thanks for again improving upon it! 
x: Yea, this conditional operator '?' var result = (statement) ? true: false; is quite nice... short and sweet

Your Welcome!

Quoting pauls42:
Quote:
Another nice change.. (not sure what's actually changed) but I'm sure it must have been nice.. 


I can help you with that. The code is a little cleaner, with 1 left IF statement (doesn't change anything functionally), and maybe other stuff that I have not noticed.
But, you now have the option of having the Wikipedia page load right when the profile is loaded in Profiler, or, if you'd rather keep the load on the system and bandwidth consumption to a minimum, you can have show a clickable link, that will load the Wikipedia page on demand.
x: That's about it, well your cool bgimage.jpg naturally included 

Which makes me think of a feature request/or bug (depending how you want to see it). Maybe Profiler should execute/load the HTML Windows' code only when the HTML window gets activated?

Or is it already the case?

I believe that only HTML windows that has focus (tab selected) gets updated. I noticed this when I had one of my HTML windows floating about (selected)... the other didn't update. It least that's what I recall...
DVD Profiler Unlimited RegistrantRossRoy
Registered: March 13, 2007
Posts: 793
Posted:
PM this userDirect link to this postReply with quote
Quoting xyrano:
Quote:
I believe that only HTML windows that has focus (tab selected) gets updated. I noticed this when I had one of my HTML windows floating about (selected)... the other didn't update. It least that's what I recall...


I think you're right. I took advantage of the fact that my internet connection is a bit slow tonight, and when switching from gallery to Wikipedia, I see the Wikipedia page load.
DVD Profiler Desktop and Mobile Registrantdetlefs
Regd. since: 09/20/2001
Registered: March 14, 2007
Germany Posts: 273
Posted:
PM this userVisit this user's homepageView this user's DVD collectionDirect link to this postReply with quote
Hi guys,

inspired by the nice YouTube/GoogleVideo HTML window, I have enhanced this Wikipedia window to support a new (more XML like) syntax. This way, both syntaxes are equal, it has the advantage to not be displayed in the regular Notes view, and is a little more flexible. 

New Syntax:
<wiki page=TheWikipediaTitle />          Embeds the Wikipedia page
or
<wiki link=TheWikipediaTitle />            Creates a link to Wikipedia

The old syntax <wiki>TheWikipediaTitle</wiki> is still supported, so nobody needs to change their already existing notes entries.

If no wiki tag is found, a Wikipedia search link (for movie title) is generated.

Quote:

<HTML>
<HEAD>
<SCRIPT TYPE="text/javascript">
<!--
<DP NAME="HEADER_VARS" Language="JavaScript" Comments="True" IncludeCast="False" IncludeCrew="False">
/**************************************************/
// Start: Wikipedia configuration
var wikiURL = "http://en.wikipedia.org/wiki/";
var wikiSearchURL = "http://en.wikipedia.org/wiki/Special:Search?search=";
var wikiSearchFullText = "&fulltext=Search"; // Leave empty if you don't want full text search
// End: Wikipedia configuration

// Open Wikipedia page for the profile
function wiki() {
var wikiStart = DP_Notes.toLowerCase().search("\<wiki\>") + 6;
var wikiEnd = DP_Notes.toLowerCase().search("\</wiki\>");
var wikiCode = "";
var wikiLink = "";

if (wikiEnd > 1) {
wikiCode = DP_Notes.slice(wikiStart, wikiEnd);
wikiLink = (wikiURL + wikiCode);
window.location.href = wikiLink;
} else {
switch(wikiType()) {
case 1:
PageWiki();
break;
case 2:
LinkWiki();
break;
case -1:
wikiLink = (wikiSearchURL + DP_Title);
document.getElementsByTagName("h1")[0].innerHTML = "Wikipedia search: <a href='" + wikiLink + wikiSearchFullText + "' target='_new' onFocus='blur(this);'>" + DP_Title + "</a>";
break;
}
}
}

// Retrieve the Wiki display type
// Returns -1: No Wiki XML tag found
//                1: Wiki page entry found
//                2: Wiki link entry found
function wikiType() {
var wStart = DP_Notes.indexOf("\<wiki");
var wPage = DP_Notes.indexOf(" page=", wStart);
var wLink = DP_Notes.indexOf("link=", wStart);
// alert ("Start: " + wStart + " : Page: " + wPage + " : Link: " + wLink);

if (wStart < 0) {
return -1;
}
if (wPage > -1) {
return 1;
}
if (wLink > -1) {
return 2;
}
return -1;
}

// Display Wiki link
function LinkWiki() {
wikiStart = DP_Notes.indexOf("\<wiki link=") + 11;
wikiEnd = DP_Notes.indexOf("/\>", wikiStart);
if (wikiStart > 10 && wikiEnd > 1) {
wikiCode = DP_Notes.slice(wikiStart, wikiEnd);
wikiLink = (wikiURL + wikiCode);
// alert (wikiLink);
document.getElementsByTagName("h1")[0].innerHTML = "Wikipedia: <a href='" + wikiLink + "' target='_new' onFocus='blur(this);'>" + wikiCode + "</a>";
}
}

// Display Wiki page embedded
function PageWiki() {
wikiStart = DP_Notes.indexOf("\<wiki page=") + 11;
wikiEnd = DP_Notes.indexOf("/\>", wikiStart);
if (wikiStart > 10 && wikiEnd > 1) {
wikiCode = DP_Notes.slice(wikiStart, wikiEnd);
wikiLink = (wikiURL + wikiCode);
// alert (wikiLink);
window.location.href = wikiLink;
}
}


//-->
</SCRIPT>
</HEAD>
<BODY onload="wiki();">
<h1></h1>
</BODY>
</HTML>
DVD Profiler Unlimited Registrantbbmountain
Registered: March 16, 2007
Posts: 50
Posted:
PM this userEmail this userView this user's DVD collectionDirect link to this postReply with quote
Is it possible to integrate the Wikipedia window into the "customtab" on the Mithirandir skin?  And if it is, how would one go about doing it?
DVD Profiler Desktop and Mobile RegistrantStar ContributorSH84
Registered: March 13, 2007
Reputation: High Rating
Germany Posts: 922
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
It would be nice to have a tag to choose another Wikipedia language for just one special profile (e.g. <wiki lang=en> or <wiki lang=de>).

BTW: I'm using the print view of Wikipedia, the syntax is "http://en.wikipedia.org/w/index.php?title=" + title + "&printable=yes"; The only problem I'm aware of is a title with an &.

Deutsches DVD Profiler Forum: www.dvdprofiler-forum.de
DVD Profiler Desktop and Mobile Registrantpauls42
Reg: 31/01/2003
Registered: March 13, 2007
United Kingdom Posts: 2,692
Posted:
PM this userEmail this userVisit this user's homepageView this user's DVD collectionDirect link to this postReply with quote
Quoting SH84:
Quote:
It would be nice to have a tag to choose another Wikipedia language for just one special profile (e.g. <wiki lang=en> or <wiki lang=de>).



why would you ever want just one page to be in a different language?
Paul
DVD Profiler Desktop and Mobile RegistrantStar ContributorSH84
Registered: March 13, 2007
Reputation: High Rating
Germany Posts: 922
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
There're many German Movies that aren't in the English Wikipedia at the moment.

Deutsches DVD Profiler Forum: www.dvdprofiler-forum.de
DVD Profiler Desktop and Mobile RegistrantMarEll
Registered: June 9, 2007
United Kingdom Posts: 1,208
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Oh my God this is a great little feature!

What other uses for the HTML window are there?
    Invelos Forums->DVD Profiler: Layouts and Reports Page: 1 2  Previous   Next