Merge lp:~quam-plures-core/quam-plures/youtube-iframe into lp:quam-plures

Proposed by Yabs
Status: Merged
Merged at revision: 7601
Proposed branch: lp:~quam-plures-core/quam-plures/youtube-iframe
Merge into: lp:quam-plures
Diff against target: 33 lines (+7/-1)
1 file modified
qp_plugins/video_plugin/video_modules/_youtube.vp.php (+7/-1)
To merge this branch: bzr merge lp:~quam-plures-core/quam-plures/youtube-iframe
Reviewer Review Type Date Requested Status
EdB Approve
Review via email: mp+58897@code.launchpad.net

Description of the change

Users can now paste iframe embed code

¥

To post a comment you must log in.
Revision history for this message
Kimberly (kimberly-netweb360) wrote :

Tested and working; thanks.

Revision history for this message
EdB (edb) wrote :

downloading but probably won't be able to test for a while :(

Revision history for this message
Yabs (yabs) wrote :

No worries, I'm not exactly over endowed with coding time for QP myself ;)

¥

Revision history for this message
Yabs (yabs) wrote :

Ooops, sorry Kimberly I missed your comment :-S

Thanks for testing :D

¥

Revision history for this message
EdB (edb) wrote :

Sorry for the delay, but finally tested and approving and will merge into core tomorrow (just in case anyone else wants to wait till the last minute), but I did notice a funky thing that I'll bring up in the forums. If I can find the thread :(

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qp_plugins/video_plugin/video_modules/_youtube.vp.php'
--- qp_plugins/video_plugin/video_modules/_youtube.vp.php 2010-06-14 15:22:51 +0000
+++ qp_plugins/video_plugin/video_modules/_youtube.vp.php 2011-04-24 11:30:55 +0000
@@ -4,7 +4,7 @@
4 *4 *
5 * Quam Plures - {@link http://quamplures.net/}5 * Quam Plures - {@link http://quamplures.net/}
6 * Released under GNU GPL License - {@link http://quamplures.net/license.html}6 * Released under GNU GPL License - {@link http://quamplures.net/license.html}
7 * @copyright (c) 2010 by the Quam Plures developers - {@link http://quamplures.net/}7 * @copyright (c) 2010 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
8 *8 *
9 * @package plugins9 * @package plugins
10 * @subpackage video10 * @subpackage video
@@ -77,14 +77,20 @@
77 *77 *
78 * Sample url :78 * Sample url :
79 * http://www.youtube.com/watch?v=xGQJuALzNGo&feature=featured79 * http://www.youtube.com/watch?v=xGQJuALzNGo&feature=featured
80 *
81 * Sample iframe
82 * <iframe title="YouTube video player" width="640" height="390" src="http://www.youtube.com/embed/Hzgzim5m7oU" frameborder="0" allowfullscreen></iframe>
80 */83 */
81 $r = <<<JAVASCRIPT84 $r = <<<JAVASCRIPT
82var regex = new RegExp( '^.+?width="([0-9]+?)" height="([0-9]+?)".+?youtube\.com\/v\/(.+?)&.+?$', 'i' );85var regex = new RegExp( '^.+?width="([0-9]+?)" height="([0-9]+?)".+?youtube\.com\/v\/(.+?)&.+?$', 'i' );
83var regexUrl = new RegExp( '^.+?youtube.com\/.+?v=(.+?)(&.+?)?$' );86var regexUrl = new RegExp( '^.+?youtube.com\/.+?v=(.+?)(&.+?)?$' );
87var regexIframe = new RegExp( '^.+?width="([0-9]+?)" height="([0-9]+?)".+?youtube\.com\/embed\/(.+?)".+?$', 'i' );
84if( vid_code.match( regex ) ) {88if( vid_code.match( regex ) ) {
85 return '[video:youtube:'+vid_code.replace( regex, '$3 w:$1 h:$2' )+']';89 return '[video:youtube:'+vid_code.replace( regex, '$3 w:$1 h:$2' )+']';
86} else if( vid_code.match( regexUrl ) ) {90} else if( vid_code.match( regexUrl ) ) {
87 return '[video:youtube:'+vid_code.replace( regexUrl, '$1' )+']';91 return '[video:youtube:'+vid_code.replace( regexUrl, '$1' )+']';
92} else if( vid_code.match( regexIframe ) ) {
93 return '[video:youtube:'+vid_code.replace( regexIframe, '$3 w:$1 h:$2' )+']';
88} else {94} else {
89 return false;95 return false;
90}96}

Subscribers

People subscribed via source and target branches