diff --git a/batch-processing/src/main/webapp/index.html b/batch-processing/src/main/webapp/index.html index f161c4e913..7420332470 100644 --- a/batch-processing/src/main/webapp/index.html +++ b/batch-processing/src/main/webapp/index.html @@ -20,4 +20,4 @@ - \ No newline at end of file + diff --git a/bmt/src/main/webapp/index.html b/bmt/src/main/webapp/index.html index d74dc4aed1..d53341f665 100644 --- a/bmt/src/main/webapp/index.html +++ b/bmt/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - - + + + + + + + + diff --git a/cdi-injection/src/main/webapp/index.html b/cdi-injection/src/main/webapp/index.html index ee63587b7f..701437aa0e 100644 --- a/cdi-injection/src/main/webapp/index.html +++ b/cdi-injection/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - - + + + + + + + + diff --git a/cmt/src/main/webapp/index.html b/cmt/src/main/webapp/index.html index a02b72f73b..a78a0b2bfe 100644 --- a/cmt/src/main/webapp/index.html +++ b/cmt/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - + + + + + + + diff --git a/contacts-jquerymobile/src/main/webapp/index.html b/contacts-jquerymobile/src/main/webapp/index.html index 9fa3bce91a..65184d3334 100644 --- a/contacts-jquerymobile/src/main/webapp/index.html +++ b/contacts-jquerymobile/src/main/webapp/index.html @@ -38,23 +38,23 @@ - + - + - + - + @@ -73,7 +73,7 @@ - + @@ -87,20 +87,20 @@ - - - + -
@@ -139,7 +139,7 @@

Try out these different Themes!

- +
@@ -167,7 +167,7 @@

Contacts

Red Hat JBoss Quickstarts

- +
@@ -189,7 +189,7 @@

About

- +
@@ -203,11 +203,11 @@

About

Add Contact

-
@@ -238,8 +238,8 @@

Add Contact

Save @@ -250,10 +250,10 @@

Add Contact

-
+
- +
@@ -269,14 +269,14 @@

Edit Contact

Delete
-
@@ -310,8 +310,8 @@

Edit Contact

Save @@ -322,7 +322,7 @@

Edit Contact

-
+
@@ -330,8 +330,8 @@

Edit Contact

Delete Contact

-

Are you sure you want to Delete?

@@ -340,6 +340,6 @@

Are you sure you want to Delete?

