restructuring

This commit is contained in:
Florian Dold 2016-11-13 23:30:18 +01:00
parent 200d83c388
commit f3fb8be7db
83 changed files with 548 additions and 67143 deletions

28
.gitignore vendored
View File

@ -1,24 +1,16 @@
lib/**/*.js.map
background/**/*.js.map
popup/**/*.js.map
pages/**/*.js.map
pogen/**/*.js.map
test/**/*.js.map
content_scripts/**/*.js.map
testlib/**/*.js.map
src/**/*.js.map
src/**/*.js
!src/content_scripts/*.js
!src/module-trampoline.js
testlib/talertest.js
background/*.js
pogen/*.js
test/*.js
lib/wallet/*.js
pages/*.js
content_scripts/*.js
lib/*.js
!lib/module-trampoline.js
popup/*.js
test/tests/*.js
testlib/talertest.js.map
build/
.idea/
taler-wallet-*.tar.gz
taler-wallet-*.directive
taler-wallet-*.directive.asc

View File

@ -1,13 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script src="../lib/vendor/URI.js"></script>
<script src="../lib/vendor/system-csp-production.src.js"></script>
<script src="main.js"></script>
<meta charset="UTF-8">
<title>(wallet bg page)</title>
</head>
<body>
<img id="taler-logo" src="../img/icon.png">
</body>
</html>

View File

@ -1 +0,0 @@
../content_scripts

View File

@ -1 +0,0 @@
../lib

View File

@ -50,39 +50,31 @@ const vfs = require('vinyl-fs');
const paths = {
ts: {
release: [
"lib/**/*.{ts,tsx}",
"background/*.{ts,tsx}",
"content_scripts/*.{ts,tsx}",
"popup/*.{ts,tsx}",
"pages/*.{ts,tsx}",
"!**/*.d.ts",
"!**/*-test*.ts",
src: [
"src/**/*.{ts,tsx}",
"!src/**/*-test*.ts",
],
decl: [
"lib/refs.d.ts",
"decl/lib.es6.d.ts",
"decl/urijs/URIjs.d.ts",
"decl/systemjs/systemjs.d.ts",
"decl/react-global.d.ts",
"decl/chrome/chrome.d.ts",
],
dev: [
test: [
"testlib/**/.ts",
"**/*-test*.ts",
"src/**/*-test*.ts",
],
},
dist: [
"img/icon.png",
"img/logo.png",
"i18n/strings.js",
"lib/emscripten/taler-emscripten-lib.js",
"lib/module-trampoline.js",
"lib/vendor/*.js",
"style/*.css",
"popup/**/*.{html,css}",
"pages/**/*.{html,css}",
"background/*.html",
"src/**/*.{js,css,html}",
],
extra: [
"i18n/*.po",
"i18n/*.pot",
"lib/**/*.d.ts",
"src/i18n/*.po",
"src/i18n/*.pot",
"decl/**/*.d.ts",
"AUTHORS",
"README",
"COPYING",
@ -98,30 +90,6 @@ const paths = {
// targets other than "srcdist".
"manifest.json",
],
/* French copyright application */
appdist: [
"i18n/*.po",
"i18n/*.pot",
"style/*.css",
"img/**",
"lib/**/*.{ts,tsx}",
"!lib/vendor/*",
"!**/*.d.ts",
"background/*.{ts,tsx}",
"content_scripts/*.{ts,tsx}",
"popup/*.{ts,tsx}",
"pages/*.{ts,tsx}",
"AUTHORS",
"README",
"COPYING",
"Makefile",
"gulpfile.js",
"test/tests/*.{ts,tsx}",
"pogen/pogen.ts",
"lib/module-trampoline.js",
"popup/**/*.{html,css}",
"pages/**/*.{html,css}",
],
};
@ -140,37 +108,7 @@ const tsBaseArgs = {
};
let manifest;
(() => {
const f = fs.readFileSync("manifest.json", "utf8");
manifest = JSON.parse(f);
})();
/**
* File globbing that works just like
* gulp.src(...).
*/
function gglob(ps) {
let patPos = [];
let patNeg = [];
for (let x of ps) {
if (x.slice(0,1) === "!") {
patNeg.push(x.slice(1));
} else {
patPos.push(x);
console.log("Pattern", x);
}
}
let result = new Set();
for (let pat of patPos) {
let rs = glob.sync(pat, {ignore: patNeg});
for (let r of rs) {
result.add(r);
}
}
return Array.from(result);
}
const manifest = JSON.parse(fs.readFileSync("manifest.json", "utf8"));
// Concatenate node streams,
@ -178,7 +116,7 @@ function gglob(ps) {
function concatStreams (/*streams...*/) {
var toMerge = [].slice.call(arguments);
if (toMerge.length === 1 && (toMerge[0] instanceof Array)) {
toMerge = toMerge[0]; //handle array as arguments object
toMerge = toMerge[0]; // handle array as arguments object
}
var stream = new Stream();
stream.setMaxListeners(0); // allow adding more than 11 streams
@ -228,7 +166,7 @@ gulp.task("compile-prod", ["clean"], function () {
tsArgs.sourceMap = undefined;
let opts = {base: "."};
const files = concatStreams(
gulp.src(paths.ts.release, opts),
gulp.src(paths.ts.src, opts),
gulp.src(paths.ts.decl, opts));
return files
@ -284,9 +222,9 @@ gulp.task("srcdist", [], function () {
const opts = {buffer: false, stripBOM: false, base: "."};
// We can't just concat patterns due to exclude patterns
const files = concatStreams(
gulp.src(paths.ts.release, opts),
gulp.src(paths.ts.src, opts),
gulp.src(paths.ts.decl, opts),
gulp.src(paths.ts.dev, opts),
gulp.src(paths.ts.test, opts),
gulp.src(paths.dist, opts),
gulp.src(paths.extra, opts));
@ -298,18 +236,6 @@ gulp.task("srcdist", [], function () {
});
/**
* Create source distribution for
* French copyright application.
*/
gulp.task("appdist", [], function () {
let zipname = String.prototype.concat("taler-wallet-webex-", manifest.version_name, "-appsrc.zip");
return gulp.src(paths.appdist, {buffer: false, stripBOM: false, base: "."})
.pipe(zip(zipname))
.pipe(gulp.dest("."));
});
/**
* Compile po extraction script.
*/
@ -360,9 +286,9 @@ function tsconfig(confBase) {
gulp.task("tsconfig", function() {
let opts = {base: "."};
const files = concatStreams(
gulp.src(paths.ts.release, opts),
gulp.src(paths.ts.dev, opts),
gulp.src(paths.ts.decl, opts));
vfs.src(paths.ts.src, opts),
vfs.src(paths.ts.test, opts),
vfs.src(paths.ts.decl, opts));
return files.pipe(tsconfig(tsBaseArgs))
.pipe(gulp.dest("."));
});

View File

@ -1,3 +0,0 @@
if (!window.i18n) {
throw Error("Module loading order incorrect, please load i18n module before loading i18n-strings");
}

View File

@ -1,7 +0,0 @@
if (!window.i18n) {
throw Error("Module loading order incorrect, please load i18n module before loading i18n-strings");
}
i18n.strings['de'] = {"domain":"de","locale_data":{"de":{"":{"domain":"de","plural_forms":"nplurals=2; plural=(n != 1);","lang":""},"%1$s\n wants to enter a contract over %2$s\n with you.":["%1$s\n möchte einen Vertrag über %2$s\n mit Ihnen abschließen."],"You are about to purchase:":["Sie sind dabei, Folgendes zu kaufen:"],"You have insufficient funds of the requested currency in your wallet.":[""],"Error: URL is empty":[""],"Error: URL may not be relative":[""],"Error: could not retrieve balance information.":[""],"Bank requested reserve (%1$s) for %2$s.":["Bank bestätig anlegen der Reserve (%1$s) bei %2$s"],"Started to withdraw %1$s from %2$s (%3$s).":[""],"Merchant %1$s offered contract %2$s.":[""],"Withdrew %1$s from %2$s (%3$s).":["Reserve (%1$s) mit %2$s bei %3$s erzeugt"],"Paid %1$s to merchant %2$s. (%3$s)":[""],"Error: could not retrieve event history":[""],"Your wallet has no events recorded.":["Ihre Geldbörse verzeichnet keine Vorkommnisse."]}}};
i18n.strings['en-US'] = {"domain":"en-US","locale_data":{"en-US":{"":{"domain":"en-US","plural_forms":"nplurals=2; plural=(n != 1);","lang":""},"%1$s\n wants to enter a contract over %2$s\n with you.":[""],"You are about to purchase:":[""],"You have insufficient funds of the requested currency in your wallet.":[""],"Error: URL is empty":[""],"Error: URL may not be relative":[""],"Error: could not retrieve balance information.":[""],"Bank requested reserve (%1$s) for %2$s.":[""],"Started to withdraw %1$s from %2$s (%3$s).":[""],"Merchant %1$s offered contract %2$s.":[""],"Withdrew %1$s from %2$s (%3$s).":[""],"Paid %1$s to merchant %2$s. (%3$s)":[""],"Error: could not retrieve event history":[""],"Your wallet has no events recorded.":[""]}}};
i18n.strings['fr'] = {"domain":"fr","locale_data":{"fr":{"":{"domain":"fr","plural_forms":"nplurals=2; plural=(n != 1);","lang":""},"%1$s\n wants to enter a contract over %2$s\n with you.":[""],"You are about to purchase:":[""],"You have insufficient funds of the requested currency in your wallet.":[""],"Error: URL is empty":[""],"Error: URL may not be relative":[""],"Error: could not retrieve balance information.":[""],"Bank requested reserve (%1$s) for %2$s.":[""],"Started to withdraw %1$s from %2$s (%3$s).":[""],"Merchant %1$s offered contract %2$s.":[""],"Withdrew %1$s from %2$s (%3$s).":[""],"Paid %1$s to merchant %2$s. (%3$s)":[""],"Error: could not retrieve event history":[""],"Your wallet has no events recorded.":[""]}}};
i18n.strings['it'] = {"domain":"it","locale_data":{"it":{"":{"domain":"it","plural_forms":"nplurals=2; plural=(n != 1);","lang":""},"%1$s\n wants to enter a contract over %2$s\n with you.":[""],"You are about to purchase:":[""],"You have insufficient funds of the requested currency in your wallet.":[""],"Error: URL is empty":[""],"Error: URL may not be relative":[""],"Error: could not retrieve balance information.":[""],"Bank requested reserve (%1$s) for %2$s.":[""],"Started to withdraw %1$s from %2$s (%3$s).":[""],"Merchant %1$s offered contract %2$s.":[""],"Withdrew %1$s from %2$s (%3$s).":[""],"Paid %1$s to merchant %2$s. (%3$s)":[""],"Error: could not retrieve event history":[""],"Your wallet has no events recorded.":[""]}}};

File diff suppressed because it is too large Load Diff

View File

@ -1,548 +0,0 @@
// Type definitions for File System API
// Project: http://www.w3.org/TR/file-system-api/
// Definitions by: Kon <http://phyzkit.net/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../filewriter/filewriter.d.ts" />
interface LocalFileSystem {
/**
* Used for storage with no guarantee of persistence.
*/
TEMPORARY:number;
/**
* Used for storage that should not be removed by the user agent without application or user permission.
*/
PERSISTENT:number;
/**
* Requests a filesystem in which to store application data.
* @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT.
* @param size This is an indicator of how much storage space, in bytes, the application expects to need.
* @param successCallback The callback that is called when the user agent provides a filesystem.
* @param errorCallback A callback that is called when errors happen, or when the request to obtain the filesystem is denied.
*/
requestFileSystem(type:number, size:number, successCallback:FileSystemCallback, errorCallback?:ErrorCallback):void;
/**
* Allows the user to look up the Entry for a file or directory referred to by a local URL.
* @param url A URL referring to a local file in a filesystem accessable via this API.
* @param successCallback A callback that is called to report the Entry to which the supplied URL refers.
* @param errorCallback A callback that is called when errors happen, or when the request to obtain the Entry is denied.
*/
resolveLocalFileSystemURL(url:string, successCallback:EntryCallback, errorCallback?:ErrorCallback):void;
/**
* see requestFileSystem.
*/
webkitRequestFileSystem(type:number, size:number, successCallback:FileSystemCallback, errorCallback?:ErrorCallback):void;
}
interface LocalFileSystemSync {
/**
* Used for storage with no guarantee of persistence.
*/
TEMPORARY:number;
/**
* Used for storage that should not be removed by the user agent without application or user permission.
*/
PERSISTENT:number;
/**
* Requests a filesystem in which to store application data.
* @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT.
* @param size This is an indicator of how much storage space, in bytes, the application expects to need.
*/
requestFileSystemSync(type:number, size:number):FileSystemSync;
/**
* Allows the user to look up the Entry for a file or directory referred to by a local URL.
* @param url A URL referring to a local file in a filesystem accessable via this API.
*/
resolveLocalFileSystemSyncURL(url:string):EntrySync;
/**
* see requestFileSystemSync
*/
webkitRequestFileSystemSync(type:number, size:number):FileSystemSync;
}
interface Metadata {
/**
* This is the time at which the file or directory was last modified.
* @readonly
*/
modificationTime:Date;
/**
* The size of the file, in bytes. This must return 0 for directories.
* @readonly
*/
size:number;
}
interface Flags {
/**
* Used to indicate that the user wants to create a file or directory if it was not previously there.
*/
create?:boolean;
/**
* By itself, exclusive must have no effect. Used with create, it must cause getFile and getDirectory to fail if the target path already exists.
*/
exclusive?:boolean;
}
/**
* This interface represents a file system.
*/
interface FileSystem{
/**
* This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems.
* @readonly
*/
name: string;
/**
* The root directory of the file system.
* @readonly
*/
root: DirectoryEntry;
}
interface Entry {
/**
* Entry is a file.
*/
isFile:boolean;
/**
* Entry is a directory.
*/
isDirectory:boolean;
/**
* Look up metadata about this entry.
* @param successCallback A callback that is called with the time of the last modification.
* @param errorCallback ErrorCallback A callback that is called when errors happen.
*/
getMetadata(successCallback:MetadataCallback, errorCallback?:ErrorCallback):void;
/**
* The name of the entry, excluding the path leading to it.
*/
name:string;
/**
* The full absolute path from the root to the entry.
*/
fullPath:string;
/**
* The file system on which the entry resides.
*/
filesystem:FileSystem;
/**
* Move an entry to a different location on the file system. It is an error to try to:
*
* <ui>
* <li>move a directory inside itself or to any child at any depth;</li>
* <li>move an entry into its parent if a name different from its current one isn't provided;</li>
* <li>move a file to a path occupied by a directory;</li>
* <li>move a directory to a path occupied by a file;</li>
* <li>move any element to a path occupied by a directory which is not empty.</li>
* <ul>
*
* A move of a file on top of an existing file must attempt to delete and replace that file.
* A move of a directory on top of an existing empty directory must attempt to delete and replace that directory.
*/
moveTo(parent:DirectoryEntry, newName?:string, successCallback?:EntryCallback, errorCallback?:ErrorCallback):string;
/**
* Copy an entry to a different location on the file system. It is an error to try to:
*
* <ul>
* <li> copy a directory inside itself or to any child at any depth;</li>
* <li> copy an entry into its parent if a name different from its current one isn't provided;</li>
* <li> copy a file to a path occupied by a directory;</li>
* <li> copy a directory to a path occupied by a file;</li>
* <li> copy any element to a path occupied by a directory which is not empty.</li>
* <li> A copy of a file on top of an existing file must attempt to delete and replace that file.</li>
* <li> A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory.</li>
* </ul>
*
* Directory copies are always recursive--that is, they copy all contents of the directory.
*/
copyTo(parent:DirectoryEntry, newName?:string, successCallback?:EntryCallback, errorCallback?:ErrorCallback):string;
/**
* Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists.
*/
toURL():string;
/**
* Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
* @param successCallback A callback that is called on success.
* @param errorCallback A callback that is called when errors happen.
*/
remove(successCallback:VoidCallback, errorCallback?:ErrorCallback):void;
/**
* Look up the parent DirectoryEntry containing this Entry. If this Entry is the root of its filesystem, its parent is itself.
* @param successCallback A callback that is called to return the parent Entry.
* @param errorCallback A callback that is called when errors happen.
*/
getParent(successCallback:DirectoryEntryCallback, errorCallback?:ErrorCallback):void;
}
/**
* This interface represents a directory on a file system.
*/
interface DirectoryEntry extends Entry {
/**
* Creates a new DirectoryReader to read Entries from this Directory.
*/
createReader():DirectoryReader;
/**
* Creates or looks up a file.
* @param path Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.
* @param options
* <ul>
* <li>If create and exclusive are both true, and the path already exists, getFile must fail.</li>
* <li>If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.</li>
* <li>If create is not true and the path doesn't exist, getFile must fail.</li>
* <li>If create is not true and the path exists, but is a directory, getFile must fail.</li>
* <li>Otherwise, if no other error occurs, getFile must return a FileEntry corresponding to path.</li>
* </ul>
* @param successCallback A callback that is called to return the File selected or created.
* @param errorCallback A callback that is called when errors happen.
*/
getFile(path:string, options?:Flags, successCallback?:FileEntryCallback, errorCallback?:ErrorCallback):void;
/**
* Creates or looks up a directory.
* @param path Either an absolute path or a relative path from this DirectoryEntry to the directory to be looked up or created. It is an error to attempt to create a directory whose immediate parent does not yet exist.
* @param options
* <ul>
* <li>If create and exclusive are both true and the path already exists, getDirectory must fail.</li>
* <li>If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.</li>
* <li>If create is not true and the path doesn't exist, getDirectory must fail.</li>
* <li>If create is not true and the path exists, but is a file, getDirectory must fail.</li>
* <li>Otherwise, if no other error occurs, getDirectory must return a DirectoryEntry corresponding to path.</li>
* </ul>
* @param successCallback A callback that is called to return the DirectoryEntry selected or created.
* @param errorCallback A callback that is called when errors happen.
*
*/
getDirectory(path:string, options?:Flags, successCallback?:DirectoryEntryCallback, errorCallback?:ErrorCallback):void;
/**
* Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem.
* @param successCallback A callback that is called on success.
* @param errorCallback A callback that is called when errors happen.
*/
removeRecursively(successCallback:VoidCallback, errorCallback?:ErrorCallback):void;
}
/**
* This interface lets a user list files and directories in a directory. If there are no additions to or deletions from a directory between the first and last call to readEntries, and no errors occur, then:
* <ul>
* <li> A series of calls to readEntries must return each entry in the directory exactly once.</li>
* <li> Once all entries have been returned, the next call to readEntries must produce an empty array.</li>
* <li> If not all entries have been returned, the array produced by readEntries must not be empty.</li>
* <li> The entries produced by readEntries must not include the directory itself ["."] or its parent [".."].</li>
* </ul>
*/
interface DirectoryReader {
/**
* Read the next block of entries from this directory.
* @param successCallback Called once per successful call to readEntries to deliver the next previously-unreported set of Entries in the associated Directory. If all Entries have already been returned from previous invocations of readEntries, successCallback must be called with a zero-length array as an argument.
* @param errorCallback A callback indicating that there was an error reading from the Directory.
*/
readEntries(successCallback:EntriesCallback, errorCallback?:ErrorCallback):void;
}
/**
* This interface represents a file on a file system.
*/
interface FileEntry extends Entry {
/**
* Creates a new FileWriter associated with the file that this FileEntry represents.
* @param successCallback A callback that is called with the new FileWriter.
* @param errorCallback A callback that is called when errors happen.
*/
createWriter(successCallback:FileWriterCallback, errorCallback?:ErrorCallback):void;
/**
* Returns a File that represents the current state of the file that this FileEntry represents.
* @param successCallback A callback that is called with the File.
* @param errorCallback A callback that is called when errors happen.
*/
file(successCallback:FileCallback, errorCallback?:ErrorCallback):void;
}
/**
* When requestFileSystem() succeeds, the following callback is made.
*/
interface FileSystemCallback {
/**
* @param filesystem The file systems to which the app is granted access.
*/
(filesystem:FileSystem):void;
}
/**
* This interface is the callback used to look up Entry objects.
*/
interface EntryCallback {
/**
* @param entry
*/
(entry:Entry):void;
}
/**
* This interface is the callback used to look up FileEntry objects.
*/
interface FileEntryCallback {
/**
* @param entry
*/
(entry:FileEntry):void;
}
/**
* This interface is the callback used to look up DirectoryEntry objects.
*/
interface DirectoryEntryCallback {
/**
* @param entry
*/
(entry:DirectoryEntry):void;
}
/**
* When readEntries() succeeds, the following callback is made.
*/
interface EntriesCallback {
(entries:Entry[]):void;
}
/**
* This interface is the callback used to look up file and directory metadata.
*/
interface MetadataCallback {
(metadata:Metadata):void;
}
/**
* This interface is the callback used to create a FileWriter.
*/
interface FileWriterCallback {
(fileWriter:FileWriter):void;
}
/**
* This interface is the callback used to obtain a File.
*/
interface FileCallback {
(file:File):void;
}
/**
* This interface is the generic callback used to indicate success of an asynchronous method.
*/
interface VoidCallback {
():void;
}
/**
* When an error occurs, the following callback is made.
*/
interface ErrorCallback {
(err:DOMError):void;
}
/**
* This interface represents a file system.
*/
interface FileSystemSync {
/**
* This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems.
*/
name:string;
/**
* root The root directory of the file system.
*/
root:DirectoryEntrySync;
}
/**
* An abstract interface representing entries in a file system, each of which may be a FileEntrySync or DirectoryEntrySync.
*/
interface EntrySync{
/**
* EntrySync is a file.
* @readonly
*/
isFile:boolean;
/**
* EntrySync is a directory.
* @readonly
*/
isDirectory:boolean;
/**
* Look up metadata about this entry.
*/
getMetadata():Metadata;
/**
* The name of the entry, excluding the path leading to it.
*/
name:string;
/**
* The full absolute path from the root to the entry.
*/
fullPath:string;
/**
* The file system on which the entry resides.
*/
filesystem:FileSystemSync;
/**
* Move an entry to a different location on the file system. It is an error to try to:
* <ul>
* <li> move a directory inside itself or to any child at any depth;</li>
* <li> move an entry into its parent if a name different from its current one isn't provided;</li>
* <li> move a file to a path occupied by a directory;</li>
* <li> move a directory to a path occupied by a file;</li>
* <li> move any element to a path occupied by a directory which is not empty.</li>
* </ui>
* A move of a file on top of an existing file must attempt to delete and replace that file. A move of a directory on top of an existing empty directory must attempt to delete and replace that directory.
* @param parent The directory to which to move the entry.
* @param newName The new name of the entry. Defaults to the EntrySync's current name if unspecified.
*/
moveTo(parent:DirectoryEntrySync, newName?:string):EntrySync;
/**
* Copy an entry to a different location on the file system. It is an error to try to:
* <ul>
* <li> copy a directory inside itself or to any child at any depth;</li>
* <li> copy an entry into its parent if a name different from its current one isn't provided;</li>
* <li> copy a file to a path occupied by a directory;</li>
* <li> copy a directory to a path occupied by a file;</li>
* <li> copy any element to a path occupied by a directory which is not empty.</li>
* </ui>
* A copy of a file on top of an existing file must attempt to delete and replace that file.
* A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory.
* Directory copies are always recursive--that is, they copy all contents of the directory.
*/
copyTo(parent:DirectoryEntrySync, newName?:string):EntrySync;
/**
* Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists.
*/
toURL():string;
/**
* Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
*/
remove ():void;
/**
* Look up the parent DirectoryEntrySync containing this Entry. If this EntrySync is the root of its filesystem, its parent is itself.
*/
getParent():DirectoryEntrySync;
}
/**
* This interface represents a directory on a file system.
*/
interface DirectoryEntrySync extends EntrySync {
/**
* Creates a new DirectoryReaderSync to read EntrySyncs from this DirectorySync.
*/
createReader():DirectoryReaderSync;
/**
* Creates or looks up a directory.
* @param path Either an absolute path or a relative path from this DirectoryEntrySync to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.
* @param options
* <ul>
* <li> If create and exclusive are both true and the path already exists, getFile must fail.</li>
* <li> If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.</li>
* <li> If create is not true and the path doesn't exist, getFile must fail.</li>
* <li> If create is not true and the path exists, but is a directory, getFile must fail.</li>
* <li> Otherwise, if no other error occurs, getFile must return a FileEntrySync corresponding to path.</li>
* </ul>
*/
getFile(path:string, options?:Flags):FileEntrySync;
/**
* Creates or looks up a directory.
* @param path Either an absolute path or a relative path from this DirectoryEntrySync to the directory to be looked up or created. It is an error to attempt to create a directory whose immediate parent does not yet exist.
* @param options
* <ul>
* <li> If create and exclusive are both true and the path already exists, getDirectory must fail.</li>
* <li> If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.</li>
* <li> If create is not true and the path doesn't exist, getDirectory must fail.</li>
* <li> If create is not true and the path exists, but is a file, getDirectory must fail.</li>
* <li> Otherwise, if no other error occurs, getDirectory must return a DirectoryEntrySync corresponding to path.</li>
* </ul>
*/
getDirectory(path:string, options?:Flags):DirectoryEntrySync;
/**
* Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem.
*/
removeRecursively():void;
}
/**
* This interface lets a user list files and directories in a directory. If there are no additions to or deletions from a directory between the first and last call to readEntries, and no errors occur, then:
* <ul>
* <li> A series of calls to readEntries must return each entry in the directory exactly once.</li>
* <li> Once all entries have been returned, the next call to readEntries must produce an empty array.</li>
* <li> If not all entries have been returned, the array produced by readEntries must not be empty.</li>
* <li> The entries produced by readEntries must not include the directory itself ["."] or its parent [".."].</li>
* </ul>
*/
interface DirectoryReaderSync {
/**
* Read the next block of entries from this directory.
*/
readEntries():EntrySync[];
}
/**
* This interface represents a file on a file system.
*/
interface FileEntrySync extends EntrySync {
/**
* Creates a new FileWriterSync associated with the file that this FileEntrySync represents.
*/
createWriter():FileWriterSync;
/**
* Returns a File that represents the current state of the file that this FileEntrySync represents.
*/
file():File;
}
interface Window extends LocalFileSystem, LocalFileSystemSync{
}
interface WorkerGlobalScope extends LocalFileSystem, LocalFileSystemSync{
}

View File

@ -1,176 +0,0 @@
// Type definitions for File API: Writer
// Project: http://www.w3.org/TR/file-writer-api/
// Definitions by: Kon <http://phyzkit.net/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/**
* This interface provides methods to monitor the asynchronous writing of blobs to disk using progress events [PROGRESS-EVENTS] and event handler attributes.
* This interface is specified to be used within the context of the global object (Window [HTML5]) and within Web Workers (WorkerUtils [WEBWORKERS-ED]).
*/
interface FileSaver extends EventTarget {
/**
* When the abort method is called, user agents must run the steps below:
* <ol>
* <li> If readyState == DONE or readyState == INIT, terminate this overall series of steps without doing anything else. </li>
* <li> Set readyState to DONE. </li>
* <li> If there are any tasks from the object's FileSaver task source in one of the task queues, then remove those tasks. </li>
* <li> Terminate the write algorithm being processed. </li>
* <li> Set the error attribute to a DOMError object of type "AbortError". </li>
* <li> Fire a progress event called abort </li>
* <li> Fire a progress event called writeend </li>
* <li> Terminate this algorithm. </li>
* </ol>
*/
abort():void;
/**
* The blob is being written.
* @readonly
*/
INIT:number;
/**
* The object has been constructed, but there is no pending write.
* @readonly
*/
WRITING:number;
/**
* The entire Blob has been written to the file, an error occurred during the write, or the write was aborted using abort(). The FileSaver is no longer writing the blob.
* @readonly
*/
DONE:number;
/**
* The FileSaver object can be in one of 3 states. The readyState attribute, on getting, must return the current state, which must be one of the following values:
* <ul>
* <li>INIT</li>
* <li>WRITING</li>
* <li>DONE</li>
* <ul>
* @readonly
*/
readyState:number;
/**
* The last error that occurred on the FileSaver.
* @readonly
*/
error:DOMError;
/**
* Handler for writestart events
*/
onwritestart:Function;
/**
* Handler for progress events.
*/
onprogress:Function;
/**
* Handler for write events.
*/
onwrite:Function;
/**
* Handler for abort events.
*/
onabort:Function;
/**
* Handler for error events.
*/
onerror:Function;
/**
* Handler for writeend events.
*/
onwriteend:Function;
}
declare var FileSaver: {
/**
* When the FileSaver constructor is called, the user agent must return a new FileSaver object with readyState set to INIT.
* This constructor must be visible when the script's global object is either a Window object or an object implementing the WorkerUtils interface.
*/
new(data:Blob): FileSaver;
};
/**
* This interface expands on the FileSaver interface to allow for multiple write actions, rather than just saving a single Blob.
*/
interface FileWriter extends FileSaver {
/**
* The byte offset at which the next write to the file will occur. This must be no greater than length.
* A newly-created FileWriter must have position set to 0.
*/
position:number;
/**
* The length of the file. If the user does not have read access to the file, this must be the highest byte offset at which the user has written.
*/
length:number;
/**
* Write the supplied data to the file at position.
* @param data The blob to write.
*/
write(data:Blob):void;
/**
* Seek sets the file position at which the next write will occur.
* @param offset If nonnegative, an absolute byte offset into the file. If negative, an offset back from the end of the file.
*/
seek(offset:number):void;
/**
* Changes the length of the file to that specified. If shortening the file, data beyond the new length must be discarded. If extending the file, the existing data must be zero-padded up to the new length.
* @param size The size to which the length of the file is to be adjusted, measured in bytes.
*/
truncate(size:number):void;
}
/**
* This interface lets users write, truncate, and append to files using simple synchronous calls.
* This interface is specified to be used only within Web Workers (WorkerUtils [WEBWORKERS]).
*/
interface FileWriterSync {
/**
* The byte offset at which the next write to the file will occur. This must be no greater than length.
*/
position:number;
/**
* The length of the file. If the user does not have read access to the file, this must be the highest byte offset at which the user has written.
*/
length:number;
/**
* Write the supplied data to the file at position. Upon completion, position will increase by data.size.
* @param data The blob to write.
*/
write(data:Blob):void;
/**
* Seek sets the file position at which the next write will occur.
* @param offset An absolute byte offset into the file. If offset is greater than length, length is used instead. If offset is less than zero, length is added to it, so that it is treated as an offset back from the end of the file. If it is still less than zero, zero is used.
*/
seek(offset:number):void;
/**
* Changes the length of the file to that specified. If shortening the file, data beyond the new length must be discarded. If extending the file, the existing data must be zero-padded up to the new length.
* Upon successful completion:
* <ul>
* <li>length must be equal to size.</li>
* <li>position must be the lesser of
* <ul>
* <li>its pre-truncate value,</li>
* <li>size.</li>
* </ul>
* </li>
* </ul>
* @param size The size to which the length of the file is to be adjusted, measured in bytes.
*/
truncate(size:number):void;
}

View File

@ -1,184 +0,0 @@
// Type definitions for Handlebars 1.0
// Project: http://handlebarsjs.com/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Use either HandlebarsStatic or HandlebarsRuntimeStatic
declare var Handlebars: HandlebarsStatic;
//declare var Handlebars: HandlebarsRuntimeStatic;
/**
* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View
**/
interface HandlebarsTemplatable {
template: HandlebarsTemplateDelegate;
}
interface HandlebarsTemplateDelegate {
(context: any, options?: any): string;
}
interface HandlebarsCommon {
registerHelper(name: string, fn: Function, inverse?: boolean): void;
registerPartial(name: string, str: any): void;
K(): void;
createFrame(object: any): any;
Exception(message: string): void;
SafeString: typeof hbs.SafeString;
Utils: typeof hbs.Utils;
logger: Logger;
log(level: number, obj: any): void;
}
interface HandlebarsStatic extends HandlebarsCommon {
parse(input: string): hbs.AST.ProgramNode;
compile(input: any, options?: any): HandlebarsTemplateDelegate;
}
interface HandlebarsTemplates {
[index: string]: HandlebarsTemplateDelegate;
}
interface HandlebarsRuntimeStatic extends HandlebarsCommon {
// Handlebars.templates is the default template namespace in precompiler.
templates: HandlebarsTemplates;
}
declare module hbs {
class SafeString {
constructor(str: string);
static toString(): string;
}
module Utils {
function escapeExpression(str: string): string;
}
}
interface Logger {
DEBUG: number;
INFO: number;
WARN: number;
ERROR: number;
level: number;
methodMap: { [level: number]: string };
log(level: number, obj: string): void;
}
declare module hbs {
module AST {
interface IStripInfo {
left?: boolean;
right?: boolean;
inlineStandalone?: boolean;
}
class NodeBase {
firstColumn: number;
firstLine: number;
lastColumn: number;
lastLine: number;
type: string;
}
class ProgramNode extends NodeBase {
statements: NodeBase[];
}
class IdNode extends NodeBase {
original: string;
parts: string[];
string: string;
depth: number;
idName: string;
isSimple: boolean;
stringModeValue: string;
}
class HashNode extends NodeBase {
pairs: {0: string;
1: NodeBase}[];
}
class SexprNode extends NodeBase {
hash: HashNode;
id: NodeBase;
params: NodeBase[];
isHelper: boolean;
eligibleHelper: boolean;
}
class MustacheNode extends NodeBase {
strip: IStripInfo;
escaped: boolean;
sexpr: SexprNode;
}
class BlockNode extends NodeBase {
mustache: MustacheNode;
program: ProgramNode;
inverse: ProgramNode;
strip: IStripInfo;
isInverse: boolean;
}
class PartialNameNode extends NodeBase {
name: string;
}
class PartialNode extends NodeBase {
partialName: PartialNameNode;
context: NodeBase;
hash: HashNode;
strip: IStripInfo;
}
class RawBlockNode extends NodeBase {
mustache: MustacheNode;
program: ProgramNode;
}
class ContentNode extends NodeBase {
original: string;
string: string;
}
class DataNode extends NodeBase {
id: IdNode;
stringModeValue: string;
idName: string;
}
class StringNode extends NodeBase {
original: string;
string: string;
stringModeValue: string;
}
class NumberNode extends NodeBase {
original: string;
number: string;
stringModeValue: number;
}
class BooleanNode extends NodeBase {
bool: string;
stringModeValue: boolean;
}
class CommentNode extends NodeBase {
comment: string;
strip: IStripInfo;
}
}
}
declare module "handlebars" {
export = Handlebars;
}

View File

@ -1,227 +0,0 @@
// Type definitions for Handlebars v3.0.3
// Project: http://handlebarsjs.com/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module Handlebars {
export function registerHelper(name: string, fn: Function, inverse?: boolean): void;
export function registerPartial(name: string, str: any): void;
export function unregisterHelper(name: string): void;
export function unregisterPartial(name: string): void;
export function K(): void;
export function createFrame(object: any): any;
export function Exception(message: string): void;
export function log(level: number, obj: any): void;
export function parse(input: string): hbs.AST.Program;
export function compile(input: any, options?: any): HandlebarsTemplateDelegate;
export var SafeString: typeof hbs.SafeString;
export var Utils: typeof hbs.Utils;
export var logger: Logger;
export var templates: HandlebarsTemplates;
export var helpers: any;
export module AST {
export var helpers: hbs.AST.helpers;
}
interface ICompiler {
accept(node: hbs.AST.Node): void;
Program(program: hbs.AST.Program): void;
BlockStatement(block: hbs.AST.BlockStatement): void;
PartialStatement(partial: hbs.AST.PartialStatement): void;
MustacheStatement(mustache: hbs.AST.MustacheStatement): void;
ContentStatement(content: hbs.AST.ContentStatement): void;
CommentStatement(comment?: hbs.AST.CommentStatement): void;
SubExpression(sexpr: hbs.AST.SubExpression): void;
PathExpression(path: hbs.AST.PathExpression): void;
StringLiteral(str: hbs.AST.StringLiteral): void;
NumberLiteral(num: hbs.AST.NumberLiteral): void;
BooleanLiteral(bool: hbs.AST.BooleanLiteral): void;
UndefinedLiteral(): void;
NullLiteral(): void;
Hash(hash: hbs.AST.Hash): void;
}
export class Visitor implements ICompiler {
accept(node: hbs.AST.Node): void;
acceptKey(node: hbs.AST.Node, name: string): void;
acceptArray(arr: hbs.AST.Expression[]): void;
Program(program: hbs.AST.Program): void;
BlockStatement(block: hbs.AST.BlockStatement): void;
PartialStatement(partial: hbs.AST.PartialStatement): void;
MustacheStatement(mustache: hbs.AST.MustacheStatement): void;
ContentStatement(content: hbs.AST.ContentStatement): void;
CommentStatement(comment?: hbs.AST.CommentStatement): void;
SubExpression(sexpr: hbs.AST.SubExpression): void;
PathExpression(path: hbs.AST.PathExpression): void;
StringLiteral(str: hbs.AST.StringLiteral): void;
NumberLiteral(num: hbs.AST.NumberLiteral): void;
BooleanLiteral(bool: hbs.AST.BooleanLiteral): void;
UndefinedLiteral(): void;
NullLiteral(): void;
Hash(hash: hbs.AST.Hash): void;
}
}
/**
* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View
**/
interface HandlebarsTemplatable {
template: HandlebarsTemplateDelegate;
}
interface HandlebarsTemplateDelegate {
(context: any, options?: any): string;
}
interface HandlebarsTemplates {
[index: string]: HandlebarsTemplateDelegate;
}
declare module hbs {
class SafeString {
constructor(str: string);
static toString(): string;
}
module Utils {
function escapeExpression(str: string): string;
}
}
interface Logger {
DEBUG: number;
INFO: number;
WARN: number;
ERROR: number;
level: number;
methodMap: { [level: number]: string };
log(level: number, obj: string): void;
}
declare module hbs {
module AST {
interface Node {
type: string;
loc: SourceLocation;
}
interface SourceLocation {
source: string;
start: Position;
end: Position;
}
interface Position {
line: number;
column: number;
}
interface Program extends Node {
body: Statement[];
blockParams: string[];
}
interface Statement extends Node {}
interface MustacheStatement extends Statement {
path: PathExpression | Literal;
params: Expression[];
hash: Hash;
escaped: boolean;
strip: StripFlags;
}
interface BlockStatement extends Statement {
path: PathExpression;
params: Expression[];
hash: Hash;
program: Program;
inverse: Program;
openStrip: StripFlags;
inverseStrip: StripFlags;
closeStrip: StripFlags;
}
interface PartialStatement extends Statement {
name: PathExpression | SubExpression;
params: Expression[];
hash: Hash;
indent: string;
strip: StripFlags;
}
interface ContentStatement extends Statement {
value: string;
original: StripFlags;
}
interface CommentStatement extends Statement {
value: string;
strip: StripFlags;
}
interface Expression extends Node {}
interface SubExpression extends Expression {
path: PathExpression;
params: Expression[];
hash: Hash;
}
interface PathExpression extends Expression {
data: boolean;
depth: number;
parts: string[];
original: string;
}
interface Literal extends Expression {}
interface StringLiteral extends Literal {
value: string;
original: string;
}
interface BooleanLiteral extends Literal {
value: boolean;
original: boolean;
}
interface NumberLiteral extends Literal {
value: number;
original: number;
}
interface UndefinedLiteral extends Literal {}
interface NullLiteral extends Literal {}
interface Hash extends Node {
pairs: HashPair[];
}
interface HashPair extends Node {
key: string;
value: Expression;
}
interface StripFlags {
open: boolean;
close: boolean;
}
interface helpers {
helperExpression(node: Node): boolean;
scopeId(path: PathExpression): boolean;
simpleId(path: PathExpression): boolean;
}
}
}
declare module "handlebars" {
export = Handlebars;
}

File diff suppressed because it is too large Load Diff

20674
lib/decl/lib.es6.d.ts vendored

File diff suppressed because it is too large Load Diff

2178
lib/decl/node.d.ts vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,75 +0,0 @@
// Type definitions for React v0.14 (react-dom)
// Project: http://facebook.github.io/react/
// Definitions by: Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="react.d.ts" />
declare namespace __React {
namespace __DOM {
function findDOMNode<E extends Element>(instance: ReactInstance): E;
function findDOMNode(instance: ReactInstance): Element;
function render<P extends DOMAttributes, T extends Element>(
element: DOMElement<P, T>,
container: Element,
callback?: (element: T) => any): T;
function render<P>(
element: SFCElement<P>,
container: Element,
callback?: () => any): void;
function render<P, T extends Component<P, ComponentState>>(
element: CElement<P, T>,
container: Element,
callback?: (component: T) => any): T;
function render<P>(
element: ReactElement<P>,
container: Element,
callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
function unmountComponentAtNode(container: Element): boolean;
var version: string;
function unstable_batchedUpdates<A, B>(callback: (a: A, b: B) => any, a: A, b: B): void;
function unstable_batchedUpdates<A>(callback: (a: A) => any, a: A): void;
function unstable_batchedUpdates(callback: () => any): void;
function unstable_renderSubtreeIntoContainer<P extends DOMAttributes, T extends Element>(
parentComponent: Component<any, any>,
element: DOMElement<P, T>,
container: Element,
callback?: (element: T) => any): T;
function unstable_renderSubtreeIntoContainer<P, T extends Component<P, ComponentState>>(
parentComponent: Component<any, any>,
element: CElement<P, T>,
container: Element,
callback?: (component: T) => any): T;
function render<P>(
parentComponent: Component<any, any>,
element: SFCElement<P>,
container: Element,
callback?: () => any): void;
function unstable_renderSubtreeIntoContainer<P>(
parentComponent: Component<any, any>,
element: ReactElement<P>,
container: Element,
callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
}
namespace __DOMServer {
function renderToString(element: ReactElement<any>): string;
function renderToStaticMarkup(element: ReactElement<any>): string;
var version: string;
}
}
declare module "react-dom" {
import DOM = __React.__DOM;
export = DOM;
}
declare module "react-dom/server" {
import DOMServer = __React.__DOMServer;
export = DOMServer;
}

View File

@ -1,11 +0,0 @@
// Type definitions for React v0.14 (namespace)
// Project: http://facebook.github.io/react/
// Definitions by: Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="react.d.ts" />
/// <reference path="react-dom.d.ts" />
import React = __React;
import ReactDOM = __React.__DOM;

2547
lib/decl/react.d.ts vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +0,0 @@
interface System {
import(name: string): Promise<any>;
defined: any;
amdDefine: () => void;
amdRequire: () => void;
baseURL: string;
paths: { [key: string]: string };
meta: { [key: string]: Object };
config: any;
newModule(obj: Object): any;
normalizeSync(name: string): string;
set(moduleName: string, module: any): void;
}
declare var System: System;
declare module "systemjs" {
export = System;
}

View File

@ -1,236 +0,0 @@
// Type definitions for URI.js 1.15.1
// Project: https://github.com/medialize/URI.js
// Definitions by: RodneyJT <https://github.com/RodneyJT>, Brian Surowiec <https://github.com/xt0rted>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
declare module uri {
interface URI {
absoluteTo(path: string): URI;
absoluteTo(path: URI): URI;
addFragment(fragment: string): URI;
addQuery(qry: string): URI;
addQuery(qry: Object): URI;
addSearch(qry: string): URI;
addSearch(key: string, value:any): URI;
addSearch(qry: Object): URI;
authority(): string;
authority(authority: string): URI;
clone(): URI;
directory(): string;
directory(dir: boolean): string;
directory(dir: string): URI;
domain(): string;
domain(domain: boolean): string;
domain(domain: string): URI;
duplicateQueryParameters(val: boolean): URI;
equals(): boolean;
equals(url: string): boolean;
filename(): string;
filename(file: boolean): string;
filename(file: string): URI;
fragment(): string;
fragment(fragment: string): URI;
fragmentPrefix(prefix: string): URI;
hash(): string;
hash(hash: string): URI;
host(): string;
host(host: string): URI;
hostname(): string;
hostname(hostname: string): URI;
href(): string;
href(url: string): void;
is(qry: string): boolean;
iso8859(): URI;
normalize(): URI;
normalizeFragment(): URI;
normalizeHash(): URI;
normalizeHostname(): URI;
normalizePath(): URI;
normalizePathname(): URI;
normalizePort(): URI;
normalizeProtocol(): URI;
normalizeQuery(): URI;
normalizeSearch(): URI;
password(): string;
password(pw: string): URI;
path(): string;
path(path: boolean): string;
path(path: string): URI;
pathname(): string;
pathname(path: boolean): string;
pathname(path: string): URI;
port(): string;
port(port: string): URI;
protocol(): string;
protocol(protocol: string): URI;
query(): string;
query(qry: string): URI;
query(qry: boolean): Object;
query(qry: Object): URI;
readable(): string;
relativeTo(path: string): URI;
removeQuery(qry: string): URI;
removeQuery(qry: Object): URI;
removeSearch(qry: string): URI;
removeSearch(qry: Object): URI;
resource(): string;
resource(resource: string): URI;
scheme(): string;
scheme(protocol: string): URI;
search(): string;
search(qry: string): URI;
search(qry: boolean): any;
search(qry: Object): URI;
segment(): string[];
segment(segments: string[]): URI;
segment(position: number): string;
segment(position: number, level: string): URI;
segment(segment: string): URI;
setQuery(key: string, value: string): URI;
setQuery(qry: Object): URI;
setSearch(key: string, value: string): URI;
setSearch(qry: Object): URI;
subdomain(): string;
subdomain(subdomain: string): URI;
suffix(): string;
suffix(suffix: boolean): string;
suffix(suffix: string): URI;
tld(): string;
tld(tld: boolean): string;
tld(tld: string): URI;
unicode(): URI;
userinfo(): string;
userinfo(userinfo: string): URI;
username(): string;
username(uname: string): URI;
valueOf(): string;
}
interface URIOptions {
protocol?: string;
username?: string;
password?: string;
hostname?: string;
port?: string;
path?: string;
query?: string;
fragment?: string;
}
interface URIStatic {
(): URI;
(value: string | URIOptions | HTMLElement): URI;
new (): URI;
new (value: string | URIOptions | HTMLElement): URI;
addQuery(data: Object, prop: string, value: string): Object;
addQuery(data: Object, qryObj: Object): Object;
build(parts: {
protocol: string;
username: string;
password: string;
hostname: string;
port: string;
path: string;
query: string;
fragment: string;
}): string;
buildAuthority(parts: {
username?: string;
password?: string;
hostname?: string;
port?: string;
}): string;
buildHost(parts: {
hostname?: string;
port?: string;
}): string;
buildQuery(qry: Object): string;
buildQuery(qry: Object, duplicates: boolean): string;
buildUserinfo(parts: {
username?: string;
password?: string;
}): string;
commonPath(path1: string, path2: string): string;
decode(str: string): string;
decodeQuery(qry: string): string;
encode(str: string): string;
encodeQuery(qry: string): string;
encodeReserved(str: string): string;
expand(template: string, vals: Object): URI;
iso8859(): void;
parse(url: string): {
protocol: string;
username: string;
password: string;
hostname: string;
port: string;
path: string;
query: string;
fragment: string;
};
parseAuthority(url: string, parts: {
username?: string;
password?: string;
hostname?: string;
port?: string;
}): string;
parseHost(url: string, parts: {
hostname?: string;
port?: string;
}): string;
parseQuery(url: string): Object;
parseUserinfo(url: string, parts: {
username?: string;
password?: string;
}): string;
removeQuery(data: Object, prop: string, value: string): Object;
removeQuery(data: Object, props: string[]): Object;
removeQuery(data: Object, props: Object): Object;
unicode(): void;
withinString(source: string, func: (url: string) => string): string;
}
}
interface JQuery {
uri(): uri.URI;
}
declare var URI: uri.URIStatic;
declare module 'URI' {
export = URI;
}
declare module 'urijs' {
export = URI;
}

File diff suppressed because one or more lines are too long

7
lib/refs.d.ts vendored
View File

@ -1,7 +0,0 @@
// Help the TypeScript compiler find declarations.
/// <reference path="decl/lib.es6.d.ts" />
/// <reference path="decl/urijs/URIjs.d.ts" />
/// <reference path="decl/systemjs/systemjs.d.ts" />
/// <reference path="decl/react-global.d.ts" />

2162
lib/vendor/URI.js vendored

File diff suppressed because it is too large Load Diff

1
lib/vendor/jed.js vendored
View File

@ -1 +0,0 @@
../../thirdparty/jed/jed.js

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
react-dom.min.js

File diff suppressed because one or more lines are too long

3783
lib/vendor/react.dev.js vendored

File diff suppressed because it is too large Load Diff

1
lib/vendor/react.js vendored
View File

@ -1 +0,0 @@
react.min.js

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -36,28 +36,27 @@
"32": "img/icon.png"
},
"default_title": "Taler",
"default_popup": "popup/popup.html"
"default_popup": "src/popup/popup.html"
},
"content_scripts": [
{
"matches": ["*://*/*"],
"js": [
"lib/vendor/URI.js",
"lib/taler-wallet-lib.js",
"content_scripts/notify.js"
"src/vendor/URI.js",
"src/taler-wallet-lib.js",
"src/content_scripts/notify.js"
],
"run_at": "document_start"
}
],
"web_accessible_resources": [
"pages/*",
"lib/*"
"src/*"
],
"background": {
"page": "background/background.html",
"page": "src/background/background.html",
"persistent": true
}
}

View File

@ -1,36 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Taler Wallet: Tree View</title>
<link rel="stylesheet" type="text/css" href="../style/lang.css">
<link rel="stylesheet" type="text/css" href="../style/wallet.css">
<link rel="icon" href="../img/icon.png">
<script src="../lib/vendor/URI.js"></script>
<script src="../lib/vendor/react.js"></script>
<script src="../lib/vendor/react-dom.js"></script>
<!-- i18n -->
<script src="../lib/vendor/jed.js"></script>
<script src="../lib/i18n.js"></script>
<script src="../i18n/strings.js"></script>
<script src="../lib/vendor/system-csp-production.src.js"></script>
<script src="../lib/module-trampoline.js"></script>
<style>
.tree-item {
margin: 2em;
border-radius: 5px;
border: 1px solid gray;
padding: 1em;
}
</style>
<body>
<div id="container"></div>
</body>
</html>

View File

@ -1,26 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="../style/lang.css">
<link rel="stylesheet" type="text/css" href="popup.css">
<script src="../lib/vendor/react.js"></script>
<script src="../lib/vendor/react-dom.js"></script>
<script src="../lib/vendor/URI.js"></script>
<script src="../lib/vendor/jed.js"></script>
<script src="../lib/i18n.js"></script>
<script src="../i18n/strings.js"></script>
<script src="../lib/vendor/system-csp-production.src.js"></script>
<script src="../lib/module-trampoline.js"></script>
</head>
<body>
<div id="content" style="margin:0;padding:0"></div>
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script src="../vendor/URI.js"></script>
<script src="../vendor/system-csp-production.src.js"></script>
<script src="background.js"></script>
<meta charset="UTF-8">
<title>(wallet bg page)</title>
</head>
<body>
<img id="taler-logo" src="/img/icon.png">
</body>
</html>

View File

@ -30,12 +30,12 @@ window.addEventListener("load", () => {
defaultJSExtensions: true,
});
System.import("../lib/wallet/wxMessaging")
.then((wxMessaging) => {
System.import("../wxMessaging")
.then((wxMessaging: any) => {
// Export as global for debugger
(window as any).wxMessaging = wxMessaging;
wxMessaging.wxMain();
}).catch((e) => {
}).catch((e: Error) => {
console.log("wallet failed");
console.error(e.stack);
});

View File

@ -0,0 +1,325 @@
/*
This file is part of TALER
(C) 2015 GNUnet e.V.
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3, or (at your option) any later version.
TALER 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
/**
* Script that is injected into (all!) pages to allow them
* to interact with the GNU Taler wallet via DOM Events.
*
* @author Florian Dold
*/
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments)).next());
});
};
// Make sure we don't pollute the namespace too much.
var TalerNotify;
(function (TalerNotify) {
const PROTOCOL_VERSION = 1;
let logVerbose = false;
try {
logVerbose = !!localStorage.getItem("taler-log-verbose");
}
catch (e) {
}
if (!taler) {
console.error("Taler wallet lib not included, HTTP 402 payments not" +
" supported");
}
function subst(url, H_contract) {
url = url.replace("${H_contract}", H_contract);
url = url.replace("${$}", "$");
return url;
}
const handlers = [];
function hashContract(contract) {
let walletHashContractMsg = {
type: "hash-contract",
detail: { contract }
};
return new Promise((resolve, reject) => {
chrome.runtime.sendMessage(walletHashContractMsg, (resp) => {
if (!resp.hash) {
console.log("error", resp);
reject(Error("hashing failed"));
}
resolve(resp.hash);
});
});
}
function checkRepurchase(contract) {
const walletMsg = {
type: "check-repurchase",
detail: {
contract: contract
},
};
return new Promise((resolve, reject) => {
chrome.runtime.sendMessage(walletMsg, (resp) => {
resolve(resp);
});
});
}
function putHistory(historyEntry) {
const walletMsg = {
type: "put-history-entry",
detail: {
historyEntry,
},
};
return new Promise((resolve, reject) => {
chrome.runtime.sendMessage(walletMsg, (resp) => {
resolve();
});
});
}
function saveOffer(offer) {
const walletMsg = {
type: "save-offer",
detail: {
offer: {
contract: offer.contract,
merchant_sig: offer.merchant_sig,
H_contract: offer.H_contract,
offer_time: new Date().getTime() / 1000
},
},
};
return new Promise((resolve, reject) => {
chrome.runtime.sendMessage(walletMsg, (resp) => {
resolve(resp);
});
});
}
function init() {
chrome.runtime.sendMessage({ type: "get-tab-cookie" }, (resp) => {
if (chrome.runtime.lastError) {
logVerbose && console.log("extension not yet ready");
window.setTimeout(init, 200);
return;
}
registerHandlers();
// Hack to know when the extension is unloaded
let port = chrome.runtime.connect();
port.onDisconnect.addListener(() => {
logVerbose && console.log("chrome runtime disconnected, removing handlers");
for (let handler of handlers) {
document.removeEventListener(handler.type, handler.listener);
}
});
if (resp && resp.type === "fetch") {
logVerbose && console.log("it's fetch");
taler.internalOfferContractFrom(resp.contractUrl);
document.documentElement.style.visibility = "hidden";
}
else if (resp && resp.type === "execute") {
logVerbose && console.log("it's execute");
document.documentElement.style.visibility = "hidden";
taler.internalExecutePayment(resp.contractHash, resp.payUrl, resp.offerUrl);
}
});
}
logVerbose && console.log("loading Taler content script");
init();
function registerHandlers() {
/**
* Add a handler for a DOM event, which automatically
* handles adding sequence numbers to responses.
*/
function addHandler(type, handler) {
let handlerWrap = (e) => {
if (e.type != type) {
throw Error(`invariant violated`);
}
let callId = undefined;
if (e.detail && e.detail.callId != undefined) {
callId = e.detail.callId;
}
let responder = (msg) => {
let fullMsg = Object.assign({}, msg, { callId });
let opts = { detail: fullMsg };
if ("function" == typeof cloneInto) {
opts = cloneInto(opts, document.defaultView);
}
let evt = new CustomEvent(type + "-result", opts);
document.dispatchEvent(evt);
};
handler(e.detail, responder);
};
document.addEventListener(type, handlerWrap);
handlers.push({ type, listener: handlerWrap });
}
addHandler("taler-query-id", (msg, sendResponse) => {
// FIXME: maybe include this info in taoer-probe?
sendResponse({ id: chrome.runtime.id });
});
addHandler("taler-probe", (msg, sendResponse) => {
sendResponse();
});
addHandler("taler-create-reserve", (msg) => {
let params = {
amount: JSON.stringify(msg.amount),
callback_url: URI(msg.callback_url)
.absoluteTo(document.location.href),
bank_url: document.location.href,
wt_types: JSON.stringify(msg.wt_types),
};
let uri = URI(chrome.extension.getURL("/src/pages/confirm-create-reserve.html"));
let redirectUrl = uri.query(params).href();
window.location.href = redirectUrl;
});
addHandler("taler-confirm-reserve", (msg, sendResponse) => {
let walletMsg = {
type: "confirm-reserve",
detail: {
reservePub: msg.reserve_pub
}
};
chrome.runtime.sendMessage(walletMsg, (resp) => {
sendResponse();
});
});
addHandler("taler-confirm-contract", (msg) => __awaiter(this, void 0, void 0, function* () {
if (!msg.contract_wrapper) {
console.error("contract wrapper missing");
return;
}
const offer = msg.contract_wrapper;
if (!offer.contract) {
console.error("contract field missing");
return;
}
if (!offer.H_contract) {
console.error("H_contract field missing");
return;
}
let walletHashContractMsg = {
type: "hash-contract",
detail: { contract: offer.contract }
};
let contractHash = yield hashContract(offer.contract);
if (contractHash != offer.H_contract) {
console.error("merchant-supplied contract hash is wrong");
return;
}
let resp = yield checkRepurchase(offer.contract);
if (resp.error) {
console.error("wallet backend error", resp);
return;
}
if (resp.isRepurchase) {
logVerbose && console.log("doing repurchase");
console.assert(resp.existingFulfillmentUrl);
console.assert(resp.existingContractHash);
window.location.href = subst(resp.existingFulfillmentUrl, resp.existingContractHash);
}
else {
let merchantName = "(unknown)";
try {
merchantName = offer.contract.merchant.name;
}
catch (e) {
}
let historyEntry = {
timestamp: (new Date).getTime(),
subjectId: `contract-${contractHash}`,
type: "offer-contract",
detail: {
contractHash,
merchantName,
}
};
yield putHistory(historyEntry);
let offerId = yield saveOffer(offer);
const uri = URI(chrome.extension.getURL("/src/pages/confirm-contract.html"));
const params = {
offerId: offerId.toString(),
};
const target = uri.query(params).href();
if (msg.replace_navigation === true) {
document.location.replace(target);
}
else {
document.location.href = target;
}
}
}));
addHandler("taler-payment-failed", (msg, sendResponse) => {
const walletMsg = {
type: "payment-failed",
detail: {
contractHash: msg.H_contract
},
};
chrome.runtime.sendMessage(walletMsg, (resp) => {
sendResponse();
});
});
addHandler("taler-payment-succeeded", (msg, sendResponse) => {
if (!msg.H_contract) {
console.error("H_contract missing in taler-payment-succeeded");
return;
}
logVerbose && console.log("got taler-payment-succeeded");
const walletMsg = {
type: "payment-succeeded",
detail: {
contractHash: msg.H_contract,
},
};
chrome.runtime.sendMessage(walletMsg, (resp) => {
sendResponse();
});
});
addHandler("taler-get-payment", (msg, sendResponse) => {
const walletMsg = {
type: "execute-payment",
detail: {
H_contract: msg.H_contract,
},
};
chrome.runtime.sendMessage(walletMsg, (resp) => {
if (resp.rateLimitExceeded) {
console.error("rate limit exceeded, check for redirect loops");
}
if (!resp.success) {
if (msg.offering_url) {
window.location.href = msg.offering_url;
}
else {
console.error("execute-payment failed", resp);
}
return;
}
let contract = resp.contract;
if (!contract) {
throw Error("contract missing");
}
// We have the details for then payment, the merchant page
// is responsible to give it to the merchant.
sendResponse({
H_contract: msg.H_contract,
contract: resp.contract,
payment: resp.payReq,
});
});
});
}
})(TalerNotify || (TalerNotify = {}));
//# sourceMappingURL=notify.js.map

