From 0699917ee001bbca845fb20a2607b452d0ea482b Mon Sep 17 00:00:00 2001 From: abose Date: Sun, 22 Feb 2026 16:49:20 +0530 Subject: [PATCH] feat: date tribute game in explore project --- docs/API-Reference/document/Document.md | 14 + .../explore/A-dave-tribute.html | 641 ++++++++++++++++++ .../Phoenix-live-preview/main.js | 6 +- 3 files changed, 659 insertions(+), 2 deletions(-) create mode 100644 src/assets/sample-projects/explore/A-dave-tribute.html diff --git a/docs/API-Reference/document/Document.md b/docs/API-Reference/document/Document.md index 4f4b14cba7..21679b25d5 100644 --- a/docs/API-Reference/document/Document.md +++ b/docs/API-Reference/document/Document.md @@ -27,6 +27,7 @@ const Document = brackets.getModule("document/Document") * [.replaceRange(text, start, end, origin)](#Document+replaceRange) * [.getRange(start, end)](#Document+getRange) ⇒ string * [.getLine(Zero-based)](#Document+getLine) ⇒ string + * [.posFromIndex(index)](#Document+posFromIndex) ⇒ Object * [.batchOperation(doOperation)](#Document+batchOperation) * [.notifySaved()](#Document+notifySaved) * [.adjustPosForChange(pos, textLines, start, end)](#Document+adjustPosForChange) ⇒ Object @@ -240,6 +241,19 @@ Returns the text of the given line (excluding any line ending characters) | --- | --- | --- | | Zero-based | number | line number | + + +### document.posFromIndex(index) ⇒ Object +Given a character index within the document text (assuming \n newlines), +returns the corresponding {line, ch} position. Works whether or not +a master editor is attached. + +**Kind**: instance method of [Document](#Document) + +| Param | Type | Description | +| --- | --- | --- | +| index | number | Zero-based character offset | + ### document.batchOperation(doOperation) diff --git a/src/assets/sample-projects/explore/A-dave-tribute.html b/src/assets/sample-projects/explore/A-dave-tribute.html new file mode 100644 index 0000000000..6c20629704 --- /dev/null +++ b/src/assets/sample-projects/explore/A-dave-tribute.html @@ -0,0 +1,641 @@ + + + + + + Dangerous Dave + + + +
+ +
+
+ + + + diff --git a/src/extensionsIntegrated/Phoenix-live-preview/main.js b/src/extensionsIntegrated/Phoenix-live-preview/main.js index 1c393d0ef6..6b63e3080f 100644 --- a/src/extensionsIntegrated/Phoenix-live-preview/main.js +++ b/src/extensionsIntegrated/Phoenix-live-preview/main.js @@ -901,12 +901,14 @@ define(function (require, exports, module) { if (isExploreProject) { // Always use highlight mode for explore project - LiveDevelopment.setMode(LiveDevelopment.CONSTANTS.LIVE_HIGHLIGHT_MODE); + LiveDevelopment.setMode(LiveDevelopment.CONSTANTS.LIVE_PREVIEW_MODE); } else if (isProEditUser) { // Pro users: auto-switch to edit mode on regular projects LiveDevelopment.setMode(LiveDevelopment.CONSTANTS.LIVE_EDIT_MODE); + } else { + // Non-pro users on regular projects: keep current mode (no change) + LiveDevelopment.setMode(LiveDevelopment.CONSTANTS.LIVE_HIGHLIGHT_MODE); } - // Non-pro users on regular projects: keep current mode (no change) } let startupFilesLoadHandled = false;