Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ module.exports = function (grunt) {
'!src/extensions/**/thirdparty/**/*.js',
'!src/extensions/dev/**',
'!src/extensions/extra/brackets-cdn-suggestions/**',
'!src/extensions/default/Brackets-InteractiveLinter/**',
'!src/extensions/extra/HTMLHinter/**',
'!src/extensions/extra/MDNDocs/**',
'!src/bramble/thirdparty/EventEmitter/**',
Expand Down
14 changes: 14 additions & 0 deletions src/extensions/default/Brackets-InteractiveLinter/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"env": {
"browser": true,
"amd": true
},
"rules": {
"semi": 1,
"strict": 0,
"quotes": [2, "double"],
"key-spacing": 0,
"no-trailing-spaces": 0,
"eol-last": 0
}
}
226 changes: 226 additions & 0 deletions src/extensions/default/Brackets-InteractiveLinter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
plugins/dev/*
plugins/disabled/*
!plugins/dev/README.md
!plugins/disabled/README.md

#################
## NodeJs
#################
node_modules/


#################
## Eclipse
#################

*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath


#################
## Visual Studio
#################

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results

[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml
*.pubxml

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf

#############
## Windows detritus
#############

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac crap
.DS_Store


#############
## Python
#############

*.py[co]

# Packages
*.egg
*.egg-info
#dist/
build/
eggs/
parts/
var/
sdist/
develop-eggs/
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox

#Translations
*.mo

#Mr Developer
.mr.developer.cfg
23 changes: 23 additions & 0 deletions src/extensions/default/Brackets-InteractiveLinter/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"undef": true,
"unused": true,
"curly": true,
"indent": 4,
"devel": true,
"globals": {
"brackets": true,
"window": true,
"document": true,
"importScripts": true,
"postMessage": true,
"onmessage": true,
"requirejs": true,
"require": true,
"define": true,
"$": true,
"Mustache": true,
"clearTimeout": true,
"setTimeout": true,
"Worker": true
}
}
39 changes: 39 additions & 0 deletions src/extensions/default/Brackets-InteractiveLinter/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# The Basics

### Filing a bug

**For bugs** be sure to search existing issues first. Include steps to consistently reproduce the
problem, actual vs. expected results, and your OS and Brackets version number.

When filing a new bug, please include:

- Descriptive title
- Steps to reproduce the problem
- Describe current and expected behavior
- Include the exact text of any error messages if applicable (or upload screenshots)
- Brackets version (or if you're pulling directly from Git, your current commit SHA - use git rev-parse HEAD)
- Interactive Linter Version (see Extension Manager)
- OS, and OS version
- List of other installed extensions
- Any errors logged in Debug > Show Developer Tools - Console view

### Guidelines for code contributions

#### LoDash vs. Native Policy

- Use native methods when available
- Use LoDash for iteration of everything but arrays
- Use LoDash utility methods when the native alternative increases complexity and syntax verbosity

#### Code Style
- Use 4 spaces
- Format if/else, try/catch/finally, etc. block as follows. Note the line break before the `else` keyword.

```javascript
if (condition) {
// ...
}
else {

}
```
21 changes: 21 additions & 0 deletions src/extensions/default/Brackets-InteractiveLinter/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) 2013 Miguel Castillo.

Licensed under MIT

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
59 changes: 59 additions & 0 deletions src/extensions/default/Brackets-InteractiveLinter/ProblemWidget.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
* Interactive Linter Copyright (c) 2015 Miguel Castillo.
*
* Licensed under MIT
*/


define(function (require, exports, module) {
"use strict";

var _ = brackets.getModule("thirdparty/lodash");
var Mustache = brackets.getModule("thirdparty/mustache/mustache");
var InlineWidget = brackets.getModule("editor/InlineWidget").InlineWidget;
var widgetTemplate = require("text!templates/inlineWidgetLint.html");

function ProblemWidget(mark, line) {
InlineWidget.call(this);

var problems = [].concat(mark.warnings, mark.errors);
var $html = $(Mustache.render(widgetTemplate, { messages: problems }));
this.$wrapperDiv = $html;

this.$wrapperDiv
.appendTo(this.$htmlContent)
.on("mousedown", function (e) {
e.stopPropagation();
});

this.line = line;
this._sizeEditorToContent = _.debounce(sizeEditorToContent.bind(this), 250);
}


ProblemWidget.prototype = Object.create(InlineWidget.prototype);
ProblemWidget.prototype.constructor = ProblemWidget;

ProblemWidget.prototype.onAdded = function() {
InlineWidget.prototype.onAdded.apply(this, arguments);

// Set height initially, and again whenever width might have changed (word wrap)
this._sizeEditorToContent();
$(window).on("resize", this._sizeEditorToContent);
};

ProblemWidget.prototype.onClosed = function() {
InlineWidget.prototype.onClosed.apply(this, arguments);
$(window).off("resize", this._sizeEditorToContent);
};

ProblemWidget.prototype.refresh = function() {
this._sizeEditorToContent();
};

function sizeEditorToContent () {
this.hostEditor.setInlineWidgetHeight(this, this.$wrapperDiv.height() + 20, true);
}

module.exports = ProblemWidget;
});
Loading