dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16080
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6016: Consistent code-style
------------------------------------------------------------
revno: 6016
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-02-17 11:35:31 +0100
message:
Consistent code-style
modified:
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
--
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-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2012-02-17 06:58:48 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2012-02-17 10:35:31 +0000
@@ -69,9 +69,9 @@
*/
$( document ).ready( function()
{
- $.ajaxSetup({
+ $.ajaxSetup( {
type: 'POST'
- });
+ } );
selection.setListenerFunction( organisationUnitSelected );
$( '#loaderSpan' ).show();
@@ -250,11 +250,13 @@
cache: false,
success: function( data, textStatus, jqXHR )
{
- if(data.c == 2) {
+ if ( data.c == 2 ) {
log( 'DataSet is now locked' );
setHeaderMessage( i18n_saving_value_failed_dataset_is_locked );
- } else {
+ }
+ else
+ {
storageManager.clearDataValueJSON( value );
log( 'Successfully saved data value with value: ' + value );
( array = array.slice( 1 ) ).length && pushDataValues( array );
@@ -517,18 +519,19 @@
// -----------------------------------------------------------------------------
// Locking
// -----------------------------------------------------------------------------
+
function getLockStatus()
{
var periodId = $( '#selectedPeriodId' ).val();
var dataSetId = $( '#selectedDataSetId' ).val();
var locked = false;
- if(periodId == null || dataSetId == -1)
+ if ( periodId == null || dataSetId == -1 )
{
return false;
}
- $.ajax({
+ $.ajax( {
url: 'getLockStatus.action',
async: false,
data: {
@@ -539,7 +542,7 @@
success: function (data) {
locked = data.locked;
}
- });
+ } );
return locked;
}
@@ -781,16 +784,16 @@
if( getLockStatus() )
{
- $("#contentDiv :input").attr("disabled", true);
+ $( '#contentDiv :input' ).attr( 'disabled', true );
$( '#currentDataElement' ).html( i18n_dataset_is_locked );
}
else
{
- $("#contentDiv :input").removeAttr("disabled");
+ $( '#contentDiv :input' ).removeAttr( 'disabled' );
$( '#currentDataElement' ).html( i18n_no_dataelement_selected );
}
- $("#contentDiv :input").css("backgroundColor", "white");
+ $( '#contentDiv :input' ).css( 'background-color', 'white' );
}
function valueFocus( e )
@@ -965,7 +968,7 @@
var url = '../dhis-web-commons-ajax-json/getUser.action';
$.getJSON( url, { username:currentCompletedByUser }, function( json ) {
- $( '#userFullName' ).html( json.user.firstName + " " + json.user.surname );
+ $( '#userFullName' ).html( json.user.firstName + ' ' + json.user.surname );
$( '#userUsername' ).html( json.user.username );
$( '#userEmail' ).html( json.user.email );
$( '#userPhoneNumber' ).html( json.user.phoneNumber );