Changeset 1737861
- Timestamp:
- 09/28/2017 04:27:49 PM (9 years ago)
- Location:
- synq-video
- Files:
-
- 1 added
- 5 edited
-
tags/2.1.0 (added)
-
trunk/README.md (modified) (1 diff)
-
trunk/assets/js/synq-video.js (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/synq-video-front.js (modified) (1 diff)
-
trunk/synq-video.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
synq-video/trunk/README.md
r1733612 r1737861 67 67 Tested up to: 4.8.1 68 68 Requires PHP: 5.4 69 Stable tag: 2. 0.169 Stable tag: 2.1.0 70 70 License: MIT 71 71 License URI: https://opensource.org/licenses/MIT 72 72 73 73 ## Changelog 74 75 ### 2.1.0 76 * My Uploads page and posts video selection/uploading have been made more responsive. 77 74 78 ### 2.0.1 75 79 * Bugfix regarding the plugin's behaviour on the post editor page. -
synq-video/trunk/assets/js/synq-video.js
r1733269 r1737861 25 25 } 26 26 }, false); 27 afterUploadsLoaded = function(){ 28 $(".search-result-img-holder").each(function(i,e){ 29 var videoId = this.dataset.videoId; 30 var link = "https://player.synq.fm/embed/" + videoId; 31 this.onclick = function(){ 32 window.open(link); 33 } 34 }); 27 35 28 $(".search-result-img-holder").each(function(i,e){ 29 var videoId = this.dataset.videoId; 30 var link = "https://player.synq.fm/embed/" + videoId; 31 this.onclick = function(){ 32 window.open(link); 33 } 34 }); 36 $('.clip-btn').click(function(e) { 37 $(this).addClass("tooltipped"); 38 $(this).addClass("tooltipped-n"); 39 $(this).addClass("tooltipped-no-delay"); 40 }); 35 41 36 $('.clip-btn').click(function(e) {37 $(this).addClass("tooltipped");38 $(this).addClass("tooltipped-n");39 $(this).addClass("tooltipped-no-delay");40 });42 $('.clip-btn').mouseleave(function(e) { 43 $(this).removeClass("tooltipped"); 44 $(this).removeClass("tooltipped-n"); 45 $(this).removeClass("tooltipped-no-delay"); 46 }); 41 47 42 $('.clip-btn').mouseleave(function(e) { 43 $(this).removeClass("tooltipped"); 44 $(this).removeClass("tooltipped-n"); 45 $(this).removeClass("tooltipped-no-delay"); 46 }); 47 48 new Clipboard('.clip-btn'); 48 new Clipboard('.clip-btn'); 49 } 49 50 50 51 $('.synq-content-block a[data-toggle="tab"]').on('shown.bs.tab', function(){ -
synq-video/trunk/readme.txt
r1733612 r1737861 6 6 Tested up to: 4.8.1 7 7 Requires PHP: 5.4 8 Stable tag: 2. 0.18 Stable tag: 2.1.0 9 9 License: MIT 10 10 License URI: https://opensource.org/licenses/MIT … … 82 82 83 83 == Changelog == 84 = 2.1.0 = 85 * My Uploads page and posts video selection/uploading have been made more responsive. 84 86 = 2.0.1 = 85 87 * Bugfix regarding the plugin's behaviour on the post editor page. -
synq-video/trunk/synq-video-front.js
r1733269 r1737861 6 6 // Get all the divs that are generated by the shortcode 7 7 // Insert responsive iframes for each of them 8 console.log('whaddup');9 8 $('.synq-video-wrapper').each((index, ele) => { 10 console.log('whaddup, inni');11 9 var id = ele.getAttribute('id'); 12 10 var url = 'https://player.synq.fm/embed/' + ele.dataset.videoId; -
synq-video/trunk/synq-video.php
r1733612 r1737861 7 7 * Plugin Name: SYNQ Video 8 8 * Description: SYNQ Video, the best way to add video uploading and embedding to your WordPress site! 9 * Version: 2. 0.19 * Version: 2.1.0 10 10 * Author: SYNQ 11 11 * Contributors: synqfm … … 95 95 96 96 97 /* Function that gets and prints all uploaded videos */ 98 function print_my_uploads() { 97 /* AJAX page that gets and prints all uploaded videos */ 98 add_action("wp_ajax_uploadspage", "uploadspage"); 99 function uploadspage(){ 100 101 /* Page that gets and prints all uploaded videos */ 99 102 if (get_option('synq_api_key')) 100 103 { … … 112 115 { 113 116 ?> 114 <div class="uploaded-content" style="display: flex; flex-direction: row;117 <div id="uploaded-content" class="uploaded-content" style="display: flex; flex-direction: row; 115 118 flex-wrap: wrap; width: 100%; height: 100%; box-sizing: border-box; align-items: center; justify-content: center;"> 116 119 <?php … … 151 154 echo '<div class="synq-no-uploads">'.__('No uploaded videos found','synq-video').'</div>'; 152 155 } 156 wp_die(); 157 } 158 159 /* function that can be added to any page to call the above ajax page */ 160 function print_my_uploads() { 161 ?> 162 <div id="content"></div> 163 <script type="text/javascript" > 164 jQuery(document).ready(function($) { 165 166 var data = { 167 'action': 'uploadspage', 168 }; 169 170 // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php 171 jQuery.post(ajaxurl, data, function(response) { 172 jQuery("#content").html(response); 173 if(afterUploadsLoaded) afterUploadsLoaded(); 174 }); 175 }); 176 </script> <?php 153 177 } 154 178 … … 247 271 ?> 248 272 <script> 249 function sendPostmessage(videoId){ 250 window.parent.postMessage(JSON.stringify({event: "synqShortcodeEvent", videoId: videoId}),"*"); 251 console.log("also test") 252 } 253 window.addEventListener('message', function (event) { 254 // Make sure the event is from the synq uploader iframe. 255 if(event.origin == "https://uploader.synq.fm"){ 256 eventObj = JSON.parse(event.data); 257 // Check if it's an upload complete event. 258 if(eventObj.event == "synqUploaderStatusChange" && eventObj.newStatus == "upload successful"){ 259 sendPostmessage(eventObj.videoId); 260 // Upload completed successfully. Close media tab and insert shortcode. 261 } 262 } 263 }, false); 264 265 document.onreadystatechange = function() { 266 if (document.readyState === 'complete') { 267 elements = document.getElementsByClassName("search-result-img-holder"); 268 for(i = 0; i < elements.length; i++){ 269 e = elements[i]; 270 e.onclick = function(){ 271 sendPostmessage(this.dataset.videoId); 272 } 273 function sendPostmessage(videoId){ 274 window.parent.postMessage(JSON.stringify({event: "synqShortcodeEvent", videoId: videoId}),"*"); 275 } 276 window.addEventListener('message', function (event) { 277 // Make sure the event is from the synq uploader iframe. 278 if(event.origin == "https://uploader.synq.fm"){ 279 eventObj = JSON.parse(event.data); 280 // Check if it's an upload complete event. 281 if(eventObj.event == "synqUploaderStatusChange" && eventObj.newStatus == "upload successful"){ 282 sendPostmessage(eventObj.videoId); 283 // Upload completed successfully. Close media tab and insert shortcode. 273 284 } 274 285 } 275 }; 286 }, false); 287 288 afterUploadsLoaded = function(){ 289 elements = document.getElementsByClassName("search-result-img-holder"); 290 for(i = 0; i < elements.length; i++){ 291 e = elements[i]; 292 e.onclick = function(){ 293 sendPostmessage(this.dataset.videoId); 294 } 295 } 296 } 276 297 </script> 277 298 <style type="text/css"> … … 313 334 */ 314 335 315 /* create short code for video player */336 /* create shortcode for video player */ 316 337 /* "synq-video-player" should be used at all times. */ 317 338 add_shortcode('synq-video-player', 'synq_video_player');
Note: See TracChangeset
for help on using the changeset viewer.