Skip to content

Commit 9ae5f2e

Browse files
author
Rémy HUBSCHER
committed
Update sync-v5 with 1.9.0 code.
2 parents 100eb7f + 3523431 commit 9ae5f2e

File tree

12 files changed

+57
-32
lines changed

12 files changed

+57
-32
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![CircleCI](https://circleci.com/gh/mozilla/notes/tree/master.svg?style=svg)](https://circleci.com/gh/mozilla/notes/tree/master)
44
[![Available on Test Pilot](https://img.shields.io/badge/available_on-Test_Pilot-0996F8.svg)](https://testpilot.firefox.com/experiments/notes)
5+
[![Waffle.io - Bug Triage](https://badge.waffle.io/mozilla/notes.svg?columns=all)](https://waffle.io/mozilla/notes)
56

67
## What does it aim for
78

@@ -43,4 +44,4 @@ Firefox Notes localization is managed via [Pontoon](https://pontoon.mozilla.org/
4344

4445
Design for reference https://mozilla.invisionapp.com/share/6VBUYHMRB#/235284916_Desktop_Sidebar
4546

46-
![Notes Screenshot](https://i.imgur.com/kHwBN2f.png)
47+
![Notes Screenshot](https://i.imgur.com/lQM0tpr.png)

ckeditor-build/src/ckeditor.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
import ClassicEditorBase from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
77
import EssentialsPlugin from '@ckeditor/ckeditor5-essentials/src/essentials';
8-
import MarkdownPlugin from './markdown';
98
import AutoformatPlugin from '@ckeditor/ckeditor5-autoformat/src/autoformat';
109
import BoldPlugin from '@ckeditor/ckeditor5-basic-styles/src/bold';
1110
import ItalicPlugin from '@ckeditor/ckeditor5-basic-styles/src/italic';
1211
import StrikePlugin from './strike';
1312
import CodePlugin from '@ckeditor/ckeditor5-basic-styles/src/code';
13+
import UnderlinePlugin from '@ckeditor/ckeditor5-basic-styles/src/underline';
1414
import HeadingPlugin from '@ckeditor/ckeditor5-heading/src/heading';
1515
import ListPlugin from '@ckeditor/ckeditor5-list/src/list';
1616
import ParagraphPlugin from '@ckeditor/ckeditor5-paragraph/src/paragraph';
@@ -21,12 +21,12 @@ export default class ClassicEditor extends ClassicEditorBase {}
2121
ClassicEditor.build = {
2222
plugins: [
2323
EssentialsPlugin,
24-
MarkdownPlugin,
2524
AutoformatPlugin,
2625
BoldPlugin,
2726
ItalicPlugin,
2827
StrikePlugin,
2928
CodePlugin,
29+
UnderlinePlugin,
3030
HeadingPlugin,
3131
ListPlugin,
3232
ParagraphPlugin

ckeditor-build/src/markdown.js

-6
This file was deleted.

locales/es-AR/notes.properties

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
welcomeTitle2=¡Hola!
22
welcomeText2=Bienvenido a este bloc de notas de una página integrado en Firefox. Navegar la web. Tomar notas. Así de simple.
33

4+
migratedEditor=Reemplazamos el editor de texto en Notes para mejor velocidad y funcionalidad pero tuvimos que eliminar el formato de las notas existentes. Disculpas por el inconveniente, apreciamos tu participación.
5+
46
emptyPlaceHolder=Tomar nota…
57

68
giveFeedback=Clic aquí para darnos tu opinión

locales/es-ES/notes.properties

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
welcomeTitle2=¡Hola!
22
welcomeText2=Bienvenido a este bloc de notas integrado en Firefox. Navega por la web y anota. Es así de sencillo.
33

4+
migratedEditor=Hemos mejorado el editor de texto de Notes con más velocidad y funcionalidades, pero tuvimos que eliminar el formato de las notas que ya tenías. Lo sentimos, pero te agradecemos que lo uses.
5+
46
emptyPlaceHolder=Tomar notas…
57

68
giveFeedback=Haz clic aquí para darnos tu opinión

locales/es-MX/notes.properties

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
welcomeTitle2=¡Hola!
22
welcomeText2=Bienvenido a este bloc de notas integrado en Firefox. Navega por la web y anota. Así de sencillo.
33

4+
migratedEditor=Reemplazamos el editor de texto en Notas para una mayor velocidad y funcionalidad, pero tuvimos que eliminar el formato de tus notas existentes. ¡Lo sentimos, pero agradecemos tu participación!
5+
46
emptyPlaceHolder=Toma nota…
57

68
giveFeedback=Haz clic aquí para hacernos algunos comentarios

locales/nn-NO/notes.properties

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
welcomeTitle2=Hei!
22
welcomeText2=Velkomen til denne sida med innebygd «enkel tekst» i Firefox. Surf på nettet. Skribl ned notat. Så enkelt er det.
33

4+
migratedEditor=Vi erstatta tekstredigeringsprogrammet i Notes for betre fart og funksjonalitet, men måtte fjerne formateringa av eksisterande notat. Beklagar, men vi set pris på deltakinga di!
5+
46
emptyPlaceHolder=Skriv eit notat…
57

68
giveFeedback=Klikk her for å gje oss tilbakemelding

locales/sr/notes.properties

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
welcomeTitle2=Здраво!
22
welcomeText2=Добродошли на једностранични нотес уграђен у Firefox. Сурфујте вебом. Запишите белешке. Једноставно је.
33

4+
migratedEditor=Заменили смо едитор текста у Notes-у ради веће брзине и боље функционисање, али смо морали да уклонимо форматирање ваших постојећих нота. Жао нам је због тога, али ценимо ваше учествовање!
5+
46
emptyPlaceHolder=Забележи ноту…
57

68
giveFeedback=Кликните овде за повратну информацију

locales/sv-SE/notes.properties

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
welcomeTitle2=Hej!
22
welcomeText2=Välkommen till den här sidan med ett inbyggt anteckningsblock i Firefox. Surfa på webben. Krafsa ner anteckningar. Så enkelt är det.
33

4+
migratedEditor=Vi ersatte textredigeraren i Notes för högre hastighet och funktionalitet, men måste ta bort formateringen av dina befintliga anteckningar. Ledsen för det, men vi uppskattar ditt deltagande!
5+
46
emptyPlaceHolder=Gör en anteckning…
57

68
giveFeedback=Klicka här för att ge oss lite återkoppling

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"url": "https://github.com/mozilla/notes/issues"
99
},
1010
"dependencies": {
11-
"@ckeditor/ckeditor5-autoformat": "^1.0.0-alpha.2",
11+
"@ckeditor/ckeditor5-autoformat": "vladikoff/ckeditor5-autoformat#fix-numbered-list",
1212
"@ckeditor/ckeditor5-basic-styles": "^1.0.0-alpha.2",
1313
"@ckeditor/ckeditor5-build-classic": "^1.0.0-alpha.2",
1414
"@ckeditor/ckeditor5-dev-utils": "^5.0.0",
@@ -17,7 +17,6 @@
1717
"@ckeditor/ckeditor5-essentials": "^1.0.0-alpha.2",
1818
"@ckeditor/ckeditor5-heading": "vladikoff/ckeditor5-heading#short-heading",
1919
"@ckeditor/ckeditor5-list": "^1.0.0-alpha.2",
20-
"@ckeditor/ckeditor5-markdown-gfm": "^1.0.0-alpha.2",
2120
"@ckeditor/ckeditor5-paragraph": "^1.0.0-alpha.2",
2221
"babel-minify-webpack-plugin": "^0.2.0",
2322
"css-loader": "^0.28.7",

src/sidebar/panel.js

+33-19
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,29 @@ ClassicEditor.create(document.querySelector('#editor'), {
3333
.then(() => {
3434
let ignoreNextLoadEvent = false;
3535

36-
editor.document.on('change', () => {
37-
const content = editor.getData();
38-
39-
if (!ignoreNextLoadEvent) {
40-
// Debounce this second event
41-
chrome.runtime.sendMessage({
42-
action: 'kinto-save',
43-
content
36+
editor.document.on('change', (eventInfo, name) => {
37+
const isFocused = document.querySelector('.ck-editor__editable').classList.contains('ck-focused');
38+
// Only use the focused editor or handle 'rename' events to set the data into storage.
39+
if (isFocused || name === 'rename') {
40+
const content = editor.getData();
41+
browser.storage.local.set({ notes2: content }).then(() => {
42+
// Notify other sidebars
43+
if (!ignoreNextLoadEvent) {
44+
chrome.runtime.sendMessage('[email protected]', {
45+
action: 'kinto-save',
46+
content
47+
});
48+
49+
updateSavingIndicator();
50+
// Debounce this second event
51+
chrome.runtime.sendMessage({
52+
action: 'metrics-changed',
53+
context: getPadStats(editor)
54+
});
55+
} else {
56+
ignoreNextLoadEvent = false;
57+
}
4458
});
45-
46-
// Debounce this second event
47-
chrome.runtime.sendMessage({
48-
action: 'metrics-changed',
49-
context: getPadStats(editor)
50-
});
51-
} else {
52-
ignoreNextLoadEvent = false;
5359
}
5460
});
5561

@@ -78,6 +84,14 @@ ClassicEditor.create(document.querySelector('#editor'), {
7884
});
7985
});
8086

87+
// Fixes an issue with CKEditor and keeping multiple Firefox windows in sync
88+
// Ref: https://github.com/mozilla/notes/issues/424
89+
document.querySelectorAll('.ck-heading-dropdown .ck-list__item').forEach((btn) => {
90+
btn.addEventListener('click', () => {
91+
editor.fire('changesDone');
92+
});
93+
});
94+
8195
localizeEditorButtons();
8296
});
8397

@@ -89,7 +103,7 @@ ClassicEditor.create(document.querySelector('#editor'), {
89103
let ignoreNextLoadEvent = false;
90104
function handleLocalContent(editor, data) {
91105
if (!data.hasOwnProperty('notes2')) {
92-
editor.setData(`## ${browser.i18n.getMessage('welcomeTitle2')}\n\n${browser.i18n.getMessage('welcomeText2')}`);
106+
editor.setData(`<h2>${browser.i18n.getMessage('welcomeTitle2')}</h2><p>${browser.i18n.getMessage('welcomeText2')}</p>`);
93107
} else {
94108
if (JSON.stringify(editor.getData()) !== JSON.stringify(data.notes2)) {
95109
editor.setData(data.notes2);
@@ -403,8 +417,8 @@ function localizeEditorButtons () {
403417
bold = document.querySelector('button.ck-button:nth-child(2)'),
404418
italic = document.querySelector('button.ck-button:nth-child(3)'),
405419
strike = document.querySelector('button.ck-button:nth-child(4)'),
406-
ordered = document.querySelector('button.ck-button:nth-child(5)'),
407-
bullet = document.querySelector('button.ck-button:nth-child(6)');
420+
bullet = document.querySelector('button.ck-button:nth-child(5)'),
421+
ordered = document.querySelector('button.ck-button:nth-child(6)');
408422

409423
// Setting button titles in place of tooltips
410424
size.title = browser.i18n.getMessage('fontSizeTitle');

src/sidebar/styles.css

+7-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ body .ck-editor .ck-editor__editable {
4747
}
4848

4949
.ck-editor__editable ol, .ck-editor__editable ul {
50-
padding-left: 10px;
50+
padding-left: 20px;
5151
}
5252

5353
/**
@@ -366,18 +366,23 @@ CKEditor overrides
366366

367367
#notes .ck-editor__editable p {
368368
margin: 5px 0;
369+
font-size: 14px;
369370
}
370371

371372
#notes .ck-editor__editable h1 {
372-
margin: 10px 0;
373+
margin: 2px 0;
374+
font-size: 24px;
375+
padding: 0;
373376
}
374377

375378
#notes .ck-editor__editable h2 {
376379
margin: 7px 0;
380+
font-size: 20px;
377381
}
378382

379383
#notes .ck-editor__editable h3 {
380384
margin: 5px 0;
385+
font-size: 16px;
381386
}
382387

383388
.ck-heading-dropdown button {

0 commit comments

Comments
 (0)