Changeset 1954969
- Timestamp:
- 10/11/2018 08:52:21 AM (7 years ago)
- Location:
- mapple
- Files:
-
- 5 edited
- 20 copied
-
tags/1.5.1 (copied) (copied from mapple/trunk)
-
tags/1.5.1/README.md (copied) (copied from mapple/trunk/README.md)
-
tags/1.5.1/admin/class-mapple-admin.php (copied) (copied from mapple/trunk/admin/class-mapple-admin.php)
-
tags/1.5.1/admin/js (copied) (copied from mapple/trunk/admin/js)
-
tags/1.5.1/admin/partials/mapple-admin-field-image.php (copied) (copied from mapple/trunk/admin/partials/mapple-admin-field-image.php)
-
tags/1.5.1/admin/partials/mapple-admin-field-textarea.php (copied) (copied from mapple/trunk/admin/partials/mapple-admin-field-textarea.php)
-
tags/1.5.1/admin/partials/mapple-admin-page-settings.php (copied) (copied from mapple/trunk/admin/partials/mapple-admin-page-settings.php)
-
tags/1.5.1/admin/partials/mapple-admin-settings-section-api.php (copied) (copied from mapple/trunk/admin/partials/mapple-admin-settings-section-api.php)
-
tags/1.5.1/includes/class-mapple-shared.php (copied) (copied from mapple/trunk/includes/class-mapple-shared.php) (2 diffs)
-
tags/1.5.1/includes/class-mapple.php (copied) (copied from mapple/trunk/includes/class-mapple.php)
-
tags/1.5.1/mapple.php (copied) (copied from mapple/trunk/mapple.php) (2 diffs)
-
tags/1.5.1/public/class-mapple-public.php (copied) (copied from mapple/trunk/public/class-mapple-public.php) (1 diff)
-
tags/1.5.1/public/class-mapple-template-functions.php (copied) (copied from mapple/trunk/public/class-mapple-template-functions.php)
-
tags/1.5.1/public/css/mapple-public.css (copied) (copied from mapple/trunk/public/css/mapple-public.css)
-
tags/1.5.1/public/js/mapple-public.js (copied) (copied from mapple/trunk/public/js/mapple-public.js) (2 diffs)
-
tags/1.5.1/public/templates/mapple-client-content.php (copied) (copied from mapple/trunk/public/templates/mapple-client-content.php)
-
tags/1.5.1/public/templates/mapple-client-search.php (copied) (copied from mapple/trunk/public/templates/mapple-client-search.php)
-
tags/1.5.1/public/templates/mapple-client-table-start.php (copied) (copied from mapple/trunk/public/templates/mapple-client-table-start.php)
-
tags/1.5.1/public/templates/mapple-loop-clients.php (copied) (copied from mapple/trunk/public/templates/mapple-loop-clients.php)
-
tags/1.5.1/readme.txt (copied) (copied from mapple/trunk/readme.txt) (3 diffs)
-
trunk/includes/class-mapple-shared.php (modified) (2 diffs)
-
trunk/mapple.php (modified) (2 diffs)
-
trunk/public/class-mapple-public.php (modified) (1 diff)
-
trunk/public/js/mapple-public.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mapple/tags/1.5.1/includes/class-mapple-shared.php
r1933696 r1954969 137 137 $args['orderby'] = $params['orderby']; 138 138 $args['order'] = 'ASC'; 139 $args['posts_per_page'] = absint( $params['quantity'] ); 139 // @todo: insert option for shortcode to adjust qty when pagination feature is in 140 //$args['posts_per_page'] = absint( $params['quantity'] ); 140 141 $args['post_status'] = 'publish'; 141 142 $args['post_type'] = 'clients'; … … 143 144 144 145 unset( $params['orderby'] ); 145 unset( $params['quantity'] );146 //unset( $params['quantity'] ); 146 147 unset( $params['listview'] ); 147 148 unset( $params['singleview'] ); -
mapple/tags/1.5.1/mapple.php
r1937361 r1954969 17 17 * Plugin URI: https://andrekelling.de/ 18 18 * Description: To show a google map with the locations of your clients. You can output additionally a sorted listing table of all your clients. Just with shortcodes. 19 * Version: 1.5. 019 * Version: 1.5.1 20 20 * Author: André Kelling 21 21 * Author URI: https://andrekelling.de/about … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define( 'MAPPLE_VERSION', '1.5. 0' );38 define( 'MAPPLE_VERSION', '1.5.1' ); 39 39 40 40 /** -
mapple/tags/1.5.1/public/class-mapple-public.php
r1937361 r1954969 160 160 $defaults['loop-template'] = $this->plugin_name . '-loop-clients'; 161 161 $defaults['orderby'] = 'title'; 162 $defaults['quantity'] = 0; 162 // @todo: insert option for shortcode to adjust qty when pagination feature is in 163 //$defaults['quantity'] = 0; // is 10 164 $defaults['nopaging'] = true; 163 165 164 166 $shared = new Mapple_Shared( $this->plugin_name, $this->version ); -
mapple/tags/1.5.1/public/js/mapple-public.js
r1937361 r1954969 40 40 41 41 const theMap = new google.maps.Map(el, myMapOptions); 42 43 plugin.loadJSON('clients', function(response) { 44 for(let i = 0; i < response.length; i++) { 45 46 if (response[i].location){ 47 plugin.setMarker(response[i], i, theMap); 48 } 49 50 } 51 52 //now fit the map to the newly inclusive bounds 53 theMap.fitBounds(settings.bounds); 54 }); 42 const perPage = 100; 43 44 plugin.loadJSON('clients/?per_page='+perPage, function(response, total, pages) { 45 // first load get total count of pages 46 for(let i = 0; i < pages; i++) { 47 plugin.loadJSON('clients/?page='+(i+1)+'&per_page='+perPage, function(response) { 48 //console.log(response); 49 plugin.responseLoop(response, theMap); 50 }); 51 } 52 53 plugin.responseLoop(response, theMap); 54 }); 55 }; 56 57 plugin.responseLoop = function(response, theMap) { 58 for(let i = 0; i < response.length; i++) { 59 60 if (response[i].location){ 61 plugin.setMarker(response[i], i, theMap); 62 } 63 64 } 65 66 //now fit the map to the newly inclusive bounds 67 theMap.fitBounds(settings.bounds); 55 68 }; 56 69 … … 114 127 if (xobj.readyState == 4 && xobj.status == '200') { 115 128 // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode 116 callback(JSON.parse(xobj.responseText) );129 callback(JSON.parse(xobj.responseText), xobj.getResponseHeader("X-WP-Total"), xobj.getResponseHeader("X-WP-TotalPages")); 117 130 } 118 131 }; -
mapple/tags/1.5.1/readme.txt
r1937361 r1954969 5 5 Requires at least: 4.7 6 6 Tested up to: 4.9.5 7 Stable tag: 1.5. 07 Stable tag: 1.5.1 8 8 Requires PHP: 7.0 9 9 License: GPLv3.0 or later … … 26 26 * provides a new custom post type `clients` 27 27 * map functionality works over the REST_API 28 * the limit of fetched `clients` posts is unset. Beware of the risk fetching too much!!! (proper limitation feature is planned) 28 29 29 30 ### Shortcodes … … 63 64 == Changelog == 64 65 66 = 1.5.1 = 67 * remove default 10 post entries limit from table and map 68 65 69 = 1.5.0 = 66 70 * enable google maps marker image customisation -
mapple/trunk/includes/class-mapple-shared.php
r1933696 r1954969 137 137 $args['orderby'] = $params['orderby']; 138 138 $args['order'] = 'ASC'; 139 $args['posts_per_page'] = absint( $params['quantity'] ); 139 // @todo: insert option for shortcode to adjust qty when pagination feature is in 140 //$args['posts_per_page'] = absint( $params['quantity'] ); 140 141 $args['post_status'] = 'publish'; 141 142 $args['post_type'] = 'clients'; … … 143 144 144 145 unset( $params['orderby'] ); 145 unset( $params['quantity'] );146 //unset( $params['quantity'] ); 146 147 unset( $params['listview'] ); 147 148 unset( $params['singleview'] ); -
mapple/trunk/mapple.php
r1937361 r1954969 17 17 * Plugin URI: https://andrekelling.de/ 18 18 * Description: To show a google map with the locations of your clients. You can output additionally a sorted listing table of all your clients. Just with shortcodes. 19 * Version: 1.5. 019 * Version: 1.5.1 20 20 * Author: André Kelling 21 21 * Author URI: https://andrekelling.de/about … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define( 'MAPPLE_VERSION', '1.5. 0' );38 define( 'MAPPLE_VERSION', '1.5.1' ); 39 39 40 40 /** -
mapple/trunk/public/class-mapple-public.php
r1937361 r1954969 160 160 $defaults['loop-template'] = $this->plugin_name . '-loop-clients'; 161 161 $defaults['orderby'] = 'title'; 162 $defaults['quantity'] = 0; 162 // @todo: insert option for shortcode to adjust qty when pagination feature is in 163 //$defaults['quantity'] = 0; // is 10 164 $defaults['nopaging'] = true; 163 165 164 166 $shared = new Mapple_Shared( $this->plugin_name, $this->version ); -
mapple/trunk/public/js/mapple-public.js
r1937361 r1954969 40 40 41 41 const theMap = new google.maps.Map(el, myMapOptions); 42 43 plugin.loadJSON('clients', function(response) { 44 for(let i = 0; i < response.length; i++) { 45 46 if (response[i].location){ 47 plugin.setMarker(response[i], i, theMap); 48 } 49 50 } 51 52 //now fit the map to the newly inclusive bounds 53 theMap.fitBounds(settings.bounds); 54 }); 42 const perPage = 100; 43 44 plugin.loadJSON('clients/?per_page='+perPage, function(response, total, pages) { 45 // first load get total count of pages 46 for(let i = 0; i < pages; i++) { 47 plugin.loadJSON('clients/?page='+(i+1)+'&per_page='+perPage, function(response) { 48 //console.log(response); 49 plugin.responseLoop(response, theMap); 50 }); 51 } 52 53 plugin.responseLoop(response, theMap); 54 }); 55 }; 56 57 plugin.responseLoop = function(response, theMap) { 58 for(let i = 0; i < response.length; i++) { 59 60 if (response[i].location){ 61 plugin.setMarker(response[i], i, theMap); 62 } 63 64 } 65 66 //now fit the map to the newly inclusive bounds 67 theMap.fitBounds(settings.bounds); 55 68 }; 56 69 … … 114 127 if (xobj.readyState == 4 && xobj.status == '200') { 115 128 // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode 116 callback(JSON.parse(xobj.responseText) );129 callback(JSON.parse(xobj.responseText), xobj.getResponseHeader("X-WP-Total"), xobj.getResponseHeader("X-WP-TotalPages")); 117 130 } 118 131 }; -
mapple/trunk/readme.txt
r1937361 r1954969 5 5 Requires at least: 4.7 6 6 Tested up to: 4.9.5 7 Stable tag: 1.5. 07 Stable tag: 1.5.1 8 8 Requires PHP: 7.0 9 9 License: GPLv3.0 or later … … 26 26 * provides a new custom post type `clients` 27 27 * map functionality works over the REST_API 28 * the limit of fetched `clients` posts is unset. Beware of the risk fetching too much!!! (proper limitation feature is planned) 28 29 29 30 ### Shortcodes … … 63 64 == Changelog == 64 65 66 = 1.5.1 = 67 * remove default 10 post entries limit from table and map 68 65 69 = 1.5.0 = 66 70 * enable google maps marker image customisation
Note: See TracChangeset
for help on using the changeset viewer.