dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #06074
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1894: Switch to use commons javasript and remove un-used scripts in web maintenance dataset.
Merge authors:
Quang <Quang@Quang-PC>
------------------------------------------------------------
revno: 1894 [merge]
committer: Quang <Quang@Quang-PC>
branch nick: trunk
timestamp: Mon 2010-05-24 23:30:12 +0700
message:
Switch to use commons javasript and remove un-used scripts in web maintenance dataset.
removed:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataElementsList.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/filterTable.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/hashtable.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/request.js
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addSection.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editSection.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortOrderSection.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml 2010-03-24 02:56:06 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml 2010-05-24 16:30:12 +0000
@@ -20,7 +20,7 @@
class="org.hisp.dhis.dataset.action.dataentryform.SelectDataElementAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-dataset/editCustomValues.vm</param>
- <param name="javascripts">javascript/dataSet.js,javascript/dataElementsList.js,javascript/hashtable.js</param>
+ <param name="javascripts">javascript/dataSet.js</param>
<param name="requiredAuthorities">F_DATASET_UPDATE</param>
</action>
@@ -30,7 +30,7 @@
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-dataset/dataSetList.vm</param>
<param name="menu">/dhis-web-maintenance-dataset/menu.vm</param>
- <param name="javascripts">javascript/dataSet.js,javascript/filterTable.js</param>
+ <param name="javascripts">javascript/dataSet.js</param>
</action>
<!-- Section -->
@@ -47,7 +47,7 @@
<param name="page">/dhis-web-maintenance-dataset/addSection.vm</param>
<param name="menu">/dhis-web-maintenance-dataset/menu.vm</param>
<result name="success" type="chain">section</result>
- <param name="javascripts">javascript/dataElementsList.js,javascript/section.js
+ <param name="javascripts">javascript/section.js
,../dhis-web-commons/util/validate/jquery.validate.js,../dhis-web-commons/util/jquery.metadata.js
,../dhis-web-commons/util/validate/additional-methods.js,../dhis-web-commons/util/validate/messages_locale.js</param>
</action>
@@ -59,12 +59,12 @@
<param name="onExceptionReturn">plainTextError</param>
</action>
- <action name="sortOrderSection" class="org.hisp.dhis.dataset.action.section.SortOrderSection">
+ <action name="sortOrderSection" class="org.hisp.dhis.dataset.action.section.SortOrderSection">
<result name="input" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-dataset/sortOrderSection.vm</param>
<param name="menu">/dhis-web-maintenance-dataset/menu.vm</param>
<result name="success" type="chain">section</result>
- <param name="javascripts">javascript/dataElementsList.js,javascript/dataSet.js</param>
+ <param name="javascripts">javascript/dataSet.js</param>
</action>
<action name="editSectionAction"
@@ -72,7 +72,7 @@
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-dataset/editSection.vm</param>
<param name="menu">/dhis-web-maintenance-dataset/menu.vm</param>
- <param name="javascripts">javascript/dataElementsList.js,javascript/dataSet.js
+ <param name="javascripts">javascript/dataSet.js
,../dhis-web-commons/util/validate/jquery.validate.js,../dhis-web-commons/util/jquery.metadata.js
,../dhis-web-commons/util/validate/additional-methods.js,../dhis-web-commons/util/validate/messages_locale.js</param>
</action>
@@ -125,7 +125,7 @@
class="org.hisp.dhis.dataset.action.PeriodTypeListAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-dataset/addDataSet.vm</param>
- <param name="javascripts">javascript/shortName.js,javascript/dataSet.js,javascript/dataElementsList.js
+ <param name="javascripts">javascript/shortName.js,javascript/dataSet.js
,../dhis-web-commons/util/validate/jquery.validate.js,../dhis-web-commons/util/jquery.metadata.js
,../dhis-web-commons/util/validate/additional-methods.js,../dhis-web-commons/util/validate/messages_locale.js</param>
<param name="requiredAuthorities">F_DATASET_ADD</param>
@@ -155,7 +155,7 @@
class="org.hisp.dhis.dataset.action.PeriodTypeListAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-dataset/editDataSet.vm</param>
- <param name="javascripts">javascript/dataSet.js,javascript/dataElementsList.js
+ <param name="javascripts">javascript/dataSet.js
,../dhis-web-commons/util/validate/jquery.validate.js,../dhis-web-commons/util/jquery.metadata.js
,../dhis-web-commons/util/validate/additional-methods.js,../dhis-web-commons/util/validate/messages_locale.js</param>
<param name="requiredAuthorities">F_DATASET_UPDATE</param>
@@ -244,7 +244,7 @@
class="org.hisp.dhis.dataset.action.GetDataSetAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-dataset/dataSetAssociations.vm</param>
- <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/dataElementsList.js,javascript/associations.js</param>
+ <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/associations.js</param>
<param name="requiredAuthorities">F_DATASET_UPDATE</param>
</action>
@@ -254,7 +254,7 @@
class="org.hisp.dhis.dataset.action.dataentryform.ViewDataEntryFormAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-dataset/viewDataEntryForm.vm</param>
- <param name="javascripts">javascript/dataEntryForm.js,javascript/FCK/fckeditor.js,javascript/hashtable.js
+ <param name="javascripts">javascript/dataEntryForm.js,javascript/FCK/fckeditor.js
,../dhis-web-commons/util/validate/jquery.validate.js,../dhis-web-commons/util/jquery.metadata.js
,../dhis-web-commons/util/validate/additional-methods.js,../dhis-web-commons/util/validate/messages_locale.js</param>
<param name="stylesheets">css/cde.css</param>
@@ -283,25 +283,24 @@
class="org.hisp.dhis.dataset.action.dataentryform.SelectDataElementAction">
<result name="success" type="velocity">selectDataElement.vm</result>
<result name="input" type="velocity-xml">/dhis-web-maintenance-dataset/responseInput.vm</result>
- <param name="javascripts">javascript/hashtable.js</param>
</action>
<action name="getSelectedDataElements"
class="org.hisp.dhis.dataset.action.dataentryform.GetSelectedDataElementsAction">
<result name="success" type="velocity-xml">/dhis-web-maintenance-dataset/responseSelDataElementList.vm</result>
- <param name="javascripts">javascript/dataEntryForm.js,javascript/FCK/fckeditor.js,javascript/hashtable.js</param>
+ <param name="javascripts">javascript/dataEntryForm.js,javascript/FCK/fckeditor.js</param>
</action>
<action name="getOptionCombos"
class="org.hisp.dhis.dataset.action.dataentryform.GetOptionCombosAction">
<result name="success" type="velocity-xml">/dhis-web-maintenance-dataset/responseOptionCombo.vm</result>
- <param name="javascripts">javascript/dataEntryForm.js,javascript/FCK/fckeditor.js,javascript/hashtable.js</param>
+ <param name="javascripts">javascript/dataEntryForm.js,javascript/FCK/fckeditor.js</param>
</action>
<action name="getCustomValues"
class="org.hisp.dhis.dataset.action.dataentryform.GetCustomValuesAction">
<result name="success" type="velocity-xml">/dhis-web-maintenance-dataset/responseCustomValue.vm</result>
- <param name="javascripts">javascript/dataEntryForm.js,javascript/FCK/fckeditor.js,javascript/hashtable.js</param>
+ <param name="javascripts">javascript/dataEntryForm.js,javascript/FCK/fckeditor.js</param>
</action>
<!-- Compulsory data elements -->
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addSection.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addSection.vm 2010-04-19 09:54:45 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addSection.vm 2010-05-21 15:41:26 +0000
@@ -10,6 +10,7 @@
,errorElement:"td"
,submitHandler: function(form)
{
+ selectAllById( 'selectedList' );
validateAddSection();
}
});
@@ -17,7 +18,6 @@
jQuery("#sectionName").focus();
}
);
-
</script>
<input type="hidden" id="curLocaleCode" value="$locale.getLanguage()_$locale.getCountry()"/>
<h3>$i18n.getString( "add_section" )</h3>
@@ -65,7 +65,7 @@
<tr>
<td>
<!-- List of all available DataElements -->
- <select size="15" id="availableList" name="availableList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="move( 'availableList' )">
+ <select size="15" id="availableList" name="availableList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="moveSelected( this, document.getElementById( 'selectedList' ) )">
<!-- Show all available DataElements -->
#foreach ( $availableDataElement in $dataElements )
<option value="$availableDataElement.id">$encoder.htmlEncode( $availableDataElement.name )</option>
@@ -74,13 +74,13 @@
</td>
<td valign="top">
- <input type="button" value=">" title="$i18n.getString('move_selected')" onclick="move( 'availableList' )">
+ <input type="button" value=">" title="$i18n.getString('move_selected')" onclick="moveSelected( document.getElementById( 'availableList' ), document.getElementById( 'selectedList' ) )">
<br>
- <input type="button" value="<" title="$i18n.getString('remove_selected')" onclick="move ( 'selectedList' )">
+ <input type="button" value="<" title="$i18n.getString('remove_selected')" onclick="moveSelected( document.getElementById( 'selectedList' ), document.getElementById( 'availableList' ) )">
</td>
<td>
- <select id="selectedList" name="selectedList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="move( 'selectedList' )">
+ <select id="selectedList" name="selectedList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="moveSelected( this, document.getElementById( 'availableList' ) )">
<!-- initially empty -->
</select>
</td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editSection.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editSection.vm 2010-04-21 11:40:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editSection.vm 2010-05-21 09:02:33 +0000
@@ -11,7 +11,7 @@
,submitHandler: function(form)
{
// select all in the selectedList!
- submitForm();
+ selectAllById( 'selectedList' );
// actually submit the form
document.forms['editDataSetForm'].submit();
}
@@ -68,7 +68,7 @@
<tr>
<td>
<!-- List of all available DataElements -->
- <select size="15" id="availableList" name="availableList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="move( 'availableList' )">
+ <select size="15" id="availableList" name="availableList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="moveSelected( this, document.getElementById( 'selectedList' ) )">
<!-- Show all available DataElements -->
#foreach ( $availableDataElement in $dataElementOfDataSet )
<option value="$availableDataElement.id"> $availableDataElement.name</option>
@@ -76,12 +76,12 @@
</select>
</td>
<td valign="top">
- <input type="button" value=">" title="$i18n.getString('move_selected')" onclick="move( 'availableList' )">
+ <input type="button" value=">" title="$i18n.getString('move_selected')" onclick="moveSelected( document.getElementById( 'availableList' ), document.getElementById( 'selectedList' ) )">
<br>
- <input type="button" value="<" title="$i18n.getString('remove_selected')" onclick="move( 'selectedList' )">
+ <input type="button" value="<" title="$i18n.getString('remove_selected')" onclick="moveSelected( document.getElementById( 'selectedList' ), document.getElementById( 'availableList' ) )">
</td>
<td>
- <select id="selectedList" name="selectedList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="move( 'selectedList' )">
+ <select id="selectedList" name="selectedList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="moveSelected( this, document.getElementById( 'availableList' ) )">
#foreach ( $dataElement in $dataElementsOfSection )
<option value="$dataElement.id">$dataElement.name</option>
#end
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataElementsList.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataElementsList.js 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataElementsList.js 1970-01-01 00:00:00 +0000
@@ -1,51 +0,0 @@
-var selectedList;
-var availableList;
-
-function move( listId ) {
-
- var fromList = document.getElementById(listId);
-
- if ( fromList.selectedIndex == -1 ) { return; }
-
- if ( ! availableList ) {
- availableList = document.getElementById('availableList');
- }
-
- if ( ! selectedList ) {
- selectedList = document.getElementById('selectedList');
- }
-
- var toList = ( fromList == availableList ? selectedList : availableList );
-
- while ( fromList.selectedIndex > -1 ) {
- option = fromList.options.item(fromList.selectedIndex);
- fromList.remove(fromList.selectedIndex);
- toList.add(option, null);
- }
-
-}
-
-function submitForm() {
-
- if ( ! availableList ) {
- availableList = document.getElementById('availableList');
- }
-
- if ( ! selectedList ) {
- selectedList = document.getElementById('selectedList');
- }
-
- // selectAll(availableList);
- selectAll(selectedList);
-
- return false;
-
-}
-
-function selectAll(list) {
-
- for ( var i = 0, option; option = list.options.item(i); i++ ) {
- option.selected = true;
- }
-
-}
\ No newline at end of file
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/filterTable.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/filterTable.js 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/filterTable.js 1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
-
-function filterValues( filter )
-{
- var list = document.getElementById( 'list' );
-
- var rows = list.getElementsByTagName( 'tr' );
-
- for ( var i = 0; i < rows.length; ++i )
- {
- var cell = rows[i].getElementsByTagName( 'td' )[0];
-
- var value = cell.firstChild.nodeValue;
-
- value = value.toLowerCase();
- filter = filter.toLowerCase();
-
- if ( value.indexOf( filter ) != -1 )
- {
- rows[i].style.display = 'table-row';
- }
- else
- {
- rows[i].style.display = 'none';
- }
- }
-}
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/hashtable.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/hashtable.js 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/hashtable.js 1970-01-01 00:00:00 +0000
@@ -1,310 +0,0 @@
-/**
- * <p>Implements a sortable hashtable which accepts non-<code>null</code> String
- * keys and non-<code>null</code> values.</p>
- *
- * <p>This object is primarily intended to address the shortcomings of using an
- * Object as a hashtable, by managing the names of the properties which are
- * stored in an Object.</p>
- *
- * <p>HashTable does not define a hashing function, as Object's built-in
- * hashing is used for storing and retrieving items.</p>
- *
- * <p>Initial values are taken from any Objects passed into the constructor:
- * if another HashTable is given as an argument, its contents will be taken.</p>
- *
- * @constructor
- */
-var HashTable = function()
-{
- /**
- * Storage object - values are stored as properties whose names are hashtable
- * keys.
- *
- * @type Object
- * @private
- */
- this._store = {};
-
- /**
- * A list of hashtable keys.
- *
- * @type Array
- * @private
- */
- this._keys = [];
-
- for (var i = 0; i < arguments.length; i++)
- {
- this._putFromObject(arguments[i]);
- }
-};
-
-/**
- * Puts all properties from a given HashTable or Object into the hashtable.
- *
- * @param {Object} source an object whose values will be put into the hashtable.
- * @private
- */
-HashTable.prototype._putFromObject = function(source)
-{
- if (source.constructor == HashTable)
- {
- source.forEach(function(k, v)
- {
- this.put(k, v);
- }, this);
- }
- else
- {
- for (property in source)
- {
- if (source.hasOwnProperty(property))
- {
- this.put(property, source[property]);
- }
- }
- }
-};
-
-/**
- * Clears the hashtable.
- */
-HashTable.prototype.clear = function()
-{
- this._store = {};
- this._keys = [];
-};
-
-/**
- * An iterator which calls the given function, passing key, value, item index and a
- * reference to this Hashtable for each item in the hashtable.
- *
- * @param {Function} callback the function to be called for each item.
- * @param {Object} context an optional context object for the calls to block.
- *
- * @see "Enumerating Javascript Objects", http://dean.edwards.name/weblog/2006/07/enum/
- */
-HashTable.prototype.forEach = function(callback, context)
-{
- for (var i = 0, l = this._keys.length; i < l; i++)
- {
- callback.call(context, this._keys[i], this._store[this._keys[i]], i, this);
- }
-};
-
-/**
- * Retrieves the item with the given key.
- *
- * @param {String} key the key for the item to be retrieved.
- * @return the item stored in this HashTable with the given key if one exists,
- * <code>null</code> otherwise.
- */
-HashTable.prototype.get = function(key)
-{
- var result = null;
- if (typeof(this._store[key]) != "undefined")
- {
- result = this._store[key];
- }
- return result;
-};
-
-/**
- * Determines if the hashtable contains the given key.
- *
- * @param {String} key the key to be searched for.
- * @return <code>true</code> if this HashTable contains the given key,
- * <code>false</code> otherwise.
- * @type Boolean
- */
-HashTable.prototype.hasKey = function(key)
-{
- var result = false;
- this.forEach(function(k)
- {
- if (key == k)
- {
- result = true;
- return true;
- }
- });
- return result;
-};
-
-/**
- * Determines if the hashtable contains the given value.
- *
- * @param {Object} value the value to be searched for.
- * @return <code>true</code> if this HashTable contains the given value,
- * <code>false</code> otherwise.
- * @type Boolean
- */
-HashTable.prototype.hasValue = function(value)
-{
- var result = false;
- this.forEach(function(k, v)
- {
- if (value == v)
- {
- result = true;
- return true;
- }
- });
- return result;
-};
-
-/**
- * Creates Object representations of the items in the hashtable.
- *
- * @return the items in the hashtable, represented as Objects with "key"
- * and "value" properties.
- * @type Array
- */
-HashTable.prototype.items = function()
-{
- var items = [];
- this.forEach(function(k, v)
- {
- items.push({"key": k, "value": v});
- });
- return items;
-};
-
-/**
- * Retrieves the hashtable's keys.
- *
- * @return the hashtable's keys.
- * @type Array
- */
-HashTable.prototype.keys = function()
-{
- var keys = [];
- this.forEach(function(key)
- {
- keys.push(key);
- });
- return keys;
-};
-
-/**
- * Puts an item into the hashtable.
- *
- * @param {String} key the key under which the item should be stored.
- * @param {Object} value the item to be stored.
- */
-HashTable.prototype.put = function(key, value)
-{
- if (key == undefined || key == null || typeof(key) != "string"
- || value == undefined || value == null)
- {
- return;
- }
-
- if (typeof(this._store[key]) == "undefined")
- {
- this._keys.push(key);
- }
-
- this._store[key] = value;
-};
-
-/**
- * Removes an item from the hashtable and returns it.
- *
- * @param {String} key the key for the item to be removed.
- * @return the item which was removed, or <code>null</code> if the item did not
- * exist.
- */
-HashTable.prototype.remove = function(key)
-{
- var result = null;
- for (var i = 0, l = this._keys.length; i < l; i++)
- {
- if (key == this._keys[i])
- {
- result = this._store[key];
- delete(this._store[key]);
- this._keys.splice(i, 1);
- break;
- }
- }
- return result;
-};
-
-/**
- * Determines the number of entries in the hashtable.
- *
- * @return the number of entries in this HashTable.
- * @type Number
- */
-HashTable.prototype.size = function()
-{
- return this._keys.length;
-};
-
-/**
- * Sorts the keys of the hashtable.
- *
- * @param {Function} comparator an optional function which will be used to sort
- * the keys - if not provided, they will be sorted
- * lexographically (in dictionary order).
- */
-HashTable.prototype.sort = function(comparator)
-{
- if (typeof(comparator) == "function")
- {
- this._keys.sort(comparator);
- }
- else
- {
- this._keys.sort();
- }
-};
-
-/**
- * Creates a String representation of the hashtable.
- *
- * @return a String representation of this {@link HashTable}.
- * @type String
- */
-HashTable.prototype.toString = function()
-{
- var result = "{";
- this.forEach(function(key, value, index)
- {
- if (index != 0)
- {
- result += ", ";
- }
- result += key + ": " + value;
- });
- result += "}";
- return result;
-};
-
-/**
- * Updates the hashtable with the values contained in a given {@link HashTable}
- * or Object.
- *
- * @param {Object} source an object whose values will be put into the hashtable.
- */
-HashTable.prototype.update = function(source)
-{
- this._putFromObject(source);
-};
-
-/**
- * Retrieves the hashtable's values.
- *
- * @return the hashtable's values.
- * @type Array
- */
-HashTable.prototype.values = function()
-{
- var values = [];
- this.forEach(function(key, value)
- {
- values.push(value);
- });
- return values;
-};
\ No newline at end of file
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/request.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/request.js 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/request.js 1970-01-01 00:00:00 +0000
@@ -1,199 +0,0 @@
-
-// -----------------------------------------------------------------------------
-// Author: Torgeir Lorange Ostby, torgeilo@xxxxxxxxx
-// Version: $Id: request.js 2644 2007-01-03 13:24:56Z torgeilo $
-// -----------------------------------------------------------------------------
-
-/*
- * Usage:
- *
- * function processResponse( response ) { ... } // Text or XML
- * function requestFailed( httpStatusCode ) { ... }
- *
- * var request = new Request();
- * request.setResponseTypeXML( 'rootElement' ); // Optional
- * request.sendAsPost( 'value=1&value=2' ); // Optional
- * request.setCallbackSuccess( processResponse ); // Optional
- * request.setCallbackError( requestFailed ); // Optional
- * request.send( 'url.action?value=1' );
- */
-
-function Request()
-{
- var request;
- var responseType = 'TEXT';
- var requestMethod = 'GET';
- var requestParameters = null;
- var rootElementName;
- var callbackSuccess;
- var callbackError;
-
- this.setResponseTypeXML = function( rootElementName_ )
- {
- responseType = 'XML';
- rootElementName = rootElementName_;
- };
-
- this.sendAsPost = function( requestParameters_ )
- {
- requestMethod = 'POST';
- requestParameters = requestParameters_;
- };
-
- this.setCallbackSuccess = function( callbackSuccess_ )
- {
- callbackSuccess = callbackSuccess_;
- };
-
- this.setCallbackError = function( callbackError_ )
- {
- callbackError = callbackError_;
- };
-
- this.send = function( url )
- {
- request = newXMLHttpRequest();
-
- if ( !request )
- {
- window.alert( "Your browser doesn't support XMLHttpRequest" );
- return;
- }
-
- request.onreadystatechange = responseReceived;
- request.open( requestMethod, url, true );
- request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' );
- request.send( requestParameters );
- };
-
- function newXMLHttpRequest()
- {
- if ( window.XMLHttpRequest )
- {
- try
- {
- return new XMLHttpRequest();
- }
- catch ( e )
- {
- return false;
- }
- }
- else if ( window.ActiveXObject )
- {
- try
- {
- return new ActiveXObject( 'Msxml2.XMLHTTP' );
- }
- catch ( e )
- {
- try
- {
- return new ActiveXObject( 'Microsoft.XMLHTTP' );
- }
- catch ( ee )
- {
- return false;
- }
- }
- }
-
- return false;
- }
-
- function responseReceived()
- {
- if ( request.readyState == 4 )
- {
- switch( request.status )
- {
- case 200:
- if ( callbackSuccess )
- {
- if ( responseType == 'TEXT' )
- {
- callbackSuccess( request.responseText );
- }
- else
- {
- var xml = textToXML( request.responseText, rootElementName );
-
- callbackSuccess( xml );
- }
- }
- break;
- case 204:
- if ( callbackSuccess )
- {
- callbackSuccess( null );
- }
- break;
- case 500:
- var message = 'Operation failed - internal server error';
-
- var serverMessage = request.responseText;
-
- if ( serverMessage )
- {
- var maxLength = 512;
-
- if ( serverMessage.length > maxLength )
- {
- serverMessage = serverMessage.substring( 0, maxLength - 3 ) + '...';
- }
-
- if ( serverMessage.length > 0 )
- {
- message += '\n\n' + serverMessage;
- }
- }
-
- message += '\n\nThe error details are logged';
-
- window.alert( message );
-
- break;
- default:
- if ( callbackError )
- {
- callbackError( request.status );
- }
- }
- }
- }
-
- function textToXML( text, rootElementName )
- {
- var docImpl = document.implementation;
- var parser, dom;
-
- // For standards compliant browsers
- if ( docImpl && docImpl.createLSParser )
- {
- parser = docImpl.createLSParser( docImpl.MODE_SYNCHRONOUS, null );
- var input = docImpl.createLSInput();
- input.stringData = text;
- return parser.parse( input ).documentElement;
- }
-
- // For IE
- else if ( window.ActiveXObject )
- {
- dom = new ActiveXObject( 'Microsoft.XMLDOM' );
- dom.async = "false";
- dom.loadXML( text );
- return dom.getElementsByTagName( rootElementName )[0];
- }
-
- // For Mozilla
- else if ( window.DOMParser )
- {
- parser = new DOMParser();
- dom = parser.parseFromString( text, 'application\/xml' );
- return dom.documentElement;
- }
-
- // No parsing abilities
- return null;
- }
-}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortOrderSection.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortOrderSection.vm 2009-11-03 09:05:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortOrderSection.vm 2010-05-21 16:16:11 +0000
@@ -1,7 +1,7 @@
<h3>$i18n.getString( "add_section" )</h3>
-<form id="sortOrderForm" name="sortOrderForm" action="sortOrderSection.action" method="post" onsubmit="submitForm();">
+<form id="sortOrderForm" name="sortOrderForm" action="sortOrderSection.action" method="post" onsubmit="selectAllById( 'selectedList' );">
<table id="detailsList">
<col> ## Labels
<col> ## Input
@@ -34,19 +34,19 @@
<tbody>
<tr>
<td>
- <select size="15" id="availableList" name="availableList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="move( 'availableList' )">
+ <select size="15" id="availableList" name="availableList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="moveSelected( this, document.getElementById( 'selectedList' ) )">
#foreach ( $section in $sections )
<option value="$section.id">$encoder.htmlEncode( $section.name )</option>
#end
</select>
</td>
<td valign="top">
- <input type="button" value=">" title="$i18n.getString('move_selected')" onclick="move( 'availableList' )">
+ <input type="button" value=">" title="$i18n.getString('move_selected')" onclick="moveSelected( document.getElementById( 'availableList' ), document.getElementById( 'selectedList' ) )">
<br>
- <input type="button" value="<" title="$i18n.getString('remove_selected')" onclick="move ( 'selectedList' )">
+ <input type="button" value="<" title="$i18n.getString('remove_selected')" onclick="moveSelected( document.getElementById( 'selectedList' ), document.getElementById( 'availableList' ) )">
</td>
<td>
- <select id="selectedList" name="selectedList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="move( 'selectedList' )">
+ <select id="selectedList" name="selectedList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="moveSelected( this, document.getElementById( 'availableList' ) )">
</select>
</td>
</tr>