Code Question 3

Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
Again, here is the lovely content featuring code that works well and is truly impressive (at least to me). First of all the code looks like this:

 <div class="col12 last">
      {if jrCore_is_mobile_device()}<div class="menu_tab">
             <div id="default" class="p_choice fartist" onclick="jrLoad('#sm','{$jamroom_url}/index_artists');jrSetActive('#default');">{jrCore_lang  skin=$_conf.jrCore_active_skin id="21" default="featured"} {jrCore_lang  skin=$_conf.jrCore_active_skin id="12" default="artists"}</div>
            <div id="s_song" class="p_choice fsong" onclick="jrLoad('#sm','{$jamroom_url}/index_songs');jrSetActive('#s_song');">Songs</div>           
            <div id="s_video" class="p_choice fvideo" onclick="jrLoad('#sm','{$jamroom_url}/index_videos');jrSetActive('#s_video');">Videos</div>                        <div class="clear"></div>        </div>

{else}

        <div class="menu_tab">
            <div id="default" class="p_choice fartist" onclick="jrLoad('#sm','{$jamroom_url}/index_artists');jrSetActive('#default');">{jrCore_lang  skin=$_conf.jrCore_active_skin id="21" default="featured"} {jrCore_lang  skin=$_conf.jrCore_active_skin id="12" default="artists"}</div>
            <div id="s_song" class="p_choice fsong" onclick="jrLoad('#sm','{$jamroom_url}/index_songs');jrSetActive('#s_song');">{jrCore_lang  skin=$_conf.jrCore_active_skin id="21" default="featured"} {jrCore_lang  skin=$_conf.jrCore_active_skin id="13" default="songs"}</div>
            <div id="s_soundcloud" class="p_choice fsoundcloud" onclick="jrLoad('#sm','{$jamroom_url}/index_soundclouds');jrSetActive('#s_soundcloud');">{jrCore_lang  skin=$_conf.jrCore_active_skin id="21" default="featured"} {jrCore_lang  skin=$_conf.jrCore_active_skin id="61" default="Soundcloud"}</div>
            <div id="s_video" class="p_choice fvideo" onclick="jrLoad('#sm','{$jamroom_url}/index_videos');jrSetActive('#s_video');">{jrCore_lang  skin=$_conf.jrCore_active_skin id="21" default="featured"} {jrCore_lang  skin=$_conf.jrCore_active_skin id="14" default="videos"}</div>
            <div id="s_youtube" class="p_choice fyoutube" onclick="jrLoad('#sm','{$jamroom_url}/index_youtubes');jrSetActive('#s_youtube');">{jrCore_lang  skin=$_conf.jrCore_active_skin id="21" default="featured"} {jrCore_lang  skin=$_conf.jrCore_active_skin id="62" default="youtube"}</div>
            <div id="s_vimeo" class="p_choice fvimeo" onclick="jrLoad('#sm','{$jamroom_url}/index_vimeos');jrSetActive('#s_vimeo');">{jrCore_lang  skin=$_conf.jrCore_active_skin id="21" default="featured"} {jrCore_lang  skin=$_conf.jrCore_active_skin id="63" default="vimeo"}</div>
            <div class="clear"></div>
        </div>{/if}
        <div class="inner mb8">
            <div id="sm"></div>
        </div>
    </div>
</div>

At the top of the index page, this code is used to call up the initialization protocol in Java...

<script type="text/javascript">
    $(document).ready(function(){
        jrSkinInit();
    });
</script>


In the java folder, the actual initialization protocol being called up looks like this:


function jrSkinInit() {
       jrLoad('#sm',core_system_url +'/index_artists');
 jrLoad('#top_members',core_system_url +'/top_members');
    jrLoad('#top_songs',core_system_url +'/top_songs');
    jrLoad('#top_groups',core_system_url +'/top_groups');
    jrLoad('#top_discussions',core_system_url +'/top_discussions');
    jrLoad('#top_notes',core_system_url +'/top_notes');
    jrLoad('#top_actions',core_system_url +'/top_actions');
    jrLoad('#top_blogs',core_system_url +'/top_blogs');
    jrLoad('#top_galleries',core_system_url +'/top_galleries');
    jrSetActive('#default');
}


If one were to install this on Ninga what would be the steps?

1. I would imagine all the java would need to be copied over.
2. index_artists_row.tpl as detailed in "Code Question 1" as well (separate thread).
3. Am I correct in thinking that the division id's and classes relate to CSS, therefore some CSS values would have to be copied over too?

