Commit 73d36e3a authored by Gyuris Szabolcs's avatar Gyuris Szabolcs

ver. 0.1

parent c1918435
content cloudfile-seafile chrome/content/
locale cloudfile-seafile en-US chrome/locales/en-US/
skin cloudfile-seafile classic/1.0 chrome/skin/
component {57c44a6d-2ffd-4554-8a57-a592f8361176} components/nsSeaFile.js
contract @mozilla.org/mail/cloudfile-seafile;1 {57c44a6d-2ffd-4554-8a57-a592f8361176}
category cloud-files SeaFile @mozilla.org/mail/cloudfile-seafile;1
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Based on: https://mxr.mozilla.org/comm-central/source/mail/components/cloudfile/content/YouSendIt/management.js
* Edited by Szabolcs Gyuris (szimszon at oregpreshaz dot eu)
*/
function onLoadProvider(provider) {
let messenger = Components.classes["@mozilla.org/messenger;1"]
.createInstance(Components.interfaces.nsIMessenger);
let repoName = document.getElementById("repo-name");
repoName.textContent = provider.repoName;
let fileSpaceUsed = document.getElementById("file-space-used");
fileSpaceUsed.textContent = messenger.formatFileSize(provider.fileSpaceUsed);
let fileSpaceUsedSwatch = document.getElementById("file-space-used-swatch");
fileSpaceUsedSwatch.style.backgroundColor = pv.Colors.category20.values[0];
let remainingFileSpace = document.getElementById("remaining-file-space");
remainingFileSpace.textContent = messenger.formatFileSize(
provider.remainingFileSpace);
let remainingFileSpaceSwatch = document.getElementById("remaining-file-space-swatch");
remainingFileSpaceSwatch.style.backgroundColor = pv.Colors.category20.values[1];
let totalSpace = provider.fileSpaceUsed + provider.remainingFileSpace;
let pieScale = 2 * Math.PI / totalSpace;
let spaceDiv = document.getElementById("provider-space-visuals");
let vis = new pv.Panel().canvas(spaceDiv)
.width(150)
.height(150);
vis.add(pv.Wedge)
.data([provider.fileSpaceUsed, provider.remainingFileSpace])
.left(75)
.top(75)
.innerRadius(30)
.outerRadius(65)
.angle(function(d) d * pieScale);
vis.add(pv.Label)
.left(75)
.top(75)
.font("14px Sans-Serif")
.textAlign("center")
.textBaseline("middle")
.text(messenger.formatFileSize(totalSpace));
vis.render();
}
<?xml version="1.0" encoding="UTF-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
- https://mxr.mozilla.org/comm-central/source/mail/components/cloudfile/content/YouSendIt/management.xhtml
- Edited by Szabolcs Gyuris (szimszon at oregpreshaz dot eu)-->
<!DOCTYPE html [
<!ENTITY % htmlDTD PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> %htmlDTD;
<!ENTITY % managementDTD SYSTEM "chrome://messenger/locale/cloudfile/management.dtd"> %managementDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="application/javascript;version=1.8"
src="chrome://messenger/content/protovis-r2.6-modded.js"/>
<script type="text/javascript;version=1.8"
src="chrome://cloudfile-seafile/content/management.js"/>
<link rel="stylesheet"
type="text/css"
href="chrome://messenger/skin/preferences/preferences.css" />
</head>
<body id="provider-management">
<div id="provider-header">
<div id="provider-terms">
</div>
<div id="provider-name">
<h1>SeaFile</h1>
<div id="repo-name"></div>
</div>
</div>
<div id="provider-spacebox">
<div id="provider-space-visuals"></div>
<div id="provider-space">
<div>
<label>&cloudfileMgmt.usedSpace;</label>
<span id="file-space-used"/>
<span id="file-space-used-swatch" class="space-swatch"/>
</div>
<div>
<label>&cloudfileMgmt.unusedSpace;</label>
<span id="remaining-file-space"/>
<span id="remaining-file-space-swatch" class="space-swatch"/>
</div>
</div>
</div>
</body>
</html>
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
* Based on https://mxr.mozilla.org/comm-central/source/mail/components/cloudfile/content/YouSendIt/settings.js
* Edited by Szabolcs Gyuris (szimszon at oregpreshaz dot eu)
*/
function extraArgs() {
var usernameValue = document.getElementById("username").value.trim();
var baseURL = document.getElementById("baseURL").value.trim();
if (baseURL && baseURL[baseURL.length - 1] != '/') {
baseURL += "/";
}
var libraryValue = document.getElementById("library").value.trim();
return {
"baseURL": { type: "char", value: baseURL },
"username": { type: "char", value: usernameValue },
"library": { type: "char", value: libraryValue },
};
}
<?xml version="1.0" encoding="UTF-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
- Edited by Szabolcs Gyuris (szimszon at oregpreshaz dot eu) -->
<!DOCTYPE html [
<!ENTITY % htmlDTD PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> %htmlDTD;
<!ENTITY % seafileDTD SYSTEM "chrome://cloudfile-seafile/locale/settings.dtd"> %seafileDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script type="application/javascript"
src="chrome://cloudfile-seafile/content/settings.js"/>
<link rel="stylesheet"
type="text/css"
href="chrome://messenger/skin/cloudfile/addAccountDialog.css" />
</head>
<body id="provider-settings">
<form id="provider-form" onsubmit="return false;">
<label for="baseURL">&SeaFileSettings.baseURL;</label>
<input id="baseURL" type="text" required="true"/>
<label for="username">&SeaFileSettings.username;</label>
<input id="username" type="text" required="true"/>
<label for="library">&SeaFileSettings.library;</label>
<input id="library" type="text" required="true"/>
<label>&SeaFileSettings.description;</label>
</form>
</body>
</html>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
- Edited by Szabolcs Gyuris (szimszon at oregpreshaz dot eu) -->
<!ENTITY SeaFileSettings.baseURL "Service Location (e.g. https://seafile.example.com/)">
<!ENTITY SeaFileSettings.username "Username">
<!ENTITY SeaFileSettings.library "Library">
<!ENTITY SeaFileSettings.description "The service location is the URL used for uploading attachments, with all subfolders. The public location specifies the location where the files are publicly reachable. If not specified, the service location will be used instead.">
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/.
- Edited by Szabolcs Gyuris (szimszon at oregpreshaz dot eu) -->
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>cloudfile-seafile@oregpreshaz.eu</em:id>
<em:version>0.1</em:version>
<em:type>2</em:type>
<!-- Target Application this extension can install into,
with minimum and maximum supported versions. -->
<em:targetApplication>
<Description>
<!-- Thunderbird -->
<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
<em:minVersion>14.0</em:minVersion>
<em:maxVersion>24.*</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Front End MetaData -->
<em:name>SeaFile for Filelink</em:name>
<em:description>Adds the possibility to use a SeaFile store for Filelink</em:description>
<em:creator>Szabolcs Gyuris</em:creator>
<em:homepageURL>http://oregpreshaz.eu/</em:homepageURL>
<em:contributor></em:contributor>
<em:iconURL>chrome://cloudfile-seafile/skin/seafile_32.png</em:iconURL>
<!--
<em:localized>
<Description>
<em:locale>de</em:locale>
<em:name>SeaFile für Filelink</em:name>
<em:description>Ermöglicht es, ein SeaFile Dienst für Filelink zu verwenden</em:description>
<em:translator>Philipp Kewisch</em:translator>
</Description>
</em:localized>
<em:localized>
<Description>
<em:locale>es-ES</em:locale>
<em:name>SeaFile para Filelink</em:name>
<em:description>Añade la posibilidad de usar una tienda de SeaFile para FileLink</em:description>
</Description>
</em:localized>
-->
</Description>
</RDF>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment