Changeset 424304
- Timestamp:
- 08/16/2011 04:16:26 PM (15 years ago)
- Location:
- fancy-sitemap/trunk
- Files:
-
- 5 edited
-
css/admin.css (modified) (1 diff)
-
fancy-sitemap.php (modified) (2 diffs)
-
js/fancy_sitemap.js (modified) (7 diffs)
-
readme.txt (modified) (1 diff)
-
views/admin_options.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fancy-sitemap/trunk/css/admin.css
r423516 r424304 3 3 #fancySitemapAdmin .formRow{margin:10px 0;} 4 4 #fancySitemapAdmin .formRow label{vertical-align: top;} 5 #fancySitemapAdmin select{width:auto;height:auto;min-width:350px;} 5 #page_exclude{width:auto;height:250px !important;min-width:350px;} 6 #sitemapHolder{border:1px solid #000000;position:relative;} 7 .hMarkerTop{position:absolute;top:0;height:5px;width:2px;background:#ff0000;} 8 .hMarkerBot{position:absolute;bottom:0;height:5px;width:2px;background:#ff0000;} 9 .vMarkerLeft{position:absolute;left:0;height:2px;width:5px;background:#ff0000;} 10 .vMarkerRight{position:absolute;right:0;height:2px;width:5px;background:#ff0000;} -
fancy-sitemap/trunk/fancy-sitemap.php
r423535 r424304 5 5 Plugin URI: http://www.bunchacode.com/programming/fancy-sitemap/ 6 6 Description: generates a javascript/html5 sitemap. 7 Version: 0. 67 Version: 0.7 8 8 Author: Jiong Ye 9 9 Author URI: http://www.bunchacode.com … … 60 60 $output = ''; 61 61 62 if($type=='page') 63 { 62 if($type=='page'){ 64 63 $pageExcludes = get_option(FS_TYPE_PAGE_EXCLUDE); 65 64 $pages = wp_list_pages(array( -
fancy-sitemap/trunk/js/fancy_sitemap.js
r423516 r424304 1 1 (function($) { 2 /* 3 * function stolen from rephaeljs.com demo to create a path between objects 4 */ 2 5 Raphael.fn.connection = function (obj1, obj2, line, bg) { 3 6 if (obj1.line && obj1.from && obj1.to) { … … 58 61 } 59 62 } 63 60 64 if (dis.length == 0) { 61 65 var res = [0, 4]; … … 65 69 var x1 = p[res[0]].x, 66 70 y1 = p[res[0]].y, 67 x4 = p[ res[1]].x,68 y4 = p[ res[1]].y;71 x4 = p[4].x, 72 y4 = p[4].y; 69 73 dx = Math.max(Math.abs(x1 - x4) / 2, 10); 70 74 dy = Math.max(Math.abs(y1 - y4) / 2, 10); … … 73 77 x3 = [0, 0, 0, 0, x4, x4, x4 - dx, x4 + dx][res[1]].toFixed(3), 74 78 y3 = [0, 0, 0, 0, y1 + dy, y1 - dy, y4, y4][res[1]].toFixed(3); 75 var path = ["M", x1.toFixed(3), y1.toFixed(3), "C", x2, y2, x3, y3, x4.toFixed(3), y4.toFixed(3)].join(","); 79 80 var lineStyle = options.line_style?options.line_style:'C'; 81 var path = ["M", x1.toFixed(3), y1.toFixed(3), lineStyle, x2, y2, x3, y3, x4.toFixed(3), y4.toFixed(3)].join(","); 76 82 if (line && line.line) { 77 83 line.bg && line.bg.attr({ … … 102 108 $(document).ready(function(){ 103 109 var sitemap = cleanHtml($('.fancySitemap')).hide(); 104 var holder = $('#sitemapHolder') ;110 var holder = $('#sitemapHolder').css({width:options.canvas_width,height:options.canvas_height}); 105 111 var r = Raphael("sitemapHolder", holder.width(), holder.height()); 106 112 var connections = []; 107 113 var tree = []; 108 114 109 $('#savePosition').hide(); 110 115 if(typeof preview !== 'undefined' && preview==true){ 116 $('#savePosition').hide(); 117 118 //display width and height markers 119 var widthMarker = Math.floor(holder.width()/10); 120 var markerLeft = widthMarker; 121 while(markerLeft < holder.width()){ 122 var marker = $('<div />',{'class':'hMarkerTop'}) 123 .css({left:markerLeft}) 124 .appendTo(holder); 125 126 marker.clone().attr('class', 'hMarkerBot').appendTo(holder); 127 markerLeft += widthMarker; 128 } 129 130 var heightMarker = Math.floor(holder.height()/10); 131 var markerTop = heightMarker; 132 while(markerTop < holder.height()){ 133 var marker = $('<div />',{'class':'vMarkerLeft'}) 134 .css({top:markerTop}) 135 .appendTo(holder) 136 .clone() 137 .attr('class', 'vMarkerRight') 138 .appendTo(holder); 139 markerTop += heightMarker; 140 } 141 } 142 143 /* 144 * dragger, move and up are callback functions for drag event of block 145 */ 111 146 var dragger = function () { 112 147 this.ox = this.attr("x"); … … 187 222 188 223 /* 224 * recursive function to fill a tree from ul 225 * blocks are created here 189 226 * parent = root or subroot of a tree 190 227 * canvasWidth = canvas width … … 269 306 } 270 307 308 /* 309 * recursive function to link the blocks together with svg path 310 * and stylizes blocks 311 * tree = array of object 312 * parent = root of a subtree 313 * c = connection array 314 * r = rapheal object 315 */ 271 316 function buildTree(tree, parent, c, r){ 272 317 if(tree != null){ -
fancy-sitemap/trunk/readme.txt
r423535 r424304 4 4 Requires at least: 3.0 5 5 Tested up to: 3.2.1 6 Stable tag: 0. 66 Stable tag: 0.7 7 7 8 8 Fancy sitemap generates a javascript/svg sitemap. -
fancy-sitemap/trunk/views/admin_options.php
r423535 r424304 64 64 <legend>Options</legend> 65 65 <div class="formRow"> 66 <label for="bbc">Canvas Size:</label> 67 <input type="text" name="options[canvas_width]" size="1" value="<?php echo !empty($options['canvas_width'])?$options['canvas_width']:'450';?>" /> X 68 <input type="text" name="options[canvas_height]" size="1" value="<?php echo !empty($options['canvas_height'])?$options['canvas_height']:'250';?>" /> 69 </div> 70 <div class="formRow"> 66 71 <label for="bbc">Auto Block Width:</label> 67 72 <input type="hidden" name="options[auto_size]" value="0" /> … … 97 102 </div> 98 103 <div class="formRow"> 104 <label for="lc">Line Style:</label> 105 <select name="options[line_style]"> 106 <option value="C" <?php echo isset($options['line_style']) && $options['line_style']=='C'?'selected="selected"':'';?>>Curve Line</option> 107 <option value="L" <?php echo isset($options['line_style']) && $options['line_style']=='L'?'selected="selected"':'';?>>Straight Line</option> 108 <option value="T" <?php echo isset($options['line_style']) && $options['line_style']=='Q'?'selected="selected"':'';?>>Crazy Curve</option> 109 </select> 110 </div> 111 <div class="formRow"> 99 112 <label for="bbc">Font Size:</label> 100 113 <input type="text" name="options[font_size]" size="1" value="<?php echo isset($options['font_size'])?$options['font_size']:'8';?>" /> … … 122 135 <small>Use this to preview and position your sitemap.<br />Admin section and frontend should have a similar width so it looks the same on both.</small> 123 136 <div class="formRow"> 124 <div id="sitemapHolder"> 125 <?php echo fancy_sitemap_get_output(true);?> 126 </div> 127 <div class="formRow"> 128 <input type="submit" value="Save" class="button" id="savePosition" /> 129 </div> 137 <?php echo fancy_sitemap_get_output(true);?> 138 </div> 139 <div class="formRow"> 140 <input type="submit" value="Save" class="button" id="savePosition" /> 130 141 </div> 131 142 </fieldset>
Note: See TracChangeset
for help on using the changeset viewer.