Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add email social sharing provider #5

Merged
merged 2 commits into from
Apr 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
661 changes: 661 additions & 0 deletions socialsharing_email/LICENSE

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions socialsharing_email/appinfo/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* @copyright 2017, Roeland Jago Douma <roeland@famdouma.nl>
*
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\SocialSharingEmail\AppInfo;

use OCP\Util;

$app = new Application();
$c = $app->getContainer();
$appName = $c->query('AppName');

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

\OC::$server->getEventDispatcher()->addListener('OCA\Files::loadAdditionalScripts', $loadScripts);
15 changes: 15 additions & 0 deletions socialsharing_email/appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<info>
<id>socialsharing_email</id>
<name>Social sharing email</name>
<licence>AGPL</licence>
<author>Roeland Jago Douma</author>
<description>
This allows the user to directly share link shares to email.
</description>
<version>0.0.1</version>
<namespace>SocialSharingEmail</namespace>
<dependencies>
<nextcloud min-version="12" max-version="12" />
</dependencies>
</info>
3 changes: 3 additions & 0 deletions socialsharing_email/css/socialsharingemail.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.icon-social-email {
background-image: url('../img/email.svg');
}
1 change: 1 addition & 0 deletions socialsharing_email/img/email.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions socialsharing_email/js/socialsharingemail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* @copyright 2017, Roeland Jago Douma <roeland@famdouma.nl>
*
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

(function() {
var email = new OC.Share.Social.Model({
key: 'email',
url: 'mailto:?subject=I shared a file with yout&body={{reference}}',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to translate the subject

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmm fair enough but then we have to setup transifex for this app. I suggest to get it in now. And fix it later ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let's fix this later

name: 'Email',
iconClass: 'icon-social-email',
newWindow: false
});
OC.Share.Social.Collection.add(email);
})();
37 changes: 37 additions & 0 deletions socialsharing_email/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* @copyright 2017, Roeland Jago Douma <roeland@famdouma.nl>
*
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\SocialSharingEmail\AppInfo;

use OCP\AppFramework\App;

class Application extends App {

/**
* Constructor
*
* @param array $urlParams
*/
public function __construct(array $urlParams = []) {
parent::__construct('socialsharing_email', $urlParams);
}
}