Skip to content

Commit

Permalink
merge master into debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
nmielnik committed Mar 29, 2015
2 parents dff15c3 + d0f87bd commit c7ddb04
Show file tree
Hide file tree
Showing 52 changed files with 1,094 additions and 508 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ indent_size = 4

[*.json]
indent_size = 2

[.jshintrc]
indent_size = 2
15 changes: 15 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"boss": true,
"browser": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"immed": true,
"latedef": true,
"newcap": false,
"noarg": true,
"sub": true,
"undef": true,
"unused": true,
"validthis": true
}
32 changes: 32 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
4.0.3 / 2015-03-27
==================
* Introduce 'removeFormat' button, for removing formatting from selection
* Fix issues with focus/blur when using standardizeSelectionStart option


4.0.2 / 2015-03-26
==================
* Fix bug causing toolbar to disappaer on click in safari (rollback fix from 4.0.1)
* Break up anchor form extension logic into more overrideable parts


4.0.1 / 2015-03-24
==================
* Fix issue with dragged in image sizes
* Fix issues with focus/blur when using standardizeSelectionStart option


4.0.0 / 2015-03-23
==================
* Introduced custom events (consumable externally)
* Reduce API surface area
* Deprecated activate & deactivated. Exposed setup and destroy as replacements
* Updated documentation to reflect API changes
* HTML standardization around list items
* Fixed throttling
* Added superscript & subscript css
* Added better paste cleaning for Microsoft Word
* Convert anchor preview into overrideable extension
* Added disableAnchorPreview option


