1
0

federatedfilesharing-vue-settings-personal.js 11 KB

12
  1. !function(){"use strict";var n,e={23105:function(n,e,o){var r=o(20144),i=o(22200),a=o(9944),c=(o(36144),o(26932)),l=o(16453),s=o(13299),d=o.n(s),u=o(10861),f=o.n(u),p=o(8731),h=o(78095),g=o(49298),m=o(75017),v=o(15168),b=o.n(v);function y(n,t,e,o,r,i,a){try{var c=n[i](a),l=c.value}catch(n){return void e(n)}c.done?t(l):Promise.resolve(l).then(o,r)}var A={name:"PersonalSettings",components:{NcButton:f(),NcSettingsSection:d(),Twitter:p.Z,Facebook:h.Z,Web:g.Z,Clipboard:m.Z},directives:{Tooltip:b()},data:function(){return{color:(0,l.loadState)("federatedfilesharing","color"),textColor:(0,l.loadState)("federatedfilesharing","textColor"),logoPath:(0,l.loadState)("federatedfilesharing","logoPath"),reference:(0,l.loadState)("federatedfilesharing","reference"),cloudId:(0,l.loadState)("federatedfilesharing","cloudId"),docUrlFederated:(0,l.loadState)("federatedfilesharing","docUrlFederated"),showHtml:!1,isCopied:!1}},computed:{messageWithURL:function(){return t("federatedfilesharing","Share with me through my #Nextcloud Federated Cloud ID, see {url}",{url:this.reference})},messageWithoutURL:function(){return t("federatedfilesharing","Share with me through my #Nextcloud Federated Cloud ID")},shareDiasporaUrl:function(){return"https://share.diasporafoundation.org/?title=".concat(encodeURIComponent(this.messageWithoutURL),"&url=").concat(encodeURIComponent(this.reference))},shareTwitterUrl:function(){return"https://twitter.com/intent/tweet?text=".concat(encodeURIComponent(this.messageWithURL))},shareFacebookUrl:function(){return"https://www.facebook.com/sharer/sharer.php?u=".concat(encodeURIComponent(this.reference))},logoPathAbsolute:function(){return window.location.protocol+"//"+window.location.host+this.logoPath},backgroundStyle:function(){return"padding:10px;background-color:".concat(this.color,";color:").concat(this.textColor,";border-radius:3px;padding-left:4px;")},linkStyle:function(){return"background-image:url(".concat(this.logoPathAbsolute,");width:50px;height:30px;position:relative;top:8px;background-size:contain;display:inline-block;background-repeat:no-repeat; background-position: center center;")},htmlCode:function(){return'<a target="_blank" rel="noreferrer noopener" href="'.concat(this.reference,'" style="').concat(this.backgroundStyle,'">\n\t<span style="').concat(this.linkStyle,'"></span>\n\t').concat(t("federatedfilesharing","Share with me via Nextcloud"),"\n</a>")},copyLinkTooltip:function(){return this.isCopied?t("federatedfilesharing","Cloud ID copied to the clipboard"):t("federatedfilesharing","Copy to clipboard")}},methods:{copyCloudId:function(){var n,e=this;return(n=regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(navigator.clipboard){n.next=3;break}return(0,c.x2)(t("federatedfilesharing","Clipboard is not available")),n.abrupt("return");case 3:return n.next=5,navigator.clipboard.writeText(e.cloudId);case 5:e.isCopied=!0,e.$refs.clipboard.$el.focus();case 7:case"end":return n.stop()}}),n)})),function(){var t=this,e=arguments;return new Promise((function(o,r){var i=n.apply(t,e);function a(n){y(i,o,r,a,c,"next",n)}function c(n){y(i,o,r,a,c,"throw",n)}a(void 0)}))})()},goTo:function(n){window.location.href=n}}},C=A,x=o(93379),w=o.n(x),k=o(7795),I=o.n(k),_=o(90569),S=o.n(_),T=o(3565),M=o.n(T),D=o(19216),N=o.n(D),Z=o(44589),j=o.n(Z),P=o(15337),B={};B.styleTagTransform=j(),B.setAttributes=M(),B.insert=S().bind(null,"head"),B.domAPI=I(),B.insertStyleElement=N(),w()(P.Z,B),P.Z&&P.Z.locals&&P.Z.locals;var z=(0,o(51900).Z)(C,(function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("NcSettingsSection",{attrs:{title:n.t("federatedfilesharing","Federated Cloud"),description:n.t("federatedfilesharing","You can share with anyone who uses a Nextcloud server or other Open Cloud Mesh (OCM) compatible servers and services! Just put their Federated Cloud ID in the share dialog. It looks like person@cloud.example.com"),"doc-url":n.docUrlFederated}},[e("p",{staticClass:"cloud-id-text"},[n._v("\n\t\t"+n._s(n.t("federatedfilesharing","Your Federated Cloud ID:"))+"\n\t\t"),e("strong",{attrs:{id:"cloudid"}},[n._v(n._s(n.cloudId))]),n._v(" "),e("NcButton",{directives:[{name:"tooltip",rawName:"v-tooltip",value:n.copyLinkTooltip,expression:"copyLinkTooltip"}],ref:"clipboard",staticClass:"clipboard",attrs:{type:"tertiary-no-background"},on:{click:function(t){return t.preventDefault(),n.copyCloudId.apply(null,arguments)}},scopedSlots:n._u([{key:"icon",fn:function(){return[e("Clipboard",{attrs:{size:20}})]},proxy:!0}])})],1),n._v(" "),e("p",{staticClass:"social-button"},[n._v("\n\t\t"+n._s(n.t("federatedfilesharing","Share it so your friends can share files with you:"))),e("br"),n._v(" "),e("NcButton",{on:{click:function(t){return n.goTo(n.shareFacebookUrl)}},scopedSlots:n._u([{key:"icon",fn:function(){return[e("Facebook",{attrs:{size:20}})]},proxy:!0}])},[n._v("\n\t\t\t"+n._s(n.t("federatedfilesharing","Facebook"))+"\n\t\t\t")]),n._v(" "),e("NcButton",{on:{click:function(t){return n.goTo(n.shareTwitterUrl)}},scopedSlots:n._u([{key:"icon",fn:function(){return[e("Twitter",{attrs:{size:20}})]},proxy:!0}])},[n._v("\n\t\t\t"+n._s(n.t("federatedfilesharing","Twitter"))+"\n\t\t\t")]),n._v(" "),e("NcButton",{on:{click:function(t){return n.goTo(n.shareDiasporaUrl)}},scopedSlots:n._u([{key:"icon",fn:function(){return[e("svg",{attrs:{width:"20",height:"20",viewBox:"-10 -5 1034 1034",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{fill:"currentColor",d:"M502 197q-96 0-96.5 1.5t-1.5 137-1.5 138-2 2.5T266 432.5 132.5 390t-30 94T74 578l232 77q21 8 21 10t-79.5 117.5T168 899t79.5 56.5T328 1011t81-110 82-110 41 55l83 115q43 60 44 60t79.5-58 79-59-76-112.5-76-113.5T795 632.5t129.5-44-28-94T867 400t-128 42-128.5 43-2.5-7.5-1-38.5l-3-108q-4-133-5-133.5t-97-.5z"}})])]},proxy:!0}])},[n._v("\n\t\t\t"+n._s(n.t("federatedfilesharing","Diaspora"))+"\n\t\t\t")]),n._v(" "),e("NcButton",{on:{click:function(t){n.showHtml=!n.showHtml}},scopedSlots:n._u([{key:"icon",fn:function(){return[e("Web",{attrs:{size:20}})]},proxy:!0}])},[n._v("\n\t\t\t"+n._s(n.t("federatedfilesharing","Add to your website"))+"\n\t\t")])],1),n._v(" "),n.showHtml?[e("p",{staticStyle:{margin:"10px 0"}},[e("a",{style:n.backgroundStyle,attrs:{target:"_blank",rel:"noreferrer noopener",href:n.reference}},[e("span",{style:n.linkStyle}),n._v("\n\t\t\t\t"+n._s(n.t("federatedfilesharing","Share with me via Nextcloud"))+"\n\t\t\t")])]),n._v(" "),e("p",[n._v("\n\t\t\t"+n._s(n.t("federatedfilesharing","HTML Code:"))+"\n\t\t\t"),e("br"),n._v(" "),e("pre",[n._v(n._s(n.htmlCode))])])]:n._e()],2)}),[],!1,null,"e3fb521a",null),L=z.exports;o.nc=btoa((0,i.getRequestToken)()),r.ZP.mixin({methods:{t:a.translate}}),(new(r.ZP.extend(L))).$mount("#vue-personal-federated")},15337:function(n,t,e){var o=e(87537),r=e.n(o),i=e(23645),a=e.n(i)()(r());a.push([n.id,".social-button[data-v-e3fb521a]{margin-top:.5rem}.social-button button[data-v-e3fb521a]{display:inline-flex;margin-left:.5rem;margin-top:1rem}.cloud-id-text[data-v-e3fb521a]{display:flex;align-items:center}.cloud-id-text button[data-v-e3fb521a]{display:inline-flex}pre[data-v-e3fb521a]{margin-top:0;white-space:pre-wrap}#cloudid[data-v-e3fb521a]{margin-left:.25rem}","",{version:3,sources:["webpack://./apps/federatedfilesharing/src/components/PersonalSettings.vue"],names:[],mappings:"AAiLA,gCACC,gBAAA,CACA,uCACC,mBAAA,CACA,iBAAA,CACA,eAAA,CAGF,gCACC,YAAA,CACA,kBAAA,CACA,uCACC,mBAAA,CAGF,qBACC,YAAA,CACA,oBAAA,CAED,0BACC,kBAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.social-button {\n\tmargin-top: 0.5rem;\n\tbutton {\n\t\tdisplay: inline-flex;\n\t\tmargin-left: 0.5rem;\n\t\tmargin-top: 1rem;\n\t}\n}\n.cloud-id-text {\n\tdisplay: flex;\n\talign-items: center;\n\tbutton {\n\t\tdisplay: inline-flex;\n\t}\n}\npre {\n\tmargin-top: 0;\n\twhite-space: pre-wrap;\n}\n#cloudid {\n\tmargin-left: 0.25rem;\n}\n"],sourceRoot:""}]),t.Z=a},81490:function(n){n.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiI+CiAgPHBhdGggZD0iTTE0IDEyLjNMMTIuMyAxNCA4IDkuNyAzLjcgMTQgMiAxMi4zIDYuMyA4IDIgMy43IDMuNyAyIDggNi4zIDEyLjMgMiAxNCAzLjcgOS43IDh6Ii8+Cjwvc3ZnPgo="},90888:function(n){n.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiI+CiAgPHBhdGggZD0iTTE0IDEyLjNMMTIuMyAxNCA4IDkuNyAzLjcgMTQgMiAxMi4zIDYuMyA4IDIgMy43IDMuNyAyIDggNi4zIDEyLjMgMiAxNCAzLjcgOS43IDh6IiBzdHlsZT0iZmlsbC1vcGFjaXR5OjE7ZmlsbDojZmZmZmZmIi8+Cjwvc3ZnPgo="}},o={};function r(n){var t=o[n];if(void 0!==t)return t.exports;var i=o[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.m=e,r.amdD=function(){throw new Error("define cannot be used indirect")},r.amdO={},n=[],r.O=function(t,e,o,i){if(!e){var a=1/0;for(d=0;d<n.length;d++){e=n[d][0],o=n[d][1],i=n[d][2];for(var c=!0,l=0;l<e.length;l++)(!1&i||a>=i)&&Object.keys(r.O).every((function(n){return r.O[n](e[l])}))?e.splice(l--,1):(c=!1,i<a&&(a=i));if(c){n.splice(d--,1);var s=o();void 0!==s&&(t=s)}}return t}i=i||0;for(var d=n.length;d>0&&n[d-1][2]>i;d--)n[d]=n[d-1];n[d]=[e,o,i]},r.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(t,{a:t}),t},r.d=function(n,t){for(var e in t)r.o(t,e)&&!r.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:t[e]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"==typeof window)return window}}(),r.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},r.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.nmd=function(n){return n.paths=[],n.children||(n.children=[]),n},r.j=5855,function(){r.b=document.baseURI||self.location.href;var n={5855:0};r.O.j=function(t){return 0===n[t]};var t=function(t,e){var o,i,a=e[0],c=e[1],l=e[2],s=0;if(a.some((function(t){return 0!==n[t]}))){for(o in c)r.o(c,o)&&(r.m[o]=c[o]);if(l)var d=l(r)}for(t&&t(e);s<a.length;s++)i=a[s],r.o(n,i)&&n[i]&&n[i][0](),n[i]=0;return r.O(d)},e=self.webpackChunknextcloud=self.webpackChunknextcloud||[];e.forEach(t.bind(null,0)),e.push=t.bind(null,e.push.bind(e))}(),r.nc=void 0;var i=r.O(void 0,[7874],(function(){return r(23105)}));i=r.O(i)}();
  2. //# sourceMappingURL=federatedfilesharing-vue-settings-personal.js.map?v=460f87cfe98c94afc0d8