From a78debc461944f55de246db15a1dd29353dec4ae Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Thu, 8 Oct 2015 23:25:04 +0200 Subject: Support app deployment under a path prefix Fixes #133 --- client/components/main/header.jade | 4 ++-- client/components/main/layouts.jade | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'client/components/main') diff --git a/client/components/main/header.jade b/client/components/main/header.jade index 4715bfc8..86dfd6a7 100644 --- a/client/components/main/header.jade +++ b/client/components/main/header.jade @@ -43,10 +43,10 @@ template(name="header") the list of all boards. if isSandstorm .wekan-logo - img(src="/wekan-logo-header.png" alt="Wekan") + img(src="{{pathFor '/wekan-logo-header.png'}}" alt="Wekan") else a.wekan-logo(href="{{pathFor 'home'}}" title="{{_ 'header-logo-title'}}") - img(src="/wekan-logo-header.png" alt="Wekan") + img(src="{{pathFor '/wekan-logo-header.png'}}" alt="Wekan") template(name="headerTitle") h1 {{_ 'my-boards'}} diff --git a/client/components/main/layouts.jade b/client/components/main/layouts.jade index f5a8db59..166f143a 100644 --- a/client/components/main/layouts.jade +++ b/client/components/main/layouts.jade @@ -2,12 +2,16 @@ head title Wekan meta(name="viewport" content="maximum-scale=1.0,width=device-width,initial-scale=1.0,user-scalable=0") + //- XXX We should use pathFor in the following `href` to support the case + where the application is deployed with a path prefix, but it seems to be + difficult to do that cleanly with Blaze -- at least without adding extra + packages. link(rel="shortcut icon" href="/wekan-favicon.png") template(name="userFormsLayout") section.auth-layout h1.at-form-landing-logo - img(src="/wekan-logo.png" alt="Wekan") + img(src="{{pathFor '/wekan-logo.png'}}" alt="Wekan") +Template.dynamic(template=content) template(name="defaultLayout") -- cgit v1.2.3-1-g7c22 From 8bbc69616f91e9d09302d8a00f845b74e37d535f Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Tue, 13 Oct 2015 18:36:58 +0200 Subject: Abstract the jquery-textcomplete integration with EscapeActions We now can re-use this integration in multiple places, this will be useful for #342 for instance. --- client/components/main/editor.js | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'client/components/main') diff --git a/client/components/main/editor.js b/client/components/main/editor.js index 1d88fe74..67b65bec 100644 --- a/client/components/main/editor.js +++ b/client/components/main/editor.js @@ -1,11 +1,9 @@ -let dropdownMenuIsOpened = false; - Template.editor.onRendered(() => { const $textarea = this.$('textarea'); autosize($textarea); - $textarea.textcomplete([ + $textarea.escapeableTextComplete([ // Emojies { match: /\B:([\-+\w]*)$/, @@ -44,30 +42,8 @@ Template.editor.onRendered(() => { index: 1, }, ]); - - // Since commit d474017 jquery-textComplete automatically closes a potential - // opened dropdown menu when the user press Escape. This behavior conflicts - // with our EscapeActions system, but it's too complicated and hacky to - // monkey-pach textComplete to disable it -- I tried. Instead we listen to - // 'open' and 'hide' events, and create a ghost escapeAction when the dropdown - // is opened (and rely on textComplete to execute the actual action). - $textarea.on({ - 'textComplete:show'() { - dropdownMenuIsOpened = true; - }, - 'textComplete:hide'() { - Tracker.afterFlush(() => { - dropdownMenuIsOpened = false; - }); - }, - }); }); -EscapeActions.register('textcomplete', - () => {}, - () => dropdownMenuIsOpened -); - // XXX I believe we should compute a HTML rendered field on the server that // would handle markdown, emojies and user mentions. We can simply have two // fields, one source, and one compiled version (in HTML) and send only the -- cgit v1.2.3-1-g7c22 From 118b434a5aad35df8eefea85624ab9abafab56f0 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Tue, 20 Oct 2015 20:02:12 +0200 Subject: Provide a default date for lists and cards creation date See https://github.com/wekan/wekan/pull/362#issuecomment-149645497 for motivation. This commit also contains cosmetic changes to the import Popup and on the code style to be more consistent with the code base. --- client/components/main/popup.styl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'client/components/main') diff --git a/client/components/main/popup.styl b/client/components/main/popup.styl index 3bef4f7d..8a685069 100644 --- a/client/components/main/popup.styl +++ b/client/components/main/popup.styl @@ -17,9 +17,11 @@ $popupWidth = 300px margin: 4px -10px width: $popupWidth + p, + textarea, input[type="text"], input[type="email"], - input[type="password"] + input[type="password"], input[type="file"] margin: 4px 0 12px width: 100% @@ -30,8 +32,6 @@ $popupWidth = 300px textarea height: 72px - margin: 4px 0 12px - width: 100% .header height: 36px -- cgit v1.2.3-1-g7c22 From aa974aa54ab6e5b7db7450206d12b44ffb3a0306 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Thu, 22 Oct 2015 04:02:12 +0200 Subject: Prefer ES5 methods over underscore utilities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 07cc454 (ie the switch to Meteor 1.2) we includes the `es5-shim` polyfill to support methods like `Array.prototype.forEach` in a consistent way across all supported browsers (IE8+). MDG recently released a blog post recommending the use of these native methods instead of underscore [0]. We know follow this recommendation. This commit also favor some ES6 features (argument defaults, destructing assignment) in places where we didn’t use them. [0]: http://info.meteor.com/blog/es2015-get-started --- client/components/main/editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/components/main') diff --git a/client/components/main/editor.js b/client/components/main/editor.js index 67b65bec..168c85d0 100644 --- a/client/components/main/editor.js +++ b/client/components/main/editor.js @@ -54,7 +54,7 @@ const at = HTML.CharRef({html: '@', str: '@'}); Blaze.Template.registerHelper('mentions', new Template('mentions', function() { const view = this; const currentBoard = Boards.findOne(Session.get('currentBoard')); - const knowedUsers = _.map(currentBoard.members, (member) => { + const knowedUsers = currentBoard.members.map((member) => { member.username = Users.findOne(member.userId).username; return member; }); -- cgit v1.2.3-1-g7c22 From 31b60d82fcae64a844805a2a76a0af25fb9c16c2 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Fri, 23 Oct 2015 16:56:55 +0200 Subject: Upgrade Meteor to 1.2.1-rc4 This version includes a more complete selection of ES2015 polyfills that I started used across the code base, for instance by replacing `$.trim(str)` by `str.trim()`. --- client/components/main/editor.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'client/components/main') diff --git a/client/components/main/editor.js b/client/components/main/editor.js index 168c85d0..82fce641 100644 --- a/client/components/main/editor.js +++ b/client/components/main/editor.js @@ -8,8 +8,8 @@ Template.editor.onRendered(() => { { match: /\B:([\-+\w]*)$/, search(term, callback) { - callback($.map(Emoji.values, (emoji) => { - return emoji.indexOf(term) === 0 ? emoji : null; + callback(Emoji.values.map((emoji) => { + return emoji.includes(term) ? emoji : null; })); }, template(value) { @@ -28,9 +28,9 @@ Template.editor.onRendered(() => { match: /\B@(\w*)$/, search(term, callback) { const currentBoard = Boards.findOne(Session.get('currentBoard')); - callback($.map(currentBoard.members, (member) => { + callback(currentBoard.members.map((member) => { const username = Users.findOne(member.userId).username; - return username.indexOf(term) === 0 ? username : null; + return username.includes(term) ? username : null; })); }, template(value) { -- cgit v1.2.3-1-g7c22