INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Need Javascript help for new Track Info  (Read 8583 times)

drosoph

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 661
  • TiVo-aholic
Need Javascript help for new Track Info
« on: July 07, 2003, 10:56:49 am »

Here is the jist of what Im doing ... trying to make a dynamic plugin for files that do not have cover art... for the Slideshow to popup in its place ...

Here is sample code ... I know NOTHING of javascript .. can someone look at this and tell me what is glaringly wrong !!!

<script>
     function CoverArt() {
             var artfile;      
       if (TrackInfo_Insert(Image File) != null) {
          artfile = "<IMG SRC="TRACKINFO_INSERT_IMAGE" >"
       } else {
          artfile = "<object classid="clsid:46848D62-2387-46B0-8B89-00E57F849BA9"
id="SlideShowCtrl1" data="DATA:application/x-oleobject;BASE64,Yo2ERocjsEaLiQDlf4SbqQADAADYEwAA2BMAAA=="
height="250"></object>"
       }
       CoverArtorSlideShow.innerHTML = artfile;
     
     }
     window.onload = CoverArt;
</script>

Than, how do I insert the results into the page ?

knickelfarz

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 493
Re: Need Javascript help for new Track Info
« Reply #1 on: July 10, 2003, 06:07:04 am »

Here is an example for what you are looking for:
Install "Test01-OClock"
It doesn't do anything to check if the slideshow plugin is installed, yet.

Remember: The scripting will work only in the "Generated.html" where the keywords are already replaced by track information - so it doesn't make sense to search for something like "TRACKINFO_INSERT_IMAGE" here...
Logged

drosoph

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 661
  • TiVo-aholic
Re: Need Javascript help for new Track Info
« Reply #2 on: July 10, 2003, 07:34:29 am »

Dude, you rock ! ... Excellent way of doing it !

drosoph

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 661
  • TiVo-aholic
Re: Need Javascript help for new Track Info
« Reply #3 on: July 16, 2003, 05:39:57 pm »

I love it .. but I dont use full screen so added scrollbars to the lyrics, notes, and bios windows ...
Install "Drosoph-OClock"

Enjoy

knickelfarz

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 493
Re: Need Javascript help for new Track Info
« Reply #4 on: July 17, 2003, 07:26:39 am »

Quote
Install "Drosoph-OClock"

Enjoy


I would like to, but...please check the link  ;)
Logged

drosoph

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 661
  • TiVo-aholic
Re: Need Javascript help for new Track Info
« Reply #5 on: July 17, 2003, 07:43:37 am »

Works fine for me from work ... what error are you getting ? Do you not even get to the MJP file or are you having troubles reaching the ZIP file during install ?


(BTW I altered the link to not use the forwarding server, maybe tht will help you if you were having problems with getting the MJP file)

knickelfarz

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 493
Re: Need Javascript help for new Track Info
« Reply #6 on: July 17, 2003, 08:10:14 am »

I can get the mjp file, but the link inside seems to be wrong:
http://dns.drosoph.com/drosoph/drosoph.zip


EDIT: I can now get the ZIP, too (manual)
But installing with the mjp does not seem to work...maybe some "safety restrictions" of the download logic ?
Logged

drosoph

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 661
  • TiVo-aholic
Re: Need Javascript help for new Track Info
« Reply #7 on: July 17, 2003, 08:20:58 am »

I dont know what the deal is ... IE has a problem installing directly ...

You have to save the MJP file first then execute it .. and it will work !

knickelfarz

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 493
Re: Need Javascript help for new Track Info
« Reply #8 on: July 17, 2003, 08:30:38 am »

OK, I took a look at it...the inner scrollbars are very useful...I will add them to my next version, too.

I'm just working on a "smart" version that is DHTML based, without extra pages for bios, lyrics and notes. So you can switch to bios, lyrics and notes without reloading the page...this prevents the slide show from restarting if you take a look at bios while a track without cover art is running, for example...for this, a lot of scripting is needed, so I will need some more days to finish it...
Logged

drosoph

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 661
  • TiVo-aholic
Re: Need Javascript help for new Track Info
« Reply #9 on: July 17, 2003, 08:31:38 am »

Beautiful .. thats what I tried to do using IFrames .. but MC doesnt support IFrames ..

Good luck .. how many beers do I owe you ?

knickelfarz

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 493
Re: Need Javascript help for new Track Info
« Reply #10 on: July 17, 2003, 08:52:47 am »

Quote
Beautiful .. thats what I tried to do using IFrames .. but MC doesnt support IFrames ..
I think MC's little "server" for HTML pages would get too complicated if it would try to support frames...

