Changeset 2461813
- Timestamp:
- 01/24/2021 03:25:43 PM (5 years ago)
- Location:
- appizy-app-embed
- Files:
-
- 16 added
- 8 edited
-
tags/2.1.0 (added)
-
tags/2.1.0/appizy-app-embed.php (added)
-
tags/2.1.0/class (added)
-
tags/2.1.0/class/class-appizy-api.php (added)
-
tags/2.1.0/class/class-appizy-app-embed.php (added)
-
tags/2.1.0/css (added)
-
tags/2.1.0/css/appizy-styles.css (added)
-
tags/2.1.0/includes (added)
-
tags/2.1.0/includes/admin-config.php (added)
-
tags/2.1.0/includes/admin-tools-screen.php (added)
-
tags/2.1.0/includes/app-embed.php (added)
-
tags/2.1.0/js (added)
-
tags/2.1.0/js/admin-tools-screen.js (added)
-
tags/2.1.0/js/embed.js (added)
-
tags/2.1.0/license.txt (added)
-
tags/2.1.0/readme.txt (added)
-
trunk/appizy-app-embed.php (modified) (1 diff)
-
trunk/class/class-appizy-app-embed.php (modified) (3 diffs)
-
trunk/css/appizy-styles.css (modified) (2 diffs)
-
trunk/includes/admin-tools-screen.php (modified) (1 diff)
-
trunk/includes/app-embed.php (modified) (3 diffs)
-
trunk/js/admin-tools-screen.js (modified) (2 diffs)
-
trunk/js/embed.js (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
appizy-app-embed/trunk/appizy-app-embed.php
r1975563 r2461813 9 9 Author: Appizy 10 10 Author URI: http://www.appizy.com 11 Version: 2. 0.111 Version: 2.1.0 12 12 Text Domain: appizy 13 13 */ 14 14 15 15 /* 16 Copyright (C) 2017 Appizy16 Copyright (C) 2017-2021 Appizy 17 17 18 18 This program is free software: you can redistribute it and/or modify -
appizy-app-embed/trunk/class/class-appizy-app-embed.php
r1964229 r2461813 26 26 add_action( 'wp_loaded', array( $this, 'enqueue_appizy_scripts' ) ); 27 27 add_action( 'wp_loaded', array( $this, 'enqueue_appizy_styles' ) ); 28 29 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_appizy_admin_script' ) ); 30 } 31 32 public function enqueue_appizy_admin_script() { 33 wp_register_script( 'appizy-admin-script', plugins_url( '/../js/admin-tools-screen.js', __FILE__ ), array( 'jquery' ), null, true ); 34 35 wp_enqueue_script( 'appizy-admin-script' ); 28 36 } 29 37 … … 33 41 public function enqueue_appizy_scripts() { 34 42 wp_register_script( 'appizy-script', plugins_url( '/../js/embed.js', __FILE__ ), array( 'jquery' ), null, true ); 35 wp_register_script( 'appizy-admin-script', plugins_url( '/../js/admin-tools-screen.js', __FILE__ ), array( 'jquery' ), null, true );36 wp_register_style( 'appizy-styles', plugins_url( '/../css/appizy-styles.css', __FILE__ ) );37 43 38 44 wp_enqueue_script( 'appizy-script' ); 39 wp_enqueue_script( 'appizy-admin-script' );40 45 41 46 wp_localize_script( … … 51 56 */ 52 57 public function enqueue_appizy_styles() { 58 wp_register_style( 'appizy-styles', plugins_url( '/../css/appizy-styles.css', __FILE__ ) ); 59 53 60 wp_enqueue_style( 'appizy-styles' ); 54 61 } -
appizy-app-embed/trunk/css/appizy-styles.css
r1964229 r2461813 1 .appizy-app {2 3 }4 1 5 2 .appizy-app-iframe { … … 9 6 10 7 .appizy-app-toolbar { 11 border-bottom: 1px solid #eee;12 8 border-top: 1px solid #eee; 13 9 margin: 0.4em 0 1em 0; -
appizy-app-embed/trunk/includes/admin-tools-screen.php
r1964229 r2461813 59 59 </tr> 60 60 <tr> 61 <th><?php _e( 'Manual height' ); ?></th> 62 <td> 63 <input name="height" type="number" value="" placeholder="" size="4"> px 64 <p class="description"><?php _e( 'Leave empty for auto height.' ); ?></p> 65 </td> 66 </tr> 67 <tr> 61 68 <th><?php _e( 'Shortcode' ); ?></th> 62 69 <td> -
appizy-app-embed/trunk/includes/app-embed.php
r1964229 r2461813 17 17 $attributes = shortcode_atts( 18 18 [ 19 'id' => null, 20 'save' => 'disabled', 19 'id' => null, 20 'save' => 'disabled', 21 'height' => null 21 22 ], 22 23 $attributes, … … 27 28 28 29 $atts_id = $attributes['id']; 30 $height_attribute = $attributes['height'] ? 'height="' . $attributes['height'] . '" ' : ''; 29 31 30 $content = "<div class='appizy-app'><iframe class='appizy-app-iframe' " . 31 "data-app-id='$atts_id' frameborder='0' width='100%' src='$attachment_url'></iframe>";32 $content = "<div class='appizy-app'><iframe class='appizy-app-iframe' " . $height_attribute . 33 "data-app-id='$atts_id' frameborder='0' width='100%' src='$attachment_url'></iframe>"; 32 34 33 35 if ( is_user_logged_in() ) { … … 35 37 if ( 'enabled' === $attributes['save'] ) { 36 38 $content .= '<div class="appizy-app-toolbar">'; 37 $content .= '<button type="submit">Save</button>';39 $content .= '<button class="button" type="submit">Save</button>'; 38 40 $content .= '</div>'; 39 41 } -
appizy-app-embed/trunk/js/admin-tools-screen.js
r1964229 r2461813 13 13 var appIdSelector = appizyGeneratorForm.querySelector('select[name="app-id"]'); 14 14 var enableSaveDataCheckbox = appizyGeneratorForm.querySelector('input[name="enable-save"]'); 15 var appContainerHeight = appizyGeneratorForm.querySelector('input[name="height"]'); 15 16 16 17 appizyGeneratorForm.addEventListener('change', function () { 17 18 var appId = appIdSelector.value; 18 19 var enableSave = enableSaveDataCheckbox.checked; 20 var height = appContainerHeight.value; 19 21 20 shortCodeOutput.value = generateShortCode(appId, enableSave );22 shortCodeOutput.value = generateShortCode(appId, enableSave, height); 21 23 }); 22 24 } 23 25 24 26 /** 25 * @param {string} appId 26 * @param {boolean} enableSave 27 * @return {string} 28 */ 29 function generateShortCode(appId, enableSave) { 27 * @param {string} appId 28 * @param {boolean} enableSave 29 * @param {string} appContainerHeight 30 * @return {string} 31 */ 32 function generateShortCode(appId, enableSave, appContainerHeight) { 30 33 var shortCode = ''; 31 34 … … 36 39 shortCode += ' save="enabled"'; 37 40 } 41 42 if (appContainerHeight > 0) { 43 shortCode += ' height="' + appContainerHeight + '"'; 44 } 38 45 39 46 shortCode += ']'; -
appizy-app-embed/trunk/js/embed.js
r1964229 r2461813 2 2 3 3 (function ($) { 4 var default_margin = 16;5 4 var apps = document.getElementsByClassName('appizy-app'); 6 5 … … 12 11 var isSaveEnabled = !!saveButton; 13 12 14 frame.addEventListener('load', _resizeFrame); 13 if (!frame.height) { 14 frame.addEventListener('load', _resizeFrame); 15 } 15 16 16 17 if (isSaveEnabled) { … … 21 22 22 23 function _resizeFrame() { 23 this.style.height = this.contentWindow.document.body. offsetHeight + default_margin+ 'px';24 this.style.height = this.contentWindow.document.body.scrollHeight + 'px'; 24 25 } 25 26 -
appizy-app-embed/trunk/readme.txt
r2202901 r2461813 3 3 Tags: appizy, spreadsheet, embed, calculator, web-calculator 4 4 Requires at least: 4.9 5 Tested up to: 5. 35 Tested up to: 5.6 6 6 Requires PHP: 5.6 7 7 Stable tag:2.0.1 … … 85 85 == Changelog == 86 86 87 = 2.1.0 = 88 89 * Add new "height" option in shortcode configuration to skip auto-height calculation on load. 90 * Remove default margin in auto-height calculation. 91 87 92 = 2.0.1 = 88 93 * Fix the version number inside plugin files
Note: See TracChangeset
for help on using the changeset viewer.