This repository was archived by the owner on Nov 25, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +37
-2
lines changed Expand file tree Collapse file tree 6 files changed +37
-2
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,15 @@ div#react_share_form .additional-actions-links a {
79
79
display : inline-block;
80
80
margin-left : 10px ;
81
81
}
82
+ div # react_share_form .additional-actions-links a .qrcode-active {
83
+ color : # 333333 ;
84
+ }
85
+ div # react_share_form .qrCode {
86
+ text-align : center;
87
+ }
88
+ div # react_share_form .qrCode canvas {
89
+ margin-top : 10px ;
90
+ }
82
91
div # react_share_form .form-legend {
83
92
color : # bbb ;
84
93
margin-top : -5px !important ;
Original file line number Diff line number Diff line change @@ -98,6 +98,15 @@ div#react_share_form {
98
98
cursor : pointer ;
99
99
display : inline-block ;
100
100
margin-left : 10px ;
101
+ & .qrcode-active {
102
+ color : #333333 ;
103
+ }
104
+ }
105
+ }
106
+ .qrCode {
107
+ text-align : center ;
108
+ canvas {
109
+ margin-top : 10px ;
101
110
}
102
111
}
103
112
.form-legend {
Original file line number Diff line number Diff line change 854
854
showMailer :React . PropTypes . func
855
855
} ,
856
856
getInitialState : function ( ) {
857
- return { editLink : false , copyMessage :'' } ;
857
+ return { editLink : false , copyMessage :'' , showQRCode : false } ;
858
858
} ,
859
859
toggleEditMode : function ( ) {
860
860
if ( this . state . editLink && this . state . customLink ) {
917
917
this . props . showMailer ( mailData . subject , mailData . message , [ ] ) ;
918
918
} ,
919
919
920
+ toggleQRCode : function ( ) {
921
+ this . setState ( { showQRCode :! this . state . showQRCode } ) ;
922
+ } ,
923
+
920
924
render : function ( ) {
921
925
var publicLink = this . props . linkData [ 'public_link' ] ;
922
926
var editAllowed = this . props . editAllowed && ! this . props . linkData [ 'hash_is_shorten' ] && ! this . context . isReadonly ( ) && this . props . shareModel . currentIsOwner ( ) ;
944
948
if ( editAllowed ) {
945
949
actionLinks . push ( < a key = "customize" onClick = { this . toggleEditMode } > { this . context . getMessage ( '193' ) } </ a > ) ;
946
950
}
951
+ if ( ReactModel . Share . qrcodeEnabled ( ) ) {
952
+ actionLinks . push ( < a className = { this . state . showQRCode ?'qrcode-active' :'' } key = "qrcode" onClick = { this . toggleQRCode } > { this . context . getMessage ( '94' ) } </ a > )
953
+ }
947
954
if ( actionLinks . length ) {
948
955
actionLinks = (
949
956
< div className = "additional-actions-links" > { actionLinks } </ div >
950
957
) ;
951
958
} else {
952
959
actionLinks = null ;
953
960
}
961
+ if ( this . state . showQRCode ) {
962
+ var qrCode = < div className = "qrCode" > < ReactQRCode size = { 128 } value = { publicLink } level = "Q" /> </ div > ;
963
+ }
954
964
return (
955
965
< div className = "public-link-container" >
956
966
< ReactMUI . TextField
963
973
/> { copyButton }
964
974
< div style = { { textAlign :'center' } } className = "section-legend" dangerouslySetInnerHTML = { setHtml ( ) } />
965
975
{ actionLinks }
976
+ { qrCode }
966
977
</ div >
967
978
) ;
968
979
}
Original file line number Diff line number Diff line change 857
857
return global . pydio . getPluginConfigs ( "core.ocs" ) . get ( "ENABLE_FEDERATED_SHARING" ) ;
858
858
}
859
859
860
+ static qrcodeEnabled ( ) {
861
+ return global . pydio . getPluginConfigs ( "action.share" ) . get ( "CREATE_QRCODE" ) ;
862
+ }
863
+
860
864
prepareEmail ( shareType , linkId = null ) {
861
865
var MessageHash = global . pydio . MessageHash ;
862
866
var ApplicationTitle = global . pydio . appTitle ;
Original file line number Diff line number Diff line change 24
24
"lodash" : " ^3.10.1" ,
25
25
"classnames" : " ~2.1.3" ,
26
26
"react-autosuggest" : " 1.18.2" ,
27
- "clipboard" :" ^1.5.8"
27
+ "clipboard" :" ^1.5.8" ,
28
+ "qrcode.react" :" 0.6.1"
28
29
},
29
30
"devDependencies" : {
30
31
"grunt" : " ~0.4.5" ,
Original file line number Diff line number Diff line change @@ -14,4 +14,5 @@ window.ReactDND.flow = require('lodash/function/flow');
14
14
window . classNames = require ( 'classnames' ) ;
15
15
window . ReactAutoSuggest = require ( 'react-autosuggest' ) ;
16
16
window . Clipboard = require ( 'clipboard' ) ;
17
+ window . ReactQRCode = require ( 'qrcode.react' ) ;
17
18
window . injectTapEventPlugin ( ) ;
You can’t perform that action at this time.
0 commit comments