[Cosmo-dev] Fwd: [commits-cosmo] (mde) [4291] Removing vast amounts
of redundant whitespace.
Bobby Rullo
br at osafoundation.org
Tue May 1 17:17:54 PDT 2007
Mde,
Please don't do that again! It caused tons of conflicts for me and
Travis.
Begin forwarded message:
> From: svncheckin at osafoundation.org
> Date: May 1, 2007 11:25:32 AM PDT
> To: commits-cosmo at osafoundation.org
> Subject: [commits-cosmo] (mde) [4291] Removing vast amounts of
> redundant whitespace.
> List-Id: OSAF Cosmo Checkins <commits-cosmo.osafoundation.org>
>
> Revision
> 4291
> Author
> mde
> Date
> 2007-05-01 11:25:30 -0700 (Tue, 01 May 2007)
> Log Message
>
> Removing vast amounts of redundant whitespace.
> Modified Paths
>
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/account/common.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/account/create.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/account/settings.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/cmp.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/conduits.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/datetime/timezone/
> LazyCachingTimezoneRegistry.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/datetime/timezone.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/datetime/util.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/datetime.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/env.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/legacy/cal_event.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/model/EventStamp.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/model/Item.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/model/util.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/model.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/rpc/JsonService.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/rpc/MockJsonService.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/service/atom.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/service/conduits/common.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/service/conduits/jsonrpc.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/service/exception.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/service/service_stub.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/service/translators/eim.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/service/transport/Atom.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/service/transport/Rest.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/__package__.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/cal_form.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/contentcontainer.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/event/handlers.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/global_css.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/login.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/minical.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/widget/About.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/widget/AuthBox.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/widget/ButtonPanel.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/widget/
> CollectionDetailsDialog.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/widget/
> CollectionSelector.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/widget/CosmoUserList.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/widget/Layout.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/widget/ModalDialog.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/widget/
> PasswordRecoverer.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/widget/
> PasswordResetter.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/widget/TabContainer.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/widget/TicketWidget.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/widget/templates/
> CollectionDetailsDialog/CollectionDetailsDialog.html
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/ui/widget/templates/
> Debug.css
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/util/auth.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/util/encoding.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/util/hash.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/util/log.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/util/popup.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/util/text.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/view/cal/canvas.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/view/cal/draggable.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/view/cal/lozenge.js
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/view/cal.js
> Diff
>
> Modified: cosmo/trunk/cosmo/src/main/webapp/js/cosmo/account/
> common.js (4290 => 4291)
>
> --- cosmo/trunk/cosmo/src/main/webapp/js/cosmo/account/common.js
> 2007-05-01 18:20:34 UTC (rev 4290)
> +++ cosmo/trunk/cosmo/src/main/webapp/js/cosmo/account/common.js
> 2007-05-01 18:25:30 UTC (rev 4291)
> @@ -24,84 +24,84 @@
> var list = [];
> var f = {};
> var a = accountInfo || {}; // If account info passed, set
> input values
> -
> +
> // Don't include username when editing account settings
> if (!accountInfo) {
> - f = { label:_('Signup.Form.Username'),
> + f = { label:_('Signup.Form.Username'),
> elemName: 'username',
> elemType: 'text'
> };
> - f.validators = function (elem) {
> - return (cosmo.util.validate.required(elem) ||
> + f.validators = function (elem) {
> + return (cosmo.util.validate.required(elem) ||
> cosmo.util.validate.minLength(elem, 3)); };
> f.value = a[f.elemName];
> list.push(f);
> }
> -
> +
> f = { label: _('Signup.Form.FirstName'),
> elemName: 'firstName',
> elemType: 'text'
> };
> - f.validators = function (elem) {
> + f.validators = function (elem) {
> return cosmo.util.validate.required(elem); };
> f.value = a[f.elemName];
> list.push(f);
> -
> - f = { label: _('Signup.Form.LastName'),
> +
> + f = { label: _('Signup.Form.LastName'),
> elemName: 'lastName',
> elemType: 'text'
> };
> - f.validators = function (elem) {
> + f.validators = function (elem) {
> return cosmo.util.validate.required(elem); };
> f.value = a[f.elemName];
> list.push(f);
> -
> - f = { label: _('Signup.Form.EMailAddress'),
> +
> + f = { label: _('Signup.Form.EMailAddress'),
> elemName: 'email',
> elemType: 'text'
> };
> - f.validators = function (elem) {
> - return (cosmo.util.validate.required(elem) ||
> + f.validators = function (elem) {
> + return (cosmo.util.validate.required(elem) ||
> cosmo.util.validate.eMail(elem)); };
> f.value = a[f.elemName];
> list.push(f);
> -
> - f = { label: _('Signup.Form.Password'),
> - elemName: 'password',
> +
> + f = { label: _('Signup.Form.Password'),
> + elemName: 'password',
> elemType: 'password'
> };
> // User editing own account -- blank password means no change
> if (accountInfo) {
> - f.validators = function (elem) {
> + f.validators = function (elem) {
> return cosmo.util.validate.minLength(elem, 5); };
>
> }
> - // Creating a new account -- require password field
> + // Creating a new account -- require password field
> else {
> - f.validators = function (elem) {
> - return (cosmo.util.validate.required(elem) ||
> + f.validators = function (elem) {
> + return (cosmo.util.validate.required(elem) ||
> cosmo.util.validate.minLength(elem, 5)); };
> }
> f.value = a[f.elemName];
> list.push(f);
> -
> - f = { label: _('Signup.Form.ConfirmPassword'),
> - elemName: 'confirm',
> +
> + f = { label: _('Signup.Form.ConfirmPassword'),
> + elemName: 'confirm',
> elemType: 'password' };
> // User editing own account -- blank password means no change
> if (accountInfo) {
> - f.validators = function (elem1, elem2) {
> + f.validators = function (elem1, elem2) {
> return cosmo.util.validate.confirmPass(elem1, elem2); };
> }
> - // Creating a new account -- require password field
> + // Creating a new account -- require password field
> else {
> - f.validators = function (elem1, elem2) {
> - return (cosmo.util.validate.required(elem1) ||
> + f.validators = function (elem1, elem2) {
> + return (cosmo.util.validate.required(elem1) ||
> cosmo.util.validate.confirmPass(elem1, elem2)); };
> }
> f.value = a[f.elemName];
> list.push(f);
> -
> +
> return list;
> };
>
> @@ -109,7 +109,7 @@
> * Programmatically creates the table of form elements
> * used for signup. Loops through fieldList for all the
> * form fields.
> - * @return Object (HtmlFormElement), form to append to the
> + * @return Object (HtmlFormElement), form to append to the
> * content area of the modal dialog box.
> */
> cosmo.account.getFormTable = function (fieldList, isCreate) {
> @@ -119,13 +119,13 @@
> var td = null;
> var elem = null;
> var form = _createElem('form');
> -
> +
> form.id = 'accountSignupForm';
> form.onsubmit = function () { return false; };
> -
> +
> table = _createElem('table');
> body = _createElem('tbody');
> -
> +
> if (isCreate) {
> table.style.width = '60%';
> }
> @@ -133,17 +133,17 @@
> table.style.width = '100%';
> }
> table.style.margin = 'auto';
> -
> +
> var inputs = [];
> -
> +
> // Table row for each form field
> for (var i = 0; i < fieldList.length; i++) {
> var f = fieldList[i];
> var type = f.elemType;
> -
> +
> // Create row
> tr = _createElem('tr');
> -
> +
> // Label cell
> td = _createElem('td');
> td.id = f.elemName + 'LabelCell';
> @@ -152,7 +152,7 @@
> td.appendChild(_createText(f.label + ':'));
> td.style.width = '1%';
> tr.appendChild(td);
> -
> +
> // Form field cell
> td = _createElem('td');
> td.id = f.elemName + 'ElemCell';
> @@ -168,14 +168,14 @@
> elem.value = f.value || '';
> inputs.push(elem);
> td.appendChild(elem);
> -
> +
> tr.appendChild(td);
> body.appendChild(tr);
> }
> table.appendChild(body);
> form.appendChild(table);
> -
> - // BANDAID: Hack to get the checkbox into Safari's
> +
> + // BANDAID: Hack to get the checkbox into Safari's
> // form elements collection
> if (navigator.userAgent.indexOf('Safari') > -1) {
> cosmo.util.html.addInputsToForm(inputs, form);
> @@ -196,8 +196,8 @@
> var errRet = '';
> for (var i = 0; i < fieldList.length; i++) {
> var field = fieldList[i];
> - cell = document.getElementById(field.elemName +
> - 'ElemCell');
> + cell = document.getElementById(field.elemName +
> + 'ElemCell');
> err = field.validators(form[field.elemName], form
> ['password'], false);
> // Remove any previous err msg div
> child = cell.firstChild;
> @@ -208,7 +208,7 @@
> // At least one err msg string returned from chain of methods
> if (err) {
> // Set master err msg for return
> - errRet = _('Signup.Error.Main');
> + errRet = _('Signup.Error.Main');
> // Insert err msg div before text input
> div = _createElem('div');
> div.className = 'inputError';
> Modified: cosmo/trunk/cosmo/src/main/webapp/js/cosmo/account/
> create.js (4290 => 4291)
>
> --- cosmo/trunk/cosmo/src/main/webapp/js/cosmo/account/create.js
> 2007-05-01 18:20:34 UTC (rev 4290)
> +++ cosmo/trunk/cosmo/src/main/webapp/js/cosmo/account/create.js
> 2007-05-01 18:25:30 UTC (rev 4291)
> @@ -28,12 +28,12 @@
>
> var self = this; // Stash a copy of this
> var form = null; // The form containing the signup fields
> - var fieldList = cosmo.account.getFieldList();
> + var fieldList = cosmo.account.getFieldList();
> var f = null; // Temp var
> -
> +
> /**
> - * Handler function for XHR call to cosmo.cmp for signup.
> - * Sets error prompt if request fails, set up the results
> + * Handler function for XHR call to cosmo.cmp for signup.
> + * Sets error prompt if request fails, set up the results
> * table with external client config on success.
> * @return Boolean, true on success, false on failure
> */
> @@ -46,13 +46,13 @@
> err = _('Signup.Error.AlreadyLoggedIn');
> break;
> case 431:
> - err = _('Signup.Error.UsernameInUse');
> + err = _('Signup.Error.UsernameInUse');
> break;
> case 432:
> err = _('Signup.Error.EMailInUse');
> break;
> default:
> - err = _('Signup.Error.Generic') + ' (error
> code ' +
> + err = _('Signup.Error.Generic') + ' (error
> code ' +
> resp.status + ')';
> break;
> }
> @@ -73,27 +73,27 @@
> * Sets up a hash of data for the info needed to configure an
> * external cal client to access this Cosmo account.
> * @return Object, hash of configuration data -- hash keys
> - * are also the keys for the i18n label strings for the
> + * are also the keys for the i18n label strings for the
> * data in the displayed table.
> *
> */
> function getClientConfig(user) {
> -
> +
> var cfg = {};
> var username = user.username;
> var homedirUrl = new dojo.uri.Uri(user.homedirUrl);
> // Server settings
> var isSSL = homedirUrl.scheme == 'https';
> -
> +
> var portNum = homedirUrl.port;
> // Port -- if none specified use 80 (or 443 for https)
> if (portNum == undefined) {
> portNum = isSSL ? 443 : 80;
> }
> -
> +
> // String to display for SSL
> isSSL = isSSL ? 'Yes' : 'No';
> -
> +
> // Config settings for external client setup
> cfg['Server'] = homedirUrl.host;
> cfg['Path'] = homedirUrl.path;
> @@ -120,10 +120,10 @@
> var a = null;
> var tr = null;
> var td = null;
> -
> +
> // Outer div
> var dO = _createElem('div');
> -
> +
> if (user.unactivated) {
> p = _createElem('div');
> p.style.marginBottom = '16px';
> @@ -132,30 +132,30 @@
> p.appendChild(_createText(_
> ('Signup.Prompt.AccountActivation')));
> dO.appendChild(p);
> }
> -
> +
> p = _createElem('div');
> p.appendChild(_createText(_('Signup.Prompt.AccountSetup')));
> dO.appendChild(p);
> -
> +
> // Create the table, append rows for each config value
> var table = _createElem('table');
> table.className = 'dataDisplay';
> table.style.width = '80%';
> - table.style.margin = 'auto';
> + table.style.margin = 'auto';
> table.style.marginTop = '12px';
> -
> +
> var body = _createElem('tbody');
>
> // Create a row for each config setting
> for (var propName in cfg) {
> tr = _createElem('tr');
> -
> +
> // Prop label
> td = _createElem('td');
> td.className = 'dataDisplayLabel';
> td.appendChild(_createText(_('Signup.Config.' +
> propName)));
> tr.appendChild(td);
> -
> +
> // Prop value
> td = _createElem('td');
> td.appendChild(_createText(cfg[propName]));
> @@ -164,7 +164,7 @@
> }
> table.appendChild(body);
> dO.appendChild(table);
> -
> +
> /*
> ***** Leave this out until we can actually do auto-login
> *****
> // Link to begin using new account
> @@ -179,11 +179,11 @@
> dO.appendChild(p);
> }
> */
> -
> +
> // Return the div containing the content
> return dO;
> }
> -
> +
> // Public methods
> // =============================
> /**
> @@ -193,7 +193,7 @@
> this.showForm = function () {
> var o = {};
> var b = null;
> -
> +
> o.width = 540;
> o.height = 480;
> o.title = 'Create an Account';
> @@ -206,7 +206,7 @@
> o.btnsLeft = [b];
> // Have to set empty center set of buttons -- showForm
> will be called
> // without buttons getting cleared by 'hide.'
> - o.btnsCenter = [];
> + o.btnsCenter = [];
> b = new cosmo.ui.button.Button({ text:_
> ('App.Button.Submit'), width:74,
> handleOnClick: function () { self.submitCreate(); } });
> o.btnsRight = [b];
> @@ -216,14 +216,14 @@
> form.username.focus();
> };
> /**
> - * Submit the call via XHR to cosmo.cmp to sign the user
> + * Submit the call via XHR to cosmo.cmp to sign the user
> * up for a new account.
> */
> this.submitCreate = function () {
> // Validate the form input using each field's
> // attached validators
> var err = cosmo.account.validateForm(form, fieldList);
> -
> +
> if (err) {
> cosmo.app.modalDialog.setPrompt(err);
> }
> @@ -249,10 +249,10 @@
> var content = getResultsTable(user, cfg);
> var prompt = _('Signup.Prompt.Success');
> var d = cosmo.app.modalDialog;
> - var btnsCenter = [dojo.widget.createWidget("cosmo:Button",
> - { text:_('App.Button.Close'), width:74,
> + var btnsCenter = [dojo.widget.createWidget("cosmo:Button",
> + { text:_('App.Button.Close'), width:74,
> handleOnClick: function () { cosmo.app.hideDialog
> (); } })];
> -
> +
> // Update dialog in place
> d.setPrompt(prompt);
> d.setContent(content);
> Modified: cosmo/trunk/cosmo/src/main/webapp/js/cosmo/account/
> settings.js (4290 => 4291)
>
> --- cosmo/trunk/cosmo/src/main/webapp/js/cosmo/account/settings.js
> 2007-05-01 18:20:34 UTC (rev 4290)
> +++ cosmo/trunk/cosmo/src/main/webapp/js/cosmo/account/settings.js
> 2007-05-01 18:25:30 UTC (rev 4291)
> @@ -28,7 +28,7 @@
> var originalAboutBox = null;
>
> cosmo.account.settings = new function () {
> -
> +
> var self = this; // Stash a copy of this
> this.detailsForm = null; // The form containing the signup fields
> this.advancedForm = null;
> @@ -41,25 +41,25 @@
> general: _('AccountSettings.General'),
> advanced: _('AccountSettings.Advanced'),
> about: _('AccountSettings.About'),
> - advancedAccountBrowser: _
> ('AccountSettings.Advanced.AccountBrowser')
> + advancedAccountBrowser: _
> ('AccountSettings.Advanced.AccountBrowser')
> }
> -
> +
> // Public memebers
> // ==============
> // Cache of user account data
> this.accountInfo = null;
> // Array of form input fields for basic account data
> - this.fieldList = [];
> -
> + this.fieldList = [];
> +
> // Public methods
> // ==============
> /**
> - * Handles successful loading of the current account info from
> + * Handles successful loading of the current account info from
> * the server -- will reload updated account info if the user
> * edits it
> * @param type String, should be 'load'
> * @param data Object, a hash of account properties
> - * @param resp Object, the XHR obj
> + * @param resp Object, the XHR obj
> */
> this.accountInfoLoadSuccess = function (type, data, resp) {
> this.accountInfo = data;
> @@ -70,7 +70,7 @@
> * @param type String, should be 'error'
> * @param data Object, error object -- 'message' prop contains
> * actual error message text
> - * @param resp Object, the XHR obj
> + * @param resp Object, the XHR obj
> */
> this.accountInfoLoadError = function (type, data, resp) {
> var err = strings['settingsErrorLoad'];
> @@ -84,23 +84,23 @@
> */
> this.showDialog = function () {
> var o = {};
> - var s = document.createElement('span'); // Throwaway node
> to avoid doc reflow
> + var s = document.createElement('span'); // Throwaway node
> to avoid doc reflow
> var tabs = [];
> var tabLabel = '';
> var tabContent = null;
> -
> +
> o.width = 580;
> o.height = 380;
> o.title = strings.title;
> o.prompt = ''; // This dialog has no prompt
> -
> - // No user account data cached -- grab it from the server
> +
> + // No user account data cached -- grab it from the server
> // and bail out
> if (!this.accountInfo) {
> var self = this;
> - var success = function (type, data, resp) {
> + var success = function (type, data, resp) {
> self.accountInfoLoadSuccess(type, data, resp); };
> - var error = function (type, data, resp) {
> + var error = function (type, data, resp) {
> self.accountInfoLoadError(type, data, resp); };
> var hand = { load: success, error: error };
> cosmo.cmp.getAccount(hand, true);
> @@ -108,10 +108,10 @@
> }
>
> // Build the list of fields based on the account info
> - this.fieldList = cosmo.account.getFieldList
> (this.accountInfo);
> + this.fieldList = cosmo.account.getFieldList
> (this.accountInfo);
> // Build the form using the list of input fields
> this.detailsForm = cosmo.account.getFormTable
> (this.fieldList, false);
> -
> +
> // Add the notice to the right of the password field
> // to indicate that leaving the fields blank mean 'no change'
> var passCell = this.detailsForm.password.parentNode;
> @@ -131,50 +131,50 @@
> d = _createElem('div');
> d.className = 'clearBoth';
> passCell.appendChild(d);
> -
> +
> // General tab -- general account data
> // -------
> - tabLabel = strings.general;
> + tabLabel = strings.general;
> tabContent = _createElem('div');
> tabContent.appendChild(this.detailsForm);
> tabs.push({ label: tabLabel, content: tabContent });
> -
> +
> // Advanced settings
> // -------
> - tabLabel = strings.advanced;
> + tabLabel = strings.advanced;
> tabContent = _createElem('div');
> this.advancedForm = this.getAdvancedForm();
> tabContent.appendChild(this.advancedForm);
> tabs.push({ label: tabLabel, content: tabContent });
> -
> +
> // About Cosmo tab
> // -------
> - tabLabel = strings.about;
> + tabLabel = strings.about;
> var about = dojo.widget.createWidget("cosmo:About", {}, s,
> 'last');
> s.removeChild(about.domNode); // Detach from the throwaway
> node
> tabContent = about;
> originalAboutBox = about;
> tabs.push({ label: tabLabel, content: tabContent });
> -
> +
> var self = this; // For callback scope
> // Submit button and default Enter-key action
> var f = function () { self.submitSave.apply(self); };
> -
> +
> var b = null; // For dialog buttons
> var c = null; // For dialog content area
> - c = dojo.widget.createWidget("cosmo:TabContainer", {
> + c = dojo.widget.createWidget("cosmo:TabContainer", {
> tabs: tabs }, s, 'last');
> s.removeChild(c.domNode); // Detach from the throwaway node
> o.content = c;
> - b = new cosmo.ui.button.Button({ text:_('App.Button.Close'),
> - width:60, small: true, handleOnClick: function () {
> + b = new cosmo.ui.button.Button({ text:_('App.Button.Close'),
> + width:60, small: true, handleOnClick: function () {
> cosmo.app.hideDialog(); } });
> o.btnsLeft = [b];
> - b = new cosmo.ui.button.Button({ text:_('App.Button.Save'),
> + b = new cosmo.ui.button.Button({ text:_('App.Button.Save'),
> width:60, small: true, handleOnClick: f });
> o.btnsRight = [b];
> o.defaultAction = f;
> -
> +
> cosmo.app.showDialog(o);
> }
> /**
> @@ -184,26 +184,26 @@
> // Save preferences syncronously first
> var prefs = {};
>
> - prefs[cosmo.account.preferences.SHOW_ACCOUNT_BROWSER_LINK] =
> + prefs[cosmo.account.preferences.SHOW_ACCOUNT_BROWSER_LINK] =
> this.advancedForm.showAccountBrowser.checked.toString();
> -
> +
> cosmo.account.preferences.setMultiplePreferences(prefs);
> -
> +
> // Validate the form input using each field's
> // attached validators
> var fieldList = this.fieldList;
> - // Validate fields with the attached validators
> + // Validate fields with the attached validators
> // and display any inline err messages
> var err = cosmo.account.validateForm(this.detailsForm,
> fieldList, false);
> -
> +
> // No error -- submit updated account info via CMP
> if (!err) {
> var self = this;
> - // Same handler for both success and error -- IE throws a
> + // Same handler for both success and error -- IE throws a
> // freakish '1223' HTTP code when server returns a
> successful
> // 204 'No content'. Dojo's io.bind doesn't recognize
> that as
> // success, so we have to examine status codes manually
> - var f = function (type, data, resp) {
> + var f = function (type, data, resp) {
> self.handleAccountSave(type, data, resp); };
> var hand = { handle: f };
> var account = {};
> @@ -226,8 +226,8 @@
> * @param type String, may be 'load' or 'error' -- if type is
> * 'error,' this may be bogus result from weird IE 1223
> * HTTP response code
> - * @param data Object, May be data or error object
> - * @param resp Object, the XHR obj
> + * @param data Object, May be data or error object
> + * @param resp Object, the XHR obj
> */
> this.handleAccountSave = function (type, data, resp) {
> var stat = resp.status;
> @@ -253,7 +253,7 @@
>
> // Both error & success -- the dialog goes poof
> cosmo.app.hideDialog();
> -
> +
> // Errors, spawn a new dialog to report the error
> if (err) {
> cosmo.app.showErr(err, data);
> @@ -269,17 +269,17 @@
> var nbsp = function () { return cosmo.util.html.nbsp(); };
> var prefs = cosmo.account.preferences.getPreferences();
> var checkedDefault = (prefs
> [cosmo.account.preferences.SHOW_ACCOUNT_BROWSER_LINK] == 'true');
> - var check = cosmo.util.html.createInput({ type: 'checkbox',
> - id: 'showAccountBrowser', name: 'showAccountBrowser',
> + var check = cosmo.util.html.createInput({ type: 'checkbox',
> + id: 'showAccountBrowser', name: 'showAccountBrowser',
> value: '', checked: checkedDefault });
> -
> +
> div.appendChild(check);
> div.appendChild(nbsp());
> div.appendChild(nbsp());
> div.appendChild(_createText(strings.advancedAccountBrowser));
> form.appendChild(div);
>
> - // BANDAID: Hack to get the checkbox into Safari's
> + // BANDAID: Hack to get the checkbox into Safari's
> // form elements collection
> if (navigator.userAgent.indexOf('Safari') > -1) {
> cosmo.util.html.addInputsToForm([check], form);
> @@ -287,6 +287,6 @@
>
> return form;
> };
> -
> -
> +
> +
> };
> Modified: cosmo/trunk/cosmo/src/main/webapp/js/cosmo/cmp.js (4290
> => 4291)
>
> --- cosmo/trunk/cosmo/src/main/webapp/js/cosmo/cmp.js 2007-05-01
> 18:20:34 UTC (rev 4290)
> +++ cosmo/trunk/cosmo/src/main/webapp/js/cosmo/cmp.js 2007-05-01
> 18:25:30 UTC (rev 4291)
> @@ -11,7 +11,7 @@
> * See the License for the specific language governing permissions
> and
> * limitations under the License.
> */
> -
> +
> /**
> * summary:
> * This module provides wrappers around dojo.io.bind to
> simplify using
> @@ -19,7 +19,7 @@
> * description:
> * For more information about CMP, please see:
> * http://wiki.osafoundation.org/Projects/
> CosmoManagementProtocol
> - *
> + *
> * Most methods take handlerDicts identical to those required
> * by dojo.io.bind.
> */
> @@ -47,9 +47,9 @@
> /**
> * summary: Return request populated with attributes
> common to all CMP calls.
> */
> - getDefaultCMPRequest: function (/*Object*/ handlerDict,
> + getDefaultCMPRequest: function (/*Object*/ handlerDict,
> /*boolean?*/ sync){
> -
> +
> var request = cosmo.util.auth.getAuthorizedRequest()
>
> request.load = handlerDict.load;
> @@ -67,27 +67,27 @@
>
> return request;
> },
> -
> +
> /*
> - * Administrator operations:
> - * administrator user credentials must be provided
> with the
> + * Administrator operations:
> + * administrator user credentials must be provided
> with the
> * request for these operations
> - *
> + *
> */
> /**
> * summary: Get a list of the users on this Cosmo instance
> - * description: Get an Array of Objects representing a
> list of
> + * description: Get an Array of Objects representing a
> list of
> * users on this Cosmo instance. The
> composition of
> * this list can be specified with the server
> side
> - * paging parameters <code>pageNumber</code>,
> + * paging parameters <code>pageNumber</code>,
> * <code>pageSize</code>, <code>sortOrder</
> code> and
> * <code>sortType</code>.
> - */
> - getUsers: function (/*Object*/ handlerDict,
> - /*int*/ pageNumber,
> - /*int*/ pageSize,
> - /*String*/ sortOrder,
> - /*String*/ sortType,
> + */
> + getUsers: function (/*Object*/ handlerDict,
> + /*int*/ pageNumber,
> + /*int*/ pageSize,
> + /*String*/ sortOrder,
> + /*String*/ sortType,
> /*boolean?*/ sync) {
> handlerDict = this._wrapXMLHandlerFunctions
> (handlerDict, this.cmpUsersXMLToJSON);
>
> @@ -96,18 +96,18 @@
>
> /**
> * summary: Get a list of the users on this Cosmo instance
> - * description: Get an XML representation of a list of
> + * description: Get an XML representation of a list of
> * users on this Cosmo instance. The
> composition of
> * this list can be specified with the server
> side
> - * paging parameters <code>pageNumber</code>,
> + * paging parameters <code>pageNumber</code>,
> * <code>pageSize</code>, <code>sortOrder</
> code> and
> * <code>sortType</code>.
> - */
> - getUsersXML: function (/*Object*/ handlerDict,
> - /*int*/ pageNumber,
> - /*int*/ pageSize,
> - /*String*/ sortOrder,
> - /*String*/ sortType,
> + */
> + getUsersXML: function (/*Object*/ handlerDict,
> + /*int*/ pageNumber,
> + /*int*/ pageSize,
> + /*String*/ sortOrder,
> + /*String*/ sortType,
> /*boolean?*/ sync) {
> var requestDict = this.getDefaultCMPRequest
> (handlerDict, sync);
> requestDict.url = cosmo.env.getBaseUrl() + "/cmp/users";
> @@ -123,13 +123,13 @@
>
> dojo.io.bind(requestDict);
> },
> -
> +
> /**
> * summary: Get the user representation for
> <code>username</code>
> * description: Return an Object representation of
> <code>username</code>.
> */
> - getUser: function(/*String*/ username,
> - /*Object*/ handlerDict,
> + getUser: function(/*String*/ username,
> + /*Object*/ handlerDict,
> /*boolean?*/ sync) {
> handlerDict = this._wrapXMLHandlerFunctions
> (handlerDict, this.cmpUserXMLToJSON);
>
> @@ -141,17 +141,17 @@
> * description: Return an XML representation of
> <code>username</code>.
> */
> getUserXML: function (/*String*/ username,
> - /*Object*/ handlerDict,
> + /*Object*/ handlerDict,
> /*boolean?*/ sync) {
> -
> +
> var requestDict = this.getDefaultCMPRequest
> (handlerDict, sync);
> - requestDict.url = cosmo.env.getBaseUrl() + "/cmp/user/" +
> + requestDict.url = cosmo.env.getBaseUrl() + "/cmp/user/" +
> encodeURIComponent(dojo.string.trim(username));
> requestDict.method = "GET";
>
> dojo.io.bind(requestDict);
> },
> -
> +
> /**
> * summary: Create the user described by <code>userHash</
> code>
> * description: Create the user described by
> <code>userHash</code>.
> @@ -166,14 +166,14 @@
> '<email>' + userHash.email + '</
> email>';
>
> if (userHash.administrator) {
> - request_content += '<' + EL_ADMINISTRATOR + '
> >true</' +
> + request_content += '<' + EL_ADMINISTRATOR + '
> >true</' +
> EL_ADMINISTRATOR + '>';
> }
>
> request_content += '</user>'
>
> requestDict = this.getDefaultCMPRequest
> (handlerDict, true, sync)
> - requestDict.url = cosmo.env.getBaseUrl() + "/cmp/
> user/" +
> + requestDict.url = cosmo.env.getBaseUrl() + "/cmp/
> user/" +
> encodeURIComponent(dojo.string.trim
> (userHash.username));
> requestDict.method = "POST";
> requestDict.headers['X-Http-Method-Override'] =
> "PUT";
> @@ -194,7 +194,7 @@
>
> if (username == cosmo.util.auth.getUsername() &&
> (userHash.password || userHash.username)){
> -
> +
> var newCred = {};
> if (userHash.password){
> newCred.password = userHash.password;
> @@ -202,7 +202,7 @@
> if (userHash.username){
> newCred.username = userHash.username;
> }
> -
> +
> handlerDict =
> this._wrapChangeCredentialFunctions(
> handlerDict, [204], newCred);
> }
> @@ -212,7 +212,7 @@
> document.all){
> handlerDict = this._wrap204Bandaid(handlerDict);
> }
> -
> +
> var request_content = '<?xml version="1.0"
> encoding="utf-8" ?>\r\n' +
> '<user xmlns="http://osafoundation.org/
> cosmo/CMP">';
> for (propName in userHash) {
> @@ -227,26 +227,26 @@
> requestDict.method = "POST";
> requestDict.headers['X-Http-Method-Override'] =
> "PUT";
> requestDict.postContent = request_content;
> -
> +
> dojo.io.bind(requestDict);
>
> },
> -
> +
> /**
> * summary: Delete <code>username</code>
> * description: Delete <code>username</code>
> - *
> + *
> */
> - deleteUser: function (/*String*/ username,
> - /*Object*/ handlerDict,
> + deleteUser: function (/*String*/ username,
> + /*Object*/ handlerDict,
> /*boolean?*/ sync) {
> -
> +
> // Safari and IE don't understand 204s. Boo.
> if (navigator.userAgent.indexOf('Safari') > -1 ||
> document.all){
> handlerDict = this._wrap204Bandaid(handlerDict);
> }
> -
> +
> var requestDict = this.getDefaultCMPRequest
> (handlerDict, sync);
>
> requestDict.url = cosmo.env.getBaseUrl() + "/cmp/
> user/" +
> @@ -256,29 +256,29 @@
> dojo.io.bind(requestDict);
>
> },
> -
> +
> /**
> * summary: Delete the all users in <code>usernames</code>
> * description: Delete all the users whose usernames
> appear in
> * <code>usernames</code>
> - *
> + *
> */
> - deleteUsers: function (/*String[]*/ usernames,
> - /*Object*/ handlerDict,
> + deleteUsers: function (/*String[]*/ usernames,
> + /*Object*/ handlerDict,
> /*boolean?*/ sync) {
> // Safari and IE don't understand
> 204s. Boo.
> if (navigator.userAgent.indexOf('Safari') > -1 ||
> document.all){
> handlerDict = this._wrap204Bandaid(handlerDict);
> }
> -
> +
> var requestDict = this.getDefaultCMPRequest
> (handlerDict, sync);
> requestDict.url = cosmo.env.getBaseUrl() + "/cmp/
> user/delete";
> requestDict.method = "POST";
>
>
> for (var i = 0; i < usernames.length; i++){
> - usernames[i] = "user=" +
> + usernames[i] = "user=" +
> encodeURIComponent(dojo.string.trim
> (usernames[i]));
> }
> var requestContent = usernames.join("&");
> @@ -288,13 +288,13 @@
> dojo.io.bind(requestDict);
>
> },
> -
> +
> /**
> * summary: Activate <code>username</code>'s account
> * description: Activate <code>username</code>'s account
> */
> - activate: function (/*String*/ username,
> - /*Object*/ handlerDict,
> + activate: function (/*String*/ username,
> + /*Object*/ handlerDict,
> /*boolean?*/ sync) {
>
> // Safari and IE don't understand 204s. Boo.
> @@ -302,7 +302,7 @@
> document.all){
> handlerDict = this._wrap204Bandaid(handlerDict);
> }
> -
> +
> var requestDict = this.getDefaultCMPRequest
> (handlerDict, sync);
>
> requestDict.url = cosmo.env.getBaseUrl() + "/cmp/
> activate/" + username;
> @@ -310,12 +310,12 @@
> requestDict.postContent = "id="+username;
> dojo.io.bind(requestDict);
> },
> -
> +
> /**
> * summary: Return the number of users on this server.
> * description: Return the number of users on this server.
> */
> - getUserCount: function (/*Object*/ handlerDict,
> + getUserCount: function (/*Object*/ handlerDict,
> /*boolean?*/ sync){
> var requestDict = this.getDefaultCMPRequest(handlerDict,
> sync);
> requestDict.url = cosmo.env.getBaseUrl() + "/cmp/users/
> count";
> @@ -325,15 +325,15 @@
>
> /**
> * summary: Perform a HEAD request for <code>username</code>.
> - * description: Perform a HEAD request for <code>username</
> code>. Will return
> + * description: Perform a HEAD request for <code>username</
> code>. Will return
> * a 404 if the user does not exist, and a 200
> * if it does.
> */
> - headUser: function (/*String*/ username,
> - /*Object*/ handlerDict,
> + headUser: function (/*String*/ username,
> + /*Object*/ handlerDict,
> /*boolean?*/ sync){
> var requestDict = this.getDefaultCMPRequest
> (handlerDict, true)
> - requestDict.url = cosmo.env.getBaseUrl() + "/cmp/
> user/" +
> + requestDict.url = cosmo.env.getBaseUrl() + "/cmp/
> user/" +
> encodeURIComponent(dojo.string.trim(username));
> requestDict.method = "HEAD"
> if (sync){
> @@ -344,12 +344,12 @@
> },
>
> /*
> - * Authenticated operations:
> - * user credentials must be provided with the request for
> + * Authenticated operations:
> + * user credentials must be provided with the request for
> * these operations
> - *
> + *
> */
> - getAccount: function (/*Object*/ handlerDict,
> + getAccount: function (/*Object*/ handlerDict,
> /*boolean?*/ sync) {
> handlerDict = this._wrapXMLHandlerFunctions
> (handlerDict, this.cmpUserXMLToJSON);
>
> @@ -360,7 +360,7 @@
> * summary: Get the user representation for the current user.
> * description: Return an XML representation of the
> current user.
> */
> - getAccountXML: function(/*Object*/ handlerDict,
> + getAccountXML: function(/*Object*/ handlerDict,
> /*boolean?*/ sync) {
> var requestDict = this.getDefaultCMPRequest
> (handlerDict, sync);
> requestDict.url = cosmo.env.getBaseUrl() + "/cmp/
> account";
> @@ -373,8 +373,8 @@
> * summary: Get the user representation for the current user.
> * description: Return an Object representation of the
> current user.
> */
> - modifyAccount: function (/*Object*/ userHash,
> - /*Object*/ handlerDict,
> + modifyAccount: function (/*Object*/ userHash,
> + /*Object*/ handlerDict,
> /*boolean?*/ sync) {
> // If the user is changing his password,
> // make sure to wrap this in the credential
> @@ -384,7 +384,7 @@
> [204],
>
> {password:userHash.password});
> }
> -
> +
> // Safari and IE don't understand 204s. Boo.
> if (navigator.userAgent.indexOf('Safari') > -1 ||
> document.all){
> @@ -404,23 +404,23 @@
> requestDict.method = "POST";
> requestDict.headers['X-Http-Method-Override'] =
> "PUT";
> requestDict.postContent = requestContent;
> -
> -
> +
> +
> dojo.io.bind(requestDict);
>
> },
> -
> +
> /*
> * Anonymous operations:
> * Credentials should not be provided with this request
> */
> /**
> - * summary: Sign up the user represented by
> <code>userHash</code>
> + * summary: Sign up the user represented by
> <code>userHash</code>
> * description: Sign up the user represented by
> <code>userHash</code>
> * and return an Object representation of
> that user.
> - */
> - signup: function (/*Object*/ userHash,
> - /*Object*/ handlerDict,
> + */
> + signup: function (/*Object*/ userHash,
> + /*Object*/ handlerDict,
> /*boolean?*/ sync) {
> var self = this;
> handlerDict = this._wrapXMLHandlerFunctions
> (handlerDict, this.cmpUserXMLToJSON);
> @@ -429,12 +429,12 @@
> },
>
> /**
> - * summary: Sign up the user represented by
> <code>userHash</code>
> + * summary: Sign up the user represented by
> <code>userHash</code>
> * description: Sign up the user represented by
> <code>userHash</code>
> * and return an XML representation of that
> user.
> */
> - getSignupXML: function(/*Object*/ userHash,
> - /*Object*/ handlerDict,
> + getSignupXML: function(/*Object*/ userHash,
> + /*Object*/ handlerDict,
> /*boolean?*/ sync) {
> var request_content = '<?xml version="1.0"
> encoding="utf-8" ?>\r\n' +
> '<user xmlns="http://osafoundation.org/
> cosmo/CMP">' +
> @@ -460,37 +460,37 @@
> document.all){
> handlerDict = this._wrap204Bandaid(handlerDict);
> }
> -
> - var requestContent =
> - username? "username=" + username : "" +
> +
> + var requestContent =
> + username? "username=" + username : "" +
> username && email? "&" : "" +
> email? "email=" + email : "";
> -
> +
> var requestDict = this.getDefaultCMPRequest
> (handlerDict, sync);
> requestDict.url = cosmo.env.getBaseUrl() + "/cmp/
> account/password/recover";
> requestDict.method = "POST";
> requestDict.contentType = "application/x-www-form-
> urlencoded";
> requestDict.postContent = requestContent;
> -
> +
> dojo.io.bind(requestDict);
> },
> -
> +
> resetPassword: function(key, password, handlerDict, sync){
> -
> +
> var requestContent = "password=" + password;
> -
> +
> // Safari and IE don't understand 204s. Boo.
> if (navigator.userAgent.indexOf('Safari') > -1 ||
> document.all){
> handlerDict = this._wrap204Bandaid(handlerDict);
> }
> -
> +
> var requestDict = this.getDefaultCMPRequest
> (handlerDict, sync);
> requestDict.url = cosmo.env.getBaseUrl() + "/cmp/
> account/password/reset/" + key;
> requestDict.method = "POST";
> requestDict.contentType = "application/x-www-form-
> urlencoded";
> requestDict.postContent = requestContent;
> -
> +
> dojo.io.bind(requestDict);
> },
>
> @@ -504,8 +504,8 @@
> obj.dateCreated = user.getElementsByTagName("created")
> [0].firstChild.nodeValue;
> obj.dateModified = user.getElementsByTagName
> ("modified")[0].firstChild.nodeValue;
> obj.url = user.getElementsByTagName("url")
> [0].firstChild.nodeValue;
> -
> - obj.administrator =
> +
> + obj.administrator =
> (
> dojo.string.trim(
> user.getElementsByTagName("administrator")
> [0].firstChild.nodeValue) ==
> @@ -534,7 +534,7 @@
> return userList;
> },
>
> - _wrapXMLHandlerFunctions: function (/*Object*/ hDict,
> + _wrapXMLHandlerFunctions: function (/*Object*/ hDict,
> /*function*/
> xmlParseFunc){
> var self = this;
> var handlerDict = dojo.lang.shallowCopy(hDict);
> @@ -551,13 +551,13 @@
> // Don't mess with "handle". This is a "don't mess with my
> stuff" handler.
> return handlerDict;
> },
> -
> +
> /*
> - * statusCodes is a list of status codes to
> + * statusCodes is a list of status codes to
> * call the cred change function on.
> */
> - _wrapChangeCredentialFunctions: function(/*Object*/ hDict,
> - /*int[]*/
> statusCodes,
> + _wrapChangeCredentialFunctions: function(/*Object*/ hDict,
> + /*int[]*/
> statusCodes,
> /*Object*/ newCred){
> var self = this;
> var handlerDict = dojo.lang.shallowCopy(hDict);
> @@ -566,27 +566,27 @@
> handlerDict.load = function(type, data, evt){
> self._changeCredIfStatusMatches(
> evt.status, statusCodes, newCred);
> - oldLoad(type, data, evt);
> + oldLoad(type, data, evt);
> }
> }
> -
> +
> if (handlerDict.handle){
> var oldHandle = handlerDict.handle;
> handlerDict.handle = function(type, data, evt){
> self._changeCredIfStatusMatches(
> evt.status, statusCodes, newCred);
> - oldHandle(type, data, evt);
> + oldHandle(type, data, evt);
> }
> -
> +
> }
> -
> +
> return handlerDict;
> -
> +
> },
> -
> +
> _wrap204Bandaid: function(hDict){
> var handlerDict = dojo.lang.shallowCopy(hDict);
> -
> +
> if (handlerDict.load){
> handlerDict.load = this._204Bandaid
> (handlerDict.load);
> }
> @@ -597,29 +597,29 @@
> if (handlerDict.handle){
> handlerDict.handle = this._204Bandaid
> (handlerDict.handle);
> }
> -
> +
> return handlerDict;
> },
> -
> +
> _204Bandaid: function(originalFunc, handle204Func){
> // Use original function if handle204Func is not
> specified.
> handle204Func = handle204Func? handle204Func:
> originalFunc;
> return function(type, data, evt){
> - if (navigator.userAgent.indexOf('Safari') > -1 &&
> + if (navigator.userAgent.indexOf('Safari') > -1 &&
> !evt.status) {
> -
> +
> var newEvt = dojo.lang.shallowCopy(evt);
> newEvt.status = 204;
> newEvt.statusText = "No Content";
> handle204Func('load', '', newEvt);
> -
> +
> }
> -
> +
> // If we're Internet Explorer
> - else if (document.all &&
> + else if (document.all &&
> evt.status == 1223){
> // apparently, shallow copying the XHR object
> in ie
> - // causes problems.
> + // causes problems.
> var newEvt = {};
> newEvt.status = 204;
> newEvt.statusText = "No Content";
> @@ -629,7 +629,7 @@
> }
> }
> },
> -
> +
> _changeCredIfStatusMatches: function (stat, statusCodes,
> newCred){
> for (var i = 0; i < statusCodes.length; i++){
> if (newCred.username){
> Modified: cosmo/trunk/cosmo/src/main/webapp/js/cosmo/conduits.js
> (4290 => 4291)
>
> --- cosmo/trunk/cosmo/src/main/webapp/js/cosmo/conduits.js
> 2007-05-01 18:20:34 UTC (rev 4290)
> +++ cosmo/trunk/cosmo/src/main/webapp/js/cosmo/conduits.js
> 2007-05-01 18:25:30 UTC (rev 4291)
> @@ -17,8 +17,8 @@
>
> dojo.require("cosmo.app.pim");
>
> -cosmo.conduits.Conduit =
> -{
> +cosmo.conduits.Conduit =
> +{
> getCollection: function(collectionUid, transportInfo){},
> getEvents: function(collectionUid, startTime, endTime,
> transportInfo){},
> getEvent: function(eventUid, transportInfo){},
> @@ -27,14 +27,14 @@
> getRecurrenceRules: function(eventUids, transportInfo){},
> saveRecurrenceRule: function(eventUid, recurrenceRule,
> transportInfo){},
> expandEvents: function(eventUids, startTime, endTime,
> transportInfo){},
> - saveNewEventBreakRecurrence: function(event, originalEventUid,
> - originalEventEndDate, transportInfo){},
> + saveNewEventBreakRecurrence: function(event, originalEventUid,
> + originalEventEndDate, transportInfo){},
> saveDisplayName: function(collectionUid, newDisplayName,
> transportInfo){}
> -
> +
> };
>
>
> -cosmo.conduits.OwnedCollectionConduit =
> +cosmo.conduits.OwnedCollectionConduit =
> {
> getCollection: function(collectionUid, transportInfo,
> handlerFunc){
> if (handlerFunc){
> @@ -72,42 +72,42 @@
> }
> },
> getRecurrenceRules: function(collectionUid, eventUids,
> transportInfo, handlerFunc){
> - if (handlerFunc){
> + if (handlerFunc){
> return cosmo.app.pim.serv.getRecurrenceRules
> (handlerFunc, collectionUid, eventUids);
> } else {
> - return cosmo.app.pim.serv.getRecurrenceRules
> (collectionUid, eventUids);
> + return cosmo.app.pim.serv.getRecurrenceRules
> (collectionUid, eventUids);
> }
> },
> - saveRecurrenceRule: function(collectionUid, eventUid,
> recurrenceRule,
> + saveRecurrenceRule: function(collectionUid, eventUid,
> recurrenceRule,
> transportInfo, handlerFunc){
> - if (handlerFunc){
> + if (handlerFunc){
> return cosmo.app.pim.serv.saveRecurrenceRule
> (handlerFunc, collectionUid, eventUid, recurrenceRule);
> } else {
> - return cosmo.app.pim.serv.saveRecurrenceRule
> (collectionUid, eventUid, recurrenceRule);
> + return cosmo.app.pim.serv.saveRecurrenceRule
> (collectionUid, eventUid, recurrenceRule);
> }
> },
> - expandEvents: function(collectionUid, eventUids, startTime,
> endTime,
> + expandEvents: function(collectionUid, eventUids, startTime,
> endTime,
> transportInfo, handlerFunc){
>
> - if (handlerFunc){
> - return cosmo.app.pim.serv.expandEvents(handlerFunc,
> collectionUid, eventUids,
> + if (handlerFunc){
> + return cosmo.app.pim.serv.expandEvents(handlerFunc,
> collectionUid, eventUids,
> startTime, endTime);
> } else {
> - return cosmo.app.pim.serv.expandEvents(collectionUid,
> eventUids,
> + return cosmo.app.pim.serv.expandEvents(collectionUid,
> eventUids,
> startTime, endTime);
> }
> },
> saveNewEventBreakRecurrence: function(collectionUid, event,
> originalEventUid, originalEventEndDate, transportInfo,
> handlerFunc){
> if (handlerFunc){
> - return cosmo.app.pim.serv.saveNewEventBreakRecurrence
> (handlerFunc, collectionUid, event,
> + return cosmo.app.pim.serv.saveNewEventBreakRecurrence
> (handlerFunc, collectionUid, event,
> originalEventUid, originalEventEndDate);
> } else {
> - return cosmo.app.pim.serv.saveNewEventBreakRecurrence
> (collectionUid, event,
> + return cosmo.app.pim.serv.saveNewEventBreakRecurrence
> (collectionUid, event,
> originalEventUid, originalEventEndDate);
> }
> },
> -
> +
> saveDisplayName: function(collectionUid, newDisplayName,
> transportInfo, handlerFunc){
> if (handlerFunc){
> cosmo.app.pim.serv.saveDisplayName(handlerFunc,
> collectionUid, newDisplayName);
> @@ -155,45 +155,45 @@
> }
> },
> getRecurrenceRules: function(collectionUid, eventUids,
> transportInfo, handlerFunc){
> - if (handlerFunc){
> + if (handlerFunc){
> return cosmo.app.pim.serv.getRecurrenceRules
> (handlerFunc, collectionUid, eventUids, this.getTicket
> (transportInfo));
> } else {
> - return cosmo.app.pim.serv.getRecurrenceRules
> (collectionUid, eventUids, this.getTicket(transportInfo));
> + return cosmo.app.pim.serv.getRecurrenceRules
> (collectionUid, eventUids, this.getTicket(transportInfo));
> }
> },
> - saveRecurrenceRule: function(collectionUid, eventUid,
> recurrenceRule,
> + saveRecurrenceRule: function(collectionUid, eventUid,
> recurrenceRule,
> transportInfo, handlerFunc){
> - if (handlerFunc){
> + if (handlerFunc){
> return cosmo.app.pim.serv.saveRecurrenceRule
> (handlerFunc, collectionUid, eventUid, recurrenceRule,
> this.getTicket(transportInfo));
> } else {
> - return cosmo.app.pim.serv.saveRecurrenceRule
> (collectionUid, eventUid, recurrenceRule, this.getTicket
> (transportInfo));
> + return cosmo.app.pim.serv.saveRecurrenceRule
> (collectionUid, eventUid, recurrenceRule, this.getTicket
> (transportInfo));
> }
> },
> - expandEvents: function(collectionUid, eventUids, startTime,
> endTime,
> + expandEvents: function(collectionUid, eventUids, startTime,
> endTime,
> transportInfo, handlerFunc){
>
> - if (handlerFunc){
> - return cosmo.app.pim.serv.expandEvents(handlerFunc,
> collectionUid, eventUids,
> + if (handlerFunc){
> + return cosmo.app.pim.serv.expandEvents(handlerFunc,
> collectionUid, eventUids,
> startTime, endTime, this.getTicket(transportInfo));
> } else {
> - return cosmo.app.pim.serv.expandEvents(collectionUid,
> eventUids,
> + return cosmo.app.pim.serv.expandEvents(collectionUid,
> eventUids,
> startTime, endTime, this.getTicket(transportInfo));
> }
> },
> saveNewEventBreakRecurrence: function(collectionUid, event,
> originalEventUid, originalEventEndDate, transportInfo,
> handlerFunc){
> if (handlerFunc){
> - return cosmo.app.pim.serv.saveNewEventBreakRecurrence
> (handlerFunc, collectionUid, event,
> + return cosmo.app.pim.serv.saveNewEventBreakRecurrence
> (handlerFunc, collectionUid, event,
> originalEventUid, originalEventEndDate,
> this.getTicket(transportInfo));
> } else {
> - return cosmo.app.pim.serv.saveNewEventBreakRecurrence
> (collectionUid, event,
> + return cosmo.app.pim.serv.saveNewEventBreakRecurrence
> (collectionUid, event,
> originalEventUid, originalEventEndDate,
> this.getTicket(transportInfo));
> }
> }
>
> };
>
> -cosmo.conduits.SubscriptionConduit =
> +cosmo.conduits.SubscriptionConduit =
> {
> getTicket: function(transportInfo){
> return transportInfo.ticket.ticketKey;
> Modified: cosmo/trunk/cosmo/src/main/webapp/js/cosmo/datetime/
> timezone/LazyCachingTimezoneRegistry.js (4290 => 4291)
>
> --- cosmo/trunk/cosmo/src/main/webapp/js/cosmo/datetime/timezone/
> LazyCachingTimezoneRegistry.js 2007-05-01 18:20:34 UTC (rev 4290)
> +++ cosmo/trunk/cosmo/src/main/webapp/js/cosmo/datetime/timezone/
> LazyCachingTimezoneRegistry.js 2007-05-01 18:25:30 UTC (rev 4291)
> @@ -21,7 +21,7 @@
> dojo.require("cosmo.datetime.timezone");
> dojo.require("cosmo.datetime.timezone.SimpleTimezoneRegistry");
>
> -dojo.declare("cosmo.datetime.timezone.LazyCachingTimezoneRegistry",
> +dojo.declare("cosmo.datetime.timezone.LazyCachingTimezoneRegistry",
> cosmo.datetime.timezone.SimpleTimezoneRegistry,
> function(timezoneFileRoot){
> this.timezoneFileRoot = timezoneFileRoot || null;
> @@ -34,37 +34,37 @@
> }
> },
> {
> -
> +
> _prefixToFileMap:
> {"EST":"northamerica","MST":"northamerica","HST":"northamerica","EST5E
> DT":"northamerica","CST6CDT":"northamerica","MST7MDT":"northamerica","
> PST8PDT":"northamerica","America":"northamerica","Pacific":"australasi
> a","Atlantic":"europe","Africa":"africa","Indian":"africa","Antarctica
> ":"antarctica","Asia":"asia","Australia":"australasia","Europe":"europ
> e","WET":"europe","CET":"europe","MET":"europe","EET":"europe"},
> _exceptionsMap: {"Pacific/Honolulu":"northamerica","Atlantic/
> Bermuda":"northamerica","Atlantic/Cape_Verde":"africa","Atlantic/
> St_Helena":"africa","Indian/Kerguelen":"antarctica","Indian/
> Chagos":"asia","Indian/Maldives":"asia","Indian/
> Christmas":"australasia","Indian/Cocos":"australasia","America/
> Danmarkshavn":"europe","America/Scoresbysund":"europe","America/
> Godthab":"europe","America/Thule":"europe","Asia/
> Yekaterinburg":"europe","Asia/Omsk":"europe","Asia/
> Novosibirsk":"europe","Asia/Krasnoyarsk":"europe","Asia/
> Irkutsk":"europe","Asia/Yakutsk":"europe","Asia/Vladivostok":"europe"
> ;,"Asia/Sakhalin":"europe","Asia/Magadan":"europe","Asia/
> Kamchatka":"europe","Asia/Anadyr":"europe","Africa/
> Ceuta":"europe","America/Argentina/
> Buenos_Aires":"southamerica","America/Argentina/
> Cordoba":"southamerica","America/Argentina/
> Tucuman":"southamerica","America/Argentina/
> La_Rioja":"southamerica","America/Argentina/
> San_Juan":"southamerica","America/Argentina/
> Jujuy":"southamerica","America/Argentina/
> Catamarca":"southamerica","America/Argentina/
> Mendoza":"southamerica","America/Argentina/
> Rio_Gallegos":"southamerica","America/Argentina/
> Ushuaia":"southamerica","America/Aruba":"southamerica","America/
> La_Paz":"southamerica","America/Noronh
> a":"southamerica","America/Belem":"southamerica","America/
> Fortaleza":"southamerica","America/Recife":"southamerica","America/
> Araguaina":"southamerica","America/Maceio":"southamerica","America/
> Bahia":"southamerica","America/Sao_Paulo":"southamerica","America/
> Campo_Grande":"southamerica","America/
> Cuiaba":"southamerica","America/
> Porto_Velho":"southamerica","America/
> Boa_Vista":"southamerica","America/Manaus":"southamerica","America/
> Eirunepe":"southamerica","America/
> Rio_Branco":"southamerica","America/
> Santiago":"southamerica","Pacific/Easter":"southamerica","America/
> Bogota":"southamerica","America/Curacao":"southamer
> ica","America/Guayaquil":"southamerica","Pacific/
> Galapagos":"southamerica","Atlantic/
> Stanley":"southamerica","America/Cayenne":"southamerica","America/
> Guyana":"southamerica","America/Asuncion":"southamerica","America/
> Lima":"southamerica","Atlantic/
> South_Georgia":"southamerica","America/
> Paramaribo":"southamerica","America/
> Port_of_Spain":"southamerica","America/
> Montevideo":"southamerica","America/Caracas":"southamerica"},
> _loadedFiles: {},
> _loadedRegions: {},
> -
> +
> getTimezone: function(tzid){
> var tz = this._timezones[tzid];
> if (tz){
> return tz;
> }
> -
> +
> //check the exceptions map
> var file = this._exceptionsMap[tzid];
> if (!file){
> file = this._prefixToFileMap[tzid.split("/")[0]];
> }
> -
> +
> if (file && this.loadFile(file)){
> return this.getTimezone(tzid);
> }
> -
> +
> var link = this.getLink(tzid);
> -
> +
> if (link){
> return this.getTimezone(link);
> }
> -
> +
> return null;
> },
> -
> +
> loadFile: function(file){
> if (!this._loadedFiles[file]){
> this._parseUri(file);
> @@ -73,12 +73,12 @@
> }
> return false;
> },
> -
> +
> addTimezone: function(timezone){
> this._timezones[timezone.tzId] = timezone;
> this._addTzToTzsByRegion(timezone.tzId);
> },
> -
> +
> getTzIdsForRegion: function(region){
> if (!this._loadedRegions[region]){
> this.loadFile(this._prefixToFileMap[region]);
> @@ -90,12 +90,12 @@
> this._loadedRegions[region] = true;
> }
> return this._tzsByRegion[region] || [];
> - },
> -
> + },
> +
> getLink: function(tzid){
> this.loadFile("backward");
> return this._links[tzid];
> }
> -
> -
> +
> +
> });
> Modified: cosmo/trunk/cosmo/src/main/webapp/js/cosmo/datetime/
> timezone.js (4290 => 4291)
>
> --- cosmo/trunk/cosmo/src/main/webapp/js/cosmo/datetime/timezone.js
> 2007-05-01 18:20:34 UTC (rev 4290)
> +++ cosmo/trunk/cosmo/src/main/webapp/js/cosmo/datetime/timezone.js
> 2007-05-01 18:25:30 UTC (rev 4291)
> @@ -42,7 +42,7 @@
> // tzId : String
> // the time zone ID (eg. "America/Los_Angeles")
> this.tzId = tzId;
> -
> +
> // zoneItems: Array
> // An array with teh ZoneItems for this timezone
> this.zoneItems = zoneItems || [];
> @@ -139,7 +139,7 @@
> };
>
> cosmo.datetime.timezone._getLastDayForMonthAndYear = function(day,
> month, year){
> - // summary: returns the day of the month of the last time the
> given day of the week occurs in a
> + // summary: returns the day of the month of the last time the
> given day of the week occurs in a
> // given month and year.
> var lastDayOfMonth = new Date(year, month + 1,1, -24);
> var lastDayDay = lastDayOfMonth.getDay();
> @@ -148,7 +148,7 @@
> };
>
> cosmo.datetime.timezone._getDayGreaterThanNForMonthAndYear =
> function(n, day, month, year){
> - // summary: returns the first date (day of month) after (or
> on) the given date "n" in the
> + // summary: returns the first date (day of month) after (or
> on) the given date "n" in the
> // given month and year for which the given day occurs
> // description: Confusing eh? Here's some help: if there
> params were "10, 1, 0, 2007" this
> // function would return the first Monday (1) that occurs
> after the 10th, in January(0), 2007
> @@ -160,7 +160,7 @@
> };
>
> cosmo.datetime.timezone._getDayLessThanNForMonthAndYear = function
> (n, day, month, year){
> - // summary: returns the first date (day of month) before (or
> on) the given date "n" in the
> + // summary: returns the first date (day of month) before (or
> on) the given date "n" in the
> // given month and year for which the given day occurs
> // description: Example: if there params were "10, 1, 0, 2007"
> this
> // function would return the first Monday (1) that occurs
> before (or on) the 10th, in January(0), 2007
> @@ -199,7 +199,7 @@
>
> cosmo.datetime.timezone.ZoneItem = function(){
> // summary: represents one Zone line in a olson timezone
> -
> +
> this.offsetInMinutes = null;
> this.ruleName = null;
> this.format = null;
> @@ -341,21 +341,21 @@
> // summary: returns whether or not this rule might be
> applicable for the given date
> // description: this does NOT return whether or not this is
> the right rule to use, just whether
> // or not the date is after this rules start date (hence "might")
> -
> +
> var ruleStartDate = this._getStartDateForYear(date.getFullYear
> ());
> return cosmo.datetime.timezone._compareDates(date,
> ruleStartDate) >= 0 ;
> }
>
> cosmo.datetime.timezone.Rule.prototype._getStartDateForYear =
> function(year){
> - // summary: returns the date (naked object with date props not
> a "real" date) when this rule becomes
> - // active
> + // summary: returns the date (naked object with date props not
> a "real" date) when this rule becomes
> + // active
> // description: this is sort of an expensive call, so once it
> is calculated, it is cached.
> -
> +
> var startDate = this._startDatesByYear[year];
> if (startDate){
> - return startDate;
> + return startDate;
> }
> -
> +
> startDate = { year: year,
> month: this.startMonth,
> hours: this.startTime.hours,
> @@ -376,7 +376,7 @@
> } else {
> startDate.date = this.startDate;
> }
> -
> +
> this._startDatesByYear[year] = startDate;
> return startDate;
> }
> @@ -404,7 +404,7 @@
> cosmo.datetime.timezone.parse = function(str, timezoneCallback,
> rulesetCallback, linkCallback){
> // summary: parses the given string as olson data,
> creating ZoneItems, Rules and link entries
> // passing them to the appropriate given call back
> -
> +
> var ruleSets = new dojo.collections.Dictionary();
> var zones = new dojo.collections.Dictionary();
> var links = {};
> @@ -530,7 +530,7 @@
>
> cosmo.datetime.timezone._parseRuleLine = function(array){
> // sumamry: parses an olson 'Rule' line into a Rule object
> -
> +
> var rule = new cosmo.datetime.timezone.Rule();
>
> //The Format: DEBUG: Rule --> 0->'1942' 1->'only' 2->'-' 3-
> >'Feb' 4->'9' 5->'2:00' 6->'1:00' 7->'W' 8->''
> Modified: cosmo/trunk/cosmo/src/main/webapp/js/cosmo/datetime/
> util.js (4290 => 4291)
>
> --- cosmo/trunk/cosmo/src/main/webapp/js/cosmo/datetime/util.js
> 2007-05-01 18:20:34 UTC (rev 4290)
> +++ cosmo/trunk/cosmo/src/main/webapp/js/cosmo/datetime/util.js
> 2007-05-01 18:25:30 UTC (rev 4291)
> @@ -21,7 +21,7 @@
> dojo.require("dojo.date.common");
>
> cosmo.datetime.util = new function () {
> -
> +
> var stripZeroPat = /^0/;
> this.parseTimeString = function (str, opts) {
> var stripLeadingZero = function (s) {
> @@ -43,7 +43,7 @@
> h = parseInt(stripLeadingZero(h));
> m = parseInt(stripLeadingZero(m));
> }
> - return { hours: h, minutes: m };
> + return { hours: h, minutes: m };
> };
> /**
> * Convert a 24-hour formatted hour to 12-hour format
> Modified: cosmo/trunk/cosmo/src/main/webapp/js/cosmo/datetime.js
> (4290 => 4291)
>
> --- cosmo/trunk/cosmo/src/main/webapp/js/cosmo/datetime.js
> 2007-05-01 18:20:34 UTC (rev 4290)
> +++ cosmo/trunk/cosmo/src/main/webapp/js/cosmo/datetime.js
> 2007-05-01 18:25:30 UTC (rev 4291)
> @@ -30,12 +30,12 @@
> MINUTE: "n",
> SECOND: "s"
> };
> - this.fullWeekday = ['Sunday', 'Monday', 'Tuesday',
> 'Wednesday', 'Thursday',
> + this.fullWeekday = ['Sunday', 'Monday', 'Tuesday',
> 'Wednesday', 'Thursday',
> 'Friday', 'Saturday'];
> this.abbrWeekday = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri',
> 'Sat'];
> - this.fullMonth = ['January', 'February', 'March', 'April',
> 'May', 'June',
> + this.fullMonth = ['January', 'February', 'March', 'April',
> 'May', 'June',
> 'July', 'August', 'September', 'October', 'November',
> 'December'];
> - this.abbrMonth = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
> 'Jul', 'Aug',
> + this.abbrMonth = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
> 'Jul', 'Aug',
> 'Sep', 'Oct', 'Nov', 'Dec'];
> this.meridian = {
> AM: 'AM',
> Modified: cosmo/trunk/cosmo/src/main/webapp/js/cosmo/env.js (4290
> => 4291)
>
> --- cosmo/trunk/cosmo/src/main/webapp/js/cosmo/env.js 2007-05-01
> 18:20:34 UTC (rev 4290)
> +++ cosmo/trunk/cosmo/src/main/webapp/js/cosmo/env.js 2007-05-01
> 18:25:30 UTC (rev 4291)
> @@ -17,17 +17,17 @@
> /**
> * To use this file, you must first provide it with the base URL
> for your application
> * by calling "setBaseUrl"
> - *
> + *
> * @fileoverview provides information about the Cosmo environment.
> * @author Bobby Rullo br at osafoundation.org
> * @license Apache License 2.0
> */
> -
> +
> dojo.provide("cosmo.env");
>
> cosmo.env.OVERLORD_USERNAME = "root";
>
> -//private variable for storing environment information. Do not
> access directly,
> +//private variable for storing environment information. Do not
> access directly,
> //use methods below.
> cosmo.env._cosmoConfig = {};
> cosmo.env._cosmoConfig["baseUrl"] = djConfig['staticBaseUrl'];
> @@ -35,25 +35,25 @@
> cosmo.env._FALSE_OR_ZERO = {};
> cosmo.env._getCachePropGetterPopulator = function(propName,
> calculatorFunction ){
> var _calcy = calculatorFunction;
> -
> +
> return function(){
> var prop = cosmo.env._cosmoConfig[propName];
> -
> +
> if (prop){
> - //if we don't use these placeholders, then the preceding if
> statement will return
> + //if we don't use these placeholders, then the preceding if
> statement will return
> //false, and we'll have to recalculate.
> if (prop == cosmo.env._NULL) {
> - return null;
> + return null;
> }
> -
> +
> if (prop == cosmo.env._FALSE_OR_ZERO) {
> - return false;
> + return false;
> }
> -
> +
> return prop;
> }
> -
> -
> +
> +
> prop = _calcy();
>
> if (!prop){
> @@ -61,11 +61,11 @@
> cosmo.env._cosmoConfig[propName] =
> cosmo.env._FALSE_OR_ZERO;
> } else if (prop == null) {
> cosmo.env._cosmoConfig[propName] = cosmo.env._NULL;
> - }
> + }
> } else {
> cosmo.env._cosmoConfig[propName] = prop;
> - }
> -
> + }
> +
> return prop;
> };
> }
> @@ -74,7 +74,7 @@
> * Returns the path to the cosmo script base, relative to the
> document NOT dojo
> */
> cosmo.env.getCosmoBase = cosmo.env._getCachePropGetterPopulator
> ("cosmoBase", function(){
> - // "../.." is ugly but it works.
> + // "../.." is ugly but it works.
> var uri = dojo.hostenv.getBaseScriptUri() + "../../";
> cosmo.env._cosmoConfig["baseCosmoUri"] = uri;
> return uri;
> @@ -82,7 +82,7 @@
>
> /**
> * Returns the path to the widgets template directory , relative
> to the document NOT dojo.
> - * In other words, not for use with dojo.uri.dojoUri(), which
> wants you to be relative to
> + * In other words, not for use with dojo.uri.dojoUri(), which
> wants you to be relative to
> * dojo scripts. This is useful for stuff like css background urls
> which can't deal with
> * dojo relative uri's
> *
> @@ -114,7 +114,7 @@
> }
>
> /**
> - * Sets the number of seconds for server-side timeout. Provided
> + * Sets the number of seconds for server-side timeout. Provided
> * by the server somehow
> * @param {Number} timeoutSeconds (note: this number may be negative)
> * Negative number means effectively no timeout
> @@ -157,7 +157,7 @@
> }
>
> /**
> - * Convenience method to return the number of minutes
> + * Convenience method to return the number of minutes
> * for the server-side timeout -- -1 indicates no timeout
> * set, infinite timeout
> */
> Modified: cosmo/trunk/cosmo/src/main/webapp/js/cosmo/legacy/
> cal_event.js (4290 => 4291)
>
> --- cosmo/trunk/cosmo/src/main/webapp/js/cosmo/legacy/cal_event.js
> 2007-05-01 18:20:34 UTC (rev 4290)
> +++ cosmo/trunk/cosmo/src/main/webapp/js/cosmo/legacy/cal_event.js
> 2007-05-01 18:25:30 UTC (rev 4291)
> @@ -38,7 +38,7 @@
> this.lozenge = lozenge;
> // Points to this event's CalEventData obj
> this.data = null;
> - // A backup copy (clone) of the .data property made
> + // A backup copy (clone) of the .data property made
> // before trying to edit
> this.dataOrig = null;
> // List of conflicting events that come before this event
> @@ -51,18 +51,18 @@
> this.maxDepth = 0;
> // Row occupied for an untimed event
> this.allDayRow = 0;
> -
> +
> /**
> * Indicates if an event has actually been edited or not --
> * used when dragging or moving to make sure event has really
> * changed before saving. Mapping of comparator functions to
> - * properties are saved in compareList. Null values for the
> + * properties are saved in compareList. Null values for the
> * comparator func in that list mean comparison just uses
> * generic equality.
> * @return Object with two props
> * 'count' -- the number of changes, and 'changes' --
> - * a keyword/value obj, where the keyword is the name of the
> - * changed property, and the value is an object with two items:
> + * a keyword/value obj, where the keyword is the name of the
> + * changed property, and the value is an object with two items:
> * newValue (the updated value) and origValue (the original)
> */
> this.hasChanged = function () {
> @@ -79,7 +79,7 @@
> * @return Boolean, true or false
> */
> var compareStatus = function (curr, orig) {
> - if ((!curr && orig == EventStatus.CONFIRMED) ||
> + if ((!curr && orig == EventStatus.CONFIRMED) ||
> (curr == EventStatus.CONFIRMED && !orig)) {
> return false;
> }
> @@ -119,7 +119,7 @@
> if ((curr.frequency != orig.frequency) ||
> (curr.endDate && !orig.endDate) ||
> (!curr.endDate && orig.endDate) ||
> - ((curr.endDate && orig.endDate) &&
> + ((curr.endDate && orig.endDate) &&
> curr.endDate.getTime() !=
> orig.endDate.getTime())) {
> return true;
> }
> @@ -135,9 +135,9 @@
> var compareOptional = function (curr, orig) {
> var a = curr || null;
> var b = orig || null;
> - return (a != b);
> + return (a != b);
> }
> -
> +
> // Comparator function mappings
> var compareList = {
> 'start': compareDateTime,
> @@ -180,7 +180,7 @@
> }
> }
> }
> -
> +
> for (var i in compareList) {
> compareVals(i, d[i], dO[i], compareList[i]);
> }
> @@ -235,7 +235,7 @@
> }
> };
> /**
> - * Makes a clone backup of the CalEventData for the event to
> + * Makes a clone backup of the CalEventData for the event to
> * store in the dataOrig property. This is used to back out of
> * a cancelled/failed save operation or failed remove operation.
> */
> @@ -246,7 +246,7 @@
> return true;
> };
> /**
> - * Makes a clone backup of the CalEventData for the event to
> + * Makes a clone backup of the CalEventData for the event to
> * store in the dataOrig property. This is used to back out of
> * a cancelled/failed save operation or failed remove operation.
> */
> Modified: cosmo/trunk/cosmo/src/main/webapp/js/cosmo/model/
> EventStamp.js (4290 => 4291)
>
> --- cosmo/trunk/cosmo/src/main/webapp/js/cosmo/model/EventStamp.js
> 2007-05-01 18:20:34 UTC (rev 4290)
> +++ cosmo/trunk/cosmo/src/main/webapp/js/cosmo/model/EventStamp.js
> 2007-05-01 18:25:30 UTC (rev 4291)
> @@ -27,12 +27,12 @@
> ["exdates", [Array, cosmo.datetime.Date], {}],
> ["status", String, {}],
> ],
> - //mixins for master item stamps
> + //mixins for master item stamps
> {
> initializer: function(kwArgs){
> this.initializeProperties(kwArgs);
> },
> -
> +
> getEndDate: function getEndDate(){
> var duration = this.getDuration();
> var endDate = this.getStartDate().clone();
> @@ -41,7 +41,7 @@
> },
>
> setEndDate: function setEndDate(/*CosmoDate*/ endDate){
> - var duration = dojo.date.diff(this.getStartDate().toUTC(),
> endDate.toUTC(),
> + var duration = dojo.date.diff(this.getStartDate().toUTC(),
> endDate.toUTC(),
> dojo.date.dateParts.SECOND);
> this.setDuration(duration);
> }
> @@ -62,6 +62,6 @@
> }
> return this.recurrenceId;
> }*/
> -
> +
> }
> );
> \ No newline at end of file
> Modified: cosmo/trunk/cosmo/src/main/webapp/js/cosmo/model/Item.js
> (4290 => 4291)
>
> --- cosmo/trunk/cosmo/src/main/webapp/js/cosmo/model/Item.js
> 2007-05-01 18:20:34 UTC (rev 4290)
> +++ cosmo/trunk/cosmo/src/main/webapp/js/cosmo/model/Item.js
> 2007-05-01 18:25:30 UTC (rev 4291)
> @@ -25,7 +25,7 @@
> cosmo.model.TRIAGE_DONE = 300;
>
> cosmo.model._stampRegistry = {};
> -
> +
> cosmo.model.declare = function(/*String*/ ctrName, /*Function*/
> parentCtr, propertiesArray, otherDeclarations){
> var newCtr = dojo.declare(ctrName, parentCtr, otherDeclarations);
> cosmo.model.util.simplePropertyApplicator.enhanceClass(newCtr,
> propertiesArray, {enhanceInitializer: false});
> @@ -41,39 +41,39 @@
> var attArgs = attributesArray[x];
> propertiesArray.push([attArgs[0], attArgs[2]]);
> }
> -
> - cosmo.model.util.simplePropertyApplicator.enhanceClass(newCtr,
> propertiesArray,
> +
> + cosmo.model.util.simplePropertyApplicator.enhanceClass(newCtr,
> propertiesArray,
> {enhanceInitializer: false});
> -
> +
> var stampOccurrenceCtr = dojo.declare(ctrName+"Occurrence",
> newCtr, {
> __noOverride:{},
>
> initializer: function stampOccurrenceInitializer
> (noteOccurrence){
> this._master = noteOccurrence._master;
> - this.recurrenceId = noteOccurrence.recurrenceId;
> + this.recurrenceId = noteOccurrence.recurrenceId;
> this.item = noteOccurrence;
> },
> -
> +
> //it doesn't make sense to initialze properties of an
> occurrence.
> initializeProperties: function noop(){
> return;
> },
> -
> - __getProperty: cosmo.model._occurrenceGetProperty,
>
> + __getProperty: cosmo.model._occurrenceGetProperty,
> +
> __setProperty: cosmo.model._occurrenceSetProperty,
>
> getMaster: function getMaster(){
> return this._master;
> },
> -
> +
> _getMasterProperty: function
> noteOccurrenceGetMasterProperty(propertyName){
> if (this._masterPropertyGetters &&
> this._masterPropertyGetters[propertyName]){
> return this._masterPropertyGetters[propertyName].apply(this);
> }
> return this._master._stamps[stampName].__getProperty
> (propertyName);
> },
> -
> +
> _getModifiedProperty: function stampOccurrenceGetModifiedProperty
> (propertyName){
> var modification = this._master.getModification
> (this.recurrenceId);
> var modifiedStamp = modification._modifiedStamps
> [stampName];
> @@ -81,7 +81,7 @@
> return modifiedStamp[propertyName];
> }
> },
> -
> +
> _setModifiedProperty: function stampOccurrenceSetModifiedProperty
> (propertyName, value){
> var modification = this._master.getModification
> (this.recurrenceId);
> var modifiedStamp = modification._modifiedStamps
> [stampName];
> @@ -94,15 +94,15 @@
> });
>
> dojo.lang.mixin(stampOccurrenceCtr.prototype,
> occurrenceDeclarations || {});
> -
> -
> - cosmo.model._stampRegistry[stampName]
> +
> +
> + cosmo.model._stampRegistry[stampName]
> = {constructor:newCtr,
> occurrenceConstructor:stampOccurrenceCtr};
> -
> +
> return newCtr;
> }
>
> -cosmo.model.declare("cosmo.model.Item", null,
> +cosmo.model.declare("cosmo.model.Item", null,
> //declare the dynamically generated properties
> [["uid", {"default": null}],
> ["displayName", {"default": null} ],
> @@ -112,7 +112,7 @@
> ["triageStatus", {"default": 100}],
> ["autoTriage", {"default": false}],
> ["rank", {"default": 0}]
> - ],
> + ],
> //declare other properties
> {
> initializer: function(kwArgs){
> @@ -121,55 +121,55 @@
> }
> });
>
> -cosmo.model.declare("cosmo.model.Note", cosmo.model.Item,
> +cosmo.model.declare("cosmo.model.Note", cosmo.model.Item,
> [ ["body", {"default": null}] ],
> {
> //TODO could be useful to use the same format as is in the
> UUID in EIM
> OCCURRENCE_FMT_STRING: "%Y-%m-%d %H:%M:%S",
> -
> +
> _stamps: null,
> -
> +
> initializer: function(){
> this._stamps = {};
> this._modifications = {};
> },
> -
> +
> getStamp: function(/*String*/ stampName, /*Boolean?*/
> createIfDoesntExist) {
> var stamp = this._stamps[stampName];
> -
> +
> if (stamp){
> return stamp;
> - }
> -
> + }
> +
> if (createIfDoesntExist){
> var ctr = cosmo.model._stampRegistry[stampName]
> ["constructor"];
> var stamp = new ctr({item:this});
> this._stamps[stampName] = stamp;
> return stamp;
> - }
> -
> - },
> -
> + }
> +
> + },
> +
> getModification: function getModification(/
> *cosmo.datetime.Date*/ recurrenceId){
> return this._modifications[this._formatRecurrenceId
> (recurrenceId)];
> },
> -
> +
> addModification: function(/*cosmo.model.Modification*/
> modification){
> this._modifications[this._formatRecurrenceId
> (modification.getRecurrenceId())] = modification;
> },
> -
> +
> removeModification: function removeModification(/
> *cosmo.model.Modification*/ recurrenceId){
> - delete(this._modifications[this._formatRecurrenceId
> (recurrenceId)]);
> + delete(this._modifications[this._formatRecurrenceId
> (recurrenceId)]);
> },
> -
> +
> _formatRecurrenceId: function formatRecurrenceId(/
> *cosmo.datetime.Date*/date){
> return date.strftime(this.OCCURRENCE_FMT_STRING);
> },
> -
> +
> isOccurrence: function isOccurrence(){
> return false;
> },
> -
> +
> getMaster: function getMaster(){
> return this;
> },
> @@ -177,60 +177,60 @@
> removeStamp: function removeStamp(/*String*/ stampName){
> delete this._stamps[stampName];
> },
> -
> +
> getEventStamp: function getEventStamp(/*Boolean?*/
> createIfDoesntExist){
> return this.getStamp("event", createIfDoesntExist);
> },
> -
> +
> getTaskStamp: function getTaskStamp(/*Boolean*/
> createIfDoesntExist){
> return this.getStamp("task", createIfDoesntExist);
> },
> -
> +
> getNoteOccurrence: function getNoteOccurrence(/
> *cosmo.datetime.Date*/ recurrenceId){
> return new cosmo.model.NoteOccurrence(this,
> recurrenceId);
> }
> });
> -
> +
> dojo.declare("cosmo.model.NoteOccurrence", cosmo.model.Note, {
> __noOverride:{uid:1,version:1},
> -
> +
> initializer: function noteOccurrenceInitializer(master,
> recurrenceId){
> // dojo.debug("noteOccurrenceInitializer");
> this._master = master;
> this.recurrenceId = recurrenceId;
> },
> -
> +
> isOccurrence: function isOccurrence(){
> return true;
> },
> -
> +
> getMaster: function getMaster(){
> return this._master;
> },
> -
> +
> _getMasterProperty: function noteOccurrenceGetMasterProperty
> (propertyName){
> return this._master.__getProperty(propertyName);
> },
> -
> +
> _getModifiedProperty: function
> noteOccurrenceGetModifiedProperty(propertyName){
> var modification = this._master.getModification
> (this.recurrenceId);
> return modification.getModifiedProperties()[propertyName];
> },
> -
> +
> _setModifiedProperty: function
> noteOccurrenceSetModifiedProperty(propertyName, value){
> var modification = this._master.getModification
> (this.recurrenceId);
> - modification._modifiedProperties[propertyName] = value;
> + modification._modifiedProperties[propertyName] = value;
> },
> -
> - __getProperty: cosmo.model._occurrenceGetProperty,
> -
> +
> + __getProperty: cosmo.model._occurrenceGetProperty,
> +
> __setProperty: cosmo.model._occurrenceSetProperty,
> -
> -
> +
> +
> initializeProperties: function noop(){
> return;
> },
> -
> +
> _throwOnlyMaster: function(){
> throw new Error("You can only call this method on the
> master item");
> },
> @@ -244,16 +244,16 @@
> var modification = master.getModification
> (this.recurrenceId);
> if (modification && modification.getModifiedStamps
> [stampName]){
> return new ctr(this);
> - }
> - }
> -
> + }
> + }
> +
> if (createIfDoesntExist){
> return new ctr(this);
> } else {
> return null;
> }
> - },
> -
> + },
> +
> removeStamp: function removeStamp(/*String*/ stampName){
> throw new Error("remove stamp not implented yet!");
> },
> @@ -261,11 +261,11 @@
> getModification: function(/*cosmo.datetime.Date*/ recurrenceId){
> this._throwOnlyMaster();
> },
> -
> +
> addModification: function(/*cosmo.model.Modification*/
> modification){
> this._throwOnlyMaster();
> },
> -
> +
> removeModification: function(/*cosmo.model.Modification*/
> recurrenceId){
> this._throwOnlyMaster();
> },
> @@ -273,7 +273,7 @@
> getNoteOccurrence: function getNoteOccurrence(/
> *cosmo.datetime.Date*/ recurrenceId){
> this._throwOnlyMaster();
> }
> -
> +
> });
>
> cosmo.model.declare("cosmo.model.Modification", null,
> @@ -290,9 +290,9 @@
> });
>
> dojo.declare("cosmo.model.StampMetaData", null,{
> - stampName: null,
> + stampName: null,
> attributes: null,
> -
> +
> initializer: function(stampName, stampAttributesArray){
> this.attributes = [];
> this.stampName = stampName || null;
> @@ -305,7 +305,7 @@
> }
> }
> },
> -
> +
> getAttribute: function getAttribute(name){
> for (var x = 0; x < this.attributes.length; x++){
> var attr = this.attributes[x];
> @@ -313,19 +313,19 @@
> return attr;
> }
> }
> -
> - return null;
> +
> + return null;
> }
> -
> +
> });
>
> dojo.declare("cosmo.model.StampAttribute", null, {
> name: null,
> type: null, /*Function*/
> -
> +
> initializer: function(name, type, kwArgs){
> this.name = name;
> - this.type = type;
> + this.type = type;
> }
> });
>
> Modified: cosmo/trunk/cosmo/src/main/webapp/js/cosmo/model/util.js
> (4290 => 4291)
>
> --- cosmo/trunk/cosmo/src/main/webapp/js/cosmo/model/util.js
> 2007-05-01 18:20:34 UTC (rev 4290)
> +++ cosmo/trunk/cosmo/src/main/webapp/js/cosmo/model/util.js
> 2007-05-01 18:25:30 UTC (rev 4291)
> @@ -19,30 +19,30 @@
> return str.charAt(0).toUpperCase() + str.substr(1,str.length
> -1 );
> }
>
> -cosmo.model.util.BasePropertyApplicator = function(){}
> +cosmo.model.util.BasePropertyApplicator = function(){}
> cosmo.model.util.BasePropertyApplicator.prototype = {
> -
> +
> enhanceClass: function(ctr, propertyArray, kwArgs){
> this.initializeClass(ctr, kwArgs);
> for (var x = 0; x < propertyArray.length; x++){
> this.addProperty.apply(this, [ctr, propertyArray[x]
> [0], propertyArray[x][1]]);
> }
> },
> -
> +
> addProperty: function(ctr, propertyName, kwArgs){
> kwArgs = kwArgs || {};
> var upProp = cosmo.model.util._upperFirstChar(propertyName);
> var setterName = "set" + upProp;
> var getterName = "get" + upProp;
> -
> +
> ctr.prototype[setterName] = this.getSetter(ctr,
> propertyName, kwArgs);
> ctr.prototype[getterName] = this.getGetter(ctr,
> propertyName, kwArgs);
> },
> -
> +
> initializeClass: function(ctr, kwArgs){
> //implementers should override this.
> },
> -
> +
> getSetter: function(ctr, propertyName, kwArgs){
> //implementers should override this.
> return null;
> @@ -62,9 +62,9 @@
> ctr.prototype.__propertyNames.push(propertyName);
> ctr.prototype.__defaults[propertyName] = kwArgs["default"];
> },
> -
> +
> getGetter: function(ctr, propertyName, kwArgs){
> - return function(){
> + return function(){
> return this.__getProperty(propertyName);
> }
> },
> @@ -78,7 +78,7 @@
> initializeClass: function(ctr, kwArgs){
> if (ctr.prototype["__enhanced"]){
> //it's already been enhanced, which usually means that
> this is a subclass.
> - //so let's just copy the arrays/objects to the new
> prototype
> + //so let's just copy the arrays/objects to the new
> prototype
> //since we'll be adding to them and don't want to add
> to the parent's arrays/objects!
> ctr.prototype.__propertyNames =
> ctr.prototype.__propertyNames.slice();
> var newDefaults = {};
> @@ -96,7 +96,7 @@
> ctr.prototype.__propertyNames = [];
> ctr.prototype.__defaults = {};
> ctr.prototype.initializeProperties =
> this._initializeProperties;
> -
> +
> if (kwArgs["enhanceInitializer"]){
> var oldInitter = ctr.prototype.initializer;
> var when = kwArgs["enhanceInitializer"];
> @@ -105,18 +105,18 @@
> if (when == "before"){
> this.initializeProperties(arguments);
> }
> -
> +
> oldInitter.apply(this,arguments);
> -
> +
> if (when != "before"){
> this.initializeProperties(arguments);
> }
> }
> ctr.prototype.initializer = newInitializer;
> - }
> + }
> },
> -
> - //These functions are "protected" - in other words they should
> only be used by this class,
> +
> + //These functions are "protected" - in other words they should
> only be used by this class,
> //or other classes in this package.
> _initializeProperties: function(kwProps){
> for (var x = 0; x < this.__propertyNames.length; x++){
> @@ -127,30 +127,30 @@
> this.__setProperty(propertyName, this.__getDefault
> (propertyName));
> }
> }
> - },
> -
> + },
> +
> _genericGetter: function genericGetter(propertyName){
> return this["_"+propertyName];
> },
> -
> +
> _genericSetter: function genericSetter(propertyName, value){
> this["_"+propertyName] = value;
> },
> -
> +
> _getDefault: function getDefault(propertyName){
> var propDefault = this.__defaults[propertyName];
> -
> +
> if (typeof(propDefault) == "function"){
> return propDefault();
> } else {
> return propDefault;
> }
> -
> +
> return propDefault;
> }
> });
>
> -//instantiate the singleton
> +//instantiate the singleton
> cosmo.model.util.simplePropertyApplicator = new
> cosmo.model.util.SimplePropertyApplicator();
>
> dojo.declare("cosmo.model.util.InheritingSubclassCreator", null, {
> @@ -158,46 +158,46 @@
> dojo.declare(childConstructorName, parentConstructor, {
> });
> },
> -
> +
> //default functions
> _getParentDefault: function(){
> - return this.parent;
> - },
> -
> + return this.parent;
> + },
> +
> _getterDefault: function(){
> -
> +
> }
> -
> -});
>
> +});
> +
> cosmo.model.util.equals = function cosmoEquals(a,b){
> var type = typeof (a);
> if (type != typeof(b)){
> - throw new Error("Both operands must be of the same type!\n
> You passed '"
> + throw new Error("Both operands must be of the same type!\n
> You passed '"
> + a + "' and '" + b +"', a " + typeof(a) + " and a "+
> typeof(b));
> }
> -
> +
> if (type == "object"){
> if (a == null){
> return b == null;
> }
> return a.equals(b);
> }
> -
> +
> return a == b;
> -}
> +}
>
> cosmo.model._occurrenceGetProperty = function
> occurrenceGetProperty(propertyName){
> //get the master version
> var master = this.getMaster();