Permalink
Browse files

Merge branch 'release-0.20.0' of github.com:alohaeditor/Aloha-Editor …

…into release-0.20.0

Conflicts:
	CHANGELOG.md
  • Loading branch information...
2 parents e1bc845 + d55ff57 commit aae89357b5fe8f3de5b53838568655ed54c29636 @cprerovsky cprerovsky committed Nov 10, 2011
View
@@ -2,55 +2,80 @@
This document is to serve as a "what has been done" in terms of the [Roadmap](http://aloha-editor.org/wiki/Roadmap)
-
-### 0.20
-
-- 0.20.1
- - core: Adds option for "cls" property to be added to ui-attributefields.
- cls will be an optional extra CSS class that will be added to this component's Element. This can be useful for adding customized styles to the component or any of its children using standard CSS rules. (http://docs.sencha.com/ext-js/4-0/#!/api/Ext.AbstractComponent-cfg-cls)
- - ribbon-plugin: The ribbon will no longer be visible by default. Instead you can use the show function to make it appear.
- - image-plugin: The plugin will now use a different method to calculate the width/height when using a fixed aspect ratio.
- - core: Fixed floatingmenu to stay visible, if pinned and window is resized.
- - core: Added new Method to FloatingMenu: activateTabOfButton(name) will activate the tab containing the button with given name (if tab is visible)
- Fixed all plugins to not use FloatingMenu.userActivatedTab, but FloatingMenu.activateTabOfButton instead. This will ensure that switching Tabs will also work, if floatingmenu is configured individually.
- - link-plugin: Fixed link-plugin to bind events to links when editables are created. Also bind events to new created links. This ensures that Hotkey CTRL+L to create a new link works, and links can be followed by clicking on them while holding CTRL
- - link-plugin: Fixed handling of external links. Previously it was not possible to change a repository link to an external link.
- - listenforcer-plugin: fixed a bug which would cause an error when activating or deactivating an editable
- - format-plugin: tags removed by the "remove format" button may now be configured by setting Aloha.settings.plugins.format.removeFormats = ['b', 'strong', 'whatever']; The default set of formats to be removed is: 'strong', 'em', 'b', 'i', 'cite', 'q', 'code', 'abbr', 'del', 'sub', 'sup'
-
-### 0.10
-
-- 0.10.0-alpha, Pending
+## 0.20-BETA - 2011/11
+- core: Add option for "cls" property to be added to ui-attributefields. cls will be an optional extra CSS class that will be added to this component's Element. This can be useful for adding customized styles to the component or any of its children using standard CSS rules. (http://docs.sencha.com/ext-js/4-0/#!/api/Ext.AbstractComponent-cfg-cls)
+- ribbon-plugin: The ribbon will no longer be visible by default. Instead you can use the show function to make it appear.
+- image-plugin: The plugin will now use a different method to calculate the width/height when using a fixed aspect ratio.
+- core: Fixed floatingmenu to stay visible, if pinned and window is resized.
+- core: Added new Method to FloatingMenu: activateTabOfButton(name) will activate the tab containing the button with given name (if tab is visible)
+- core: Fixed all plugins to not use FloatingMenu.userActivatedTab, but FloatingMenu.activateTabOfButton instead. This will ensure that switching Tabs will also work, if floatingmenu is configured individually.
+- link-plugin: Fixed link-plugin to bind events to links when editables are created. Also bind events to new created links. This ensures that Hotkey CTRL+L to create a new link works, and links can be followed by clicking on them while holding CTRL
+- link-plugin: Fixed handling of external links. Previously it was not possible to change a repository link to an external link.
+- listenforcer-plugin: fixed a bug which would cause an error when activating or deactivating an editable
+- format-plugin: tags removed by the "remove format" button may now be configured by setting Aloha.settings.plugins.format.removeFormats = ['b', 'strong', 'whatever']; The default set of formats to be removed is: 'strong', 'em', 'b', 'i', 'cite', 'q', 'code', 'abbr', 'del', 'sub', 'sup'
+- browser-plugin: The browser now supports i18n and has better paging support, if the repositories provides meta information (numItems, hasMoreItems)
+- core: added +Aloha.ready( function() {} )+
+- core: Aloha base url is now auto-detected
+- core: Aloha plugins are now loaded in through `data-plugins="format,table"` on the aloha `script` element
+ - See demos for more usage information
+- core: moved to requireJS
- Structure overhaul
- `WebContent` is now `src`
- `build/out` is now `out`
- Plugins are now nicely named, and have dropped their ExtJS prefixes. Eg. the format plugin was renamed from 'com.gentics.aloha.plugins.Format' to 'format'. Have a look at the plugin folder for a complete overview of new plugin names.
- - The GENTICS namespace has been completely removed from all objects in Aloha Editor's core
- - Building overhaul
- - Building has moved from Java + Ant to Node.js + Buildr
- - Building now runs in seconds instead of minutes, with greater compression ratios
- - Building will run strict JSHint code quality tests
- - Output is now more consistent with source, demos can remain untouched between using the src and out versions
- - JavaScript and CSS files are now bundled into `aloha.js` and `aloha.css`
- - Image plugin
- - Supports inserting via src
- - Title editing
- - Size increase/decrease
- - Padding increase/decrease
- - Alignment
- - Translations are now JSON files
- - Initialisation and load process are now asynchronous (less initialisation problems)
- - Introduction of the `$('body').bind('aloha',function(){/*your code*/});` event for creating editables
- - Aloha base url is now auto-detected
- - Aloha plugins are now loaded in through `data-plugins="format,table"` on the aloha `script` element
- - See demos for more usage information
- - Great speed increases
- - Introduction of the CLI to increase developer/contributor effeciency
+ - refactored respecting commonJS package structure
+ - AMD loading - Convert Plugins to RequireJS structure - improved plugin lodaing (lib, css, doc, i18n) - Major Source Code Structure Refinements - build - CSS Bundling & Compression - JavaScript Bundling & Compression - The GENTICS namespace has been completely removed from all objects in Aloha Editor's core - Building overhaul - Building has moved from Java + Ant to Node.js + Buildr - Building now runs in seconds instead of minutes, with greater compression ratios - Building will run strict JSHint code quality tests - Output is now more consistent with source, demos can remain untouched between using the src and out versions - JavaScript and CSS files are now bundled into `aloha.js` and `aloha.css`- core: documentation
+ - guides for using Aloha Editor
+ - JSdoc
+- core: tests
+ - added testbox for developer
+ - commandAPI test suite
+ - improve core tests
+ - added plugin API tests
+ - added repository API tests
+- core: ranslations as JSON files
+- core: Support for Opera (>11)
+- core: update jQuery to 1.7
+- contenthandler-plugin: (for copy/paste)
+ - sanitize (configureable HTML elements and attributes)
+ - word
+ - generic (for html and text)
+- core: implemented Aloha.execCommand stack
+ - Bold
+ - Delete
+ - ForwardDelete
+ - InsertParagraph
+ - InsertLineBreak
+ - InsertHTML
+ - InsertOrderedList
+ - InsertUnorderedList
+ - Indent
+ - Outdent
+- table-plugin
+ - merging and splitting
+ - repair tables if they are broken
+- list-plugin
+ - fixed issues in IE with empty list nodes
+- sidebar-plugin: new
+- image: new
+- horizontalruler-plugin: new
+- characterpicker-plugin: new
+- undo-plugin: new
+- new extra plugins
+ - cite
+ - headerids
+ - metaview
+ - wai-lang
+ - speak
+ - googletranslate
+
+## 0.10.-0.19.0
+The reason for not releasing this builds was the ongoing refactoring of the core engine to implement all functionallities based on execCommand.
+Non of these releases reached a production ready state. We still increased the release number due to the fact that we also tested the new release process with maven and archivia and it would brake dependencies if we wouldn't have increased the version number.
-### 0.9
-- 0.9.3 - October 2010
+## 0.9.3 - October 2010
- Link/Href handling
- Repository browser
- As well as sample Delicious and LinkList Repositories
@@ -313,4 +313,12 @@ function( Aloha, Selection, jQuery, console ) {
// Return the modified object
return target;
};
+
+ jQuery.isBoolean = function(b) {
+ return b === true || b === false;
+ },
+
+ jQuery.isNumeric = function(o) {
+ return ! isNaN (o-0);
+ }
});
@@ -146,8 +146,10 @@ function( Aloha, Class, jQuery ) {
query: function ( params, callback ) {
var that = this,
repo,
- // The marged results, collected from repository responses
+ // The merged results, collected from repository responses
allitems = [],
+ // the merge metainfo, collected from repository responses
+ allmetainfo = {numItems: 0, hasMoreItems: false},
// The set of repositories towhich we want to delegate work
repositories = [],
// A counting semaphore (working in reverse, ie: 0 means free)
@@ -177,8 +179,9 @@ function( Aloha, Class, jQuery ) {
* nb: "this" is reference to the calling repository
*
* @param {Array} items - Results returned by the repository
+ * @param {Object} metainfo - optional Metainfo returned by the repository
*/
- processResults = function ( items ) {
+ processResults = function ( items, metainfo ) {
if (numOpenCallbacks == 0) {
return;
}
@@ -198,9 +201,29 @@ function( Aloha, Class, jQuery ) {
if ( j ) {
jQuery.merge( allitems, items );
}
-
+
+ if ( metainfo && allmetainfo ) {
+ if ( jQuery.isNumeric(metainfo.numItems)
+ && jQuery.isNumeric(allmetainfo.numItems) ) {
+ allmetainfo.numItems += metainfo.numItems;
+ } else {
+ allmetainfo.numItems = undefined;
+ }
+
+ if (jQuery.isBoolean(metainfo.hasMoreItems)
+ && jQuery.isBoolean(allmetainfo.hasMoreItems)) {
+ allmetainfo.hasMoreItems = allmetainfo.hasMoreItems || metainfo.hasMoreItems;
+ } else {
+ allmetainfo.hasMoreItems = undefined;
+ }
+ } else {
+ // at least one repository did not return metainfo, so we have no aggregated metainfo at all
+ allmetainfo = undefined;
+ }
+
+ // TODO how to return the metainfo here?
if ( --numOpenCallbacks == 0 ) {
- that.queryCallback( callback, allitems, timer );
+ that.queryCallback( callback, allitems, allmetainfo, timer );
}
};
@@ -212,7 +235,7 @@ function( Aloha, Class, jQuery ) {
var timeout = parseInt( params.timeout, 10 ) || 5000;
timer = setTimeout(function() {
numOpenCallbacks = 0;
- that.queryCallback( callback, allitems, timer );
+ that.queryCallback( callback, allitems, allmetainfo, timer );
}, timeout);
// If repositoryId or a list of repository ids, is not specified in
@@ -244,7 +267,7 @@ function( Aloha, Class, jQuery ) {
// If none of the repositories implemented the query method, then
// don't wait for the timeout, simply report to the client
if (numOpenCallbacks == 0) {
- this.queryCallback( callback, allitems, timer );
+ this.queryCallback( callback, allitems, allmetainfo, timer );
}
},
@@ -255,11 +278,12 @@ function( Aloha, Class, jQuery ) {
* @param {Function} callback - Callback specified by client when
* invoking the query method
* @param {Array} items - Results, collected from all repositories
+ * @param {Object} metainfo - optional object containing metainfo
* @param {Timer} timer - We need to clear this timer
* @return void
* @hide
*/
- queryCallback: function ( callback, items, timer ) {
+ queryCallback: function ( callback, items, metainfo, timer ) {
if ( timer ) {
clearTimeout( timer );
timer = undefined;
@@ -276,7 +300,12 @@ function( Aloha, Class, jQuery ) {
items : items,
results : items.length
};
-
+
+ if (metainfo) {
+ result.numItems = metainfo.numItems;
+ result.hasMoreItems = metainfo.hasMoreItems;
+ }
+
callback.call( this, result );
},
@@ -14,14 +14,15 @@ define([
'aloha/jquery',
'util/class',
+ 'i18n!browser/nls/i18n',
'css!browser/css/browsercombined.css',
'jquery-plugin!browser/vendor/jquery.ui',
'jquery-plugin!browser/vendor/ui-layout',
- 'jquery-plugin!browser/vendor/grid.locale.en',
+ 'jquery-plugin!browser/vendor/grid.locale.en', // TODO how can we load the correct language here?
'jquery-plugin!browser/vendor/jquery.jqGrid',
'jquery-plugin!browser/vendor/jquery.jstree'
-], function (jQuery, Class) {
+], function (jQuery, Class, i18n) {
'use strict';
@@ -128,9 +129,9 @@ var Browser = Class.extend({
pageSize : 10,
columns : {
icon : {title: '', width: 30, sortable: false, resizable: false},
- name : {title: 'Name', width: 250, sorttype: 'text'},
- url : {title: 'URL', width: 250, sorttype: 'text'},
- preview : {title: 'Preview', width: 200, sorttype: 'text'}
+ name : {title: i18n.t('Name'), width: 250, sorttype: 'text'},
+ url : {title: i18n.t('URL'), width: 250, sorttype: 'text'},
+ preview : {title: i18n.t('Preview'), width: 200, sorttype: 'text'}
},
isFloating : false
}, opts || {});
@@ -374,22 +375,28 @@ var Browser = Class.extend({
this.repositoryManager.query(params, function (response) {
that.processRepoResponse(
(response.results > 0) ? response.items : [],
+ { numItems: response.numItems, hasMoreItems: response.hasMoreItems},
callback
);
});
}
},
- processRepoResponse: function (items, callback) {
+ processRepoResponse: function (items, metainfo, callback) {
var that = this;
var data = [];
+ // if the second parameter is a function, it is the callback
+ if (typeof metainfo === 'function') {
+ callback = metainfo;
+ metainfo = undefined;
+ }
jQuery.each(items, function () {
data.push(that.harvestRepoObject(this));
});
if (typeof callback === 'function') {
- callback.call(this, data);
+ callback.call(this, data, metainfo);
}
},
@@ -739,7 +746,7 @@ var Browser = Class.extend({
));
bar.addClass('aloha-browser-grab-handle').append(btns);
- bar.find('.aloha-browser-search-btn').click(function () {
+ bar.find('.aloha-browser-search-btn').html(i18n.t('Search')).click(function () {
that.triggerSearch();
});
searchField = bar.find('.aloha-browser-search-field').keypress(function (event) {
@@ -748,7 +755,7 @@ var Browser = Class.extend({
}
});
- var prefilledValue = "Input search text...";
+ var prefilledValue = i18n.t("Input search text...");
searchField.val(prefilledValue).addClass("aloha-browser-search-field-empty")
.focus(function() {
if (jQuery(this).val() == prefilledValue) {
@@ -764,7 +771,7 @@ var Browser = Class.extend({
}
});
- bar.find('.aloha-browser-close-btn').click(function () {
+ bar.find('.aloha-browser-close-btn').html(i18n.t('Close')).click(function () {
that.close();
});
bar.find('.aloha-browser-btn').mousedown(function () {
@@ -877,8 +884,8 @@ var Browser = Class.extend({
this.list.setCaption(
(typeof this._searchQuery === 'string')
- ? 'Searching for "' + this._searchQuery + '" in ' + folder.name
- : 'Browsing: ' + folder.name
+ ? i18n.t('Searching for') + ' "' + this._searchQuery + '" ' + i18n.t('in') + ' ' + folder.name
+ : i18n.t('Browsing') + ': ' + folder.name
);
this.list.hide();
@@ -899,9 +906,9 @@ var Browser = Class.extend({
filter : this.filter,
recursive : false
},
- function (data) {
+ function (data, metainfo) {
if (typeof callback === 'function') {
- callback.call(that, data);
+ callback.call(that, data, metainfo);
}
}
);
@@ -931,10 +938,17 @@ var Browser = Class.extend({
});
},
- processItems: function (data) {
+ processItems: function (data, metainfo) {
var btns = this._pagingBtns;
var disabled = 'ui-state-disabled';
-
+
+ // if the total number of items is known, we can calculate the number of pages
+ if (metainfo && jQuery.isNumeric(metainfo.numItems)) {
+ this._pagingCount = metainfo.numItems;
+ } else {
+ this._pagingCount = undefined;
+ }
+
this.grid.find('.loading').hide();
this.list.show();
this.listItems(data);
@@ -970,9 +984,9 @@ var Browser = Class.extend({
}
this.grid.find('.ui-paging-info').html(
- 'Viewing ' + (from)
- + ' - ' + (to)
- + ' of ' + (this._pagingCount || 'numerous')
+ i18n.t('Viewing') + ' ' + (from)
+ + ' - ' + (to)
+ + ' ' + i18n.t('of') + ' ' + (jQuery.isNumeric(this._pagingCount) ? this._pagingCount : i18n.t('numerous'))
);
},
Oops, something went wrong.

0 comments on commit aae8935

Please sign in to comment.