|
From: <net...@us...> - 2010-11-28 17:26:10
|
Revision: 171
http://openautomation.svn.sourceforge.net/openautomation/?rev=171&view=rev
Author: netzkind
Date: 2010-11-28 17:26:04 +0000 (Sun, 28 Nov 2010)
Log Message:
-----------
activated "loading"-layout for editor too, changed bug reported by Bodo, added input for address (in case someone does have an out-of-date eibga.conf)
Modified Paths:
--------------
CometVisu/trunk/visu/designs/discreet/basic.css
CometVisu/trunk/visu/designs/pure/basic.css
CometVisu/trunk/visu/edit/style_edit.css
CometVisu/trunk/visu/edit/visuconfig_edit.js
CometVisu/trunk/visu/edit_config.html
CometVisu/trunk/visu/index.html
Modified: CometVisu/trunk/visu/designs/discreet/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/discreet/basic.css 2010-11-28 16:39:42 UTC (rev 170)
+++ CometVisu/trunk/visu/designs/discreet/basic.css 2010-11-28 17:26:04 UTC (rev 171)
@@ -289,7 +289,7 @@
/* End hide from IE-mac */
}
-div#top, div#main, div#bottom {
+.loading {
display: block !important;
}
Modified: CometVisu/trunk/visu/designs/pure/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/pure/basic.css 2010-11-28 16:39:42 UTC (rev 170)
+++ CometVisu/trunk/visu/designs/pure/basic.css 2010-11-28 17:26:04 UTC (rev 171)
@@ -252,7 +252,7 @@
/* End hide from IE-mac */
}
-div#top, div#main, div#bottom {
+.loading {
display: block !important;
}
Modified: CometVisu/trunk/visu/edit/style_edit.css
===================================================================
--- CometVisu/trunk/visu/edit/style_edit.css 2010-11-28 16:39:42 UTC (rev 170)
+++ CometVisu/trunk/visu/edit/style_edit.css 2010-11-28 17:26:04 UTC (rev 171)
@@ -82,11 +82,12 @@
.addwidget .editcontrols label {
float: left;
- width: 220px;
+ width: 180px;
}
-.addwidget .editcontrols input, .addwidget .editcontrols select {
+.addwidget .editcontrols .input {
+ padding-left: 200px;
}
div.line {
Modified: CometVisu/trunk/visu/edit/visuconfig_edit.js
===================================================================
--- CometVisu/trunk/visu/edit/visuconfig_edit.js 2010-11-28 16:39:42 UTC (rev 170)
+++ CometVisu/trunk/visu/edit/visuconfig_edit.js 2010-11-28 17:26:04 UTC (rev 171)
@@ -210,7 +210,9 @@
var element = $("<div />").addClass("add_input").addClass("content")
.append($("<label />").attr("for", "add_textContent").html("text-content"))
- .append($("<input type=\"text\" id=\"add_textContent\"/>"));
+ .append($("<div class=\"input\" />")
+ .append($("<input type=\"text\" id=\"add_textContent\"/>"))
+ );
if (typeof values["textContent"] != "undefined") {
element.find("input").val(values["textContent"]);
}
@@ -223,25 +225,41 @@
$.each(attributes, function (index, e) {
var element = $("<div />").addClass("add_input").addClass("attribute")
- .append($("<label />").attr("for", "add_" + index).html(index));
+ .append($("<label />").attr("for", "add_" + index).html(index))
+ .append($("<div class=\"input\" />"));
+ var myElement = element.find("div.input");
switch (e.type) {
case "address":
- if (typeof addressesCache == undefined || addressesCache == false) {
- // appearantly we were unable to load the list of addresses from the server
- // we will provide an input-field instead
- element.append($("<input id=\"add_" + index + "\" />"));
- if (typeof values[index] != "undefined") {
- // pre-set the value
- element.find(":input").val(values[index]);
- }
- } else {
- element.append($("<select id=\"add_" + index + "\" />")
+ // appearantly we were unable to load the list of addresses from the server
+ // we will provide an input-field instead
+ myElement.append($("<input id=\"add_" + index + "\" />"));
+ if (typeof values[index] != "undefined") {
+ // pre-set the value
+ myElement.find(":input").val(values[index]);
+ }
+
+ if (typeof addressesCache != undefined && addressesCache != false) {
+ var input = myElement.find("input");
+ input.attr("disabled", "disabled");
+ myElement.append($("<input type=\"checkbox\" name=\"enable_" + e.type + "\" checked=\"checked\" />")
+ .change(function() {
+ if ($(this).attr("checked")) {
+ input.attr("disabled", "disabled");
+ myElement.find("select").show();
+ } else {
+ input.removeAttr("disabled");
+ myElement.find("select").hide();
+ }
+ })
+ );
+ myElement.append($("<br />"));
+ myElement.append($("<select id=\"add_" + index + "\" />")
.append($("<option />").attr("value", "").html("-")));
- element.find("select:first").append(getAddressesObject());
+ myElement.find("select:first").append(getAddressesObject());
- element.find("select").bind("change", function() {
+ myElement.find("select").bind("change", function() {
// on changing the address, the coresponding datatype-field is
// automagically set
var name = $(this).attr("id");
@@ -255,7 +273,7 @@
});
if (typeof values[index] != "undefined") {
- element.find("option[value=" + values[index] + "]").attr("selected", "selected");
+ myElement.find("option[value=" + values[index] + "]").attr("selected", "selected");
}
}
@@ -264,61 +282,69 @@
if (typeof dptCache == undefined || dptCache == false) {
// appearantly we were unable to load the list of datatypes from the server
// we will provide an input-field instead
- element.append($("<input id=\"add_" + index + "\" />"));
+ myElement.append($("<input id=\"add_" + index + "\" />"));
if (typeof values[index] != "undefined") {
// pre-set the value
- element.find(":input").val(values[index]);
+ myElement.find(":input").val(values[index]);
}
} else {
- element.append($("<select id=\"add_" + index + "\" />")
+ myElement.append($("<select id=\"add_" + index + "\" />")
.append($("<option />").attr("value", "").html("-")));
- element.find("select:first").append(getDPTObject());
+ myElement.find("select:first").append(getDPTObject());
if (typeof values[index] != "undefined") {
- element.find("option[value=" + values[index] + "]").attr("selected", "selected");
+ myElement.find("option[value=" + values[index] + "]").attr("selected", "selected");
}
}
break;
case "mapping":
- element.append($("<select id=\"add_mapping\" />")
+ myElement.append($("<select id=\"add_mapping\" />")
.append($("<option />").attr("value", "").html("-")));
jQuery.each(mappings, function(i, tmp) {
- element.find("select#add_mapping").append($("<option />").attr("value", i).html(i));
+ myElement.find("select#add_mapping").append($("<option />").attr("value", i).html(i));
});
if (typeof values[index] != "undefined") {
- element.find("option[value=" + values[index] + "]").attr("selected", "selected");
+ myElement.find("option[value=" + values[index] + "]").attr("selected", "selected");
}
break;
case "styling":
- element.append($("<select id=\"add_styling\" />")
+ myElement.append($("<select id=\"add_styling\" />")
.append($("<option />").attr("value", "").html("-")));
jQuery.each(stylings, function(i, tmp) {
- element.find("select#add_styling").append($("<option />").attr("value", i).html(i));
+ myElement.find("select#add_styling").append($("<option />").attr("value", i).html(i));
});
if (typeof values[index] != "undefined") {
- element.find("option[value=" + values[index] + "]").attr("selected", "selected");
+ myElement.find("option[value=" + values[index] + "]").attr("selected", "selected");
}
break;
case "datatype":
break;
default:
- element.append($("<input type=\"text\" id=\"add_" + index + "\" />"));
+ myElement.append($("<input type=\"text\" id=\"add_" + index + "\" />"));
if (typeof values[index] != "undefined") {
- element.find("input").val(values[index]);
+ myElement.find("input").val(values[index]);
}
break;
}
+ if (element.find("select")[0]) {
+ var select = element.find("select");
+ select.change(function() {
+ // update the input-field
+ jQuery(this).parent().find("input").val(jQuery(this).val());
+ })
+ }
+
element.find(":input")
.data("name", index)
.data("required", e.required)
@@ -365,7 +391,7 @@
var error = false;
// alte Werte zwischenspeichern
- container.find(":input").each(function() {
+ container.find(":input:visible").not("[name^=enable_]").each(function() {
var name;
if ($(this).closest("div.add_input").hasClass("attribute")) {
name = $(this).data("name");
Modified: CometVisu/trunk/visu/edit_config.html
===================================================================
--- CometVisu/trunk/visu/edit_config.html 2010-11-28 16:39:42 UTC (rev 170)
+++ CometVisu/trunk/visu/edit_config.html 2010-11-28 17:26:04 UTC (rev 171)
@@ -5,7 +5,6 @@
<head>
<title>Visu - Editor-Modus</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<!-- <link rel="stylesheet" type="text/css" href="style_discreet.css" /> -->
<link rel="stylesheet" type="text/css" href="edit/style_edit.css" />
<script src="lib/jquery.js" type="text/javascript"></script>
<script src="lib/jquery-ui.js" type="text/javascript"></script>
@@ -17,17 +16,20 @@
<script src="lib/templateengine.js" type="text/javascript"></script>
<script src="edit/visuconfig_edit.js" type="text/javascript"></script>
<script src="edit/json2.js" type="text/javascript"></script>
+ <style type="text/css">
+ .loading { display: none; }
+ </style>
</head>
<body>
- <div id="top">
+ <div id="top" class="loading">
<div class="nav_path">-</div>
<hr />
</div>
- <div id="main" style="width:900px;position:relative; overflow: hidden; z-index: 1;">
+ <div id="main" style="width:900px;position:relative; overflow: hidden; z-index: 1;" class="loading">
<div id="pages" class="clearfix" style="width:20000em; position:relative;clear:both;"><!-- all pages will be inserted here -->
</div>
</div>
- <div id="bottom">
+ <div id="bottom" class="loading">
<hr />
<div class="footer">
<img src="icon/comet_64_ff8000.png" alt="CometVisu" />
@@ -43,9 +45,11 @@
<h2 class="edit">Edit widget</h2>
<div class="editcontrols">
<label for="add_type">Typ</label>
- <select id="add_type">
- <option>-</option>
- </select>
+ <div class="input">
+ <select id="add_type">
+ <option>-</option>
+ </select>
+ </div>
<div class="inputs">
@@ -60,9 +64,12 @@
</div>
</form>
</div>
- <div id="controlcontainer">
+ <div id="controlcontainer" class="loading">
<div id="saveconfigcontrol">save</div>
<div id="addwidgetcontrol">+</div>
</div>
+ <div id="loading" style="text-align: center; width: 200px; height: 30px; margin: auto;">
+ Loading ...
+ </div>
</body>
</html>
Modified: CometVisu/trunk/visu/index.html
===================================================================
--- CometVisu/trunk/visu/index.html 2010-11-28 16:39:42 UTC (rev 170)
+++ CometVisu/trunk/visu/index.html 2010-11-28 17:26:04 UTC (rev 171)
@@ -13,16 +13,19 @@
<script src="designs/structure_pure.js" type="text/javascript"></script>
<script src="designs/structure_custom.js" type="text/javascript"></script>
<script src="lib/templateengine.js" type="text/javascript"></script>
+ <style type="text/css">
+ .loading { display: none; }
+ </style>
</head>
<body>
- <div id="top" style="display: none;">
+ <div id="top" class="loading">
<div class="nav_path">-</div>
</div>
- <div id="main" style="width:900px;position:relative; overflow: hidden;" style="display: none;">
+ <div id="main" style="width:900px;position:relative; overflow: hidden;" class="loading">
<div id="pages" class="clearfix" style="width:20000em; position:relative;clear:both;"><!-- all pages will be inserted here -->
</div>
</div>
- <div id="bottom" style="display: none;">
+ <div id="bottom" class="loading">
<hr />
<div class="footer">
<img src="icon/comet_64_000000.png" alt="CometVisu" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|