profile download implemented; closes #16
This commit is contained in:
@@ -250,10 +250,10 @@ EOF
|
|||||||
# use this in configure.ac to support HTML data for webservers
|
# use this in configure.ac to support HTML data for webservers
|
||||||
AC_DEFUN([AX_BUILD_HTML], [
|
AC_DEFUN([AX_BUILD_HTML], [
|
||||||
AC_CONFIG_FILES([html/makefile])
|
AC_CONFIG_FILES([html/makefile])
|
||||||
AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-example-targets], [html/makefile.in])
|
AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-html-targets], [html/makefile.in])
|
||||||
test -f html/makefile.in && cat >> examples/html.in <<EOF
|
test -f html/makefile.in && cat >> html/makefile.in <<EOF
|
||||||
#### Begin: Appended by $0
|
#### Begin: Appended by $0
|
||||||
maintainer-clean-example-targets:
|
maintainer-clean-html-targets:
|
||||||
-rm makefile.in
|
-rm makefile.in
|
||||||
#### End: $0
|
#### End: $0
|
||||||
EOF
|
EOF
|
||||||
|
16
bootstrap.sh
16
bootstrap.sh
@@ -40,7 +40,7 @@ SYNOPSIS
|
|||||||
OPTIONS
|
OPTIONS
|
||||||
|
|
||||||
--configure, -c call ./configure after initialization
|
--configure, -c call ./configure after initialization
|
||||||
--build, -c build, also call ./configure && make
|
--build, -b build, also call ./configure && make
|
||||||
--overwrite, -o overwrite all basic files (bootstrap.sh, m4-macros)
|
--overwrite, -o overwrite all basic files (bootstrap.sh, m4-macros)
|
||||||
--rebuild, -r force rebuild of generated files, even if modified
|
--rebuild, -r force rebuild of generated files, even if modified
|
||||||
--rebuild-file, -f <file> rebild specific file (can be added multiple times)
|
--rebuild-file, -f <file> rebild specific file (can be added multiple times)
|
||||||
@@ -102,6 +102,8 @@ GENERATED FILES
|
|||||||
* ax_check_qt.m4 - auxiliary macro definition file
|
* ax_check_qt.m4 - auxiliary macro definition file
|
||||||
* mac-create-app-bundle.sh - script to create apple mac os-x app-bundle
|
* mac-create-app-bundle.sh - script to create apple mac os-x app-bundle
|
||||||
* AUTHORS - replace your name in AUTHORS before first run
|
* AUTHORS - replace your name in AUTHORS before first run
|
||||||
|
* NEWS - empty file add your project's news
|
||||||
|
* README - add project description (first line is header, followed by an empty line)
|
||||||
* configure.ac - global configuration file template
|
* configure.ac - global configuration file template
|
||||||
* makefile.am - global makefile template
|
* makefile.am - global makefile template
|
||||||
* src/makefile.am - if you enabled AX_USE_CXX
|
* src/makefile.am - if you enabled AX_USE_CXX
|
||||||
@@ -146,6 +148,7 @@ FILES TO EDIT
|
|||||||
|
|
||||||
The following files normally require editing:
|
The following files normally require editing:
|
||||||
* AUTHORS
|
* AUTHORS
|
||||||
|
* NEWS
|
||||||
* README
|
* README
|
||||||
* configure.ac
|
* configure.ac
|
||||||
* src/makefile.am
|
* src/makefile.am
|
||||||
@@ -175,6 +178,7 @@ FILES
|
|||||||
* AUTHORS: First line is the main author and used in Debian and RPM
|
* AUTHORS: First line is the main author and used in Debian and RPM
|
||||||
packaging, so there must be a GPG key that matches
|
packaging, so there must be a GPG key that matches
|
||||||
to this line.
|
to this line.
|
||||||
|
* NEWS: File to add project news.
|
||||||
* README: First line is a short description of your project, then an
|
* README: First line is a short description of your project, then an
|
||||||
empty line must follow. All remaining lines are a
|
empty line must follow. All remaining lines are a
|
||||||
long description of your project. this information
|
long description of your project. this information
|
||||||
@@ -385,6 +389,14 @@ fi
|
|||||||
to AUTHORS <<EOF && notice "please edit AUTHORS"
|
to AUTHORS <<EOF && notice "please edit AUTHORS"
|
||||||
$AUTHOR
|
$AUTHOR
|
||||||
EOF
|
EOF
|
||||||
|
to NEWS <<EOF && notice "please edit NEWS"
|
||||||
|
$(date) created ${DEFAULT_PROJECT_NAME}
|
||||||
|
EOF
|
||||||
|
to README <<EOF && notice "please edit README"
|
||||||
|
${DEFAULT_PROJECT_NAME}
|
||||||
|
|
||||||
|
add description for ${DEFAULT_PROJECT_NAME}
|
||||||
|
EOF
|
||||||
to configure.ac <<EOF && \
|
to configure.ac <<EOF && \
|
||||||
( notice "please edit configure.ac, then rerun $0"; exit 0 )
|
( notice "please edit configure.ac, then rerun $0"; exit 0 )
|
||||||
${HEADER}m4_define(x_package_name, ${DEFAULT_PROJECT_NAME}) # project's name
|
${HEADER}m4_define(x_package_name, ${DEFAULT_PROJECT_NAME}) # project's name
|
||||||
@@ -788,7 +800,7 @@ rm -rf \$RPM_BUILD_ROOT
|
|||||||
$(if testtag AX_USE_LIBTOOL; then
|
$(if testtag AX_USE_LIBTOOL; then
|
||||||
echo '/usr/%_lib/@PACKAGE_NAME@.so.*'
|
echo '/usr/%_lib/@PACKAGE_NAME@.so.*'
|
||||||
else
|
else
|
||||||
/usr/bin/
|
echo /usr/bin/
|
||||||
fi)
|
fi)
|
||||||
%doc
|
%doc
|
||||||
/usr/share/doc/packages/@PACKAGE_NAME@/AUTHORS
|
/usr/share/doc/packages/@PACKAGE_NAME@/AUTHORS
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
m4_define(x_package_name, safechat) # project's name
|
m4_define(x_package_name, safechat) # project's name
|
||||||
m4_define(x_major, 0) # project's major version
|
m4_define(x_major, 0) # project's major version
|
||||||
m4_define(x_minor, 0) # project's minor version
|
m4_define(x_minor, 1) # project's minor version
|
||||||
m4_include(ax_init_standard_project.m4)
|
m4_include(ax_init_standard_project.m4)
|
||||||
AC_INIT(x_package_name, x_version, x_package_name)
|
AC_INIT(x_package_name, x_version, x_package_name)
|
||||||
AM_INIT_AUTOMAKE([1.9 tar-pax])
|
AM_INIT_AUTOMAKE([1.9 tar-pax])
|
||||||
|
@@ -24,10 +24,7 @@
|
|||||||
|
|
||||||
<ul id="menu" style="display: none">
|
<ul id="menu" style="display: none">
|
||||||
<li onclick="backup()">Download Backup</li>
|
<li onclick="backup()">Download Backup</li>
|
||||||
<li>
|
<li class="toolbutton"><label for="restore">Restore Backup</label><input autocomplete="off" type="file" accept="text/*" id="restore" /></li>
|
||||||
<label for="restore">Restore: Upload Backup</label>
|
|
||||||
<input autocomplete="off" type="file" accept="text/*" id="restore" />
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<script>
|
<script>
|
||||||
$("#restore").change(function(evt){restore(evt)});
|
$("#restore").change(function(evt){restore(evt)});
|
||||||
|
@@ -121,9 +121,10 @@ td:last-child {
|
|||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
#menu li {
|
#menu li, #menu li * {
|
||||||
padding: 0 1em 0 1em;
|
padding: 0 1em 0 1em;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
text-align: left;
|
||||||
}
|
}
|
||||||
#menu li + li {
|
#menu li + li {
|
||||||
border-top: 1px solid black;
|
border-top: 1px solid black;
|
||||||
|
@@ -139,7 +139,7 @@ function togglemenu() {
|
|||||||
|
|
||||||
/// Download Profile Backup
|
/// Download Profile Backup
|
||||||
function backup() {
|
function backup() {
|
||||||
status("<p>Starting Download...</p>");
|
status("<p>Starting backup download ...</p>");
|
||||||
var download = document.createElement('a');
|
var download = document.createElement('a');
|
||||||
download.href = 'data:attachment/text,'+encodeURI(JSON.stringify(localStorage));
|
download.href = 'data:attachment/text,'+encodeURI(JSON.stringify(localStorage));
|
||||||
download.target = '_blank';
|
download.target = '_blank';
|
||||||
@@ -155,11 +155,29 @@ function backup() {
|
|||||||
});
|
});
|
||||||
download.dispatchEvent(clickEvent);
|
download.dispatchEvent(clickEvent);
|
||||||
togglemenu();
|
togglemenu();
|
||||||
setTimeout(start, 20000);
|
setTimeout(start, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Upload Profile Backup
|
/// Upload Profile Backup
|
||||||
function restore(evt) {
|
function restore(evt) {
|
||||||
|
status("<p>Starting backup restore ...</p>");
|
||||||
|
if (!window.FileReader)
|
||||||
|
return error("your browser dows not support file upload", true);
|
||||||
|
for (var i=0, f; f=evt.target.files[i]; ++i) {
|
||||||
|
var file = f;
|
||||||
|
var reader = new FileReader();
|
||||||
|
reader.onload = function(evt) {
|
||||||
|
if (evt.target.error) return error("error reading file", true);
|
||||||
|
if (evt.target.readyState==0) return notice("waiting for data ...");
|
||||||
|
if (evt.target.readyState==1) return notice("loading data ...");
|
||||||
|
var parsed=JSON.parse(evt.target.result);
|
||||||
|
togglemenu();
|
||||||
|
localStorage.pubKey = parsed.pubKey;
|
||||||
|
localStorage.privKey = parsed.privKey;
|
||||||
|
setTimeout(start, 2000);
|
||||||
|
}
|
||||||
|
reader.readAsText(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check if user name is available
|
/// Check if user name is available
|
||||||
@@ -251,8 +269,8 @@ function createkeypair(user, pwd) {
|
|||||||
passphrase: pwd
|
passphrase: pwd
|
||||||
}).then(function(keyPair) {
|
}).then(function(keyPair) {
|
||||||
success("keys generated");
|
success("keys generated");
|
||||||
localStorage.pubKey = keyPair.publicKeyArmored;
|
localStorage["pubKey"] = keyPair.publicKeyArmored;
|
||||||
localStorage.privKey = keyPair.privateKeyArmored;
|
localStorage["privKey"] = keyPair.privateKeyArmored;
|
||||||
login();
|
login();
|
||||||
}).catch(function(e) {
|
}).catch(function(e) {
|
||||||
error(e);
|
error(e);
|
||||||
@@ -262,15 +280,15 @@ function createkeypair(user, pwd) {
|
|||||||
/// Get Own Public Key
|
/// Get Own Public Key
|
||||||
/** @return public key object */
|
/** @return public key object */
|
||||||
function publicKey() {
|
function publicKey() {
|
||||||
if (typeof localStorage.pubKey == 'undefined') return null;
|
if (typeof localStorage["pubKey"] == 'undefined') return null;
|
||||||
return openpgp.key.readArmored(localStorage.pubKey);
|
return openpgp.key.readArmored(localStorage["pubKey"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get Own Private Key
|
/// Get Own Private Key
|
||||||
/** @return private key object */
|
/** @return private key object */
|
||||||
function privateKey() {
|
function privateKey() {
|
||||||
if (typeof localStorage.privKey == 'undefined') return null;
|
if (typeof localStorage["privKey"] == 'undefined') return null;
|
||||||
return openpgp.key.readArmored(localStorage.privKey);
|
return openpgp.key.readArmored(localStorage["privKey"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get Own User Name
|
/// Get Own User Name
|
||||||
|
Reference in New Issue
Block a user