rejetto forum
May 25, 2012, 07:10:13 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Help appreciated on JavaScript, RAWR player and more...  (Read 1933 times)
0 Members and 2 Guests are viewing this topic.
Grinderedge
Occasional poster
*
Offline Offline

Spain Spain

Posts: 6


View Profile Email
« on: December 14, 2008, 06:18:24 PM »

Hello everybody

I'm still working on the template for my own web server, and I got some issues I can't seem to resolve by myself. All help would be greatly appreciated  Smiley

JavaScripts:

Since I'm very new in this web making world, I gotta admit I'm a dirty little copy/paste monkey... Copy this, paste it there, repeat 100 times and you end up with a template that is 2 meters long... What I would like is to move all the javascripts I got between <head> and </head> into .js files inside a code directory in my web. As example, here is the Terayon search code I'm using (thanx RAWR team, you do an excellent work by the way!):

----start of code----

<script type="text/javascript">
//<![CDATA[
<!--
function searchQuery() {
frm = document.searchForm;
if(frm.query.value.length < 3) {
alert("Please enter a search with 3 or more characters.");
} else {
frm.recursive.checked ? recursive ="&recursive" : recursive ="";
for(x=0; x<frm.choice.length; x++) {
if(frm.choice
  • .checked ==1) {
if(frm.choice
  • .value =="file") {
searchMode ="?files-filter=";
filter="&folders-filter=%5C";
} else if(frm.choice
  • .value =="folder") {
searchMode ="?folders-filter=";
filter="&files-filter=%5C";
} else {
searchMode ="?filter=";
filter="";
}
}
}
for(c=0; c<frm.root.length; c++) {
if(frm.root[c].checked ==1) {
frm.root[c].value =="current" ? searchFrom ="http://%host%%folder%": searchFrom = "http://%host%";
}
}
document.location.href = searchFrom+searchMode+"*"+frm.query.value+"*"+recursive+filter;
}
}
//-->
//]]>

----end of code----

I'd like this in a .js file. How should I change this in the <body> section for it to work?

----start of code----

  <form name="searchForm" method="get"
action="javascript:search()" id="searchForm">
  <p align="center">
    <input name="query" type="text" class="field" value="" size="25" />
    <input class="button"
type="submit" name="searchBtn" value="Search" /></p>
  <p>&nbsp;</p>
  <p align="center"><input type="radio" name="choice"
value="file" /> File(s) <input type="radio" name=
"choice" value="folder" /> Folder(s) <input name=
"choice" type="radio" value="both" checked=
"checked" /> Both <input name="recursive" type=
"checkbox" value="" checked="checked" />
    Recursive<br />
  <input name="root" type="radio" value="root" checked=
"checked" /> From Root Directory <input name="root"
type="radio" value="current" /> From Current
    Directory</p>
  </form>

----end of code----

More JavaScript related suff:

I'm trying to have a toggle button on my web that would hide/show a div. It works ok, but sure enough it forgets the setting (hidden or visible) when it loads a page. I've seen tons of boggus code involving cookies to remember the state of a div, each one more weird than the other... Could anyone point me on the right direction?

RAWR player:

Here I must admit my utter failure to integrate this cool player from RAWR in my template. This is head-asploding for me, I simply have no clue at all as to how to make the player work!! I'd like it to work in the same way as in the RAWR templates, with a preview link that would pop the player up and start playing the file...

Those are the 3 last things that keep me from completing my page. It would be great if some experienced user familiar with those issues could lend me a hand with this... Attached you'll find the stuff I've done so far. I'm using HFS 2.3 beta 217.


Posted on: December 14, 2008, 07:23:42 AM
1) move javascript to js files = help!
2) remember state of div when reloading/changing directory/whatever = solved!
3) Integrating RAWR player in a template = mass help needed!

It turns out that toggling a div on/off and remembering its state on page reload or when browsing directories is giving many people a hard time.

Here is a link for those trying to achieve this goal: http://www.localteklink.com/cgi-bin/ltl_articles.pl?action=view_article&id=1.

I still am in desperate need of your help for issue 2... RAWR player integration would be specially nice, I've been trying to achive it for well past a month now...

* Web Project.zip (245.86 KB - downloaded 114 times.)
Logged
Grinderedge
Occasional poster
*
Offline Offline

Spain Spain

Posts: 6


View Profile Email
« Reply #1 on: December 16, 2008, 11:54:42 AM »

Nobody at all can put me on tracks with RAWR player?   Undecided
Logged
TSG
Moderator
Insane poster
*****
Offline Offline

Australia Australia

Posts: 1919



View Profile WWW
« Reply #2 on: December 17, 2008, 09:22:12 PM »

lol sorry, I am still getting over the move. There is alot of javascript code to make this box and the playlists work. I understand how it works, but explaining it to a beginner would be almost impossible. The only thing I can suggest is altering the appearance of one of our templates to replicate your own design, that way you have this feature already working.
Logged

Giant Eagle
Moderator
Insane poster
*****
Offline Offline

Netherlands Netherlands

Posts: 533


>=3 RAWR!

no.body056@gmail.com
View Profile WWW
« Reply #3 on: December 18, 2008, 02:56:47 AM »

Creating external .js files is easy.

Create a new empty .js file, place all the code you want to have external in the .js file and save it (This excludes the <script> tag)

Place the following code in the <head> section of your page: <script type='text/javascript' src='/location/of/file.js'></script>

As for the RAWR player, i also suggest as TSG said: Use one of our templates and modify it to your own needs. It's just a lot of work to adapt the javascript we made to work with other templates.
Logged

Rest in peace 500mhz server, you served me well...
New 1500mhz server DOA'ed on me >_>
New 2400mhz server up and running again Grin

Grinderedge
Occasional poster
*
Offline Offline

Spain Spain

Posts: 6


View Profile Email
« Reply #4 on: December 18, 2008, 06:41:04 AM »

Thanx a lot for your replies!

Your suggestions look reasonable and in fact they are just plain logic, but...  Tongue

I spent a lot of time every day making my (crappy, I must admit) template. Ditching all my work and just grabbing yours is not something I find intellectualy filling  Grin

I did make the same directory structure  and modified the head of main and files sections. It works, but it doesn't play next file, next and previous controls don't work...

So close...
Logged
Mrmcmillan912
Occasional poster
*
Offline Offline

United States United States

Posts: 7



View Profile Email
« Reply #5 on: December 30, 2011, 08:11:57 AM »

I just want to know where do I put the Rawr code at to get it to work?
Logged


~ MrMcMillan912
rejetto forum
« Reply #5 on: December 30, 2011, 08:11:57 AM »

Do you like this software? Consider even $2
 Logged
Mrmcmillan912
Occasional poster
*
Offline Offline

United States United States

Posts: 7



View Profile Email
« Reply #6 on: January 01, 2012, 12:12:25 PM »

FINALLY after 2 days figured it out Grin This Terayon template is amazing!!!
Logged


~ MrMcMillan912
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page May 24, 2012, 03:27:46 PM