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

Commit

Permalink
resolved merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
pthiess committed Apr 26, 2012
2 parents 1f321f5 + bd7fdd8 commit 2d3cd28
Show file tree
Hide file tree
Showing 14 changed files with 243 additions and 75 deletions.
15 changes: 12 additions & 3 deletions src/brackets.js
Expand Up @@ -282,10 +282,19 @@ define(function (require, exports, module) {
"extensions/user"
);

// Use unobtrusive scrollbars if we aren't on Lion
// Use quiet scrollbars if we aren't on Lion. If we're on Lion, only
// use native scroll bars when the mouse is not plugged in or when
// using the "Always" scroll bar setting.
var osxMatch = /Mac OS X 10\D([\d+])\D/.exec(navigator.userAgent);
if (!(osxMatch && osxMatch[1] && Number(osxMatch[1]) >= 7)) {
$(".sidebar").addClass("quiet-scrollbars");
if (osxMatch && osxMatch[1] && Number(osxMatch[1]) >= 7) {
// test a scrolling div for scrollbars
var $testDiv = $("<div style='position:fixed;left:-50px;width:50px;height:50px;overflow:auto;'><div style='width:100px;height:100px;'/></div>").appendTo(document.body);

if ($testDiv.outerWidth() === $testDiv.get(0).clientWidth) {
$(".sidebar").removeClass("quiet-scrollbars");
}

$testDiv.remove();
}

PerfUtils.addMeasurement("Application Startup");
Expand Down
4 changes: 1 addition & 3 deletions src/editor/Editor.js
Expand Up @@ -360,8 +360,6 @@ define(function (require, exports, module) {

this._installEditorListeners();

ViewUtils.installScrollShadow($("#editor-scroll-shadow"), this);

$(this)
.on("keyEvent", _checkElectricChars)
.on("change", this._handleEditorChange.bind(this));
Expand Down Expand Up @@ -396,7 +394,7 @@ define(function (require, exports, module) {
document._makeEditable(this);
}

// Add a "scrollTop" property to this object for the scroll shadow code to use
// Add scrollTop property to this object for the scroll shadow code to use
Object.defineProperty(this, "scrollTop", {
get: function () {
return this._codeMirror.scrollPos().y;
Expand Down
10 changes: 9 additions & 1 deletion src/editor/EditorManager.js
Expand Up @@ -47,6 +47,7 @@ define(function (require, exports, module) {
Editor = require("editor/Editor").Editor,
InlineTextEditor = require("editor/InlineTextEditor").InlineTextEditor,
EditorUtils = require("editor/EditorUtils"),
ViewUtils = require("utils/ViewUtils"),
Strings = require("strings");

/** @type {jQueryObject} DOM node that contains all editors (visible and hidden alike) */
Expand Down Expand Up @@ -379,12 +380,19 @@ define(function (require, exports, module) {

/** Handles changes to DocumentManager.getCurrentDocument() */
function _onCurrentDocumentChange() {
var doc = DocumentManager.getCurrentDocument();
var doc = DocumentManager.getCurrentDocument(),
container = _editorHolder.get(0);

// Remove scrollerShadow from the current editor
if (_currentEditor) {
ViewUtils.removeScrollerShadow(container, _currentEditor);
}

// Update the UI to show the right editor (or nothing), and also dispose old editor if no
// longer needed.
if (doc) {
_showEditor(doc);
ViewUtils.addScrollerShadow(container, _currentEditor);
} else {
_showNoEditor();
}
Expand Down
5 changes: 1 addition & 4 deletions src/editor/InlineTextEditor.js
Expand Up @@ -242,10 +242,7 @@ define(function (require, exports, module) {
});

// set dirty indicator state
// use setTimeout to allow filenameDiv to render first
setTimeout(function () {
_showDirtyIndicator($dirtyIndicatorDiv, doc.isDirty);
}, 0);
_showDirtyIndicator($dirtyIndicatorDiv, doc.isDirty);
};

/**
Expand Down
9 changes: 6 additions & 3 deletions src/index.html
Expand Up @@ -59,7 +59,7 @@
<body>
<!-- Main UI -->
<div class="main-view">
<div class="sidebar">
<div class="sidebar quiet-scrollbars">
<!-- Left-hand 'Project panel' -->
<div id="projects" class="panel">
<div id="project-header"></div>
Expand All @@ -84,6 +84,7 @@
<div class="content">
<!-- Toolbar containing menus, filename, and icons -->
<div id="main-toolbar" class="toolbar">
<!-- Menu bar -->
<ul class="nav" data-dropdown="dropdown">
<!-- File menu -->
<li class="dropdown">
Expand Down Expand Up @@ -171,14 +172,18 @@
</li>
</ul>

<!-- Toolbar -->
<div class="buttons">
<span class="experimental-label">Experimental Build</span>

<a href="#" id="toolbar-go-live"></a> <!-- tooltip for this is set in JS -->

<span id="gold-star" title="No JSLint errors - good job!">
&#9733;
</span>
</div>

<!-- Filename label -->
<div class="title-wrapper">
<span class="title"></span>
</div>
Expand All @@ -188,8 +193,6 @@
<div id="notEditor">
<div id="notEditorContent">[&nbsp;&nbsp;]</div>
</div>
<div id="editor-scroll-shadow">
</div>
</div>

<div id="jslint-results">
Expand Down
16 changes: 13 additions & 3 deletions src/project/ProjectManager.js
Expand Up @@ -99,6 +99,12 @@ define(function (require, exports, module) {
// redraw selection
if ($projectTreeList) {
$projectTreeList.trigger("selectionChanged");

// in-lieu of resize events, manually trigger contentChanged for every
// FileViewController focus change. This event triggers scroll shadows
// on the jstree to update. documentSelectionFocusChange fires when
// a new file is added and removed (causing a new selection) from the working set
_projectTree.triggerHandler("contentChanged");
}
}

Expand All @@ -125,8 +131,6 @@ define(function (require, exports, module) {
_fireSelectionChanged();
};

$(FileViewController).on("documentSelectionFocusChange", _documentSelectionFocusChange);

/**
* Unique PreferencesManager clientID
*/
Expand Down Expand Up @@ -287,6 +291,8 @@ define(function (require, exports, module) {
"loaded.jstree open_node.jstree close_node.jstree",
function (event, data) {
ViewUtils.updateChildrenToParentScrollwidth($("#project-files-container"));

// update when tree display state changes
_fireSelectionChanged();
_savePreferences();
}
Expand All @@ -300,7 +306,7 @@ define(function (require, exports, module) {
// Filed this bug against jstree at https://github.com/vakata/jstree/issues/163
_projectTree.bind("init.jstree", function () {
// install scroller shadows
ViewUtils.installScrollShadow(_projectTree[0]);
ViewUtils.addScrollerShadow(_projectTree.get(0));

_projectTree
.unbind("dblclick.jstree")
Expand Down Expand Up @@ -768,6 +774,10 @@ define(function (require, exports, module) {
// Init PreferenceStorage
_prefs = PreferencesManager.getPreferenceStorage(PREFERENCES_CLIENT_ID, defaults);

// Event Handlers
$(FileViewController).on("documentSelectionFocusChange", _documentSelectionFocusChange);
$("#open-files-container").on("contentChanged", _fireSelectionChanged); // redraw jstree when working set size changes

CommandManager.register(Commands.FILE_OPEN_FOLDER, openProject);
}());
});
8 changes: 7 additions & 1 deletion src/project/WorkingSetView.js
Expand Up @@ -56,6 +56,9 @@ define(function (require, exports, module) {
function _fireSelectionChanged() {
// redraw selection
$openFilesList.trigger("selectionChanged");

// in-lieu of resize events, manually trigger contentChanged to update scroll shadows
$openFilesContainer.triggerHandler("contentChanged");
}

/**
Expand Down Expand Up @@ -285,11 +288,14 @@ define(function (require, exports, module) {

$(FileViewController).on("documentSelectionFocusChange", function (event, eventTarget) {
_handleDocumentSelectionChange();

// redraw shadows
_fireSelectionChanged();
});

_updateOpenFilesContainer();

// Show scroller shadows when open-files-container scrolls
ViewUtils.installScrollShadow($openFilesContainer[0]);
ViewUtils.addScrollerShadow($openFilesContainer[0], null, true);
ViewUtils.sidebarList($openFilesContainer);
});
56 changes: 39 additions & 17 deletions src/styles/brackets.less
Expand Up @@ -76,7 +76,7 @@ a, img {

.sidebar {
.vbox;
width: 200px;
width: @sidebar-width;
}

.content {
Expand Down Expand Up @@ -111,14 +111,6 @@ a, img {
opacity: 0.30;
}
}

/* Scroll shadow */
#editor-scroll-shadow {
position: fixed;
height: 4px;
width: 100%;
z-index: 12;
}
}

#jslint-results, #search-results {
Expand Down Expand Up @@ -274,14 +266,28 @@ a, img {
}

.sidebarSelectionTriangle {
background: url("styles/images/active_back.png");
width: 10px;
height: 25px;
position: fixed;

margin-top: -@triangle-size;

z-index: 20; /* scrollerShadow appears above this triangle */
}

.sidebarSelectionTriangle:before {
content: "";

border-top: @triangle-size solid transparent;
border-bottom: @triangle-size solid transparent;
border-right: @triangle-size solid @background-color-3;

display: block;
position: absolute;
top: 2px;
right: 0;
width: 0;
height: 0;

.scaleX(0.9, right, top);
}

Expand All @@ -302,15 +308,31 @@ a, img {
}
}

.sidebar .scrollerShadow {
max-width: @sidebar-width; /* width is clobbered by ViewUtils.updateChildrenToParentScrollwidth() */
}

#editorHolder .scrollerShadow {
width: 100%;
}

.scrollerShadow {
/* top shadow */
#gradient.vertical(rgba(0,0,0,0.10), rgba(0, 0, 0, 0));
background-size: 100% 5px;
background-repeat: no-repeat;
height: 5px;
position: fixed;
z-index: 21;

/* hide the shadow on init */
background-position: 0px -9999px;
&.top {
#gradient.vertical(rgba(0,0,0,0.1), rgba(0,0,0,0));
background-position: 0 -5px;
}

background-size: 100% 4px;
background-repeat: no-repeat;
&.bottom {
#gradient.vertical(rgba(0,0,0,0), rgba(0,0,0,0.1));
background-position: 0 5px;
background-color: transparent; /* override background-color: @endColor from #gradient.vertical */
}
}

@spriteSize18: 18px;
Expand Down
12 changes: 12 additions & 0 deletions src/styles/brackets_fonts.less
Expand Up @@ -66,6 +66,18 @@
font-style: normal;
}

/* SourceSansItalic */
@font-face {
font-family: 'SourceSans';
src: url('styles/fonts/source-sans/sourcesans-it-webfont.eot');
src: url('styles/fonts/source-sans/sourcesans-it-webfont.eot?#iefix') format('embedded-opentype'),
url('styles/fonts/source-sans/sourcesans-it-webfont.woff') format('woff'),
url('styles/fonts/source-sans/sourcesans-it-webfont.ttf') format('truetype'),
url('styles/fonts/source-sans/sourcesans-it-webfont.svg#SourceSansSemibold') format('svg');
font-weight: normal;
font-style: italic;
}


/* Font Stacks */

Expand Down
15 changes: 13 additions & 2 deletions src/styles/brackets_patterns_override.less
Expand Up @@ -146,6 +146,15 @@

.buttons {
margin: @toolbar-top-gap-px 0 0 4px;

.experimental-label {
color: #a0a0a0;
font-size: 15px;
line-height: 20px; // prevent jumping when 20px-tall JSLint star is added/removed
font-weight: normal;
font-style: italic;
padding-right: 22px;
}
}
}

Expand Down Expand Up @@ -282,10 +291,12 @@
font-size: 17px;
font-weight: @font-weight-semibold;
color: #454545;


// On hover, gradient slides away to reveal a solid-color bg. Want same bg color in non-hover
// too so we don't see the color cross-fading during the gradient slide animation
background-color: #fff;
&:hover {
background-position: 0 15px;
background-color: #fff;
}

&.primary {
Expand Down
4 changes: 3 additions & 1 deletion src/styles/brackets_variables.less
@@ -1,4 +1,3 @@

// Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a
Expand Down Expand Up @@ -32,3 +31,6 @@

/* CSS triangle */
@triangle-size: 10px;

/* sidebar */
@sidebar-width: 200px;

0 comments on commit 2d3cd28

Please sign in to comment.