Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show breakpoints, warnings and errors in App Lab again #17382

Merged
merged 3 commits into from
Aug 29, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
70 changes: 34 additions & 36 deletions apps/lib/droplet/droplet-full.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2017 Anthony Bau.
* MIT License.
*
* Date: 2017-08-08
* Date: 2017-08-29
*/
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.droplet = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
Expand Down Expand Up @@ -10438,42 +10438,40 @@ Editor.prototype.addLineNumberForLine = function(line) {
lastPosition: null
};
}
if (treeView.bounds[line].y !== this.lineNumberTags[line].lastPosition) {
lineDiv.className = 'droplet-gutter-line';
if (this.annotations[line] != null) {
lineDiv.className += ' droplet_' + getMostSevereAnnotationType(this.annotations[line]);
title = this.annotations[line].map(function(x) {
return x.text;
}).join('\n');
lineDiv.addEventListener('mouseover', (function(_this) {
return function() {
_this.tooltipElement.innerText = _this.tooltipElement.textContent = title;
return _this.tooltipElement.style.display = 'block';
};
})(this));
lineDiv.addEventListener('mousemove', (function(_this) {
return function(event) {
_this.tooltipElement.style.left = event.pageX + 'px';
return _this.tooltipElement.style.top = event.pageY + 'px';
};
})(this));
lineDiv.addEventListener('mouseout', (function(_this) {
return function() {
return _this.tooltipElement.style.display = 'none';
};
})(this));
}
if (this.breakpoints[line]) {
lineDiv.className += ' droplet_breakpoint';
}
lineDiv.style.top = treeView.bounds[line].y + "px";
lineDiv.style.paddingTop = (treeView.distanceToBase[line].above - this.session.view.opts.textHeight - this.session.fontAscent) + "px";
lineDiv.style.paddingBottom = "" + (treeView.distanceToBase[line].below - this.session.fontDescent);
lineDiv.style.height = treeView.bounds[line].height + 'px';
lineDiv.style.fontSize = this.session.fontSize + 'px';
this.lineNumberWrapper.appendChild(lineDiv);
return this.lineNumberTags[line].lastPosition = treeView.bounds[line].y;
lineDiv.className = 'droplet-gutter-line';
if (this.annotations[line] != null) {
lineDiv.className += ' droplet_' + getMostSevereAnnotationType(this.annotations[line]);
title = this.annotations[line].map(function(x) {
return x.text;
}).join('\n');
lineDiv.addEventListener('mouseover', (function(_this) {
return function() {
_this.tooltipElement.innerText = _this.tooltipElement.textContent = title;
return _this.tooltipElement.style.display = 'block';
};
})(this));
lineDiv.addEventListener('mousemove', (function(_this) {
return function(event) {
_this.tooltipElement.style.left = event.pageX + 'px';
return _this.tooltipElement.style.top = event.pageY + 'px';
};
})(this));
lineDiv.addEventListener('mouseout', (function(_this) {
return function() {
return _this.tooltipElement.style.display = 'none';
};
})(this));
}
if (this.breakpoints[line]) {
lineDiv.className += ' droplet_breakpoint';
}
lineDiv.style.top = treeView.bounds[line].y + "px";
lineDiv.style.paddingTop = (treeView.distanceToBase[line].above - this.session.view.opts.textHeight - this.session.fontAscent) + "px";
lineDiv.style.paddingBottom = "" + (treeView.distanceToBase[line].below - this.session.fontDescent);
lineDiv.style.height = treeView.bounds[line].height + 'px';
lineDiv.style.fontSize = this.session.fontSize + 'px';
this.lineNumberWrapper.appendChild(lineDiv);
return this.lineNumberTags[line].lastPosition = treeView.bounds[line].y;
};

TYPE_SEVERITY = {
Expand Down
12 changes: 6 additions & 6 deletions apps/lib/droplet/droplet-full.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/lib/droplet/droplet-full.min.js.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions dashboard/test/ui/features/applab/eyes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ Scenario: Applab debugging
And I see no difference for "stepped in twice"
Then I press "stepInButton"
And I see no difference for "stepped in thrice"
Then I press "show-code-header"
And I wait to see Droplet block mode
And I press "resetButton"
And I click droplet gutter line 1
And I see no difference for "droplet breakpoint"
Then I close my eyes

Scenario: Drag to delete
Expand Down
14 changes: 14 additions & 0 deletions dashboard/test/ui/features/step_definitions/droplet_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@
@browser.execute_script code
end

When /^I click droplet gutter line (\d+)$/ do |line|
code = %{
var gutterLine = $(".droplet-gutter-line").filter(function (index) { return $(this).text() === "#{line}"; });
var x = gutterLine.offset().left + 5;
var y = gutterLine.offset().top + 5;
gutterLine.simulate( 'mousedown', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit that i dont really care about: space before 'mousedown'

clientX: x,
clientY: y,
});
}

@browser.execute_script code
end

When /^I ensure droplet is in text mode$/ do
steps 'And I wait to see "#show-code-header"'
button_text = @browser.execute_script("return $('#show-code-header').text()")
Expand Down