Skip to content

Commit 1f3d8b4

Browse files
committed
Merge branch 'dev' of https://github.com/zen-browser/desktop into dev
2 parents 5013533 + adc4b95 commit 1f3d8b4

File tree

10 files changed

+105
-27
lines changed

10 files changed

+105
-27
lines changed

l10n

Submodule l10n updated 42 files

src/browser/base/content/zen-panels/popups.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</menupopup>
1010

1111
<menupopup id="zenWorkspaceMoreActions">
12-
<menuitem id="context_zenEditWorkspace" data-l10n-id="zen-panel-ui-workspaces-create" command="cmd_zenChangeWorkspaceName"/>
12+
<menuitem id="context_zenEditWorkspace" data-l10n-id="zen-workspaces-panel-change-name" command="cmd_zenChangeWorkspaceName"/>
1313
<menuitem id="context_zenEditWorkspaceIcon" data-l10n-id="zen-workspaces-panel-change-icon" command="cmd_zenChangeWorkspaceIcon"/>
1414
<menuitem class="zenToolbarThemePicker"
1515
data-l10n-id="zen-workspaces-change-theme"

src/browser/components/urlbar/UrlbarInput-sys-mjs.patch

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
2-
index 0c5145c3d31862bd2c6b5ed2faa88f02425ffde1..1cf86995514b2c00360f6ed681f0c640dac8ab56 100644
2+
index 0c5145c3d31862bd2c6b5ed2faa88f02425ffde1..370bd107be760893516360bd85553acb6533774b 100644
33
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
44
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
55
@@ -68,6 +68,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
@@ -187,7 +187,15 @@ index 0c5145c3d31862bd2c6b5ed2faa88f02425ffde1..1cf86995514b2c00360f6ed681f0c640
187187

