Changeset 3207917
- Timestamp:
- 12/14/2024 10:41:50 AM (14 months ago)
- Location:
- traveledmap-trip-itinerary-embedded-map/trunk
- Files:
-
- 49 added
- 9 edited
-
.gitignore (modified) (1 diff)
-
README.md (modified) (1 diff)
-
plugin.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
src/init.php (modified) (2 diffs)
-
src/metabox/metabox.php (modified) (3 diffs)
-
src/metabox/style.css (added)
-
src/shared/constants/env.php (modified) (1 diff)
-
src/shared/front-renderer.php (modified) (1 diff)
-
src/trip-block (added)
-
src/trip-block/.editorconfig (added)
-
src/trip-block/.gitignore (added)
-
src/trip-block/build (added)
-
src/trip-block/build/block.json (added)
-
src/trip-block/build/index-rtl.css (added)
-
src/trip-block/build/index.asset.php (added)
-
src/trip-block/build/index.css (added)
-
src/trip-block/build/index.js (added)
-
src/trip-block/build/index.php (added)
-
src/trip-block/build/render.php (added)
-
src/trip-block/build/style-index-rtl.css (added)
-
src/trip-block/build/style-index.css (added)
-
src/trip-block/package-lock.json (added)
-
src/trip-block/package.json (added)
-
src/trip-block/src (added)
-
src/trip-block/src/block.json (added)
-
src/trip-block/src/edit.js (added)
-
src/trip-block/src/editor.scss (added)
-
src/trip-block/src/index.js (added)
-
src/trip-block/src/index.php (added)
-
src/trip-block/src/render.php (added)
-
src/trip-block/src/save.js (added)
-
src/trip-block/src/style.scss (added)
-
src/trip-block/trip-block.php (added)
-
src/trip-block/yarn.lock (added)
-
src/trip-step-block (added)
-
src/trip-step-block/.editorconfig (added)
-
src/trip-step-block/.gitignore (added)
-
src/trip-step-block/build (added)
-
src/trip-step-block/build/block.json (added)
-
src/trip-step-block/build/index-rtl.css (added)
-
src/trip-step-block/build/index.asset.php (added)
-
src/trip-step-block/build/index.css (added)
-
src/trip-step-block/build/index.js (added)
-
src/trip-step-block/build/style-index-rtl.css (added)
-
src/trip-step-block/build/style-index.css (added)
-
src/trip-step-block/package-lock.json (added)
-
src/trip-step-block/package.json (added)
-
src/trip-step-block/src (added)
-
src/trip-step-block/src/block.json (added)
-
src/trip-step-block/src/edit.js (added)
-
src/trip-step-block/src/editor.scss (added)
-
src/trip-step-block/src/index.js (added)
-
src/trip-step-block/src/save.js (added)
-
src/trip-step-block/src/style.scss (added)
-
src/trip-step-block/trip-step-block.php (added)
-
src/trip-step-block/yarn.lock (added)
-
src/widget/widget.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
traveledmap-trip-itinerary-embedded-map/trunk/.gitignore
r2636205 r3207917 1 src/blocks/node_modules 1 src/trip-block/node_modules 2 src/trip-step-block/node_modules 2 3 3 4 ## Uncomment line below if you prefer to -
traveledmap-trip-itinerary-embedded-map/trunk/README.md
r2636216 r3207917 1 1 ## Develop 2 The main thing is to change the variables in the `src/contants/env.php` file 3 Then `cd src/blocks` and `yarn start` 2 The main thing is to change the variables in the `src/contants/env.php` file : 3 - ENV_URL 4 - API_URL 5 Then 6 - `cd src/trip-block` and `npm i && npm start` 7 - `cd src/trip-step-block` and `npm i && npm start` 4 8 5 9 ## Deploy 6 - `cd src/blocks && yarn build` 10 - `cd src/trip-block && yarn build` 11 - `cd src/trip-step-block && yarn build` 7 12 - `git add .` 8 13 - `git push` -
traveledmap-trip-itinerary-embedded-map/trunk/plugin.php
r2636216 r3207917 6 6 * Author: TraveledMap 7 7 * Author URI: https://www.traveledmap.com 8 * Version: 1. 1.28 * Version: 1.2.0 9 9 * License: GPL2+ 10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.txt -
traveledmap-trip-itinerary-embedded-map/trunk/readme.txt
r2636216 r3207917 4 4 Donate link: https://donorbox.org/help-traveledmap-to-stay-free 5 5 Requires at least: 3.0.1 6 Tested up to: 5.8.26 Tested up to: 6.6.2 7 7 Requires PHP: 5.6 8 Stable tag: 1. 1.28 Stable tag: 1.2.0 9 9 License: GPLv2 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 210 210 button to recover the content. 211 211 212 = 1.2.0 = 213 Conformed to WordPress best practices for developing blocks. Made it compatible with newer WordPress versions. 214 -
traveledmap-trip-itinerary-embedded-map/trunk/src/init.php
r2636205 r3207917 16 16 function traveledmap_trip_block_assets() 17 17 { 18 // Embedded trip block---------------------------------------18 // Metabox style --------------------------------------- 19 19 wp_register_style( 20 'traveledmap- trip-style-css', // Handle.21 plugins_url('src/ blocks/dist/blocks.style.build.css', dirname(__FILE__)),20 'traveledmap-metabox-style-css', 21 plugins_url('src/metabox/style.css', dirname(__FILE__)), 22 22 array('wp-editor'), 23 23 null 24 24 ); 25 25 26 // Register block editor script for backend. 27 wp_register_script( 28 'traveledmap-trip-block-js', // Handle. 29 plugins_url('/src/blocks/dist/blocks.build.js', dirname(__FILE__)), // Block.build.js: We register the block here. Built with Webpack. 30 array('wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor'), // Dependencies, defined above. 31 null, // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: filemtime — Gets file modification time. 32 true // Enqueue the script in the footer. 33 ); 34 35 // Register block editor styles for backend. 36 wp_register_style( 37 'traveledmap-trip-block-editor-css', // Handle. 38 plugins_url('src/blocks/dist/blocks.editor.build.css', dirname(__FILE__)), // Block editor CSS. 39 array('wp-edit-blocks'), // Dependency to include the CSS after it. 40 null // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. 41 ); 42 43 // Other libs ----------------------------------------------- 44 wp_register_script( 45 'traveledmap_map-sticky-js', 46 plugins_url('/dist/sticky.min.js', dirname(__FILE__)), 47 array(), 48 null, 49 true 50 ); 26 wp_enqueue_style('traveledmap-metabox-style-css'); 51 27 52 28 // TODO: Introduced in 5.8.0: add_filter('block_categories_all', 'add_new_traveledmap_category', 10, 2); … … 54 30 add_filter('block_categories', 'add_new_traveledmap_category', 10, 2); 55 31 56 register_block_type( 57 'traveledmap/embedded-trip-block', array( 58 // Enqueue blocks.style.build.css on both frontend & backend. 59 'style' => 'traveledmap-trip-style-css', 60 // Enqueue blocks.build.js in the editor only. 61 'editor_script' => 'traveledmap-trip-block-js', 62 // Enqueue blocks.editor.build.css in the editor only. 63 'editor_style' => 'traveledmap-trip-block-editor-css', 64 // Server side rendering 65 'render_callback' => 'traveledmap_render_callback', 66 'attributes' => array( 67 'tripId' => array('type' => 'string'), 68 'traveledmap_user_id' => array('type' => 'string'), 69 'traveledmap_trip_base_url' => array('type' => 'string'), 70 'baseUrl' => array('type' => 'string'), 71 'traveledmap_trip_steps' => array('type' => 'string'), 72 'traveledmap_disable_widget' => array('type' => 'boolean', 'default' => false), 73 'traveledmap_show_markers_customization' => array('type' => 'boolean', 'default' => false), 74 'showPopup' => array('type' => 'boolean', 'default' => false), 75 'showPictures' => array('type' => 'boolean', 'default' => true), 76 'showPicturesAtStart' => array('type' => 'boolean', 'default' => false), 77 'isSticky' => array('type' => 'boolean', 'default' => true), 78 'showOnPhones' => array('type' => 'boolean', 'default' => true), 79 'showOnTablets' => array('type' => 'boolean', 'default' => true), 80 'showOnLargeScreens' => array('type' => 'boolean', 'default' => true), 81 'mapHeight' => array('type' => 'string', 'default' => '50%'), 82 'standardMapHeight' => array('type' => 'string', 'default' => '30%'), 83 'extendedMapHeight' => array('type' => 'string', 'default' => '60%'), 84 'marginTop' => array('type' => 'number', 'default' => 0), 85 ) 86 ) 87 ); 32 33 register_block_type( __DIR__ . '/trip-block/build' ); 34 register_block_type( __DIR__ . '/trip-step-block/build' ); 88 35 } 89 36 -
traveledmap-trip-itinerary-embedded-map/trunk/src/metabox/metabox.php
r2636205 r3207917 35 35 <input id="traveledmap-trip-id" type="text" name="traveledmap-trip-id" value="' . esc_html($tripId) . '" maxlength="40" /> 36 36 </div> 37 <p class="mt-5"> 38 <a href="https://www.traveledmap.com/share?tab=0&share=TRIP&tool=WORDPRESS_GUTENBERG" target="_blank">How to find your data?</a> 39 </p> 37 <div> 38 <p class="mt-5"> 39 <a href="https://www.traveledmap.com/share?tab=website&share=TRIP&tool=WORDPRESS_GUTENBERG" target="_blank">How to find your data?</a> 40 </p> 41 </div> 40 42 </div> 41 43 … … 109 111 110 112 const traveledMapMetaboxHandleSteps = (steps, tripId, userId) => { 113 const stateEl = document.getElementById("traveledmap-metabox-state"); 114 111 115 if (!steps) { 112 116 traveledMapMetaboxStopLoading(); … … 119 123 }), {}); 120 124 121 const stateEl = document.getElementById("traveledmap-metabox-state");122 125 stateEl.classList.remove("success"); 123 126 stateEl.classList.remove("warning"); -
traveledmap-trip-itinerary-embedded-map/trunk/src/shared/constants/env.php
r2636211 r3207917 3 3 define("ENV_URL", "https://www.traveledmap.com"); 4 4 define("API_URL", "https://us-central1-traveledmap.cloudfunctions.net"); 5 define("SDK_VERSION", "1.0. 1");5 define("SDK_VERSION", "1.0.2"); -
traveledmap-trip-itinerary-embedded-map/trunk/src/shared/front-renderer.php
r2636216 r3207917 49 49 const handleTraveledMapTripBlockLoad = function () { 50 50 new TraveledMapTrip("' . $elementId . '", { 51 baseUrl: "' . ENV_URL . '", 51 52 userId: "' . $userId . '", 52 53 tripId: "' . $tripId . '", -
traveledmap-trip-itinerary-embedded-map/trunk/src/widget/widget.php
r2636216 r3207917 104 104 const handleTraveledMapWidgetLoad = function () { 105 105 new TraveledMapTrip("' . $elementId . '", { 106 baseUrl: "' . ENV_URL . '", 106 107 userId: "' . $userId . '", 107 108 tripId: "' . $tripId . '", … … 155 156 public function form($instance) 156 157 { 157 $thisWidgetRandomId = rand(0, 10000000);158 158 $title = !empty($instance['title']) ? esc_attr($instance['title']) : ''; 159 159 $titleId = esc_attr($this->get_field_id('title')); … … 201 201 $extendedShowPicturesValue = esc_attr(self::instanceVarToChecked($instance, 'extended_show_pictures')); 202 202 203 $extendedWrapperClass = $extendableValue == ="checked" ? '' : 'is-hidden';203 $extendedWrapperClass = $extendableValue == "checked" ? '' : 'is-hidden'; 204 204 205 205 echo ' … … 219 219 <input type="checkbox" name="' . $showOnLargeScreensName. '" ' . $showOnLargeScreensValue . '> 220 220 <label for="' . $showOnLargeScreensName . '">Show on larger screens</label> <br /> 221 <small >221 <small class="tm-widget-note"><i> 222 222 You can decides on which type of device the widget will show up. 223 </ small>223 </i></small> 224 224 </p> 225 225 <p> 226 226 <label>Map height (in pixels or percentage)</label> 227 227 <input type="text" name="' . $mapHeightName . '" value="' . $mapHeightValue . '" class="widefat" maxlength="10"> 228 <small >228 <small class="tm-widget-note"><i> 229 229 You can specify height in pixels of percentage. i.e: 500px or 60%<br /> 230 230 Percentage are relative to screen\'s height. 231 </ small>231 </i></small> 232 232 </p> 233 233 <p> 234 234 <input type="checkbox" name="' . $isStickyName . '" ' . $isStickyValue . '> 235 235 <label>Widget is sticky</label> <br /> 236 <small >236 <small class="tm-widget-note"><i> 237 237 Sticky means that the widget will stay fixed on the screen while user scroll, 238 to allow him to see the map where ever his current scroll is on the blog post.239 </ small>238 to allow him to see the map wherever his current scroll is on the blog post. 239 </i></small> 240 240 </p> 241 241 <hr /> … … 254 254 <p> 255 255 <h3>Map extended</h3> 256 <input type="checkbox" name="' . $extendableName . '" ' . $extendableValue . ' onclick="window.toggleExtendOptions [\'' . $thisWidgetRandomId . '\']()">256 <input type="checkbox" name="' . $extendableName . '" ' . $extendableValue . ' onclick="window.toggleExtendOptions(this)"> 257 257 <label>Can be expanded (to a large map, using options bellow - you may need to save and refresh to make them appear)</label> <br /> 258 258 </p> … … 260 260 261 261 echo ' 262 <div id="tm-extend-options-wrapper-' . $thisWidgetRandomId . '"class="tm-extend-options-wrapper ' . $extendedWrapperClass . '">262 <div class="tm-extend-options-wrapper ' . $extendedWrapperClass . '"> 263 263 <p> 264 264 <strong>Extend options</strong><br /> … … 301 301 </p> 302 302 303 <p >303 <p class="tm-widget-note"> 304 304 <strong>Help</strong> 305 305 Margins: Space between the extended map and the screen\'s border, set in pixels (px) … … 311 311 echo ' 312 312 <style> 313 .tm-widget-note { 314 color: #353535; 315 line-height: 1em; 316 font-size: 12px; 317 } 313 318 .mt-20 { 314 319 margin-top: 20px; … … 330 335 <script> 331 336 (function() { 332 const randomId = "' . $thisWidgetRandomId . '"; 333 const extendOptionsWrapperEl = document.getElementById(`tm-extend-options-wrapper-${randomId}`); 334 if(!window.toggleExtendOptions) { 335 window.toggleExtendOptions = {}; 336 } 337 window.toggleExtendOptions[randomId] = function() { 338 if(extendOptionsWrapperEl.classList.contains("is-hidden")) { 339 extendOptionsWrapperEl.classList.remove("is-hidden"); 337 window.toggleExtendOptions = function(el) { 338 const siblingWrapper = el.parentNode.querySelector(".tm-extend-options-wrapper") 339 if(siblingWrapper.classList.contains("is-hidden")) { 340 siblingWrapper.classList.remove("is-hidden"); 340 341 } else { 341 extendOptionsWrapperEl.classList.add("is-hidden");342 siblingWrapper.classList.add("is-hidden"); 342 343 } 343 344 };
Note: See TracChangeset
for help on using the changeset viewer.