svn: /web/doc-editor/trunk/ js/login_override.js js/ux/Ext.ux.CodeMirror.js js/ux/Ext.ux.WindowDrawer.js js/ux/others/login_specific/Ext.ux.IconCombo.css js/ux/others/login_specific/Ext.ux.IconCombo.js js/ux/others/main_specific/Ext.util.md5.js js/ux/others/main_specific/Ext.ux.CodeMirror.js js/ux/others/main_specific/Ext.ux.Notification.js js/ux/others/main_specific/Ext.ux.WindowDrawer.js js/ux/others/main_specific/Ext.ux.grid.GridSummary.css js/ux/others/main_specific/Ext.ux.grid.GridSummary.j
[email protected] (Yannick Torres)
| Newsgroups | php.doc.web |
|---|---|
| Message-ID | <[email protected]> |
yannick Sat, 26 Dec 2009 18:18:57 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=292661
Log:
Reorder all Ux to be able to minimize it easly
Changed paths:
D web/doc-editor/trunk/js/login_override.js
D web/doc-editor/trunk/js/ux/Ext.ux.CodeMirror.js
D web/doc-editor/trunk/js/ux/Ext.ux.WindowDrawer.js
D web/doc-editor/trunk/js/ux/GridSummary/
D web/doc-editor/trunk/js/ux/Notification/
D web/doc-editor/trunk/js/ux/md5/
A web/doc-editor/trunk/js/ux/others/
A web/doc-editor/trunk/js/ux/others/login_specific/
A web/doc-editor/trunk/js/ux/others/login_specific/Ext.ux.IconCombo.css
A web/doc-editor/trunk/js/ux/others/login_specific/Ext.ux.IconCombo.js
A web/doc-editor/trunk/js/ux/others/main_specific/
A + web/doc-editor/trunk/js/ux/others/main_specific/Ext.util.md5.js
(from web/doc-editor/trunk/js/ux/md5/md5.js:r292400)
A + web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.CodeMirror.js
(from web/doc-editor/trunk/js/ux/Ext.ux.CodeMirror.js:r292626)
A + web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.Notification.js
(from web/doc-editor/trunk/js/ux/Notification/Ext.ux.Notification.js:r292580)
A + web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.WindowDrawer.js
(from web/doc-editor/trunk/js/ux/Ext.ux.WindowDrawer.js:r292400)
A + web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.grid.GridSummary.css
(from web/doc-editor/trunk/js/ux/GridSummary/Ext.ux.grid.GridSummary.css:r292400)
A + web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.grid.GridSummary.js
(from web/doc-editor/trunk/js/ux/GridSummary/Ext.ux.grid.GridSummary.js:r292400)
U web/doc-editor/trunk/themes/style.css
svn-diffs-292661.txt
(text/x-diff, 59.6 KB)
Deleted: web/doc-editor/trunk/js/login_override.js
===================================================================
--- web/doc-editor/trunk/js/login_override.js 2009-12-26 18:13:48 UTC (rev 292660)
+++ web/doc-editor/trunk/js/login_override.js 2009-12-26 18:18:57 UTC (rev 292661)
@@ -1,60 +0,0 @@
-// create namespace for plugins
-Ext.namespace('Ext.ux.plugins');
-
-/**
- * Ext.ux.IconCombo Extension Class for Ext 2.x Library
- *
- * @author Ing. Jozef Sakalos
- * @version $Id: Ext.ux.IconCombo.js 617 2007-12-20 11:29:56Z jozo $
- *
- * @class Ext.ux.IconCombo
- * @extends Ext.form.ComboBox
- */
-
-Ext.ux.IconCombo = Ext.extend(Ext.form.ComboBox, {
- initComponent:function() {
-
- Ext.apply(this, {
- tpl: '<tpl for=".">'
- + '<div class="x-combo-list-item ux-icon-combo-item">'
- + '<div class="flags {' + this.iconClsField + '}" style="position:absolute"></div>'
- + '<div class="ux-icon-combo-value">{' + this.displayField + '}</div>'
- + '</div></tpl>'
- });
-
- // call parent initComponent
- Ext.ux.IconCombo.superclass.initComponent.call(this);
-
- }, // end of function initComponent
-
- onRender:function(ct, position) {
- // call parent onRender
- Ext.ux.IconCombo.superclass.onRender.call(this, ct, position);
-
- // adjust styles
- this.wrap.applyStyles({position:'relative'});
- this.el.addClass('ux-icon-combo-input');
-
- // add div for icon
- this.icon = Ext.DomHelper.append(this.el.up('div.x-form-field-wrap'), {
- tag: 'div', style:'position:absolute'
- });
-
- }, // end of function onRender
-
- setIconCls:function() {
- var rec = this.store.query(this.valueField, this.getValue()).itemAt(0);
- if(rec) {
- this.icon.className = 'flags ' + rec.get(this.iconClsField);
- }
- }, // end of function setIconCls
-
- setValue: function(value) {
- Ext.ux.IconCombo.superclass.setValue.call(this, value);
- this.setIconCls();
- } // end of function setValue
-});
-
-// register xtype
-Ext.reg('iconcombo', Ext.ux.IconCombo);
-
Deleted: web/doc-editor/trunk/js/ux/Ext.ux.CodeMirror.js
===================================================================
--- web/doc-editor/trunk/js/ux/Ext.ux.CodeMirror.js 2009-12-26 18:13:48 UTC (rev 292660)
+++ web/doc-editor/trunk/js/ux/Ext.ux.CodeMirror.js 2009-12-26 18:18:57 UTC (rev 292661)
@@ -1,231 +0,0 @@
-Ext.ux.CodeMirror = Ext.extend(Ext.BoxComponent, {
-
- readOnly : (this.readOnly) ? this.readOnly : false,
- width : 'auto',
- height : 'auto',
- autoResize : true,
- initialised : false,
- documentDurty : false,
- parser : (this.parser) ? this.parser : "xml",
- parserFile : "parsexml.js",
- parserStylesheet : "js/ux/codemirror/css/xmlcolors.css",
-
- initComponent : function() {
-
- Ext.ux.CodeMirror.superclass.initComponent.apply(this);
-
- this.addEvents({
- initialize : true,
- codemodified : true,
- coderestored : true,
- cursormove : true,
- scroll : true
- });
-
- //For the parser
- if( this.parser == 'xml' ) {
- this.parserFile = "parsexml.js";
- this.parserStylesheet = "js/ux/codemirror/css/xmlcolors.css";
- }
-
- if( this.parser == 'html' ) {
- this.parserFile = ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "parsehtmlmixed.js"];
- this.parserStylesheet = ["js/ux/codemirror/css/xmlcolors.css", "js/ux/codemirror/css/jscolors.css", "js/ux/codemirror/css/csscolors.css"];
- }
-
- if( this.parser == 'php' ) {
- this.parserFile = ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js",
- "../contrib/php/js/tokenizephp.js", "../contrib/php/js/parsephp.js",
- "../contrib/php/js/parsephphtmlmixed.js"];
- this.parserStylesheet = ["js/ux/codemirror/css/xmlcolors.css", "js/ux/codemirror/css/jscolors.css", "js/ux/codemirror/css/csscolors.css", "js/ux/codemirror/contrib/php/css/phpcolors.css"];
- }
- },
- onRender : function(ct, position){
- Ext.ux.CodeMirror.superclass.onRender.apply(this, [ct, position]);
- },
-
- resize: function() {
- this.mirror.frame.style.height = this.ownerCt.lastSize.height - 85 +"px";
- this.mirror.frame.style.width = this.ownerCt.lastSize.width - 35 +"px";
- },
-
- onInit: function(t, cmId) {
-
- var cmp = Ext.getCmp(cmId),
- mirror = cmp.mirror;
-
- cmp.ownerCt.fireEvent('resize');
-
- // Fire the initialize event
- cmp.fireEvent('initialize');
- cmp.initialised = true;
-
- // Value used to monitor the state of this document (changed or not)
- cmp.documentDurty = false;
-
- // Attach some others events
- mirror.editor.keyUp = function(e) {
-
- // On envoie cursormove
- var r = mirror.cursorPosition(),
- line = mirror.lineNumber(r.line),
- caracter = r.character;
- cmp.fireEvent('cursormove', line, caracter);
-
- // We check if the code has changed or not
- cmp.manageCodeChange(cmId);
- }
-
- Ext.EventManager.addListener(mirror.frame.contentWindow, "scroll", function(e){ cmp.monitorScroll(e, cmp); }, this);
-
- },
-
- manageCodeChange: function(cmId) {
-
- var cmp = Ext.getCmp(cmId),
- mirror = cmp.mirror;
-
-
- var originalContent = mirror.originalContent,
- currentContent = mirror.getCode();
-
- // If originalContent is false, the editor is not ready
- if( originalContent ) {
- if( originalContent === currentContent ) {
- if( cmp.documentDurty === true ) {
- cmp.fireEvent('coderestored');
- cmp.documentDurty = false;
- }
-
- } else {
- cmp.ownerCt.topToolbar.items.items[3].enable();
- if( cmp.documentDurty === false ) {
- cmp.fireEvent('codemodified');
- cmp.documentDurty = true;
- }
- }
-
- }
-
- },
-
- saveFunction: function(cmId) {
-
- var cmp = Ext.getCmp(cmId);
-
- var saveBtn = cmp.ownerCt.topToolbar.items.items[0];
- if( ! saveBtn.disabled ) {
- saveBtn.handler.call(saveBtn.scope || saveBtn, saveBtn);
- }
-
- },
-
- monitorScroll: function(e, cmp) {
- cmp.fireEvent('scroll',e.target.body.scrollTop, this);
- },
-
- afterRender: function() {
- this.mirror = new CodeMirror(CodeMirror.replace(Ext.get(this.id).dom), {
- textWrapping : false,
- saveFunction : this.saveFunction,
- width : '100%',
- height : this.ownerCt.lastSize.height,
- readOnly : this.readOnly,
- content : this.value,
- originalContent : false,
- parserfile : this.parserFile,
- parserConfig : {alignCDATA: true, useHTMLKludges: false},
- indentUnit : 1,
- cmId : this.id,
- lineNumbers : true,
- continuousScanning : (this.readOnly) ? false : 500,
- stylesheet : this.parserStylesheet,
- path : "js/ux/codemirror/js/",
- initCallback : this.onInit,
- autoMatchParens : true,
- disableSpellcheck : false,
- onChange : this.manageCodeChange
- });
-
- this.ownerCt.on('resize', function(ct, adjW, adjH, rawW, rawH) {
- this.resize();
- }, this);
-
- },
-
- getCode: function() {
- return this.mirror.getCode();
- },
-
- setCode: function(code) {
- if( !this.initialised ) {
- var wait = new Ext.util.DelayedTask(function() { this.setCode(code); }, this );
- wait.delay(500);
- } else {
- this.mirror.setCode(code);
- this.mirror.originalContent = code;
- }
- },
-
- reIndentAll : function() {
- this.mirror.reindent();
- },
-
- undo : function(cmp) {
-
- this.mirror.undo();
-
- // Enable the Redo btn
- cmp.topToolbar.items.items[4].enable();
-
- // Is there more undo history ? If not, we disable this btn
- if( ! this.mirror.editor.history.history.length ) {
- cmp.topToolbar.items.items[3].disable();
- }
- },
-
- redo : function(cmp) {
-
- this.mirror.redo();
-
- // Enable the undo btn
- cmp.topToolbar.items.items[3].enable();
-
- // Is there more redo history ? If not, we disable this btn
- if( ! this.mirror.editor.history.redoHistory.length ) {
- cmp.topToolbar.items.items[4].disable();
- }
- },
-
- insertIntoLine : function(line, position, text) {
- var lineObj = this.mirror.nthLine(line);
- this.mirror.insertIntoLine(lineObj, position, text);
- },
-
- scrollTo : function(scrollY) {
- this.mirror.frame.contentWindow.document.body.scrollTop = scrollY;
- },
-
- focus: function() {
- this.mirror.focus();
- },
-
- setOriginalCode : function() {
- this.mirror.originalContent = this.getCode();
- this.documentDurty = false;
- },
-
- getCursorPosition : function() {
- var r = this.mirror.cursorPosition(),
- line = this.mirror.lineNumber(r.line),
- caracter = r.character;
-
- return '{line:'+line+', caracter:'+caracter+'}';
- },
-
- nthLine : function(number) {
- return this.mirror.nthLine(number);
- }
-
-});
-Ext.reg('codemirror', Ext.ux.CodeMirror);
Deleted: web/doc-editor/trunk/js/ux/Ext.ux.WindowDrawer.js
===================================================================
--- web/doc-editor/trunk/js/ux/Ext.ux.WindowDrawer.js 2009-12-26 18:13:48 UTC (rev 292660)
+++ web/doc-editor/trunk/js/ux/Ext.ux.WindowDrawer.js 2009-12-26 18:18:57 UTC (rev 292661)
@@ -1,298 +0,0 @@
-/*
- Author : Jay Garcia
- Site : http://tdg-i.com
- Contact Info : [email protected]
- Purpose : Window Drawers for Ext 2.x Ext.Window class, which emulates OS X behaviors
- Contributors : Mystix, http://extjs.com/forum/member.php?u=1459
- Hendricd, http://extjs.com/forum/member.php?u=8730
-
- Warranty : none
- Price : free
- Version : ??? IT'S UP TO JAY TO DECIDE =)
- Date : ???
- */
-
-// Need to override the Window DnD to allow events to fire.
-Ext.override(Ext.Window.DD, {
- // private - used for dragging
- startDrag : function() {
- var w = this.win;
- w.fireEvent('ghost', []);
- this.proxy = w.ghost();
- if (w.constrain !== false) {
- var so = w.el.shadowOffset;
- this.constrainTo(w.container, {right: so, left: so, bottom: so});
- } else if (w.constrainHeader !== false) {
- var s = this.proxy.getSize();
- this.constrainTo(w.container, {right: -(s.width - this.headerOffsets[0]), bottom: -(s.height - this.headerOffsets[1])});
- }
- }
-});
-
-
-// Need to override the Window class to allow events to fire for front and back movement.
-Ext.override(Ext.Window, {
- setZIndex : function(index) {
- var newZIndex = ++index;
-
- if (this.modal) {
- this.mask.setStyle("z-index", index);
- }
-
- this.el.setZIndex(newZIndex);
- index += 5;
-
- if (this.resizer) {
- this.resizer.proxy.setStyle("z-index", ++index);
- }
- if (newZIndex > this.lastZIndex) {
- this.fireEvent('tofront', this);
- } else {
- this.fireEvent('toback', this);
- }
- this.lastZIndex = index;
- }
-});
-
-// Drawer Base Class
-Ext.ux.plugins.WindowDrawer = Ext.extend(Ext.Window, {
- closable : false,
- resizable : false,
-
- show : function(skipAnim, cb, scope) {
- if (this.hidden && this.fireEvent("beforeshow", this) !== false) {
- this.hidden = false;
- this.onBeforeShow();
- this.afterShow(!!skipAnim, cb, scope);
- }
- },
-
- hide : function(skipAnim, cb, scope) {
- if (this.hidden) {
- return;
- }
-
- if (this.animate === true && !skipAnim) {
- if (this.el.shadow) { // honour WindowDrawer's "shadow" config
- this.el.disableShadow();
- }
-
- this.el.slideOut(this.alignToParams.slideDirection, {
- scope : this,
- duration : this.animDuration || .25,
- callback : function() {
- this.el.removeClass('x-panel-animated');
-
- if (typeof cb == 'function') {
- cb.call(scope || this);
- }
- }
- });
- } else {
- Ext.ux.plugins.WindowDrawer.superclass.hide.call(this, null, cb, scope);
- }
-
- // REQUIRED!!!
- this.hidden = true;
- },
-
- // private
- init : function(parent) {
- this.win = parent;
- this.resizeHandles = this.side; // allow resizing only on 1 side (if resizing is allowed)
- this.shim = parent.shim; // shim the kids too (modification by @hendricd -- http://extjs.com/forum/showthread.php?p=281140#post281140)
-
- parent.drawers = parent.drawers || {};
- parent.drawers[this.side] = this; // add this WindowDrawer to the parent's drawer collection
- parent.on({
- scope : this,
- tofront : this.onBeforeShow,
- toback : this.onBeforeShow,
- ghost : this.onBeforeResize,
- move : this.alignAndShow,
- resize : this.alignAndShow,
- destroy : this.destroy,
-
- // modifications by @hendricd -- http://extjs.com/forum/showthread.php?p=281140#post281140
- render : function(p) {
- // render WindowDrawer to parent's container, if available
- this.render(p.el.parent());
- },
- beforecollapse : function() {
- if (!this.hidden) {
- this.wasVisible = true;
- this.hide(true);
- }
- },
- expand : function() {
- if (this.showAgain = this.wasVisible) {
- this.alignAndShow();
- }
- },
- beforehide: function() {
- this.wasVisible = !this.hidden;
- this.hide(true);
- }
- });
- },
-
- // private
- initComponent : function() {
- Ext.apply(this, {
- frame : true,
- draggable : false,
- modal : false,
- closeAction : 'hide',
- alignToParams : {}
- });
-
- this.on({
- scope : this,
- beforeshow : this.onBeforeShow,
- beforehide : this.onBeforeHide
- });
-
- if (this.size) {
- if (this.side == 'e' || this.side == 'w') {
- this.width = this.size;
- } else {
- this.height = this.size;
- }
- }
-
- Ext.ux.plugins.WindowDrawer.superclass.initComponent.call(this);
-
- },
-
- // private
- onBeforeResize : function() {
- if (!this.hidden) {
- this.showAgain = true;
- }
- this.hide(true);
- },
-
- // private
- onBeforeHide : function() {
- if (this.animate) {
- this.getEl().addClass('x-panel-animated');
- }
- },
-
-
- // private
- onBeforeShow : function() {
- if (this.animate) {
- this.el.addClass('x-panel-animated');
- }
- this.setAlignment();
- this.setZIndex(this.win.el.getZIndex() - 3);
- },
-
- // private
- afterShow : function(skipAnim, cb, scope) {
- if (this.animate && !skipAnim) {
- this.el.slideIn(this.alignToParams.slideDirection, {
- scope : this,
- duration : this.animDuration || .25,
- callback : function() {
- this.el.removeClass('x-panel-animated');
-
- if (this.el.shadow) { // honour WindowDrawer's "shadow" config
- // re-enable shadows after animation
- this.el.enableShadow(true);
- }
-
- // REQUIRED!!
- this.el.show(); // somehow forces the shadow to appear
-
- if (typeof cb == 'function') {
- cb.call(scope || this);
- }
- }
- });
- } else {
- Ext.ux.plugins.WindowDrawer.superclass.afterShow.call(this);
-
- if (typeof cb == 'function') {
- cb.call(scope || this);
- }
- }
-
- // modification by @hendricd -- http://extjs.com/forum/showthread.php?p=281140#post281140
- this.wasVisible = true;
- },
-
- // private
- alignAndShow : function() {
- this.setAlignment();
-
- if (this.showAgain) {
- this.show(true);
- }
- this.showAgain = false;
- },
-
- // private
- setAlignment: function() {
- switch(this.side) {
- case 'n' :
- this.setWidth(this.win.el.getWidth() - 10);
- Ext.apply(this.alignToParams, {
- alignTo : 'tl',
- alignToXY : [5, (this.el.getComputedHeight() * -1) + 5],
- slideDirection : 'b'
- });
- break;
-
- case 's' :
- this.setWidth(this.win.el.getWidth() - 10);
- Ext.apply(this.alignToParams, {
- alignTo : 'bl',
- alignToXY : [5, (Ext.isIE6)? -2 : -7],
- slideDirection : 't'
- });
- break;
-
- case 'e' :
- this.setHeight(this.win.el.getHeight() - 10);
- Ext.apply(this.alignToParams, {
- alignTo : 'tr',
- alignToXY : [-5, 5],
- slideDirection : 'l'
- });
- break;
-
- case 'w' :
- this.setHeight(this.win.el.getHeight() - 10);
- Ext.apply(this.alignToParams, {
- alignTo : 'tl',
- alignToXY : [(this.el.getComputedWidth() * -1) + 5, 5],
- slideDirection : 'r'
- });
- break;
- }
-
- if (!this.hidden) {
- this.el.alignTo(this.win.el, this.alignToParams.alignTo, this.alignToParams.alignToXY);
-
- // Simple fix for IE, where the bwrap doesn't properly resize.
- if (Ext.isIE) {
- this.bwrap.hide();
- this.bwrap.show();
- }
- }
-
- // force doLayout()
- this.doLayout();
- },
-
-
- // private
- toFront: function() {
- this.win.toFront(); // first bring WindowDrawer's parent to the front
- return this;
- }
-});
-
-Ext.reg('windowdrawer', Ext.ux.plugins.WindowDrawer);
\ No newline at end of file
Added: web/doc-editor/trunk/js/ux/others/login_specific/Ext.ux.IconCombo.css
===================================================================
--- web/doc-editor/trunk/js/ux/others/login_specific/Ext.ux.IconCombo.css (rev 0)
+++ web/doc-editor/trunk/js/ux/others/login_specific/Ext.ux.IconCombo.css 2009-12-26 18:18:57 UTC (rev 292661)
@@ -0,0 +1,16 @@
+/*
+* Css for the IconCombo Ux
+*
+*/
+
+.ux-icon-combo-input {
+ padding-left: 25px !important;
+}
+
+.ux-icon-combo-value {
+ padding-left: 22px !important;
+}
+
+.ux-icon-combo-item {
+ padding-left: 3px !important;
+}
\ No newline at end of file
Added: web/doc-editor/trunk/js/ux/others/login_specific/Ext.ux.IconCombo.js
===================================================================
--- web/doc-editor/trunk/js/ux/others/login_specific/Ext.ux.IconCombo.js (rev 0)
+++ web/doc-editor/trunk/js/ux/others/login_specific/Ext.ux.IconCombo.js 2009-12-26 18:18:57 UTC (rev 292661)
@@ -0,0 +1,60 @@
+// create namespace for plugins
+Ext.namespace('Ext.ux.plugins');
+
+/**
+ * Ext.ux.IconCombo Extension Class for Ext 2.x Library
+ *
+ * @author Ing. Jozef Sakalos
+ * @version $Id: Ext.ux.IconCombo.js 617 2007-12-20 11:29:56Z jozo $
+ *
+ * @class Ext.ux.IconCombo
+ * @extends Ext.form.ComboBox
+ */
+
+Ext.ux.IconCombo = Ext.extend(Ext.form.ComboBox, {
+ initComponent:function() {
+
+ Ext.apply(this, {
+ tpl: '<tpl for=".">'
+ + '<div class="x-combo-list-item ux-icon-combo-item">'
+ + '<div class="flags {' + this.iconClsField + '}" style="position:absolute"></div>'
+ + '<div class="ux-icon-combo-value">{' + this.displayField + '}</div>'
+ + '</div></tpl>'
+ });
+
+ // call parent initComponent
+ Ext.ux.IconCombo.superclass.initComponent.call(this);
+
+ }, // end of function initComponent
+
+ onRender:function(ct, position) {
+ // call parent onRender
+ Ext.ux.IconCombo.superclass.onRender.call(this, ct, position);
+
+ // adjust styles
+ this.wrap.applyStyles({position:'relative'});
+ this.el.addClass('ux-icon-combo-input');
+
+ // add div for icon
+ this.icon = Ext.DomHelper.append(this.el.up('div.x-form-field-wrap'), {
+ tag: 'div', style:'position:absolute'
+ });
+
+ }, // end of function onRender
+
+ setIconCls:function() {
+ var rec = this.store.query(this.valueField, this.getValue()).itemAt(0);
+ if(rec) {
+ this.icon.className = 'flags ' + rec.get(this.iconClsField);
+ }
+ }, // end of function setIconCls
+
+ setValue: function(value) {
+ Ext.ux.IconCombo.superclass.setValue.call(this, value);
+ this.setIconCls();
+ } // end of function setValue
+});
+
+// register xtype
+Ext.reg('iconcombo', Ext.ux.IconCombo);
+
Copied: web/doc-editor/trunk/js/ux/others/main_specific/Ext.util.md5.js (from rev 292400, web/doc-editor/trunk/js/ux/md5/md5.js)
===================================================================
--- web/doc-editor/trunk/js/ux/others/main_specific/Ext.util.md5.js (rev 0)
+++ web/doc-editor/trunk/js/ux/others/main_specific/Ext.util.md5.js 2009-12-26 18:18:57 UTC (rev 292661)
@@ -0,0 +1,138 @@
+Ext.util.md5 = function(s,r,hexcase,chrsz) {
+ r= (typeof r=="undefined" ? false:r);
+ hexcase= (typeof hexcase=="undefined" ? false:hexcase);
+ chrsz= (typeof chrsz=="undefined" ? 8:chrsz);
+
+ function safe_add(x, y){
+ var lsw = (x & 0xFFFF) + (y & 0xFFFF);
+ var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+ return (msw << 16) | (lsw & 0xFFFF);
+ }
+ function bit_rol(num, cnt){
+ return (num << cnt) | (num >>> (32 - cnt));
+ }
+ function md5_cmn(q, a, b, x, s, t){
+ return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
+ }
+ function md5_ff(a, b, c, d, x, s, t){
+ return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
+ }
+ function md5_gg(a, b, c, d, x, s, t){
+ return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
+ }
+ function md5_hh(a, b, c, d, x, s, t){
+ return md5_cmn(b ^ c ^ d, a, b, x, s, t);
+ }
+ function md5_ii(a, b, c, d, x, s, t){
+ return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
+ }
+
+ function core_md5(x, len){
+ x[len >> 5] |= 0x80 << ((len) % 32);
+ x[(((len + 64) >>> 9) << 4) + 14] = len;
+ var a = 1732584193;
+ var b = -271733879;
+ var c = -1732584194;
+ var d = 271733878;
+ for(var i = 0; i < x.length; i += 16){
+ var olda = a;
+ var oldb = b;
+ var oldc = c;
+ var oldd = d;
+ a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
+ d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
+ c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
+ b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
+ a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
+ d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
+ c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
+ b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
+ a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
+ d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
+ c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
+ b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
+ a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
+ d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
+ c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
+ b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
+ a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
+ d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
+ c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
+ b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
+ a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
+ d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
+ c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
+ b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
+ a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
+ d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
+ c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
+ b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
+ a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
+ d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
+ c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
+ b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
+ a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
+ d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
+ c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
+ b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
+ a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
+ d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
+ c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
+ b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
+ a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
+ d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
+ c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
+ b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
+ a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
+ d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
+ c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
+ b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
+ a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
+ d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
+ c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
+ b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
+ a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
+ d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
+ c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
+ b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
+ a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
+ d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
+ c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
+ b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
+ a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
+ d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
+ c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
+ b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
+ a = safe_add(a, olda);
+ b = safe_add(b, oldb);
+ c = safe_add(c, oldc);
+ d = safe_add(d, oldd);
+ }
+ return [a, b, c, d];
+ }
+ function str2binl(str){
+ var bin = [];
+ var mask = (1 << chrsz) - 1;
+ for(var i = 0; i < str.length * chrsz; i += chrsz) {
+ bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
+ }
+ return bin;
+ }
+ function binl2str(bin){
+ var str = "";
+ var mask = (1 << chrsz) - 1;
+ for(var i = 0; i < bin.length * 32; i += chrsz) {
+ str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
+ }
+ return str;
+ }
+ function binl2hex(binarray){
+ var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
+ var str = "";
+ for(var i = 0; i < binarray.length * 4; i++) {
+ str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) + hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);
+ }
+ return str;
+ }
+ return (r ? binl2str(core_md5(str2binl(s), s.length * chrsz)) : binl2hex(core_md5(str2binl(s), s.length * chrsz)));
+};
\ No newline at end of file
Copied: web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.CodeMirror.js (from rev 292626, web/doc-editor/trunk/js/ux/Ext.ux.CodeMirror.js)
===================================================================
--- web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.CodeMirror.js (rev 0)
+++ web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.CodeMirror.js 2009-12-26 18:18:57 UTC (rev 292661)
@@ -0,0 +1,231 @@
+Ext.ux.CodeMirror = Ext.extend(Ext.BoxComponent, {
+
+ readOnly : (this.readOnly) ? this.readOnly : false,
+ width : 'auto',
+ height : 'auto',
+ autoResize : true,
+ initialised : false,
+ documentDurty : false,
+ parser : (this.parser) ? this.parser : "xml",
+ parserFile : "parsexml.js",
+ parserStylesheet : "js/ux/codemirror/css/xmlcolors.css",
+
+ initComponent : function() {
+
+ Ext.ux.CodeMirror.superclass.initComponent.apply(this);
+
+ this.addEvents({
+ initialize : true,
+ codemodified : true,
+ coderestored : true,
+ cursormove : true,
+ scroll : true
+ });
+
+ //For the parser
+ if( this.parser == 'xml' ) {
+ this.parserFile = "parsexml.js";
+ this.parserStylesheet = "js/ux/codemirror/css/xmlcolors.css";
+ }
+
+ if( this.parser == 'html' ) {
+ this.parserFile = ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "parsehtmlmixed.js"];
+ this.parserStylesheet = ["js/ux/codemirror/css/xmlcolors.css", "js/ux/codemirror/css/jscolors.css", "js/ux/codemirror/css/csscolors.css"];
+ }
+
+ if( this.parser == 'php' ) {
+ this.parserFile = ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js",
+ "../contrib/php/js/tokenizephp.js", "../contrib/php/js/parsephp.js",
+ "../contrib/php/js/parsephphtmlmixed.js"];
+ this.parserStylesheet = ["js/ux/codemirror/css/xmlcolors.css", "js/ux/codemirror/css/jscolors.css", "js/ux/codemirror/css/csscolors.css", "js/ux/codemirror/contrib/php/css/phpcolors.css"];
+ }
+ },
+ onRender : function(ct, position){
+ Ext.ux.CodeMirror.superclass.onRender.apply(this, [ct, position]);
+ },
+
+ resize: function() {
+ this.mirror.frame.style.height = this.ownerCt.lastSize.height - 85 +"px";
+ this.mirror.frame.style.width = this.ownerCt.lastSize.width - 35 +"px";
+ },
+
+ onInit: function(t, cmId) {
+
+ var cmp = Ext.getCmp(cmId),
+ mirror = cmp.mirror;
+
+ cmp.ownerCt.fireEvent('resize');
+
+ // Fire the initialize event
+ cmp.fireEvent('initialize');
+ cmp.initialised = true;
+
+ // Value used to monitor the state of this document (changed or not)
+ cmp.documentDurty = false;
+
+ // Attach some others events
+ mirror.editor.keyUp = function(e) {
+
+ // On envoie cursormove
+ var r = mirror.cursorPosition(),
+ line = mirror.lineNumber(r.line),
+ caracter = r.character;
+ cmp.fireEvent('cursormove', line, caracter);
+
+ // We check if the code has changed or not
+ cmp.manageCodeChange(cmId);
+ }
+
+ Ext.EventManager.addListener(mirror.frame.contentWindow, "scroll", function(e){ cmp.monitorScroll(e, cmp); }, this);
+
+ },
+
+ manageCodeChange: function(cmId) {
+
+ var cmp = Ext.getCmp(cmId),
+ mirror = cmp.mirror;
+
+
+ var originalContent = mirror.originalContent,
+ currentContent = mirror.getCode();
+
+ // If originalContent is false, the editor is not ready
+ if( originalContent ) {
+ if( originalContent === currentContent ) {
+ if( cmp.documentDurty === true ) {
+ cmp.fireEvent('coderestored');
+ cmp.documentDurty = false;
+ }
+
+ } else {
+ cmp.ownerCt.topToolbar.items.items[3].enable();
+ if( cmp.documentDurty === false ) {
+ cmp.fireEvent('codemodified');
+ cmp.documentDurty = true;
+ }
+ }
+
+ }
+
+ },
+
+ saveFunction: function(cmId) {
+
+ var cmp = Ext.getCmp(cmId);
+
+ var saveBtn = cmp.ownerCt.topToolbar.items.items[0];
+ if( ! saveBtn.disabled ) {
+ saveBtn.handler.call(saveBtn.scope || saveBtn, saveBtn);
+ }
+
+ },
+
+ monitorScroll: function(e, cmp) {
+ cmp.fireEvent('scroll',e.target.body.scrollTop, this);
+ },
+
+ afterRender: function() {
+ this.mirror = new CodeMirror(CodeMirror.replace(Ext.get(this.id).dom), {
+ textWrapping : false,
+ saveFunction : this.saveFunction,
+ width : '100%',
+ height : this.ownerCt.lastSize.height,
+ readOnly : this.readOnly,
+ content : this.value,
+ originalContent : false,
+ parserfile : this.parserFile,
+ parserConfig : {alignCDATA: true, useHTMLKludges: false},
+ indentUnit : 1,
+ cmId : this.id,
+ lineNumbers : true,
+ continuousScanning : (this.readOnly) ? false : 500,
+ stylesheet : this.parserStylesheet,
+ path : "js/ux/codemirror/js/",
+ initCallback : this.onInit,
+ autoMatchParens : true,
+ disableSpellcheck : false,
+ onChange : this.manageCodeChange
+ });
+
+ this.ownerCt.on('resize', function(ct, adjW, adjH, rawW, rawH) {
+ this.resize();
+ }, this);
+
+ },
+
+ getCode: function() {
+ return this.mirror.getCode();
+ },
+
+ setCode: function(code) {
+ if( !this.initialised ) {
+ var wait = new Ext.util.DelayedTask(function() { this.setCode(code); }, this );
+ wait.delay(500);
+ } else {
+ this.mirror.setCode(code);
+ this.mirror.originalContent = code;
+ }
+ },
+
+ reIndentAll : function() {
+ this.mirror.reindent();
+ },
+
+ undo : function(cmp) {
+
+ this.mirror.undo();
+
+ // Enable the Redo btn
+ cmp.topToolbar.items.items[4].enable();
+
+ // Is there more undo history ? If not, we disable this btn
+ if( ! this.mirror.editor.history.history.length ) {
+ cmp.topToolbar.items.items[3].disable();
+ }
+ },
+
+ redo : function(cmp) {
+
+ this.mirror.redo();
+
+ // Enable the undo btn
+ cmp.topToolbar.items.items[3].enable();
+
+ // Is there more redo history ? If not, we disable this btn
+ if( ! this.mirror.editor.history.redoHistory.length ) {
+ cmp.topToolbar.items.items[4].disable();
+ }
+ },
+
+ insertIntoLine : function(line, position, text) {
+ var lineObj = this.mirror.nthLine(line);
+ this.mirror.insertIntoLine(lineObj, position, text);
+ },
+
+ scrollTo : function(scrollY) {
+ this.mirror.frame.contentWindow.document.body.scrollTop = scrollY;
+ },
+
+ focus: function() {
+ this.mirror.focus();
+ },
+
+ setOriginalCode : function() {
+ this.mirror.originalContent = this.getCode();
+ this.documentDurty = false;
+ },
+
+ getCursorPosition : function() {
+ var r = this.mirror.cursorPosition(),
+ line = this.mirror.lineNumber(r.line),
+ caracter = r.character;
+
+ return '{line:'+line+', caracter:'+caracter+'}';
+ },
+
+ nthLine : function(number) {
+ return this.mirror.nthLine(number);
+ }
+
+});
+Ext.reg('codemirror', Ext.ux.CodeMirror);
Copied: web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.Notification.js (from rev 292580, web/doc-editor/trunk/js/ux/Notification/Ext.ux.Notification.js)
===================================================================
--- web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.Notification.js (rev 0)
+++ web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.Notification.js 2009-12-26 18:18:57 UTC (rev 292661)
@@ -0,0 +1,91 @@
+/**
+ * Ext.ux.ToastWindow
+ *
+ * @author Edouard Fattal
+ * @date March 14, 2008
+ *
+ * @class Ext.ux.ToastWindow
+ * @extends Ext.Window
+ */
+
+Ext.namespace("Ext.ux");
+
+
+Ext.ux.NotificationMgr = {
+ positions: []
+};
+
+Ext.ux.Notification = Ext.extend(Ext.Window, {
+ initComponent: function(){
+ Ext.apply(this, {
+ iconCls: this.iconCls || 'x-icon-information',
+ cls: 'x-notification',
+ width: 250,
+ autoHeight: true,
+ //plain: false,
+ draggable: false,
+ bodyStyle: 'text-align:center; padding: 10px;'
+ });
+ if(this.autoDestroy) {
+ this.task = new Ext.util.DelayedTask(this.hide, this);
+ } else {
+ this.closable = true;
+ }
+ Ext.ux.Notification.superclass.initComponent.call(this);
+ },
+ setMessage: function(msg){
+ this.body.update(msg);
+ },
+ setTitle: function(title, iconCls){
+ Ext.ux.Notification.superclass.setTitle.call(this, title, iconCls||this.iconCls);
+ },
+ onRender:function(ct, position) {
+ Ext.ux.Notification.superclass.onRender.call(this, ct, position);
+ },
+ onDestroy: function(){
+ Ext.ux.NotificationMgr.positions.remove(this.pos);
+ Ext.ux.Notification.superclass.onDestroy.call(this);
+ },
+ cancelHiding: function(){
+ this.addClass('fixed');
+ if(this.autoDestroy) {
+ this.task.cancel();
+ }
+ },
+ afterShow: function(){
+ Ext.ux.Notification.superclass.afterShow.call(this);
+ Ext.fly(this.body.dom).on('click', this.cancelHiding, this);
+ if(this.autoDestroy) {
+ this.task.delay(this.hideDelay || 5000);
+ }
+ },
+ animShow: function(){
+ this.pos = 0;
+ while(Ext.ux.NotificationMgr.positions.indexOf(this.pos)>-1)
+ this.pos++;
+ Ext.ux.NotificationMgr.positions.push(this.pos);
+ this.setSize(200,100);
+ this.el.alignTo(document, "br-br", [ -20, -20-((this.getSize().height+10)*this.pos) ]);
+ this.el.slideIn('b', {
+ duration: 1,
+ callback: this.afterShow,
+ scope: this
+ });
+ },
+ animHide: function(){
+ Ext.ux.NotificationMgr.positions.remove(this.pos);
+ this.el.shadow.hide();
+ this.el.ghost("b", {
+ duration: 1,
+ remove: false,
+ callback : function () {
+ Ext.ux.NotificationMgr.positions.remove(this.pos);
+ this.destroy();
+ }.createDelegate(this)
+
+ });
+ },
+
+ focus: Ext.emptyFn
+
+});
Copied: web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.WindowDrawer.js (from rev 292400, web/doc-editor/trunk/js/ux/Ext.ux.WindowDrawer.js)
===================================================================
--- web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.WindowDrawer.js (rev 0)
+++ web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.WindowDrawer.js 2009-12-26 18:18:57 UTC (rev 292661)
@@ -0,0 +1,298 @@
+/*
+ Author : Jay Garcia
+ Site : http://tdg-i.com
+ Contact Info : [email protected]
+ Purpose : Window Drawers for Ext 2.x Ext.Window class, which emulates OS X behaviors
+ Contributors : Mystix, http://extjs.com/forum/member.php?u=1459
+ Hendricd, http://extjs.com/forum/member.php?u=8730
+
+ Warranty : none
+ Price : free
+ Version : ??? IT'S UP TO JAY TO DECIDE =)
+ Date : ???
+ */
+
+// Need to override the Window DnD to allow events to fire.
+Ext.override(Ext.Window.DD, {
+ // private - used for dragging
+ startDrag : function() {
+ var w = this.win;
+ w.fireEvent('ghost', []);
+ this.proxy = w.ghost();
+ if (w.constrain !== false) {
+ var so = w.el.shadowOffset;
+ this.constrainTo(w.container, {right: so, left: so, bottom: so});
+ } else if (w.constrainHeader !== false) {
+ var s = this.proxy.getSize();
+ this.constrainTo(w.container, {right: -(s.width - this.headerOffsets[0]), bottom: -(s.height - this.headerOffsets[1])});
+ }
+ }
+});
+
+
+// Need to override the Window class to allow events to fire for front and back movement.
+Ext.override(Ext.Window, {
+ setZIndex : function(index) {
+ var newZIndex = ++index;
+
+ if (this.modal) {
+ this.mask.setStyle("z-index", index);
+ }
+
+ this.el.setZIndex(newZIndex);
+ index += 5;
+
+ if (this.resizer) {
+ this.resizer.proxy.setStyle("z-index", ++index);
+ }
+ if (newZIndex > this.lastZIndex) {
+ this.fireEvent('tofront', this);
+ } else {
+ this.fireEvent('toback', this);
+ }
+ this.lastZIndex = index;
+ }
+});
+
+// Drawer Base Class
+Ext.ux.plugins.WindowDrawer = Ext.extend(Ext.Window, {
+ closable : false,
+ resizable : false,
+
+ show : function(skipAnim, cb, scope) {
+ if (this.hidden && this.fireEvent("beforeshow", this) !== false) {
+ this.hidden = false;
+ this.onBeforeShow();
+ this.afterShow(!!skipAnim, cb, scope);
+ }
+ },
+
+ hide : function(skipAnim, cb, scope) {
+ if (this.hidden) {
+ return;
+ }
+
+ if (this.animate === true && !skipAnim) {
+ if (this.el.shadow) { // honour WindowDrawer's "shadow" config
+ this.el.disableShadow();
+ }
+
+ this.el.slideOut(this.alignToParams.slideDirection, {
+ scope : this,
+ duration : this.animDuration || .25,
+ callback : function() {
+ this.el.removeClass('x-panel-animated');
+
+ if (typeof cb == 'function') {
+ cb.call(scope || this);
+ }
+ }
+ });
+ } else {
+ Ext.ux.plugins.WindowDrawer.superclass.hide.call(this, null, cb, scope);
+ }
+
+ // REQUIRED!!!
+ this.hidden = true;
+ },
+
+ // private
+ init : function(parent) {
+ this.win = parent;
+ this.resizeHandles = this.side; // allow resizing only on 1 side (if resizing is allowed)
+ this.shim = parent.shim; // shim the kids too (modification by @hendricd -- http://extjs.com/forum/showthread.php?p=281140#post281140)
+
+ parent.drawers = parent.drawers || {};
+ parent.drawers[this.side] = this; // add this WindowDrawer to the parent's drawer collection
+ parent.on({
+ scope : this,
+ tofront : this.onBeforeShow,
+ toback : this.onBeforeShow,
+ ghost : this.onBeforeResize,
+ move : this.alignAndShow,
+ resize : this.alignAndShow,
+ destroy : this.destroy,
+
+ // modifications by @hendricd -- http://extjs.com/forum/showthread.php?p=281140#post281140
+ render : function(p) {
+ // render WindowDrawer to parent's container, if available
+ this.render(p.el.parent());
+ },
+ beforecollapse : function() {
+ if (!this.hidden) {
+ this.wasVisible = true;
+ this.hide(true);
+ }
+ },
+ expand : function() {
+ if (this.showAgain = this.wasVisible) {
+ this.alignAndShow();
+ }
+ },
+ beforehide: function() {
+ this.wasVisible = !this.hidden;
+ this.hide(true);
+ }
+ });
+ },
+
+ // private
+ initComponent : function() {
+ Ext.apply(this, {
+ frame : true,
+ draggable : false,
+ modal : false,
+ closeAction : 'hide',
+ alignToParams : {}
+ });
+
+ this.on({
+ scope : this,
+ beforeshow : this.onBeforeShow,
+ beforehide : this.onBeforeHide
+ });
+
+ if (this.size) {
+ if (this.side == 'e' || this.side == 'w') {
+ this.width = this.size;
+ } else {
+ this.height = this.size;
+ }
+ }
+
+ Ext.ux.plugins.WindowDrawer.superclass.initComponent.call(this);
+
+ },
+
+ // private
+ onBeforeResize : function() {
+ if (!this.hidden) {
+ this.showAgain = true;
+ }
+ this.hide(true);
+ },
+
+ // private
+ onBeforeHide : function() {
+ if (this.animate) {
+ this.getEl().addClass('x-panel-animated');
+ }
+ },
+
+
+ // private
+ onBeforeShow : function() {
+ if (this.animate) {
+ this.el.addClass('x-panel-animated');
+ }
+ this.setAlignment();
+ this.setZIndex(this.win.el.getZIndex() - 3);
+ },
+
+ // private
+ afterShow : function(skipAnim, cb, scope) {
+ if (this.animate && !skipAnim) {
+ this.el.slideIn(this.alignToParams.slideDirection, {
+ scope : this,
+ duration : this.animDuration || .25,
+ callback : function() {
+ this.el.removeClass('x-panel-animated');
+
+ if (this.el.shadow) { // honour WindowDrawer's "shadow" config
+ // re-enable shadows after animation
+ this.el.enableShadow(true);
+ }
+
+ // REQUIRED!!
+ this.el.show(); // somehow forces the shadow to appear
+
+ if (typeof cb == 'function') {
+ cb.call(scope || this);
+ }
+ }
+ });
+ } else {
+ Ext.ux.plugins.WindowDrawer.superclass.afterShow.call(this);
+
+ if (typeof cb == 'function') {
+ cb.call(scope || this);
+ }
+ }
+
+ // modification by @hendricd -- http://extjs.com/forum/showthread.php?p=281140#post281140
+ this.wasVisible = true;
+ },
+
+ // private
+ alignAndShow : function() {
+ this.setAlignment();
+
+ if (this.showAgain) {
+ this.show(true);
+ }
+ this.showAgain = false;
+ },
+
+ // private
+ setAlignment: function() {
+ switch(this.side) {
+ case 'n' :
+ this.setWidth(this.win.el.getWidth() - 10);
+ Ext.apply(this.alignToParams, {
+ alignTo : 'tl',
+ alignToXY : [5, (this.el.getComputedHeight() * -1) + 5],
+ slideDirection : 'b'
+ });
+ break;
+
+ case 's' :
+ this.setWidth(this.win.el.getWidth() - 10);
+ Ext.apply(this.alignToParams, {
+ alignTo : 'bl',
+ alignToXY : [5, (Ext.isIE6)? -2 : -7],
+ slideDirection : 't'
+ });
+ break;
+
+ case 'e' :
+ this.setHeight(this.win.el.getHeight() - 10);
+ Ext.apply(this.alignToParams, {
+ alignTo : 'tr',
+ alignToXY : [-5, 5],
+ slideDirection : 'l'
+ });
+ break;
+
+ case 'w' :
+ this.setHeight(this.win.el.getHeight() - 10);
+ Ext.apply(this.alignToParams, {
+ alignTo : 'tl',
+ alignToXY : [(this.el.getComputedWidth() * -1) + 5, 5],
+ slideDirection : 'r'
+ });
+ break;
+ }
+
+ if (!this.hidden) {
+ this.el.alignTo(this.win.el, this.alignToParams.alignTo, this.alignToParams.alignToXY);
+
+ // Simple fix for IE, where the bwrap doesn't properly resize.
+ if (Ext.isIE) {
+ this.bwrap.hide();
+ this.bwrap.show();
+ }
+ }
+
+ // force doLayout()
+ this.doLayout();
+ },
+
+
+ // private
+ toFront: function() {
+ this.win.toFront(); // first bring WindowDrawer's parent to the front
+ return this;
+ }
+});
+
+Ext.reg('windowdrawer', Ext.ux.plugins.WindowDrawer);
\ No newline at end of file
Copied: web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.grid.GridSummary.css (from rev 292400, web/doc-editor/trunk/js/ux/GridSummary/Ext.ux.grid.GridSummary.css)
===================================================================
--- web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.grid.GridSummary.css (rev 0)
+++ web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.grid.GridSummary.css 2009-12-26 18:18:57 UTC (rev 292661)
@@ -0,0 +1,20 @@
+/*
+ * Ext JS Library 2.0
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ * [email protected]
+ *
+ * http://extjs.com/license
+ */
+
+/* [OPTIONAL] -- may be used for either Ext.grid.GroupSummary / Ext.ux.grid.GridSummary plugins */
+.x-grid3-summary-row{border-left:1px solid #fff;border-right:1px solid #fff;color:#333;background:#f1f2f4;}
+.x-grid3-summary-row .x-grid3-cell-inner{font-weight:bold;padding-bottom:4px;}
+.x-grid3-cell-first .x-grid3-cell-inner{padding-left:16px;}
+.x-grid-hide-summary .x-grid3-summary-row{display:none;}
+.x-grid3-summary-msg{padding:4px 16px;font-weight:bold;}
+
+
+/* [REQUIRED] (by Ext.ux.grid.GridSummary plugin) */
+.x-grid3-gridsummary-row-inner{overflow:hidden;width:100%;}/* IE6 requires width:100% for hori. scroll to work */
+.x-grid3-gridsummary-row-offset{width:10000px;}
+.x-grid-hide-gridsummary .x-grid3-gridsummary-row-inner{display:none;}
\ No newline at end of file
Copied: web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.grid.GridSummary.js (from rev 292400, web/doc-editor/trunk/js/ux/GridSummary/Ext.ux.grid.GridSummary.js)
===================================================================
--- web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.grid.GridSummary.js (rev 0)
+++ web/doc-editor/trunk/js/ux/others/main_specific/Ext.ux.grid.GridSummary.js 2009-12-26 18:18:57 UTC (rev 292661)
@@ -0,0 +1,218 @@
+Ext.ns('Ext.ux.grid');
+
+Ext.ux.grid.GridSummary = function(config) {
+ Ext.apply(this, config);
+};
+
+Ext.extend(Ext.ux.grid.GridSummary, Ext.util.Observable, {
+ init : function(grid) {
+ this.grid = grid;
+ this.cm = grid.getColumnModel();
+ this.view = grid.getView();
+
+ var v = this.view;
+
+ // override GridView's onLayout() method
+ v.onLayout = this.onLayout;
+
+ v.afterMethod('render', this.refreshSummary, this);
+ v.afterMethod('refresh', this.refreshSummary, this);
+ v.afterMethod('syncScroll', this.syncSummaryScroll, this);
+ v.afterMethod('onColumnWidthUpdated', this.doWidth, this);
+ v.afterMethod('onAllColumnWidthsUpdated', this.doAllWidths, this);
+ v.afterMethod('onColumnHiddenUpdated', this.doHidden, this);
+
+ // update summary row on store's add/remove/clear/update events
+ grid.store.on({
+ add: this.refreshSummary,
+ remove: this.refreshSummary,
+ clear: this.refreshSummary,
+ update: this.refreshSummary,
+ scope: this
+ });
+
+ if (!this.rowTpl) {
+ this.rowTpl = new Ext.Template(
+ '<div class="x-grid3-summary-row x-grid3-gridsummary-row-offset">',
+ '<table class="x-grid3-summary-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',
+ '<tbody><tr>{cells}</tr></tbody>',
+ '</table>',
+ '</div>'
+ );
+ this.rowTpl.disableFormats = true;
+ }
+ this.rowTpl.compile();
+
+ if (!this.cellTpl) {
+ this.cellTpl = new Ext.Template(
+ '<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}">',
+ '<div class="x-grid3-cell-inner x-grid3-col-{id}" unselectable="on" {attr}>{value}</div>',
+ "</td>"
+ );
+ this.cellTpl.disableFormats = true;
+ }
+ this.cellTpl.compile();
+ },
+
+ calculate : function(rs, cm) {
+ var data = {}, cfg = cm.config;
+ for (var i = 0, len = cfg.length; i < len; i++) { // loop through all columns in ColumnModel
+ var cf = cfg[i], // get column's configuration
+ cname = cf.dataIndex; // get column dataIndex
+
+ // initialise grid summary row data for
+ // the current column being worked on
+ data[cname] = 0;
+
+ if (cf.summaryType) {
+ for (var j = 0, jlen = rs.length; j < jlen; j++) {
+ var r = rs[j]; // get a single Record
+ data[cname] = Ext.ux.grid.GridSummary.Calculations[cf.summaryType](r.get(cname), r, cname, data, j);
+ }
+ }
+ }
+
+ return data;
+ },
+
+ onLayout : function(vw, vh) {
+ if (Ext.type(vh) != 'number') { // handles grid's height:'auto' config
+ return;
+ }
+ // note: this method is scoped to the GridView
+ if (!this.grid.getGridEl().hasClass('x-grid-hide-gridsummary')) {
+ // readjust gridview's height only if grid summary row is visible
+ this.scroller.setHeight(vh - this.summary.getHeight());
+ }
+ },
+
+ syncSummaryScroll : function() {
+ var mb = this.view.scroller.dom;
+
+ this.view.summaryWrap.dom.scrollLeft = mb.scrollLeft;
+ this.view.summaryWrap.dom.scrollLeft = mb.scrollLeft; // second time for IE (1/2 time first fails, other browsers ignore)
+ },
+
+ doWidth : function(col, w, tw) {
+ var s = this.view.summary.dom;
+
+ s.firstChild.style.width = tw;
+ s.firstChild.rows[0].childNodes[col].style.width = w;
+ },
+
+ doAllWidths : function(ws, tw) {
+ var s = this.view.summary.dom, wlen = ws.length;
+
+ s.firstChild.style.width = tw;
+
+ var cells = s.firstChild.rows[0].childNodes;
+
+ for (var j = 0; j < wlen; j++) {
+ cells[j].style.width = ws[j];
+ }
+ },
+
+ doHidden : function(col, hidden, tw) {
+ var s = this.view.summary.dom,
+ display = hidden ? 'none' : '';
+
+ s.firstChild.style.width = tw;
+ s.firstChild.rows[0].childNodes[col].style.display = display;
+ },
+
+ renderSummary : function(o, cs, cm) {
+ cs = cs || this.view.getColumnData();
+ var cfg = cm.config,
+ buf = [],
+ last = cs.length - 1;
+
+ for (var i = 0, len = cs.length; i < len; i++) {
+ var c = cs[i], cf = cfg[i], p = {};
+
+ p.id = c.id;
+ p.style = c.style;
+ p.css = i == 0 ? 'x-grid3-cell-first ' : (i == last ? 'x-grid3-cell-last ' : '');
+
+ if (cf.summaryType || cf.summaryRenderer) {
+ p.value = (cf.summaryRenderer || c.renderer)(o.data[c.name], p, o);
+ } else {
+ p.value = '';
+ }
+ if (p.value == undefined || p.value === "") p.value = " ";
+ buf[buf.length] = this.cellTpl.apply(p);
+ }
+
+ return this.rowTpl.apply({
+ tstyle: 'width:' + this.view.getTotalWidth() + ';',
+ cells: buf.join('')
+ });
+ },
+
+ refreshSummary : function() {
+ var g = this.grid, ds = g.store,
+ cs = this.view.getColumnData(),
+ cm = this.cm,
+ rs = ds.getRange(),
+ data = this.calculate(rs, cm),
+ buf = this.renderSummary({data: data}, cs, cm);
+
+ if (!this.view.summaryWrap) {
+ this.view.summaryWrap = Ext.DomHelper.insertAfter(this.view.scroller, {
+ tag: 'div',
+ cls: 'x-grid3-gridsummary-row-inner'
+ }, true);
+ }
+ this.view.summary = this.view.summaryWrap.update(buf).first();
+ },
+
+ toggleSummary : function(visible) { // true to display summary row
+ var el = this.grid.getGridEl();
+
+ if (el) {
+ if (visible === undefined) {
+ visible = el.hasClass('x-grid-hide-gridsummary');
+ }
+ el[visible ? 'removeClass' : 'addClass']('x-grid-hide-gridsummary');
+
+ this.view.layout(); // readjust gridview height
+ }
+ },
+
+ getSummaryNode : function() {
+ return this.view.summary
+ }
+});
+Ext.reg('gridsummary', Ext.ux.grid.GridSummary);
+
+/*
+ * all Calculation methods are called on each Record in the Store
+ * with the following 5 parameters:
+ *
+ * v - cell value
+ * record - reference to the current Record
+ * colName - column name (i.e. the ColumnModel's dataIndex)
+ * data - the cumulative data for the current column + summaryType up to the current Record
+ * rowIdx - current row index
+ */
+Ext.ux.grid.GridSummary.Calculations = {
+ sum : function(v, record, colName, data, rowIdx) {
+ return data[colName] + Ext.num(v, 0);
+ },
+
+ count : function(v, record, colName, data, rowIdx) {
+ return rowIdx + 1;
+ },
+
+ max : function(v, record, colName, data, rowIdx) {
+ return Math.max(Ext.num(v, 0), data[colName]);
+ },
+
+ min : function(v, record, colName, data, rowIdx) {
+ return Math.min(Ext.num(v, 0), data[colName]);
+ },
+
+ average : function(v, record, colName, data, rowIdx) {
+ var t = data[colName] + Ext.num(v, 0), count = record.store.getCount();
+ return rowIdx == count - 1 ? (t / count) : t;
+ }
+}
\ No newline at end of file
Modified: web/doc-editor/trunk/themes/style.css
===================================================================
--- web/doc-editor/trunk/themes/style.css 2009-12-26 18:13:48 UTC (rev 292660)
+++ web/doc-editor/trunk/themes/style.css 2009-12-26 18:18:57 UTC (rev 292661)
@@ -101,30 +101,7 @@
}
-
-
/*
-* Css for the IconCombo Ux
-*
-*/
-
-
-
-.ux-icon-combo-input {
- padding-left: 25px !important;
-}
-
-.ux-icon-combo-value {
- padding-left: 22px !important;
-}
-
-.ux-icon-combo-item {
- padding-left: 3px !important;
-}
-
-
-
-/*
* Css for the flags
*
*/