Skip to content

Commit

Permalink
Merge pull request #37 from nextcloud/refactor/migrate-to-new-18-shar…
Browse files Browse the repository at this point in the history
…ing-2

Comply to 18 new sharing ui
  • Loading branch information
skjnldsv authored Dec 16, 2019
2 parents 853e383 + 931efc9 commit b9f843f
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 55 deletions.
2 changes: 1 addition & 1 deletion socialsharing_diaspora/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<screenshot>https://raw.githubusercontent.com/nextcloud/socialsharing/master/socialsharing_diaspora/screenshots/preview.png</screenshot>
<namespace>SocialSharingDiaspora</namespace>
<dependencies>
<nextcloud min-version="12" max-version="17" />
<nextcloud min-version="18" max-version="18" />
</dependencies>
<bugs>https://github.com/nextcloud/socialsharing</bugs>
<website>https://github.com/nextcloud/socialsharing</website>
Expand Down
2 changes: 1 addition & 1 deletion socialsharing_diaspora/img/diaspora.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 10 additions & 9 deletions socialsharing_diaspora/js/socialsharingdiaspora.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @copyright 2017, Roeland Jago Douma <[email protected]>
*
* @author Roeland Jago Douma <[email protected]>
* @author John Molakvoæ <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
Expand All @@ -20,12 +21,12 @@
*
*/

(function() {
var diaspora = new OC.Share.Social.Model({
key: 'diaspora',
url: 'https://share.diasporafoundation.org/?url={{reference}}',
name: 'Diaspora',
iconClass: 'icon-social-diaspora'
});
OC.Share.Social.Collection.add(diaspora);
})();
window.addEventListener('DOMContentLoaded', () => {
if (OCA.Sharing && OCA.Sharing.ExternalLinkActions) {
OCA.Sharing.ExternalLinkActions.registerAction({
url: link =>`https://share.diasporafoundation.org/?url=${link}`,
name: t('socialsharing_facebook', 'Share to Diaspora'),
icon: 'icon-social-diaspora'
});
}
});
1 change: 0 additions & 1 deletion socialsharing_email/appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

$loadScripts = function() use ($appName) {
Util::addScript($appName, 'socialsharingemail');
Util::addStyle($appName, 'socialsharingemail');
};

\OC::$server->getEventDispatcher()->addListener('OCP\Share::loadSocial', $loadScripts);
Expand Down
2 changes: 1 addition & 1 deletion socialsharing_email/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<screenshot>https://raw.githubusercontent.com/nextcloud/socialsharing/master/socialsharing_email/screenshots/preview.png</screenshot>
<namespace>SocialSharingEmail</namespace>
<dependencies>
<nextcloud min-version="12" max-version="17" />
<nextcloud min-version="18" max-version="18" />
</dependencies>
<bugs>https://github.com/nextcloud/socialsharing</bugs>
<website>https://github.com/nextcloud/socialsharing</website>
Expand Down
3 changes: 0 additions & 3 deletions socialsharing_email/css/socialsharingemail.css

This file was deleted.

1 change: 0 additions & 1 deletion socialsharing_email/img/email.svg

This file was deleted.

22 changes: 10 additions & 12 deletions socialsharing_email/js/socialsharingemail.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @copyright 2017, Roeland Jago Douma <[email protected]>
*
* @author Roeland Jago Douma <[email protected]>
* @author John Molakvoæ <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
Expand All @@ -20,15 +21,12 @@
*
*/

(function() {
var email = new OC.Share.Social.Model({
key: 'email',
url: 'mailto:?subject=' +
t('socialsharing_email' , 'I shared a file with you') +
'&body={{reference}}',
name: 'Email',
iconClass: 'icon-social-email',
newWindow: false
});
OC.Share.Social.Collection.add(email);
})();
window.addEventListener('DOMContentLoaded', () => {
if (OCA.Sharing && OCA.Sharing.ExternalLinkActions) {
OCA.Sharing.ExternalLinkActions.registerAction({
url: link => `mailto:?subject=${t('socialsharing_email', 'I shared a file with you')}&body=${link}`,
name: t('socialsharing_email', 'Share to email'),
icon: 'icon-mail'
});
}
});
2 changes: 1 addition & 1 deletion socialsharing_facebook/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<screenshot>https://raw.githubusercontent.com/nextcloud/socialsharing/master/socialsharing_facebook/screenshots/preview.png</screenshot>
<namespace>SocialSharingFacebook</namespace>
<dependencies>
<nextcloud min-version="12" max-version="17" />
<nextcloud min-version="18" max-version="18" />
</dependencies>
<bugs>https://github.com/nextcloud/socialsharing</bugs>
<website>https://github.com/nextcloud/socialsharing</website>
Expand Down
3 changes: 1 addition & 2 deletions socialsharing_facebook/img/facebook.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 10 additions & 9 deletions socialsharing_facebook/js/socialsharingfacebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @copyright 2017, Roeland Jago Douma <[email protected]>
*
* @author Roeland Jago Douma <[email protected]>
* @author John Molakvoæ <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
Expand All @@ -20,12 +21,12 @@
*
*/

(function() {
var facebook = new OC.Share.Social.Model({
key: 'facebook',
url: 'https://www.facebook.com/sharer/sharer.php?u={{reference}}',
name: 'Facebook',
iconClass: 'icon-social-facebook'
});
OC.Share.Social.Collection.add(facebook);
})();
window.addEventListener('DOMContentLoaded', () => {
if (OCA.Sharing && OCA.Sharing.ExternalLinkActions) {
OCA.Sharing.ExternalLinkActions.registerAction({
url: link => `https://www.facebook.com/sharer/sharer.php?u=${link}`,
name: t('socialsharing_facebook', 'Share to Facebook'),
icon: 'icon-social-facebook'
});
}
});
2 changes: 1 addition & 1 deletion socialsharing_twitter/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<screenshot>https://raw.githubusercontent.com/nextcloud/socialsharing/master/socialsharing_twitter/screenshots/preview.png</screenshot>
<namespace>SocialSharingTwitter</namespace>
<dependencies>
<nextcloud min-version="12" max-version="17" />
<nextcloud min-version="18" max-version="18" />
</dependencies>
<bugs>https://github.com/nextcloud/socialsharing</bugs>
<website>https://github.com/nextcloud/socialsharing</website>
Expand Down
5 changes: 1 addition & 4 deletions socialsharing_twitter/img/twitter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 10 additions & 9 deletions socialsharing_twitter/js/socialsharingtwitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @copyright 2017, Roeland Jago Douma <[email protected]>
*
* @author Roeland Jago Douma <[email protected]>
* @author John Molakvoæ <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
Expand All @@ -20,12 +21,12 @@
*
*/

(function() {
var twitter = new OC.Share.Social.Model({
key: 'twitter',
url: 'https://twitter.com/intent/tweet?url={{reference}}',
name: 'Twitter',
iconClass: 'icon-social-twitter'
});
OC.Share.Social.Collection.add(twitter);
})();
window.addEventListener('DOMContentLoaded', () => {
if (OCA.Sharing && OCA.Sharing.ExternalLinkActions) {
OCA.Sharing.ExternalLinkActions.registerAction({
url: link => `https://twitter.com/intent/tweet?url=${link}`,
name: t('socialsharing_facebook', 'Share to Twitter'),
icon: 'icon-social-twitter'
});
}
});

0 comments on commit b9f843f

Please sign in to comment.