|
From: <net...@us...> - 2011-05-23 17:29:36
|
Revision: 345
http://openautomation.svn.sourceforge.net/openautomation/?rev=345&view=rev
Author: netzkind
Date: 2011-05-23 17:29:29 +0000 (Mon, 23 May 2011)
Log Message:
-----------
allow attributes for pages, don't drop names of "empty" pages
Modified Paths:
--------------
CometVisu/trunk/visu/edit/save_config.php
CometVisu/trunk/visu/edit/visuconfig_edit.js
Modified: CometVisu/trunk/visu/edit/save_config.php
===================================================================
--- CometVisu/trunk/visu/edit/save_config.php 2011-05-23 07:05:49 UTC (rev 344)
+++ CometVisu/trunk/visu/edit/save_config.php 2011-05-23 17:29:29 UTC (rev 345)
@@ -91,6 +91,27 @@
$objXML->setAttribute("name", (string)$objJSON->name);
}
+ if (false === empty($objJSON->_attributes)) {
+ // some attributes are in a sub-element - it's easier to get them out of there
+ // into our main namespace
+ foreach ($objJSON->_attributes as $strKey => $strValue) {
+ $objJSON->$strKey = $strValue;
+ }
+ }
+
+ foreach ($objJSON as $strAttribute => $mixValue) {
+ if (0 === strpos($strAttribute, "_")) {
+ // Parameter die mit "_" beginnen sind special purpose
+ continue;
+ }
+
+ if ($strAttribute === "textContent") {
+ $objXML->nodeValue = $mixValue;
+ continue;
+ }
+ $objXML->setAttribute($strAttribute, $mixValue);
+ }
+
if (true === empty($objJSON->_elements) || false === is_array($objJSON->_elements)) {
return $objXML;
}
Modified: CometVisu/trunk/visu/edit/visuconfig_edit.js
===================================================================
--- CometVisu/trunk/visu/edit/visuconfig_edit.js 2011-05-23 07:05:49 UTC (rev 344)
+++ CometVisu/trunk/visu/edit/visuconfig_edit.js 2011-05-23 17:29:29 UTC (rev 345)
@@ -865,6 +865,10 @@
return myObj;
}
+function getPageData(element) {
+
+}
+
function createObjectFromPage(pageObject) {
var obj = {};
var elements = new Array();
@@ -873,6 +877,10 @@
// Seitenname
obj.name = $(element).text();
obj._type = "page";
+ if ($(element).parents("div.page").data("configData")) {
+ var data = $(element).parents("div.page").data("configData");
+ obj = jQuery.extend(obj, data.attributes);
+ }
} else {
var myObj = {};
myObj = getWidgetData(element);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-05-26 15:33:45
|
Revision: 346
http://openautomation.svn.sourceforge.net/openautomation/?rev=346&view=rev
Author: makki1
Date: 2011-05-26 15:33:39 +0000 (Thu, 26 May 2011)
Log Message:
-----------
Add missing icons for status/notification-bar
Added Paths:
-----------
CometVisu/trunk/visu/edit/images/
CometVisu/trunk/visu/edit/images/ui-bg_flat_0_aaaaaa_40x100.png
CometVisu/trunk/visu/edit/images/ui-bg_flat_75_ffffff_40x100.png
CometVisu/trunk/visu/edit/images/ui-bg_glass_55_fbf9ee_1x400.png
CometVisu/trunk/visu/edit/images/ui-bg_glass_65_ffffff_1x400.png
CometVisu/trunk/visu/edit/images/ui-bg_glass_75_dadada_1x400.png
CometVisu/trunk/visu/edit/images/ui-bg_glass_75_e6e6e6_1x400.png
CometVisu/trunk/visu/edit/images/ui-bg_glass_95_fef1ec_1x400.png
CometVisu/trunk/visu/edit/images/ui-bg_highlight-soft_75_cccccc_1x100.png
CometVisu/trunk/visu/edit/images/ui-icons_222222_256x240.png
CometVisu/trunk/visu/edit/images/ui-icons_2e83ff_256x240.png
CometVisu/trunk/visu/edit/images/ui-icons_454545_256x240.png
CometVisu/trunk/visu/edit/images/ui-icons_888888_256x240.png
CometVisu/trunk/visu/edit/images/ui-icons_cd0a0a_256x240.png
Added: CometVisu/trunk/visu/edit/images/ui-bg_flat_0_aaaaaa_40x100.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/edit/images/ui-bg_flat_0_aaaaaa_40x100.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/edit/images/ui-bg_flat_75_ffffff_40x100.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/edit/images/ui-bg_flat_75_ffffff_40x100.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/edit/images/ui-bg_glass_55_fbf9ee_1x400.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/edit/images/ui-bg_glass_55_fbf9ee_1x400.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/edit/images/ui-bg_glass_65_ffffff_1x400.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/edit/images/ui-bg_glass_65_ffffff_1x400.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/edit/images/ui-bg_glass_75_dadada_1x400.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/edit/images/ui-bg_glass_75_dadada_1x400.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/edit/images/ui-bg_glass_75_e6e6e6_1x400.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/edit/images/ui-bg_glass_75_e6e6e6_1x400.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/edit/images/ui-bg_glass_95_fef1ec_1x400.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/edit/images/ui-bg_glass_95_fef1ec_1x400.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/edit/images/ui-bg_highlight-soft_75_cccccc_1x100.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/edit/images/ui-bg_highlight-soft_75_cccccc_1x100.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/edit/images/ui-icons_222222_256x240.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/edit/images/ui-icons_222222_256x240.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/edit/images/ui-icons_2e83ff_256x240.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/edit/images/ui-icons_2e83ff_256x240.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/edit/images/ui-icons_454545_256x240.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/edit/images/ui-icons_454545_256x240.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/edit/images/ui-icons_888888_256x240.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/edit/images/ui-icons_888888_256x240.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/edit/images/ui-icons_cd0a0a_256x240.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/edit/images/ui-icons_cd0a0a_256x240.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <net...@us...> - 2011-10-08 22:21:37
|
Revision: 432
http://openautomation.svn.sourceforge.net/openautomation/?rev=432&view=rev
Author: netzkind
Date: 2011-10-08 22:21:30 +0000 (Sat, 08 Oct 2011)
Log Message:
-----------
fixed: attribute variant for addresses
Modified Paths:
--------------
CometVisu/trunk/visu/edit/cometeditor.js
CometVisu/trunk/visu/edit/visuconfig_edit.js
Modified: CometVisu/trunk/visu/edit/cometeditor.js
===================================================================
--- CometVisu/trunk/visu/edit/cometeditor.js 2011-10-08 10:42:25 UTC (rev 431)
+++ CometVisu/trunk/visu/edit/cometeditor.js 2011-10-08 22:21:30 UTC (rev 432)
@@ -95,7 +95,7 @@
objData.textContent = "";
objData._attributes = {};
objData._attributes.transform = "";
- objData._attributes.type = "";
+ objData._attributes.variant = "";
objData._attributes.readonly = false;
var elementDiv = HTMLLayer.createAddressEditorElement(objData);
@@ -469,7 +469,7 @@
myElement._attributes.transform = jQuery(element).attr("transform");
myElement._attributes.readonly = jQuery(element).attr("readonly");
- myElement._attributes.type = jQuery(element).attr("type") || "";
+ myElement._attributes.variant = jQuery(element).attr("variant") || "";
break;
default:
// mostly labels
@@ -620,15 +620,15 @@
elementDiv.find(".title").append(t.find("option[value=" + elementData.textContent + "]").text());
elementDiv.find(".value").append(elementData.textContent);
elementDiv.find(".transform").append(elementData._attributes.transform);
- if (elementData._attributes.type != "undefined" && elementData._attributes.type != "") {
- elementDiv.find(".variant").append(elementData._attributes.type).show();
+ if (elementData._attributes.variant != "undefined" && elementData._attributes.variant != "") {
+ elementDiv.find(".variant").append(elementData._attributes.variant).show();
} else {
elementDiv.find(".variant").hide();
}
elementDiv.find(".readonly").append(elementData._attributes.readonly == "true" ? "readonly" : "")
elementDiv.data("transform", elementData._attributes.transform)
- .data("variant", elementData._attributes.type)
+ .data("variant", elementData._attributes.variant)
.data("readonly", elementData._attributes.readonly == "true" ? true : false)
.data("address", elementData.textContent);
Modified: CometVisu/trunk/visu/edit/visuconfig_edit.js
===================================================================
--- CometVisu/trunk/visu/edit/visuconfig_edit.js 2011-10-08 10:42:25 UTC (rev 431)
+++ CometVisu/trunk/visu/edit/visuconfig_edit.js 2011-10-08 22:21:30 UTC (rev 432)
@@ -292,7 +292,7 @@
objData.textContent = $e.find("input.add_address").val();
objData._attributes = {};
objData._attributes.transform = $e.find(".add_transform").val();
- objData._attributes.type = $e.find(".add_variant").val();
+ objData._attributes.variant = $e.find(".add_variant").val();
objData._attributes.readonly = $e.find(".add_readonly:checked").val();
// remove this item and insert a new one instead
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <net...@us...> - 2011-12-18 12:50:00
|
Revision: 584
http://openautomation.svn.sourceforge.net/openautomation/?rev=584&view=rev
Author: netzkind
Date: 2011-12-18 12:49:54 +0000 (Sun, 18 Dec 2011)
Log Message:
-----------
made Editor work with UI-fixes from #583
Modified Paths:
--------------
CometVisu/trunk/visu/edit/cometeditor.js
CometVisu/trunk/visu/edit/style_edit.css
CometVisu/trunk/visu/edit/visuconfig_edit.js
Modified: CometVisu/trunk/visu/edit/cometeditor.js
===================================================================
--- CometVisu/trunk/visu/edit/cometeditor.js 2011-12-18 11:21:22 UTC (rev 583)
+++ CometVisu/trunk/visu/edit/cometeditor.js 2011-12-18 12:49:54 UTC (rev 584)
@@ -175,7 +175,7 @@
if (typeof values._attributes != "undefined"
&& typeof values._attributes[index] != "undefined") {
- $input.find("option[value=" + values._attributes[index] + "]").attr("selected", "selected");
+ $input.find("option[value='" + values._attributes[index] + "']").attr("selected", "selected");
}
break;
@@ -189,7 +189,7 @@
if (typeof values._attributes != "undefined"
&& typeof values._attributes[index] != "undefined") {
- $input.find("option[value=" + values._attributes[index] + "]").attr("selected", "selected");
+ $input.find("option[value='" + values._attributes[index] + "']").attr("selected", "selected");
}
break;
@@ -204,7 +204,7 @@
if (typeof values._attributes != "undefined"
&& typeof values._attributes[index] != "undefined") {
- $input.find("option[value=" + values._attributes[index] + "]").attr("selected", "selected");
+ $input.find("option[value='" + values._attributes[index] + "']").attr("selected", "selected");
}
break;
@@ -356,7 +356,7 @@
$("#" + path + ".page").insertAfter($(".page:visible:last"));
if ($("#pages .inedit").is(".widget")) {
- $("#pages .inedit").replaceWith(newWidget);
+ $("#pages .inedit").closest(".widget_container").replaceWith(newWidget);
} else {
jQuery(".page:visible:last > div").append(newWidget);
}
@@ -463,6 +463,11 @@
var myObj = {};
var e = $(element);
+
+ // if this is a widget-container, get its widget
+ if (e.is(".widget_container")) {
+ e = e.children(".widget");
+ }
myObj._type = e.data("nodeName");
myObj.textContent = e.data("textContent");
@@ -632,7 +637,7 @@
.append("<div class=\"readonly editable\" />");
//myDiv.find(".title").append();
var t = Editor.getAddressesObject();
- elementDiv.find(".title").append(t.find("option[value=" + elementData.textContent + "]").text());
+ elementDiv.find(".title").append(t.find("option[value='" + elementData.textContent + "']").text());
elementDiv.find(".value").append(elementData.textContent);
elementDiv.find(".transform").append(elementData._attributes.transform);
if (elementData._attributes.variant != "undefined" && elementData._attributes.variant != "") {
Modified: CometVisu/trunk/visu/edit/style_edit.css
===================================================================
--- CometVisu/trunk/visu/edit/style_edit.css 2011-12-18 11:21:22 UTC (rev 583)
+++ CometVisu/trunk/visu/edit/style_edit.css 2011-12-18 12:49:54 UTC (rev 584)
@@ -1,5 +1,5 @@
/* Editor-Stuff */
-.widget {position: relative;}
+.widget_container, .widget {position: relative;}
.editcontrol, .movecontrol, .removecontrol {
position: absolute;
@@ -181,8 +181,8 @@
padding-left: 120px;
}
-div.line {
- width: 97%;
+.widget_container.line {
+ width: 100%;
}
div.line hr {
Modified: CometVisu/trunk/visu/edit/visuconfig_edit.js
===================================================================
--- CometVisu/trunk/visu/edit/visuconfig_edit.js 2011-12-18 11:21:22 UTC (rev 583)
+++ CometVisu/trunk/visu/edit/visuconfig_edit.js 2011-12-18 12:49:54 UTC (rev 584)
@@ -71,36 +71,46 @@
});
jQuery("#pages").bind("done", function() {
+ // wrap hr and br into "widgets", so they can be moved + removed
$("#pages hr, #pages br").each(function() {
if ($(this).closest(".widget").length == 0) {
- $(this).wrap("<div class=\"widget clearfix line\" />");
+ $(this).wrap("<div class=\"widget clearfix\" />");
+ $(this).closest(".widget").wrap("<div class=\"widget_container line\" />");
var d = $.extend({}, $(this).data());
$(this).closest("div.widget").data(d);
}
});
+ // init "sortable"
jQuery(".page div").sortable({
handle: ".movecontrol",
- items: '.widget',
+ items: '.widget_container',
stop: function(event, ui) {
//console.log(jQuery(this).sortable("toArray"));
// hier haben wir eine neue Config
}
});
- jQuery(".widget").unbind("mouseenter.edit").bind("mouseenter.edit", function() {
+ // create buttons for edit, move, remove
+ jQuery(".widget_container").unbind("mouseenter.edit").bind("mouseenter.edit", function() {
jQuery(this).data("background-color-old", jQuery(this).css("background-color"));
- $(this).prepend(jQuery("<div />").attr("class", "movecontrol"));
- $(this).prepend(jQuery("<div />").attr("class", "editcontrol").html("edit"));
- $(this).prepend(jQuery("<div />").attr("class", "removecontrol").html("x"));
+ if ($(this).find("div.movecontrol").is("div")) {
+ jQuery(this).find("div.editcontrol, div.movecontrol, div.removecontrol").show();
+ } else {
+ $(this).prepend(jQuery("<div />").attr("class", "movecontrol"));
+ $(this).prepend(jQuery("<div />").attr("class", "editcontrol").html("edit"));
+ $(this).prepend(jQuery("<div />").attr("class", "removecontrol").html("x"));
+ }
});
- jQuery(".widget").unbind("mouseleave.edit").bind("mouseleave.edit", function() {
+ // remove buttons when cursor leaves
+ jQuery(".widget_container").unbind("mouseleave.edit").bind("mouseleave.edit", function() {
jQuery(this).css("background-color", jQuery(this).data("background-color-old"));
- jQuery(this).find("div.editcontrol, div.movecontrol, div.removecontrol").remove();
+ jQuery(this).find("div.editcontrol, div.movecontrol, div.removecontrol").hide();
});
+ // create list of widgets to be insertable/editable
var options = {};
$("#addMaster").find("select#add_type").empty();
jQuery.each(design.creators, function (index, e) {
@@ -120,8 +130,9 @@
});
});
+ // act on "remove"-Clicks
jQuery(".removecontrol").live("click", function() {
- var widget = $(this).parents("div.widget");
+ var widget = $(this).siblings("div.widget");
var data = Editor.getWidgetData(widget, true);
var t;
@@ -132,15 +143,16 @@
}
var b = confirm(lingua("confirm_delete", t));
if (b) {
- widget.remove();
+ widget.closest(".widget_container").remove();
}
});
+ // act on "edit"-clicks
jQuery(".editcontrol").live("click", function() {
$("#addMaster").triggerHandler("cleanup");
- var widget = $(this).parents("div.widget");
+ var widget = $(this).siblings("div.widget");
if (widget.is(".pagelink")) {
return renamePage(widget);
}
@@ -152,11 +164,12 @@
$("#addMaster").data("widgetdata", data);
- $("#addMaster #add_type").find("option[value=" + data._type + "]").attr("selected", "selected");
+ $("#addMaster #add_type").find("option[value='" + data._type + "']").attr("selected", "selected");
$("#addMaster").triggerHandler("show");
});
+ // multi-element edits, like "address"
jQuery(".multi_element .element").live("click", function() {
$this = jQuery(this);
if ($this.is(".inedit")) {
@@ -214,12 +227,12 @@
if ($dptField.is("input")) {
$dptField.val(dpt);
} else if ($dptField.is("select")) {
- $dptField.find("option[value=" + dpt + "]").attr("selected", "selected");
+ $dptField.find("option[value='" + dpt + "']").attr("selected", "selected");
}
});
if (typeof $e.text() != "undefined") {
- myElement.find("option[value=" + $e.text() + "]").attr("selected", "selected");
+ myElement.find("option[value='" + $e.text() + "']").attr("selected", "selected");
}
}
@@ -241,7 +254,7 @@
myElement.find("select:first").append(Editor.getDPTObject());
if (typeof $e.text() != "undefined") {
- myElement.find("option[value=" + $e.text() + "]").attr("selected", "selected");
+ myElement.find("option[value='" + $e.text() + "']").attr("selected", "selected");
}
}
@@ -314,7 +327,9 @@
);
});
+ // edit-"window"
jQuery("#addMaster")
+ // act on "show"
.bind("show", function() {
if ($("#pages .inedit").is(".widget")) {
$(this).find(".create").hide().end().find(".edit").show();
@@ -325,7 +340,7 @@
// if we have widget-specific data, we must be in edit-mode
var widgetdata = $(this).data("widgetdata");
if (typeof widgetdata != "undefined") {
- $(this).find("#add_type").find("option[value=" + widgetdata._type + "]").attr("selected", "selected").trigger("change");
+ $(this).find("#add_type").find("option[value='" + widgetdata._type + "']").attr("selected", "selected").trigger("change");
}
$(this).show()
@@ -333,20 +348,24 @@
jQuery(".page div").sortable("destroy");
jQuery(".widget").unbind("mouseenter.edit").trigger("mouseleave.edit").unbind("mouseleave.edit");
})
+ // act on "hide"
.bind("hide", function() {
$(this).hide();
$("#pages").triggerHandler("done");
})
+ // cleanup
.bind("cleanup", function() {
$(this).removeData("widgetdata");
jQuery(this).find("input[type=text]").val("");
$("#addMaster div.inputs").empty();
$("#pages").find(".inedit").removeClass("inedit");
})
+ // cancel: hide and cleanup
.find("#add_cancel").click(function() {
jQuery("#addMaster").trigger("hide").trigger("cleanup")
})
.end()
+ // act on changes of widget-type (the select-list)
.find("#add_type").change(function() {
// the type has been changed
// we need to change the input-field accordingly to match
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <net...@us...> - 2011-12-18 16:24:36
|
Revision: 595
http://openautomation.svn.sourceforge.net/openautomation/?rev=595&view=rev
Author: netzkind
Date: 2011-12-18 16:24:30 +0000 (Sun, 18 Dec 2011)
Log Message:
-----------
corrected Content-type to application/json
Modified Paths:
--------------
CometVisu/trunk/visu/edit/get_addresses.php
CometVisu/trunk/visu/edit/get_widget_diagram.php
Modified: CometVisu/trunk/visu/edit/get_addresses.php
===================================================================
--- CometVisu/trunk/visu/edit/get_addresses.php 2011-12-18 16:24:02 UTC (rev 594)
+++ CometVisu/trunk/visu/edit/get_addresses.php 2011-12-18 16:24:30 UTC (rev 595)
@@ -39,6 +39,7 @@
);
}
+Header("Content-type: application/json");
print json_encode($arrAdresses);
exit;
Modified: CometVisu/trunk/visu/edit/get_widget_diagram.php
===================================================================
--- CometVisu/trunk/visu/edit/get_widget_diagram.php 2011-12-18 16:24:02 UTC (rev 594)
+++ CometVisu/trunk/visu/edit/get_widget_diagram.php 2011-12-18 16:24:30 UTC (rev 595)
@@ -28,6 +28,7 @@
}
+Header("Content-type: application/json");
print json_encode($arrAdresses);
exit;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2012-02-05 10:53:40
|
Revision: 681
http://openautomation.svn.sourceforge.net/openautomation/?rev=681&view=rev
Author: makki1
Date: 2012-02-05 10:53:34 +0000 (Sun, 05 Feb 2012)
Log Message:
-----------
writeonly for addresses in editor
Modified Paths:
--------------
CometVisu/trunk/visu/edit/cometeditor.js
CometVisu/trunk/visu/edit/style_edit.css
CometVisu/trunk/visu/edit/visuconfig_edit.js
Modified: CometVisu/trunk/visu/edit/cometeditor.js
===================================================================
--- CometVisu/trunk/visu/edit/cometeditor.js 2012-02-02 18:59:06 UTC (rev 680)
+++ CometVisu/trunk/visu/edit/cometeditor.js 2012-02-05 10:53:34 UTC (rev 681)
@@ -117,6 +117,7 @@
objData._attributes.transform = "";
objData._attributes.variant = "";
objData._attributes.readonly = false;
+ objData._attributes.writeonly = false;
var elementDiv = HTMLLayer.createAddressEditorElement(objData, e.options);
$input.find("div.multi_element").append(elementDiv);
@@ -313,6 +314,7 @@
.attr("transform", $(e).data("transform"))
.attr("variant", $(e).data("variant") || "")
.attr("readonly", $(e).data("readonly") == true ? "true" : "false")
+ .attr("writeonly", $(e).data("writeonly") == true ? "true" : "false")
.append($(e).data("address"));
dataObject.append($address);
});
@@ -494,6 +496,7 @@
myElement._attributes.transform = jQuery(element).attr("transform");
myElement._attributes.readonly = jQuery(element).attr("readonly");
+ myElement._attributes.writeonly = jQuery(element).attr("writeonly");
myElement._attributes.variant = jQuery(element).attr("variant") || "";
break;
default:
@@ -640,7 +643,8 @@
.append("<div class=\"value editable\" />")
.append("<div class=\"transform editable\" />")
.append("<div class=\"variant editable\" />")
- .append("<div class=\"readonly editable\" />");
+ .append("<div class=\"readonly editable\" />")
+ .append("<div class=\"writeonly editable\" />");
//myDiv.find(".title").append();
var t = Editor.getAddressesObject();
elementDiv.find(".title").append(t.find("option[value='" + elementData.textContent + "']").text());
@@ -653,9 +657,11 @@
elementDiv.find(".variant").hide();
}
elementDiv.find(".readonly").append(elementData._attributes.readonly == "true" ? "readonly" : "")
+ elementDiv.find(".writeonly").append(elementData._attributes.writeonly == "true" ? "writeonly" : "")
elementDiv.data("transform", elementData._attributes.transform)
.data("readonly", elementData._attributes.readonly == "true" ? true : false)
+ .data("writeonly", elementData._attributes.writeonly == "true" ? true : false)
.data("address", elementData.textContent);
if (typeof options == "undefined" || typeof options.variant == "undefined" || options.variant == false) {
Modified: CometVisu/trunk/visu/edit/style_edit.css
===================================================================
--- CometVisu/trunk/visu/edit/style_edit.css 2012-02-02 18:59:06 UTC (rev 680)
+++ CometVisu/trunk/visu/edit/style_edit.css 2012-02-05 10:53:34 UTC (rev 681)
@@ -122,13 +122,13 @@
height: 1em;
}
-.element .value, .element .transform, .element .readonly, .element .variant {
+.element .value, .element .transform, .element .readonly, .element .writeonly, .element .variant {
font-weight: normal;
height: 1em;
font-size: small;
}
-.element .value, .element .readonly {
+.element .value, .element .readonly, .element .writeonly {
float: left;
}
@@ -141,6 +141,11 @@
font-style: italic;
}
+.element .writeonly {
+ margin-left: .4em;
+ font-style: italic;
+}
+
.element .variant {
float: left;
margin-left: .4em;
Modified: CometVisu/trunk/visu/edit/visuconfig_edit.js
===================================================================
--- CometVisu/trunk/visu/edit/visuconfig_edit.js 2012-02-02 18:59:06 UTC (rev 680)
+++ CometVisu/trunk/visu/edit/visuconfig_edit.js 2012-02-05 10:53:34 UTC (rev 681)
@@ -267,6 +267,13 @@
myElement.find("input").attr("checked", "checked");
}
}
+ if ($e.hasClass("writeonly")) {
+ element.find("label").html("writeonly");
+ myElement.append($("<input type=\"checkbox\" name=\"add_writeonly\" class=\"add_writeonly\" value=\"true\" />"));
+ if (typeof $e.text() != "undefined" && $e.text() != "") {
+ myElement.find("input").attr("checked", "checked");
+ }
+ }
if ($e.hasClass("variant") && typeof options.variant != "undefined") {
// variants can be selected from a pre-defined list ONLY.
@@ -318,6 +325,7 @@
objData._attributes.transform = $e.find(".add_transform").val();
objData._attributes.variant = $e.find(".add_variant").val();
objData._attributes.readonly = $e.find(".add_readonly:checked").val();
+ objData._attributes.writeonly = $e.find(".add_writeonly:checked").val();
var options = $e.data("options");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2012-02-05 16:00:13
|
Revision: 682
http://openautomation.svn.sourceforge.net/openautomation/?rev=682&view=rev
Author: makki1
Date: 2012-02-05 16:00:07 +0000 (Sun, 05 Feb 2012)
Log Message:
-----------
CV-Editor: Dropdown-list for RRD in diagram-widgets
Modified Paths:
--------------
CometVisu/trunk/visu/edit/cometeditor.js
CometVisu/trunk/visu/edit/get_widget_diagram.php
Modified: CometVisu/trunk/visu/edit/cometeditor.js
===================================================================
--- CometVisu/trunk/visu/edit/cometeditor.js 2012-02-05 10:53:34 UTC (rev 681)
+++ CometVisu/trunk/visu/edit/cometeditor.js 2012-02-05 16:00:07 UTC (rev 682)
@@ -214,6 +214,17 @@
}
break;
+ case "string": //FIXME: for filling in RRD-name, better would be change attribute e.type=rrd?
+ if (index == "rrd") {
+ $input.append($("<select id=\"add_rrd\" />"));
+ $input.find("select:first").append(Editor.getRRDObject());
+ if (typeof values._attributes != "undefined"
+ && typeof values._attributes[index] != "undefined") {
+ $input.find("option[value='" + values._attributes[index] + "']").attr("selected", "selected");
+ }
+ //FIXME: provide text-input if RRDs failed to get fetched
+ break;
+ } //else fall through
default:
$input.append($("<input type=\"text\" id=\"add_" + index + "\" />"));
@@ -627,6 +638,20 @@
return Editor.cache.cachedDPTObject;
}
+ Editor.getRRDObject = function() {
+ if (typeof Editor.cache.cachedRRDObject == "object") {
+ return Editor.cache.cachedRRDObject.clone();
+ }
+ var element = $("<select />");
+ $.each(Editor.cache.rrdCache, function(file, rrdEntry) {
+ file = file.substring(0,file.lastIndexOf("."));
+ element.append($("<option />").attr("value", file)
+ .html("" + rrdEntry.name + ": " + file + ".rrd (" + rrdEntry.address + ")")
+ );
+ });
+ Editor.cache.cachedRRDObject = element.children();
+ return Editor.cache.cachedRRDObject;
+ }
};
var CometEditorHTMLLayer = function() {
Modified: CometVisu/trunk/visu/edit/get_widget_diagram.php
===================================================================
--- CometVisu/trunk/visu/edit/get_widget_diagram.php 2012-02-05 10:53:34 UTC (rev 681)
+++ CometVisu/trunk/visu/edit/get_widget_diagram.php 2012-02-05 16:00:07 UTC (rev 682)
@@ -21,7 +21,7 @@
$arrRRDParts = explode("_", $filebase, 2);
$arrRRDtype = explode(".", $arrRRDParts[1], 2);
$arrAdresses[$filebase] = array(
- "adddress" => $arrOW[$arrRRDParts[0]]['eib_ga_'.$arrRRDtype[0]],
+ "address" => $arrOW[$arrRRDParts[0]]['eib_ga_'.$arrRRDtype[0]],
"name" => utf8_encode($arrOW[$arrRRDParts[0]]['name']),
"dpt" => $arrGA[$arrOW[$arrRRDParts[0]]['eib_ga_'.$arrRRDtype[0]]]['DPTSubId']
);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|