im working on tweaking the hell outta my site dreadlocks site

and i want to speed it up minfy the javascript and custom code and maybe externalize it (if thats the best thing to do)

i minified the css and much of the main page html

alot of whats slowing me down is http requests i think

 

heres my custom code

(i'll add as attachment too)

 


<!-- Add =EchoTopicCategories to Blog

-->
<script

type="text/javascript">
// BlogTags v1B - 7/11/11 -

Adding a first choice of

[Select Tag] to the Blog Tags

List.
// BlogTags v1A - 7/10/11 -

Use a drop down list to Enter

Blog Tags and Search for

Blogs.


var gBT_Status = ' BlogTags

Status...';  // Global

BlogTags status message.
// Pre-determined Blog Tags

List:
var gBT_Options = '<option>

[Select Categories]

</option><option>dreads</optio

n><option>life

issues</option><option>dreadlo

cks

stories</option><option>relati

onships</option><option>family

</option><option>employment</o

ption><option>travel</option>br/>
option>Current

Events</option><option>rants

and

raves</option><option>poetry

and

writing</option><option>Self-

Help/Advice</option><option>In

spirational</option><option>dr

ead

updates</option><option>Miscel

laneous</option>';

var gBT_Location =

window.location.href + '';

// Add Selection from the

Pre-determined Blog Tags List

to Tags:
if (gBT_Location.indexOf

('profiles/blog/new') > 0) {
    var TJBlogTagsList = '<div

id="TJBlogTagsWrapper"><select

id="TJBlogTags">' +

gBT_Options +

'</select></div>';
    x$("input#tags").parent

().append(TJBlogTagsList);
    x$("#TJBlogTags").change

(function() {
        var selTag = x

$("#TJBlogTags

option:selected").text() + '';
        if (selTag != '[Select

Categories]') {
            // If tag has a

space in it, it is a multi

word tag and must be inside

quotes.
            if

(selTag.indexOf(' ') > -1)

selTag = '"' + selTag + '"';
            var current_val =

x$("input#tags").val();
            if

(current_val.length > 0)

current_val += ", " + selTag;

else current_val = selTag;
            x

$("input#tags").val

(current_val);
        }
    });
}

// Search for Blogs with tag

equal to the Selection from

the Pre-determined Blog Tags

List:
if (gBT_Location.indexOf

('profiles/blog/list') > 0) {
    var TJBlogTagsSearchList =

'<span

id="TJBlogTagsSearchWrapper">br/>
select id="TJBlogTagsSearch">'

+ gBT_Options +

'</select></span>';
    x$("a.xg_icon-

search").after(' &nbsp; ' +

TJBlogTagsSearchList);
    x

$("#TJBlogTagsSearch").change

(function() {
        var selTag = x

$("#TJBlogTagsSearch

option:selected").text();
        if (selTag != '[Select

Tag]') {
            window.location =

'http://www.dreadlockssite.com

//profiles/blog/list?tag=' +

selTag;
        }
    });
}
</script>

<style>
#TJBlogTagsWrapper {
    background-attachment:

scroll;
    background-clip: border-

box;
    background-color:

transparent;
    background-image: url

("http://api.ning.com/files/ZJ

zbxRDVhRwKhJoN5aNwUAG3ltTyy8Gt

cfXfAejdNNZf*gLc1u0pgebN4eBO6k

qdRzME-

1c*0U8gu5K6bba*UHmvJBbVH80o/bl

ogicon.jpg");
    background-origin:

padding-box;
    background-repeat: no-

repeat;
    background-size: auto

auto;
    padding-bottom: 5px;
    padding-top: 5px;
}
</style>
<script

type="text/javascript">var

switchTo5x=false;</script><scr

ipt type="text/javascript"

src="http://w.sharethis.com/bu

tton/buttons.js"></script><scr

ipt

type="text/javascript">stLight

.options

({publisher:'a5e8a54b-c770-

4a6f-b651-

836342b97918'});</script>
<!-- komoona script start -->
<script

type="text/javascript">
var

komoona_site_id='eee29d53208d4

913885a2bce55d29792';
(function() {
    var ad =

document.createElement

('script'); ad.type =

'text/javascript'; ad.async =

true;
    ad.src = ('https:' ==

document.location.protocol ?

'https://' : 'http://') +

'www.komoona.com/a/scripts/kmn

_sa.js?v=1.2';
   

(document.getElementsByTagName

('head')[0] ||

document.getElementsByTagName

('body')[0]).appendChild(ad);
})();
</script>
<script

type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount',

'UA-10037235-3']);
  _gaq.push

(['_trackPageview']);

  (function() {
    var ga =

document.createElement

('script'); ga.type =

'text/javascript'; ga.async =

true;
    ga.src = ('https:' ==

document.location.protocol ?

'https://ssl' : 'http://www')

+ '.google-

analytics.com/ga.js';
    var s =

document.getElementsByTagName

('script')[0];

s.parentNode.insertBefore(ga,

s);
  })();

</script>
<script

type="text/javascript"><!--
window.googleAfmcRequest = {
  client: 'ca-mb-pub-

1147632186808710',
  ad_type: 'text_image',
  output: 'html',
  channel: '0248172424',
  format: '320x50_mb',
  oe: 'utf8',
  color_border:

'555555,336699,000000,6699CC',
  color_bg:

'EEEEEE,FFFFFF,F0F0F0,003366',
  color_link:

'0000CC,0000FF,0000FF,FFFFFF',
  color_text:

'000000,000000,000000,AECCEB',
  color_url:

'008000,008000,008000,AECCEB',
};
//--></script>
<script type="text/javascript"
  

src="http://pagead2.googlesynd

ication.com/pagead/show_afmc_a

ds.js"></script>
<script

type="text/javascript">
if

(document.location.protocol=='

http:'){
 var Tynt=Tynt||[];Tynt.push

('bY6cvQBaKr34Kcadbi-

bpO');Tynt.i=

{"cc":"1","st":true,"as":"the

best place for real dreadlocks

no lies no products to buy

just truth about healthy

dreads "};
 (function(){var

s=document.createElement

('script');s.async="async";s.t

ype="text/javascript";s.src='h

ttp://tcr.tynt.com/ti.js';var

h=document.getElementsByTagNam

e('script')

[0];h.parentNode.insertBefore

(s,h);})();
}
</script>
<script

type="text/javascript">
  var vglnk = { api_url:

'//api.viglink.com/api',
                key:

'2af17f4d6e5dfd4707440940927cd

201' };

  (function(d, t) {
    var s = d.createElement

(t); s.type =

'text/javascript'; s.async =

true;
    s.src = ('https:' ==

document.location.protocol ?

vglnk.api_url :
            

'//cdn.viglink.com/api') +

'/vglnk.js';
    var r =

d.getElementsByTagName(t)[0];

r.parentNode.insertBefore(s,

r);
  }(document, 'script'));
</script>
<script

type="text/javascript">
if (typeof(x$) != 'undefined')

{
  var href_src =

"http://www.dreadlockssite.com

/main/";
  x

$("#application_name_header_li

nk").attr("href", href_src);
}
</script>
<script type="text/javascript"

charset="utf-8">
  var is_ssl = ("https:" ==

document.location.protocol);
  var asset_host = is_ssl ?

"https://static.punchtab.com/"

:

"http://static.punchtab.com/";
  document.write(unescape

("%3Cscript src='" +

asset_host + "js/pt.js'

type='text/javascript'%3E

%3C/script%3E"));
</script>

<script type="text/javascript"

charset="utf-8">
  var _ptq = _ptq || [];
  var reward_widget_options =

{};
  reward_widget_options.key =

"00aca4fc42cee2158bd71b254a22f

b68";
 

reward_widget_options.display

= "tab";
 

reward_widget_options.position

= {x:"right",y:"bottom"};
  var reward_widget = new

PT.reward_widget

(reward_widget_options);
</script>


<!----Add buttons under Status

Update---->

<!---Creates button table and

links--->

<div id="tmp_sm_buttons"

style="display:none;">

<div align=right

id="buttonwrapper" width="330"

height="20" style="padding:

0px;">

<table class="padded-table"

width="280" style="margin-

top:2px!important;margin-

bottom:5px!important;"><tr><td

style="text-align: left;"

valign="top" width="9%"><a

href="/photo/photo/newWithUplo

ader">Photo</a> </td> <td

style="text-align: left;"

valign="top" width="9%"> <a

href="/video/video/newWithUplo

ader"> Video </a> </td> <td

style="text-align: left;"

valign="top" width="8%"><a

href="/profiles/blog/new">Blog

</a></td><td style="text-

align: left;" valign="top"

width="10%"> <a

href="/forum/topic/new">

Discussion </a></td> <td

style="text-align: left;"

valign="top" width="10%"> <a

href="/events/event/new">

Event</a> </td></tr></table>

</div>

</div>

 

/* inserts buttons below

status update */

<script

type="text/javascript">

if (typeof(x$) != 'undefined')

{

 x$(".form-hint").prepend

('<div style="padding-

top:0px;text-align:right;"

id="sm_buttons"></div>');

    var t_sm_buttonsCode =

document.getElementById

('tmp_sm_buttons');

    var sm_buttonsCode =

document.getElementById

('sm_buttons');

    sm_buttonsCode.innerHTML =

t_sm_buttonsCode.innerHTML;

}

</script>
<!----End Buttons---->

<script type="text/javascript"
src="http://ajax.googleapis.co

m/ajax/libs/jquery/1.5.2/jquer

y.min.js"></script>
<!-- Toggle Content -->
<script

type="text/javascript">
$(document).ready(function()
{
  //hide the all of the

element with class toggle_body
  $(".toggle_body").hide();
  //toggle the content with

class toggle_body
  $(".toggle_head").click

(function()
  {
  // 200 is good for fast, and

600 for slow open
    $(this).next

(".toggle_body").slideToggle

(500);
  });
});
</script>
<!-- End Toggle Content -->
<script

type="text/javascript">

if (typeof(x$) != 'undefined')

{
   x

$('.xg_widget_profiles_message

_show .pad').after('<div

style="margin-

top:5px;background:#666!

important;width:647px;height:2

0px;"><span

style="padding:5px;color:#fff;

">Receiving spam? <a

style="color:#fff;text-

decoration:underline!

important;"

href="http://www.dreadlockssit

e.com/profiles/message/newFrom

Profile?

screenName=0ckm6eysjtzgb&targe

t=http%3A%2F

%2Fwww.dreadlockssite.com

%2Fprofiles%2Fprofile%2Fshow

%3Fid%3Dsoaringeagle

%26">Report it now</a> (please

provide a screenshot too)

</span></div>');
}

</script>
<!-- Add Scrolling Message to

NingBar -->
<div style="xg-p:absolute;

left:62px; right:400px;

top:4px;"><marquee

onmouseover="this.stop();"

onmouseout="this.start();"

scrolldelay="100"

scrollamount="3"

direction="left" height="20"

vspace="0"

bgcolor="transparent"

style="font-family: Verdana;

font-size:14px; color:

#fff;">Looking for the best

available info and advice on

dreadlocks? look no further!

<a style="color:#fff;"

href="http://www.dreadlockssit

e.com/main/authorization/signU

p?target=http%3A%2F

%2Fwww.dreadlockssite.com

%2Fmain%2F">Join us today!</a>

We help you save money and

time, we believe dreadlocks

should be free, they should

not cost more then rent. It is

free to join, however your

donations would be

appreciated. The site is

getting closer to a million

pages, as it grows we will

continue to try to make it

easier to use and find the

important info you

seek.</marquee></div>
<!-- End Scrolling Message to

NingBar -->

 

theres alot of it

i tried some online miniy things that ended up breaking some part of the code or another

whats the best way to compress minify or externalize this to speed it up?

thanks

 

Views: 194

Attachments:

Reply to This

Replies to This Discussion

I couldn't assist you with this. Maybe someone else can help out. I answer quick questions, and specialize in Ning platform and CSS questions. Anything outside of that would be a custom job.

Best of luck,

Jen

RSS

Members

© 2024   Created by JenSocial.   Powered by

Badges  |  Report an Issue  |  Terms of Service

Home
VIP Ning Tips