Changeset 2604494
- Timestamp:
- 09/24/2021 03:46:31 PM (4 years ago)
- Location:
- aspiesoft-auto-embed/trunk
- Files:
-
- 6 edited
-
aspiesoft-auto-embed.php (modified) (1 diff)
-
assets/settings.js (modified) (6 diffs)
-
readme.txt (modified) (1 diff)
-
src/assets/0settings.php (modified) (2 diffs)
-
src/main.php (modified) (1 diff)
-
src/settings.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
aspiesoft-auto-embed/trunk/aspiesoft-auto-embed.php
r2598834 r2604494 4 4 */ 5 5 /* 6 Plugin Name: Auto Embed (YouTube, Facebook, PDF, Image )6 Plugin Name: Auto Embed (YouTube, Facebook, PDF, Image, And More) 7 7 Plugin URI: https://github.com/AspieSoft/aspiesoft-auto-embed 8 8 Description: Easily Embed Dynamic Lazy Loading Youtube Videos Simply By Pasting The Url. 9 Version: 1.4. 59 Version: 1.4.6 10 10 Author: AspieSoft 11 11 Author URI: https://www.aspiesoft.com -
aspiesoft-auto-embed/trunk/assets/settings.js
r2582309 r2604494 59 59 } 60 60 61 61 62 let valueAttr = ''; 62 63 if(value && type !== 'bool'){ 64 if(value.startsWith('[') && value.endsWith(']')){ 65 try{ 66 value = JSON.parse(value.replace(/\\([\\"])/g, '$1')).join('\n').trim(); 67 }catch(e){} 68 } 69 63 70 value = value.replace(/\\?"/g, '\\"'); 64 71 valueAttr = ' value="'+value+'"'; … … 67 74 let defValueAttr = ''; 68 75 if(defaultValue && type !== 'bool'){ 76 if(defaultValue.startsWith('[') && defaultValue.endsWith(']')) { 77 try { 78 defaultValue = JSON.parse(defaultValue.replace(/\\([\\"])/g, '$1')).join('\n').trim(); 79 } catch(e) {} 80 } 81 69 82 defaultValue = defaultValue.replace(/\\?"/g, '\\"'); 70 83 defValueAttr = ' placeholder="'+defaultValue+'"'; … … 92 105 93 106 let origValue = ''; 94 if(value !== ''){origValue = ' origValue="'+value+'"';} 95 return '<textarea name="'+name+'"'+valueAttr+defValueAttr+origValue+style+'></textarea>'; 107 if(value !== '') {origValue = ' origValue="' + value + '"';} 108 109 if(value === defaultValue){value = '';} 110 111 return '<textarea type="' + inputType + '" name="' + name + '"' + defValueAttr + origValue + style + '>' + value.replace(/<\/textarea>/g, '')+'\n' +'</textarea>'; 96 112 97 113 }else if(inputType === 'select' && optionsList){ … … 267 283 //let origValue = $(this).attr('origValue'); 268 284 let defaultValue = optionsList[name]['default']; 285 286 if(elmTag === 'textarea') { 287 defaultValue = defaultValue.split(/\r?\n/).filter(val => val.trim() !== ''); 288 if(!defaultValue.length) { 289 defaultValue = ''; 290 } else { 291 defaultValue = JSON.stringify(defaultValue); 292 } 293 } 269 294 270 295 if(elmType === 'checkbox'){ … … 400 425 elmTag = elmTag.toLowerCase(); 401 426 if(elmType){elmType = elmType.toLowerCase();}else{elmType = '';} 402 427 403 428 // don't run for hidden, button, and submit input types 404 429 if(elmTag === 'input' && (elmType === 'hidden' || elmType === 'button' || elmType === 'submit')){ … … 463 488 let value = $(this).val(); 464 489 let origValue = $(this).attr('origValue'); 490 491 if(elmTag === 'textarea'){ 492 value = value.split(/\r?\n/).filter(val => val.trim() !== ''); 493 if(!value.length){ 494 value = ''; 495 }else{ 496 value = JSON.stringify(value); 497 } 498 499 origValue = origValue.split(/\r?\n/).filter(val => val.trim() !== ''); 500 if(!origValue.length) { 501 origValue = ''; 502 } else { 503 origValue = JSON.stringify(origValue); 504 } 505 506 if($(this).attr('placeholder') === value){ 507 value = ''; 508 } 509 510 if($(this).attr('placeholder') !== origValue) { 511 origValue = 'null'; 512 } 513 } 465 514 466 515 // add value to builder -
aspiesoft-auto-embed/trunk/readme.txt
r2598834 r2604494 1 === Auto YouTube Embed===1 === Auto Embed (YouTube, Facebook, PDF, Image, And More) === 2 2 Contributors: AspieSoft 3 Tags: youtube, embed, auto, pdf, image, img, webP, dynamic, simple, lazy-load, css 3 Tags: youtube, embed, auto, pdf, image, img, webP, dynamic, simple, lazy-load, css, facebook 4 4 Requires at least: 3.0.1 5 5 Tested up to: 5.8 6 Stable tag: 1.4. 56 Stable tag: 1.4.6 7 7 Requires PHP: 5.2.4 8 8 License: GPLv2 or later -
aspiesoft-auto-embed/trunk/src/assets/0settings.php
r2596457 r2604494 71 71 // only embed shortcode 72 72 if ($options['get']('ytOnlyEmbedShortcode', false, true)) { 73 $this->opts['requireAttrs'] = array(' yt-auto-embed');73 $this->opts['requireAttrs'] = array('aspiesoft-auto-embed'); 74 74 } 75 75 … … 81 81 82 82 $includeDomains = $options['get']('includeDomains'); 83 if ($includeDomains !== 'example.com') { 84 $this->opts['includeDomains'] = explode('\n', $includeDomains); 83 if ($includeDomains && $includeDomains !== 'example.com') { 84 if(str_starts_with($includeDomains, '[') && str_ends_with($includeDomains, ']')){ 85 try{ 86 $this->opts['includeDomains'] = json_decode(preg_replace('/\\([\\"])/', '$1', $includeDomains)); 87 }catch(Exception $e){} 88 }else{ 89 $this->opts['includeDomains'] = explode('\n', $includeDomains); 90 } 85 91 } 86 92 -
aspiesoft-auto-embed/trunk/src/main.php
r2590553 r2604494 144 144 145 145 if(self::$options['get']('ytOnlyEmbedShortcode', false, true)){ 146 $result .= ' yt-auto-embed';146 $result .= ' aspiesoft-auto-embed'; 147 147 } 148 148 -
aspiesoft-auto-embed/trunk/src/settings.php
r2596457 r2604494 56 56 'disableWpEmbed' => array('label' => 'Disable Wp-Embed', 'default' => 'false', 'form' => '[check][label][br]', 'type' => 'bool'), 57 57 'enableEditorAutoUrl' => array('label' => 'Automatically Make URLs Clickable In Page Editor', 'default' => 'false', 'form' => '[check][label][br][br]', 'type' => 'bool'), 58 58 59 'overrideIframes' => array('label' => 'Override Compatable Iframes Including WP-Embed Iframes', 'default' => 'false', 'form' => '[check][label][br][br]', 'type' => 'bool'), 60 'ytOnlyEmbedShortcode' => array('label' => 'Only Embed Shortcodes', 'default' => 'false', 'form' => '[check][label][br][br]', 'type' => 'bool'), 59 61 60 62 'altShortcode_default' => array('label' => 'Alternate Shortcode Name', 'default' => '', 'form' => '[label][text][br]'), … … 82 84 'embedAuto' => array('label' => 'Auto Play', 'default' => 'false', 'form' => '[check][label]', 'type' => 'bool'), 83 85 'embedMute' => array('label' => 'Mute', 'default' => 'false', 'form' => '[check][label][br]', 'type' => 'bool'), 84 85 'ytOnlyEmbedShortcode' => array('label' => 'Only Embed Shortcodes', 'default' => 'false', 'form' => '[check][label][br]', 'type' => 'bool'),86 86 87 87 );
Note: See TracChangeset
for help on using the changeset viewer.