Thread: Forum Home Enhancements - UKBL ~ Quality Drop Down Menu System
View Single Post
  #322  
Old 06-29-2010, 01:05 PM
speedway's Avatar
speedway speedway is offline
 
Join Date: Nov 2001
Location: Sydney, Australia
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MagicThemeParks View Post
Does anyone have step-by-step instructions on how to clean things up by having the javascript and CSS in separate files rather than all within the code in the template?
Don't exactly have step by step but I have successfully separated the CSS and js scripts out of the menu into files.

What resulted in my implementation was 2 css files and 5 .js files, each containing a section of the surrounding code. I had to load the external .js files in the same order as they were in the menu block given to us originally. I then called them in the headinclude template in the order I needed them:

Code:
<!-- Navbar Repplacement Files -->
<link rel="stylesheet" type="text/css" href="assets/css/cqm-menu.css" />
<link rel="stylesheet" type="text/css" href="assets/css/cqm-menuitems.css" />
<!-- Small section initialising the qmad object -->
<script type="text/javascript" src="assets/js/cqm-qmad.js"</script>
<!--  Menu 0 Add-On Settings -->
<script type="text/javascript" src="assets/js/cqm-aosetting.js"</script>
<!-- UKBL ~ Core Quality Menu Code -->
<script type="text/javascript" src="assets/js/cqm-menucode.js"</script>
<!-- Add-On Code: Rounded Sub Corners -->
<script type="text/javascript" src="assets/js/cqm-aorsubcnr.js"</script>
<!-- Add-On Code: Rounded Items -->
<script type="text/javascript" src="assets/js/cqm-aoritem.js"</script>
The names are of course my own naming convention to give me an idea of what is in each one.

I left the very last piece of .js code in the header template, haven't got as far as to try that in an external just yet.

I tested this with 3 browsers - Firefox 3.6.3, Safari 4.5 and Opera 10.10 on OSX Snow Leopard 10.6.3 and all browsers loaded fine and displayed the menu as "normal".

I would attach the files here if the author is OK with that otherwise just sort of follow what I did and you should be good to go.....


I did all this to see if I can replace the navbar sub-menu items in VB4 with this code so I can mimic my VB3 style in VB4

Cheers
Bruce
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01075 seconds
  • Memory Usage 1,770KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete