Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit 8c72bc4

Browse files
authored
Merge pull request #217 from sobisht/gh-pages.1.13
Add api docs for 1.13 brackets release
2 parents 4d2b99c + fe0b518 commit 8c72bc4

29 files changed

Lines changed: 1068 additions & 195 deletions

docs/current/modules/LiveDevelopment/LiveDevelopment.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ <h3>Dependencies</h3>
556556
<li><a href="..&#x2F;../modules/file/FileUtils.html">FileUtils</a></li>
557557
<li><a href="..&#x2F;../modules/utils/Global.html">Global</a></li>
558558
<li><a href="..&#x2F;../modules/LiveDevelopment/Agents/GotoAgent.html">GotoAgent</a></li>
559+
<li><a href="..&#x2F;../modules/utils/HealthLogger.html">HealthLogger</a></li>
559560
<li><a href="..&#x2F;../modules/LiveDevelopment/Agents/HighlightAgent.html">HighlightAgent</a></li>
560561
<li><a href="..&#x2F;../modules/LiveDevelopment/Documents/HTMLDocument.html">HTMLDocument</a></li>
561562
<li><a href="..&#x2F;../modules/LiveDevelopment/Inspector/Inspector.html">Inspector</a></li>
@@ -2520,6 +2521,13 @@ <h4>
25202521
});
25212522
}
25222523
}
2524+
&#x2F;&#x2F; Send analytics data when Live Preview is opened
2525+
HealthLogger.sendAnalyticsData(
2526+
&quot;livePreviewOpen&quot;,
2527+
&quot;usage&quot;,
2528+
&quot;livePreview&quot;,
2529+
&quot;open&quot;
2530+
);
25232531

25242532
&#x2F;&#x2F; Register user defined server provider and keep handlers for further clean-up
25252533
_regServers.push(LiveDevServerManager.registerServer({ create: _createUserServer }, 99));

docs/current/modules/command/Menus.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2571,7 +2571,7 @@ <h4>
25712571
posLeft += 3;
25722572

25732573
if (clip.right &gt; 0) {
2574-
posLeft = Math.max(0, posLeft - 2 * $parentMenuItem.outerWidth());
2574+
posLeft = Math.max(0, posLeft - $parentMenuItem.outerWidth() - $menuWindow.outerWidth());
25752575
}
25762576
} else {
25772577
this.trigger(&quot;beforeContextMenuOpen&quot;);

docs/current/modules/document/Document.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,7 @@ <h4>
610610
<button class="btn btn-small show-code">Show code</button>
611611
<pre class="code language-javascript"><code class="language-javascript"> function Document(file, initialTimestamp, rawText) {
612612
this.file = file;
613+
this.editable = !file.readOnly;
613614
this._updateLanguage();
614615
this.refreshText(rawText, initialTimestamp, true);
615616
&#x2F;&#x2F; List of full editors which are initialized as master editors for this doc.

docs/current/modules/document/DocumentCommandHandlers.html

Lines changed: 92 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ <h3>Dependencies</h3>
518518
<li><a href="..&#x2F;../modules/widgets/Dialogs.html">Dialogs</a></li>
519519
<li><a href="..&#x2F;../modules/document/DocumentManager.html">DocumentManager</a></li>
520520
<li><a href="..&#x2F;../modules/editor/EditorManager.html">EditorManager</a></li>
521+
<li><a href="..&#x2F;../modules/utils/EventDispatcher.html">EventDispatcher</a></li>
521522
<li><a href="..&#x2F;../modules/filesystem/FileSystem.html">FileSystem</a></li>
522523
<li><a href="..&#x2F;../modules/filesystem/FileSystemError.html">FileSystemError</a></li>
523524
<li><a href="..&#x2F;../modules/file/FileUtils.html">FileUtils</a></li>
@@ -549,7 +550,25 @@ <h3>Variables
549550
<input class="toggle-public" type="checkbox"> Show Private Members
550551
</label> </h3>
551552

552-
<div class="member">
553+
<div class="member public">
554+
555+
<span class="pull-right scope">
556+
557+
Public API
558+
</span>
559+
<h4>
560+
APP_QUIT_CANCELLED
561+
<a class="anchor" href="#-APP_QUIT_CANCELLED" id="-APP_QUIT_CANCELLED"><span class="icon-link"></span></a>
562+
</h4>
563+
564+
565+
<div class="description"><p>Event triggered when File Save is cancelled, when prompted to save dirty files</p>
566+
</div>
567+
568+
<dl>
569+
</dl><dl>
570+
<dl><button class="btn btn-small show-code">Show code</button>
571+
<pre class="code language-javascript"><code class="language-javascript"> var APP_QUIT_CANCELLED = &quot;appQuitCancelled&quot;;</code></pre></div><div class="member">
553572

554573
<span class="pull-right scope">
555574

@@ -571,7 +590,8 @@ <h4>
571590

572591
PreferencesManager.definePreference(&quot;defaultExtension&quot;, &quot;string&quot;, &quot;&quot;, {
573592
excludeFromHints: true
574-
});</code></pre></div><div class="member">
593+
});
594+
EventDispatcher.makeEventDispatcher(exports);</code></pre></div><div class="member">
575595

576596
<span class="pull-right scope">
577597

@@ -903,7 +923,47 @@ <h4>
903923
<dl>
904924
</dl><dl>
905925
<dl><button class="btn btn-small show-code">Show code</button>
906-
<pre class="code language-javascript"><code class="language-javascript"> var handleReloadWithoutExts = _.partial(handleReload, true);</code></pre></div>
926+
<pre class="code language-javascript"><code class="language-javascript"> var handleReloadWithoutExts = _.partial(handleReload, true);</code></pre></div><div class="member">
927+
928+
<span class="pull-right scope">
929+
930+
931+
</span>
932+
<h4>
933+
isTestWindow
934+
<a class="anchor" href="#-isTestWindow" id="-isTestWindow"><span class="icon-link"></span></a>
935+
</h4>
936+
937+
938+
<div class="description"><p>Attach a beforeunload handler to notify user about unsaved changes and URL redirection in CEF.
939+
Prevents data loss in scenario reported under #13708
940+
Make sure we don&#39;t attach this handler if the current window is actually a test window</p>
941+
</div>
942+
943+
<dl>
944+
</dl><dl>
945+
<dl><button class="btn btn-small show-code">Show code</button>
946+
<pre class="code language-javascript"><code class="language-javascript">
947+
var isTestWindow = (new window.URLSearchParams(window.location.search || &quot;&quot;)).get(&quot;testEnvironment&quot;);
948+
if (!isTestWindow) {
949+
window.onbeforeunload = function(e) {
950+
var openDocs = DocumentManager.getAllOpenDocuments();
951+
952+
&#x2F;&#x2F; Detect any unsaved changes
953+
openDocs = openDocs.filter(function(doc) {
954+
return doc &amp;&amp; doc.isDirty;
955+
});
956+
957+
&#x2F;&#x2F; Ensure we are not in normal app-quit or reload workflow
958+
if (!_isReloading &amp;&amp; !_windowGoingAway) {
959+
if (openDocs.length &gt; 0) {
960+
return Strings.WINDOW_UNLOAD_WARNING_WITH_UNSAVED_CHANGES;
961+
} else {
962+
return Strings.WINDOW_UNLOAD_WARNING;
963+
}
964+
}
965+
};
966+
}</code></pre></div>
907967
</section>
908968

909969
<section id="functions">
@@ -1004,6 +1064,7 @@ <h4>
10041064
)
10051065
.done(function (id) {
10061066
if (id === Dialogs.DIALOG_BTN_CANCEL) {
1067+
dispatchAppQuitCancelledEvent();
10071068
result.reject();
10081069
} else if (id === Dialogs.DIALOG_BTN_OK) {
10091070
&#x2F;&#x2F; Save all unsaved files, then if that succeeds, close all
@@ -1510,6 +1571,7 @@ <h4>
15101571
if (selectedPath) {
15111572
_doSaveAfterSaveDialog(selectedPath);
15121573
} else {
1574+
dispatchAppQuitCancelledEvent();
15131575
result.reject(USER_CANCELED);
15141576
}
15151577
} else {
@@ -1914,7 +1976,9 @@ <h4>
19141976
<pre class="code language-javascript"><code class="language-javascript"> function _updateTitle() {
19151977
var currentDoc = DocumentManager.getCurrentDocument(),
19161978
windowTitle = brackets.config.app_title,
1917-
currentlyViewedPath = MainViewManager.getCurrentlyViewedPath(MainViewManager.ACTIVE_PANE);
1979+
currentlyViewedFile = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE),
1980+
currentlyViewedPath = currentlyViewedFile &amp;&amp; currentlyViewedFile.fullPath,
1981+
readOnlyString = (currentlyViewedFile &amp;&amp; currentlyViewedFile.readOnly) ? &quot;[Read Only] - &quot; : &quot;&quot;;
19181982

19191983
if (!brackets.nativeMenus) {
19201984
if (currentlyViewedPath) {
@@ -1954,7 +2018,7 @@ <h4>
19542018
var projectName = projectRoot.name;
19552019
&#x2F;&#x2F; Construct shell&#x2F;browser window title, e.g. &quot;• index.html (myProject) — Brackets&quot;
19562020
if (currentlyViewedPath) {
1957-
windowTitle = StringUtils.format(WINDOW_TITLE_STRING_DOC, _currentTitlePath, projectName, brackets.config.app_title);
2021+
windowTitle = StringUtils.format(WINDOW_TITLE_STRING_DOC, readOnlyString + _currentTitlePath, projectName, brackets.config.app_title);
19582022
&#x2F;&#x2F; Display dirty dot when there are unsaved changes
19592023
if (currentDoc &amp;&amp; currentDoc.isDirty) {
19602024
windowTitle = &quot;• &quot; + windowTitle;
@@ -2066,6 +2130,28 @@ <h4>
20662130
<span class="pull-right scope">
20672131

20682132

2133+
</span>
2134+
<h4>
2135+
dispatchAppQuitCancelledEvent
2136+
<a class="anchor" href="#-dispatchAppQuitCancelledEvent" id="-dispatchAppQuitCancelledEvent"><span class="icon-link"></span></a>
2137+
</h4>
2138+
2139+
2140+
<div class="description"><p>Dispatches the app quit cancelled event</p>
2141+
</div>
2142+
2143+
<dl>
2144+
</dl><dl>
2145+
</dl><dl>
2146+
</dl><dl>
2147+
<dl><button class="btn btn-small show-code">Show code</button>
2148+
<pre class="code language-javascript"><code class="language-javascript"> function dispatchAppQuitCancelledEvent() {
2149+
exports.trigger(exports.APP_QUIT_CANCELLED);
2150+
}</code></pre></div><div class="member">
2151+
2152+
<span class="pull-right scope">
2153+
2154+
20692155
</span>
20702156
<h4>
20712157
doSave
@@ -2570,6 +2656,7 @@ <h4>
25702656
)
25712657
.done(function (id) {
25722658
if (id === Dialogs.DIALOG_BTN_CANCEL) {
2659+
dispatchAppQuitCancelledEvent();
25732660
result.reject();
25742661
} else if (id === Dialogs.DIALOG_BTN_OK) {
25752662
&#x2F;&#x2F; &quot;Save&quot; case: wait until we confirm save has succeeded before closing

docs/current/modules/document/DocumentManager.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,13 +1121,19 @@ <h4>
11211121
<span class="label label-info">string</span>
11221122
</dt>
11231123
<dd></dd>
1124+
<dt>
1125+
fileObj
1126+
<span class="label label-non-nullable">non-nullable</span>
1127+
<span class="label label-info">object</span>
1128+
</dt>
1129+
<dd>actual File|RemoteFile or some other protocol adapter handle</dd>
11241130
</dl><dl>
11251131
<dt>Returns: <span class="label label-info">$.Promise</span></dt>
11261132
<dd>A promise object that will be resolved with the Document, or rejected with a FileSystemError if the file is not yet open and can't be read from disk.</dd>
11271133
</dl><dl>
11281134
</dl><dl>
11291135
<dl><button class="btn btn-small show-code">Show code</button>
1130-
<pre class="code language-javascript"><code class="language-javascript"> function getDocumentForPath(fullPath) {
1136+
<pre class="code language-javascript"><code class="language-javascript"> function getDocumentForPath(fullPath, fileObj) {
11311137
var doc = getOpenDocumentForPath(fullPath);
11321138

11331139
if (doc) {
@@ -1143,7 +1149,7 @@ <h4>
11431149
return promise;
11441150
}
11451151

1146-
var file = FileSystem.getFileForPath(fullPath),
1152+
var file = fileObj || FileSystem.getFileForPath(fullPath),
11471153
pendingPromise = getDocumentForPath._pendingDocumentPromises[file.id];
11481154

11491155
if (pendingPromise) {

docs/current/modules/editor/CSSInlineEditor.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ <h3>Dependencies</h3>
517517
<li><a href="..&#x2F;../modules/editor/Editor.html">Editor</a></li>
518518
<li><a href="..&#x2F;../modules/editor/EditorManager.html">EditorManager</a></li>
519519
<li><a href="..&#x2F;../modules/file/FileUtils.html">FileUtils</a></li>
520+
<li><a href="..&#x2F;../modules/utils/HealthLogger.html">HealthLogger</a></li>
520521
<li><a href="..&#x2F;../modules/language/HTMLUtils.html">HTMLUtils</a></li>
521522
<li><a href="..&#x2F;../modules/language/LanguageManager.html">LanguageManager</a></li>
522523
<li><a href="..&#x2F;../modules/thirdparty/lodash.html">lodash</a></li>
@@ -1023,6 +1024,14 @@ <h4>
10231024
return null;
10241025
}
10251026

1027+
&#x2F;&#x2F;Send analytics data for QuickEdit open
1028+
HealthLogger.sendAnalyticsData(
1029+
&quot;QuickEditOpen&quot;,
1030+
&quot;usage&quot;,
1031+
&quot;quickEdit&quot;,
1032+
&quot;open&quot;
1033+
);
1034+
10261035
&#x2F;&#x2F; Only provide CSS editor if the selection is within a single line
10271036
var sel = hostEditor.getSelection();
10281037
if (sel.start.line !== sel.end.line) {

docs/current/modules/editor/CodeHintList.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,10 @@ <h4>
922922

923923
$item.find(&quot;a&quot;).addClass(&quot;highlight&quot;);
924924
ViewUtils.scrollElementIntoView($view, $item, false);
925+
926+
if (this.handleHighlight) {
927+
this.handleHighlight($item.find(&quot;a&quot;));
928+
}
925929
}
926930
};</code></pre></div><div class="member">
927931

@@ -1118,6 +1122,33 @@ <h4>
11181122
<span class="pull-right scope">
11191123

11201124

1125+
</span>
1126+
<h4>
1127+
onHighlight
1128+
<a class="anchor" href="#CodeHintList-onHighlight" id="CodeHintList-onHighlight"><span class="icon-link"></span></a>
1129+
</h4>
1130+
1131+
1132+
<div class="description"><p>Set the hint list highlight callback function</p>
1133+
</div>
1134+
1135+
<dl>
1136+
<dt>
1137+
callback
1138+
<span class="label label-info">Function</span>
1139+
</dt>
1140+
<dd></dd>
1141+
</dl><dl>
1142+
</dl><dl>
1143+
</dl><dl>
1144+
<dl><button class="btn btn-small show-code">Show code</button>
1145+
<pre class="code language-javascript"><code class="language-javascript"> CodeHintList.prototype.onHighlight = function (callback) {
1146+
this.handleHighlight = callback;
1147+
};</code></pre></div><div class="member">
1148+
1149+
<span class="pull-right scope">
1150+
1151+
11211152
</span>
11221153
<h4>
11231154
onSelect

docs/current/modules/editor/Editor.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,8 @@ <h4>
643643
UPPERCASE_COLORS = &quot;uppercaseColors&quot;,
644644
USE_TAB_CHAR = &quot;useTabChar&quot;,
645645
WORD_WRAP = &quot;wordWrap&quot;,
646+
AUTO_HIDE_SEARCH = &quot;autoHideSearch&quot;,
647+
INDENT_LINE_COMMENT = &quot;indentLineComment&quot;,
646648
INDENT_LINE_COMMENT = &quot;indentLineComment&quot;,
647649
INPUT_STYLE = &quot;inputStyle&quot;;</code></pre></div><div class="member">
648650

@@ -777,6 +779,11 @@ <h4>
777779
PreferencesManager.definePreference(WORD_WRAP, &quot;boolean&quot;, true, {
778780
description: Strings.DESCRIPTION_WORD_WRAP
779781
});
782+
783+
PreferencesManager.definePreference(AUTO_HIDE_SEARCH, &quot;boolean&quot;, true, {
784+
description: Strings.DESCRIPTION_SEARCH_AUTOHIDE
785+
});
786+
780787
PreferencesManager.definePreference(INDENT_LINE_COMMENT, &quot;boolean&quot;, false, {
781788
description: Strings.DESCRIPTION_INDENT_LINE_COMMENT
782789
});
@@ -1032,7 +1039,7 @@ <h4>
10321039
<pre class="code language-javascript"><code class="language-javascript"> function Editor(document, makeMasterEditor, container, range, options) {
10331040
var self = this;
10341041

1035-
var isReadOnly = options &amp;&amp; options.isReadOnly;
1042+
var isReadOnly = (options &amp;&amp; options.isReadOnly) || !document.editable;
10361043

10371044
_instances.push(this);
10381045

docs/current/modules/editor/EditorOptionHandlers.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,8 @@ <h4>
547547
_optionMapping[SHOW_LINE_NUMBERS] = Commands.TOGGLE_LINE_NUMBERS;
548548
_optionMapping[STYLE_ACTIVE_LINE] = Commands.TOGGLE_ACTIVE_LINE;
549549
_optionMapping[WORD_WRAP] = Commands.TOGGLE_WORD_WRAP;
550-
_optionMapping[CLOSE_BRACKETS] = Commands.TOGGLE_CLOSE_BRACKETS;</code></pre></div>
550+
_optionMapping[CLOSE_BRACKETS] = Commands.TOGGLE_CLOSE_BRACKETS;
551+
_optionMapping[AUTO_HIDE_SEARCH] = Commands.TOGGLE_SEARCH_AUTOHIDE;</code></pre></div>
551552
</section>
552553

553554
<section id="functions">
@@ -601,6 +602,7 @@ <h4>
601602
CommandManager.register(Strings.CMD_TOGGLE_ACTIVE_LINE, Commands.TOGGLE_ACTIVE_LINE, _getToggler(STYLE_ACTIVE_LINE));
602603
CommandManager.register(Strings.CMD_TOGGLE_WORD_WRAP, Commands.TOGGLE_WORD_WRAP, _getToggler(WORD_WRAP));
603604
CommandManager.register(Strings.CMD_TOGGLE_CLOSE_BRACKETS, Commands.TOGGLE_CLOSE_BRACKETS, _getToggler(CLOSE_BRACKETS));
605+
CommandManager.register(Strings.CMD_TOGGLE_SEARCH_AUTOHIDE, Commands.TOGGLE_SEARCH_AUTOHIDE, _getToggler(AUTO_HIDE_SEARCH));
604606

605607
AppInit.htmlReady(_init);
606608
});</code></pre></div><div class="member private">

docs/current/modules/editor/EditorStatusBar.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ <h3>Dependencies</h3>
523523
<li><a href="..&#x2F;../modules/editor/EditorManager.html">EditorManager</a></li>
524524
<li><a href="..&#x2F;../modules/filesystem/FileSystem.html">FileSystem</a></li>
525525
<li><a href="..&#x2F;../modules/file/FileUtils.html">FileUtils</a></li>
526+
<li><a href="..&#x2F;../modules/utils/HealthLogger.html">HealthLogger</a></li>
526527
<li><a href="..&#x2F;../modules/document/InMemoryFile.html">InMemoryFile</a></li>
527528
<li><a href="..&#x2F;../modules/utils/KeyEvent.html">KeyEvent</a></li>
528529
<li><a href="..&#x2F;../modules/language/LanguageManager.html">LanguageManager</a></li>
@@ -1189,6 +1190,13 @@ <h4>
11891190
selStr = &quot;&quot;;
11901191

11911192
if (sels.length &gt; 1) {
1193+
&#x2F;&#x2F;Send analytics data for multicursor use
1194+
HealthLogger.sendAnalyticsData(
1195+
&quot;multiCursor&quot;,
1196+
&quot;usage&quot;,
1197+
&quot;multiCursor&quot;,
1198+
&quot;use&quot;
1199+
);
11921200
selStr = StringUtils.format(Strings.STATUSBAR_SELECTION_MULTIPLE, sels.length);
11931201
} else if (editor.hasSelection()) {
11941202
var sel = sels[0];

0 commit comments

Comments
 (0)