Quote
Good luck .. how many beers do I owe you ?
He, he, you gave me a good idea for starting something different - that's quite enough ;) Anyhow, I prefer german beer ;D

I hope some more people will like the "smart" version when it's complete...I will add a tool that allows the users to change the colors, the size of the cover art and something more without touching the HTML...but there is still much work to do :P

If you would like to take a look at the beta, download it here.
Logged

drosoph

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 661
  • TiVo-aholic
Re: Need Javascript help for new Track Info
« Reply #11 on: July 17, 2003, 11:59:40 am »

On first load, Im having to click on General to get the info to show up ..


Getting a few Script errors on new songs starting up ...

Can you also make the default windows for lyrics/bios/notes fill the space to the bottom of the cover art .. or should I just wait and see how the dynamic resize of cover art works out first :)

drosoph

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 661
  • TiVo-aholic
Re: Need Javascript help for new Track Info
« Reply #12 on: July 18, 2003, 01:41:11 pm »

Knickelfarz ... any updates to it yet ? I dont want to keep downloading until you let me know you've made a revision :)

knickelfarz

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 493
Re: Need Javascript help for new Track Info
« Reply #13 on: July 21, 2003, 07:26:18 am »

Maybe you would like to take a look at this one.

You will get errors if you play tracks with quotation marks somewhere in the fields / tags:

DJ Drosoph's 12"Remix > Error
DJ Drosoph's 12inchRemix > OK

Quotation marks are not masked/filtered out, yet.

The slide show will restart if a new track starts to play - you can not prevent that by scripting.
You can only prevent the slide show from restarting if you take a look at bios/lyrics/notes while a track without cover art is running.
Logged

drosoph

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 661
  • TiVo-aholic
Re: Need Javascript help for new Track Info
« Reply #14 on: July 21, 2003, 09:03:19 am »

Great build ... I havent had time to test if there are problems with any other characters ...

When I get home from work I will put it through its paces ...

drosoph

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 661
  • TiVo-aholic
Re: Need Javascript help for new Track Info
« Reply #15 on: July 21, 2003, 02:31:41 pm »

Ok ... in my testing I'm also seeing the Quotemark " problem.

It's hard to avoid since most artist Bios contain quotes :(

knickelfarz

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 493
Re: Need Javascript help for new Track Info
« Reply #16 on: July 21, 2003, 05:33:33 pm »

Please check this one. Should eat everything...
Logged

drosoph

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 661
  • TiVo-aholic
Re: Need Javascript help for new Track Info
« Reply #17 on: July 21, 2003, 05:55:11 pm »

Alright  ... you've now got it dying on SINGLE Quotes '  :)

But double quotes " work fine !

drosoph

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 661
  • TiVo-aholic
Re: Need Javascript help for new Track Info
« Reply #18 on: July 24, 2003, 04:33:39 pm »

DOnt forget to make the DIV element on the bios section 195 pixels .. there only one header line on it .. so it needs to be longer than the other sections ..

knickelfarz

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 493
Re: Need Javascript help for new Track Info
« Reply #19 on: July 25, 2003, 03:53:22 am »

Please check this one.
I couldn't find a way to mask both single quotes and double quotes to avoid java script errors ... so I do not use the MC keyword results as variables anymore ... All in all it's just more simple this way ;)

The "RELOAD" link is just for testing...if everything is fine, you can delete it from the HTML.
Logged

drosoph

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 661
  • TiVo-aholic
Re: Need Javascript help for new Track Info
« Reply #20 on: July 25, 2003, 12:41:14 pm »

I think we both came to the same conclusion .. there is no way to define a string variable without putting the single/double quotes on it and having issues with Single/Double quotes in the output string !!!

Great work ... Im having no problems with it ...

Where do I send the beer to again ?  Ya know, when ur in Dallas ur welcome to come sit for a few!

knickelfarz

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 493
Re: Need Javascript help for new Track Info
« Reply #21 on: July 27, 2003, 09:20:18 am »

If I will ever be in Dallas, we will see what's in your fridge ;)

Maybe you would like to test the first version of the "XtraSmart" Track Info template...
By clicking on the small "wrench icon" in the upper right, it opens a tool to set up your "style" without touching HTML. So far, you can set the colors and the background image of the template, but there is much more to come soon ;)



It requires the Shockwave browser plugin, Version 8 or higher. Shockwave is similar to Flash...if you didn't installed it yet, you can download it for free from here (first install Shockwave, then use "XtraSmart"!): http://www.macromedia.com/shockwave/download/alternates/

