Changeset 653
- Timestamp:
- 2008-06-29 04:06:58 (2 months ago)
- Location:
- plugins/magic_archives/trunk
- Files:
-
- 1 added
- 3 modified
-
archives.php (modified) (1 diff)
-
magic_archives.plugin.php (modified) (1 diff)
-
magicarchives.js (modified) (3 diffs)
-
stringranker.js (added)
Legend:
- Unmodified
- Added
- Removed
-
plugins/magic_archives/trunk/archives.php
r652 r653 1 1 <div id="magicArchives"> 2 2 <div id="archiveControls"> 3 <div class="search"> 4 <input type="text" name="archiveSearch" value="" id="archiveSearch"> 5 </div> 3 6 <div class="control month"> 4 7 <h4><?php echo _t('Month'); ?></h4> -
plugins/magic_archives/trunk/magic_archives.plugin.php
r652 r653 31 31 32 32 Stack::add( 'template_header_javascript', Site::get_url('scripts') . '/jquery.js', 'jquery' ); 33 Stack::add( 'template_header_javascript', URL::get_from_filesystem(__FILE__) . '/stringranker.js', 'stringranker' ); 33 34 Stack::add( 'template_header_javascript', URL::get_from_filesystem(__FILE__) . '/magicarchives.js', 'magicarchives' ); 34 35 } -
plugins/magic_archives/trunk/magicarchives.js
r652 r653 13 13 magicArchives.content_type = $('#archiveControls .type ol', magicArchives.archives); 14 14 magicArchives.posts = $('ol#archiveItems li:not(.headings)', magicArchives.archives); 15 magicArchives.search = $('#archiveSearch', magicArchives.archives); 15 16 16 17 magicArchives.posts.each(function() { 17 18 $(this).addClass('searched').addClass('filtered'); 19 }); 20 21 magicArchives.search.keyup(function() { 22 magicArchives.filter(); 18 23 }); 19 24 … … 57 62 magicArchives.posts.show(); 58 63 64 var i = 0; 65 59 66 magicArchives.posts.each(function() { 60 67 if(month.hasClass('allofthestuff') == false) { … … 87 94 } 88 95 } 96 97 var score = 0; 98 99 $('.tags .tag', $(this)).each(function() { 100 score = score + $(this).text().score(magicArchives.search.val()); 101 }); 102 103 score = score + $('.month', $(this)).text().toLowerCase().score(magicArchives.search.val()); 104 score = score + $('.title', $(this)).text().toLowerCase().score(magicArchives.search.val()); 105 score = score + $('.year', $(this)).text().toLowerCase().score(magicArchives.search.val()); 106 107 if(score == 0) { 108 $(this).hide(); 109 } 89 110 }); 111 112 90 113 } 91 114 };
