This file contains 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
try { | |
const entities = await Nymph.getEntities( | |
{'class': BlogPost.class}, | |
{'type': '&', | |
'like': ['title', '%easy%'], | |
'equal': ['archived', false] | |
} | |
); | |
console.log(entities); | |
} catch (e) { |
This file contains 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
<?php | |
/** | |
* Slim archiving class. | |
* | |
* Slim is a portable file archive format based on JSON. It can be self | |
* extracting in multiple languages. | |
* | |
* @license https://www.apache.org/licenses/LICENSE-2.0 | |
* @author Hunter Perrin <[email protected]> |
This file contains 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 |
NewerOlder