mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 09:03:21 +00:00 
			
		
		
		
	Merge branch 'master' into GUAC-1193
This commit is contained in:
		| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
|  * Copyright (C) 2014 Glyptodon LLC | ||||
|  * Copyright (C) 2015 Glyptodon LLC | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
|  * of this software and associated documentation files (the "Software"), to deal | ||||
| @@ -31,82 +31,11 @@ angular.module('client').factory('guacAudio', [function guacAudio() { | ||||
|     return new (function() { | ||||
|  | ||||
|         /** | ||||
|          * Array of codecs to test. | ||||
|          * Array of all supported audio mimetypes. | ||||
|          * | ||||
|          * @type String[] | ||||
|          */ | ||||
|         var codecs = [ | ||||
|             'audio/ogg; codecs="vorbis"', | ||||
|             'audio/mp4; codecs="mp4a.40.5"', | ||||
|             'audio/mpeg; codecs="mp3"', | ||||
|             'audio/webm; codecs="vorbis"', | ||||
|             'audio/wav; codecs=1' | ||||
|         ]; | ||||
|  | ||||
|         /** | ||||
|          * Array of all codecs that are reported as "probably" supported. | ||||
|          * | ||||
|          * @type String[] | ||||
|          */ | ||||
|         var probably_supported = []; | ||||
|  | ||||
|         /** | ||||
|          * Array of all codecs that are reported as "maybe" supported. | ||||
|          * | ||||
|          * @type String[] | ||||
|          */ | ||||
|         var maybe_supported = []; | ||||
|  | ||||
|         /** | ||||
|          * Internal audio element for the sake of testing codec support. If | ||||
|          * audio is explicitly not supported by the browser, this will instead | ||||
|          * be null. | ||||
|          * | ||||
|          * @type Audio | ||||
|          */ | ||||
|         var audio = null; | ||||
|  | ||||
|         // Attempt to create audio element | ||||
|         try { | ||||
|             audio = new Audio(); | ||||
|         } | ||||
|         catch (e) { | ||||
|             // If creation fails, allow audio to remain null | ||||
|         } | ||||
|  | ||||
|         /** | ||||
|          * Array of all supported audio mimetypes, ordered by liklihood of | ||||
|          * working. | ||||
|          */ | ||||
|         this.supported = []; | ||||
|  | ||||
|         // Build array of supported audio formats (if audio supported at all) | ||||
|         if (audio) { | ||||
|             codecs.forEach(function(mimetype) { | ||||
|  | ||||
|                 var support_level = audio.canPlayType(mimetype); | ||||
|  | ||||
|                 // Trim semicolon and trailer | ||||
|                 var semicolon = mimetype.indexOf(";"); | ||||
|                 if (semicolon !== -1) | ||||
|                     mimetype = mimetype.substring(0, semicolon); | ||||
|  | ||||
|                 // Partition by probably/maybe | ||||
|                 if (support_level === "probably") | ||||
|                     probably_supported.push(mimetype); | ||||
|                 else if (support_level === "maybe") | ||||
|                     maybe_supported.push(mimetype); | ||||
|  | ||||
|             }); | ||||
|  | ||||
|             // Add probably supported types first | ||||
|             Array.prototype.push.apply( | ||||
|                 this.supported, probably_supported); | ||||
|  | ||||
|             // Prioritize "maybe" supported types second | ||||
|             Array.prototype.push.apply( | ||||
|                 this.supported, maybe_supported); | ||||
|         } | ||||
|         this.supported = Guacamole.AudioPlayer.getSupportedTypes(); | ||||
|  | ||||
|     })(); | ||||
|  | ||||
|   | ||||
| @@ -28,14 +28,94 @@ | ||||
|     z-index: 20; | ||||
|  | ||||
|     font-size: 0.8em; | ||||
|     padding: 0.5em; | ||||
|  | ||||
|     width: 4in; | ||||
|     max-width: 100%; | ||||
|     max-height: 3in; | ||||
|  | ||||
| } | ||||
|  | ||||
| #file-transfer-dialog .transfer-manager { | ||||
|  | ||||
|     /* IE10 */ | ||||
|     display: -ms-flexbox; | ||||
|     -ms-flex-align: stretch; | ||||
|     -ms-flex-direction: column; | ||||
|  | ||||
|     /* Ancient Mozilla */ | ||||
|     display: -moz-box; | ||||
|     -moz-box-align: stretch; | ||||
|     -moz-box-orient: vertical; | ||||
|  | ||||
|     /* Ancient WebKit */ | ||||
|     display: -webkit-box; | ||||
|     -webkit-box-align: stretch; | ||||
|     -webkit-box-orient: vertical; | ||||
|  | ||||
|     /* Old WebKit */ | ||||
|     display: -webkit-flex; | ||||
|     -webkit-align-items: stretch; | ||||
|     -webkit-flex-direction: column; | ||||
|  | ||||
|     /* W3C */ | ||||
|     display: flex; | ||||
|     align-items: stretch; | ||||
|     flex-direction: column; | ||||
|  | ||||
|     max-width: inherit; | ||||
|     max-height: inherit; | ||||
|  | ||||
|     border: 1px solid rgba(0, 0, 0, 0.5); | ||||
|     box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25); | ||||
|  | ||||
| } | ||||
|  | ||||
| #file-transfer-dialog .transfer-manager .header { | ||||
|     -ms-flex: 0 0 auto; | ||||
|     -moz-box-flex: 0; | ||||
|     -webkit-box-flex: 0; | ||||
|     -webkit-flex: 0 0 auto; | ||||
|     flex: 0 0 auto; | ||||
| } | ||||
|  | ||||
| #file-transfer-dialog .transfer-manager .transfer-manager-body { | ||||
|  | ||||
|     -ms-flex: 1 1 auto; | ||||
|     -moz-box-flex: 1; | ||||
|     -webkit-box-flex: 1; | ||||
|     -webkit-flex: 1 1 auto; | ||||
|     flex: 1 1 auto; | ||||
|  | ||||
|     overflow: auto; | ||||
|  | ||||
| } | ||||
|  | ||||
| /* | ||||
|  * Shrink maximum height if viewport is too small for default 3in dialog. | ||||
|  */ | ||||
| @media all and (max-height: 3in) { | ||||
|  | ||||
|     #file-transfer-dialog { | ||||
|         max-height: 1.5in; | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| /* | ||||
|  * If viewport is too small for even the 1.5in dialog, fit all available space. | ||||
|  */ | ||||
| @media all and (max-height: 1.5in) { | ||||
|  | ||||
|     #file-transfer-dialog { | ||||
|         height: 100%; | ||||
|     } | ||||
|  | ||||
|     #file-transfer-dialog .transfer-manager { | ||||
|         position: absolute; | ||||
|         left:   0.5em; | ||||
|         top:    0.5em; | ||||
|         right:  0.5em; | ||||
|         bottom: 0.5em; | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -27,15 +27,17 @@ | ||||
|         <button ng-click="clearCompletedTransfers()">{{'CLIENT.ACTION_CLEAR_COMPLETED_TRANSFERS' | translate}}</button> | ||||
|     </div> | ||||
|  | ||||
|     <!-- Sent/received files files --> | ||||
|     <div class="transfers"> | ||||
|         <guac-file-transfer | ||||
|             transfer="upload" | ||||
|             ng-repeat="upload in client.uploads"> | ||||
|         </guac-file-transfer><guac-file-transfer | ||||
|             transfer="download" | ||||
|             ng-repeat="download in client.downloads"> | ||||
|         </guac-file-transfer> | ||||
|     <!-- Sent/received files --> | ||||
|     <div class="transfer-manager-body"> | ||||
|         <div class="transfers"> | ||||
|             <guac-file-transfer | ||||
|                 transfer="upload" | ||||
|                 ng-repeat="upload in client.uploads"> | ||||
|             </guac-file-transfer><guac-file-transfer | ||||
|                 transfer="download" | ||||
|                 ng-repeat="download in client.downloads"> | ||||
|             </guac-file-transfer> | ||||
|         </div> | ||||
|     </div> | ||||
|  | ||||
| </div> | ||||
|   | ||||
| @@ -29,9 +29,10 @@ | ||||
| angular.module('locale').factory('translationLoader', ['$injector', function translationLoader($injector) { | ||||
|  | ||||
|     // Required services | ||||
|     var $http        = $injector.get('$http'); | ||||
|     var $q           = $injector.get('$q'); | ||||
|     var cacheService = $injector.get('cacheService'); | ||||
|     var $http           = $injector.get('$http'); | ||||
|     var $q              = $injector.get('$q'); | ||||
|     var cacheService    = $injector.get('cacheService'); | ||||
|     var languageService = $injector.get('languageService'); | ||||
|  | ||||
|     /** | ||||
|      * Satisfies a translation request for the given key by searching for the | ||||
| @@ -62,22 +63,48 @@ angular.module('locale').factory('translationLoader', ['$injector', function tra | ||||
|             return; | ||||
|         } | ||||
|  | ||||
|         // Attempt to retrieve language | ||||
|         $http({ | ||||
|             cache   : cacheService.languages, | ||||
|             method  : 'GET', | ||||
|             url     : 'translations/' + encodeURIComponent(currentKey) + '.json' | ||||
|         }) | ||||
|  | ||||
|         // Resolve promise if translation retrieved successfully | ||||
|         .success(function translationFileRetrieved(translation) { | ||||
|             deferred.resolve(translation); | ||||
|         }) | ||||
|  | ||||
|         // Retry with remaining languages if translation file could not be retrieved | ||||
|         .error(function translationFileUnretrievable() { | ||||
|         /** | ||||
|          * Continues trying possible translation files until no possibilities | ||||
|          * exist. | ||||
|          * | ||||
|          * @private | ||||
|          */ | ||||
|         var tryNextTranslation = function tryNextTranslation() { | ||||
|             satisfyTranslation(deferred, requestedKey, remainingKeys); | ||||
|         }); | ||||
|         }; | ||||
|  | ||||
|         // Retrieve list of supported languages | ||||
|         languageService.getLanguages() | ||||
|  | ||||
|         // Attempt to retrieve translation if language is supported | ||||
|         .success(function retrievedLanguages(languages) { | ||||
|  | ||||
|             // Skip retrieval if language is not supported | ||||
|             if (!(currentKey in languages)) { | ||||
|                 tryNextTranslation(); | ||||
|                 return; | ||||
|             } | ||||
|  | ||||
|             // Attempt to retrieve language | ||||
|             $http({ | ||||
|                 cache   : cacheService.languages, | ||||
|                 method  : 'GET', | ||||
|                 url     : 'translations/' + encodeURIComponent(currentKey) + '.json' | ||||
|             }) | ||||
|  | ||||
|             // Resolve promise if translation retrieved successfully | ||||
|             .success(function translationFileRetrieved(translation) { | ||||
|                 deferred.resolve(translation); | ||||
|             }) | ||||
|  | ||||
|             // Retry with remaining languages if translation file could not be | ||||
|             // retrieved | ||||
|             .error(tryNextTranslation); | ||||
|  | ||||
|         }) | ||||
|  | ||||
|         // Retry with remaining languages if translation does not exist | ||||
|         .error(tryNextTranslation); | ||||
|  | ||||
|     }; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user