[Commits] r1618 - in sandbox/cmoullet/ux/LayerManager: examples ux ux/widgets
commits at geoext.org
commits at geoext.org
Sun Dec 27 08:13:21 CET 2009
Author: cmoullet
Date: 2009-12-27 08:13:21 +0100 (Sun, 27 Dec 2009)
New Revision: 1618
Added:
sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerImportPanel.js
Removed:
sandbox/cmoullet/ux/LayerManager/ux/form/
sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerTabPanel.js
Modified:
sandbox/cmoullet/ux/LayerManager/examples/LayerManagerExample.html
sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerExportPanel.js
sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerWindow.js
Log:
Remove unnecessary files... no more tabs...
Modified: sandbox/cmoullet/ux/LayerManager/examples/LayerManagerExample.html
===================================================================
--- sandbox/cmoullet/ux/LayerManager/examples/LayerManagerExample.html 2009-12-27 00:56:04 UTC (rev 1617)
+++ sandbox/cmoullet/ux/LayerManager/examples/LayerManagerExample.html 2009-12-27 07:13:21 UTC (rev 1618)
@@ -11,6 +11,7 @@
<script type="text/javascript" src="../ux/data/FormatStore.js"></script>
<script type="text/javascript" src="../ux/data/Export.js"></script>
<script type="text/javascript" src="../ux/widgets/LayerManagerExportPanel.js"></script>
+ <script type="text/javascript" src="../ux/widgets/LayerManagerImportPanel.js"></script>
<script type="text/javascript" src="../ux/widgets/LayerManagerTabPanel.js"></script>
<script type="text/javascript" src="../ux/widgets/LayerManagerWindow.js"></script>
<script type="text/javascript" src="LayerManagerExample.js"></script>
Modified: sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerExportPanel.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerExportPanel.js 2009-12-27 00:56:04 UTC (rev 1617)
+++ sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerExportPanel.js 2009-12-27 07:13:21 UTC (rev 1618)
@@ -33,7 +33,7 @@
this.formatCombo.setValue(this.defaultFormat);
this.exportLinkBox = new Ext.BoxComponent({
- id: 'exportlink',
+ id: 'exportlinkbox',
autoEl: {
html: '<a href=""></a>'
}
@@ -109,12 +109,12 @@
} else {
if (Ext.isIE) {
- this.exportLinkBox.getEl().dom.innerHTML = '<a href="javascript:GeoExt.ux.data.Export.OpenWindowIE(\'' + this.formatCombo.getValue() + '\');">Save file</a>';
+ GeoExt.ux.data.Export.OpenWindowIE(this.formatCombo.getValue());
return;
}
if (Ext.isGecko) {
if (this.formatCombo.getValue() == 'KML') {
- this.exportLinkBox.getEl().dom.innerHTML = '<a href="data:text/kml,' + exportContent.replace(/"/g, '\'') + '" target="new">Right mouse click, Save As...</a>';
+ this.exportLinkBox.getEl().dom.innerHTML = '<a id=\'exportlink\' href="data:text/kml,' + exportContent.replace(/"/g, '\'') + '" target="new">Right mouse click, Save As...</a>';
}
return;
}
@@ -147,8 +147,5 @@
}
];
GeoExt.ux.LayerManagerExportPanel.superclass.initComponent.call(this);
- },
- onRender: function(container, position) {
- GeoExt.ux.LayerManagerExportPanel.superclass.onRender.apply(this, arguments);
}
});
\ No newline at end of file
Added: sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerImportPanel.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerImportPanel.js (rev 0)
+++ sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerImportPanel.js 2009-12-27 07:13:21 UTC (rev 1618)
@@ -0,0 +1,120 @@
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
+ * Published under the BSD license.
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
+ * of the license.
+ */
+
+Ext.namespace('GeoExt.ux');
+
+GeoExt.ux.LayerManagerImportPanel = Ext.extend(Ext.Panel, {
+ border: false,
+ formatCombo: null,
+ defaultFormat: 'KML',
+
+ initComponent: function() {
+
+ this.formatCombo = new Ext.form.ComboBox({
+ id: 'layermanagerimportformat',
+ fieldLabel: OpenLayers.i18n('Format'),
+ store: GeoExt.ux.data.FormatStore,
+ displayField:'shortName',
+ typeAhead: true,
+ mode: 'local',
+ triggerAction: 'all',
+ emptyText:'Select a format...',
+ selectOnFocus:true,
+ resizable:true
+ });
+
+ this.formatCombo.setValue(this.defaultFormat);
+
+ this.fileSelectorBox = new Ext.BoxComponent({
+ id: 'fileSelectorBox',
+ autoEl: {
+ html: '<input type="file" name="fileselector" id="fileselector"/>'
+ }
+ });
+
+ this.items = [
+ {
+ layout: 'form',
+ border:false,
+ items: [
+ {
+ layout: 'column',
+ border: false,
+ defaults:{
+ layout:'form',
+ border:false,
+ bodyStyle:'padding:5px 5px 5px 5px'
+ },
+ items:[
+ {
+ columnWidth:1,
+ defaults:{
+ anchor:'100%'
+ },
+ items: [
+ this.formatCombo
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ layout: 'column',
+ border: false,
+ defaults:{
+ layout:'form',
+ border:false,
+ bodyStyle:'padding:5px 5px 5px 5px'
+ },
+ items: [
+ {
+ columnWidth: 1,
+ bodyCfg: {tag:'center'},
+ items: [
+ this.fileSelectorBox
+ ]
+ }
+ ]
+ },
+ {
+ layout: 'column',
+ border: false,
+ defaults:{
+ layout:'form',
+ border:false,
+ bodyStyle:'padding:5px 5px 5px 5px'
+ },
+ items: [
+ {
+ columnWidth: 1,
+ bodyCfg: {tag:'center'},
+ items: [
+ {
+ xtype:'button',
+ text: OpenLayers.i18n('Import'),
+ handler: function() {
+ if (document.getElementById('fileselector').value == "") {
+ alert(OpenLayers.i18n('Select a file to import'));
+ } else {
+ alert(document.getElementById('fileselector').value);
+ }
+ },
+ scope: this
+ }
+ ]
+ }
+ ]
+ }
+ ];
+ GeoExt.ux.LayerManagerImportPanel.superclass.initComponent.call(this);
+ },
+ onRender: function(container, position) {
+ GeoExt.ux.LayerManagerImportPanel.superclass.onRender.apply(this, arguments);
+ }
+});
\ No newline at end of file
Deleted: sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerTabPanel.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerTabPanel.js 2009-12-27 00:56:04 UTC (rev 1617)
+++ sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerTabPanel.js 2009-12-27 07:13:21 UTC (rev 1618)
@@ -1,46 +0,0 @@
-/**
- * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
- *
- * Published under the BSD license.
- * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
- * of the license.
- */
-
-Ext.namespace('GeoExt.ux');
-
-GeoExt.ux.LayerManagerTabPanel = Ext.extend(Ext.TabPanel, {
- activeTab: 0,
- importPanel: null,
- exportPanel: null,
- deferredRender: false,
- downloadService: null,
-
- initComponent: function() {
- this.exportPanel = new GeoExt.ux.LayerManagerExportPanel({
- map: this.map,
- downloadService: this.downloadService,
- uploadService: this.uploadService,
- defaultFormat: 'KML'
- });
-
- this.items = [
- {
- title: OpenLayers.i18n('Export'),
- // TODO make it more dynamic... IE problem
- height: 100,
- items: [
- this.exportPanel
- ]
- },
- {
- title: OpenLayers.i18n('Import')
- }
- ];
- GeoExt.ux.LayerManagerTabPanel.superclass.initComponent.call(this);
- },
-
-
- onRender: function(container, position) {
- GeoExt.ux.LayerManagerTabPanel.superclass.onRender.apply(this, arguments);
- }
-});
\ No newline at end of file
Modified: sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerWindow.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerWindow.js 2009-12-27 00:56:04 UTC (rev 1617)
+++ sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerWindow.js 2009-12-27 07:13:21 UTC (rev 1618)
@@ -11,23 +11,41 @@
GeoExt.ux.LayerManagerWindow = Ext.extend(Ext.Window, {
modal: true,
title: OpenLayers.i18n('Layer Manager'),
- height: 300,
- width: 400,
- layerManagerTabPanel: null,
+ height: 400,
+ width: 275,
+ layout: 'accordion',
+ layoutConfig: {animate:true},
downloadService: null,
+ importPanel: null,
+ exportPanel: null,
initComponent: function() {
- this.layerManagerTabPanel = new GeoExt.ux.LayerManagerTabPanel({
+
+ this.exportPanel = new GeoExt.ux.LayerManagerExportPanel({
map: this.map,
downloadService: this.downloadService,
- uploadService: this.uploadService
+ defaultFormat: 'KML'
});
- this.items = this.layerManagerTabPanel;
- GeoExt.ux.LayerManagerWindow.superclass.initComponent.call(this);
- },
+ this.importPanel = new GeoExt.ux.LayerManagerImportPanel({
+ map: this.map,
+ defaultFormat: 'KML'
+ });
- onRender: function(container, position) {
- GeoExt.ux.LayerManagerWindow.superclass.onRender.apply(this, arguments);
+ this.items = [
+ {
+ title: OpenLayers.i18n('Export'),
+ items: [
+ this.exportPanel
+ ]
+ },
+ {
+ title: OpenLayers.i18n('Import'),
+ items: [
+ this.importPanel
+ ]
+ }
+ ];
+ GeoExt.ux.LayerManagerWindow.superclass.initComponent.call(this);
}
});
\ No newline at end of file
More information about the Commits
mailing list