Skip to content

Commit

Permalink
Merge pull request #5 from nextcloud/email
Browse files Browse the repository at this point in the history
Add email social sharing provider
  • Loading branch information
MorrisJobke authored Apr 20, 2017
2 parents a1157ab + e7eb8bd commit a6feb3f
Show file tree
Hide file tree
Showing 7 changed files with 785 additions and 0 deletions.
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}}',
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);
}
}

0 comments on commit a6feb3f

Please sign in to comment.