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
/* ***** BEGIN LICENSE BLOCK ***** | |
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 | |
* | |
* The contents of this file are subject to the Mozilla Public License Version | |
* 1.1 (the "License"); you may not use this file except in compliance with | |
* the License. You may obtain a copy of the License at | |
* http://www.mozilla.org/MPL/ | |
* | |
* Software distributed under the License is distributed on an "AS IS" basis, | |
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
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
<dl> | |
<dt>[b]bold[/b]</dt> | |
<dd>Bold style text, which produces: <strong>bold</strong> | |
</dd> | |
<dt>[quote="cite"]quotation text[/quote]</dt> | |
<dd>Citing and quoting text, which produces: <blockquote><cite>cite</cite><div>quotation text</div></blockquote></dd> | |
</dl> |
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
/* | |
* @example An iframe-based dialog with frame window fit dialog size. | |
*/ | |
( function() { | |
CKEDITOR.plugins.add( 'iframe-fit-size', | |
{ | |
requires: [ 'iframedialog' ], | |
init: function( editor ) | |
{ | |
var height = 480, width = 750; |
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
CKEDITOR.replace( 'editor1', | |
{ | |
on : | |
{ | |
'pluginsLoaded' : function( evt ) | |
{ | |
// Disallow all heading elements. | |
evt.editor.dataProcessor.dataFilter.addRules( | |
{ |
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
// Insert link (apply link style) to selected html in editor. | |
var style = new CKEDITOR.style( { element : 'a', attributes : attributes } ); | |
style.type = CKEDITOR.STYLE_INLINE; // need to override... dunno why. | |
style.apply( editor.document ); |
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
// The below code is for FF only. | |
var editor = CKEDITOR.appendTo( 'editor1' ); | |
setTimeout( function() | |
{ | |
var focused = editor.focusManager.hasFocus; | |
if ( focused ) | |
{ | |
var sel = editor.getSelection(); | |
sel.lock(); |
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
function getIndex( normalized ) | |
{ | |
// Attention: getAddress depends on this.$ | |
// getIndex is called on a plain object: { $ : node } | |
var current = this.$, | |
index = -1, | |
isNormalizing; | |
do |
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
// Generate list of editable elements from DTD. | |
// :npm install underscore | |
// :node editable.js | |
var _ = require('underscore'); | |
var X = _.intersection, U = _.union, D = _.difference; | |
var flow = [ 'a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'blockquote', 'br', 'button', 'canvas', 'cite', 'code', 'command', 'datalist', 'del', 'details', 'dfn', 'div', 'dl', 'em', 'embed', 'fieldset', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'map', 'mark', 'math', 'menu', 'meter', 'nav', 'noscript', 'object', 'ol', 'output', 'p', 'pre', 'progress', 'q', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'span', 'strong', 'style', 'sub', 'sup', 'svg', 'table', 'textarea', 'time', 'u', 'ul', 'var', 'video', 'wbr'], | |
phrasing = [ 'a', 'abbr', 'area', 'audio', 'b', 'bdi', 'bdo', 'br', 'button', 'canvas', 'cite', 'code', 'command', 'datalist', 'del', 'dfn', 'em', 'embed', 'i', |
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
function checkCaretSelection( sel ) | |
{ | |
var ranges = sel.getRanges(); | |
return ranges.length == 1 && ranges[ 0 ].collapsed; | |
} |
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
#!/bin/sh | |
BRANCH=$1 | |
git checkout $BRANCH | |
git fetch origin | |
git merge-base $BRANCH origin/$BRANCH | xargs git reset --hard | |
git merge origin/$BRANCH --ff-only |
OlderNewer