diff --git a/core/src/plugins/action.share/res/react-share-form.css b/core/src/plugins/action.share/res/react-share-form.css index 08454075ec..e88980d0e8 100644 --- a/core/src/plugins/action.share/res/react-share-form.css +++ b/core/src/plugins/action.share/res/react-share-form.css @@ -79,6 +79,15 @@ div#react_share_form .additional-actions-links a { display: inline-block; margin-left: 10px; } +div#react_share_form .additional-actions-links a.qrcode-active { + color: #333333; +} +div#react_share_form .qrCode { + text-align: center; +} +div#react_share_form .qrCode canvas { + margin-top: 10px; +} div#react_share_form .form-legend { color: #bbb; margin-top: -5px !important; diff --git a/core/src/plugins/action.share/res/react-share-form.less b/core/src/plugins/action.share/res/react-share-form.less index 1999099b36..c82238f231 100644 --- a/core/src/plugins/action.share/res/react-share-form.less +++ b/core/src/plugins/action.share/res/react-share-form.less @@ -98,6 +98,15 @@ div#react_share_form { cursor: pointer; display: inline-block; margin-left: 10px; + &.qrcode-active{ + color: #333333; + } + } + } + .qrCode{ + text-align: center; + canvas{ + margin-top: 10px; } } .form-legend { diff --git a/core/src/plugins/action.share/res/react/ShareDialog.js b/core/src/plugins/action.share/res/react/ShareDialog.js index dc8fd14a1e..eb6bbcefb6 100644 --- a/core/src/plugins/action.share/res/react/ShareDialog.js +++ b/core/src/plugins/action.share/res/react/ShareDialog.js @@ -854,7 +854,7 @@ showMailer:React.PropTypes.func }, getInitialState: function(){ - return {editLink: false, copyMessage:''}; + return {editLink: false, copyMessage:'', showQRCode: false}; }, toggleEditMode: function(){ if(this.state.editLink && this.state.customLink){ @@ -917,6 +917,10 @@ this.props.showMailer(mailData.subject, mailData.message, []); }, + toggleQRCode: function(){ + this.setState({showQRCode:!this.state.showQRCode}); + }, + render: function(){ var publicLink = this.props.linkData['public_link']; var editAllowed = this.props.editAllowed && !this.props.linkData['hash_is_shorten'] && !this.context.isReadonly() && this.props.shareModel.currentIsOwner(); @@ -944,6 +948,9 @@ if(editAllowed){ actionLinks.push({this.context.getMessage('193')}); } + if(ReactModel.Share.qrcodeEnabled()){ + actionLinks.push({this.context.getMessage('94')}) + } if(actionLinks.length){ actionLinks = (
{actionLinks}
@@ -951,6 +958,9 @@ }else{ actionLinks = null; } + if(this.state.showQRCode){ + var qrCode =
; + } return (
{copyButton}
{actionLinks} + {qrCode}
); } diff --git a/core/src/plugins/action.share/res/react/model/ShareModel.js b/core/src/plugins/action.share/res/react/model/ShareModel.js index 61b2feeb06..4a8d1125d9 100644 --- a/core/src/plugins/action.share/res/react/model/ShareModel.js +++ b/core/src/plugins/action.share/res/react/model/ShareModel.js @@ -857,6 +857,10 @@ return global.pydio.getPluginConfigs("core.ocs").get("ENABLE_FEDERATED_SHARING"); } + static qrcodeEnabled(){ + return global.pydio.getPluginConfigs("action.share").get("CREATE_QRCODE"); + } + prepareEmail(shareType, linkId = null){ var MessageHash = global.pydio.MessageHash; var ApplicationTitle = global.pydio.appTitle; diff --git a/core/src/plugins/gui.ajax/package.json b/core/src/plugins/gui.ajax/package.json index d0c8ea9cfd..e538204ece 100644 --- a/core/src/plugins/gui.ajax/package.json +++ b/core/src/plugins/gui.ajax/package.json @@ -24,7 +24,8 @@ "lodash": "^3.10.1", "classnames": "~2.1.3", "react-autosuggest": "1.18.2", - "clipboard":"^1.5.8" + "clipboard":"^1.5.8", + "qrcode.react":"0.6.1" }, "devDependencies": { "grunt": "~0.4.5", diff --git a/core/src/plugins/gui.ajax/res/js/vendor/nodejs/export.js b/core/src/plugins/gui.ajax/res/js/vendor/nodejs/export.js index e92f81b6e0..c718867c44 100644 --- a/core/src/plugins/gui.ajax/res/js/vendor/nodejs/export.js +++ b/core/src/plugins/gui.ajax/res/js/vendor/nodejs/export.js @@ -14,4 +14,5 @@ window.ReactDND.flow = require('lodash/function/flow'); window.classNames = require('classnames'); window.ReactAutoSuggest = require('react-autosuggest'); window.Clipboard = require('clipboard'); +window.ReactQRCode = require('qrcode.react'); window.injectTapEventPlugin(); \ No newline at end of file