[Mapbender-commits] r6099 - in trunk/mapbender: http/javascripts
http/plugins resources/locale/de_DE/LC_MESSAGES
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri May 7 10:02:08 EDT 2010
Author: christoph
Date: 2010-05-07 10:02:08 -0400 (Fri, 07 May 2010)
New Revision: 6099
Added:
trunk/mapbender/http/javascripts/mb_helpDialog.js
trunk/mapbender/http/plugins/mb_metadata_edit.php
Modified:
trunk/mapbender/http/javascripts/mod_changeEPSG.js
trunk/mapbender/http/plugins/mb_metadata_edit.js
trunk/mapbender/http/plugins/mb_metadata_layer.html
trunk/mapbender/http/plugins/mb_metadata_layerPreview.js
trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po
Log:
metadata editor
Added: trunk/mapbender/http/javascripts/mb_helpDialog.js
===================================================================
--- trunk/mapbender/http/javascripts/mb_helpDialog.js (rev 0)
+++ trunk/mapbender/http/javascripts/mb_helpDialog.js 2010-05-07 14:02:08 UTC (rev 6099)
@@ -0,0 +1,45 @@
+(function ($) {
+ $.fn.helpDialog = function () {
+ $.fn.helpDialog.currentDialog = null;
+ return this.each(function () {
+
+ var $this = $(this);
+ var isOpen = false;
+
+ var obj = $this.metadata({
+ type: 'attr',
+ name: 'help'
+ });
+ var helptext = obj.text.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1<br>$2');
+ var label = obj.label;
+
+ var dialog = $("<div>" + helptext + "</div>").attr({
+ "title": label
+ }).dialog({
+ autoOpen: false,
+ show: 'fold',
+ hide: 'fold',
+ position: [
+ $this.position().left + $this.width() + 10,
+ $this.position().top + 5
+ ],
+ beforeclose: function () {
+ isOpen = false;
+ $.fn.helpDialog.currentDialog = null;
+ }
+ });
+
+ $this.bind("click", function () {
+ if (isOpen) {
+ return;
+ }
+ if ($.fn.helpDialog.currentDialog !== null) {
+ $.fn.helpDialog.currentDialog.dialog("close");
+ }
+ $.fn.helpDialog.currentDialog = dialog;
+ dialog.dialog("open");
+ isOpen = true;
+ });
+ });
+ };
+}(jQuery));
Modified: trunk/mapbender/http/javascripts/mod_changeEPSG.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_changeEPSG.js 2010-05-07 13:58:51 UTC (rev 6098)
+++ trunk/mapbender/http/javascripts/mod_changeEPSG.js 2010-05-07 14:02:08 UTC (rev 6099)
@@ -40,13 +40,15 @@
(function ($) {
$.fn.ajaxChange = function () {
var args = arguments;
- this.each(function () {
- if (this.tagName.toUpperCase() !== "SELECT") return;
+ return this.each(function () {
+ if (this.tagName.toUpperCase() !== "SELECT") {
+ return;
+ }
var $this = $(this);
// initialization
- if (args.length >= 1 && typeof args[0] === "function") {
+ if (args.length >= 1 && $.isFunction(args[0])) {
var f = args[0];
var options = {};
Modified: trunk/mapbender/http/plugins/mb_metadata_edit.js
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_edit.js 2010-05-07 13:58:51 UTC (rev 6098)
+++ trunk/mapbender/http/plugins/mb_metadata_edit.js 2010-05-07 14:02:08 UTC (rev 6099)
@@ -25,6 +25,7 @@
var MetadataEditApi = function (o) {
var that = this;
var validator;
+ var wmsId;
this.events = {
showOriginalMetadata : new Mapbender.Event()
@@ -38,7 +39,14 @@
var formReady = false;
+ // second optional parameter formData
var fillForm = function (obj) {
+ if (arguments.length >= 2) {
+ $metadataForm.easyform("reset");
+ $metadataForm.easyform("fill", arguments[1]);
+ return;
+ }
+
// get metadata from server
var req = new Mapbender.Ajax.Request({
url: "../plugins/mb_metadata_server.php",
@@ -67,13 +75,23 @@
};
this.init = function (obj) {
+ wmsId = obj;
+
+ var formData = arguments.length >= 2 ? arguments[1] : undefined;
+
if (!formReady) {
- $metadataForm.load("../plugins/mb_metadata_edit.html", function () {
+ $metadataForm.load("../plugins/mb_metadata_edit.php", function () {
+ $metadataForm.find(".help-dialog").helpDialog();
$metadataForm.find(".original-metadata-wms").bind("click", function() {
showOriginalMetadata(obj);
- });
+ });
validator = $metadataForm.validate();
- fillForm(obj);
+ if (formData !== undefined) {
+ fillForm(obj, formData);
+ }
+ else {
+ fillForm(obj);
+ }
formReady = true;
});
return;
@@ -83,6 +101,9 @@
Mapbender.events.localize.register(function () {
that.valid();
+ var formData = $metadataForm.easyform("serialize");
+ formReady = false;
+ that.init(wmsId, formData);
});
Mapbender.events.init.register(function () {
that.valid();
Added: trunk/mapbender/http/plugins/mb_metadata_edit.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_edit.php (rev 0)
+++ trunk/mapbender/http/plugins/mb_metadata_edit.php 2010-05-07 14:02:08 UTC (rev 6099)
@@ -0,0 +1,101 @@
+<?php
+ require_once dirname(__FILE__) . "/../../core/globalSettings.php";
+?>
+<fieldset class="ui-widget">
+
+ <legend>Service Level Metadata: <img class="help-dialog" help="{text:'Noch ein Text.'}" src="../img/questionmark.png"></img></legend>
+ <p>
+ <label for="wms_title"><?php echo _mb("Show original Service Metadata from last update");?></label>
+ <img class="metadata_img" src="../img/book.png"></img>
+ <img class="help-dialog" help="{label:'Erläuterung',text:'Dies ist ein Hilfetext.\n\nDies ist ein weiterer Text.'}" src="../img/questionmark.png"></img>
+ </p>
+ <p>
+ <label for="wms_title">WMS Title (OWS):</label>
+ <input name="wms_title" id="wms_title" class="required"/>
+ <img class="metadata_img" src="../img/misc/inspire_eu_klein.png"></img>
+ </p>
+ <p>
+ <label for="wms_abstract">WMS Abstract (OWS):</label>
+ <input name="wms_abstract" id="wms_abstract"/>
+ <img class="metadata_img" src="../img/misc/inspire_eu_klein.png"></img>
+ </p>
+ <p>
+ <label for="">WMS Keywords (OWS):</label>
+ <input name=" "id=""/>
+ <img class="metadata_img" src="../img/misc/inspire_eu_klein.png"></img>
+ </p>
+ <p>
+ <label for="fees">WMS Fees (OWS):</label>
+ <input name="fees" id="fees"/>
+ <img class="metadata_img" src="../img/misc/inspire_eu_klein.png"></img>
+ </p>
+ <p>
+ <label for="accessconstraints">WMS AccessConstraints (OWS):</label>
+ <input name="accessconstraints" id="accessconstraints"/>
+ <img class="metadata_img" src="../img/misc/inspire_eu_klein.png"></img>
+ </p>
+ <p>
+ <label for="">WMS Predefined Licence (Registry):</label>
+ <input name="" id""/>
+ <img class="metadata_img" src="../img/questionmark.png"></img>
+ </p>
+ <p>
+ <label>WMS Provider Section (OWS):</label>
+ </p>
+ <p>
+ <label for="contactperson">Contact Individual Name (OWS):</label>
+ <input name="contactperson" id="contactperson"/>
+ </p>
+ <p>
+ <label for="contactposition">Contact Position Name (OWS):</label>
+ <input name="contactposition" id="contactposition"/>
+ </p>
+ <p>
+ <label for="contactvoicetelephone">Contact Phone Voice (OWS):</label>
+ <input name="contactvoicetelephone" id="contactvoicetelephone"/>
+ </p>
+ <p>
+ <label for="contactfacsimiletelephone">Contact Phone Fax (OWS):</label>
+ <input name="contactfacsimiletelephone" id="contactfacsimiletelephone"/>
+ </p>
+ <p>
+ <label for="contactorganization">Contact Organisation (WMS):</label>
+ <input name="contactorganization" id="contactorganization"/>
+ <img class="metadata_img" src="../img/misc/inspire_eu_klein.png"></img>
+ </p>
+ <p>
+ <label for="address">Contact Address (WMS):</label>
+ <input name="address" id="address"/>
+ </p>
+ <p>
+ <label for="city">Contact City (WMS):</label>
+ <input name="city" id="city"/>
+ </p>
+ <p>
+ <label for="stateorprovince">Contact State or Province (WMS) - ISO 3166-II:</label>
+ <input name="stateorprovince" id="stateorprovince"/>
+ </p>
+ <p>
+ <label for="postcode">Contact Post Code (WMS):</label>
+ <input name="postcode" id="postcode"/>
+ </p>
+ <p>
+ <label for="country">Contact Post Country (WMS) - ISO 3166:</label>
+ <input name="country" id="country"/>
+ </p>
+ <p>
+ <label for="contactelectronicmailaddress">Contact Electronic Mail Address (WMS):</label>
+ <input name="contactelectronicmailaddress" id="contactelectronicmailaddress" class="required email"/>
+ <img class="metadata_img" src="../img/misc/inspire_eu_klein.png"></img>
+ </p>
+ <p>
+ <label for="">Date of first registration (Registry):</label>
+ <input name="" id=""/>
+ <img class="metadata_img" src="../img/misc/inspire_eu_klein.png"></img>
+ </p>
+ <p>
+ <label for="">Date of last revision (Registry):</label>
+ <td><input name="" id=""/>
+ <img class="metadata_img" src="../img/misc/inspire_eu_klein.png"></img>
+ </p>
+</fieldset>
Modified: trunk/mapbender/http/plugins/mb_metadata_layer.html
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_layer.html 2010-05-07 13:58:51 UTC (rev 6098)
+++ trunk/mapbender/http/plugins/mb_metadata_layer.html 2010-05-07 14:02:08 UTC (rev 6099)
@@ -60,8 +60,9 @@
<div>
<fieldset class="">
<legend>Preview</legend>
- <div id="map">
- </div>
+ <div id="map"></div>
+ <div id="toolbar_upper"></div>
+ <div id="toolbar_lower"></div>
</fieldset>
</div>
Modified: trunk/mapbender/http/plugins/mb_metadata_layerPreview.js
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_layerPreview.js 2010-05-07 13:58:51 UTC (rev 6098)
+++ trunk/mapbender/http/plugins/mb_metadata_layerPreview.js 2010-05-07 14:02:08 UTC (rev 6099)
@@ -107,14 +107,22 @@
var $target = $('#map');
$target.append($map);
- $(options.buttons).each(function () {
+ $(options.toolbarUpper).each(function () {
$("#" + this).css({
"position": "relative",
"display":"",
"top":"",
"left":""
- }).appendTo($target);
+ }).appendTo($("#toolbar_upper"));
});
+ $(options.toolbarLower).each(function () {
+ $("#" + this).css({
+ "position": "relative",
+ "display":"",
+ "top":"",
+ "left":""
+ }).appendTo($("#toolbar_lower"));
+ });
this.init.done = true;
}
that.wms(obj);
Modified: trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po
===================================================================
--- trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po 2010-05-07 13:58:51 UTC (rev 6098)
+++ trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po 2010-05-07 14:02:08 UTC (rev 6099)
@@ -993,3 +993,6 @@
#: ../http/javascripts/mod_zoomCoords.php:92
msgid "Latitude"
msgstr "Hochwert"
+
+msgid "Show original Service Metadata from last update"
+msgstr "Originale Dienstmetadaten von letzter Aktualisierung anzeigen"
More information about the Mapbender_commits
mailing list