HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


What Javascript changes do you make?

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#86001 (In Topic #17624)
Avatar

I know some people make JS changes (to JAVASCRIPT*.tpl templates) which makes it a bit harder to upgrade.

So I am going to see if we can isolate out areas people are likely to change into separate files.

So what do you change?

I write this as I just spotted a case myself – people wanting to change WYSIWYG editor settings would override JAVASCRIPT_EDITING.tpl which is generally a very volatile file.

So, if you can let me know, we can probably make upgrading slightly easier going forward.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Item has a rating of 5 (Liked by BobS)  
Rating:
#86006
Avatar

Community saint

Going through my notes, I can see:

JAVASCRIPT_TREE_LIST.tpl

Changed some hard-coded colours, specifically:

   black to #e6b05d   x5 instances
   white to black      x7 instances
   316AC5 to #DEFFDE   x2 instances

I can see also at least on other colour in that code "gray", and there may be other colours, but I havent changed them.

JAVASCRIPT_VALIDATION.tpl

replace 2x ".3" to ".7" to improve the opacity of disabled field, like those on the "Edit image" screen.

JAVASCRIPT_POSTING.tpl

Not technically valid to this discussion because I'm bypassing the entire issue, you'll see why, but here it is anyway:

In my forum post editor I have a custom "Insert Youtube Video" button that take a youtube url and extracts the video id and places it in a custom comcode tag.

This template comprises of an include to the default template, like so:

Code

{$BLOCK,block=fileinclude,path=themes/default/templates/JAVASCRIPT_POSTING.tpl}

Followed by my custom doInput_??? function.

JAVASCRIPT_CUSTOM_GLOBALS.tpl

But of course where we are supposed to make the changes here.

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Item has a rating of 5 (Liked by BobS)  
Rating:
#86007
Avatar

Community saint

I honestly believe that I've removed all the previous JS_* overrides I used to carry, and have now brought my site into line with the original …

EXCEPT FOR

JAVASCRIPT.tpl in which I've made a minor change that allows me to replace 1 with 2 …



So, in my case, I cannot be of any help whatsoever as I now toe the party line!

 :thumbs:

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Item has a rating of 5 (Liked by BobS)  
Rating:
#86010
Avatar

Fletch said

I honestly believe that I've removed all the previous JS_* overrides I used to carry, and have now brought my site into line with the original …

EXCEPT FOR

JAVASCRIPT.tpl in which I've made a minor change that allows me to replace 1 with 2 …



So, in my case, I cannot be of any help whatsoever as I now toe the party line!

 :thumbs:
Thanks guys. I think I'll be solving these with CSS flexibility instead.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#86032
Avatar

Well-settled

I always add jquery in from the google cdn and am glad I came acrossed this post because it would be great if there was an option to combine in all of the main js files into one in order to make fewer http requests.  
Back to the top
 
Posted
Rating:
#86033
Avatar

GodzMuzicIan said

I always add jquery in from the google cdn and am glad I came acrossed this post because it would be great if there was an option to combine in all of the main js files into one in order to make fewer http requests.  


I've already added this into the new header, but commented out by default.

There's something on the tracker about automatically doing that optimisation by statistical analysis (as there's a tradeoff here – losing modularity means downloading more initially even when non-needed – so ocPortal would need to detect what was the best tradeoff). There's quite a lot of performance stuff on the tracker, but all together it's a few weeks of work.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Item has a rating of 5 (Liked by Fletch)  
Rating:
#86057
Avatar

Community saint

NONE, but thank you for asking!:thumbs:
Back to the top
 
Posted
Rating:
#86064
Avatar

Well-settled

what about async or lazy loading the files.  For instance, I was trying to add a hidden form on the start page with the module embed block that lets people click on an add video button after they search youtube from my site and it all works great but I was downloading ckeditor on every load which is huge.  So i went in and changed ckeditor to ackeditor and then made the original ckeditor an async script that loads ackeditor.  Therefore ackeditor is there if it's needed and it doesn't block page loading.
The other way is to comment out ckeditor and give the script tag an id and then strip out the comments when someone clicks on a button which in this case might be the search button.  In this example ckeditor is there but it isn't even parsed until the tags are stripped.  This second method can be used in cdata tags as well which is supposed to be even more efficient but I don't even know what cdata does or means so i don't mess with that yet.

Gmail for Mobile HTML5 Series: Reducing Startup Latency - The official Google Code blog
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: