This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is: ~/.ssh/config | |
# You may have other (non-CodeCommit) SSH credentials stored in this | |
# config file – in addition to the CodeCommit settings shown below. | |
# NOTE: Make sure to run [ chmod 600 ~/.ssh/config ] after creating this file! | |
# Credentials for Account1 | |
Host awscc-account1 # 'awscc-account1' is a name you pick | |
Hostname git-codecommit.us-east-1.amazonaws.com # This points to CodeCommit in the 'US East' region |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { EditorState, SelectionState } from 'draft-js'; | |
import getSelectedBlocks from './getSelectedBlocks'; | |
/** | |
* Calls a provided `modifier` function with a selection for each | |
* selected block in the current editor selection. Passes through additional | |
* arguments to the modifier. | |
* | |
* Note: At the moment it will retain the original selection and override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getCaretYPosition = function(){ | |
var editor = CKEDITOR.instances.editor1, //get your CKEDITOR instance here | |
sel = editor.getSelection(), // text selection | |
obj = sel.getStartElement().$, // the element the selected text resides in | |
range = editor.getSelection().getRanges(), // range of selection | |
container = range[0].startContainer.$, // get the DOM node of the selected text, probably a textnode | |
textlen = typeof obj.textContent === "undefined" ? obj.innerText.length : obj.textContent.length, // get the length of the text in the container | |
offset = range[0].startOffset; // get the offset from the beginning of the text in the container to the caret | |
if (container.nodeType === 3) { // if the container is a text node | |
while (container.previousSibling) { // add the length of all the preceding text nodes and elements in the same parent element |