@@ -9695,7 +9695,7 @@ $.extend(UI, {
96959695 // script per fare apparire e scomparire la riga con l'upload della tmx
96969696
96979697
9698- $ ( 'body' ) . on ( 'click' , 'tr.mine a.canceladdtmx, #inactivetm tr.new .action .addtmxfile' , function ( ) {
9698+ $ ( 'body' ) . on ( 'click' , 'tr.mine a.canceladdtmx, tr.ownergroup a.canceladdtmx, #inactivetm tr.new .action .addtmxfile' , function ( ) {
96999699 $ ( this ) . parents ( 'tr' ) . find ( '.action .addtmx' ) . removeClass ( 'disabled' ) ;
97009700 $ ( this ) . parents ( 'td.uploadfile' ) . remove ( ) ;
97019701
@@ -9778,7 +9778,7 @@ $.extend(UI, {
97789778// $(".clicked td.action").append('progressbar');
97799779
97809780 // script per appendere le tmx fra quelle attive e inattive, preso da qui: https://stackoverflow.com/questions/24355817/move-table-rows-that-are-selected-to-another-table-javscript
9781- } ) . on ( 'click' , 'tr.mine .uploadfile .addtmxfile:not(.disabled)' , function ( ) {
9781+ } ) . on ( 'click' , 'tr.mine .uploadfile .addtmxfile:not(.disabled), tr.ownergroup .uploadfile .addtmxfile:not(.disabled) ' , function ( ) {
97829782 $ ( this ) . addClass ( 'disabled' ) ;
97839783 $ ( this ) . parents ( '.uploadfile' ) . find ( '.error' ) . text ( '' ) . hide ( ) ;
97849784
@@ -9871,7 +9871,7 @@ $.extend(UI, {
98719871 UI . useTM ( this ) ;
98729872 } ) . on ( 'change' , '#new-tm-read, #new-tm-write' , function ( ) {
98739873 UI . checkTMgrants ( ) ;
9874- } ) . on ( 'change' , 'tr.mine td.uploadfile input[type="file"]' , function ( ) {
9874+ } ) . on ( 'change' , 'tr.mine td.uploadfile input[type="file"], tr.ownergroup td.uploadfile input[type="file"] ' , function ( ) {
98759875 if ( this . files [ 0 ] . size > config . maxTMXFileSize ) {
98769876 numMb = config . maxTMXFileSize / ( 1024 * 1024 ) ;
98779877 APP . alert ( 'File too big.<br/>The maximuxm allowed size is ' + numMb + 'Mb.' ) ;
@@ -10284,7 +10284,16 @@ $.extend(UI, {
1028410284 } else {
1028510285 $ ( table ) . find ( 'tr.uploadpanel .uploadfile' ) . addClass ( 'uploading' ) ;
1028610286 }
10287- var trClass = ( existing ) ? 'mine' : 'uploadpanel' ;
10287+ if ( existing ) {
10288+ if ( $ ( el ) . parents ( 'tr' ) . hasClass ( 'mine' ) ) {
10289+ trClass = 'mine' ;
10290+ } else {
10291+ trClass = 'ownergroup' ;
10292+ }
10293+ } else {
10294+ trClass = 'uploadpanel' ;
10295+ }
10296+ // var trClass = (existing)? 'mine' : 'uploadpanel';
1028810297 form = $ ( table ) . find ( 'tr.' + trClass + ' .add-TM-Form' ) [ 0 ] ;
1028910298 path = $ ( el ) . parents ( '.uploadfile' ) . find ( 'input[type="file"]' ) . val ( ) ;
1029010299 file = path . split ( '\\' ) [ path . split ( '\\' ) . length - 1 ] ;
@@ -10372,7 +10381,6 @@ $.extend(UI, {
1037210381 iframe . setAttribute ( "height" , "0" ) ;
1037310382 iframe . setAttribute ( "border" , "0" ) ;
1037410383 iframe . setAttribute ( "style" , "width: 0; height: 0; border: none;" ) ;
10375-
1037610384 // Add to document...
1037710385 document . body . appendChild ( iframe ) ;
1037810386// form.parentNode.appendChild(iframe);
@@ -10404,7 +10412,13 @@ $.extend(UI, {
1040410412 if ( iframeId . addEventListener ) iframeId . addEventListener ( "load" , eventHandler , true ) ;
1040510413 if ( iframeId . attachEvent ) iframeId . attachEvent ( "onload" , eventHandler ) ;
1040610414 existing = ( $ ( form ) . hasClass ( 'existing' ) ) ? true : false ;
10407- TMKey = ( existing ) ? $ ( form ) . parents ( '.mine' ) . find ( '.privatekey' ) . first ( ) . text ( ) : $ ( '#new-tm-key' ) . val ( ) ;
10415+ if ( existing ) {
10416+ TR = $ ( form ) . parents ( 'tr' ) ;
10417+ TMKey = TR . find ( '.privatekey' ) . first ( ) . text ( ) ;
10418+ } else {
10419+ TMKey = $ ( '#new-tm-key' ) . val ( ) ;
10420+ }
10421+ // TMKey = (existing)? $(form).parents('.mine').find('.privatekey').first().text() : $('#new-tm-key').val();
1040810422
1040910423 // Set properties of form...
1041010424 form . setAttribute ( "target" , "upload_iframe" ) ;
0 commit comments