With Shockwave, you are allowed to save and read a text file in the Shockwave directory (In this case "C:\WinNT\System32\Macromed\Shockwave 8\Prefs\"). For security reasons, you can only save a simple text file and only in that directory. But that's enough, if the browser/MC's Playing Now window uses this file as an external CSS / stylesheet file...

That's why the current version of "XtraSmart" even requires the Windows directory "C:\WINNT\" (like it's standard on WinNT, Win2K and even WinXP (I 'm not sure about XP exactly...)). If you have installed Windows somewhere else ("D:\Windows\" for example...), please let me know, I will then post a modified version.

Thanks for testing!
Logged

drosoph

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 661
  • TiVo-aholic
Re: Need Javascript help for new Track Info
« Reply #22 on: July 27, 2003, 11:27:24 am »

Yep, C:\Windows here !

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
Re: Need Javascript help for new Track Info
« Reply #23 on: July 27, 2003, 11:51:58 am »

why not just find the default system dir

i know there is a way of doing it, it slips my memory right now.

Updated:

VB6

Private Declare Function GetSystemDirectory& Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long)

Public Function SystemDirectory()
 Dim strBuffer As String * 260

 GetSystemDirectory strBuffer, 260

 SystemDirectory = Left(strBuffer, InStr(strBuffer, Chr(0)) - 1)
End Function

Private Sub Command1_Click()
Text1.Text = SystemDirectory
End Sub

Private Sub Form_Load()
Text1.Text = SystemDirectory
End Sub
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

knickelfarz

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 493
Re: Need Javascript help for new Track Info
« Reply #24 on: July 27, 2003, 12:11:26 pm »

Quote
Yep, C:\Windows here !

OK, please try this one...It's for C:\Windows

Quote
why not just find the default system dir...

Hello King!
Thanks for the VB example...but in this case, I've got to find a way to get the windows path inside the browser or inside shockwave. I guess it will not be possible to do it with JavaScript or VBScript, but it's possible with shockwave...it's just a little bit complex with shockwave, so I didn't spend time yet to realize it...of course it's essential, so it will be the next thing on my list...

Again: Thanks for testing!


Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
Re: Need Javascript help for new Track Info
« Reply #25 on: July 27, 2003, 12:26:56 pm »

well not into the testing thing right now due to i have two programs running compiling FreeDB database and one getting Lyrics.

but i currently Use windows XP and have it on D:\Windows

so due to the many dif installs out there it maybe nice for you to find a way to check for this.
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

knickelfarz

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 493
Re: Need Javascript help for new Track Info
« Reply #26 on: July 27, 2003, 12:32:20 pm »

Quote
i currently Use windows XP and have it on D:\Windows

OK, please try this one...it's for D:\Windows  ;)
Logged

drosoph

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 661
  • TiVo-aholic
Re: Need Javascript help for new Track Info
« Reply #27 on: September 09, 2003, 03:21:09 pm »

Just thought I would let you know that the logic in your older non-dynamic page wuld need to use the new logo.png file to work ..

        var D = ImagePath.search(/Logo.png+/);

BTW, did you ever do any more on your XTraSmart track info plugin .. I never cld get mine to work properly ... always a white border .. text was black .. and purple .. cldnt see anything ... pretty useless on my view ...

knickelfarz

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 493
Re: Need Javascript help for new Track Info
« Reply #28 on: September 09, 2003, 03:38:42 pm »

Quote
Just thought I would let you know that the logic in your older non-dynamic page wuld need to use the new logo.png file to work ..
var D = ImagePath.search(/Logo.png+/);

Thanks, I will add that too...

Quote
BTW, did you ever do any more on your XTraSmart track info plugin .. I never cld get mine to work properly ... always a white border .. text was black .. and purple .. cldnt see anything ... pretty useless on my view ...
Didn't had the time yet, and there doesn't seem to be much interest, but maybe this will change if I post it in the main forum ;)
Anyhow, I will start working on it again in about two weeks... I will let you know  ;)
Logged

NoCodeUK

  • Citizen of the Universe
  • *****
  • Posts: 1820
Re: Need Javascript help for new Track Info
« Reply #29 on: September 12, 2003, 01:25:46 am »

I'm interested!!  I only just spotted this thread but your Xtra Smart thing looks pretty cool.  I guess the downside of everything being moved into here now away from the main forum is that stuff is getting less exposure...

Adam
Logged
"It's called No Code because it's full of code. It's misinformation." - Eddie Vedder
Pages: [1]   Go Up