- + diff --git a/contacts-jquerymobile/src/main/webapp/js/app.js b/contacts-jquerymobile/src/main/webapp/js/app.js index 6419559de0..3ada7aeac7 100644 --- a/contacts-jquerymobile/src/main/webapp/js/app.js +++ b/contacts-jquerymobile/src/main/webapp/js/app.js @@ -23,49 +23,49 @@ CONTACTS.namespace('CONTACTS.app.restEndpoint'); CONTACTS.app.restEndpoint = 'rest/contacts'; /** - * It is recommended to bind to this event instead of DOM ready() because this will work regardless of whether + * It is recommended to bind to this event instead of DOM ready() because this will work regardless of whether * the page is loaded directly or if the content is pulled into another page as part of the Ajax navigation system. - * - * The first thing you learn in jQuery is to call code inside the $(document).ready() function so everything - * will execute as soon as the DOM is loaded. However, in jQuery Mobile, Ajax is used to load the contents of - * each page into the DOM as you navigate, and the DOM ready handler only executes for the first page. - * To execute code whenever a new page is loaded and created, you can bind to the pagecreate event. - * - * + * + * The first thing you learn in jQuery is to call code inside the $(document).ready() function so everything + * will execute as soon as the DOM is loaded. However, in jQuery Mobile, Ajax is used to load the contents of + * each page into the DOM as you navigate, and the DOM ready handler only executes for the first page. + * To execute code whenever a new page is loaded and created, you can bind to the pagecreate event. + * + * * These functions perform the GET. They display the list, detailed list, and fill in the update form. - * + * * @author Joshua Wilson */ $( document ).on( "pagecreate", function(mainEvent) { //Initialize the vars in the beginning so that you will always have access to them. var getCurrentTime = CONTACTS.util.getCurrentTime, restEndpoint = CONTACTS.app.restEndpoint; - + console.log(getCurrentTime() + " [js/app.js] (document -> pagecreate) - start"); - - /* + + /* * Make sure the Contacts list gets populated but only once. - * + * * The "pagebeforeshow" event will delay this function until everything is set up. - * - * Because of the interesting jQM loading architecture, multiple event triggering is a constant problem. - * The "e.handled" if statement used here and elsewhere is meant to keep jQM from running this code multiple - * times for one display. + * + * Because of the interesting jQM loading architecture, multiple event triggering is a constant problem. + * The "e.handled" if statement used here and elsewhere is meant to keep jQM from running this code multiple + * times for one display. */ $('#contacts-list-page').on( "pagebeforeshow", function(e) { if(e.handled !== true) { console.log(getCurrentTime() + " [js/app.js] (#contacts-list-page -> pagebeforeshow) - start"); - + // Fetches the initial Contact data. CONTACTS.app.getContacts(); - + e.handled = true; console.log(getCurrentTime() + " [js/app.js] (#contacts-list-page -> pagebeforeshow) - end"); } }); - + // This is called on 'pagebeforeshow' above and by the CONTACTS.submissions - // Uses JAX-RS GET to retrieve current contact list. + // Uses JAX-RS GET to retrieve current contact list. CONTACTS.app.getContacts = function () { console.log(getCurrentTime() + " [js/app.js] (getContacts) - start"); var jqxhr = $.ajax({ @@ -90,14 +90,14 @@ $( document ).on( "pagecreate", function(mainEvent) { console.log(getCurrentTime() + " [js/app.js] (buildContactList) - start"); var contactList = "", contactDetailList = ""; - + // The data from the AJAX call is not sorted alphabetically, this will fix that. contacts.sort(function(a,b){ var aName = a.firstName.toLowerCase() + a.lastName.toLowerCase(); - var bName = b.firstName.toLowerCase() + b.lastName.toLowerCase(); + var bName = b.firstName.toLowerCase() + b.lastName.toLowerCase(); return ((aName < bName) ? -1 : ((aName > bName) ? 1 : 0)); }); - + // Pull the info out of the Data returned from the AJAX request and create the HTML to be placed on the page. $.each(contacts, function(index, contact) { // Create the HTML for the List only view. @@ -116,75 +116,75 @@ $( document ).on( "pagecreate", function(mainEvent) { "
" + ""); }); - + // Start with a clean list element otherwise we would have repeats. $('#contacts-display-listview').empty(); - + // Check if it is already initialized or not, refresh the list in case it is initialized otherwise trigger create. if ( $('#contacts-display-listview').hasClass('ui-listview')) { console.log(getCurrentTime() + " [js/app.js] (#contacts-display-listview - hasClass ui-listview) - append.listview - start"); $('#contacts-display-listview').append(contactList).listview("refresh", true); console.log(getCurrentTime() + " [js/app.js] (#contacts-display-listview - hasClass ui-listview) - append.listview - end"); - } + } else { console.log(getCurrentTime() + " [js/app.js] (#contacts-display-listview - !hasClass ui-listview) - append.trigger - start"); $('#contacts-display-listview').append(contactList).enhanceWithin(); console.log(getCurrentTime() + " [js/app.js] (#contacts-display-listview - !hasClass ui-listview) - append.trigger - end"); - } - + } + // Start with a clean list element otherwise we would have repeats. $('#contacts-display-detail-listview').empty(); - + // check if it is already initialized or not, refresh the list in case it is initialized otherwise trigger create if ( $('#contacts-display-detail-listview').hasClass('ui-listview')) { console.log(getCurrentTime() + " [js/app.js] (#contacts-display-detail-listview - hasClass ui-listview) - append.listview - start"); $('#contacts-display-detail-listview').append(contactDetailList).listview("refresh", true); console.log(getCurrentTime() + " [js/app.js] (#contacts-display-detail-listview - hasClass ui-listview) - append.listview - end"); - } + } else { console.log(getCurrentTime() + " [js/app.js] (#contacts-display-detail-listview - !hasClass ui-listview) - append.trigger - start"); $('#contacts-display-detail-listview').append(contactDetailList).enhanceWithin(); console.log(getCurrentTime() + " [js/app.js] (#contacts-display-detail-listview - !hasClass ui-listview) - append.trigger - end"); - } - + } + // Attach onclick event to each row of the contact list that will open up the contact info to be edited. $('.contacts-list-item').on("click", function(event){ if(event.handled !== true) { console.log(getCurrentTime() + " [js/app.js] (.contacts-display-listview -> on click) - start"); - + CONTACTS.app.getContactById($(this).attr("id").split("list-contact-ID-").pop()); - + event.handled = true; console.log(getCurrentTime() + " [js/app.js] (.contacts-display-listview -> on click) - end"); } }); - + // Attach onclick event to each row of the contact list detailed page that will open up the contact info to be edited. $('li.contacts-detail-list-item').on("click", function(event){ if(event.handled !== true) { console.log(getCurrentTime() + " [js/app.js] (li.contacts-display-listview -> on click) - start"); - + CONTACTS.app.getContactById($(this).attr("id").split("detail-contact-ID-").pop()); - + // Turn the whole
  • into a link. $("body").pagecontainer("change", "#contacts-edit-page"); - + event.handled = true; console.log(getCurrentTime() + " [js/app.js] (li.contacts-display-listview -> on click) - end"); } }); - + console.log(getCurrentTime() + " [js/app.js] (buildContactList) - end"); // Add in a line to visually see when we are done. console.log("-----------------------------List Page---------------------------------------"); }; - + // This is called by the on click event list above. // Retrieve employee detail based on employee id. CONTACTS.app.getContactById = function (contactID) { console.log(getCurrentTime() + " [js/app.js] (getContactById) - start"); console.log(getCurrentTime() + " [js/app.js] (getContactById) - contactID = " + contactID); - + var jqxhr = $.ajax({ url: restEndpoint + "/" + contactID.toString(), cache: false, @@ -200,16 +200,16 @@ $( document ).on( "pagecreate", function(mainEvent) { }); console.log(getCurrentTime() + " [js/app.js] (getContactById) - end"); }; - + // This is called by CONTACTS.app.getContactById. // Display contact detail for editing on the Edit page. CONTACTS.app.buildContactDetail = function(contact) { console.log(getCurrentTime() + " [js/app.js] (buildContactDetail) - start"); - - // The intl-Tel-Input plugin stores the lasted used country code and uses it to predetermin the flag to be - // displayed. So we remove the plugin before the data gets loaded in the Edit form and then initialize it after. + + // The intl-Tel-Input plugin stores the lasted used country code and uses it to predetermin the flag to be + // displayed. So we remove the plugin before the data gets loaded in the Edit form and then initialize it after. $("#contacts-edit-input-tel").intlTelInput("destroy"); - + // Put each field value in the text input on the page. $('#contacts-edit-input-firstName').val(contact.firstName); $('#contacts-edit-input-lastName').val(contact.lastName); @@ -217,16 +217,16 @@ $( document ).on( "pagecreate", function(mainEvent) { $('#contacts-edit-input-email').val(contact.email); $('#contacts-edit-input-date').val(contact.birthDate); $('#contacts-edit-input-id').val(contact.id); - - // The intl-Tel-Input plugin needs to be initialized everytime the data gets loaded into the Edit form so that + + // The intl-Tel-Input plugin needs to be initialized everytime the data gets loaded into the Edit form so that // it will correctly validate it and display the correct flag. $('#contacts-edit-input-tel').intlTelInput({nationalMode:false}); - + console.log(getCurrentTime() + " [js/app.js] (buildContactDetail) - end"); // Add in a line to visually see when we are done. console.log("-----------------------------Update Page---------------------------------------"); }; - + console.log(getCurrentTime() + " [js/app.js] (document -> pagecreate) - end"); }); diff --git a/contacts-jquerymobile/src/main/webapp/js/formSetup.js b/contacts-jquerymobile/src/main/webapp/js/formSetup.js index 14c66b9330..7440e5c011 100644 --- a/contacts-jquerymobile/src/main/webapp/js/formSetup.js +++ b/contacts-jquerymobile/src/main/webapp/js/formSetup.js @@ -22,31 +22,31 @@ CONTACTS.namespace('CONTACTS.validation.addContactsFormValidator'); CONTACTS.namespace('CONTACTS.validation.editContactsFormValidator'); /** - * Configure the HTML forms to hide the standard form buttons (they will be displayed in the footer). And to set up + * Configure the HTML forms to hide the standard form buttons (they will be displayed in the footer). And to set up * the actions to take place when they are clicked. - * + * * @author Joshua Wilson */ $( document ).on( "pagecreate", function(mainEvent) { //Initialize the vars in the beginning so that you will always have access to them. var getCurrentTime = CONTACTS.util.getCurrentTime; - - /* + + /* * The "pagebeforeshow" event will delay this function until everything is set up. - * - * The "e.handled" if statement used here and elsewhere is meant to keep jqm from running this code multiple times + * + * The "e.handled" if statement used here and elsewhere is meant to keep jqm from running this code multiple times * for one display. */ - + // Hide the actual form buttons so that we can use proxy buttons in the footer. $('#contacts-add-page').on( "pagebeforeshow", function(e) { if(e.handled !== true) { console.log(getCurrentTime() + " [js/formSetup.js] (#contacts-add-page -> pagebeforeshow) - start"); - + $('#submit-add-btn').parent().hide(); $('#clear-add-btn').parent().hide(); $('#cancel-add-btn').parent().hide(); - + e.handled = true; console.log(getCurrentTime() + " [js/formSetup.js] (#contacts-add-page -> pagebeforeshow) - end"); // Add in a line to visually see when we are done. @@ -58,79 +58,79 @@ $( document ).on( "pagecreate", function(mainEvent) { $('#contacts-edit-page').on( "pagebeforeshow", function(e) { if(e.handled !== true) { console.log(getCurrentTime() + " [js/formSetup.js] (#contacts-edit-page -> pagebeforeshow) - start"); - + $('#submit-edit-btn').parent().hide(); $('#reset-edit-btn').parent().hide(); $('#cancel-edit-btn').parent().hide(); - + e.handled = true; console.log(getCurrentTime() + " [js/formSetup.js] (#contacts-edit-page -> pagebeforeshow) - end"); } }); - + // The Clear button will remove data and validation marks but leave you in the form. // The Cancel button will clear the form and return you to the main page. // The Cancel button has a link on it and that is what differentiates them. Otherwise they both need to clear the form. $('#clear-add-btn, #cancel-add-btn').on("click", function(e) { if(e.handled !== true) { console.log(getCurrentTime() + " [js/formSetup.js] (#clear-add-btn, #cancel-add-btn -> on click) - start"); - - // Remove errors display as a part of the validation system. + + // Remove errors display as a part of the validation system. CONTACTS.validation.addContactsFormValidator.resetForm(); - - // Reset this flag when the form passes validation. + + // Reset this flag when the form passes validation. if (this.id === "cancel-add-btn") { CONTACTS.validation.formEmail = null; } - + // Remove any errors that are not a part of the validation system. $('.invalid').remove(); - + e.handled = true; console.log(getCurrentTime() + " [js/formSetup.js] (#clear-add-btn, #cancel-add-btn -> on click) - end"); } }); - + // This Reset button will remove unsaved changes and validation marks while leaving you in the form. $('#reset-edit-btn').on("click", function(e) { if(e.handled !== true) { console.log(getCurrentTime() + " [js/formSetup.js] (#reset-edit-btn -> on click) - start"); - - // Get the contact ID before we wipe the form. + + // Get the contact ID before we wipe the form. var contactID = $('input#contacts-edit-input-id').attr('value'); - - // Remove errors display as a part of the validation system. + + // Remove errors display as a part of the validation system. CONTACTS.validation.editContactsFormValidator.resetForm(); - + // Remove any errors that are not a part of the validation system. $('.invalid').remove(); - + // Since we are only "reseting" the form we need to put back the original data. CONTACTS.app.getContactById(contactID); - + e.handled = true; console.log(getCurrentTime() + " [js/formSetup.js] (#reset-edit-btn -> on click) - end"); } }); - + // This Cancel button will clear the form and return you to the main page. $('#cancel-edit-btn').on("click", function(e) { if(e.handled !== true) { console.log(getCurrentTime() + " [js/formSetup.js] (#cancel-edit-btn -> on click) - start"); - - // Remove errors display as a part of the validation system. + + // Remove errors display as a part of the validation system. // editValidator.resetForm(); CONTACTS.validation.editContactsFormValidator.resetForm(); - - // Reset this flag when the form passes validation. + + // Reset this flag when the form passes validation. CONTACTS.validation.formEmail = null; - + // Remove any errors that are not a part of the validation system. $('.invalid').remove(); - + e.handled = true; console.log(getCurrentTime() + " [js/formSetup.js] (#cancel-edit-btn -> on click) - end"); } }); -}); +}); diff --git a/contacts-jquerymobile/src/main/webapp/js/namespace.js b/contacts-jquerymobile/src/main/webapp/js/namespace.js index cf2dcb4215..b4194912d7 100644 --- a/contacts-jquerymobile/src/main/webapp/js/namespace.js +++ b/contacts-jquerymobile/src/main/webapp/js/namespace.js @@ -16,29 +16,29 @@ */ /** * The following is taken from "JavaScript Patterns" by Stoyan Stefanov - * - * As the complexity of a program grows and some parts of code get split into different files and included - * conditionally, it becomes unsafe to just assume that your code is the first to define a certain namespace - * or a property inside of it. Some of the properties your're adding to the namespace may already exist, and - * you could be overwriting them. Therefore before adding a property or creating a namespace, it's best to - * check first that it doesn't already exist, as shown in this example: - * + * + * As the complexity of a program grows and some parts of code get split into different files and included + * conditionally, it becomes unsafe to just assume that your code is the first to define a certain namespace + * or a property inside of it. Some of the properties your're adding to the namespace may already exist, and + * you could be overwriting them. Therefore before adding a property or creating a namespace, it's best to + * check first that it doesn't already exist, as shown in this example: + * * // unsafe * var CONTACTS = {}; - * + * * // better * if (typeof CONTACTS === "undefined") { * var CONTACTS = {}; * } - * + * * // or shorter * var CONTACTS = CONTACTS || {}; - * + * * The module pattern is widely used because it provides structure and helps organize your code as it grows. - * Unlike other languages, JavaScript doesn't have special syntax for packages, but the module pattern provides - * the tools to create self-contained decoupled pieces of code, which can be treated as black boxes of functionality + * Unlike other languages, JavaScript doesn't have special syntax for packages, but the module pattern provides + * the tools to create self-contained decoupled pieces of code, which can be treated as black boxes of functionality * and added, replaced, or removed according to the (ever-changing requirements of the software you're writing. - * + * * @author Joshua Wilson */ @@ -48,18 +48,18 @@ CONTACTS.namespace = function (ns_string) { var parts = ns_string.split('.'), parent = CONTACTS, i; - + // Strip redundant leading global if (parts[0] === "CONTACTS") { parts = parts.slice(1); } - + for (i=0; i < parts.length; i += 1) { // Create a property if it doesn't exist if (typeof parent[parts[i]] === "undefined") { parent[parts[i]] = {}; } - + parent = parent[parts[i]]; } return parent; diff --git a/contacts-jquerymobile/src/main/webapp/js/submissions.js b/contacts-jquerymobile/src/main/webapp/js/submissions.js index 71762fc778..bea77e5706 100644 --- a/contacts-jquerymobile/src/main/webapp/js/submissions.js +++ b/contacts-jquerymobile/src/main/webapp/js/submissions.js @@ -20,7 +20,7 @@ CONTACTS.namespace('CONTACTS.submissions.deleteContact'); /** * Listen for and handle the Create, Update, and Delete actions of the app. - * + * * @author Joshua Wilson */ $(document).ready(function() { @@ -47,7 +47,7 @@ $(document).ready(function() { }); return o; }; - + //Initialize all the AJAX form events. run = function () { console.log(getCurrentTime() + " [js/submissions.js] (run) - start"); @@ -57,40 +57,40 @@ $(document).ready(function() { CONTACTS.submissions.deleteContact(); console.log(getCurrentTime() + " [js/submissions.js] (run) - end"); }; - + /** - * Attempts to register a new contact using a JAX-RS POST. + * Attempts to register a new contact using a JAX-RS POST. */ CONTACTS.submissions.submitCreate = function() { console.log(getCurrentTime() + " [js/submissions.js] (submitCreate) - start"); - + $("#contacts-add-form").submit(function(event) { console.log(getCurrentTime() + " [js/submissions.js] (submitCreate - submit event) - checking if the form is valid"); // Ensure that the form has been validated. CONTACTS.validation.addContactsFormValidator.form(); - // If there are any validation error then don't process the submit. + // If there are any validation error then don't process the submit. if (CONTACTS.validation.addContactsFormValidator.valid()){ console.log(getCurrentTime() + " [js/submissions.js] (submitCreate - submit event) - started"); event.preventDefault(); - + /* - * There is a bug in the jQM that causes the list of results on the main page to be blank the first - * time you submit a form. After the first time the list display correctly. This is caused when + * There is a bug in the jQM that causes the list of results on the main page to be blank the first + * time you submit a form. After the first time the list display correctly. This is caused when * the first div gets removed by jQM and added back. This creates a problem for the very first time. - * That is because jQM does not apply the listener to 'getContacts()' to the new page because there are + * That is because jQM does not apply the listener to 'getContacts()' to the new page because there are * 2 versions of the first div in the DOM at one time. So if we remove the div early it acts like it * does every time after the first. It gets the listener applied and it will fired at the right time. - * + * * TODO: If jQM fixes this issue in the future then this line can be removed. - * - * UDPATE: After we figured out what the cause was, we implemented a fix for the validation process that + * + * UDPATE: After we figured out what the cause was, we implemented a fix for the validation process that * fixed this problem as a side effect. In order to display errors that are sent back from the server * side validation we need to keep the form from transitioning. We do that by adding 'data-ajax="false"' - * to the form in the HTML. Then we manually change the page when the form is successfully submitted. - * Since we are manually changing the page we avoid this issue altogether. - */ + * to the form in the HTML. Then we manually change the page when the form is successfully submitted. + * Since we are manually changing the page we avoid this issue altogether. + */ // $('#contacts-list-page').remove(); - + // Transform the form fields into JSON. // Must pull from the specific form so that we get the right data in case another form has data in it. var serializedForm = $("#contacts-add-form").serializeObject(); @@ -98,7 +98,7 @@ $(document).ready(function() { // Turn the object into a String. var contactData = JSON.stringify(serializedForm); console.log(getCurrentTime() + " [js/submissions.js] (submitCreate - submit event) - contactData = " + contactData); - + /* The jQuery XMLHttpRequest (jqXHR) object returned by $.ajax() as of jQuery 1.5 is a superset of * the browser's native XMLHttpRequest object. For example, it contains responseText and responseXML * properties, as well as a getResponseHeader() method. When the transport mechanism is something @@ -120,23 +120,23 @@ $(document).ready(function() { type: "POST" }).done(function(data, textStatus, jqXHR) { console.log(getCurrentTime() + " [js/submissions.js] (submitCreate) - ajax done"); - - // Reset this flag when the form passes validation. + + // Reset this flag when the form passes validation. CONTACTS.validation.formEmail = null; - + // Clear the form or else the next time you go to add a contact the last one will still be there. $('#contacts-add-form')[0].reset(); - + // Remove errors display as a part of the validation system. $('.invalid').remove(); - + // Because we turned off the automatic page transition to catch server side error we need to do it ourselves. $("body").pagecontainer("change", "#contacts-list-page"); - + }).fail(function(jqXHR, textStatus, errorThrown) { // Remove any errors that are not a part of the validation system. $('.invalid').remove(); - + // Check for server side validation errors. This should catch the email uniqueness validation. if ((jqXHR.status === 409) || (jqXHR.status === 400)) { console.log(getCurrentTime() + " [js/submissions.js] (submitCreate) - error in ajax - " + @@ -146,13 +146,13 @@ $(document).ready(function() { // ", textStatus = " + textStatus + // ", errorThrown = " + errorThrown + // ", responseText = " + jqXHR.responseText); - + // Get the contact. var contact = $("#contacts-add-form")[0]; - + // Extract the error messages from the server. var errorMsg = $.parseJSON(jqXHR.responseText); - + // We only want to set this flag if there is actual email error. $.each(errorMsg, function(index, val) { if (index === 'email'){ @@ -166,10 +166,10 @@ $(document).ready(function() { }); } }); - + // Apply the error to the form. CONTACTS.validation.displayServerSideErrors("#contacts-add-form", errorMsg); - + console.log(getCurrentTime() + " [js/submissions.js] (submitCreate) - error in ajax - " + "Validation error displayed in the form for the user to fix! "); } else if (jqXHR.status >= 200 && jqXHR.status < 300 || jqXHR.status === 304) { @@ -179,13 +179,13 @@ $(document).ready(function() { + errorThrown.message); console.log(getCurrentTime() + " [js/submissions.js] (submitCreate) - ajax error because the REST service doesn't return" + "any data and this app expects data. Fix the REST app or remove the 'dataType:' option from the AJAX call."); - + // Extract the error messages from the server. var errorMsg = $.parseJSON(jqXHR.responseText); - + // Apply the error to the form. CONTACTS.validation.displayServerSideErrors("#contacts-add-form", errorMsg); - + console.log(getCurrentTime() + " [js/submissions.js] (submitCreate) - ajax error on 20x - " + "after displayServerSideErrors()"); } else { @@ -194,10 +194,10 @@ $(document).ready(function() { ", textStatus = " + textStatus + ", errorThrown = " + errorThrown + ", responseText = " + jqXHR.responseText); - + // Extract the error messages from the server. var errorMsg = $.parseJSON(jqXHR.responseText); - + // Apply the error to the form. CONTACTS.validation.displayServerSideErrors("#contacts-add-form", errorMsg); } @@ -206,40 +206,40 @@ $(document).ready(function() { }); console.log(getCurrentTime() + " [js/submissions.js] (submitCreate) - end"); }; - + /** - * Attempts to update a contact using a JAX-RS PUT. + * Attempts to update a contact using a JAX-RS PUT. */ CONTACTS.submissions.submitUpdate = function() { console.log(getCurrentTime() + " [js/submissions.js] (submitUpdate) - start"); - + $("#contacts-edit-form").submit(function(event) { console.log(getCurrentTime() + " [js/submissions.js] (submitUpdate - submit event) - checking if the form is valid"); - + // Ensure that the form has been validated. CONTACTS.validation.editContactsFormValidator.form(); - // If there are any validation error then don't process the submit. + // If there are any validation error then don't process the submit. if (CONTACTS.validation.editContactsFormValidator.valid()){ console.log(getCurrentTime() + " [js/submissions.js] (submitUpdate - submit event) - started"); event.preventDefault(); - + /* - * There is a bug in the jQM that causes the list of results on the main page to be blank the first - * time you submit a form. After the first time the list display correctly. This is caused when + * There is a bug in the jQM that causes the list of results on the main page to be blank the first + * time you submit a form. After the first time the list display correctly. This is caused when * the first div gets removed by jQM and added back. This creates a problem for the very first time. - * That is because jQM does not apply the listener to 'getContacts()' to the new page because there are + * That is because jQM does not apply the listener to 'getContacts()' to the new page because there are * 2 versions of the first div in the DOM at one time. So if we remove the div early it acts like it * does every time after the first. It gets the listener applied and it will fired at the right time. - * + * * TODO: If jQM fixes this issue in the future then this line can be removed. - * - * UDPATE: After we figured out what the cause was, we implemented a fix for the validation process that + * + * UDPATE: After we figured out what the cause was, we implemented a fix for the validation process that * fixed this problem as a side effect. In order to display errors that are sent back from the server * side validation we need to keep the form from transitioning. We do that by adding 'data-ajax="false"' - * to the form in the HTML. Then we manually change the page when the form is successfully submitted. - * Since we are manually changing the page we avoid this issue altogether. - */ + * to the form in the HTML. Then we manually change the page when the form is successfully submitted. + * Since we are manually changing the page we avoid this issue altogether. + */ // $('#contacts-list-page').remove(); // Obtain the contact ID, to use in constructing the REST URI. @@ -252,7 +252,7 @@ $(document).ready(function() { // Turn the object into a String. var contactData = JSON.stringify(serializedForm); console.log(getCurrentTime() + " [js/submissions.js] (submitUpdate - submit event) - contactData = " + contactData); - + /* The jQuery XMLHttpRequest (jqXHR) object returned by $.ajax() as of jQuery 1.5 is a superset of * the browser's native XMLHttpRequest object. For example, it contains responseText and responseXML * properties, as well as a getResponseHeader() method. When the transport mechanism is something @@ -274,20 +274,20 @@ $(document).ready(function() { type: "PUT" }).done(function(data, textStatus, jqXHR) { console.log(getCurrentTime() + " [js/submissions.js] (submitUpdate) - ajax done"); - - // Reset this flag when the form passes validation. + + // Reset this flag when the form passes validation. CONTACTS.validation.formEmail = null; - + // Remove errors display as a part of the validation system. $('.invalid').remove(); - + // Because we turned off the automatic page transition to catch server side error we need to do it ourselves. $("body").pagecontainer("change", "#contacts-list-page"); - + }).fail(function(jqXHR, textStatus, errorThrown) { // Remove any errors that are not a part of the validation system. $('.invalid').remove(); - + // Check for server side validation errors. This should catch the email uniqueness validation. if ((jqXHR.status === 409) || (jqXHR.status === 400)) { console.log(getCurrentTime() + " [js/submissions.js] (submitUpdate) - error in ajax - " + @@ -297,13 +297,13 @@ $(document).ready(function() { // ", textStatus = " + textStatus + // ", errorThrown = " + errorThrown + // ", responseText = " + jqXHR.responseText); - + // Get the contact. var contact = $("#contacts-edit-form")[0]; - + // Extract the error messages from the server. var errorMsg = $.parseJSON(jqXHR.responseText); - + // We only want to set this flag if there is actual email error. $.each(errorMsg, function(index, val) { if (index === 'email'){ @@ -317,10 +317,10 @@ $(document).ready(function() { }); } }); - + // Apply the error to the form. CONTACTS.validation.displayServerSideErrors("#contacts-edit-form", errorMsg); - + console.log(getCurrentTime() + " [js/submissions.js] (submitUpdate) - error in ajax - " + "Validation error displayed in the form for the user to fix! "); } else if (jqXHR.status >= 200 && jqXHR.status < 300 || jqXHR.status === 304) { @@ -330,13 +330,13 @@ $(document).ready(function() { + errorThrown.message); console.log(getCurrentTime() + " [js/submissions.js] (submitUpdate) - ajax error because the REST service doesn't return" + "any data and this app expects data. Fix the REST app or remove the 'dataType:' option from the AJAX call."); - + // Extract the error messages from the server. var errorMsg = $.parseJSON(jqXHR.responseText); - + // Apply the error to the form. CONTACTS.validation.displayServerSideErrors("#contacts-edit-form", errorMsg); - + console.log(getCurrentTime() + " [js/submissions.js] (submitUpdate) - ajax error on 20x - " + "after displayServerSideErrors()"); } else { @@ -345,10 +345,10 @@ $(document).ready(function() { ", textStatus = " + textStatus + ", errorThrown = " + errorThrown + ", responseText = " + jqXHR.responseText); - + // Extract the error messages from the server. var errorMsg = $.parseJSON(jqXHR.responseText); - + // Apply the error to the form. CONTACTS.validation.displayServerSideErrors("#contacts-edit-form", errorMsg); } @@ -357,21 +357,21 @@ $(document).ready(function() { }); console.log(getCurrentTime() + " [js/submissions.js] (submitUpdate) - end"); }; - + /** - * Attempts to delete a contact using a JAX-RS DELETE. + * Attempts to delete a contact using a JAX-RS DELETE. */ CONTACTS.submissions.deleteContact = function() { console.log(getCurrentTime() + " [js/submissions.js] (deleteContact) - start"); - + $("#confirm-delete-button").click(function(event) { console.log(getCurrentTime() + " [js/submissions.js] (deleteContact - submit event) - started"); - // You must not preventDefault on a click on a link as that will prevent it from changing pages. + // You must not preventDefault on a click on a link as that will prevent it from changing pages. // event.preventDefault(); // Obtain the contact ID, to use in constructing the REST URI. var contactId = $("#contacts-edit-input-id").val(); - + /* The jQuery XMLHttpRequest (jqXHR) object returned by $.ajax() as of jQuery 1.5 is a superset of * the browser's native XMLHttpRequest object. For example, it contains responseText and responseXML * properties, as well as a getResponseHeader() method. When the transport mechanism is something @@ -391,36 +391,36 @@ $(document).ready(function() { type: "DELETE" }).done(function(data, textStatus, jqXHR) { console.log(getCurrentTime() + " [js/submissions.js] (deleteContact) - ajax done"); - - // Reset this flag when the form passes validation. + + // Reset this flag when the form passes validation. CONTACTS.validation.formEmail = null; - - // Remove errors display as a part of the validation system. + + // Remove errors display as a part of the validation system. CONTACTS.validation.editContactsFormValidator.resetForm(); - + // Remove errors display as a part of the validation system. $('.invalid').remove(); - + }).fail(function(jqXHR, textStatus, errorThrown) { // Remove any errors that are not a part of the validation system. $('.invalid').remove(); - + console.log(getCurrentTime() + " [js/submissions.js] (deleteContact) - error in ajax" + " - jqXHR = " + jqXHR.status + ", textStatus = " + textStatus + ", errorThrown = " + errorThrown + ", responseText = " + jqXHR.responseText); - + // Extract the error messages from the server. var errorMsg = $.parseJSON(jqXHR.responseText); - + // Apply the error to the form. CONTACTS.validation.displayServerSideErrors("#contacts-edit-form", errorMsg); }); }); console.log(getCurrentTime() + " [js/submissions.js] (deleteContact) - end"); }; - + //Set up each of these event listeners. run(); }); diff --git a/contacts-jquerymobile/src/main/webapp/js/theming.js b/contacts-jquerymobile/src/main/webapp/js/theming.js index d0d308e1cf..45ae44a384 100644 --- a/contacts-jquerymobile/src/main/webapp/js/theming.js +++ b/contacts-jquerymobile/src/main/webapp/js/theming.js @@ -18,7 +18,7 @@ /** * Provide a way to change the Theme dynamically. This will watch for the button click of the different theme options * in the Theming popup. - * + * * @author Joshua Wilson */ $( document ).on( "pagecreate", function(mainEvent) { @@ -26,81 +26,81 @@ $( document ).on( "pagecreate", function(mainEvent) { var getCurrentTime = CONTACTS.util.getCurrentTime, theme, changeTheme; - + console.log(getCurrentTime() + " [js/theming.js] (document -> pagecreate) - start"); - - // Dynamically set the theme based on the option selected in the popup. + + // Dynamically set the theme based on the option selected in the popup. $('#theme-button-a').click(function() { console.log(getCurrentTime() + " [js/theming.js] (#theme-button-a -> click) - start"); theme = 'a'; changeTheme(); console.log(getCurrentTime() + " [js/theming.js] (#theme-button-a -> click) - end"); }); - - // Dynamically set the theme based on the option selected in the popup. + + // Dynamically set the theme based on the option selected in the popup. $('#theme-button-b').click(function() { console.log(getCurrentTime() + " [js/theming.js] (#theme-button-b -> click) - start"); theme = 'b'; changeTheme(); console.log(getCurrentTime() + " [js/theming.js] (#theme-button-b -> click) - end"); }); - - // Dynamically set the theme based on the option selected in the popup. + + // Dynamically set the theme based on the option selected in the popup. $('#theme-button-c').click(function() { console.log(getCurrentTime() + " [js/theming.js] (#theme-button-c -> click) - start"); theme = 'c'; changeTheme(); console.log(getCurrentTime() + " [js/theming.js] (#theme-button-c -> click) - end"); }); - - // Dynamically set the theme based on the option selected in the popup. + + // Dynamically set the theme based on the option selected in the popup. $('#theme-button-d').click(function() { console.log(getCurrentTime() + " [js/theming.js] (#theme-button-d -> click) - start"); theme = 'd'; changeTheme(); console.log(getCurrentTime() + " [js/theming.js] (#theme-button-d -> click) - end"); }); - - // Dynamically set the theme based on the option selected in the popup. + + // Dynamically set the theme based on the option selected in the popup. $('#theme-button-e').click(function() { console.log(getCurrentTime() + " [js/theming.js] (#theme-button-e -> click) - start"); theme = 'e'; changeTheme(); console.log(getCurrentTime() + " [js/theming.js] (#theme-button-e -> click) - end"); }); - - // Dynamically set the theme based on the option selected in the popup. + + // Dynamically set the theme based on the option selected in the popup. $('#theme-button-f').click(function() { console.log(getCurrentTime() + " [js/theming.js] (#theme-button-f -> click) - start"); theme = 'f'; changeTheme(); console.log(getCurrentTime() + " [js/theming.js] (#theme-button-f -> click) - end"); }); - - // Dynamically set the theme based on the option selected in the popup. + + // Dynamically set the theme based on the option selected in the popup. $('#theme-button-g').click(function() { console.log(getCurrentTime() + " [js/theming.js] (#theme-button-g -> click) - start"); theme = 'g'; changeTheme(); console.log(getCurrentTime() + " [js/theming.js] (#theme-button-g -> click) - end"); }); - + changeTheme = function() { console.log(getCurrentTime() + " [js/theming.js] (changeTheme) - theme = " + theme); - + // Keep the submit buttons in the alternate theme for contrast. if (theme !== 'a') { $('.ui-btn-b').removeClass('ui-btn-b').addClass('ui-btn-a'); } else { $('.ui-btn-a').removeClass('ui-btn-a').addClass('ui-btn-b'); } - + // Go through all the Pages and remove whatever they they currently have and apply the selected theme. $('[data-role="page"]').removeClass('ui-page-theme-a ui-page-theme-b ui-page-theme-c ui-page-theme-d ui-page-theme-e') .addClass('ui-page-theme-' + theme); } - - + + console.log(getCurrentTime() + " [js/theming.js] (document -> pagecreate) - end"); }); diff --git a/contacts-jquerymobile/src/main/webapp/js/util.js b/contacts-jquerymobile/src/main/webapp/js/util.js index 690500c1ad..fd6f2195da 100644 --- a/contacts-jquerymobile/src/main/webapp/js/util.js +++ b/contacts-jquerymobile/src/main/webapp/js/util.js @@ -22,7 +22,7 @@ CONTACTS.namespace('CONTACTS.util.convertDateStringToOffsetUTC'); /** * Abstract away generic functions that are used by all. - * + * * @author Joshua Wilson */ CONTACTS.util.getCurrentDate = function() { @@ -33,7 +33,7 @@ CONTACTS.util.getCurrentDate = function() { var output = d.getFullYear() + '-' + (month<10 ? '0' : '') + month + '-' + (day<10 ? '0' : '') + day; - + return output; }; @@ -43,12 +43,12 @@ CONTACTS.util.getCurrentTime = function() { var min = d.getMinutes(); var sec = d.getSeconds(); var millisec = d.getMilliseconds(); - - var output = (hour<10 ? '0' : '') + hour + ":" + - (min<10 ? '0' : '') + min + ":" + - (sec<10 ? '0' : '') + sec + "," + + + var output = (hour<10 ? '0' : '') + hour + ":" + + (min<10 ? '0' : '') + min + ":" + + (sec<10 ? '0' : '') + sec + "," + (millisec<10 ? '0' : (millisec<100 ? '0' : '')) + millisec; - + return output; }; @@ -64,7 +64,7 @@ CONTACTS.util.convertMillisToDate = function(milliseconds) { console.log(CONTACTS.util.getCurrentTime() + " [js/util.js] (convertMillisToDate) - milliseconds passed in = " + milliseconds); var d = new Date(milliseconds); console.log(CONTACTS.util.getCurrentTime() + " [js/util.js] (convertMillisToDate) - date after converting milliseconds passed in = " + d); - + // Must add 1 due to zero based array of months. var month = d.getMonth()+1; var day = d.getDate(); @@ -73,7 +73,7 @@ CONTACTS.util.convertMillisToDate = function(milliseconds) { var output = d.getFullYear() + '-' + (month<10 ? '0' : '') + month + '-' + (day<10 ? '0' : '') + day; - + return output; }; @@ -83,26 +83,26 @@ CONTACTS.util.convertMillisToDate = function(milliseconds) { */ CONTACTS.util.convertDateStringToOffsetUTC = function(utcDate) { console.log(CONTACTS.util.getCurrentTime() + " [js/util.js] (convertDateStringToOffsetUTC) - date String passed in = " + utcDate); - + // The date passed in is a String, this makes it a Date object/type. var d = new Date(utcDate); console.log(CONTACTS.util.getCurrentTime() + " [js/util.js] (convertDateStringToOffsetUTC) - date after converting " + "String to the Date type (displayed in local time) = " + d); - - // Get the Timezone Offset, in minutes, from UTC to local. This will either be a negative or positive number depending + + // Get the Timezone Offset, in minutes, from UTC to local. This will either be a negative or positive number depending // on your timezone. var offsetInMin = d.getTimezoneOffset(); console.log(CONTACTS.util.getCurrentTime() + " [js/util.js] (convertDateStringToOffsetUTC) - offset in Minutes = " + offsetInMin); - + // We need the Offset in Milliseconds if we are going to add it more Milliseconds. var offsetInMillis = offsetInMin * 60 * 1000; console.log(CONTACTS.util.getCurrentTime() + " [js/util.js] (convertDateStringToOffsetUTC) - offset in Milliseconds = " + offsetInMillis); - + // Add the Offset to the UTC time so that we can store the actual time that was intended to be recorded. var offsetUTCDateTime = new Date(d.getTime() + offsetInMillis); console.log(CONTACTS.util.getCurrentTime() + " [js/util.js] (convertDateStringToOffsetUTC) - date after applying timezone " + "offset to UTC Date (displayed in local time) = " + offsetUTCDateTime); - + return offsetUTCDateTime; }; diff --git a/contacts-jquerymobile/src/main/webapp/js/validation.js b/contacts-jquerymobile/src/main/webapp/js/validation.js index 671db242bb..e63fcd1299 100644 --- a/contacts-jquerymobile/src/main/webapp/js/validation.js +++ b/contacts-jquerymobile/src/main/webapp/js/validation.js @@ -25,19 +25,19 @@ CONTACTS.namespace('CONTACTS.validation.addContactsFormValidator'); CONTACTS.namespace('CONTACTS.validation.editContactsFormValidator'); /** - * jQuery Mobile and moblie devices do not currently support HTML5 form validation. Therefore, basic things like - * checking if a value had only Alpha characters would either need to be done on the server or with some custom JavaScript. - * + * jQuery Mobile and moblie devices do not currently support HTML5 form validation. Therefore, basic things like + * checking if a value had only Alpha characters would either need to be done on the server or with some custom JavaScript. + * * I think it is best to validate the UI in the UI whenever possible so that you don't keep going back and forth - * over the network doing validation. That said, there are two basic options when it comes to validating fields + * over the network doing validation. That said, there are two basic options when it comes to validating fields * in JavaScript: You role your own or use a library. We are using the jQuery Validator library. It is one of the * oldest plugins in jQuery history and is still actively supported. As you will see below it works very nicely. - * + * * If jQuery Mobile ever gets HTML5 form validation to work then we should consider using that instead or in addition * to the Validation plugin. - * - * These functions control the form validation. - * + * + * These functions control the form validation. + * * @author Joshua Wilson */ $(document).ready(function() { @@ -45,20 +45,20 @@ $(document).ready(function() { var getCurrentTime = CONTACTS.util.getCurrentTime; /** - * We try to catch the format errors while on the client but some things require a database lookup. There is + * We try to catch the format errors while on the client but some things require a database lookup. There is * exception handling on the server side and the exceptions send back the errors through the form AJAX call. In - * the submit handler we catch those errors thrown by the server. They are in turn sent to this method, which + * the submit handler we catch those errors thrown by the server. They are in turn sent to this method, which * will display them in the appropriate field(s). - * - * This is only displayed on submit. If you want to use this validation during the form edits you will need to + * + * This is only displayed on submit. If you want to use this validation during the form edits you will need to * add that to the validation process, just as it has been done for the email uniqueness test. - * + * * @param pageID = the page the error will be displayed on * @param errorMsg = a JS object in JSON with the field name and the message to be displayed */ CONTACTS.validation.displayServerSideErrors = function (pageID, errorMsg) { var validator = $( pageID ).validate(); - + // Look at each error 'key' and determine where to display the message. $.each(errorMsg, function(index, val) { // Look for a form input with the 'key' from the error. @@ -76,7 +76,7 @@ $(document).ready(function() { } }); }; - + // Add a 'max' attribute to the Birth Date fields to set the maximum allowed date to today. $('.birthDate').attr('max', function() { return CONTACTS.util.getCurrentDate(); @@ -84,7 +84,7 @@ $(document).ready(function() { /** * Check if the birthdate fits the regex pattern of YYYY-DD-MM. - */ + */ CONTACTS.validation.validateBirthDate = function(date) { var parseBirthDate = /^([1-2][0,9][0-9][0-9])[-](0[1-9]|1[0-2])[-](0[1-9]|[12][0-9]|3[01])$/; var match = parseBirthDate.exec(date); @@ -96,20 +96,20 @@ $(document).ready(function() { var d = parseInt(match[3], 10); // Pass those date parts into a new date. var date = new Date(y, m - 1, d); - // Check to see if the new date matches the original date. If something like Feb 31 was used originally, - // it will automatically get converted to Mar 02. These dates would not match. + // Check to see if the new date matches the original date. If something like Feb 31 was used originally, + // it will automatically get converted to Mar 02. These dates would not match. return (date.getFullYear() == y && date.getMonth() + 1 == m && date.getDate() == d); } else { // The date passed into the regex did not get parsed. return false; } }; - + // Create a custom method for the Validator to check if a 'birth date' is formatted correctly. $.validator.addMethod("birthdate", function(value, element) { return this.optional(element) || CONTACTS.validation.validateBirthDate(value); }, "Only valid date formats like yyyy-mm-dd. (hint: There are only 12 months and at most 31 days.)"); - + /** * Check if the phone number is a valid format. */ @@ -125,7 +125,7 @@ $(document).ready(function() { return false; } // } else { -// // Nothing is in the field, let the Require validation handle it. +// // Nothing is in the field, let the Require validation handle it. // return true; // } }; @@ -134,7 +134,7 @@ $(document).ready(function() { $.validator.addMethod("intlTel", function(value, element, param) { return this.optional(element) || CONTACTS.validation.validatePhone(value, param); }, "Please use a valid phone number with county code."); - + /** * Check if the name fits the regex pattern of a Alpha characters only. */ @@ -142,15 +142,15 @@ $(document).ready(function() { var parseName = /^([A-Za-z-']+)$/; return parseName.test(name); }; - + // Create a custom method for the Validator to check if a 'name' is formatted correctly. $.validator.addMethod("personName", function(value, element) { return this.optional(element) || CONTACTS.validation.validateName(value); }, "Please use a name without numbers or specials."); - + /** * Compare the email in the form to the one returned from the server. If they match then the user is still using - * an email that is already in use. + * an email that is already in use. * (hint: it is only returned after the submit is fired, otherwise it is null) */ CONTACTS.validation.validateEmailUniqueness = function(email) { @@ -160,22 +160,22 @@ $(document).ready(function() { return true; } }; - + // Create a custom method for the Validator to check if an email is already used. $.validator.addMethod("emailUnique", function(value, element) { return this.optional(element) || CONTACTS.validation.validateEmailUniqueness(value); }, "That email is already used, please use a unique email."); - + /** * We need a way to apply the form validation in cases where the forms don't exist yet, like the unit tests. - */ + */ CONTACTS.validation.runFormValidators = function() { // Turn on the intl-Tel-Input validation for the Add form. Turn it on for the Edit form in the app.js buildContactDetail. $('#contacts-add-input-tel').intlTelInput({nationalMode:false}); - + // Set up the validator for the 'add' form. // NOTE: I tried setting it up to use the form class but then it only applied the validation to the first form. - // It appears that the plugin only works when it is given only 1 form at a time. + // It appears that the plugin only works when it is given only 1 form at a time. CONTACTS.validation.addContactsFormValidator = $('#contacts-add-form').validate({ rules: { firstName: { @@ -231,12 +231,12 @@ $(document).ready(function() { min: "Nobody is that old. Unless they are a vampire." } } - }); - + }); + /** * Set up the validator for the 'edit' form. * NOTE: I tried setting it up to use the form class but then it only applied the validation to the first form. - * It appears that the plugin only works when it is given only 1 form at a time. + * It appears that the plugin only works when it is given only 1 form at a time. */ CONTACTS.validation.editContactsFormValidator = $('#contacts-edit-form').validate({ rules: { @@ -293,12 +293,12 @@ $(document).ready(function() { min: "Nobody is that old. Unless they are a vampire." } } - }); + }); }; - + /** * Run the form validators. */ CONTACTS.validation.runFormValidators(); -}); +}); diff --git a/contacts-jquerymobile/src/test/qunit/index.html b/contacts-jquerymobile/src/test/qunit/index.html index 8753f37fb1..609f5a8272 100644 --- a/contacts-jquerymobile/src/test/qunit/index.html +++ b/contacts-jquerymobile/src/test/qunit/index.html @@ -27,7 +27,7 @@ HTML5 Test Suite - + @@ -54,7 +54,7 @@ - + diff --git a/contacts-jquerymobile/src/test/qunit/test/app_tests.js b/contacts-jquerymobile/src/test/qunit/test/app_tests.js index 2776b58292..7a85780386 100644 --- a/contacts-jquerymobile/src/test/qunit/test/app_tests.js +++ b/contacts-jquerymobile/src/test/qunit/test/app_tests.js @@ -21,9 +21,9 @@ module('The main App', { setup: function() { // run before - + var $fixture = $( "#qunit-fixture" ); - + $fixture.append( '
      ' + '
        ' @@ -54,7 +54,7 @@ test('should display nothing when no records are found. ', 1, function() { test('should be able to fill in the edit form with values', 5, function() { var $fixture = $( "#qunit-fixture" ); - + $fixture.append( '' + '
        ' + @@ -82,7 +82,7 @@ test('should be able to fill in the edit form with values', 5, function() { '' + '' ); - + var contacts = {email: "jane.doe@company.com", id: 14, firstName: "Jane", lastName: 'Doe', phoneNumber: "1231231231", birthDate:'1966-01-03'}; CONTACTS.app.buildContactDetail(contacts); strictEqual($('#contacts-edit-input-firstName').val(), 'Jane', 'Expected to find Jane in the first name field.'); @@ -94,7 +94,7 @@ test('should be able to fill in the edit form with values', 5, function() { test('should be able to GET a contact from the db', 1, function() { var $fixture = $( "#qunit-fixture" ); - + $fixture.append( '
        ' + '
        ' + @@ -122,11 +122,11 @@ test('should be able to GET a contact from the db', 1, function() { '' + '' ); - + var contacts = {email: "john.smith@mailinator.com", id: 14, firstName: "Johne", lastName: 'Smith', phoneNumber: "2125551212", birthDate:'1963-06-03'}; - + // It looks like the following will not work but I may yet find a way so I will keep this here for now. - // I think to get this work you need to set the URL to the full (http://...) version and setup CORS. In addition + // I think to get this work you need to set the URL to the full (http://...) version and setup CORS. In addition // the Contact needs to be returned by the method. // var imported = CONTACTS.app.getContactById(10001); // deepEqual(imported, contacts, 'Expected John Smith to have been returned.'); @@ -135,7 +135,7 @@ test('should be able to GET a contact from the db', 1, function() { test('should be able to GET a contact from the db and fill in the edit form', 5, function() { var $fixture = $( "#qunit-fixture" ); - + $fixture.append( '
        ' + '
        ' + @@ -164,7 +164,7 @@ test('should be able to GET a contact from the db and fill in the edit form', 5, '' ); - // It looks like the following will not work but I may yet find a way so I will keep this here for now. + // It looks like the following will not work but I may yet find a way so I will keep this here for now. // I think to get this work you need to set the URL to the full (http://...) version and setup CORS. In addition // CONTACTS.app.getContactById(10001); // strictEqual($('#contacts-edit-input-firstName').val(), 'John', 'Expected to find John in the first name field.'); diff --git a/contacts-jquerymobile/src/test/qunit/test/util_tests.js b/contacts-jquerymobile/src/test/qunit/test/util_tests.js index 76d137ce33..5b131032a7 100644 --- a/contacts-jquerymobile/src/test/qunit/test/util_tests.js +++ b/contacts-jquerymobile/src/test/qunit/test/util_tests.js @@ -31,7 +31,7 @@ module('Util', { test('should be able to provide the current date', 1, function() { // I'm not sure how to test this without reproducing the exact code here, then what is the point? - + var d = new Date(); var month = d.getMonth()+1; var day = d.getDate(); @@ -45,31 +45,31 @@ test('should be able to provide the current date', 1, function() { test('should be able to provide the current time', 1, function() { // I'm not sure how to test this without reproducing the exact code here, then what is the point - - // Also how do you test if it is providing the same exact time if you are going to the milliseconds? They should - // always be different but apparently they are not. I guess both operations are done in the same millisecond. - // This still may fail on a slower computer. + + // Also how do you test if it is providing the same exact time if you are going to the milliseconds? They should + // always be different but apparently they are not. I guess both operations are done in the same millisecond. + // This still may fail on a slower computer. var d = new Date(); var hour = d.getHours(); var min = d.getMinutes(); var sec = d.getSeconds(); var millisec = d.getMilliseconds(); - - var output = (hour<10 ? '0' : '') + hour + ":" + - (min<10 ? '0' : '') + min + ":" + - (sec<10 ? '0' : '') + sec + "," + + + var output = (hour<10 ? '0' : '') + hour + ":" + + (min<10 ? '0' : '') + min + ":" + + (sec<10 ? '0' : '') + sec + "," + (millisec<10 ? '0' : (millisec<100 ? '0' : '')) + millisec; - + strictEqual(CONTACTS.util.getCurrentTime(), output, 'The time was provide.'); }); test('should be able to provide the current date time', 1, function() { // I'm not sure how to test this without reproducing the exact code here, then what is the point - - // Also how do you test if it is providing the same exact time if you are going to the milliseconds? They should - // always be different but apparently they are not. I guess both operations are done in the same millisecond. - // This still may fail on a slower computer. + + // Also how do you test if it is providing the same exact time if you are going to the milliseconds? They should + // always be different but apparently they are not. I guess both operations are done in the same millisecond. + // This still may fail on a slower computer. var d = new Date(); var month = d.getMonth()+1; @@ -79,13 +79,13 @@ test('should be able to provide the current date time', 1, function() { var min = d.getMinutes(); var sec = d.getSeconds(); var millisec = d.getMilliseconds(); - + var output = d.getFullYear() + '-' + (month<10 ? '0' : '') + month + '-' + (day<10 ? '0' : '') + day + ' ' + - (hour<10 ? '0' : '') + hour + ":" + - (min<10 ? '0' : '') + min + ":" + - (sec<10 ? '0' : '') + sec + "," + + (hour<10 ? '0' : '') + hour + ":" + + (min<10 ? '0' : '') + min + ":" + + (sec<10 ? '0' : '') + sec + "," + (millisec<10 ? '0' : (millisec<100 ? '0' : '')) + millisec; strictEqual(CONTACTS.util.getCurrentDateTime(), output, 'The date time was provide.'); diff --git a/contacts-jquerymobile/src/test/qunit/test/validation_tests.js b/contacts-jquerymobile/src/test/qunit/test/validation_tests.js index 5805d96423..154286f68b 100644 --- a/contacts-jquerymobile/src/test/qunit/test/validation_tests.js +++ b/contacts-jquerymobile/src/test/qunit/test/validation_tests.js @@ -33,7 +33,7 @@ test('should only allow names with alpha characters, an apostrophe, or a dash in ok(CONTACTS.validation.validateName('John'), 'John is well formed'); ok(CONTACTS.validation.validateName('smith-jones'), 'smith-jones is well formed'); ok(CONTACTS.validation.validateName("O'Maley"), "O'Maley is well formed"); - + // mal-formed names ok(!CONTACTS.validation.validateName('John Smith'), 'John Smith is not well formed. It has a space in it.'); ok(!CONTACTS.validation.validateName('john3'), 'john3 is not well formed. No numbers allowed.'); @@ -45,9 +45,9 @@ test('should only allow names with alpha characters, an apostrophe, or a dash in module('Validation in the Add form', { setup: function() { // run before - + var $fixture = $( "#qunit-fixture" ); - + $fixture.append( '
        ' + '
        ' + @@ -88,7 +88,7 @@ test('should only allow names with alpha characters, an apostrophe, or a dash in ok(CONTACTS.validation.validateName('John'), 'John is well formed'); ok(CONTACTS.validation.validateName('smith-jones'), 'smith-jones is well formed'); ok(CONTACTS.validation.validateName("O'Maley"), "O'Maley is well formed"); - + // mal-formed names ok(!CONTACTS.validation.validateName('John Smith'), 'John Smith is not well formed. It has a space in it.'); ok(!CONTACTS.validation.validateName('john3'), 'john3 is not well formed. No numbers allowed.'); @@ -271,9 +271,9 @@ test('should display an error message in the birth date field when the birth dat module('Validation in the Edit form', { setup: function() { // run before - + var $fixture = $( "#qunit-fixture" ); - + $fixture.append( '' + '
        ' + diff --git a/ejb-in-ear/web/src/main/webapp/index.html b/ejb-in-ear/web/src/main/webapp/index.html index 24e357dd2e..48a7d67c1f 100644 --- a/ejb-in-ear/web/src/main/webapp/index.html +++ b/ejb-in-ear/web/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - - + + + + + + + + diff --git a/ejb-in-war/src/main/webapp/index.html b/ejb-in-war/src/main/webapp/index.html index aa3fdeefac..48a7d67c1f 100644 --- a/ejb-in-war/src/main/webapp/index.html +++ b/ejb-in-war/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - + + + + + + + diff --git a/ejb-security/src/main/webapp/index.html b/ejb-security/src/main/webapp/index.html index 68ded282a1..7c5b7e0e36 100644 --- a/ejb-security/src/main/webapp/index.html +++ b/ejb-security/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - + + + + + + + diff --git a/ejb-timer/src/main/webapp/index.html b/ejb-timer/src/main/webapp/index.html index 888d785947..bad38a0460 100644 --- a/ejb-timer/src/main/webapp/index.html +++ b/ejb-timer/src/main/webapp/index.html @@ -16,26 +16,26 @@ --> ejb-timer Quickstart - +

        ejb-timer Quickstart

        What is it?

        - The ejb-timer quickstart demonstrates how to use the EJB timer service in - Red Hat JBoss Enterprise Application Platform. - It creates a timer service that uses the @Schedule and @Timeout annotations. + The ejb-timer quickstart demonstrates how to use the EJB timer service in + Red Hat JBoss Enterprise Application Platform. + It creates a timer service that uses the @Schedule and @Timeout annotations.

        - +

        Access the Application

        This example application is not intended to be opened in a browser. - Instead, the EJB Timer service outputs messages to the JBoss EAP server console. + Instead, the EJB Timer service outputs messages to the JBoss EAP server console. View the EJB Timer message in the JBoss EAP server log or Console window.

        - +

        Additional Information

        Additional information can be found in the README file at the root of this quickstart directory. diff --git a/helloworld-mbean/helloworld-mbean-webapp/src/main/webapp/index.html b/helloworld-mbean/helloworld-mbean-webapp/src/main/webapp/index.html index c8333e3c15..f98134d5d0 100644 --- a/helloworld-mbean/helloworld-mbean-webapp/src/main/webapp/index.html +++ b/helloworld-mbean/helloworld-mbean-webapp/src/main/webapp/index.html @@ -1,39 +1,39 @@ - - - -

        Access to MBeans

        -

        You can use JConsole to inspect and use the MBeans.

        -

        To connect to the JBoss EAP server using JConsole, open a command prompt and type the following command : -

        -
        For Linux: JDK_HOME/bin/jconsole
        -
        For Windows: JDK_HOME\bin\jconsole.exe
        -

        Select the local org.jboss.modules.Main process and click Connect. You are presented with the following screen.

        - MBeans in JConsole - -

        To test the MBeans :

        -
          -
        1. Click on the JConsole MBeans tab.
        2. -
        3. Expand quickstarts in the left column of the console.
        4. -
        5. Under quickstarts, you see the 4 MBeans: AnnotatedComponentHelloWorld, MXComponentHelloWorld, MXPojoHelloWorld, and SarMXPojoHelloWorld
        6. -
        7. Expand each MBean and choose: Operations --> sayHello.
        8. -
        9. Type your name in the (p0 String ) input text box and click the sayHello button.
        10. -
        11. You will see a popup Window displaying Hello <your name>!.
        12. -
        - - - + + + +

        Access to MBeans

        +

        You can use JConsole to inspect and use the MBeans.

        +

        To connect to the JBoss EAP server using JConsole, open a command prompt and type the following command : +

        +
        For Linux: JDK_HOME/bin/jconsole
        +
        For Windows: JDK_HOME\bin\jconsole.exe
        +

        Select the local org.jboss.modules.Main process and click Connect. You are presented with the following screen.

        + MBeans in JConsole + +

        To test the MBeans :

        +
          +
        1. Click on the JConsole MBeans tab.
        2. +
        3. Expand quickstarts in the left column of the console.
        4. +
        5. Under quickstarts, you see the 4 MBeans: AnnotatedComponentHelloWorld, MXComponentHelloWorld, MXPojoHelloWorld, and SarMXPojoHelloWorld
        6. +
        7. Expand each MBean and choose: Operations --> sayHello.
        8. +
        9. Type your name in the (p0 String ) input text box and click the sayHello button.
        10. +
        11. You will see a popup Window displaying Hello <your name>!.
        12. +
        + + + diff --git a/helloworld-mdb-propertysubstitution/src/main/webapp/index.html b/helloworld-mdb-propertysubstitution/src/main/webapp/index.html index 74f0c764d6..1b75ef9155 100644 --- a/helloworld-mdb-propertysubstitution/src/main/webapp/index.html +++ b/helloworld-mdb-propertysubstitution/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - + + + + + + + diff --git a/helloworld-mdb/src/main/webapp/index.html b/helloworld-mdb/src/main/webapp/index.html index 74f0c764d6..1b75ef9155 100644 --- a/helloworld-mdb/src/main/webapp/index.html +++ b/helloworld-mdb/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - + + + + + + + diff --git a/helloworld-rs/src/main/webapp/index.html b/helloworld-rs/src/main/webapp/index.html index b71f38ee1b..57c45fca19 100644 --- a/helloworld-rs/src/main/webapp/index.html +++ b/helloworld-rs/src/main/webapp/index.html @@ -29,4 +29,4 @@
      • XML
      • - \ No newline at end of file + diff --git a/helloworld-ws/src/main/webapp/index.html b/helloworld-ws/src/main/webapp/index.html index 0df2f2870d..b93cb46da5 100644 --- a/helloworld-ws/src/main/webapp/index.html +++ b/helloworld-ws/src/main/webapp/index.html @@ -16,24 +16,24 @@ --> jboss-helloworld-ws Quickstart - +

        helloworld-ws Quickstart

        - The helloworld-ws quickstart demonstrates the use of JAX-WS in + The helloworld-ws quickstart demonstrates the use of JAX-WS in Red Hat JBoss Enterprise Application Platform as a simple Hello World application.

        - There is no user interface for this quickstart. Instead, you can verify the - Web Service is running and deployed correctly by accessing the following URL: + There is no user interface for this quickstart. Instead, you can verify the + Web Service is running and deployed correctly by accessing the following URL:

        This URL will display the WSDL definition for the deployed Web Service endpoint. -

        +

        diff --git a/helloworld/src/main/webapp/index.html b/helloworld/src/main/webapp/index.html index e9f8950917..8e59c00ac4 100644 --- a/helloworld/src/main/webapp/index.html +++ b/helloworld/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - + + + + + + + diff --git a/inter-app/appA/src/main/webapp/index.html b/inter-app/appA/src/main/webapp/index.html index 2914c61ef9..5d4d3cbb4d 100644 --- a/inter-app/appA/src/main/webapp/index.html +++ b/inter-app/appA/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - + + + + + + + diff --git a/inter-app/appB/src/main/webapp/index.html b/inter-app/appB/src/main/webapp/index.html index 2914c61ef9..5d4d3cbb4d 100644 --- a/inter-app/appB/src/main/webapp/index.html +++ b/inter-app/appB/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - + + + + + + + diff --git a/jsonp/src/main/webapp/index.html b/jsonp/src/main/webapp/index.html index bd1d3ba865..5144075b17 100644 --- a/jsonp/src/main/webapp/index.html +++ b/jsonp/src/main/webapp/index.html @@ -20,4 +20,4 @@ - \ No newline at end of file + diff --git a/jta-crash-rec/src/main/webapp/index.html b/jta-crash-rec/src/main/webapp/index.html index 7087910bdf..9e37721571 100644 --- a/jta-crash-rec/src/main/webapp/index.html +++ b/jta-crash-rec/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - - + + + + + + + + diff --git a/jts/application-component-1/src/main/webapp/index.html b/jts/application-component-1/src/main/webapp/index.html index a02b72f73b..a78a0b2bfe 100644 --- a/jts/application-component-1/src/main/webapp/index.html +++ b/jts/application-component-1/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - + + + + + + + diff --git a/kitchensink-html5-mobile/src/main/webapp/index.html b/kitchensink-html5-mobile/src/main/webapp/index.html index 483b38af35..a09d4c9048 100644 --- a/kitchensink-html5-mobile/src/main/webapp/index.html +++ b/kitchensink-html5-mobile/src/main/webapp/index.html @@ -48,12 +48,12 @@ - + - + diff --git a/logging-tools/src/main/webapp/index.html b/logging-tools/src/main/webapp/index.html index 4c3a5ede7d..6de633011b 100644 --- a/logging-tools/src/main/webapp/index.html +++ b/logging-tools/src/main/webapp/index.html @@ -16,7 +16,7 @@ --> jboss-logging-tools Quick Start - +

        logging-tools Quick Start

        @@ -33,7 +33,7 @@

        Internationalization and Localisation with JBoss Logging Tools

        The different methods of the JAX-RS service can be access using the URLs below:

        - +
        • rest/greetings/name @@ -50,7 +50,7 @@

          Internationalization and Localisation with JBoss Logging Tools

        • Logs a localized "Hello message sent".
        • -
        +
      • diff --git a/logging/src/main/webapp/index.html b/logging/src/main/webapp/index.html index 7591db404b..1ae67e5866 100644 --- a/logging/src/main/webapp/index.html +++ b/logging/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - - + + + + + + + + diff --git a/mail/src/main/webapp/index.html b/mail/src/main/webapp/index.html index 3e07684650..0897d6b00e 100644 --- a/mail/src/main/webapp/index.html +++ b/mail/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - + + + + + + + diff --git a/numberguess/src/main/webapp/index.html b/numberguess/src/main/webapp/index.html index 3e07684650..0897d6b00e 100644 --- a/numberguess/src/main/webapp/index.html +++ b/numberguess/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - + + + + + + + diff --git a/payment-cdi-event/src/main/webapp/index.html b/payment-cdi-event/src/main/webapp/index.html index e762456b38..5d4d3cbb4d 100644 --- a/payment-cdi-event/src/main/webapp/index.html +++ b/payment-cdi-event/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - - + + + + + + + + diff --git a/servlet-async/src/main/webapp/index.html b/servlet-async/src/main/webapp/index.html index 61825e7c36..b8a03e2ffb 100644 --- a/servlet-async/src/main/webapp/index.html +++ b/servlet-async/src/main/webapp/index.html @@ -1,62 +1,62 @@ - - - - servlet-async - - - -
        - This simple demo client continuously sends requests to /AsynchronousServlet
        - to invoke a resource intensive task which asynchronously generates a response. -
        -
        - Last response received at: -
        - (no response yet) -
        - - - - + + + + servlet-async + + + +
        + This simple demo client continuously sends requests to /AsynchronousServlet
        + to invoke a resource intensive task which asynchronously generates a response. +
        +
        + Last response received at: +
        + (no response yet) +
        + + + + diff --git a/servlet-filterlistener/src/main/webapp/index.html b/servlet-filterlistener/src/main/webapp/index.html index a4b61c21dc..3ddc077794 100644 --- a/servlet-filterlistener/src/main/webapp/index.html +++ b/servlet-filterlistener/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - + + + + + + + diff --git a/servlet-security/src/main/webapp/index.html b/servlet-security/src/main/webapp/index.html index e865228a1a..db8a28efc5 100644 --- a/servlet-security/src/main/webapp/index.html +++ b/servlet-security/src/main/webapp/index.html @@ -1,23 +1,23 @@ - - - - - - - + + + + + + + diff --git a/spring-petclinic/src/main/java/overview.html b/spring-petclinic/src/main/java/overview.html index 5d523ad4e9..3f8d3e67f8 100644 --- a/spring-petclinic/src/main/java/overview.html +++ b/spring-petclinic/src/main/java/overview.html @@ -1,23 +1,23 @@ - - - - -

        - The Spring Data Binding framework, an internal library used by Spring Web Flow. -

        - - \ No newline at end of file + + + + +

        + The Spring Data Binding framework, an internal library used by Spring Web Flow. +

        + + diff --git a/spring-petclinic/src/main/java/test.html b/spring-petclinic/src/main/java/test.html index f58500dce2..58ad4e754d 100644 --- a/spring-petclinic/src/main/java/test.html +++ b/spring-petclinic/src/main/java/test.html @@ -17,11 +17,11 @@