188188
let controller =
189189
this.document.commandDispatcher.getControllerForCommand("cmd_paste");
190-
@@ -4136,6 +4204,11 @@ export class UrlbarInput {
190+
@@ -4025,6 +4093,7 @@ export class UrlbarInput {
191+
_setPlaceholder(name) {
192+
this.document.l10n.setAttributes(
193+
this.inputField,
194+
+ this.window.gZenVerticalTabsManager._hasSetSingleToolbar ? 'zen-singletoolbar-urlbar-placeholder-with-name' :
195+
name ? "urlbar-placeholder-with-name" : "urlbar-placeholder",
196+
name ? { name } : undefined
197+
);
198+
@@ -4136,6 +4205,11 @@ export class UrlbarInput {
191199
}
192200

193201
_on_click(event) {
@@ -199,7 +207,7 @@ index 0c5145c3d31862bd2c6b5ed2faa88f02425ffde1..1cf86995514b2c00360f6ed681f0c640
199207
if (
200208
event.target == this.inputField ||
201209
event.target == this._inputContainer ||
202-
@@ -4207,7 +4280,7 @@ export class UrlbarInput {
210+
@@ -4207,7 +4281,7 @@ export class UrlbarInput {
203211
}
204212
}
205213

@@ -208,7 +216,7 @@ index 0c5145c3d31862bd2c6b5ed2faa88f02425ffde1..1cf86995514b2c00360f6ed681f0c640
208216
this.view.autoOpen({ event });
209217
} else {
210218
if (this._untrimOnFocusAfterKeydown) {
211-
@@ -4247,9 +4320,16 @@ export class UrlbarInput {
219+
@@ -4247,9 +4321,16 @@ export class UrlbarInput {
212220
}
213221

214222
_on_mousedown(event) {
@@ -226,7 +234,7 @@ index 0c5145c3d31862bd2c6b5ed2faa88f02425ffde1..1cf86995514b2c00360f6ed681f0c640
226234

227235
if (
228236
event.target != this.inputField &&
229-
@@ -4261,6 +4341,10 @@ export class UrlbarInput {
237+
@@ -4261,6 +4342,10 @@ export class UrlbarInput {
230238

231239
this.focusedViaMousedown = !this.focused;
232240
this._preventClickSelectsAll = this.focused;
@@ -237,7 +245,7 @@ index 0c5145c3d31862bd2c6b5ed2faa88f02425ffde1..1cf86995514b2c00360f6ed681f0c640
237245

238246
// Keep the focus status, since the attribute may be changed
239247
// upon calling this.focus().
240-
@@ -4301,7 +4385,7 @@ export class UrlbarInput {
248+
@@ -4301,7 +4386,7 @@ export class UrlbarInput {
241249
}
242250
// Don't close the view when clicking on a tab; we may want to keep the
243251
// view open on tab switch, and the TabSelect event arrived earlier.

src/zen/common/ZenUIManager.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,7 @@ var gZenVerticalTabsManager = {
981981
gURLBar._initCopyCutController();
982982
gURLBar._initPasteAndGo();
983983
gURLBar._initStripOnShare();
984+
gURLBar._updatePlaceholderFromDefaultEngine();
984985
},
985986

986987
rebuildAreas() {

src/zen/common/emojis/ZenEmojiPicker.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383

8484
#onPopupShowing(event) {
8585
if (event.target !== this.#panel) return;
86+
this.searchInput.value = '';
8687
const emojiList = this.emojiList;
8788
for (const emoji of this.#emojis) {
8889
const item = document.createXULElement('toolbarbutton');
@@ -94,6 +95,7 @@
9495
});
9596
emojiList.appendChild(item);
9697
}
98+
this.searchInput.focus();
9799
}
98100

99101
#onPopupHidden(event) {

src/zen/common/emojis/ZenEmojisData.min.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
import os
3+
import requests
4+
import json
5+
6+
7+
def get_emojis(url):
8+
"""
9+
Fetches emojis from the given URL and formats them into a JavaScript module.
10+
11+
Args:
12+
url (str): The URL to fetch the emoji data from.
13+
14+
Returns:
15+
array: A JavaScript array of emoji objects formatted for use in a module.
16+
"""
17+
response = requests.get(url)
18+
response.raise_for_status() # Raise an error for bad responses
19+
emojis_data = response.json()
20+
21+
# We only want "tags", "emoji" amd "order" from the dictionaries inside this array
22+
emojis = []
23+
for emoji in emojis_data:
24+
emojis.append({
25+
"tags": emoji.get("tags", []),
26+
"order": emoji.get("order", 0),
27+
"emoji": emoji.get("emoji", "")
28+
})
29+
return emojis
30+
31+
32+
def get_js_code(emojis):
33+
"""
34+
Generates JavaScript code to export the emojis as a module.
35+
36+
Args:
37+
emojis (list): A list of emoji dictionaries.
38+
39+
Returns:
40+
str: JavaScript code as a string.
41+
"""
42+
js_code = "var ZenEmojisData = "
43+
# dump without unicode escape
44+
js_code += json.dumps(emojis, ensure_ascii=False)
45+
return js_code
46+
47+
48+
if __name__ == "__main__":
49+
# Define the URL for the emoji JSON file
50+
url = "https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json"
51+
emojis_path = os.path.join(os.path.dirname(__file__), "ZenEmojisData.min.mjs")
52+
emojis = get_emojis(url)
53+
js_code = get_js_code(emojis)
54+
with open(emojis_path, "w", encoding="utf-8") as file:
55+
file.write(js_code)
56+
print(f"Emojis data has been written to {emojis_path}")

src/zen/workspaces/ZenWorkspaceCreation.mjs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -170,23 +170,26 @@
170170
document.getElementById('nav-bar').style.visibility = 'collapse';
171171
}
172172
this.style.visibility = 'visible';
173-
gZenUIManager.motion.animate(
174-
this.elementsToAnimate,
175-
{
176-
y: [20, 0],
177-
opacity: [0, 1],
178-
filter: ['blur(2px)', 'blur(0)'],
179-
},
180-
{
181-
duration: 0.6,
182-
type: 'spring',
183-
bounce: 0,
184-
delay: gZenUIManager.motion.stagger(0.05, { startDelay: 0.2 }),
185-
}
186-
);
173+
gZenUIManager.motion
174+
.animate(
175+
this.elementsToAnimate,
176+
{
177+
y: [20, 0],
178+
opacity: [0, 1],
179+
filter: ['blur(2px)', 'blur(0)'],
180+
},
181+
{
182+
duration: 0.6,
183+
type: 'spring',
184+
bounce: 0,
185+
delay: gZenUIManager.motion.stagger(0.05, { startDelay: 0.2 }),
186+
}
187+
)
188+
.then(() => {
189+
gZenWorkspaces.workspaceElement(this.workspaceId).hidden = false;
190+
this.resolveInitialized();
191+
});
187192
});
188-
189-
this.resolveInitialized();
190193
}
191194

192195
async onCreateButtonCommand() {

src/zen/workspaces/ZenWorkspaces.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,10 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
468468
workspaceWrapper.active = true;
469469
}
470470

471+
if (document.documentElement.hasAttribute('zen-creating-workspace')) {
472+
workspaceWrapper.hidden = true; // Hide workspace while creating it
473+
}
474+
471475
await new Promise((resolve) => {
472476
workspaceWrapper.addEventListener(
473477
'ZenWorkspaceAttached',
@@ -1521,6 +1525,10 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
15211525
}
15221526

15231527
async _organizeWorkspaceStripLocations(workspace, justMove = false, offsetPixels = 0) {
1528+
if (document.documentElement.hasAttribute('zen-creating-workspace')) {
1529+
// If we are creating a workspace, we don't want to animate the strip
1530+
return;
1531+
}
15241532
this._organizingWorkspaceStrip = true;
15251533
const workspaces = await this._workspaces();
15261534
let workspaceIndex = workspaces.workspaces.findIndex((w) => w.uuid === workspace.uuid);

surfer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"brandShortName": "Zen",
2020
"brandFullName": "Zen Browser",
2121
"release": {
22-
"displayVersion": "1.12.11b",
22+
"displayVersion": "1.13b",
2323
"github": {
2424
"repo": "zen-browser/desktop"
2525
},
@@ -39,7 +39,7 @@
3939
"brandShortName": "Twilight",
4040
"brandFullName": "Zen Twilight",
4141
"release": {
42-
"displayVersion": "1.13t",
42+
"displayVersion": "1.14t",
4343
"github": {
4444
"repo": "zen-browser/desktop"
4545
}

0 commit comments

Comments
 (0)