Skip to content

Commit

Permalink
extract Link to internal arc plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
devrieda committed Oct 15, 2015
1 parent 6ba0653 commit 77aa7c9
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 20 deletions.
1 change: 1 addition & 0 deletions examples/basic/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const Config = {
{ name: "center" },
{ name: "quote" },
{ name: "code" },
{ name: "link" },
// { name: "tweet", src: TweetPlugin }
];
},
Expand Down
7 changes: 1 addition & 6 deletions modules/helpers/Config/MenuButtonConfig.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import Config from './Config';

// default buttons
import LinkButton from '../../components/MenuButtons/LinkButton';

const defaults = [
LinkButton,
];
const defaults = [];

const MenuButtonConfig = Config({
getInitialItems() {
Expand Down
4 changes: 2 additions & 2 deletions modules/helpers/Config/__test__/MenuButtonConfig-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import ItalicKey from '../../../plugins/italic/ItalicKey';
describe('MenuButtonConfig', () => {
beforeEach(function() {
MenuButtonConfig.reset();
MenuButtonConfig.use(ItalicKey, { before: 'link' })
MenuButtonConfig.use(ItalicKey)
MenuButtonConfig.use(BoldKey, { before: 'italic' })
});

describe("#getItems", () => {
it("retrieves list of default items", () => {
expect(MenuButtonConfig.getItems().length).toEqual(3);
expect(MenuButtonConfig.getItems().length).toEqual(2);
});
});

Expand Down
2 changes: 2 additions & 0 deletions modules/helpers/ConfigManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import H2Plugin from '../plugins/h2';
import H3Plugin from '../plugins/h3';
import CenterPlugin from '../plugins/center';
import QuotePlugin from '../plugins/quote';
import LinkPlugin from '../plugins/link';
import CodePlugin from '../plugins/code';

const DEFAULT_PLUGINS = [
Expand All @@ -22,6 +23,7 @@ const DEFAULT_PLUGINS = [
{ name: 'h3', src: H3Plugin },
{ name: 'center', src: CenterPlugin },
{ name: 'quote', src: QuotePlugin },
{ name: 'link', src: LinkPlugin },
{ name: 'code', src: CodePlugin },
];

Expand Down
5 changes: 5 additions & 0 deletions modules/plugins/link/Link.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// inline
.arc-Editor-Block__a,
.arc-Editor-Block__a:visited {
color: rgba(0,153,224,1.0);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react/addons';
import MenuButton from '../MenuButton';
import React from 'react';
import MenuButton from '../../components/MenuButton';
import ToggleMarkup from '../../helpers/Manipulation/ToggleMarkup';
import EditorStore from '../../stores/EditorStore';

Expand Down
10 changes: 10 additions & 0 deletions modules/plugins/link/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Button from "./LinkButton";
import './Link.scss';

const Plugin = {
installMenuButtons(config) {
config.use(Button);
},
};

export default Plugin;
9 changes: 0 additions & 9 deletions modules/stylesheets/components/Block.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,3 @@
counter-increment: post;
content: counter(post) ".";
}

// inline
.arc-Editor-Block__em {
font-style: italic;
}
.arc-Editor-Block__a,
.arc-Editor-Block__a:visited {
color: $link-color;
}
1 change: 0 additions & 1 deletion modules/stylesheets/shared/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ $text-color: rgba(0,0,0,0.8);
$light-text-color: rgba(0,0,0,0.5);
$header-color: rgba(0,0,0,0.8);
$rule-color: rgba(0,0,0,0.15);
$link-color: rgba(0,153,224,1.0);

// menu
$menu-color: rgba(0, 151, 226, 1);
Expand Down

0 comments on commit 77aa7c9

Please sign in to comment.