View File

@ -23,9 +23,6 @@
*/
/// <reference path="../lib/decl/chrome/chrome.d.ts" />
/// <reference path="../lib/decl/urijs/URIjs.d.ts" />
"use strict";
declare var cloneInto: any;
@ -208,7 +205,7 @@ namespace TalerNotify {
bank_url: document.location.href,
wt_types: JSON.stringify(msg.wt_types),
};
let uri = URI(chrome.extension.getURL("pages/confirm-create-reserve.html"));
let uri = URI(chrome.extension.getURL("/src/pages/confirm-create-reserve.html"));
let redirectUrl = uri.query(params).href();
window.location.href = redirectUrl;
});
@ -292,7 +289,7 @@ namespace TalerNotify {
let offerId = await saveOffer(offer);
const uri = URI(chrome.extension.getURL(
"pages/confirm-contract.html"));
"/src/pages/confirm-contract.html"));
const params = {
offerId: offerId.toString(),
};

View File

@ -1,5 +1,5 @@
import {CryptoApi} from "./cryptoApi";
import {ReserveRecord, Denomination} from "lib/wallet/types";
import {ReserveRecord, Denomination} from "src/types";
import {test, TestLib} from "testlib/talertest";
let masterPub1: string = "CQQZ9DY3MZ1ARMN5K1VKDETS04Y2QCKMMCFHZSWJWWVN82BTTH00";

