Skip to content

Commit

Permalink
fixed bug in algorithm. Version 0.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaong committed Apr 8, 2011
1 parent 3b8acff commit 0fe5132
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 4 additions & 2 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ h2. Installation
Installing jQCloud is extremely simple:

# Make sure to import the jQuery library in your project.
# Download the jQCloud files. Place jqcloud-0.1.7.js (or the minified version jqcloud-0.1.7.min.js) and jqcloud.css somewhere in your project and import both of them in your HTML code.
# Download the jQCloud files. Place jqcloud-0.1.8.js (or the minified version jqcloud-0.1.8.min.js) and jqcloud.css somewhere in your project and import both of them in your HTML code.

You can easily substitute jqcloud.css with a custom CSS stylesheet following the guidelines explained later.

Expand All @@ -23,7 +23,7 @@ bc. <!DOCTYPE html>
<title>jQCloud Example</title>
<link rel="stylesheet" type="text/css" href="jqcloud.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="jqcloud-0.1.7.js"></script>
<script type="text/javascript" src="jqcloud-0.1.8.js"></script>
<script type="text/javascript">
/*!
* Create an array of objects to be passed to jQCloud, each representing a word in the cloud and specifying
Expand Down Expand Up @@ -83,6 +83,8 @@ If you happen to use jQCloud in your projects, you can make me know (just contac

h2. Changelog

0.1.8 Fix bug in the algorithm causing sometimes unbalanced layouts (thanks to "isamochernov":https://github.com/isamochernov)

0.1.7 Remove duplicated @</span>@ when word has an URL (thanks to "rbrancher":https://github.com/rbrancher)

0.1.6 JavaScript-friendly URL encode 'url' option; Typecast 'weight' option to float (thanks to "nudesign":https://github.com/nudesign)
Expand Down
2 changes: 1 addition & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>jQCloud Example</title>
<link rel="stylesheet" type="text/css" href="../jqcloud/jqcloud.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
<script type="text/javascript" src="../jqcloud/jqcloud-0.1.7.js"></script>
<script type="text/javascript" src="../jqcloud/jqcloud-0.1.8.js"></script>
<script type="text/javascript">
var word_list = [
{text: "Lorem", weight: 13, url: "https://github.com/DukeLeNoir/jQCloud"},
Expand Down
6 changes: 3 additions & 3 deletions jqcloud/jqcloud-0.1.7.js → jqcloud/jqcloud-0.1.8.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*!
* jQCloud Plugin for jQuery
*
* Version 0.1.7
* Version 0.1.8
*
* Copyright 2011, Luca Ongaro
* Licensed under the MIT license.
*
* Date: Thu Apr 7 12:59:25 +0100 2011
* Date: Fri Apr 8 10:24:15 +0100 2011
*/

(function( $ ){
Expand Down Expand Up @@ -83,7 +83,7 @@
radius += step;
angle += (index % 2 === 0 ? 1 : -1)*step;

left = origin_x + (radius*Math.cos(angle) - (width / 2.0)) * aspect_ratio;
left = origin_x - (width / 2.0) + (radius*Math.cos(angle)) * aspect_ratio;
top = origin_y + radius*Math.sin(angle) - (height / 2.0);

$(word_selector).css('left', left + "px");
Expand Down
6 changes: 3 additions & 3 deletions jqcloud/jqcloud-0.1.7.min.js → jqcloud/jqcloud-0.1.8.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0fe5132

Please sign in to comment.