Index: branches/MwEmbedStandAlone/loader.js |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | 'ClipEdit', |
52 | 52 | 'EmbedPlayer', |
53 | 53 | 'ApiProxy', |
54 | | - 'SequenceEdit', |
| 54 | + 'Sequencer', |
55 | 55 | 'TimedText', |
56 | 56 | 'SmilPlayer', |
57 | 57 | 'Playlist', |
Index: branches/MwEmbedStandAlone/components/mw.Language.js |
— | — | @@ -277,6 +277,16 @@ |
278 | 278 | // Missing key placeholder |
279 | 279 | return '<' + key + '>'; |
280 | 280 | } |
| 281 | + /** |
| 282 | + * Check if a message key is defined |
| 283 | + * @return {Boolean} true if msg is defined, false if msg is not set |
| 284 | + */ |
| 285 | + mw.Language.isMsgKeyDefined = function( msgKey ){ |
| 286 | + if( messageCache[ msgKey ] ){ |
| 287 | + return true |
| 288 | + } |
| 289 | + return false; |
| 290 | + } |
281 | 291 | |
282 | 292 | /** |
283 | 293 | * Add Supported Magic Words to parser |
— | — | @@ -425,7 +435,7 @@ |
426 | 436 | } |
427 | 437 | return ( typeInt )? parseInt( convertedNumber) : convertedNumber; |
428 | 438 | } |
429 | | - |
| 439 | + |
430 | 440 | /** |
431 | 441 | * Checks if a language key is valid ( is part of languageCodeList ) |
432 | 442 | * @param {String} langKey Language key to be checked |
Index: branches/MwEmbedStandAlone/mwEmbed.js |
— | — | @@ -1002,11 +1002,13 @@ |
1003 | 1003 | * dialogHtml text Html of the loader msg |
1004 | 1004 | */ |
1005 | 1005 | mw.addLoaderDialog = function( dialogHtml ) { |
1006 | | - $dialog = mw.addDialog( dialogHtml, dialogHtml + '<br>' + |
| 1006 | + $dialog = mw.addDialog( { |
| 1007 | + 'title' : dialogHtml, |
| 1008 | + 'content' : dialogHtml + '<br>' + |
1007 | 1009 | $j('<div />') |
1008 | 1010 | .loadingSpinner() |
1009 | 1011 | .html() |
1010 | | - ); |
| 1012 | + }); |
1011 | 1013 | return $dialog; |
1012 | 1014 | } |
1013 | 1015 | |
— | — | @@ -1031,62 +1033,73 @@ |
1032 | 1034 | /** |
1033 | 1035 | * Add a (temporary) dialog window: |
1034 | 1036 | * |
1035 | | - * @param {String} |
1036 | | - * title Title string for the dialog |
1037 | | - * @param {String} |
1038 | | - * dialogHtml String to be inserted in msg box |
1039 | | - * @param {Mixed} |
1040 | | - * buttonOption A button object for the dialog Can be a string |
1041 | | - * for the close button |
| 1037 | + * @param {Object} with following keys: |
| 1038 | + * title: {String} Title string for the dialog |
| 1039 | + * content: {String} to be inserted in msg box |
| 1040 | + * buttons: {Object} A button object for the dialog Can be a string |
| 1041 | + * for the close button |
| 1042 | + * any jquery.ui.dialog option |
1042 | 1043 | */ |
1043 | | - mw.addDialog = function ( title, dialogHtml, buttons ) { |
1044 | | - $j( '#mwTempLoaderDialog' ).remove(); |
| 1044 | + mw.addDialog = function ( options ) { |
| 1045 | + // Remove any other dialog |
| 1046 | + $j( '#mwTempLoaderDialog' ).remove(); |
1045 | 1047 | |
1046 | | - // Append the style free loader ontop: |
| 1048 | + if( !options){ |
| 1049 | + options = {}; |
| 1050 | + } |
| 1051 | + |
| 1052 | + // Extend the default options with provided options |
| 1053 | + var options = $j.extend({ |
| 1054 | + 'bgiframe': true, |
| 1055 | + 'draggable': true, |
| 1056 | + 'resizable': false, |
| 1057 | + 'modal': true |
| 1058 | + }, options ); |
| 1059 | + |
| 1060 | + if( ! options.title || ! options.content ){ |
| 1061 | + mw.log("Error: mwEmbed addDialog missing required options ( title, content ) ") |
| 1062 | + return ; |
| 1063 | + } |
| 1064 | + |
| 1065 | + // Append the dialog div on top: |
1047 | 1066 | $j( 'body' ).append( |
1048 | 1067 | $j('<div />') |
1049 | 1068 | .attr( { |
1050 | 1069 | 'id' : "mwTempLoaderDialog", |
1051 | | - 'title' : title |
| 1070 | + 'title' : options.title |
1052 | 1071 | }) |
1053 | 1072 | .css({ |
1054 | 1073 | 'display': 'none' |
1055 | 1074 | }) |
1056 | | - .html( dialogHtml ) |
| 1075 | + .append( options.content ) |
1057 | 1076 | ); |
| 1077 | + |
| 1078 | + // Build the uiRequest |
| 1079 | + var uiRequest = [ '$j.ui.dialog' ]; |
| 1080 | + if( options.draggable ){ |
| 1081 | + uiRequest.push( '$j.ui.draggable' ) |
| 1082 | + } |
| 1083 | + if( options.resizable ){ |
| 1084 | + uiRequest.push( '$j.ui.resizable' ); |
| 1085 | + } |
1058 | 1086 | |
1059 | 1087 | // Special button string |
1060 | | - if ( typeof buttons == 'string' ) { |
1061 | | - var buttonMsg = buttons; |
| 1088 | + if ( typeof options.buttons == 'string' ) { |
| 1089 | + var buttonMsg = options.buttons; |
1062 | 1090 | buttons = { }; |
1063 | | - buttons[ buttonMsg ] = function() { |
| 1091 | + options.buttons[ buttonMsg ] = function() { |
1064 | 1092 | $j( '#mwTempLoaderDialog' ).dialog( 'close' ); |
1065 | 1093 | } |
1066 | | - } |
| 1094 | + } |
1067 | 1095 | |
1068 | 1096 | // Load the dialog resources |
1069 | 1097 | mw.load([ |
1070 | 1098 | [ |
1071 | 1099 | '$j.ui' |
1072 | 1100 | ], |
1073 | | - [ |
1074 | | - '$j.ui.dialog', |
1075 | | - '$j.ui.draggable' |
1076 | | - ] |
| 1101 | + uiRequest |
1077 | 1102 | ], function() { |
1078 | | - // Set width to default 400 if mwTempLoaderDialog does not have an |
1079 | | - // inherit width |
1080 | | - var width = ( $j( '#mwTempLoaderDialog' ).width() ) ? |
1081 | | - $j( '#mwTempLoaderDialog' ).width() + 12 : |
1082 | | - 400; |
1083 | | - $j( '#mwTempLoaderDialog' ).dialog( { |
1084 | | - 'bgiframe': true, |
1085 | | - 'draggable': true, |
1086 | | - 'resizable': false, |
1087 | | - 'modal': true, |
1088 | | - 'width': width, |
1089 | | - 'buttons': buttons |
1090 | | - } ); |
| 1103 | + $j( '#mwTempLoaderDialog' ).dialog( options ); |
1091 | 1104 | } ); |
1092 | 1105 | return $j( '#mwTempLoaderDialog' ); |
1093 | 1106 | } |
Index: branches/MwEmbedStandAlone/modules/TimedText/mw.TimedTextEdit.js |
— | — | @@ -346,17 +346,17 @@ |
347 | 347 | window.location.reload(); |
348 | 348 | } |
349 | 349 | //Edit success |
350 | | - mw.addDialog( |
351 | | - gM( "mwe-timedtext-upload-text-done"), |
352 | | - gM("mwe-timedtext-upload-text-success"), |
353 | | - buttons |
354 | | - ) |
| 350 | + mw.addDialog( { |
| 351 | + 'title' : gM( "mwe-timedtext-upload-text-done"), |
| 352 | + 'content' : gM("mwe-timedtext-upload-text-success"), |
| 353 | + 'buttons' : buttons |
| 354 | + }) |
355 | 355 | }else{ |
356 | | - mw.addDialog( |
357 | | - gM( "mwe-timedtext-upload-text-fail-title"), |
358 | | - gM( "mwe-timedtext-upload-text-fail-desc"), |
359 | | - 'ok' |
360 | | - ) |
| 356 | + mw.addDialog({ |
| 357 | + 'title' : gM( "mwe-timedtext-upload-text-fail-title"), |
| 358 | + 'content' :gM( "mwe-timedtext-upload-text-fail-desc"), |
| 359 | + 'buttons' : gM( 'mwe-ok' ) |
| 360 | + }) |
361 | 361 | } |
362 | 362 | }); |
363 | 363 | }) |
Index: branches/MwEmbedStandAlone/modules/AddMedia/jquery.dragDropFile.js |
— | — | @@ -117,11 +117,6 @@ |
118 | 118 | ) |
119 | 119 | ) |
120 | 120 | ) |
121 | | - /*mw.addDialog( "upload this image", '<img width="300" src="' + files[i].getAsDataURL() + '">' + |
122 | | - '<br>name: ' + files[i].name + '</br>' + |
123 | | - '<br>size: ' + files[i].fileSize + '</br>' + |
124 | | - '<br>mime: ' + files[i].mediaType + '</br>'); |
125 | | - */ |
126 | 121 | // do the add-media-wizard with the upload tab |
127 | 122 | } else { |
128 | 123 | alert( "file is too big, needs to be below 64mb" ); |
Index: branches/MwEmbedStandAlone/modules/ApiProxy/mw.ApiProxy.js |
— | — | @@ -582,11 +582,11 @@ |
583 | 583 | gM( 'mwe-remember-loging' ) |
584 | 584 | ) |
585 | 585 | |
586 | | - mw.addDialog( |
587 | | - gM( 'mwe-proxy-not-ready' ), |
588 | | - $dialogMsg, |
589 | | - buttons |
590 | | - ) |
| 586 | + mw.addDialog( { |
| 587 | + 'title' : gM( 'mwe-proxy-not-ready' ), |
| 588 | + 'content' : $dialogMsg, |
| 589 | + 'buttons' : buttons |
| 590 | + }) |
591 | 591 | } |
592 | 592 | |
593 | 593 | /** |
Index: branches/MwEmbedStandAlone/libraries/jquery/plugins/jquery.menu/jquery.menu.js |
— | — | @@ -5,11 +5,17 @@ |
6 | 6 | By: Maggie Costello Wachs (maggie@filamentgroup.com) and Scott Jehl (scott@filamentgroup.com) |
7 | 7 | http://www.filamentgroup.com |
8 | 8 | * reference articles: http://www.filamentgroup.com/lab/jquery_ipod_style_drilldown_menu/ |
| 9 | + |
| 10 | +* modified by Michael Dale, ( michael.dale@kaltura.com ) |
9 | 11 | |
10 | 12 | Copyright (c) 2009 Filament Group |
11 | 13 | Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses. |
12 | 14 | |
13 | | -NOTE: mvEmbed will switch to jquery ui menu once that is released |
| 15 | +NOTE: mwEmbed will switch to jquery ui menu once that is released |
| 16 | +NOTE: This menu contains several customizations for use in mwEmbed modules:: |
| 17 | + |
| 18 | +* added getLineItem helper function |
| 19 | +* added special class "divider" that is non selectable menu item horizontal hr |
14 | 20 | --------------------------------------------------------------------*/ |
15 | 21 | |
16 | 22 | |
— | — | @@ -173,11 +179,11 @@ |
174 | 180 | this.showMenu = function() { |
175 | 181 | mw.log('$j.menu:: show menu' ); |
176 | 182 | killAllMenus(); |
177 | | - mw.log('done:: killAllMenus' ); |
| 183 | + mw.log('jquery.menu:: killAllMenus' ); |
178 | 184 | if ( ! menu.menuExists) { |
179 | 185 | menu.create() |
180 | 186 | }; |
181 | | - mw.log('done:: menu.create' ); |
| 187 | + mw.log('jquery.menu:: menu.create' ); |
182 | 188 | caller |
183 | 189 | .addClass('fg-menu-open') |
184 | 190 | .addClass(options.callerOnState); |
— | — | @@ -185,7 +191,7 @@ |
186 | 192 | menu.kill(); |
187 | 193 | return false; |
188 | 194 | }); |
189 | | - mw.log('done:: menu. binding container' ); |
| 195 | + mw.log('jquery.menu:: menu. binding container' ); |
190 | 196 | |
191 | 197 | container.hide().slideDown(options.showSpeed).find('.fg-menu:eq(0)'); |
192 | 198 | menu.menuOpen = true; |
— | — | @@ -289,7 +295,7 @@ |
290 | 296 | |
291 | 297 | // aria roles & attributes |
292 | 298 | container.find( 'ul' ).attr('role', 'menu').eq(0).attr('aria-activedescendant','active-menuitem').attr('aria-labelledby', caller.attr('id')); |
293 | | - container.find( 'li' ).attr('role', 'menuitem'); |
| 299 | + container.find( 'li:not(.divider)' ).attr('role', 'menuitem'); |
294 | 300 | container.find( 'li:has(ul)' ).attr('aria-haspopup', 'true').find('ul').attr('aria-expanded', 'false'); |
295 | 301 | container.find( 'a' ).attr('tabindex', '-1'); |
296 | 302 | |