View File

@ -84,7 +84,7 @@ export class CryptoApi {
ws.currentWorkItem = work;
this.numBusy++;
if (!ws.w) {
let w = new Worker("/lib/wallet/cryptoWorker.js");
let w = new Worker("/src/cryptoWorker.js");
w.onmessage = (m: MessageEvent) => this.handleWorkerMessage(ws, m);
w.onerror = (e: ErrorEvent) => this.handleWorkerError(ws, e);
ws.w = w;

View File

@ -29,10 +29,9 @@ import {
import create = chrome.alarms.create;
import {Offer} from "./wallet";
import {CoinWithDenom} from "./wallet";
import {CoinPaySig} from "./types";
import {CoinPaySig, Coin} from "./types";
import {Denomination, Amounts} from "./types";
import {Amount} from "./emscriptif";
import {Coin} from "../../background/lib/wallet/types";
import {HashContext} from "./emscriptif";
import {RefreshMeltCoinAffirmationPS} from "./emscriptif";
import {EddsaPublicKey} from "./emscriptif";

View File

@ -22,15 +22,18 @@
"use strict";
importScripts("../emscripten/taler-emscripten-lib.js",
"../vendor/system-csp-production.src.js");
importScripts("/src/emscripten/taler-emscripten-lib.js",
"/src/vendor/system-csp-production.src.js");
// TypeScript does not allow ".js" extensions in the
// module name, so SystemJS must add it.
System.config({
defaultJSExtensions: true,
});
defaultJSExtensions: true,
map: {
"src": "/src",
},
});
// We expect that in the manifest, the emscripten js is loaded
// becore the background page.
@ -46,16 +49,16 @@ if ("object" !== typeof Module) {
{
let mod = System.newModule({Module: Module, default: Module});
let modName = System.normalizeSync("../emscripten/taler-emscripten-lib");
let modName = System.normalizeSync("/src/emscripten/taler-emscripten-lib");
console.log("registering", modName);
System.set(modName, mod);
}
System.import("./cryptoLib")
.then((m) => {
System.import("/src/cryptoLib")
.then((m: any) => {
m.main(self);
})
.catch((e) => {
.catch((e: Error) => {
console.log("crypto worker failed");
console.error(e.stack);
});

View File

@ -15,7 +15,7 @@
*/
import {AmountJson} from "./types";
import Module, {EmscFunGen} from "../emscripten/taler-emscripten-lib";
import Module, {EmscFunGen} from "src/emscripten/taler-emscripten-lib";
/**
* High-level interface to emscripten-compiled modules used
@ -692,8 +692,7 @@ function makeFromCrock(decodeFn: (p: number, s: number) => number) {
function fromCrock(s: string, a?: Arena) {
let obj = new this(a);
let buf = ByteArray.fromCrock(s);
obj.setNative(decodeFn(buf.nativePtr,
buf.size()));
obj.nativePtr = decodeFn(buf.nativePtr, buf.size());
buf.destroy();
return obj;
}

View File

@ -30,6 +30,9 @@ if (typeof System === "undefined") {
System.config({
defaultJSExtensions: true,
map: {
src: "/src/",
},
});
let me = window.location.protocol

View File

@ -4,19 +4,19 @@
<head>
<title>Taler Wallet: Confirm Reserve Creation</title>
<link rel="stylesheet" type="text/css" href="../style/lang.css">
<link rel="stylesheet" type="text/css" href="../style/wallet.css">
<link rel="stylesheet" type="text/css" href="/src/style/lang.css">
<link rel="stylesheet" type="text/css" href="/src/style/wallet.css">
<link rel="icon" href="../img/icon.png">
<link rel="icon" href="/img/icon.png">
<script src="../lib/vendor/URI.js"></script>
<script src="../lib/vendor/react.js"></script>
<script src="../lib/vendor/react-dom.js"></script>
<script src="../lib/vendor/system-csp-production.src.js"></script>
<!-- <script src="../lib/vendor/jed.js"></script> -->
<script src="../lib/i18n.js"></script>
<script src="../i18n/strings.js"></script>
<script src="../lib/module-trampoline.js"></script>
<script src="/src/vendor/URI.js"></script>
<script src="/src/vendor/react.js"></script>
<script src="/src/vendor/react-dom.js"></script>
<script src="/src/vendor/system-csp-production.src.js"></script>
<!-- <script src="/src/vendor/jed.js"></script> -->
<script src="/src/i18n.js"></script>
<script src="/src/i18n/strings.js"></script>
<script src="/src/module-trampoline.js"></script>
<style>
button.accept {

View File

@ -21,13 +21,13 @@
* @author Florian Dold
*/
import {substituteFulfillmentUrl} from "../lib/wallet/helpers";
import {Contract, AmountJson, IExchangeInfo} from "../lib/wallet/types";
import {Offer} from "../lib/wallet/wallet";
import {renderContract, prettyAmount} from "../lib/wallet/renderHtml";
"use strict";
import {getExchanges} from "../lib/wallet/wxApi";
import {substituteFulfillmentUrl} from "src/helpers";
import {Contract, AmountJson, IExchangeInfo} from "src/types";
import {Offer} from "src/wallet";
import {renderContract, prettyAmount} from "src/renderHtml";
import {getExchanges} from "src/wxApi";
interface DetailState {
@ -61,8 +61,6 @@ class Details extends React.Component<DetailProps, DetailState> {
}
render() {
console.log("details collapsed (state)", this.state.collapsed);
console.log("details collapsed (prop)", this.props.collapsed);
if (this.state.collapsed) {
return (
<div>
@ -119,7 +117,6 @@ class ContractPrompt extends React.Component<ContractPromptProps, ContractPrompt
componentWillMount() {
this.update();
this.checkPayment();
}
componentWillUnmount() {

View File

@ -4,20 +4,20 @@
<head>
<title>Taler Wallet: Select Taler Provider</title>
<link rel="icon" href="../img/icon.png">
<link rel="icon" href="/img/icon.png">
<script src="../lib/vendor/URI.js"></script>
<script src="../lib/vendor/react.js"></script>
<script src="../lib/vendor/react-dom.js"></script>
<script src="/src/vendor/URI.js"></script>
<script src="/src/vendor/react.js"></script>
<script src="/src/vendor/react-dom.js"></script>
<!-- i18n -->
<script src="../lib/vendor/jed.js"></script>
<script src="../lib/i18n.js"></script>
<script src="../i18n/strings.js"></script>
<script src="/src/vendor/jed.js"></script>
<script src="/src/i18n.js"></script>
<script src="/src/i18n/strings.js"></script>
<!-- module loading -->
<script src="../lib/vendor/system-csp-production.src.js"></script>
<script src="../lib/module-trampoline.js"></script>
<script src="/src/vendor/system-csp-production.src.js"></script>
<script src="/src/module-trampoline.js"></script>
<style>

View File

@ -22,12 +22,14 @@
* @author Florian Dold
*/
import {amountToPretty, canonicalizeBaseUrl} from "../lib/wallet/helpers";
import {AmountJson, CreateReserveResponse} from "../lib/wallet/types";
import {ReserveCreationInfo, Amounts} from "../lib/wallet/types";
import {Denomination} from "../lib/wallet/types";
import {getReserveCreationInfo} from "../lib/wallet/wxApi";
import {ImplicitStateComponent, StateHolder} from "../lib/components";
import {amountToPretty, canonicalizeBaseUrl} from "src/helpers";
import {
AmountJson, CreateReserveResponse,
ReserveCreationInfo, Amounts,
Denomination,
} from "src/types";
import {getReserveCreationInfo} from "src/wxApi";
import {ImplicitStateComponent, StateHolder} from "src/components";
"use strict";

View File

@ -7,7 +7,7 @@
<body>
<h1>Debug Pages</h1>
<a href="show-db.html">Show DB</a> <br>
<a href="../popup/balance-overview.html">Show balance</a>
<a href="/src/popup/balance-overview.html">Show balance</a>
</body>
</html>

View File

@ -3,9 +3,9 @@
<head>
<meta charset="utf-8">
<title>GNU Taler Help - Empty Wallet</title>
<link rel="icon" href="../../img/icon.png">
<link rel="icon" href="/img/icon.png">
<meta name="description" content="">
<link rel="stylesheet" type="text/css" href="../../style/wallet.css">
<link rel="stylesheet" type="text/css" href="/src/style/wallet.css">
</head>
<body>
<div class="container" id="main">

View File

@ -5,7 +5,7 @@
<head>
<title>Taler Wallet: Reserve Created</title>
<link rel="stylesheet" type="text/css" href="../style/wallet.css">
<link rel="icon" href="../img/icon.png">
<link rel="icon" href="/img/icon.png">
<script src="show-db.js"></script>
</head>
<body>

36
src/pages/tree.html Normal file
View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<title>Taler Wallet: Tree View</title>
<link rel="stylesheet" type="text/css" href="../style/lang.css">
<link rel="stylesheet" type="text/css" href="../style/wallet.css">
<link rel="icon" href="/img/icon.png">
<script src="/src/vendor/URI.js"></script>
<script src="/src/vendor/react.js"></script>
<script src="/src/vendor/react-dom.js"></script>
<!-- i18n -->
<script src="/src/vendor/jed.js"></script>
<script src="/src/i18n.js"></script>
<script src="/src/i18n/strings.js"></script>
<script src="/src/vendor/system-csp-production.src.js"></script>
<script src="/src/module-trampoline.js"></script>
<style>
.tree-item {
margin: 2em;
border-radius: 5px;
border: 1px solid gray;
padding: 1em;
}
</style>
<body>
<div id="container"></div>
</body>
</html>

View File

@ -21,15 +21,15 @@
*/
import { IExchangeInfo } from "../lib/wallet/types";
import { ReserveRecord, Coin, PreCoin, Denomination } from "../lib/wallet/types";
import { ImplicitStateComponent, StateHolder } from "../lib/components";
import { IExchangeInfo } from "src/types";
import { ReserveRecord, Coin, PreCoin, Denomination } from "src/types";
import { ImplicitStateComponent, StateHolder } from "src/components";
import {
getReserves, getExchanges, getCoins, getPreCoins,
refresh
} from "../lib/wallet/wxApi";
import { prettyAmount, abbrev } from "../lib/wallet/renderHtml";
import { getTalerStampDate } from "../lib/wallet/helpers";
} from "src/wxApi";
import { prettyAmount, abbrev } from "src/renderHtml";
import { getTalerStampDate } from "src/helpers";
interface ReserveViewProps {
reserve: ReserveRecord;

26
src/popup/popup.html Normal file
View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="../style/lang.css">
<link rel="stylesheet" type="text/css" href="popup.css">
<script src="/src/vendor/react.js"></script>
<script src="/src/vendor/react-dom.js"></script>
<script src="/src/vendor/URI.js"></script>
<script src="/src/vendor/jed.js"></script>
<script src="/src/i18n.js"></script>
<script src="/src/i18n/strings.js"></script>
<script src="/src/vendor/system-csp-production.src.js"></script>
<script src="/src/module-trampoline.js"></script>
</head>
<body>
<div id="content" style="margin:0;padding:0"></div>
</body>
</html>

View File

@ -25,14 +25,14 @@
"use strict";
import {substituteFulfillmentUrl} from "../lib/wallet/helpers";
import {substituteFulfillmentUrl} from "src/helpers";
import BrowserClickedEvent = chrome.browserAction.BrowserClickedEvent;
import {HistoryRecord, HistoryLevel} from "../lib/wallet/wallet";
import {HistoryRecord, HistoryLevel} from "src/wallet";
import {
AmountJson, WalletBalance, Amounts,
WalletBalanceEntry
} from "../lib/wallet/types";
import {abbrev, prettyAmount} from "../lib/wallet/renderHtml";
} from "src/types";
import {abbrev, prettyAmount} from "src/renderHtml";
declare var i18n: any;

View File

@ -31,7 +31,7 @@ header #logo {
margin: 0;
text-align: center;
border-right: 1px solid black;
background-image: url(../img/logo.png);
background-image: url(/img/logo.png);
background-size: 100px;
}

View File

@ -379,9 +379,9 @@ export function wxMain() {
let uri = URI(tab.url);
if (uri.protocol() == "http" || uri.protocol() == "https") {
console.log("injecting into existing tab", tab.id);
chrome.tabs.executeScript(tab.id, { file: "lib/vendor/URI.js" });
chrome.tabs.executeScript(tab.id, { file: "lib/taler-wallet-lib.js" });
chrome.tabs.executeScript(tab.id, { file: "content_scripts/notify.js" });
chrome.tabs.executeScript(tab.id, { file: "/src/vendor/URI.js" });
chrome.tabs.executeScript(tab.id, { file: "/src/taler-wallet-lib.js" });
chrome.tabs.executeScript(tab.id, { file: "/src/content_scripts/notify.js" });
}
}
});

View File

@ -13,34 +13,39 @@
"noImplicitAny": true
},
"files": [
"lib/components.ts",
"lib/refs.d.ts",
"lib/i18n.ts",
"lib/taler-wallet-lib.ts",
"lib/wallet/checkable.ts",
"lib/wallet/chromeBadge.ts",
"lib/wallet/cryptoApi-test.ts",
"lib/wallet/cryptoApi.ts",
"lib/wallet/emscriptif-test.ts",
"lib/wallet/cryptoLib.ts",
"lib/wallet/cryptoWorker.ts",
"lib/wallet/types-test.ts",
"lib/wallet/db.ts",
"lib/wallet/emscriptif.ts",
"lib/wallet/helpers.ts",
"lib/wallet/http.ts",
"lib/wallet/query.ts",
"lib/wallet/types.ts",
"lib/wallet/wallet.ts",
"lib/wallet/wxApi.ts",
"lib/wallet/wxMessaging.ts",
"lib/wallet/renderHtml.tsx",
"background/main.ts",
"content_scripts/notify.ts",
"popup/popup.tsx",
"pages/show-db.ts",
"pages/confirm-contract.tsx",
"pages/confirm-create-reserve.tsx",
"pages/tree.tsx"
"src/checkable.ts",
"decl/lib.es6.d.ts",
"src/chromeBadge.ts",
"decl/urijs/URIjs.d.ts",
"src/cryptoApi-test.ts",
"src/components.ts",
"decl/systemjs/systemjs.d.ts",
"src/emscriptif-test.ts",
"src/cryptoApi.ts",
"decl/react-global.d.ts",
"src/types-test.ts",
"src/cryptoLib.ts",
"decl/chrome/chrome.d.ts",
"src/cryptoWorker.ts",
"src/db.ts",
"src/emscriptif.ts",
"src/helpers.ts",
"src/http.ts",
"src/i18n.ts",
"src/query.ts",
"src/taler-wallet-lib.ts",
"src/types.ts",
"src/wallet.ts",
"src/wxApi.ts",
"src/wxMessaging.ts",
"src/renderHtml.tsx",
"src/background/background.ts",
"src/content_scripts/notify.ts",
"src/emscripten/taler-emscripten-lib.d.ts",
"src/pages/show-db.ts",
"src/pages/confirm-contract.tsx",
"src/pages/confirm-create-reserve.tsx",
"src/pages/tree.tsx",
"src/popup/popup.tsx"
]
}