3.0.9 / 2015-03-10
==================
* Extract toolbar
Expand Down
41 changes: 20 additions & 21 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ module.exports = function (grunt) {
'src/js/extension-anchor-preview.js',
'src/js/toolbar.js',
'src/js/placeholders.js',
'src/js/core.js'
'src/js/core.js',
'src/js/version.js'
],
browsers = [ {
browserName: "internet explorer",
Expand Down Expand Up @@ -62,21 +63,19 @@ module.exports = function (grunt) {
}
};

gruntConfig.jslint = {
client: {
exclude: ['src/js/polyfills.js'],
// TODO: build check with debug and devel false
gruntConfig.jshint = {
options: {
ignores: ['src/js/polyfills.js'],
jshintrc: true,
reporter: require('jshint-stylish')
},
all: {
src: [
'src/js/**/*.js',
'spec/*.spec.js',
'Gruntfile.js'
],
directives: {
browser: true,
unparam: true,
todo: true,
regexp: true,
debug: true
}
]
}
};

Expand Down Expand Up @@ -107,11 +106,6 @@ module.exports = function (grunt) {
options: {
dir: 'reports/jasmine/lcov'
}
}, {
type: 'html',
options: {
dir: 'coverage'
}
}]
},
summary: true
Expand Down Expand Up @@ -274,7 +268,7 @@ module.exports = function (grunt) {

gruntConfig.bump = {
options: {
files: ['bower.json', 'package.json'],
files: ['bower.json', 'package.json','src/js/version.js'],
updateConfigs: [],
commit: false,
createTag: false,
Expand All @@ -292,10 +286,15 @@ module.exports = function (grunt) {
]
});

grunt.registerTask('test', ['jslint', 'concat', 'jasmine:suite', 'csslint']);
grunt.registerTask('travis', ['connect', 'jslint', 'jasmine:suite', 'csslint', 'saucelabs-jasmine', 'coveralls']);
if (parseInt(process.env.TRAVIS_PULL_REQUEST, 10) > 0) {
grunt.registerTask('travis', ['jshint', 'jasmine:suite', 'csslint', 'coveralls']);
} else {
grunt.registerTask('travis', ['connect', 'jshint', 'jasmine:suite', 'csslint', 'saucelabs-jasmine', 'coveralls']);
}

grunt.registerTask('test', ['jshint', 'concat', 'jasmine:suite', 'csslint']);
grunt.registerTask('sauce', ['connect', 'saucelabs-jasmine']);
grunt.registerTask('js', ['jslint', 'concat', 'jasmine:suite', 'uglify']);
grunt.registerTask('js', ['jshint', 'concat', 'jasmine:suite', 'uglify']);
grunt.registerTask('css', ['sass', 'autoprefixer', 'cssmin', 'csslint']);
grunt.registerTask('default', ['js', 'css']);

Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ var elements = document.querySelectorAll('.editable'),
* __updateOnEmptySelection__: update the state of the toolbar buttons even when the selection is collapse (there is no selection, just a cursor). Default: false

### Anchor form options
* __anchorButton__: enables/disables adding class __anchorButtonClass__ to anchor tags. Default: false
* __anchorButton__: enables/disables displaying a checkbox for whether the user wants the link to be displayed as a "button". If checkbox is checked, the created link will have __anchorButtonClass__ added to the class list. Default: false
* __anchorButtonClass__: class to add to anchor tags, when __anchorButton__ is set to true. Default: btn
* __anchorTarget__: enables/disables displaying a "Open in new window" checkbox, which when checked changes the `target` attribute of the created link. Default: false
* __anchorInputCheckboxLabel__: text to be shown in the checkbox enabled via the __anchorTarget__ option. Default: _Open in new window_
* __anchorInputPlaceholder__: text to be shown as placeholder of the anchor input. Default: _Paste or type a link_
* __anchorInputCheckboxLabel__: text to be shown for the anchor new window target. Default: _Open in new window_
* __anchorPreviewHideDelay__: time in milliseconds to show the anchor tag preview after the mouse has left the anchor tag. Default: 500
* __checkLinkFormat__: enables/disables check for common URL protocols on anchor links. Default: false
* __targetBlank__: enables/disables target="\_blank" for anchor tags. Default: false
Expand Down Expand Up @@ -140,6 +141,7 @@ Medium Editor, by default, will show only the buttons listed above to avoid a hu
* __image__ (this simply converts selected text to an image tag)
* __indent__ (moves the selected text up one level)
* __outdent__ (moves the selected text down one level)
* __removeFormat__ (clears inline style formatting, preserves blocks)


## Themes
Expand All @@ -149,8 +151,8 @@ Check out the Wiki page for a list of available themes: [https://github.com/davi
## API

### Core Methods
* __.deactivate()__: disables the editor, removing all DOM elements and event handlers
* __.activate()__: re-activates the editor if deactivated
* __.destroy()__: tears down the editor if already setup, removing all DOM elements and event handlers
* __.setup()__: rebuilds the editor if it has already been destroyed, recreating DOM elements and attaching event handlers
* __.serialize()__: returns a JSON object with elements contents
* __.execAction(action, opts)__: executes an built-in action via `document.execCommand`
* __.createLink(opts)__: creates a link via the native `document.execCommand('createLink')` command
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "medium-editor",
"version": "3.0.9",
"version": "4.0.3",
"homepage": "http://daviferreira.github.io/medium-editor/",
"authors": [
"Davi Ferreira <hi@daviferreira.com>",
Expand Down
4 changes: 2 additions & 2 deletions demo/js/extension-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ TableDerived.prototype = {

// Add save buton
save.setAttribute('href', '#');
save.className = 'medium-editor-toobar-save';
save.className = 'medium-editor-toolbar-save';
save.innerHTML = this.base.options.buttonLabels === 'fontawesome' ?
'<i class="fa fa-check"></i>' :
'&#10003;';
Expand All @@ -163,7 +163,7 @@ TableDerived.prototype = {

// Add close button
close.setAttribute('href', '#');
close.className = 'medium-editor-toobar-close';
close.className = 'medium-editor-toolbar-close';
close.innerHTML = this.base.options.buttonLabels === 'fontawesome' ?
'<i class="fa fa-times"></i>' :
'&times;';
Expand Down
7 changes: 7 additions & 0 deletions dist/css/medium-editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
transform: matrix(1, 0, 0, 1, 0, 0);
opacity: 1; } }

.data-medium-element sup {
vertical-align: super; }
.data-medium-element sub {
vertical-align: sub; }
.data-medium-element img {
max-width: 100%; }

.medium-toolbar-arrow-under:after, .medium-toolbar-arrow-over:before {
position: absolute;
left: 50%;
Expand Down
2 changes: 1 addition & 1 deletion dist/css/medium-editor.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/css/themes/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
.medium-editor-toolbar {
border: 1px solid #000;
background-color: #242424;
background: -webkit-linear-gradient(bottom, #242424, rgba(36, 36, 36, 0.75));
background: -webkit-linear-gradient(top, #242424, rgba(36, 36, 36, 0.75));
background: linear-gradient(to bottom, #242424, rgba(36, 36, 36, 0.75));
border-radius: 5px;
box-shadow: 0 0 3px #000; }
Expand All @@ -22,7 +22,7 @@
border-left: 1px solid rgba(255, 255, 255, 0.1);
background-color: #242424;
color: #fff;
background: -webkit-linear-gradient(bottom, #242424, rgba(36, 36, 36, 0.89));
background: -webkit-linear-gradient(top, #242424, rgba(36, 36, 36, 0.89));
background: linear-gradient(to bottom, #242424, rgba(36, 36, 36, 0.89));
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
-webkit-transition: background-color .2s ease-in;
Expand All @@ -39,7 +39,7 @@
.medium-editor-toolbar li .medium-editor-button-active {
background-color: #000;
color: #fff;
background: -webkit-linear-gradient(bottom, #242424, rgba(0, 0, 0, 0.89));
background: -webkit-linear-gradient(top, #242424, rgba(0, 0, 0, 0.89));
background: linear-gradient(to bottom, #242424, rgba(0, 0, 0, 0.89)); }

.medium-editor-toolbar-form {
Expand Down

0 comments on commit c7ddb04

Please sign in to comment.