What I mean by 3 is (if I am understanding correctly), the pointers would have to be changed to Ningja specific ones. That is, things like "div inner mb8 mr8" would have to be renamed to existing Ningja values, or those associated NingNova2 values would have to be incorporated into the Ningja stylesheets???


--

Ken Rich
indiegospel.net

updated by @ken-rich: 01/09/15 06:55:58AM
douglas
@douglas
11 years ago
2,797 posts
Instead of trying to explain how it all works, maybe you can let us know what your trying to do and we might be able to help with that a bit easier.

The Ningja skins java file is already setup with the jrLoad function, but there aren't any templates being loaded via java. The jrLoad function is only being used for pagination in the Ningja skin.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
brian
@brian
11 years ago
10,148 posts
Nothing in JR is loaded by Java (just an FYI) - Java != Javascript. Jamroom uses PHP and Javascript - no Java is involved... lol


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
brian:
Nothing in JR is loaded by Java (just an FYI) - Java != Javascript. Jamroom uses PHP and Javascript - no Java is involved... lol

@indiegospel - clarification for you:
!= means NOT equals
== means equals
=== means equals (and check that it is the same type)

Java is a different programming language to javascript. You don't need to know either language but it is very worthwhile reading a bit about jQuery (jQuery is a javascript library which makes javascript simpler to use for most people, it is genius imo, and Jamroom uses it in order to make its javascript accessible to people like me :) ).

http://www.jquery.com (jsut read the first paragraph)


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 12/04/14 03:59:45PM
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
douglas:
Instead of trying to explain how it all works, maybe you can let us know what your trying to do and we might be able to help with that a bit easier.

Well I'm not exactly trying to explain how it all works since I don't really know. I'm trying to relate my level of understanding thus far, check my hunches, and see if I can't get the same sort of thing working in Ningja.

douglas:The Ningja skins java file is already setup with the jrLoad function, but there aren't any templates being loaded via java. The jrLoad function is only being used for pagination in the Ningja skin.

So if I am understanding that part correctly, it's already there and doesn't need to be copied. However, it has to somehow be modified to load templates for this to work?


--

Ken Rich
indiegospel.net

updated by @ken-rich: 12/05/14 04:14:12AM
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
brian:
Nothing in JR is loaded by Java (just an FYI) - Java != Javascript. Jamroom uses PHP and Javascript - no Java is involved... lol

Wow... That's news to me, I thought Java was short for Javascript... Shows how much I know...

JQuery seems like it might be useful, nice tip... I didn't know it was something to make Javascript easier...I thought it was a different language...


--

Ken Rich
indiegospel.net

updated by @ken-rich: 12/05/14 04:13:43AM
michael
@michael
11 years ago
7,772 posts
Yeah there are lots of confusing things. If you look up the "Why javascript is called javascript?" you'll get a lot of info and opinions.

One quote I like is:
Quote: "Java is to Javascript what Car is to Carpet."

updated by @michael: 12/04/14 11:12:12PM
paul
@paul
11 years ago
4,335 posts
I also spent a long time thinking java = javascript!!
Another one I don't get is the answer to the question "What does PHP stand for?"
"PHP stands for PHP: Hypertext Preprocessor."
Huh? And that is from the official PHP docs!!


--
Paul Asher - JR Developer and System Import Specialist

updated by @paul: 12/05/14 01:21:17AM
michael
@michael
11 years ago
7,772 posts
paul:.....Another one I don't get is the answer to the question "What does PHP stand for?"
"PHP stands for PHP: Hypertext Preprocessor."
Huh? And that is from the official PHP docs!!....
Yeah there are a few of those around the linux world. another one is LAME (Lame Aint an MP3 Encoder) but it is......

http://sourceforge.net/p/lame/mailman/lame-dev/?viewmonth=200504
Quote:
LAME (Lame Aint an MP3 Encoder)
A high quality MP3 encoder
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
If you guys find it confusing, there's no hope for me. I'm a "Newfie" (Newfoundland - Canada).

All you have to do to confuse a Newfie, is put two shovels against a wall and tell him to take his pick...

Hmmm... I don't see a pickaxe...


--

Ken Rich
indiegospel.net
brian
@brian
11 years ago
10,148 posts
The reason they called ECMAScript (it's real name) "Javascript" is that Netscape back in 1996 wanted to capitalize on the growing popularity of Java, so they called it Javascript - it has NOTHING in common with Java other than they are both programming languages.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
paul:"PHP stands for PHP: Hypertext Preprocessor."
Huh? And that is from the official PHP docs!!
It's a recursive acronym:
https://en.wikipedia.org/wiki/Recursive_acronym
Beautifully daft :)


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)