Skip to content

Commit

Permalink
Fix: Change remaining CSS selectors to use ba- prefix (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
pramodsum authored Apr 11, 2018
1 parent f881b6e commit baf4ebc
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 25 deletions.
10 changes: 5 additions & 5 deletions src/Annotator.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
fill: $highlight-yellow;
}

.bp-is-text-highlighted .ba-annotation-highlight-dialog .bp-btn-plain {
.ba-is-text-highlighted .ba-annotation-highlight-dialog .bp-btn-plain {
svg {
fill: $highlight-yellow;
}
Expand Down Expand Up @@ -356,7 +356,7 @@
}
}

.bp-annotation-profile {
.ba-annotation-profile {
background-color: $tendemob-grey;
border-radius: 16px; // Circle
color: $white;
Expand Down Expand Up @@ -415,7 +415,7 @@
top: 15px; // Match 15px padding top on page
}

.bp-highlight-dialog {
.ba-highlight-dialog {
border-top: 20px solid transparent; // Transparent border for hover detection
color: $fours;
display: table;
Expand Down Expand Up @@ -466,7 +466,7 @@
}
}

.bp-create-highlight-comment {
.ba-create-highlight-comment {
background-color: #fff;
overflow-x: hidden;
overflow-y: auto;
Expand Down Expand Up @@ -526,7 +526,7 @@
}

.ba-annotation-drawing-label,
.bp-annotation-highlight-label {
.ba-annotation-highlight-label {
padding: 8px 4px;
width: 100%;
}
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/AnnotationDialog-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe('AnnotationDialog', () => {
dialog.hasAnnotations = true;
dialog.deactivateReply();
const commentsTextArea = dialog.element.querySelector(constants.SELECTOR_ANNOTATION_TEXTAREA);
commentsTextArea.classList.remove('bp-is-active');
commentsTextArea.classList.remove(constants.CLASS_ACTIVE);

dialog.show();
expect(stubs.position).to.be.called;
Expand Down Expand Up @@ -991,7 +991,7 @@ describe('AnnotationDialog', () => {

it('should do nothing if reply textarea is already active', () => {
const replyTextEl = dialog.element.querySelector(`.${CLASS_REPLY_TEXTAREA}`);
replyTextEl.classList.add('bp-is-active');
replyTextEl.classList.add(constants.CLASS_ACTIVE);
sandbox.stub(util, 'showElement');

dialog.activateReply();
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/CommentBox-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ describe('CommentBox', () => {
el = commentBox.createHTML();
});

it('should create and return a section element with bp-create-highlight-comment class on it', () => {
it('should create and return a section element with ba-create-highlight-comment class on it', () => {
expect(el.nodeName).to.equal('SECTION');
expect(el.classList.contains('ba-create-comment')).to.be.true;
});
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/CreateAnnotationDialog-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const stubs = {};
describe('CreateAnnotationDialog', () => {
beforeEach(() => {
parentEl = document.createElement('div');
parentEl.classList.add('bp-create-dialog-container');
parentEl.classList.add('ba-create-dialog-container');
dialog = new CreateAnnotationDialog(parentEl, {
isMobile: true,
localized
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/util-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,14 @@ describe('util', () => {
const textAreaEl = document.querySelector('.textarea');

// Fake making text area 'active'
textAreaEl.classList.add('bp-is-active');
textAreaEl.classList.add(CLASS_ACTIVE);
textAreaEl.value = 'test';
textAreaEl.style.width = '10px';
textAreaEl.style.height = '10px';

resetTextarea(textAreaEl);

expect(textAreaEl).to.not.have.class('bp-is-active');
expect(textAreaEl).to.not.have.class(CLASS_ACTIVE);
expect(textAreaEl).to.not.have.class('ba-invalid-input');
expect(textAreaEl.value).to.equal('test');
expect(textAreaEl.style.width).to.equal('');
Expand Down Expand Up @@ -281,7 +281,7 @@ describe('util', () => {
});

it('should return avatar HTML initials if no avatarUrl is provided', () => {
const expectedHtml = '<div class="bp-annotation-profile avatar-color-1">SN</div>'.trim();
const expectedHtml = '<div class="ba-annotation-profile avatar-color-1">SN</div>'.trim();
expect(getAvatarHtml('', '1', 'Some Name')).to.equal(expectedHtml);
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/doc/DocAnnotator.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const SELECTOR_PREVIEW_DOC = '.bp-doc';
const CLASS_DEFAULT_CURSOR = 'bp-use-default-cursor';

// Required by rangy highlighter
const ID_ANNOTATED_ELEMENT = 'bp-rangy-annotated-element';
const ID_ANNOTATED_ELEMENT = 'ba-rangy-annotated-element';

const ANNOTATION_LAYER_CLASSES = [
CLASS_ANNOTATION_LAYER_HIGHLIGHT,
Expand Down
6 changes: 3 additions & 3 deletions src/doc/DocHighlightDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import * as docUtil from './docUtil';
import { ICON_HIGHLIGHT, ICON_HIGHLIGHT_COMMENT } from '../icons/icons';
import * as constants from '../constants';

const CLASS_HIGHLIGHT_DIALOG = 'bp-highlight-dialog';
const CLASS_TEXT_HIGHLIGHTED = 'bp-is-text-highlighted';
const CLASS_HIGHLIGHT_LABEL = 'bp-annotation-highlight-label';
const CLASS_HIGHLIGHT_DIALOG = 'ba-highlight-dialog';
const CLASS_TEXT_HIGHLIGHTED = 'ba-is-text-highlighted';
const CLASS_HIGHLIGHT_LABEL = 'ba-annotation-highlight-label';

const HIGHLIGHT_DIALOG_HEIGHT = 38;
const PAGE_PADDING_BOTTOM = 15;
Expand Down
2 changes: 1 addition & 1 deletion src/doc/__tests__/CreateHighlightDialog-test.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div class="bp-create-highlight-dialog-container"></div>
<div class="ba-create-highlight-dialog-container"></div>
2 changes: 1 addition & 1 deletion src/doc/__tests__/CreateHighlightDialog-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('doc/CreateHighlightDialog', () => {
fixture.load('doc/__tests__/CreateHighlightDialog-test.html');

parentEl = document.createElement('div');
parentEl.classList.add('bp-create-dialog-container');
parentEl.classList.add('ba-create-dialog-container');
dialog = new CreateHighlightDialog(parentEl, {
allowHighlight: true,
allowComment: true,
Expand Down
2 changes: 1 addition & 1 deletion src/doc/__tests__/DocHighlightDialog-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div data-type="annotation-dialog" class="ba-annotation-dialog">
<div class="ba-annotation-caret"></div>
<div class="ba-annotation-highlight-dialog">
<span class="bp-annotation-highlight-label"></span>
<span class="ba-annotation-highlight-label"></span>
</div>
<div class="annotation-container">
<div data-section="create"></div>
Expand Down
6 changes: 3 additions & 3 deletions src/doc/__tests__/DocHighlightDialog-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ let dialog;
const sandbox = sinon.sandbox.create();
let stubs = {};

const CLASS_HIGHLIGHT_DIALOG = 'bp-highlight-dialog';
const CLASS_TEXT_HIGHLIGHTED = 'bp-is-text-highlighted';
const CLASS_HIGHLIGHT_LABEL = 'bp-annotation-highlight-label';
const CLASS_HIGHLIGHT_DIALOG = 'ba-highlight-dialog';
const CLASS_TEXT_HIGHLIGHTED = 'ba-is-text-highlighted';
const CLASS_HIGHLIGHT_LABEL = 'ba-annotation-highlight-label';
const DATA_TYPE_HIGHLIGHT_BTN = 'highlight-btn';
const DATA_TYPE_ADD_HIGHLIGHT_COMMENT = 'add-highlight-comment-btn';
const PAGE_PADDING_TOP = 15;
Expand Down
2 changes: 1 addition & 1 deletion src/image/__tests__/ImagePointDialog-test.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="annotated-element bp-annotated">
<div class="annotated-element ba-annotated">
<img width="400px" height="600px" data-page-number="1">
<div data-type="annotation-dialog" class="ba-annotation-dialog">
<div class="ba-annotation-caret"></div>
Expand Down
2 changes: 1 addition & 1 deletion src/image/__tests__/imageUtil-test.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="mock-header-bar" height="30px" width="100px"></div>
<div class="annotated-element bp-annotated">
<div class="annotated-element ba-annotated">
<img width="100px" height="200px" data-page-number="1">
<button class="ba-point-annotation-marker"></button>
</div>
2 changes: 1 addition & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ export function getAvatarHtml(avatarUrl, userId, userName, altText) {
}

const index = parseInt(userId, 10) || 0;
return `<div class="bp-annotation-profile avatar-color-${index % AVATAR_COLOR_COUNT}">${initials}</div>`.trim();
return `<div class="ba-annotation-profile avatar-color-${index % AVATAR_COLOR_COUNT}">${initials}</div>`.trim();
}

/**
Expand Down

0 comments on commit baf4ebc

Please sign in to comment.