|
#!-<script src="/files/javascript/jquery-1.3.2.min.js"></script>-! |
|
!-<script src="/files/javascript/jquery.tagcloud.js"></script>-! |
|
!-<style type="text/css"> |
|
#tagcloud {width: 700px;margin:0 auto;} |
|
#tagcloud a {text-decoration: none;} |
|
#tagcloud a:hover {text-decoration: underline;} |
|
#tagcloud >a {display:inline-block; margin: 5px 10px;font: 75% Arial, "MS Trebuchet", sans-serif;} |
|
</style>-! |
|
!- |
|
<div id="tagcloud"></div> |
|
<script> |
|
$(document).ready(function () { |
|
var tagMap = []; |
|
var tagRef = []; |
|
//$("div#tagcloud").append("<p>Tag Cloud</p>"); |
|
$("div.contents").find("li a").each(function () { |
|
var tags = $(this).text(); |
|
var startindex = tags.indexOf(' ('); |
|
var endindex = tags.indexOf(')', startindex); |
|
if (startindex !=-1 && endindex !=-1 && endindex > startindex ){ |
|
tags = tags.substring(startindex+2 , endindex ); |
|
var aTags = tags.split(","); |
|
for(var i=0; i < aTags.length; i++) { |
|
tag = $.trim(aTags[i]); |
|
ref = $(this).next("div:eq(0)").find("div.nested-contents li a").length+1; |
|
tagIndex = $.inArray(tag,tagMap); |
|
if(tagIndex < 0){ |
|
tagMap.push(tag); |
|
tagRef.push(ref); |
|
} |
|
else{ |
|
tagRef[tagIndex] = tagRef[tagIndex] + ref |
|
}; |
|
//console.log( tagMap ); |
|
//console.log( tagRef ); |
|
}; |
|
}; |
|
}); |
|
for(var i=0; i<tagMap.length; i++){ |
|
$("div#tagcloud").append("<a>"+tagMap[i]+"</a>"); |
|
$("div#tagcloud a:eq("+i+")").attr("rel",tagRef[i]); |
|
$("div#tagcloud a:eq("+i+")").attr("href",window.location+"?executeSearchProperties&Suites="+tagMap[i]); |
|
}; |
|
|
|
}); |
|
|
|
$.fn.tagcloud.defaults = { |
|
size: {start: 14, end: 18, unit: 'pt'}, |
|
color: {start: '#cde', end: '#f52'} |
|
}; |
|
//console.log($.fn.tagcloud.defaults); |
|
|
|
$(function () { |
|
$('div#tagcloud a').tagcloud(); |
|
}); |
|
</script> |
|
-! |