Create a settings app to manage user objects

pull/1/head
yflory 8 years ago
parent 71b84afdb2
commit cd9cea8fa4

@ -10,7 +10,9 @@
<script src="/bower_components/jquery/dist/jquery.min.js"></script> <script src="/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script> <script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-main="/customize/main" src="/bower_components/requirejs/require.js"></script> <script data-main="/customize/main" src="/bower_components/requirejs/require.js"></script>
<script src="/bower_components/requirejs/require.js"></script> <script src="/bower_components/requirejs/require.js"></script>
<script> <script>
require.config({ require.config({
@ -22,7 +24,7 @@
<div id="cryptpadTopBar"> <div id="cryptpadTopBar">
<span> <span>
<a class="gotoMain" href="/"> <a class="gotoMain" href="/">
<img src="customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad <img src="/customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad
</a> </a>
</span> </span>

@ -10,7 +10,9 @@
<script src="/bower_components/jquery/dist/jquery.min.js"></script> <script src="/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script> <script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-main="/customize/main" src="/bower_components/requirejs/require.js"></script> <script data-main="/customize/main" src="/bower_components/requirejs/require.js"></script>
<script src="/bower_components/requirejs/require.js"></script> <script src="/bower_components/requirejs/require.js"></script>
<script> <script>
require.config({ require.config({
@ -22,7 +24,7 @@
<div id="cryptpadTopBar"> <div id="cryptpadTopBar">
<span> <span>
<a class="gotoMain" href="/"> <a class="gotoMain" href="/">
<img src="customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad <img src="/customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad
</a> </a>
</span> </span>

@ -113,6 +113,14 @@ define([
return storeObj.login_name; return storeObj.login_name;
}; };
ret.repairDrive = function () {
filesOp.fixFiles();
};
ret.getEmptyObject = function () {
return filesOp.getStructure();
};
var changeHandlers = ret.changeHandlers = []; var changeHandlers = ret.changeHandlers = [];
ret.change = function (f) {}; ret.change = function (f) {};

@ -10,7 +10,9 @@
<script src="/bower_components/jquery/dist/jquery.min.js"></script> <script src="/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script> <script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-main="/customize/main" src="/bower_components/requirejs/require.js"></script> <script data-main="/customize/main" src="/bower_components/requirejs/require.js"></script>
<script src="/bower_components/requirejs/require.js"></script> <script src="/bower_components/requirejs/require.js"></script>
<script> <script>
require.config({ require.config({
@ -22,7 +24,7 @@
<div id="cryptpadTopBar"> <div id="cryptpadTopBar">
<span> <span>
<a class="gotoMain" href="/"> <a class="gotoMain" href="/">
<img src="customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad <img src="/customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad
</a> </a>
</span> </span>
@ -76,14 +78,8 @@
</div> </div>
<div id="userForm" class="form-group hidden"> <div id="userForm" class="form-group hidden">
<input type="text" id="name" name="name" class="form-control" data-localization-placeholder="login_username" autofocus>
<input type="password" id="password" name="password" class="form-control" data-localization-placeholder="login_password">
<input type="text" id="name" name="name" class="form-control"
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
data-localization-placeholder="login_username" autofocus>
<input type="password" id="password" name="password" class="form-control"
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
data-localization-placeholder="login_password">
<div style="display: none;"><span class="remember form-check"><label for="rememberme" class="form-check-label" data-localization-append="login_remember"><input type="checkbox" id="rememberme" class="form-check-input" checked="checked"></label></span><br></div> <div style="display: none;"><span class="remember form-check"><label for="rememberme" class="form-check-label" data-localization-append="login_remember"><input type="checkbox" id="rememberme" class="form-check-input" checked="checked"></label></span><br></div>
<button class="btn btn-secondary login half first" data-localization="login_login"></button> <button class="btn btn-success register half" data-localization="login_register"></button> <button class="btn btn-secondary login half first" data-localization="login_login"></button> <button class="btn btn-success register half" data-localization="login_register"></button>
<p class="separator" data-localization="login_orNoLogin"></p> <p class="separator" data-localization="login_orNoLogin"></p>

@ -10,7 +10,9 @@
<script src="/bower_components/jquery/dist/jquery.min.js"></script> <script src="/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script> <script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-main="/customize/main" src="/bower_components/requirejs/require.js"></script> <script data-main="/customize/main" src="/bower_components/requirejs/require.js"></script>
<script src="/bower_components/requirejs/require.js"></script> <script src="/bower_components/requirejs/require.js"></script>
<script> <script>
require.config({ require.config({
@ -22,7 +24,7 @@
<div id="cryptpadTopBar"> <div id="cryptpadTopBar">
<span> <span>
<a class="gotoMain" href="/"> <a class="gotoMain" href="/">
<img src="customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad <img src="/customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad
</a> </a>
</span> </span>

@ -31,7 +31,10 @@ var fragments = {};
'contact', 'contact',
'logo', 'logo',
'noscript', 'noscript',
'footer' 'footer',
'empty',
'script',
'appscript'
].forEach(function (name) { ].forEach(function (name) {
fragments[name] = read('./fragments/' + name + '.html'); fragments[name] = read('./fragments/' + name + '.html');
}); });
@ -41,7 +44,7 @@ var fragments = {};
var source = swap(template, { var source = swap(template, {
topbar: fragments.topbar, topbar: fragments.topbar,
fork: fragments.fork, fork: fragments.fork,
main: swap(fragments[page], { main: swap(fragments[page] || fragments.empty, {
topbar: fragments.topbar, topbar: fragments.topbar,
fork: fragments.fork, fork: fragments.fork,
logo: fragments.logo, logo: fragments.logo,
@ -51,6 +54,29 @@ var fragments = {};
logo: fragments.logo, logo: fragments.logo,
noscript: fragments.noscript, noscript: fragments.noscript,
footer: fragments.footer, footer: fragments.footer,
script: fragments.script
}); });
write('../' + page + '.html', source); write('../' + page + '.html', source);
}); });
// build static pages
['../www/settings/index'].forEach(function (page) {
var source = swap(template, {
topbar: fragments.topbar,
fork: fragments.fork,
main: swap(fragments[page] || fragments.empty, {
topbar: fragments.topbar,
fork: fragments.fork,
logo: fragments.logo,
noscript: fragments.noscript,
footer: fragments.footer,
}),
logo: fragments.logo,
noscript: fragments.noscript,
footer: fragments.footer,
script: fragments.appscript
});
write('../' + page + '.html', source);
});

@ -1,7 +1,7 @@
<div id="cryptpadTopBar"> <div id="cryptpadTopBar">
<span> <span>
<a class="gotoMain" href="/"> <a class="gotoMain" href="/">
<img src="customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad <img src="/customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad
</a> </a>
</span> </span>

@ -10,7 +10,7 @@
<script src="/bower_components/jquery/dist/jquery.min.js"></script> <script src="/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script> <script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-main="/customize/main" src="/bower_components/requirejs/require.js"></script> {{script}}
<script src="/bower_components/requirejs/require.js"></script> <script src="/bower_components/requirejs/require.js"></script>
<script> <script>
require.config({ require.config({

@ -10,7 +10,9 @@
<script src="/bower_components/jquery/dist/jquery.min.js"></script> <script src="/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script> <script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-main="/customize/main" src="/bower_components/requirejs/require.js"></script> <script data-main="/customize/main" src="/bower_components/requirejs/require.js"></script>
<script src="/bower_components/requirejs/require.js"></script> <script src="/bower_components/requirejs/require.js"></script>
<script> <script>
require.config({ require.config({
@ -22,7 +24,7 @@
<div id="cryptpadTopBar"> <div id="cryptpadTopBar">
<span> <span>
<a class="gotoMain" href="/"> <a class="gotoMain" href="/">
<img src="customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad <img src="/customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad
</a> </a>
</span> </span>

@ -16,7 +16,7 @@
"scripts": { "scripts": {
"lint": "jshint --config .jshintrc --exclude-path .jshintignore .", "lint": "jshint --config .jshintrc --exclude-path .jshintignore .",
"test": "node TestSelenium.js", "test": "node TestSelenium.js",
"style": "lessc ./customize.dist/src/less/cryptpad.less > ./customize.dist/main.css && lessc ./customize.dist/src/less/toolbar.less > ./customize.dist/toolbar.css && lessc ./www/drive/file.less > ./www/drive/file.css", "style": "lessc ./customize.dist/src/less/cryptpad.less > ./customize.dist/main.css && lessc ./customize.dist/src/less/toolbar.less > ./customize.dist/toolbar.css && lessc ./www/drive/file.less > ./www/drive/file.css && lessc ./www/settings/main.less > ./www/settings/main.css",
"template": "cd customize.dist/src && node build.js" "template": "cd customize.dist/src && node build.js"
} }
} }

@ -30,6 +30,16 @@ define([
console.error.apply(console, arguments); console.error.apply(console, arguments);
}; };
var getStructure = exp.getStructure = function () {
var a = {};
a[ROOT] = {};
a[UNSORTED] = [];
a[TRASH] = {};
a[FILES_DATA] = [];
a[TEMPLATE] = [];
return a;
};
var comparePath = exp.comparePath = function (a, b) { var comparePath = exp.comparePath = function (a, b) {
if (!a || !b || !$.isArray(a) || !$.isArray(b)) { return false; } if (!a || !b || !$.isArray(a) || !$.isArray(b)) { return false; }
if (a.length !== b.length) { return false; } if (a.length !== b.length) { return false; }

Loading…
Cancel
Save