From: <fxp...@us...> - 2011-01-26 22:37:44
|
Revision: 7215 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=7215&view=rev Author: fxprunayre Date: 2011-01-26 18:20:53 +0000 (Wed, 26 Jan 2011) Log Message: ----------- Add Proj4js. Fixed watchedRadio. Improve tabs and disable current tab. Modified Paths: -------------- sandbox/guiwidgets/web/src/main/webapp/apps/admin/js/AdminApp.js sandbox/guiwidgets/web/src/main/webapp/apps/css/gnmetadatadefault.css sandbox/guiwidgets/web/src/main/webapp/apps/js/GeoNetwork/lib/GeoNetwork/map/ExtentMap.js sandbox/guiwidgets/web/src/main/webapp/apps/js/GeoNetwork/lib/GeoNetwork/widgets/editor/EditorPanel.js sandbox/guiwidgets/web/src/main/webapp/apps/js/GeoNetwork/lib/GeoNetwork/widgets/editor/EditorToolbar.js sandbox/guiwidgets/web/src/main/webapp/apps/search/index_debug.html sandbox/guiwidgets/web/src/main/webapp/apps/search/js/map/Settings.js Modified: sandbox/guiwidgets/web/src/main/webapp/apps/admin/js/AdminApp.js =================================================================== --- sandbox/guiwidgets/web/src/main/webapp/apps/admin/js/AdminApp.js 2011-01-26 14:07:35 UTC (rev 7214) +++ sandbox/guiwidgets/web/src/main/webapp/apps/admin/js/AdminApp.js 2011-01-26 18:20:53 UTC (rev 7215) @@ -363,6 +363,7 @@ // Create connexion to the catalogue catalogue = new GeoNetwork.Catalogue({ statusBarId : 'info', + servlet: 'geonetwork-perf', mdOverlayedCmpId : 'resultsPanel' }); // Declare default store to be used for records and summary Modified: sandbox/guiwidgets/web/src/main/webapp/apps/css/gnmetadatadefault.css =================================================================== --- sandbox/guiwidgets/web/src/main/webapp/apps/css/gnmetadatadefault.css 2011-01-26 14:07:35 UTC (rev 7214) +++ sandbox/guiwidgets/web/src/main/webapp/apps/css/gnmetadatadefault.css 2011-01-26 18:20:53 UTC (rev 7215) @@ -168,7 +168,7 @@ width : 10%; } -.metadata * input[type=checkbox] { +.metadata * input[type = checkbox] { width : 20px; } @@ -255,11 +255,23 @@ color : #069; } +table.gn > tbody > tr > th.complex, +table.gn > tbody > tr > td.complex { + border : none; +} + table.gn > tbody > tr > td.main, table.gn > tbody > tr > th.main { background-color : #EBF5FA; } +table.map > tbody > tr > td { + text-align : center; +} +table.map > tbody > tr > td > input, +table.map > tbody > tr > td > label { + width : 80px !important; +} /* Table - end */ Modified: sandbox/guiwidgets/web/src/main/webapp/apps/js/GeoNetwork/lib/GeoNetwork/map/ExtentMap.js =================================================================== --- sandbox/guiwidgets/web/src/main/webapp/apps/js/GeoNetwork/lib/GeoNetwork/map/ExtentMap.js 2011-01-26 14:07:35 UTC (rev 7214) +++ sandbox/guiwidgets/web/src/main/webapp/apps/js/GeoNetwork/lib/GeoNetwork/map/ExtentMap.js 2011-01-26 18:20:53 UTC (rev 7215) @@ -281,10 +281,10 @@ var bounds = OpenLayers.Bounds.fromString(l + "," + b + "," + r + "," + t); - if (!toProj.equals(GeoNetwork.map.ExtentMap.mainProj)) { + var mainProj = new OpenLayers.Projection(mainProjCode); + if (!toProj.equals(mainProj)) { bounds.transform(mainProj, toProj); } - if (w !== "") { w = bounds.left.toFixed(digits) + ""; } @@ -312,9 +312,10 @@ if (input.checked) { updateInputTextFields(watchedBbox, new OpenLayers.Projection(input.value), digits); } - Ext.get(input.id).on('click', function(){ - updateInputTextFields(watchedBbox, new OpenLayers.Projection(input.value), digits); - }); + var e = Ext.get(input.id); + e.on('click', function(){ + updateInputTextFields(watchedBbox, new OpenLayers.Projection(this.value), digits); + }, e.dom); } } } @@ -504,8 +505,8 @@ idx, i, tbarItems = []; - mainProj = new OpenLayers.Projection(GeoNetwork.map.ExtentMap.mainProjCode); - alternateProj = GeoNetwork.map.ExtentMap.mainProj; + mainProj = new OpenLayers.Projection(mainProjCode); + alternateProj = mainProj; viewers = Ext.DomQuery.select('.extentViewer'); Modified: sandbox/guiwidgets/web/src/main/webapp/apps/js/GeoNetwork/lib/GeoNetwork/widgets/editor/EditorPanel.js =================================================================== --- sandbox/guiwidgets/web/src/main/webapp/apps/js/GeoNetwork/lib/GeoNetwork/widgets/editor/EditorPanel.js 2011-01-26 14:07:35 UTC (rev 7214) +++ sandbox/guiwidgets/web/src/main/webapp/apps/js/GeoNetwork/lib/GeoNetwork/widgets/editor/EditorPanel.js 2011-01-26 18:20:53 UTC (rev 7215) @@ -67,7 +67,6 @@ metadataId: undefined, metadataMode: undefined, metadataSchema: undefined, - metadataCurrTab: undefined, metadataType: undefined, position: undefined, relatedMetadataStore: undefined, @@ -663,7 +662,7 @@ } else { url = this.editUrl + '?id=' + this.metadataId; } - url += '&currTab=' + (this.metadataCurrTab ? this.metadataCurrTab : 'simple'); + url += '&currTab=' + (document.mainForm ? document.mainForm.currTab.value : 'simple'); this.loadUrl(url, undefined, this.loadCallback); @@ -694,6 +693,7 @@ params: document.mainForm ? Ext.Ajax.serializeForm('editForm') : undefined, callback: cb, scope: this, + loadScripts: true, text: action }); }, @@ -766,6 +766,9 @@ this.editorMainPanel.update(html, false, this.metadataLoaded.bind(this)); }, metadataLoaded: function(){ + this.metadataSchema = Ext.getDom('schema'); + this.metadataType = Ext.getDom('template'); + // If panel was disabled on startup, enable it after initialization if (this.disabled) { this.setDisabled(false); @@ -778,10 +781,6 @@ this.relationPanel.reload(); - this.metadataSchema = Ext.getDom('schema'); - this.metadataType = Ext.getDom('template'); - this.metadataCurrTab = Ext.getDom('currTab'); - //console.log("metadata schema: " + this.metadataSchema.value + " type:" + this.metadataType.value + " tab:" + this.metadataCurrTab.value); this.initCalendar(); @@ -946,16 +945,35 @@ updateModeMenu: function(){ var modes = Ext.query('span.mode', this.body.dom), menu = [], - i; - for (i = 0; i < modes.length; i++) { + i, j, e; + + for (i = 0; i < modes.length; i ++) { if (modes[i].firstChild) { - menu.push([modes[i].firstChild.nodeValue, modes[i].getAttribute('id')]); + var id = modes[i].getAttribute('id'); + var next = Ext.get(modes[i]).next(); + var tabs = next.query('LI'); + var current = next.query('LI[id=' + document.mainForm.currTab.value + ']'); + var activeMode = current.length === 1; + + // Remove mode and children tabs if not in current mode + if (!activeMode) { + Ext.get(modes[i]).parent().remove(); + } else { + // Remove tab if only one tab in that mode + if (next && tabs.length === 1) { + next.remove(); + } else { + // Register events when multiple tabs + for (j = 0; j < tabs.length; j++) { + e = Ext.get(tabs[j]); + e.on('click', function(){ + Ext.getCmp('editorPanel').switchToTab(this); + }, e.getAttribute('id')); + } + } + } + menu.push([modes[i].firstChild.nodeValue, id, activeMode]); } - // -- hide mode tabs if only one tab in that mode - var next = Ext.get(modes[i]).next(); - if (next && next.query('LI').length === 1) { - next.hide(); - } } this.toolbar.updateViewMenu(menu); }, Modified: sandbox/guiwidgets/web/src/main/webapp/apps/js/GeoNetwork/lib/GeoNetwork/widgets/editor/EditorToolbar.js =================================================================== --- sandbox/guiwidgets/web/src/main/webapp/apps/js/GeoNetwork/lib/GeoNetwork/widgets/editor/EditorToolbar.js 2011-01-26 14:07:35 UTC (rev 7214) +++ sandbox/guiwidgets/web/src/main/webapp/apps/js/GeoNetwork/lib/GeoNetwork/widgets/editor/EditorToolbar.js 2011-01-26 18:20:53 UTC (rev 7215) @@ -204,8 +204,8 @@ m = modes[i]; this.viewMenu.add({ text: m[0], - // TODO checked: (this.metadataCurrTab===m[1]?true:false), checked: false, + disabled: m[2], // Disable current mode group: 'mode', value: m[1], listeners: { @@ -218,8 +218,7 @@ }, onViewCheck: function(item, checked){ if (checked) { - this.editor.metadataCurrTab.value = item.value; - Ext.getDom('currTab').value = item.value; + document.mainForm.currTab.value = item.value; this.saveAction.execute(); } }, Modified: sandbox/guiwidgets/web/src/main/webapp/apps/search/index_debug.html =================================================================== --- sandbox/guiwidgets/web/src/main/webapp/apps/search/index_debug.html 2011-01-26 14:07:35 UTC (rev 7214) +++ sandbox/guiwidgets/web/src/main/webapp/apps/search/index_debug.html 2011-01-26 18:20:53 UTC (rev 7215) @@ -93,9 +93,10 @@ <script type="text/javascript" src="../js/ext-ux/MultiselectItemSelector-3.0/DDView.js"></script> <script type="text/javascript" src="../js/ext-ux/MultiselectItemSelector-3.0/Multiselect.js"></script> + <script type="text/javascript" src="../js/proj4js-compressed.js"></script> <script type="text/javascript" src="../js/OpenLayers/lib/OpenLayers.js"></script> <script type="text/javascript" src="../js/GeoExt/lib/overrides/override-ext-ajax.js"></script> - <script type="text/javascript" src="../js/GeoExt/lib/GeoExt.js"></script> + <script type="text/javascript" src="../js/GeoExt/lib/GeoExt.js"></script> <script type="text/javascript" src="../js/GeoExt-ux/LayerOpacitySliderPlugin/LayerOpacitySliderPlugin.js"></script> <script type="text/javascript" src="../js/GeoNetwork/lib/GeoNetwork.js"></script> Modified: sandbox/guiwidgets/web/src/main/webapp/apps/search/js/map/Settings.js =================================================================== --- sandbox/guiwidgets/web/src/main/webapp/apps/search/js/map/Settings.js 2011-01-26 14:07:35 UTC (rev 7214) +++ sandbox/guiwidgets/web/src/main/webapp/apps/search/js/map/Settings.js 2011-01-26 18:20:53 UTC (rev 7215) @@ -22,6 +22,9 @@ } }; +// add Proj4js.defs here +// Proj4js.defs["EPSG:27572"] = "+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs"; + GeoNetwork.map.PROJECTION = "EPSG:4326"; GeoNetwork.map.EXTENT = new OpenLayers.Bounds(-180,-90,180,90); GeoNetwork.map.BACKGROUND_LAYERS = [ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |