Changeset 2582309
- Timestamp:
- 08/12/2021 09:42:54 PM (5 years ago)
- Location:
- aspiesoft-auto-embed/trunk
- Files:
-
- 8 edited
-
aspiesoft-auto-embed.php (modified) (2 diffs)
-
assets/settings.css (modified) (1 diff)
-
assets/settings.js (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
src/assets/0settings.php (modified) (1 diff)
-
src/assets/embed.js (modified) (5 diffs)
-
src/settings.php (modified) (1 diff)
-
templates/admin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
aspiesoft-auto-embed/trunk/aspiesoft-auto-embed.php
r2582254 r2582309 4 4 */ 5 5 /* 6 Plugin Name: Auto Embed (YouTube, PDF, Image)6 Plugin Name: Auto Embed (YouTube, Facebook, PDF, Image) 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. 2.29 Version: 1.3 10 10 Author: AspieSoft 11 11 Author URI: https://www.aspiesoft.com … … 106 106 $pluginData = get_plugin_data(__FILE__); 107 107 $this->plugin = array( 108 'name' => sanitize_text_field($pluginData['Name']),108 'name' => preg_replace('/\s*\(.*?\)/', '', sanitize_text_field($pluginData['Name'])), 109 109 'setting' => str_replace('-', '', ucwords(sanitize_text_field($pluginData['TextDomain']), '-')), 110 110 'slug' => sanitize_text_field($pluginData['TextDomain']), -
aspiesoft-auto-embed/trunk/assets/settings.css
r2582254 r2582309 16 16 width: 100%; 17 17 box-shadow: 0 0 2px #121212; 18 z-index: 10000; 18 19 } 19 20 -
aspiesoft-auto-embed/trunk/assets/settings.js
r2582254 r2582309 171 171 172 172 let valueIndex = 0; 173 let html = option['form'].replace(/\[(\w+)(?:\{([\w\-:;]+)\}|)\]/g, function(_, inputType, inputStyle){ 173 let html = option['form'].replace(/(!|)\[(.*?)\]\((.*?)\)/g, function(_, emb, name, url){ 174 if(emb !== ''){ 175 return `<img src="${url}" alt="${name}">`; 176 } 177 return `<a href="${url}">${name}</a>`; 178 }).replace(/\[(\/?\w+)(?:\{([\w\-:;]+)\}|)\]/g, function(_, inputType, inputStyle){ 174 179 let style = ''; 175 180 if(inputStyle){ … … 179 184 inputType = 'text'; 180 185 } 186 181 187 if(inputType === 'br'){ 182 188 return '<br'+style+'>'; 183 } 184 if(inputType === 'hr'){ 189 }else if(inputType === 'hr'){ 185 190 return '<hr'+style+'>'; 186 191 } 192 193 if(inputType.match(/^h[1-6]$/)){ 194 return inputType.replace(/^h([1-6])$/, '<h$1'+style+'>'); 195 }else if(inputType.match(/^\/h[1-6]$/)){ 196 return inputType.replace(/^\/h([1-6])$/, '</h$1>'); 197 } 198 187 199 if(inputType === 'label'){ 188 200 return '<label for="'+name+'"'+style+'>'+label+'</label>'; -
aspiesoft-auto-embed/trunk/readme.txt
r2582254 r2582309 4 4 Requires at least: 3.0.1 5 5 Tested up to: 5.8 6 Stable tag: 1. 2.26 Stable tag: 1.3 7 7 Requires PHP: 5.2.4 8 8 License: GPLv2 or later -
aspiesoft-auto-embed/trunk/src/assets/0settings.php
r2582254 r2582309 53 53 ), 54 54 55 'fb' => array( 56 'width' => $options['get']('fbWidth'), 57 'min-width' => $options['get']('fbWidthMin'), 58 'max-width' => $options['get']('fbWidthMax'), 59 'ratio' => $options['get']('fbRatio'), 60 ), 61 55 62 ); 56 63 -
aspiesoft-auto-embed/trunk/src/assets/embed.js
r2582254 r2582309 42 42 pdf: null, // {width, min-width, max-width, ratio} 43 43 img: null, // {width, min-width, max-width, ratio} 44 fb: null, // {width, min-width, max-width, ratio} 44 45 }; 45 46 … … 243 244 iframe = $('<div class="aspiesoft-embed" doing-init-animation'+attrs+styles+'><iframe class="aspiesoft-embed-content" style="opacity: 0;" src="'+data.url+'" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>').insertAfter(elm); 244 245 }else if(data.embedType === 'embed'){ 245 iframe = $('<div class="aspiesoft-embed" doing-init-animation'+attrs+styles+'><iframe class="aspiesoft-embed-content" style="opacity: 0;" src="'+data.url+'" frameborder="0" allowfullscreen ></iframe></div>').insertAfter(elm);246 iframe = $('<div class="aspiesoft-embed" doing-init-animation'+attrs+styles+'><iframe class="aspiesoft-embed-content" style="opacity: 0;" src="'+data.url+'" frameborder="0" allowfullscreen allow="encrypted-media" allowtransparency="true"></iframe></div>').insertAfter(elm); 246 247 iframe.css('border-radius', '5px'); 247 248 }else if(data.embedType === 'image'){ … … 321 322 query = queryObj(query); 322 323 queryObject = query; 324 if(page){ 325 page = page.replace(/\\/g, '/').replace(/\/$/, ''); 326 }else{ 327 page = ''; 328 } 323 329 if(domain === 'youtu.be'){ 324 330 embedType = 'video'; … … 385 391 return; 386 392 } 393 }else if(domain === 'facebook.com'){ 394 if(page.includes('video')){ 395 //todo: embed facebook video 396 url = false; 397 return; 398 } 399 400 let href; 401 if(page === 'plugins/page' || page === 'plugins/page.php'){ 402 href = query.href; 403 }else{ 404 page = page.split('/'); 405 if(page[0] === 'page'){ 406 href = `https%3A%2F%2Fwww.facebook.com%2F${page[1].toString().replace(/[^\w_\-$\.]/g, '')}%2F`; 407 }else{ 408 href = `https%3A%2F%2Fwww.facebook.com%2F${page[0].replace(/[^\w_\-$\.]/g, '')}%2F`; 409 } 410 } 411 412 url = `https://www.facebook.com/plugins/page.php?href=${href}&tabs=timeline&width=500&height=800&small_header=true&adapt_container_width=true&hide_cover=false&show_facepile=false&appId`; 413 embedType = 'embed'; 414 exactType = 'fb'; 415 return; 387 416 }else if(!domain || domain.trim() === '' || domain === window.location.hostname || window.location.hostname.endsWith(domain)){ 388 417 // if local … … 422 451 } 423 452 } 424 } 425 return query; 453 return query; 454 } 455 return {}; 426 456 } 427 457 -
aspiesoft-auto-embed/trunk/src/settings.php
r2582254 r2582309 42 42 43 43 44 'pdfWidth' => array('label' => 'Width', 'default' => '100', 'form' => '[br][hr][br]PDF[br][label][number{width:80px;}]%[br]', 'format' => '%s%'), 44 'fbWidth' => array('label' => 'Width', 'default' => '100', 'form' => '[br][hr][h2]Facebook[/h2][br][label][number{width:80px;}]%[br]', 'format' => '%s%'), 45 'fbWidthMin' => array('label' => 'Min Width', 'default' => '300', 'form' => '[label][number{width:80px;}]px[br]', 'format' => '%spx'), 46 'fbWidthMax' => array('label' => 'Max Width', 'default' => '500', 'form' => '[label][number{width:80px;}]px[br]', 'format' => '%spx'), 47 'fbRatio' => array('label' => 'Ratio', 'default' => array(5, 8), 'form' => '[label][number{width:60px;}]:[number{width:60px;}][br][br]', 'format' => '%s:%s'), 48 49 'pdfWidth' => array('label' => 'Width', 'default' => '100', 'form' => '[br][hr][h2]PDF[/h2][br][label][number{width:80px;}]%[br]', 'format' => '%s%'), 45 50 'pdfWidthMin' => array('label' => 'Min Width', 'default' => '300', 'form' => '[label][number{width:80px;}]px[br]', 'format' => '%spx'), 46 51 'pdfWidthMax' => array('label' => 'Max Width', 'default' => '2500', 'form' => '[label][number{width:80px;}]px[br]', 'format' => '%spx'), 47 52 'pdfRatio' => array('label' => 'Ratio', 'default' => array(9, 12), 'form' => '[label][number{width:60px;}]:[number{width:60px;}][br][br]', 'format' => '%s:%s'), 48 53 49 'imgWidth' => array('label' => 'Width', 'default' => '100', 'form' => '[br][hr][ br]Image[br][label][number{width:80px;}]%[br]', 'format' => '%s%'),54 'imgWidth' => array('label' => 'Width', 'default' => '100', 'form' => '[br][hr][h2]Image[/h2][br][label][number{width:80px;}]%[br]', 'format' => '%s%'), 50 55 'imgWidthMin' => array('label' => 'Min Width', 'default' => '300', 'form' => '[label][number{width:80px;}]px[br]', 'format' => '%spx'), 51 56 'imgWidthMax' => array('label' => 'Max Width', 'default' => '2500', 'form' => '[label][number{width:80px;}]px[br]', 'format' => '%spx'), -
aspiesoft-auto-embed/trunk/templates/admin.php
r2582254 r2582309 165 165 $pluginData = get_plugin_data(WP_PLUGIN_DIR.'/'.sanitize_text_field(constant('PLUGIN_BASENAME_'.basename(plugin_dir_path(dirname(__FILE__, 1)))))); 166 166 $this->plugin = array( 167 'name' => sanitize_text_field($pluginData['Name']),167 'name' => preg_replace('/\s*\(.*?\)/', '', sanitize_text_field($pluginData['Name'])), 168 168 'setting' => str_replace('-', '', ucwords(sanitize_text_field($pluginData['TextDomain']), '-')), 169 169 'slug' => sanitize_text_field($pluginData['TextDomain']),
Note: See TracChangeset
for help on using the changeset viewer.