Changeset 940336
- Timestamp:
- 06/29/2014 11:44:59 AM (12 years ago)
- Location:
- wp-travelermap/trunk
- Files:
-
- 8 edited
-
admin/js/travelermap-admin.js (modified) (3 diffs)
-
admin/travelermap-editmap.php (modified) (1 diff)
-
admin/travelermap-upgrade.php (modified) (2 diffs)
-
frontend/js/travelermap-frontend.js (modified) (8 diffs)
-
frontend/travelermap-frontend.php (modified) (2 diffs)
-
media/tm-admin.css (modified) (2 diffs)
-
readme.txt (modified) (4 diffs)
-
wp-travelermap.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-travelermap/trunk/admin/js/travelermap-admin.js
r940307 r940336 179 179 $('#tm_place_at_address').prop('disabled', false); 180 180 $('#tm_save_changes').prop('disabled', false); 181 } else if (data.type === 'endsection' ) {181 } else if (data.type === 'endsection' || data.type === 'startendsection') { 182 182 $('#tm_type').prop('disabled', false); 183 183 $('#tm_title').prop('disabled', false); … … 219 219 "departure": $('#tm_departure').val() !== '' ? Date.parse($('#tm_departure').val()) : null 220 220 }; 221 if (data.type === 'startsection' || data.type === 'endsection' || data.type === ' waypoint') {221 if (data.type === 'startsection' || data.type === 'endsection' || data.type === 'startendsection' || data.type === 'waypoint') { 222 222 data.excludeFromPath = false; 223 223 $('#tm_excludefrompath').prop('checked', data.excludeFromPath); … … 232 232 $(_currentSelection).removeClass('post'); 233 233 $(_currentSelection).removeClass('startsection'); 234 $(_currentSelection).removeClass('startendsection'); 234 235 $(_currentSelection).removeClass('endsection'); 235 236 -
wp-travelermap/trunk/admin/travelermap-editmap.php
r940307 r940336 145 145 <option value="waypoint">Waypoint</option> 146 146 <option value="startsection">Start Section</option> 147 <option value="startendsection">Start-End Section</option> 147 148 <option value="endsection">End Section</option> 148 149 </select><br /> -
wp-travelermap/trunk/admin/travelermap-upgrade.php
r940307 r940336 30 30 travelermap_upgrade_1_0_0_to_1_1_0(); 31 31 } 32 if( version_compare($currentVersion, '1.2.0', '<')) { 33 travelermap_upgrade_1_1_0_to_1_2_0(); 34 } 32 35 } 33 36 … … 41 44 } 42 45 43 update_option("travelermap_version", TM_VERSION); 44 update_option("travelermap_db_version", TM_VERSION); 46 update_option("travelermap_version", '1.1.0'); 47 update_option("travelermap_db_version", '1.1.0'); 48 49 } 50 51 function travelermap_upgrade_1_1_0_to_1_2_0() { 52 $settings = get_option('traverlermap_settings'); 53 54 if (!$settings) { 55 $settings = array( 56 ); 57 update_option('travelermap_settings', $settings); 58 } 59 60 update_option("travelermap_version", '1.2.0'); 61 update_option("travelermap_db_version", '1.2.0'); 45 62 46 63 } -
wp-travelermap/trunk/frontend/js/travelermap-frontend.js
r940307 r940336 38 38 height: 400, 39 39 spinner: true, 40 dateFormat: "dd.MM.yyyy" 40 dateFormat: "dd.MM.yyyy", 41 zoomLevel: 3 41 42 }; 42 43 … … 72 73 } 73 74 74 _map = L.map(_mapWrapper[0]).setView([0,0], 3);;75 _map = L.map(_mapWrapper[0]).setView([0,0], _mapOptions.zoomLevel);; 75 76 _map.on('popupopen', function(e) { 76 77 var px = _map.project(e.popup._latlng); … … 226 227 currentLine.bindPopup(feature.title); 227 228 currentLine['tm_data'] = feature; 229 feature['_lf_object'] = currentLine; 228 230 group.addLayer(currentLine); 229 feature['_lf_object'] = currentLine;230 231 currentLine = L.geodesicPolyline([],{color:lineColor}); 231 232 currentLine.addLatLng([feature.lat, feature.lng]); //add as starting point … … 237 238 } 238 239 } 240 } else if(feature.type === 'startendsection') { 241 currentLine.addLatLng([feature.lat, feature.lng]); 242 currentLine.bindPopup(feature.title); 243 currentLine['tm_data'] = feature; 244 group.addLayer(currentLine); 245 feature['_lf_object'] = currentLine; 246 currentLine = L.geodesicPolyline([],{color:lineColor}); 247 currentLine.on('mouseover', function(evt) { 248 evt.target.setStyle({opacity: 1}); 249 }); 250 currentLine.on('mouseout', function(evt) { 251 evt.target.setStyle({opacity: 0.5}); 252 }); 253 currentLine.on('popupopen', function(evt) { 254 evt.target.setStyle({opacity: 1}); 255 }); 256 currentLine.on('popupclose', function(evt) { 257 evt.target.setStyle({opacity: 0.5}); 258 }); 259 currentLine.addLatLng([feature.lat, feature.lng]); //add as starting point 260 var nextPoint = _findNextWaypointMarker(data,i+1); 261 if(nextPoint) { 262 if(nextPoint.arrival && nextPoint.arrival >= new Date().getTime()) { 263 isInFuture = true; 264 } 265 } 239 266 } 240 267 … … 249 276 function _findStartSection(data, start) { 250 277 for(var i = start; i >= 0; i--) { 251 if(data[i].type === 'startsection') { 278 if(data[i].type === 'startsection' || data[i].type === 'startendsection') { 279 return data[i]; 280 } 281 } 282 return null; 283 } 284 285 function _findEndSection(data, start) { 286 for(var i = start; i < data.length; i++) { 287 if(data[i].type === 'startendsection' || data[i].type === 'endsection') { 252 288 return data[i]; 253 289 } … … 258 294 function _findNextWaypointMarker(data, start) { 259 295 for(var i = start; i < data.length; i++) { 260 if((data[i].type === "waypoint" || data[i].type === "startsection" || data[i].type === " endsection" || data[i].type==='marker' || data[i].type === 'media' || data[i].type === 'post') && !data[i].excludeFromPath) {296 if((data[i].type === "waypoint" || data[i].type === "startsection" || data[i].type === "startendsection" || data[i].type === "endsection" || data[i].type==='marker' || data[i].type === 'media' || data[i].type === 'post') && !data[i].excludeFromPath) { 261 297 return data[i]; 262 298 } … … 278 314 markerLayer.addLayer(wp); 279 315 } 280 } else if(feature.type === 'startsection' || feature.type === 'endsection' ) {316 } else if(feature.type === 'startsection' || feature.type === 'endsection' || feature.type === 'startendsection') { 281 317 var wp = L.circleMarker([feature.lat, feature.lng], {radius: 5, fillOpacity:1, color:lineColor}); 282 318 if(feature.title) { … … 317 353 } 318 354 var dateInfo = '<span>'; 319 if(feature.type === 'endsection') { 320 var start = _findStartSection(data, position); 321 if(start && start.arrival) { 355 if(feature.type === 'endsection' || feature.type === 'startendsection') { 356 var start = _findStartSection(data, position-1); 357 if(start && start.departure) { 358 dateInfo += "Start: " + $.format.date(start.departure, _mapOptions.dateFormat) + ' | '; 359 } else if(start && start.arrival) { 322 360 dateInfo += "Start: " + $.format.date(start.arrival, _mapOptions.dateFormat) + ' | '; 323 361 } 324 if(feature.departure) { 362 if(feature.arrival) { 363 dateInfo += "End: " + $.format.date(feature.arrival, _mapOptions.dateFormat) + ' | '; 364 } else if(feature.departure) { 325 365 dateInfo += "End: " + $.format.date(feature.departure, _mapOptions.dateFormat) + ' | '; 326 366 } 327 328 367 } else { 329 368 if(feature.date) { -
wp-travelermap/trunk/frontend/travelermap-frontend.php
r940307 r940336 39 39 "id" => '', 40 40 "connectmaps" => 'false', 41 'spinner' => 'true' 41 'spinner' => 'true', 42 'zoomlevel' => '3' 42 43 ), $atts ) ); 43 44 … … 72 73 $output .= "$('#tm_map_$map_id')"; 73 74 $output .= ","; 74 $output .= "{connectMaps:$connectmaps, height:$height, spinner:$spinner, dateFormat:'$dateFormat' }";75 $output .= "{connectMaps:$connectmaps, height:$height, spinner:$spinner, dateFormat:'$dateFormat', zoomLevel:$zoomlevel}"; 75 76 $output .= ');'; 76 77 $output .= '});'; -
wp-travelermap/trunk/media/tm-admin.css
r940307 r940336 104 104 } 105 105 106 ul#tm_pointlist > li.startendsection { 107 border: 1px solid #000; 108 } 109 106 110 ul#tm_pointlist > li.startsection > i:before { 107 111 content: "\f105"; … … 110 114 ul#tm_pointlist > li.endsection > i:before { 111 115 content: "\f104"; 116 } 117 118 ul#tm_pointlist > li.startendsection > i:before { 119 content: "\f101"; 112 120 } 113 121 -
wp-travelermap/trunk/readme.txt
r940307 r940336 4 4 Tags: travel, map, waypoints 5 5 Requires at least: 3.9.0 6 Tested up to: 3.9. 07 Stable tag: 1. 1.06 Tested up to: 3.9.1 7 Stable tag: 1.2.0 8 8 License: MIT 9 9 License URI: http://opensource.org/licenses/MIT … … 13 13 == Description == 14 14 15 This Pluigin allowthe creation of travel maps with routes and point of interests.15 This plugin allows the creation of travel maps with routes and point of interests. 16 16 The points or route section can be linked with posts or media attachments. 17 17 … … 20 20 Additional parameters for the shortcode are: connectmaps="true|false" to connect the maps in the order 21 21 specified in the comma separated id list and spinner="true|false" to disable the spinner to navigate 22 through markers .22 through markers, zoomlevel="0-16" to set the initial zoom level (0 min, 16 max level) 23 23 24 24 example: … … 51 51 52 52 == Changelog == 53 54 = 1.2.0 = 55 * added zoomlevel to shortcode to set initial zoom level 56 * added startendsection marker type to create consecutive sections 57 * fixed some bugs 53 58 54 59 = 1.1.0 = -
wp-travelermap/trunk/wp-travelermap.php
r940307 r940336 4 4 Plugin URI: http://bitschubser.org/projects/wp-travelermap 5 5 Description: A simple Plugin to create travel routes and manage maps 6 Version: 1. 1.06 Version: 1.2.0 7 7 Author: Mathis Zeiher 8 8 Author URI: http://bitschubser.org/ … … 32 32 33 33 if ( ! defined( 'TM_VERSION' ) ) 34 define( 'TM_VERSION', '1. 1.0' );34 define( 'TM_VERSION', '1.2.0' ); 35 35 36 36 if ( ! defined( 'TM_URL' ) )
Note: See TracChangeset
for help on using the changeset viewer.