Commit fad08d3c authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

aloha: add basic iframed gadget

parent c335849c

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Getting Started with Aloha Editor</title>
<!-- Load Aloha Editor css and js -->
<link rel="stylesheet" href="aloha/css/aloha.css" type="text/css">
<!-- exports require() and define() into the global namespace -->
<script src="aloha/lib/require.js"></script>
<!-- defines the 'jquery' module -->
<script src="aloha/lib/jquery-1.7.2.js"></script>
<!-- uses the 'jquery' module defined above -->
<script src="aloha/lib/aloha.js"
data-aloha-plugins="common/ui,common/format,common/highlighteditables,common/link,common/image,common/list,common/table"></script>
</head>
<body>
<div id="main">
<div id="content"><p>Getting started with Aloha Editor!</p></div>
</div>
<script type="text/javascript">
//Aloha.ready( function() {
Aloha.jQuery('#content').aloha();
//});
$('#aloha-devtool-source-viewer-content').live('keyup', function () {
var text = $('#aloha-devtool-source-viewer-content').clone();
var spanToKill = text.find('span.aloha-devtool-source-viewer-marker');
spanToKill.remove();
text = text.text();
var selectededit = $('.aloha-editable-active');
selectededit.html(text);
});
</script>
</body>
#editor {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<title>Aloha Editor</title>
<!-- Load Aloha Editor css and js -->
<link rel="stylesheet" href="aloha/css/aloha.css" type="text/css">
<!-- exports require() and define() into the global namespace -->
<script src="aloha/lib/require.js"></script>
<!-- defines the 'jquery' module -->
<script src="aloha/lib/jquery-1.7.2.js"></script>
<!-- uses the 'jquery' module defined above -->
<script src="aloha/lib/aloha.js"
data-aloha-plugins="common/ui,common/format,common/highlighteditables,common/link,common/image,common/list,common/table"></script>
<script src="../../node_modules/rsvp/dist/rsvp-2.0.4.js" type="text/javascript"></script>
<script src="../../dist/renderjs-latest.js" type="text/javascript"></script>
<script src="aloha.js"></script>
</head>
<body>
<div id="editor"></div>
</body>
</html>
/*global Aloha */
(function (window, rJS, Aloha,$) {
"use strict";
var gk = rJS(window);
gk.declareMethod('setContent', function (value) {
$('#editor').empty().append(value);
})
.declareMethod('getContent', function () {
return $('#editor').html();
});
gk.ready(function (g) {
Aloha.ready( function() {
Aloha.jQuery('#editor').aloha();
});
});
}(window, rJS, Aloha, jQuery));
\ No newline at end of file
/* This file should only contain import statements, only one each for
* the core and plugins, so that it is easy to make variations of this
* file that exclude some plugins.
*/
@import "aloha-core.css";
@import "../plugins/common/abbr/css/abbr.css";
@import "../plugins/common/ui/css/ui.css";
@import "../plugins/common/link/css/link.css";
@import "../plugins/common/characterpicker/css/characterpicker.css";
@import "../plugins/common/highlighteditables/css/highlighteditables.css";
@import "../plugins/common/horizontalruler/css/horizontalruler.css";
@import "../plugins/common/block/css/block.css";
@import "../plugins/common/align/css/align.css";
@import "../plugins/common/image/css/image.css";
@import "../plugins/common/table/css/table.css";
@import "../plugins/extra/cite/css/cite.css";
@import "../plugins/extra/formatlesspaste/css/formatless.css";
@import "../plugins/extra/wai-lang/css/wai-lang.css";
@import "../plugins/extra/numerated-headers/css/numerated-headers.css";
@import "../plugins/extra/ribbon/css/ribbon.css";
@import "../plugins/extra/headerids/css/headerids.css";
@import "../plugins/extra/metaview/css/metaview.css";
@import "../plugins/extra/textcolor/css/textcolor.css";
@import "aloha-reset.css";
@import "aloha-sidebar.css";
@import "../lib/vendor/repository-browser/css/repository-browser.css";
.aloha-editable {
min-height: 1.2em;
outline: none;
}
.aloha-editable ::selection,
.aloha-editable ::-moz-selection {
background: #80B5F2;
color: white;
}
.aloha-textarea {
overflow: hidden;
border:1px solid #ccc;
padding:6px;
overflow:auto;
}
/**
* Aloha CSS reset.
* Original by Eric Meyer. Modified for use in Aloha.
* Every element used in the Aloha Editor UI should have a an appropriate reset here.
*/
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
.aloha div, .aloha span, .aloha button, .aloha a, .aloha img,
.aloha ol, .aloha ul, .aloha li, .aloha label {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
.aloha ol, .aloha ul {
list-style: none;
}
.aloha-sidebar-bar {
z-index: 999999999;
position: fixed;
top: 0;
left: 0;
text-align: left;
font-family: Arial, sans-serif;
font-size: 12px;
border-right: 1px solid #888;
-moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, .5);
-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, .5);
box-shadow: 0px 0px 10px rgba(0, 0, 0, .5);
}
.aloha-sidebar-bar.aloha-sidebar-right {
left: auto;
right: 0;
border-right-width: 0;
border-left: 1px solid #888;
}
.aloha-sidebar-inner {
position: relative;
background-color: #ccc;
background-image: -webkit-radial-gradient(
rgba(0, 0, 0, 0.0) 20%,
rgba(0, 0, 0, 0.2) 80%,
rgba(0, 0, 0, 0.3) 100%
);
background-image: -moz-radial-gradient(
rgba(0, 0, 0, 0.0) 20%,
rgba(0, 0, 0, 0.2) 80%,
rgba(0, 0, 0, 0.3) 100%
);
}
.aloha-sidebar-panels {
width: 100%;
margin: 0;
padding: 15px 0;
}
.aloha-sidebar-panels li {
width: 90%;
overflow: hidden;
margin: 0;
padding: 0 15px;
}
.aloha-sidebar-panel-top {
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
}
.aloha-sidebar-panel-content.aloha-sidebar-panel-bottom {
padding-bottom: 0;
-webkit-border-bottom-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
-moz-border-radius-bottomleft: 5px;
-moz-border-radius-bottomright: 5px;
border-bottom-width: 1px;
}
.aloha-sidebar-panel-title {
position: relative;
padding: 8px 0 0 8px;
border: 1px solid rgba(0, 0, 0, 0.3);
border-bottom-width: 0;
background-color: #303539;
background-image: -webkit-gradient(
linear,
center top,
center bottom,
color-stop(0.00, #6c6f74),
color-stop(0.05, #4c4f54),
color-stop(0.10, #3f4448),
color-stop(0.45, #383d41),
color-stop(0.50, #303539),
color-stop(0.95, #33363b)
);
background-image: -moz-linear-gradient(
center top,
#6c6f74 0%,
#4c4f54 5%,
#3f4448 10%,
#383d41 45%,
#303539 50%,
#33363b 95%
);
color: #ccc;
cursor: pointer;
font-size: 13px;
font-weight: bold;
line-height: 1.5em;
text-shadow: 0 0 6px #23262b;
}
.aloha-sidebar-panel-title:hover {
color: #fff;
}
.aloha-sidebar-panel-title-arrow {
position: absolute;
top: 8px;
left: 8px;
width: 16px;
height: 16px;
background: url(../img/arrow.png) no-repeat center center;
opacity: 0.3;
}
.aloha-sidebar-panel-title:hover .aloha-sidebar-panel-title-arrow {
opacity: 0.9;
}
.aloha-sidebar-panel-title .aloha-sidebar-panel-title-arrow.aloha-sidebar-panel-title-arrow-down {
background-image: url(../img/arrow-down.png);
}
.aloha-sidebar-panel-title-text {
margin-left: 24px;
white-space: nowrap;
}
.aloha-sidebar-panel-content {
overflow: hidden;
height: 5px;
background: #303539;
padding: 2px;
padding-top: 0px;
}
.aloha-sidebar-panel-content-inner {
margin: 5px 0 0;
padding: 3px;
padding-top: 10px;
color: #888;
background: #fff;
background-image: -webkit-radial-gradient(
rgba(0, 0, 0, 0.0) 50%,
rgba(0, 0, 0, 0.1) 90%,
rgba(0, 0, 0, 0.2) 100%
);
background-image: -moz-radial-gradient(
rgba(0, 0, 0, 0.0) 50%,
rgba(0, 0, 0, 0.1) 90%,
rgba(0, 0, 0, 0.2) 100%
);
}
.aloha-sidebar-panel-content-inner ul, .aloha-sidebar-panel-content-inner ol {
padding-left: 10px;
}
.aloha-sidebar-panel-content-inner legend {
color: #000000;
font-weight: bold;
}
.aloha-sidebar-panel-content-inner label {
color: #000000;
font-weight: bold;
}
.aloha-sidebar-panel-content input, .aloha-sidebar-panel-content textarea {
width: 180px;
margin: 3px;
padding: 2px;
}
.aloha-sidebar-panel-content textarea {
height: 57px;
padding: 5px;
color: #555;
font-family: Arial, sans-serif;
font-size: 12px;
line-height: 1.2em;
}
.aloha-sidebar-handle {
position: absolute;
top: 30px;
right: -30px;
width: 40px;
height: 30px;
overflow: hidden;
background-color: #303539;
background-image: -webkit-gradient(
linear,
center top,
center bottom,
color-stop(0.00, #6c6f74),
color-stop(0.05, #4c4f54),
color-stop(0.10, #3f4448),
color-stop(0.45, #383d41),
color-stop(0.50, #303539),
color-stop(0.95, #33363b)
);
background-image: -moz-linear-gradient(
center top,
#6c6f74 0%,
#4c4f54 5%,
#3f4448 10%,
#383d41 45%,
#303539 50%,
#33363b 95%
);
cursor: pointer;
-moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, .5);
-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, .5);
box-shadow: 0px 0px 10px rgba(0, 0, 0, .5);
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
-moz-border-radius-topright: 5px;
-moz-border-radius-bottomright: 5px;
-webkit-border-top-right-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
}
.aloha-sidebar-right .aloha-sidebar-handle {
left: -30px;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
-moz-border-radius-topright: 0px;
-moz-border-radius-bottomright: 0px;
-webkit-border-top-right-radius: 0px;
-webkit-border-bottom-right-radius: 0px;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-bottomleft: 5px;
-webkit-border-top-left-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
}
.aloha-sidebar-handle-icon {
display: block;
position: absolute;
top: 5px;
right: 5px;
background: url(../img/arrow.png) no-repeat center center;
width: 20px;
height: 20px;
opacity: 0.5;
}
.aloha-sidebar-right .aloha-sidebar-handle-icon {
left: 5px;
right: auto;
}
.aloha-sidebar-handle-icon.aloha-sidebar-handle-icon-left {
background-image: url(../img/arrow-left.png);
}
.aloha-sidebar-panel-parent-path {
background-color: #303539;
background-image: -webkit-gradient(
linear,
center top,
center bottom,
color-stop(0.00, #6c6f74),
color-stop(0.05, #4c4f54),
color-stop(0.10, #3f4448),
color-stop(0.45, #383d41),
color-stop(0.50, #303539),
color-stop(0.95, #33363b)
);
background-image: -moz-linear-gradient(
center top,
#6c6f74 0%,
#4c4f54 5%,
#3f4448 10%,
#383d41 45%,
#303539 50%,
#33363b 95%
);
color: #fff;
cursor: pointer;
font-size: 12px;
text-shadow: 0 0 6px #23262b;
white-space: nowrap;
line-height: 1em;
}
.aloha-sidebar-panel-parent-path:hover {
opacity: 0.9;
}
.aloha-sidebar-panel-parent-path span {
display: inline-block;
padding: 0 10px 0 5px;
background: url(../img/breadcrumb-divider.png) no-repeat right center;
opacity: 0.25;
line-height: 1.6em;
}
.aloha-sidebar-panel-parent-path span:first-child {
font-weight: bold;
opacity: 0.8;
}
.aloha-sidebar-panel-parent-path span:last-child {
background: none;
}
.aloha-sidebar-panel-parent-content {
padding: 4px;
background-image: -webkit-gradient(
linear,
center top,
center bottom,
color-stop(0.0, rgba(0, 0, 0, 0.25)),
color-stop(0.05, rgba(0, 0, 0, 0.0))
);
background-image: -moz-linear-gradient(
center top,
rgba(0, 0, 0, 0.25) 0%,
rgba(0, 0, 0, 0.0) 5%
);
}
This diff is collapsed.
.aloha-block-CompanyBlock .aloha-block-inner {
border-bottom:1px dotted #CCC;
position:relative;
}
.stock-quote-overlay {
position:absolute;
top:20px;
left:0;
width:229px;
height:158px;
box-shadow:0 0 5px #333;
z-index:1000;
background-repeat:no-repeat;
background-color: #FFF;
}
.stock-quote-overlay.company-MSFT {
background-image:url('../img/stock-quote-msft.gif');
}
.stock-quote-overlay.company-AAPL {
background-image:url('../img/stock-quote-aapl.gif');
}
.aloha-block:hover > .block-draghandle-topleft,
.aloha-block-active > .block-draghandle-topleft {
display:block;
}
.block-draghandle-topleft {
position:absolute;
left:-1px;
top:-13px;
width:44px;
height:12px;
overflow:hidden;
display:none;
background:url(../img/toolbar-draghandle.gif);
border-top:1px solid #CCC;
border-left:1px solid #CCC;
border-right:1px solid #CCC;
border-top-left-radius:5px;
border-top-right-radius:5px;
}
.block-draghandle-topleft a {
padding: 0 2px;
font-size: 11px;
text-decoration: none;
color: #777;
display: block;
}
.block-draghandle-topleft a span {
color: #710909;
font-weight: bold;
}
\ No newline at end of file
/* block.js is part of Aloha Editor project http://aloha-editor.org
*
* Aloha Editor is a WYSIWYG HTML5 inline editing library and editor.
* Copyright (c) 2010-2012 Gentics Software GmbH, Vienna, Austria.
* Contributors http://aloha-editor.org/contribution.php
*
* Aloha Editor is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* Aloha Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* As an additional permission to the GNU GPL version 2, you may distribute
* non-source (e.g., minimized or compacted) forms of the Aloha-Editor
* source code without the copy of the GNU GPL normally required,
* provided you include this license notice and a URL through which
* recipients can access the Corresponding Source.
*/
define([
'jquery',
'block/block',
'block/blockmanager',
'blockdemo/vendor/underscore'
], function(jQuery, block, BlockManager, vcardTemplate) {
"use strict";
var CompanyBlock = block.AbstractBlock.extend({
title: 'Company',
getSchema: function() {
return {
symbol: {
type: 'string',
label: 'Stock Quote Name'
}
};
},
init: function($element, postProcessFn) {
var that = this;
$element.mouseover(function() {
$element.append('<span class="stock-quote-overlay company-' + that.attr('symbol') + '"></span>');
});
$element.mouseout(function() {
$element.find('.stock-quote-overlay').remove();
});
postProcessFn();
},
update: function($element, postProcessFn) {
// Mapping Stock-Symbol -- Company Name (Fake!)
switch (this.attr('symbol')) {
case 'MSFT':
$element.html('Microsoft');
break;
case 'AAPL':
$element.html('Apple Inc.');
break;
default:
$element.html(this.attr('symbol'));
}
postProcessFn();
}
});
var EditableProductTeaserBlock = block.AbstractBlock.extend({
title: 'product teaser',
getSchema: function() {
return {
'price': {
type: 'number',
label: 'Price'
}
}
},
update: function($element, postProcessFn) {
$element.html('<span class="aloha-editable">' + this.attr('title') + '</span> <strong class="price">(' + this.attr('price') + ')</strong>');
postProcessFn();
}
});
var ProductTeaserBlock = block.AbstractBlock.extend({
title: 'product teaser',
getSchema: function() {
return {
'title': {
type: 'string',
label: 'Product Title'
},
'price': {
type: 'number',
label: 'Price'
}
}
},
update: function($element, postProcessFn) {
$element.html(this.attr('title') + ' <span class="price">(' + this.attr('price') + ' &euro;)</span>');
postProcessFn();
}
});
var ImageBlock = block.AbstractBlock.extend({
title: 'Image',
getSchema: function() {
return {
'image': {
type: 'string',
label: 'Image URI'
},
'position': {
type: 'select',
label: 'Position',
values: [{
key: '',
label: 'No Float'
}, {
key: 'left',
label: 'Float left'
}, {
key: 'right',
label: 'Float right'
}]
}
}
},
init: function($element, postProcessFn) {
this.attr('image', $element.find('img').attr('src'));
postProcessFn();
},
update: function($element, postProcessFn) {
if (this.attr('position') === 'right') {
$element.css('float', 'right');
} else if (this.attr('position') === 'left') {
$element.css('float', 'left');
} else {
$element.css('float', '');
}
$element.find('img').attr('src', this.attr('image'));
postProcessFn();
}
});
var EditableImageBlock = ImageBlock.extend({
});
var NewsBlock = block.AbstractBlock.extend({
title: 'News',
getSchema: function() {
var that = this;
return {
'news': {
type: 'button',
buttonLabel: 'Change news',
callback: function() {
var numberOfNewsArticles = Math.floor((Math.random()*6)+1);
alert('Will render ' + numberOfNewsArticles + ' news articles. (This is a placeholder for selecting news articles)');
that.attr('numberofarticles', numberOfNewsArticles);
}
}
}
},
update: function($element, postProcessFn) {
var numberOfArticlesToBeCreated = this.attr('numberofarticles') - $element.find('.newselement').length;
if (numberOfArticlesToBeCreated > 0) {
// Insert specified number of articles
for (var i=0; i<numberOfArticlesToBeCreated; i++) {
$element.find('.newselement').first().clone().appendTo($element);
}
} else if (numberOfArticlesToBeCreated < 0) {
// Delete articles
$element.find('.newselement').slice(numberOfArticlesToBeCreated).remove();
}
postProcessFn();
}
});
var SortableNewsBlock = NewsBlock.extend({
title: 'Sortable News',
init: function($element, postProcessFn) {
var that = this;
$element.sortable({
stop: function() {
that._fixScrollPositionBugsInIE();
},
cancel: '.aloha-block-handle'
});
postProcessFn();
}
});
var ColumnBlock = block.AbstractBlock.extend({
title: 'Columns',
getSchema: function() {
return {
'columns': {
type: 'number',
label: 'Number of Columns',
range: {
min: 1,
max: 4,
step: 1
}
}
}
},
init: function($element, postProcessFn) {
this.calculateColumnWidths($element);
postProcessFn();
},
update: function($element, postProcessFn) {
this.updateDataAttributesFromColumnContents($element);
var numberOfColumns = parseInt(this.attr('columns'));
var columnDifference = numberOfColumns - $element.children('.column').length;
if (columnDifference < 0) {
// we need to remove the last N columns
$element.children('.column').slice(columnDifference).remove();
} else {
// add new columns
for (var i=0; i<columnDifference; i++) {
var $column = this.getNewColumn();
if (this.attr('column-contents-' + (numberOfColumns - columnDifference + i))) {
$column.html(this.attr('column-contents-' + (numberOfColumns - columnDifference + i)));
} else {
$column.html('Some content');
}
$element.append($column);
this.postProcessColumn($column);
}
}
this.calculateColumnWidths($element);
this.$element.children('.clear').remove();
this.$element.append(jQuery('<div class="clear" />'));
postProcessFn();
},
getNewColumn: function() {
return jQuery('<div class="column aloha-editable" />');
},
postProcessColumn: function($column) {
},
updateDataAttributesFromColumnContents: function($element) {
var that = this;
$element.children('.column').each(function(i, el) {
that.attr('column-contents-' + i, jQuery(el).html());
});
},
calculateColumnWidths: function($element) {
var numberOfColumns = $element.children('.column').length;
$element.children('.column').css('width', Math.floor(100 / numberOfColumns) + '%');
}
});
var UneditableColumnBlock = ColumnBlock.extend({
init: function($element, postProcessFn) {
var that = this;
this.calculateColumnWidths($element);
$element.children('.column').each(function() {
that.postProcessColumn(jQuery(this));
})
postProcessFn();
},
getNewColumn: function() {
return jQuery('<div class="column aloha-block-collection" />');
},
postProcessColumn: function($column) {
var $button = $column.children('button.addNewBlock');
if ($button.length === 0) {
$button = jQuery('<button class="addNewBlock">Add new block</button>');
$column.append($button);
}
$button.click(function() {
var $newBlock = jQuery('<div>Test</div>');
$newBlock.insertBefore($button);
$newBlock.alohaBlock({
});
});
}
});
return {
CompanyBlock: CompanyBlock,
EditableProductTeaserBlock: EditableProductTeaserBlock,
ProductTeaserBlock: ProductTeaserBlock,
ImageBlock: ImageBlock,
EditableImageBlock: EditableImageBlock,
NewsBlock: NewsBlock,
SortableNewsBlock: SortableNewsBlock,
ColumnBlock: ColumnBlock,
UneditableColumnBlock: UneditableColumnBlock
};
});
\ No newline at end of file
/* blockdemo-plugin.js is part of Aloha Editor project http://aloha-editor.org
*
* Aloha Editor is a WYSIWYG HTML5 inline editing library and editor.
* Copyright (c) 2010-2012 Gentics Software GmbH, Vienna, Austria.
* Contributors http://aloha-editor.org/contribution.php
*
* Aloha Editor is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* Aloha Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* As an additional permission to the GNU GPL version 2, you may distribute
* non-source (e.g., minimized or compacted) forms of the Aloha-Editor
* source code without the copy of the GNU GPL normally required,
* provided you include this license notice and a URL through which
* recipients can access the Corresponding Source.
*/
define([
'aloha/plugin',
'block/blockmanager',
'blockdemo/block',
'css!blockdemo/css/block.css'
], function(Plugin, BlockManager, block) {
"use strict";
return Plugin.create('blockdemo', {
init: function() {
BlockManager.registerBlockType('ProductTeaserBlock', block.ProductTeaserBlock);
BlockManager.registerBlockType('CompanyBlock', block.CompanyBlock);
BlockManager.registerBlockType('EditableProductTeaserBlock', block.EditableProductTeaserBlock);
BlockManager.registerBlockType('ImageBlock', block.ImageBlock);
BlockManager.registerBlockType('EditableImageBlock', block.EditableImageBlock);
BlockManager.registerBlockType('NewsBlock', block.NewsBlock);
BlockManager.registerBlockType('SortableNewsBlock', block.SortableNewsBlock);
BlockManager.registerBlockType('ColumnBlock', block.ColumnBlock);
BlockManager.registerBlockType('UneditableColumnBlock', block.UneditableColumnBlock);
}
});
});
\ No newline at end of file
<a class="url fn n" href="<%= url %>">
<span class="given-name"><%= firstname %></span>
<span class="family-name"><%= lastname %></span>
</a>
<a class="email" href="mailto:<%= email %>"><%= email %></a>
<% if (org) { %>
<div class="org"><%= org %></div>
<% } %>
<div class="adr">
<div class="street-address">123 Example street</div>
<span class="locality">San Francisco</span>, <span class="region">CA </span> <span class="postal-code">12345</span>
<span class="country-name">United States</span>
</div>
<div class="tel">555-555-5555</div>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Aloha Block Plugin Testcase</title>
<script language="javascript">
Aloha = window.Aloha || {};
Aloha.settings = {
logLevels: {'error': true, 'warn': true, 'info': false, 'debug': false},
errorhandling : true,
plugins: {
block: {
defaults : {
'.default-block': {
},
'.columnBlock': {
'aloha-block-type': 'ColumnBlock'
},
'.uneditableColumnBlock': {
'aloha-block-type': 'UneditableColumnBlock'
},
'.product-teaser': {
'aloha-block-type': 'ProductTeaserBlock'
},
'.company': {
'aloha-block-type': 'CompanyBlock'
},
'.imageBlock': {
'aloha-block-type': 'ImageBlock'
},
'.editableImageBlock': {
'aloha-block-type': 'EditableImageBlock'
},
'.news-block': {
'aloha-block-type': 'NewsBlock'
},
'.sortable-news-block': {
'aloha-block-type': 'SortableNewsBlock'
},
'.editable-product-teaser': {
'aloha-block-type': 'EditableProductTeaserBlock'
}
},
dragdrop: "1",
dropzones: ["#editable-1"],
config : {
'toggleDragdrop': "1"
// The following would make the toggleDragDrop button ignore the
// per-editable config and make the button always show and toggle
// the dragndrop feature for all editables.
//toggleDragdropGlobal: true
},
editables : {
"#editable-1": {'toggleDragdrop': true, 'dropzones': [ '#editable-1', '#editable-2' ]},
"#editable-2": {'toggleDragdrop': true}
}
}
},
bundles: {
// Path for custom bundle relative from require.js path
user: '../demo/block'
}
};
</script>
<script src="../../lib/require.js"></script>
<script src="../../lib/aloha.js" data-aloha-plugins="common/ui,common/format,common/paste,common/contenthandler,common/block,user/blockdemo,common/table,common/highlighteditables,extra/sourceview"></script>
<link rel="stylesheet" href="../../css/aloha.css" type="text/css">
<link rel="stylesheet" href="index.css" type="text/css">
<style>
.aloha-block-dropzone {background-color: #CCC;}
</style>
</head>
<body>
<div id="main">
<div id="bodyContent">
<h2><a name="edit-block-outside"></a>Editable 1</h2>
<div class="editable" id="editable-1">
<p>Williams, and other pilots who worked for <span class="company" data-symbol="MSFT">British Airways</span> claimed that their holiday pay was too low, because it only reflected his fixed salary, and not his bonuses. Williams' comprised a fixed annual salary, a "flying pay supplement" that went up the more he flew, and a "time away from base" which went up the more he was away from home. The flying and time away allowances were capped. Properly construed, his contract suggested that his holiday pay would be at the rate of only his fixed salary. Williams, however, contended that this was contrary to the Civil Aviation Working Time Directive,[1] as implemented by the Civil Aviation (Working Time) Regulations 2004,[2] (sector-specific implementations with the same objective as the Working Time Directive and the Working Time Regulations 1998 in this respect). In absence of particular provisions, the pay while on leave should be "normal remuneration". British Airways contended that because the Employment Rights Act 1996 sections 221 to 224 did not have provisions on how to determine a week's pay, the rate should be determined with reference to the contract.
The Employment Appeal Tribunal allowed Williams' claim, but this was reversed in the Court of Appeal.[3] The Supreme Court made a reference to the European Court of Justice.</p>
</div>
<h2><a name="edit-block-inside"></a>Editable 2</h2>
<div class="editable no-drag" id="editable-2">
<p>Williams, and other pilots who worked for <span class="company" data-symbol="MSFT">British Airways</span> claimed that their holiday pay was too low, because it only reflected his fixed salary, and not his bonuses. Williams' comprised a fixed annual salary, a "flying pay supplement" that went up the more he flew, and a "time away from base" which went up the more he was away from home. The flying and time away allowances were capped. Properly construed, his contract suggested that his holiday pay would be at the rate of only his fixed salary. Williams, however, contended that this was contrary to the Civil Aviation Working Time Directive,[1] as implemented by the Civil Aviation (Working Time) Regulations 2004,[2] (sector-specific implementations with the same objective as the Working Time Directive and the Working Time Regulations 1998 in this respect). In absence of particular provisions, the pay while on leave should be "normal remuneration". British Airways contended that because the Employment Rights Act 1996 sections 221 to 224 did not have provisions on how to determine a week's pay, the rate should be determined with reference to the contract.
The Employment Appeal Tribunal allowed Williams' claim, but this was reversed in the Court of Appeal.[3] The Supreme Court made a reference to the European Court of Justice.</p>
<div class="textcontent"><div class="editableImageBlock">
<img src="blockdemo/img/stock-quote-aapl.gif" />
<div class="aloha-editable">This Image Caption is editable through Aloha.</div>
</div>
</div>
<p>Williams, and other pilots who worked for British Airways claimed that their holiday pay was too low, because it only reflected his fixed salary, and not his bonuses. Williams' comprised a fixed annual salary, a "flying pay supplement" that went up the more he flew, and a "time away from base" which went up the more he was away from home. The flying and time away allowances were capped. Properly construed, his contract suggested that his holiday pay would be at the rate of only his fixed salary. Williams, however, contended that this was contrary to the Civil Aviation Working Time Directive,[1] as implemented by the Civil Aviation (Working Time) Regulations 2004,[2] (sector-specific implementations with the same objective as the Working Time Directive and the Working Time Regulations 1998 in this respect). In absence of particular provisions, the pay while on leave should be "normal remuneration". British Airways contended that because the Employment Rights Act 1996 sections 221 to 224 did not have provisions on how to determine a week's pay, the rate should be determined with reference to the contract.
The Employment Appeal Tribunal allowed Williams' claim, but this was reversed in the Court of Appeal.[3] The Supreme Court made a reference to the European Court of Justice.</p>
</div>
</div>
</div>
<script type="text/javascript">
Aloha.ready( function() {
Aloha.jQuery('.editable').aloha();
});
</script>
</body>
</html>
body {
font-family: sans-serif;
background-image: url("../common/background.png");
}
#bodyContent {
font-size:0.8em;
}
p {
margin-bottom: 10px;
}
h1, h2, h3, h4, h5, h6 {
font-family: sans-serif;
color: #1c94c4;
border-bottom:1px solid #AAAAAA;
padding-bottom:0.17em;
padding-top:0.5em;
}
h1 { font-size: 188%; }
h2 {
font-size: 150%;
margin-bottom: 14px;
}
h3 {
font-size: 132%;
margin-bottom: 10px;
padding-bottom: 0;
border-bottom: none;
}
h4 { font-size: 116%; }
h5 { font-size: 100%; }
h6 { font-size: 80%; }
#main {
width: 50%;
position: absolute;
top: 10%;
left: 25%;
padding: 30px;
background-color: white;
border-radius: 10px;
color: #444444;
-moz-border-radius: 10px;
box-shadow: 5px 5px rgba(0,0,0,0.3);
-webkit-box-shadow: 5px 5px rgba(0,0,0,0.3);
-moz-box-shadow: 5px 5px rgba(0,0,0,0.3);
}
a.aloha {
background: url(../common/external-link-ltr-icon.png) no-repeat 100% 50%;
padding: 0px 13px 0px 0px;
}
/* Abbreviation styling */
abbr, acronym
{
border-bottom: .1em dotted;
cursor: help;
}
/* A basic table styling */
.aloha_example table
{
padding: 0;
margin: 0;
border-collapse: collapse;
border: 1px solid #333;
color: #000;
}
.aloha_example table caption
{
caption-side: bottom;
font-size: 0.8em;
font-style: italic;
text-align: right;
padding: 0.5em 0;
}
.aloha_example table th,
.aloha_example table td
{
border: 1px solid #666;
padding: 0.5em;
text-align: left;
}
.aloha_example th {
background-color: #dfd;
}
table caption
{
caption-side: bottom;
font-size: 0.8em;
font-style: italic;
text-align: right;
padding: 0.5em 0;
}
#main ol, ul {
list-style-position: inside;
}
#main ol {
list-style-type: decimal;
}
#main ul {
list-style-type: disc;
}
/**
* basic table styles
*/
.hor-minimalist-a
{
background: #fff;
border-collapse: collapse;
text-align: left;
}
.hor-minimalist-a th
{
font-size: 130%;
font-weight: normal;
padding: 10px 8px;
border-bottom: 2px solid #6678b1;
}
.hor-minimalist-a td
{
padding: 9px 8px 0px 8px;
}
.hor-minimalist-a tbody tr:hover td
{
color: #009;
}
.box-table-a
{
text-align: left;
border-collapse: collapse;
}
.box-table-a th
{
font-size: 115%;
font-weight: normal;
padding: 8px;
background: #b9c9fe;
border-top: 4px solid #aabcfe;
border-bottom: 1px solid #fff;
}
.box-table-a td
{
padding: 8px;
background: #e8edff;
border-bottom: 1px solid #fff;
border-top: 1px solid transparent;
}
.box-table-a tr:hover td
{
background: #d0dafd;
}
.hor-zebra
{
text-align: left;
border-collapse: collapse;
}
.hor-zebra th
{
font-size: 130%;
font-weight: bold;
padding: 10px 8px;
border-bottom: 2px solid #6678b1;
}
.hor-zebra td
{
padding: 8px;
}
.hor-zebra tr:nth-child(2n+1) td
{
background: #e8edff;
}
td.bigbold {
font-size: 200%;
font-weight: bold;
}
td.redwhite {
background-color: red;
color: white;
font-weight: bold;
}
.vcard {
max-width: 300px;
padding: 8px;
border: 1px solid #ddd;
background-color: #eee;
border-radius: 8px;
}
.vcard .n {
font-size: 124%;
text-decoration: none;
font-weight: bold;
}
.vcard .n,
.vcard .email,
.vcard .org {
display: block;
margin: 0 0 5px 0;
}
.vcard .org {
font-weight: bold;
font-style: italic;
}
.customhandles {
width:200px;
height:100px;
}
.no-aloha-area {
background-color: #DDD;
background-image: -webkit-repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.5) 35px, rgba(255,255,255,.5) 70px);
background-image: -moz-repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.5) 35px, rgba(255,255,255,.5) 70px);
}
.columnBlock, .uneditableColumnBlock {
width: 100%;
}
.columnBlock .column,
.uneditableColumnBlock .column {
float:left;
}
.columnBlock .clear,
.uneditableColumnBlock .clear {
clear:both;
}
\ No newline at end of file
This diff is collapsed.
<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html lang="en" class="no-js"> <!--<![endif]-->
<head>
<title>The Aloha Editor Captioned Image Demo</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="The Aloha Editor Captioned Image Demo">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="stylesheet" href="../../css/aloha.css" type="text/css">
<style>#content { margin: 30px; }</style>
<script src="../../lib/vendor/jquery-1.7.2.js"></script>
<script src="../../lib/require.js"></script>
<script>
var Aloha = {
settings: {
jQuery: $,
toolbar: {
tabs: [{
label: 'Captioned Image',
showOn: { scope: '__hidden__' },
components: [
'imgAlignLeft',
'imgAlignRight',
'imgAlignCenter',
'imgAlignClear'
]
}]
},
plugins: {
captionedImage: {
/*
selector: 'img.aloha-captioned-image',
render: function (properties, callback, error) {
error({message: 'noop'});
},
defaultCSS: false,
captionedImageClass: 'aloha-captioned-image',
blockClass: 'mycms-captioned-image-block',
*/
}
}
}
};
</script>
<script src="../../lib/aloha.js"
data-aloha-plugins="common/ui,
common/format,
common/block,
common/align,
extra/captioned-image"></script>
</head>
<body>
<div id="content">
<img class="aloha-captioned-image"
src="http://www.aloha-editor.org/images/aloha-editor-logo.png" />
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris
convallis nisl eu mi posuere et congue metus posuere. Etiam sodales
tristique urna, malesuada accumsan erat laoreet vel. Aliquam
tincidunt porttitor mi, faucibus molestie mauris vestibulum ac.
Fusce sollicitudin, nibh nec iaculis egestas, ligula tellus iaculis
augue, quis faucibus nisl libero ac nulla. Vestibulum ante ipsum
primis in faucibus orci luctus et ultrices posuere cubilia Curae;
Nunc pulvinar luctus eros, ut laoreet enim aliquam vel.
</p>
<img src="http://www.aloha-editor.org/logo/Aloha%20Editor%20HTML5%20sticker%20transparent%20256.png"
alt="Sample alt text"
data-caption="Short caption."
class="aloha-captioned-image" />
<p>
Vestibulum molestie velit volutpat magna molestie non condimentum
metus tincidunt. Curabitur imperdiet lacus eget est hendrerit in
aliquam elit hendrerit. Nullam porttitor urna ac ante volutpat
feugiat semper quam volutpat. Donec auctor odio ut dui lobortis
euismod imperdiet purus pellentesque. Quisque lacinia sem ac lacus
commodo eu congue nisl porttitor. Aenean et velit quis urna
porttitor dignissim consequat eu lectus. Nam interdum elit a lacus
blandit porttitor. Integer id libero sed lectus tempus pulvinar ac
sit amet lacus. Curabitur lobortis magna a est ultrices sagittis
non eget nibh. In lobortis arcu odio.
</p>
<img src="http://www.aloha-editor.org/images/aloha-editor-logo.png"
data-caption="Praesent commodo molestie adipiscing. Mauris
lorem justo, tincidunt eget iaculis et, fermentum nec odio."
class="aloha-captioned-image" />
<p>
Praesent commodo molestie adipiscing. Mauris lorem justo, tincidunt eget iaculis et, fermentum nec odio. Ut pulvinar tristique quam, ut congue diam accumsan eleifend. Nulla sagittis tincidunt lacus, sit amet condimentum nibh ornare quis. Nulla ac nibh eu nunc rhoncus consectetur nec et velit. Cras nec dolor non felis placerat lobortis ut vitae ante. Curabitur at lectus non sem ultricies dictum.
</p>
<p>
Vivamus eu tellus id elit sollicitudin varius. Donec suscipit, risus eget vehicula eleifend, turpis felis hendrerit quam, eget tincidunt orci massa non lacus. Morbi commodo vestibulum fermentum. Pellentesque ut urna in nisi suscipit posuere. Vivamus at erat vitae nisl mollis luctus vel sit amet eros. Proin sodales adipiscing velit, id ultricies magna egestas ut. Aenean et eros magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus id elit at neque dictum aliquam. Nunc adipiscing, risus vel eleifend luctus, ligula libero blandit diam, at vehicula odio nibh eu elit.
</p>
<p>
Nulla sit amet turpis mauris, quis tincidunt quam. Sed vestibulum consequat ligula, sed ullamcorper ipsum placerat eget. Morbi ut magna luctus justo gravida rutrum id ac odio. Maecenas et ipsum dolor, ullamcorper pretium lacus. Pellentesque et tellus velit, in luctus massa. Nulla facilisi. Ut convallis pellentesque elit in egestas.
</p>
<p>
Curabitur semper ultricies eros sit amet egestas. Donec pellentesque tincidunt arcu vel facilisis. Curabitur vitae purus odio, ac pulvinar massa. Phasellus malesuada congue volutpat. Maecenas elit nibh, mattis fringilla viverra nec, pretium dapibus lacus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dui velit, ullamcorper ac tincidunt non, dapibus ornare diam. Etiam mattis adipiscing turpis, sed interdum turpis tincidunt eget. Proin sodales, ante sit amet porta vehicula, est mauris porttitor neque, ut mollis eros risus feugiat urna. In fringilla dui ut mauris lobortis vulputate. Integer gravida, turpis ut viverra dictum, nulla turpis lobortis quam, eu vehicula sapien est ac tortor. Maecenas congue pretium vehicula. Phasellus vel quam sit amet elit lacinia vehicula in elementum purus. Phasellus tempor mauris eu felis tristique blandit. Curabitur egestas mi a leo sollicitudin tristique. Praesent imperdiet turpis quam, bibendum suscipit turpis.
</p>
</div>
<script type="text/javascript">
Aloha.ready( function(){
Aloha.jQuery('#content').aloha();
});
</script>
<!--[if lt IE 7 ]>
<script src="js/libs/dd_belatedpng.js"></script>
<script> DD_belatedPNG.fix('img, .png_bg');</script>
<![endif]-->
</body>
</html>
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->
<!-- Most restrictive policy: -->
<site-control permitted-cross-domain-policies="none"/>
<!-- Least restrictive policy: -->
<!--
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" to-ports="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
-->
<!--
If you host a crossdomain.xml file with allow-access-from domain=“*”
and don’t understand all of the points described here, you probably
have a nasty security vulnerability. ~ simon willison
-->
</cross-domain-policy>
\ No newline at end of file
This diff is collapsed.
$ = jQuery = {fn: {jquery: 'Fake jQuery to catch accesses to the global object'}};
define('jquery', function () {
return "Fake jQuery to catch access to the user's defined jQuery";
});
/* the humans responsible & colophon */
/* humanstxt.org */
/* TEAM */
Project Leader: Haymo Meran
Site: http://aloha-editor.org
Twitter: @alohaeditor
Location: Hacker Dojo, Mountain View, CA, USA
/* THANKS */
Berit Jensen (http://networkteam.de)
/* SITE */
Standards: HTML5, CSS3
Components: Modernizr, jQuery, Aloha Editor
Software:
-o/-
+oo//-
:ooo+//:
-ooooo///-
/oooooo//:
:ooooooo+//-
-+oooooooo///-
-://////////////+oooooooooo++////////////::
:+ooooooooooooooooooooooooooooooooooooo+:::-
-/+ooooooooooooooooooooooooooooooo+/::////:-
-:+oooooooooooooooooooooooooooo/::///////:-
--/+ooooooooooooooooooooo+::://////:-
-:+ooooooooooooooooo+:://////:--
/ooooooooooooooooo+//////:-
-ooooooooooooooooooo////-
/ooooooooo+oooooooooo//:
:ooooooo+/::/+oooooooo+//-
-oooooo/::///////+oooooo///-
/ooo+::://////:---:/+oooo//:
-o+/::///////:- -:/+o+//-
:-:///////:- -:/://
-////:- --//:
-- -:
This diff is collapsed.
// The linklist povides example search results for the link plugin input field
Aloha.require(['aloha', 'aloha/jquery', '../plugins/common/link/extra/linklist'], function( Aloha, $) {
$.fn.alohaStage = function() {
var switcher = this.find('ul.stage-switcher'),
me = this,
current,
showNext = function() {
var nextTab;
if (!me.currentTab) {
nextTab = switcher.find('li').first();
} else {
nextTab = me.currentTab.next();
if (nextTab.length == 0) {
nextTab = switcher.find('li').first();
}
}
nextTab.click();
};
switcher.children('li').each(function() {
var $this = $(this),
editable = $this.find('.area-content'), // make stage switcher available thru editable
item = $this.find('.stage-item').detach();
editable[0].tab = $this;
item.hide();
item.appendTo(switcher.parent());
$this.click(function(event) {
if (me.currentTab) me.currentTab.removeClass('active');
me.currentTab = $this;
$this.addClass('active');
if (current && current != item ) {
if (current) current.fadeOut(500);
}
item.fadeIn(500);
current = item;
});
$this.mouseover(function() {
$this.addClass('hover');
});
$this.mouseout(function() {
$this.removeClass('hover');
});
});
showNext();
switcher.animate({right: -150}, {queue: false});
switcher.mouseenter(function() {
switcher.animate({right: 0}, {queue: false});
});
switcher.mouseleave(function() {
switcher.animate({right: -150}, {queue: false});
});
};
$('.stage-area').alohaStage();
});
( function ( window, undefined ) {
var Aloha = window.Aloha || ( window.Aloha = {} );
Aloha.settings = {
logLevels: { 'error': true, 'warn': true, 'info': true, 'debug': false, 'deprecated': true },
errorhandling: false,
ribbon: {enable: true},
locale: 'en',
//waitSeconds: 300, // This can be turned on to avoid requirejs timeouts if Aloha startup code needs to be debugged
placeholder: {
'#placeholder-test': '<img src="http://aloha-editor.org/logo/Aloha%20Editor%20HTML5%20technology%20class%2016.png" alt="Aloha Editor"/>&nbsp;Placeholder Image'
},
repositories: {
linklist: {
data: [
{ name: 'Aloha Editor Developers Wiki', url:'https://github.com/alohaeditor/Aloha-Editor/wiki', type:'website', weight: 0.50 },
{ name: 'Aloha Editor - The HTML5 Editor', url:'http://aloha-editor.com', type:'website', weight: 0.90 },
{ name: 'Aloha Editor Demo', url:'http://www.aloha-editor.com/demos.html', type:'website', weight: 0.75 },
{ name: 'Aloha Editor Wordpress Demo', url:'http://www.aloha-editor.com/demos/wordpress-demo/index.html', type:'website', weight: 0.75 },
{ name: 'Aloha Editor Logo', url:'http://www.aloha-editor.com/images/aloha-editor-logo.png', type:'image', weight: 0.10 }
]
}
},
plugins: {
format: {
// all elements with no specific configuration get this configuration
//config: [ 'b', 'i', 'p', 'sub', 'sup', 'del', 'title', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre', 'removeFormat' ],
editables: {
// no formatting allowed for title
'#top-text': []
}
},
list: {
// all elements with no specific configuration get an UL, just for fun :)
config: [ 'ul', 'ol' ],
editables: {
// Even if this is configured it is not set because OL and UL are not allowed in H1.
'#top-text': []
}
},
listenforcer: {
editables: [ '.aloha-enforce-lists' ]
},
/*metaview: {
editables: {
'#top-text': ['metaview','enabled']
}
},*/
abbr: {
// all elements with no specific configuration get an UL, just for fun :)
config: [ 'abbr' ],
editables: {
// Even if this is configured it is not set because OL and UL are not allowed in H1.
'#top-text': []
}
},
hints: {
fallback: 'fallback text',
trigger: 'hover'
},
link: {
// all elements with no specific configuration may insert links
config: [ 'a' ],
hotKey: {
// use ctrl+l instead of ctrl+k as hotkey for inserting a link
//insertLink: 'ctrl+l'
},
editables: {
// No links in the title.
'#top-text': []
},
// all links that match the targetregex will get set the target
// e.g. ^(?!.*aloha-editor.com).* matches all href except aloha-editor.com
targetregex: '^(?!.*aloha-editor.com).*',
// this target is set when either targetregex matches or not set
// e.g. _blank opens all links in new window
target: '_blank',
// the same for css class as for target
cssclassregex: '^(?!.*aloha-editor.com).*',
cssclass: 'aloha',
// use all resources of type website for autosuggest
objectTypeFilter: ['website'],
// handle change of href
onHrefChange: function ( obj, href, item ) {
var jQuery = Aloha.require( 'jquery' );
if ( item ) {
jQuery( obj ).attr( 'data-name', item.name );
} else {
jQuery( obj ).removeAttr( 'data-name' );
}
}
},
table: {
// all elements with no specific configuration are not allowed to insert tables
config: [ 'table' ],
editables: {
// Don't allow tables in top-text
'#top-text': [ '' ]
},
summaryinsidebar: true,
// [{name:'green', text:'Green', tooltip:'Green is cool', iconClass:'GENTICS_table GENTICS_button_green', cssClass:'green'}]
tableConfig: [
{ name: 'hor-minimalist-a' },
{ name: 'box-table-a' },
{ name: 'hor-zebra' },
],
columnConfig: [
{ name: 'table-style-bigbold', iconClass: 'aloha-button-col-bigbold' },
{ name: 'table-style-redwhite', iconClass: 'aloha-button-col-redwhite' }
],
rowConfig: [
{ name: 'table-style-bigbold', iconClass: 'aloha-button-row-bigbold' },
{ name: 'table-style-redwhite', iconClass: 'aloha-button-row-redwhite' }
],
cellConfig: [
{ name: 'table-style-bigbold', iconClass: 'aloha-button-row-bigbold' },
{ name: 'table-style-redwhite', iconClass: 'aloha-button-row-redwhite' }
],
// allow resizing the table width (default: false)
tableResize: true,
// allow resizing the column width (default: false)
colResize: true,
// allow resizing the row height (default: false)
rowResize: true
},
image: {
config:{
'fixedAspectRatio' : false,
'maxWidth' : 600,
'minWidth' : 20,
'maxHeight' : 600,
'minHeight' : 20,
'globalselector' : '.global',
'ui': {
'oneTab': true
}
},
'fixedAspectRatio' : false,
'maxWidth' : 600,
'minWidth' : 20,
'maxHeight' : 600,
'minHeight' : 20,
'globalselector' : '.global',
'ui': {
'oneTab' : true,
'align' : false,
'margin' : false
}
},
cite: {
referenceContainer: '#references'
},
formatlesspaste :{
formatlessPasteOption : true,
strippedElements : [
"em",
"strong",
"small",
"s",
"cite",
"q",
"dfn",
"abbr",
"time",
"code",
"var",
"samp",
"kbd",
"sub",
"sup",
"i",
"b",
"u",
"mark",
"ruby",
"rt",
"rp",
"bdi",
"bdo",
"ins",
"del"]
},
'numerated-headers': {
config: {
// default true
// numeratedactive will also accept "true" and "1" as true values
// false and "false" for false
numeratedactive: false,
// if the headingselector is empty, the button will not be shown at all
headingselector: 'h1, h2, h3, h4, h5, h6', // default: all
baseobjectSelector: 'body' // if not set: Aloha.activeEditable
}
},
'wai-lang': {
flags: true
},
'textcolor': {
// configure a set of colors for all editables
config: ['#FFEE00', 'rgb(255,0,0)', '#FFFF00', '#FFFFFF', 'greenborder'],
editables: {
// configure a different set of colors for editable #one
'#top-text' : []
}
}
}
};
} )( window );
/**
* DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML <IMG/>.
* Author: Drew Diller
* Email: drew.diller@gmail.com
* URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/
* Version: 0.0.8a
* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license
*
* Example usage:
* DD_belatedPNG.fix('.png_bg'); // argument is a CSS selector
* DD_belatedPNG.fixPng( someNode ); // argument is an HTMLDomElement
**/
var DD_belatedPNG={ns:"DD_belatedPNG",imgSize:{},delay:10,nodesFixed:0,createVmlNameSpace:function(){if(document.namespaces&&!document.namespaces[this.ns]){document.namespaces.add(this.ns,"urn:schemas-microsoft-com:vml")}},createVmlStyleSheet:function(){var b,a;b=document.createElement("style");b.setAttribute("media","screen");document.documentElement.firstChild.insertBefore(b,document.documentElement.firstChild.firstChild);if(b.styleSheet){b=b.styleSheet;b.addRule(this.ns+"\\:*","{behavior:url(#default#VML)}");b.addRule(this.ns+"\\:shape","position:absolute;");b.addRule("img."+this.ns+"_sizeFinder","behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;");this.screenStyleSheet=b;a=document.createElement("style");a.setAttribute("media","print");document.documentElement.firstChild.insertBefore(a,document.documentElement.firstChild.firstChild);a=a.styleSheet;a.addRule(this.ns+"\\:*","{display: none !important;}");a.addRule("img."+this.ns+"_sizeFinder","{display: none !important;}")}},readPropertyChange:function(){var b,c,a;b=event.srcElement;if(!b.vmlInitiated){return}if(event.propertyName.search("background")!=-1||event.propertyName.search("border")!=-1){DD_belatedPNG.applyVML(b)}if(event.propertyName=="style.display"){c=(b.currentStyle.display=="none")?"none":"block";for(a in b.vml){if(b.vml.hasOwnProperty(a)){b.vml[a].shape.style.display=c}}}if(event.propertyName.search("filter")!=-1){DD_belatedPNG.vmlOpacity(b)}},vmlOpacity:function(b){if(b.currentStyle.filter.search("lpha")!=-1){var a=b.currentStyle.filter;a=parseInt(a.substring(a.lastIndexOf("=")+1,a.lastIndexOf(")")),10)/100;b.vml.color.shape.style.filter=b.currentStyle.filter;b.vml.image.fill.opacity=a}},handlePseudoHover:function(a){setTimeout(function(){DD_belatedPNG.applyVML(a)},1)},fix:function(a){if(this.screenStyleSheet){var c,b;c=a.split(",");for(b=0;b<c.length;b++){this.screenStyleSheet.addRule(c[b],"behavior:expression(DD_belatedPNG.fixPng(this))")}}},applyVML:function(a){a.runtimeStyle.cssText="";this.vmlFill(a);this.vmlOffsets(a);this.vmlOpacity(a);if(a.isImg){this.copyImageBorders(a)}},attachHandlers:function(i){var d,c,g,e,b,f;d=this;c={resize:"vmlOffsets",move:"vmlOffsets"};if(i.nodeName=="A"){e={mouseleave:"handlePseudoHover",mouseenter:"handlePseudoHover",focus:"handlePseudoHover",blur:"handlePseudoHover"};for(b in e){if(e.hasOwnProperty(b)){c[b]=e[b]}}}for(f in c){if(c.hasOwnProperty(f)){g=function(){d[c[f]](i)};i.attachEvent("on"+f,g)}}i.attachEvent("onpropertychange",this.readPropertyChange)},giveLayout:function(a){a.style.zoom=1;if(a.currentStyle.position=="static"){a.style.position="relative"}},copyImageBorders:function(b){var c,a;c={borderStyle:true,borderWidth:true,borderColor:true};for(a in c){if(c.hasOwnProperty(a)){b.vml.color.shape.style[a]=b.currentStyle[a]}}},vmlFill:function(e){if(!e.currentStyle){return}else{var d,f,g,b,a,c;d=e.currentStyle}for(b in e.vml){if(e.vml.hasOwnProperty(b)){e.vml[b].shape.style.zIndex=d.zIndex}}e.runtimeStyle.backgroundColor="";e.runtimeStyle.backgroundImage="";f=true;if(d.backgroundImage!="none"||e.isImg){if(!e.isImg){e.vmlBg=d.backgroundImage;e.vmlBg=e.vmlBg.substr(5,e.vmlBg.lastIndexOf('")')-5)}else{e.vmlBg=e.src}g=this;if(!g.imgSize[e.vmlBg]){a=document.createElement("img");g.imgSize[e.vmlBg]=a;a.className=g.ns+"_sizeFinder";a.runtimeStyle.cssText="behavior:none; position:absolute; left:-10000px; top:-10000px; border:none; margin:0; padding:0;";c=function(){this.width=this.offsetWidth;this.height=this.offsetHeight;g.vmlOffsets(e)};a.attachEvent("onload",c);a.src=e.vmlBg;a.removeAttribute("width");a.removeAttribute("height");document.body.insertBefore(a,document.body.firstChild)}e.vml.image.fill.src=e.vmlBg;f=false}e.vml.image.fill.on=!f;e.vml.image.fill.color="none";e.vml.color.shape.style.backgroundColor=d.backgroundColor;e.runtimeStyle.backgroundImage="none";e.runtimeStyle.backgroundColor="transparent"},vmlOffsets:function(d){var h,n,a,e,g,m,f,l,j,i,k;h=d.currentStyle;n={W:d.clientWidth+1,H:d.clientHeight+1,w:this.imgSize[d.vmlBg].width,h:this.imgSize[d.vmlBg].height,L:d.offsetLeft,T:d.offsetTop,bLW:d.clientLeft,bTW:d.clientTop};a=(n.L+n.bLW==1)?1:0;e=function(b,p,q,c,s,u){b.coordsize=c+","+s;b.coordorigin=u+","+u;b.path="m0,0l"+c+",0l"+c+","+s+"l0,"+s+" xe";b.style.width=c+"px";b.style.height=s+"px";b.style.left=p+"px";b.style.top=q+"px"};e(d.vml.color.shape,(n.L+(d.isImg?0:n.bLW)),(n.T+(d.isImg?0:n.bTW)),(n.W-1),(n.H-1),0);e(d.vml.image.shape,(n.L+n.bLW),(n.T+n.bTW),(n.W),(n.H),1);g={X:0,Y:0};if(d.isImg){g.X=parseInt(h.paddingLeft,10)+1;g.Y=parseInt(h.paddingTop,10)+1}else{for(j in g){if(g.hasOwnProperty(j)){this.figurePercentage(g,n,j,h["backgroundPosition"+j])}}}d.vml.image.fill.position=(g.X/n.W)+","+(g.Y/n.H);m=h.backgroundRepeat;f={T:1,R:n.W+a,B:n.H,L:1+a};l={X:{b1:"L",b2:"R",d:"W"},Y:{b1:"T",b2:"B",d:"H"}};if(m!="repeat"||d.isImg){i={T:(g.Y),R:(g.X+n.w),B:(g.Y+n.h),L:(g.X)};if(m.search("repeat-")!=-1){k=m.split("repeat-")[1].toUpperCase();i[l[k].b1]=1;i[l[k].b2]=n[l[k].d]}if(i.B>n.H){i.B=n.H}d.vml.image.shape.style.clip="rect("+i.T+"px "+(i.R+a)+"px "+i.B+"px "+(i.L+a)+"px)"}else{d.vml.image.shape.style.clip="rect("+f.T+"px "+f.R+"px "+f.B+"px "+f.L+"px)"}},figurePercentage:function(d,c,f,a){var b,e;e=true;b=(f=="X");switch(a){case"left":case"top":d[f]=0;break;case"center":d[f]=0.5;break;case"right":case"bottom":d[f]=1;break;default:if(a.search("%")!=-1){d[f]=parseInt(a,10)/100}else{e=false}}d[f]=Math.ceil(e?((c[b?"W":"H"]*d[f])-(c[b?"w":"h"]*d[f])):parseInt(a,10));if(d[f]%2===0){d[f]++}return d[f]},fixPng:function(c){c.style.behavior="none";var g,b,f,a,d;if(c.nodeName=="BODY"||c.nodeName=="TD"||c.nodeName=="TR"){return}c.isImg=false;if(c.nodeName=="IMG"){if(c.src.toLowerCase().search(/\.png$/)!=-1){c.isImg=true;c.style.visibility="hidden"}else{return}}else{if(c.currentStyle.backgroundImage.toLowerCase().search(".png")==-1){return}}g=DD_belatedPNG;c.vml={color:{},image:{}};b={shape:{},fill:{}};for(a in c.vml){if(c.vml.hasOwnProperty(a)){for(d in b){if(b.hasOwnProperty(d)){f=g.ns+":"+d;c.vml[a][d]=document.createElement(f)}}c.vml[a].shape.stroked=false;c.vml[a].shape.appendChild(c.vml[a].fill);c.parentNode.insertBefore(c.vml[a].shape,c)}}c.vml.image.shape.fillcolor="none";c.vml.image.fill.type="tile";c.vml.color.fill.on=false;g.attachHandlers(c);g.giveLayout(c);g.giveLayout(c.offsetParent);c.vmlInitiated=true;g.applyVML(c)}};try{document.execCommand("BackgroundImageCache",false,true)}catch(r){}DD_belatedPNG.createVmlNameSpace();DD_belatedPNG.createVmlStyleSheet();
\ No newline at end of file
// Modernizr v1.7 www.modernizr.com
window.Modernizr=function(a,b,c){function G(){e.input=function(a){for(var b=0,c=a.length;b<c;b++)t[a[b]]=!!(a[b]in l);return t}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)l.setAttribute("type",f=a[d]),e=l.type!=="text",e&&(l.value=m,l.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&l.style.WebkitAppearance!==c?(g.appendChild(l),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(l,null).WebkitAppearance!=="textfield"&&l.offsetHeight!==0,g.removeChild(l)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=l.checkValidity&&l.checkValidity()===!1:/^color$/.test(f)?(g.appendChild(l),g.offsetWidth,e=l.value!=m,g.removeChild(l)):e=l.value!=m)),s[a[d]]=!!e;return s}("search tel url email datetime date month week time datetime-local number range color".split(" "))}function F(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+p.join(c+" ")+c).split(" ");return!!E(d,b)}function E(a,b){for(var d in a)if(k[a[d]]!==c&&(!b||b(a[d],j)))return!0}function D(a,b){return(""+a).indexOf(b)!==-1}function C(a,b){return typeof a===b}function B(a,b){return A(o.join(a+";")+(b||""))}function A(a){k.cssText=a}var d="1.7",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l=b.createElement("input"),m=":)",n=Object.prototype.toString,o=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),p="Webkit Moz O ms Khtml".split(" "),q={svg:"http://www.w3.org/2000/svg"},r={},s={},t={},u=[],v,w=function(a){var c=b.createElement("style"),d=b.createElement("div"),e;c.textContent=a+"{#modernizr{height:3px}}",h.appendChild(c),d.id="modernizr",g.appendChild(d),e=d.offsetHeight===3,c.parentNode.removeChild(c),d.parentNode.removeChild(d);return!!e},x=function(){function d(d,e){e=e||b.createElement(a[d]||"div");var f=(d="on"+d)in e;f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=C(e[d],"function"),C(e[d],c)||(e[d]=c),e.removeAttribute(d))),e=null;return f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),y=({}).hasOwnProperty,z;C(y,c)||C(y.call,c)?z=function(a,b){return b in a&&C(a.constructor.prototype[b],c)}:z=function(a,b){return y.call(a,b)},r.flexbox=function(){function c(a,b,c,d){a.style.cssText=o.join(b+":"+c+";")+(d||"")}function a(a,b,c,d){b+=":",a.style.cssText=(b+o.join(c+";"+b)).slice(0,-b.length)+(d||"")}var d=b.createElement("div"),e=b.createElement("div");a(d,"display","box","width:42px;padding:0;"),c(e,"box-flex","1","width:10px;"),d.appendChild(e),g.appendChild(d);var f=e.offsetWidth===42;d.removeChild(e),g.removeChild(d);return f},r.canvas=function(){var a=b.createElement("canvas");return a.getContext&&a.getContext("2d")},r.canvastext=function(){return e.canvas&&C(b.createElement("canvas").getContext("2d").fillText,"function")},r.webgl=function(){return!!a.WebGLRenderingContext},r.touch=function(){return"ontouchstart"in a||w("@media ("+o.join("touch-enabled),(")+"modernizr)")},r.geolocation=function(){return!!navigator.geolocation},r.postmessage=function(){return!!a.postMessage},r.websqldatabase=function(){var b=!!a.openDatabase;return b},r.indexedDB=function(){for(var b=-1,c=p.length;++b<c;){var d=p[b].toLowerCase();if(a[d+"_indexedDB"]||a[d+"IndexedDB"])return!0}return!1},r.hashchange=function(){return x("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},r.history=function(){return !!(a.history&&history.pushState)},r.draganddrop=function(){return x("dragstart")&&x("drop")},r.websockets=function(){return"WebSocket"in a},r.rgba=function(){A("background-color:rgba(150,255,150,.5)");return D(k.backgroundColor,"rgba")},r.hsla=function(){A("background-color:hsla(120,40%,100%,.5)");return D(k.backgroundColor,"rgba")||D(k.backgroundColor,"hsla")},r.multiplebgs=function(){A("background:url(//:),url(//:),red url(//:)");return(new RegExp("(url\\s*\\(.*?){3}")).test(k.background)},r.backgroundsize=function(){return F("backgroundSize")},r.borderimage=function(){return F("borderImage")},r.borderradius=function(){return F("borderRadius","",function(a){return D(a,"orderRadius")})},r.boxshadow=function(){return F("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){B("opacity:.55");return/^0.55$/.test(k.opacity)},r.cssanimations=function(){return F("animationName")},r.csscolumns=function(){return F("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";A((a+o.join(b+a)+o.join(c+a)).slice(0,-a.length));return D(k.backgroundImage,"gradient")},r.cssreflections=function(){return F("boxReflect")},r.csstransforms=function(){return!!E(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},r.csstransforms3d=function(){var a=!!E(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=w("@media ("+o.join("transform-3d),(")+"modernizr)"));return a},r.csstransitions=function(){return F("transitionProperty")},r.fontface=function(){var a,c,d=h||g,e=b.createElement("style"),f=b.implementation||{hasFeature:function(){return!1}};e.type="text/css",d.insertBefore(e,d.firstChild),a=e.sheet||e.styleSheet;var i=f.hasFeature("CSS2","")?function(b){if(!a||!b)return!1;var c=!1;try{a.insertRule(b,0),c=/src/i.test(a.cssRules[0].cssText),a.deleteRule(a.cssRules.length-1)}catch(d){}return c}:function(b){if(!a||!b)return!1;a.cssText=b;return a.cssText.length!==0&&/src/i.test(a.cssText)&&a.cssText.replace(/\r+|\n+/g,"").indexOf(b.split(" ")[0])===0};c=i('@font-face { font-family: "font"; src: url(data:,); }'),d.removeChild(e);return c},r.video=function(){var a=b.createElement("video"),c=!!a.canPlayType;if(c){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return c},r.audio=function(){var a=b.createElement("audio"),c=!!a.canPlayType;c&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;"));return c},r.localstorage=function(){try{return!!localStorage.getItem}catch(a){return!1}},r.sessionstorage=function(){try{return!!sessionStorage.getItem}catch(a){return!1}},r.webWorkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");a.innerHTML="<svg/>";return(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"clipPath")))};for(var H in r)z(r,H)&&(v=H.toLowerCase(),e[v]=r[H](),u.push((e[v]?"":"no-")+v));e.input||G(),e.crosswindowmessaging=e.postmessage,e.historymanagement=e.history,e.addTest=function(a,b){a=a.toLowerCase();if(!e[a]){b=!!b(),g.className+=" "+(b?"":"no-")+a,e[a]=b;return e}},A(""),j=l=null,f&&a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function p(a,b){var c=-1,d=a.length,e,f=[];while(++c<d)e=a[c],(b=e.media||b)!="screen"&&f.push(p(e.imports,b),e.cssText);return f.join("")}function o(a){var b=-1;while(++b<e)a.createElement(d[b])}var c="abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",d=c.split("|"),e=d.length,f=new RegExp("(^|\\s)("+c+")","gi"),g=new RegExp("<(/*)("+c+")","gi"),h=new RegExp("(^|[^\\n]*?\\s)("+c+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),i=b.createDocumentFragment(),j=b.documentElement,k=j.firstChild,l=b.createElement("body"),m=b.createElement("style"),n;o(b),o(i),k.insertBefore(m,k.firstChild),m.media="print",a.attachEvent("onbeforeprint",function(){var a=-1,c=p(b.styleSheets,"all"),k=[],o;n=n||b.body;while((o=h.exec(c))!=null)k.push((o[1]+o[2]+o[3]).replace(f,"$1.iepp_$2")+o[4]);m.styleSheet.cssText=k.join("\n");while(++a<e){var q=b.getElementsByTagName(d[a]),r=q.length,s=-1;while(++s<r)q[s].className.indexOf("iepp_")<0&&(q[s].className+=" iepp_"+d[a])}i.appendChild(n),j.appendChild(l),l.className=n.className,l.innerHTML=n.innerHTML.replace(g,"<$1font")}),a.attachEvent("onafterprint",function(){l.innerHTML="",j.removeChild(l),j.appendChild(n),m.styleSheet.cssText=""})}(a,b),e._enableHTML5=f,e._version=d,g.className=g.className.replace(/\bno-js\b/,"")+" js "+u.join(" ");return e}(this,this.document)
\ No newline at end of file
Aloha.ready(function(){
if (!Aloha.isPluginLoaded('ribbon')) {
return;
}
Aloha.require(["ribbon/ribbon-plugin", "ui/ui", "ui/menuButton", 'ui/dialog'], function(Ribbon, Ui, MenuButton, Dialog){
Ui.adopt("insertTag", MenuButton, {
text: "X",
menu: [
{ text: "Z",
menu: [ { text: "one two", click: function(){console.log("Q");}, iconUrl: '../../plugins/extra/wai-lang/img/button.png' },
{ text: "three four five", click: function(){console.log("W");} } ],
iconUrl: '../../plugins/extra/wai-lang/img/button.png'},
{ text: "V sdf asdf as fasd fasfd asfasf asf",
menu: [ { text: "Q asd fas fasf as faw awe ftasf asd sad f", click: function(){console.log("Q");} },
{ text: "W", click: function(){console.log("W");} } ] }
],
iconUrl: '../../plugins/extra/wai-lang/img/button.png'
});
Ribbon.addButton({
text: "split button",
menu: [
{
text: "action with submenu",
menu: [
{
text: "submenu only",
menu: [{ text: "action only", click: function(){ console.log("action only"); } }]
},
{
text: "action only",
click: function() {
console.log("action only");
}
}
],
click: function(){
console.log("action with submenu");
}
}
],
click: function(){
console.log("split button");
},
iconUrl: '../../plugins/extra/wai-lang/img/button.png'
});
Ribbon.show();
Ribbon.addButton({
text: "menu button",
menu: [
{
text: "action with submenu",
menu: [
{
text: "submenu only",
menu: [{
text: "action only",
click: function(){ console.log("action only"); }
}]
},
{
text: "action only x x x x x x",
click: function() {
console.log("action only");
}
}
],
click: function(){
console.log("action with submenu");
}
}
]
});
Ribbon.addButton({
menu: [
{
text: "action with submenu",
menu: [
{
text: "submenu only",
menu: [{
text: "action only",
click: function(){ console.log("action only"); },
iconUrl: '../../plugins/extra/wai-lang/img/button.png'
}],
iconUrl: '../../plugins/extra/wai-lang/img/button.png'
},
{
text: "action only",
click: function() {
console.log("action only");
},
iconUrl: '../../plugins/extra/wai-lang/img/button.png'
}
],
click: function(){
console.log("action with submenu");
},
iconUrl: '../../plugins/extra/wai-lang/img/button.png'
}
],
iconUrl: '../../plugins/extra/wai-lang/img/button.png'
});
Ribbon.addButton({
text: "split button2",
menu: [
{
text: "action with submenu",
menu: [
{
text: "submenu only",
menu: [{ text: "action only", click: function(){ console.log("action only"); } }]
},
{
text: "action only",
click: function() {
console.log("action only");
}
}
],
click: function(){
console.log("action with submenu");
}
}
],
click: function(){
console.log("split button");
}
});
Ribbon.addButton({
text: 'confirm',
click: function() {
Dialog.confirm({
text: "Do you want to X?"
});
}
});
Ribbon.addButton({
text: 'alert',
click: function() {
Dialog.alert({
text: "X happened!"
});
}
});
Ribbon.addButton({
text: 'progress',
click: function() {
var progress = Dialog.progress({
text: "X is in progress...",
value: 0
});
var percent = 0;
var interval = setInterval(function() {
percent += 10;
progress(percent);
if (percent == 100) {
clearInterval(interval);
}
}, 1000);
}
});
});
});
# www.robotstxt.org/
# www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449
User-agent: *
// Bind to Aloha Ready Event
Aloha.ready( function() {
var $ = jQuery = Aloha.jQuery;
$('.edit').aloha();
var button = jQuery('#bold');
button.attr( 'disabled',
( Aloha.queryCommandSupported( 'bold' ) &&
Aloha.queryCommandEnabled( 'bold' ) )
);
button.click( function() {
Aloha.execCommand( 'bold', false, '' );
updateBoldColor();
});
Aloha.bind('aloha-selection-changed aloha-command-executed', function() {
updateBoldColor();
});
function updateBoldColor() {
if ( Aloha.queryCommandIndeterm( 'bold' ) ) {
button.css( 'background-color', 'yellow' );
return;
}
button.css( 'background-color',
Aloha.queryCommandState( 'bold' ) ? 'lightgreen' : 'orange'
);
}
// update the color on startup
updateBoldColor();
var
range = Aloha.createRange(),
begin = jQuery( 'p' ),
end = jQuery( 'i' );
//setStart and setEnd take dom node and the offset as parameters
range.setStart( begin.get(0), 0);
range.setEnd( end.get(0), 1);
//add the range to the selection
Aloha.getSelection().removeAllRanges();
Aloha.getSelection().addRange( range );
Aloha.execCommand( 'bold', false, '' );
});
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Aloha commands</title>
<script src="../../lib/aloha.js"></script>
</head>
<body>
<h1>Testing Aloha Editor commands</h1>
<button id="bold">Bold</button>
<div class="edit">This is some content</div>
<div class="edit">
<h1>Hello there</h1>
<p>{Some content to <i>select}</i> with Aloha selection.</p>
</div>
<script src="commands-demo.js"></script>
</body>
</html>
body {
font-family: sans-serif;
}
body {
background-image: url("./background.png");
}
#bodyContent {
font-size:0.9em;
}
h1, h2, h3, h4, h5, h6 {
font-family: sans-serif;
padding-bottom:0.1em;
padding-top:0.5em;
}
h1 {
border-bottom:1px solid #AAAAAA;
}
h1 { font-size: 188%; }
h2 { font-size: 150%; }
h3 { font-size: 132%; }
h4 { font-size: 116%; }
h5 { font-size: 100%; }
h6 { font-size: 80%; }
#main {
width: 650px;
margin-top: 40px;
margin-left: auto ;
margin-right: auto ;
padding: 70px;
background-color: white;
border-radius: 1px;
-moz-border-radius: 1px;
box-shadow: 5px 5px rgba(0,0,0,0.3);
-webkit-box-shadow: 5px 5px rgba(0,0,0,0.3);
-moz-box-shadow: 5px 5px rgba(0,0,0,0.3);
}
a.external {
background: url("./external-link-ltr-icon.png") no-repeat 100% 50%;
padding: 0px 13px 0px 0px;
}
abbr, acronym
{
border-bottom: .1em dotted;
cursor: help;
}
/* A basic table styling */
table
{
padding: 0;
margin: 0;
border-collapse: collapse;
border: 1px solid #333;
color: #000;
}
table caption
{
caption-side: bottom;
font-size: 0.8em;
font-style: italic;
text-align: right;
padding: 0.5em 0;
}
table th, table td
{
border: 1px solid #666;
padding: 0.5em;
text-align: left;
}
#main ul,
#main ol {
margin:0 1.5em 1.5em 1.5em;
}
#main ul li {
list-style-type:disc;
}
#main ol li {
list-style-type:decimal;
}
\ No newline at end of file
Aloha Editor Demo
Demo implementation
Reset Session Store:
http://my-aloha-editor-demo.com/app/read-from-session.php?cmd=reset&pageId=0
- dont't name editable class to edit something "aloha-editable" (it's used by the core)
- class at links are removed (not so good)
(function(window, undefined) {
if (window.Aloha === undefined || window.Aloha === null) {
var Aloha = window.Aloha = {};
}
Aloha.settings = {
logLevels: {'error': true, 'warn': true, 'info': true, 'debug': false, 'deprecated': true},
errorhandling : false,
ribbon: false,
locale: 'en',
floatingmenu: {
width: 630
},
bundles: {
// Path for custom bundle relative from Aloha.settings.baseUrl usually path of aloha.js
cmsplugin: '../../../aloha-plugins'
},
repositories: {
linklist: {
data: [
{ name: 'Aloha Developers Wiki', url:'http://www.aloha-editor.com/wiki', type:'website', weight: 0.50 },
{ name: 'Aloha Editor - The HTML5 Editor', url:'http://aloha-editor.com', type:'website', weight: 0.90 },
{ name: 'Aloha Demo', url:'http://www.aloha-editor.com/demos.html', type:'website', weight: 0.75 },
{ name: 'Aloha Wordpress Demo', url:'http://www.aloha-editor.com/demos/wordpress-demo/index.html', type:'website', weight: 0.75 },
{ name: 'Aloha Logo', url:'http://www.aloha-editor.com/images/aloha-editor-logo.png', type:'image', weight: 0.10 }
]
}
},
plugins: {
format: {
// all elements with no specific configuration get this configuration
config : [ 'b', 'i', 'p', 'sub', 'sup', 'del', 'title', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre', 'removeFormat' ],
editables : {
// no formatting allowed for title
'#top-text' : [ ]
}
},
list: {
// all elements with no specific configuration get an UL, just for fun :)
config : [ 'ul', 'ol' ],
editables : {
// Even if this is configured it is not set because OL and UL are not allowed in H1.
'#top-text' : [ ]
}
},
abbr: {
// all elements with no specific configuration get an UL, just for fun :)
config : [ 'abbr' ],
editables : {
// Even if this is configured it is not set because OL and UL are not allowed in H1.
'#top-text' : [ ]
}
},
link: {
// all elements with no specific configuration may insert links
config : [ 'a' ],
editables : {
// No links in the title.
'#top-text' : [ ]
},
// all links that match the targetregex will get set the target
// e.g. ^(?!.*aloha-editor.com).* matches all href except aloha-editor.com
targetregex : '^(?!.*aloha-editor.com).*',
// this target is set when either targetregex matches or not set
// e.g. _blank opens all links in new window
target : '_blank',
// the same for css class as for target
cssclassregex : '^(?!.*aloha-editor.com).*',
cssclass : 'aloha',
// use all resources of type website for autosuggest
objectTypeFilter: ['website'],
// handle change of href
onHrefChange: function( obj, href, item ) {
var jQuery = Aloha.require('jquery');
if ( item ) {
jQuery(obj).attr('data-name', item.name);
} else {
jQuery(obj).removeAttr('data-name');
}
}
},
table: {
// all elements with no specific configuration are not allowed to insert tables
config : [ 'table' ],
editables : {
// Don't allow tables in top-text
'#top-text' : [ '' ]
},
summaryinsidebar : true,
// [{name:'green', text:'Green', tooltip:'Green is cool', iconClass:'GENTICS_table GENTICS_button_green', cssClass:'green'}]
tableConfig : [
{name:'hor-minimalist-a'},
{name:'box-table-a'},
{name:'hor-zebra'},
],
columnConfig : [
{name: 'table-style-bigbold', iconClass: 'aloha-button-col-bigbold'},
{name: 'table-style-redwhite', iconClass: 'aloha-button-col-redwhite'}
],
rowConfig : [
{name: 'table-style-bigbold', iconClass: 'aloha-button-row-bigbold'},
{name: 'table-style-redwhite', iconClass: 'aloha-button-row-redwhite'}
]
},
image: {
config :{
'fixedAspectRatio': true,
'maxWidth': 600,
'minWidth': 20,
'maxHeight': 600,
'minHeight': 20,
'globalselector': '.global',
'ui': {
'oneTab': true
}
},
/*'fixedAspectRatio': false,
'maxWidth': 600,
'minWidth': 20,
'maxHeight': 600,
'minHeight': 20,
'globalselector': '.global',
'ui': {
'oneTab': true,
'align': false,
'margin': false
}*/
},
cite: {
referenceContainer: '#references'
},
formatlesspaste :{
formatlessPasteOption : true
}
}
};
})(window);
\ No newline at end of file
(function(window, undefined) {
if (window.Aloha === undefined || window.Aloha === null) {
var Aloha = window.Aloha = {};
}
Aloha.settings = {
logLevels: {'error': true, 'warn': true, 'info': true, 'debug': false, 'deprecated': true},
errorhandling : false,
ribbon: false,
locale: 'en',
floatingmenu: {
width: 630
},
bundles: {
// Path for custom bundle relative from Aloha.settings.baseUrl usually path of aloha.js
cmsplugin: '../../../aloha-plugins'
},
repositories: {
linklist: {
data: [
{ name: 'Aloha Developers Wiki', url:'http://www.aloha-editor.com/wiki', type:'website', weight: 0.50 },
{ name: 'Aloha Editor - The HTML5 Editor', url:'http://aloha-editor.com', type:'website', weight: 0.90 },
{ name: 'Aloha Demo', url:'http://www.aloha-editor.com/demos.html', type:'website', weight: 0.75 },
{ name: 'Aloha Wordpress Demo', url:'http://www.aloha-editor.com/demos/wordpress-demo/index.html', type:'website', weight: 0.75 },
{ name: 'Aloha Logo', url:'http://www.aloha-editor.com/images/aloha-editor-logo.png', type:'image', weight: 0.10 }
]
}
},
plugins: {
format: {
// all elements with no specific configuration get this configuration
config : [ 'b', 'i', 'p', 'sub', 'sup', 'del', 'title', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre', 'removeFormat' ],
editables : {
// no formatting allowed for title
'#top-text' : [ ]
}
},
list: {
// all elements with no specific configuration get an UL, just for fun :)
config : [ 'ul', 'ol' ],
editables : {
// Even if this is configured it is not set because OL and UL are not allowed in H1.
'#top-text' : [ ]
}
},
abbr: {
// all elements with no specific configuration get an UL, just for fun :)
config : [ 'abbr' ],
editables : {
// Even if this is configured it is not set because OL and UL are not allowed in H1.
'#top-text' : [ ]
}
},
link: {
// all elements with no specific configuration may insert links
config : [ 'a' ],
editables : {
// No links in the title.
'#top-text' : [ ]
},
// all links that match the targetregex will get set the target
// e.g. ^(?!.*aloha-editor.com).* matches all href except aloha-editor.com
targetregex : '^(?!.*aloha-editor.com).*',
// this target is set when either targetregex matches or not set
// e.g. _blank opens all links in new window
target : '_blank',
// the same for css class as for target
cssclassregex : '^(?!.*aloha-editor.com).*',
cssclass : 'aloha',
// use all resources of type website for autosuggest
objectTypeFilter: ['website'],
// handle change of href
onHrefChange: function( obj, href, item ) {
var jQuery = Aloha.require('jquery');
if ( item ) {
jQuery(obj).attr('data-name', item.name);
} else {
jQuery(obj).removeAttr('data-name');
}
}
},
table: {
// all elements with no specific configuration are not allowed to insert tables
config : [ 'table' ],
editables : {
// Don't allow tables in top-text
'#top-text' : [ '' ]
},
summaryinsidebar : true,
// [{name:'green', text:'Green', tooltip:'Green is cool', iconClass:'GENTICS_table GENTICS_button_green', cssClass:'green'}]
tableConfig : [
{name:'hor-minimalist-a'},
{name:'box-table-a'},
{name:'hor-zebra'},
],
columnConfig : [
{name: 'table-style-bigbold', iconClass: 'aloha-button-col-bigbold'},
{name: 'table-style-redwhite', iconClass: 'aloha-button-col-redwhite'}
],
rowConfig : [
{name: 'table-style-bigbold', iconClass: 'aloha-button-row-bigbold'},
{name: 'table-style-redwhite', iconClass: 'aloha-button-row-redwhite'}
]
},
image: {
config :{
'fixedAspectRatio': true,
'maxWidth': 600,
'minWidth': 20,
'maxHeight': 600,
'minHeight': 20,
'globalselector': '.global',
'ui': {
'oneTab': true
}
},
/*'fixedAspectRatio': false,
'maxWidth': 600,
'minWidth': 20,
'maxHeight': 600,
'minHeight': 20,
'globalselector': '.global',
'ui': {
'oneTab': true,
'align': false,
'margin': false
}*/
},
cite: {
referenceContainer: '#references'
},
formatlesspaste :{
formatlessPasteOption : true
}
}
};
})(window);
\ No newline at end of file
(function(window, undefined) {
if (window.Aloha === undefined || window.Aloha === null) {
var Aloha = window.Aloha = {};
}
/*
This is a minimal Aloha Editor configuration
In this Aloha Editor Demo Demo we add a custom plugin.
This plugin is located in our own specific plugin bundle.
*/
Aloha.settings = {
logLevels: { 'error': true, 'warn': true, 'info': true, 'debug': true, 'deprecated': true },
locale: 'en',
bundles: {
// Path for custom bundle relative from Aloha.settings.baseUrl usually path of aloha.js
cmsplugin: '../demo/demo-app/app/aloha-plugins'
}
};
})(window);
\ No newline at end of file
(function(window, undefined) {
if (window.Aloha === undefined || window.Aloha === null) {
var Aloha = window.Aloha = {};
}
/*
This is a minimal Aloha Editor configuration
In this Aloha Editor Demo Demo we add a custom plugin.
This plugin is located in our own specific plugin bundle.
*/
Aloha.settings = {
bundles: {
// Path for custom bundle relative from Aloha.settings.baseUrl usually path of aloha.js
cmsplugin: '../../../aloha-plugins'
}
};
})(window);
\ No newline at end of file
Download the latest version of Aloha Editor (v0.20.x) from http://aloha-editor.org and extract the archive here.
Check that you have the following structure:
app/aloha-editor/aloha/lib/aloha.js
( and app/aloha-editor/aloha/css/aloha.css )
\ No newline at end of file
/**
* Aloha Link List Repository
* --------------------------
* A simple demo repository of links
*/
define( [ 'jquery', 'aloha/repository' ],
function ( jQuery, repository ) {
new ( repository.extend( {
_constructor: function () {
this._super( 'cmslinklist' );
},
urlset: [
{ name: 'Aloha Editor Demo', url: 'http://aloha-editor.org/demo/nano-cms', type: 'website' }
],
/**
* initalize LinkList, parse all links, build folder structure and add
* additional properties to the items
*/
init: function () {
var that = this;
// Add ECMA262-5 Array method filter if not supported natively.
// But we will be very conservative and add to this single array
// object so that we do not tamper with the native Array prototype
// object
if ( !( 'filter' in Array.prototype ) ) {
this.urlset.filter = function ( filter, that /*opt*/ ) {
var other = [],
v,
i = 0,
n = this.length;
for ( ; i < n; i++ ) {
if ( i in this && filter.call( that, v = this[ i ], i, this ) ) {
other.push( v );
}
}
return other;
};
}
jQuery.ajax({ type: "GET",
dataType: "json",
async: false,
url: 'app/demo-app-linklist.php',
success: function(data) {
//console.log('lookup data', data);
var items = [];
if (data.length) {
that.urlset = data;
}
},
error: function(data) {
//console.log('lookup error', data);
}
});
this.repositoryName = 'AlohaCMSLinklist';
},
/**
* Searches a repository for object items matching query if
* objectTypeFilter. If none is found it returns null.
*
* @param {Object} p
* @param {Function} callback
* @return {null|Array}
*/
query: function ( p, callback ) {
// Not supported; filter, orderBy, maxItems, skipcount, renditionFilter
var r = new RegExp( p.queryString, 'i' );
var d = this.urlset.filter( function ( e, i, a ) {
return (
( !p.queryString || e.name.match( r ) || e.url.match( r ) ) &&
( !p.objectTypeFilter || ( !p.objectTypeFilter.length ) || jQuery.inArray( e.type, p.objectTypeFilter ) > -1 ) &&
true
);
} );
callback.call( this, d );
},
} ) )();
} );
\ No newline at end of file
define( [
'aloha',
'jquery',
'aloha/plugin',
'../../cms/extra/cms-linklist' // custom linklist
], function ( Aloha, jQuery, Plugin ) {
var GENTICS = window.GENTICS;
/**
* register the plugin with unique name
*/
return Plugin.create( 'cms-plugin', {
/**
* Initialize the plugin and set initialize flag on true
*/
init: function () {
// do nothing
},
/**
* toString method
* @return string
*/
toString: function () {
return 'cms-plugin';
}
} );
} );
body {
padding-top: 60px;
}
#save-page, #edit-page {
display: none; // does not work with jquery hide/show (and twitter bootstrap)
}
.cms-actions {
font-size: 10px;
}
#footer {
margin-top: 17px;
padding-top: 17px;
border-top: 1px solid #eee;
}
This diff is collapsed.
<?php
/**
* provide aloha link suggestion
*/
/*
// also possible: use the lookup filter here to not send a json with 10000s of entries
$lookup = false;
if (isset($_REQUEST['lookup'])) {
$lookup = $_REQUEST['lookup'];
}
*/
// read all available files
$results = array();
// all pages
$files = get_files( '../' );
$results = array_merge($results, $files);
// all uploads
$files = get_files( '../uploads/' );
$results = array_merge($results, $files);
header('Content-Type:text/javascript');
if (count($results) > 0) {
$out = '[';
foreach ($results as $result) {
$out .= '{"url":"'.$result['link'].'","name":"'.$result['title'].'","type":"'.$result['type'].'"},';
}
$out = substr($out, 0, -1);
$out .= ']';
echo $out;
}
/**
* helper functions
*/
function get_files( $dir = '../', $dir_path = false) {
$files = scandir( $dir );
$result = array();
if ( empty($dir_path) ) {
$dir_path = substr($dir, 1, 0);
}
foreach ( $files as $file ) {
$data = false;
if ( $file === '.' || $file === '..' ) {
continue;
} else if (is_file($dir.$file)) {
$data['link'] = $dir_path.$file;
$data['title'] = nice_file_title($file); // read title from html, image/auto meta data ...
$data['type'] = 'website'; // check what type the file is -- now just use 'website'
array_push($result, $data);
}
}
return $result;
}
function nice_file_title($title) {
$ext = pathinfo($title, PATHINFO_EXTENSION);
$search = array("-", "_", "+", ".".$ext);
$title = trim(str_replace($search, " ", $title));
$title = $title.' ('.strtolower($ext).')';
return $title;
}
\ No newline at end of file
// We don't need to wait for Aloha in this case;
// Just get the data from our backend database and write the saved HTML into the DOM
// Note: In this Example we don't care about SEO / non JavaScript devices!
$(document).ready(function() {
// get the current page URL / ID and all Aloha Editables for that page
var backend = 'session', // session, db -- no file backend for reading needed
pageId = window.location.pathname;
if ( backend == 'file' ) {
return false;
}
// read the data from our database backend
var request = jQuery.ajax({
url: "app/read-from-" + backend + ".php",
type: "POST",
data: {
pageId : pageId
},
dataType: "json"
});
request.done(function(msg) {
// insert all content into the coresponding html container
jQuery.each(msg, function() {
// Aloha is not ready yet so we just alter the DOM
jQuery('#'+this.contentId).html(this.content);
});
});
request.fail(function(jqXHR, textStatus) {
jQuery("#log p").html( "Request failed: " + textStatus );
alert("Request failed: " + textStatus );
});
});
// Aloha is ready;
// Listen to the 'aloha-editable-deactivated' event and save the data to our backend
Aloha.ready(function() {
Aloha.require( ['aloha', 'jquery'], function( Aloha, jQuery) {
// start: save content on deactivation of an Aloha Editable
Aloha.bind('aloha-editable-deactivated', function() {
var backend = 'session', // session, db, file
content = Aloha.activeEditable.getContents(), // this is the cleaned content of the last active editable
contentId = Aloha.activeEditable.getId(), // this HTML ID of the DOM element
pageId = window.location.pathname; // page URL / ID
// textarea handling -- html id is "xy" and will be "xy-aloha" for the aloha editable
if ( contentId.match(/-aloha$/gi) ) {
contentId = contentId.replace( /-aloha/gi, '' );
}
// send the data to our save.php backend script
var request = jQuery.ajax({
url: "app/save-to-" + backend + ".php",
type: "POST",
data: {
content : content,
contentId : contentId,
pageId : pageId
},
dataType: "html"
});
request.done(function(msg) {
// everything was fine; content saved
jQuery("#log p").html( msg );
});
request.fail(function(jqXHR, textStatus) {
// there was a problem; content not saved
jQuery("#log p").html( "Request failed: " + textStatus );
});
});
// end: save content on deactivation of an Aloha Editable
});
});
/* ==========================================================
* bootstrap-alerts.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#alerts
* ==========================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================== */
!function( $ ){
"use strict"
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */
var transitionEnd
$(document).ready(function () {
$.support.transition = (function () {
var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
return support
})()
// set CSS transition event type
if ( $.support.transition ) {
transitionEnd = "TransitionEnd"
if ( $.browser.webkit ) {
transitionEnd = "webkitTransitionEnd"
} else if ( $.browser.mozilla ) {
transitionEnd = "transitionend"
} else if ( $.browser.opera ) {
transitionEnd = "oTransitionEnd"
}
}
})
/* ALERT CLASS DEFINITION
* ====================== */
var Alert = function ( content, options ) {
if (options == 'close') return this.close.call(content)
this.settings = $.extend({}, $.fn.alert.defaults, options)
this.$element = $(content)
.delegate(this.settings.selector, 'click', this.close)
}
Alert.prototype = {
close: function (e) {
var $element = $(this)
, className = 'alert-message'
$element = $element.hasClass(className) ? $element : $element.parent()
e && e.preventDefault()
$element.removeClass('in')
function removeElement () {
$element.remove()
}
$.support.transition && $element.hasClass('fade') ?
$element.bind(transitionEnd, removeElement) :
removeElement()
}
}
/* ALERT PLUGIN DEFINITION
* ======================= */
$.fn.alert = function ( options ) {
if ( options === true ) {
return this.data('alert')
}
return this.each(function () {
var $this = $(this)
, data
if ( typeof options == 'string' ) {
data = $this.data('alert')
if (typeof data == 'object') {
return data[options].call( $this )
}
}
$(this).data('alert', new Alert( this, options ))
})
}
$.fn.alert.defaults = {
selector: '.close'
}
$(document).ready(function () {
new Alert($('body'), {
selector: '.alert-message[data-alert] .close'
})
})
}( window.jQuery || window.ender );
\ No newline at end of file
/* ============================================================
* bootstrap-buttons.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#buttons
* ============================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
!function( $ ){
"use strict"
function setState(el, state) {
var d = 'disabled'
, $el = $(el)
, data = $el.data()
state = state + 'Text'
data.resetText || $el.data('resetText', $el.html())
$el.html( data[state] || $.fn.button.defaults[state] )
setTimeout(function () {
state == 'loadingText' ?
$el.addClass(d).attr(d, d) :
$el.removeClass(d).removeAttr(d)
}, 0)
}
function toggle(el) {
$(el).toggleClass('active')
}
$.fn.button = function(options) {
return this.each(function () {
if (options == 'toggle') {
return toggle(this)
}
options && setState(this, options)
})
}
$.fn.button.defaults = {
loadingText: 'loading...'
}
$(function () {
$('body').delegate('.btn[data-toggle]', 'click', function () {
$(this).button('toggle')
})
})
}( window.jQuery || window.ender );
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
session_start();
error_log("\n\n".'###### save to session ', 3, "demo-app.log");
// XSS handling required
$pageId = $_REQUEST['pageId'];
$contentId = $_REQUEST['contentId'];
$content = $_REQUEST['content'];
$data = false;
if (!empty($pageId)) {
$contentItemId = md5($pageId.'#'.$contentId);
$data['id'] = $contentItemId;
$data['pageId'] = $pageId;
$data['contentId'] = $contentId;
$data['content'] = $content;
$_SESSION[md5($pageId)][$contentItemId] = serialize($data);
}
if ( !empty($error) ) {
error_log("\n".'error: '.print_r($error, true), 3, "demo-app.log");
} else {
echo 'Content saved.';
}
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment