From 0a435709901eb5d1e8e635a507577cb2d8e56eb5 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 14 Feb 2017 19:07:17 +0100 Subject: [PATCH] Add the new files for the settings app --- customize.dist/src/fragments/appscript.html | 3 + customize.dist/src/fragments/empty.html | 2 + customize.dist/src/fragments/script.html | 2 + www/settings/index.html | 117 +++++++++++++++ www/settings/main.css | 23 +++ www/settings/main.js | 156 ++++++++++++++++++++ www/settings/main.less | 36 +++++ 7 files changed, 339 insertions(+) create mode 100644 customize.dist/src/fragments/appscript.html create mode 100644 customize.dist/src/fragments/empty.html create mode 100644 customize.dist/src/fragments/script.html create mode 100644 www/settings/index.html create mode 100644 www/settings/main.css create mode 100644 www/settings/main.js create mode 100644 www/settings/main.less diff --git a/customize.dist/src/fragments/appscript.html b/customize.dist/src/fragments/appscript.html new file mode 100644 index 000000000..66cc0acea --- /dev/null +++ b/customize.dist/src/fragments/appscript.html @@ -0,0 +1,3 @@ + + + diff --git a/customize.dist/src/fragments/empty.html b/customize.dist/src/fragments/empty.html new file mode 100644 index 000000000..05fd6a0cb --- /dev/null +++ b/customize.dist/src/fragments/empty.html @@ -0,0 +1,2 @@ + +
diff --git a/customize.dist/src/fragments/script.html b/customize.dist/src/fragments/script.html new file mode 100644 index 000000000..99ea023b5 --- /dev/null +++ b/customize.dist/src/fragments/script.html @@ -0,0 +1,2 @@ + + diff --git a/www/settings/index.html b/www/settings/index.html new file mode 100644 index 000000000..5ff8e6529 --- /dev/null +++ b/www/settings/index.html @@ -0,0 +1,117 @@ + + + + Cryptpad: Zero Knowledge, Collaborative Real Time Editing + + + + + + + + + + + + + + + + +
+ + + CryptPad + + + + + + + + About + + + Privacy + + + ToS + + + Contact + +
+ + +
+
+
+ +
+
+ + + + + + + + + + diff --git a/www/settings/main.css b/www/settings/main.css new file mode 100644 index 000000000..c10ea0d6b --- /dev/null +++ b/www/settings/main.css @@ -0,0 +1,23 @@ +.cp #mainBlock { + z-index: 1; + width: 1000px; + max-width: 90%; + margin: auto; +} +.cp #mainBlock #container .infoBlock { + padding: 15px; + border: 1px solid #555; + background: #cccccc; +} +.cp #mainBlock #container .infoBlock .label { + font-weight: bold; + text-decoration: underline; + margin-right: 5px; +} +.cp #mainBlock #container .displayName input, +.cp #mainBlock #container .displayName button { + vertical-align: middle; +} +.cp #mainBlock #container > div { + margin: 10px 0; +} diff --git a/www/settings/main.js b/www/settings/main.js new file mode 100644 index 000000000..cdea74874 --- /dev/null +++ b/www/settings/main.js @@ -0,0 +1,156 @@ +define([ + '/common/cryptpad-common.js', + '/bower_components/jquery/dist/jquery.min.js', +], function (Cryptpad) { + var $ = window.jQuery; + + var USERNAME_KEY = 'cryptpad.username'; + + var APP = { + Cryptpad: Cryptpad, + _onRefresh: [] + }; + + var redirectToMain = function () { + window.location.href = '/'; + }; + + // Manage changes in the realtime object made from another page + var onRefresh = function (h) { + if (typeof(h) !== "function") { return; } + if (APP._onRefresh.indexOf(h) !== -1) { return; } + APP._onRefresh.push(h); + }; + var refresh = APP.refresh = function () { + console.log('chnge'); + APP._onRefresh.forEach(function (h) { + h(); + }); + }; + + // Title block + var createTitle = function () { + return $('

').text('Settings'); //XXX + }; + + var createInfoBlock = function (store) { + var obj = store.proxy; + var $div = $('
', {'class': 'infoBlock'}); + + var accountName = obj.login_name; + if (!accountName) { return; } + var $label = $('', {'class': 'label'}).text('Account name:'); // XXX + var $name = $('').text(accountName); + $div.append($label).append($name); + + return $div; + }; + + // Create the block containing the display name field + var createDisplayNameInput = function (store) { + var obj = store.proxy; + var $div = $('
', {'class': 'displayName'}); + var $label = $('