|
From: <ma...@us...> - 2011-09-19 15:58:18
|
Revision: 420
http://openautomation.svn.sourceforge.net/openautomation/?rev=420&view=rev
Author: mayerch
Date: 2011-09-19 15:58:09 +0000 (Mon, 19 Sep 2011)
Log Message:
-----------
New Feature: widgets can be (optionally) marked by a maturity value, so the editor can ignore them if they or itself isn't mature enough.
The maturity level can be set through the optional URL parameter "maturity". This can either be the number directly or one of the maturity ENUM values. These are currently: "release" and "development"
Modified Paths:
--------------
CometVisu/trunk/visu/designs/structure_pure.js
CometVisu/trunk/visu/edit/visuconfig_edit.js
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2011-09-18 13:06:41 UTC (rev 419)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2011-09-19 15:58:09 UTC (rev 420)
@@ -15,6 +15,13 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
+// Define ENUM of maturity levels for features, so that e.g. the editor can
+// ignore some widgets when they are not supported yet
+var Maturity = {
+ release : 0,
+ development : 1
+};
+
/**
* This class defines all the building blocks for a Visu in the "Pure" design
*/
@@ -86,6 +93,7 @@
});
this.addCreator('group', {
+ maturity: Maturity.development,
create: function( page, path, flavour ) {
var $p = $(page);
var ret_val = $('<div class="widget group" />');
Modified: CometVisu/trunk/visu/edit/visuconfig_edit.js
===================================================================
--- CometVisu/trunk/visu/edit/visuconfig_edit.js 2011-09-18 13:06:41 UTC (rev 419)
+++ CometVisu/trunk/visu/edit/visuconfig_edit.js 2011-09-19 15:58:09 UTC (rev 420)
@@ -138,6 +138,11 @@
// "unknown" is not a good choice for a new widget :)
return;
}
+ if( design.creators[index].maturity > use_maturity )
+ {
+ // widget is not mature enough to show in the edior
+ return;
+ }
$("#addMaster").find("select#add_type").append(
$("<option />").attr("value", index).html(index)
);
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2011-09-18 13:06:41 UTC (rev 419)
+++ CometVisu/trunk/visu/lib/templateengine.js 2011-09-19 15:58:09 UTC (rev 420)
@@ -62,6 +62,18 @@
forceReload = $.getUrlVar('forceReload') != 'false'; // true unless set to false
}
+// Disable features that aren't ready yet
+// This can be overwritten in the URL with the parameter "maturity"
+var use_maturity;
+if( $.getUrlVar('maturity') ) {
+ var url_maturity = $.getUrlVar('maturity');
+ if( !isNaN ( url_maturity - 0 ) )
+ use_maturity = url_maturity - 0; // given directly as number
+ else
+ use_maturity = Maturity[ url_maturity ]; // or as the ENUM name
+}
+if( isNaN( use_maturity ) ) use_maturity = Maturity.release; // default to release
+
$(document).ready(function() {
// get the data once the page was loaded
$.ajaxSetup({cache: !forceReload});
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|