Index: trunk/phase3/js2/mwEmbed/example_usage/Player_Themable.html |
— | — | @@ -22,12 +22,12 @@ |
23 | 23 | </div> |
24 | 24 | |
25 | 25 | <div style="width:450px;float:left"> |
26 | | -<video skin_name="kskin" src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg" |
| 26 | +<video class="kskin" src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg" |
27 | 27 | poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg" durationHint="15"></video> |
28 | | -<video skin_name="kskin" style="width:208px;height:160px;float:left;" src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg" |
| 28 | +<video class="kskin" style="width:208px;height:160px;float:left;" src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg" |
29 | 29 | poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg" durationHint="15"></video> |
30 | 30 | <b>(ksin) Source Code used:</b><br> |
31 | | -<textarea cols="50" rows="7"><video style="width:400px;height:288px" poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg" |
| 31 | +<textarea cols="50" rows="7"><video class="kskin" style="width:400px;height:288px" poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg" |
32 | 32 | src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"></video></textarea> |
33 | 33 | </div> |
34 | 34 | |
Index: trunk/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -222,6 +222,8 @@ |
223 | 223 | 'jui_skin' : 'redmond', |
224 | 224 | 'video_size' : '400x300' |
225 | 225 | } |
| 226 | + //list valid skins here: |
| 227 | + $.valid_skins = ['mvpcf', 'kskin']; |
226 | 228 | // the version of mwEmbed |
227 | 229 | $.version = '1.0r21'; |
228 | 230 | |
— | — | @@ -1142,9 +1144,13 @@ |
1143 | 1145 | for(var j in e){ |
1144 | 1146 | for(var k in e[j]){ |
1145 | 1147 | if(e[j][k] && typeof( e[j][k]) == 'object'){ |
1146 | | - var sn = e[j][k].getAttribute('skin_name') |
| 1148 | + var sn = e[j][k].getAttribute('class'); |
1147 | 1149 | if( sn && sn != ''){ |
1148 | | - $mw.skin_list.push( sn ); |
| 1150 | + for(var n=0;n< $mw.valid_skins.length;n++){ |
| 1151 | + if( sn.indexOf($mw.valid_skins[n]) !== -1){ |
| 1152 | + $mw.skin_list.push( $mw.valid_skins[n] ); |
| 1153 | + } |
| 1154 | + } |
1149 | 1155 | } |
1150 | 1156 | } |
1151 | 1157 | } |
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js |
— | — | @@ -98,8 +98,6 @@ |
99 | 99 | "embed_link":true, |
100 | 100 | "download_link":true, |
101 | 101 | "type":null, //the content type of the media |
102 | | - |
103 | | - "skin_name":null //if you want to select a custom skin per video tag. |
104 | 102 | }; |
105 | 103 | /* |
106 | 104 | * the base source attribute checks |
— | — | @@ -823,9 +821,18 @@ |
824 | 822 | } |
825 | 823 | } |
826 | 824 | |
827 | | - //set the skin name from the config (if not set locally) |
828 | | - if( !this.skin_name ) |
829 | | - this.skin_name = $mw.conf['skin_name']; |
| 825 | + //set the skin name from the class |
| 826 | + var sn = element.getAttribute('class'); |
| 827 | + if( sn && sn != ''){ |
| 828 | + for(var n=0;n< $mw.valid_skins.length;n++){ |
| 829 | + if( sn.indexOf($mw.valid_skins[n]) !== -1){ |
| 830 | + this.skin_name = $mw.valid_skins[n]; |
| 831 | + } |
| 832 | + } |
| 833 | + } |
| 834 | + //set the default if unset: |
| 835 | + if(!this.skin_name) |
| 836 | + this.skin_name = $mw.conf.skin_name; |
830 | 837 | |
831 | 838 | //make sure startOffset is cast as an int |
832 | 839 | if( this.startOffset && this.startOffset.split(':').length >= 2) |