[Suiviobsmer-commits] r682 - in branches/wao-1.5.x: . src/announcement src/site/rst wao-ui/src/main/java/fr/ifremer/wao/ui/pages wao-ui/src/main/webapp/js
Author: fdesbois Date: 2010-10-15 18:32:15 +0000 (Fri, 15 Oct 2010) New Revision: 682 Log: ANO #2526 : Bug on IE javascript : - Rename js files - Resolve News bug and Contact automatic mail bug Added: branches/wao-1.5.x/wao-ui/src/main/webapp/js/administration.js branches/wao-1.5.x/wao-ui/src/main/webapp/js/news.js Removed: branches/wao-1.5.x/wao-ui/src/main/webapp/js/AdminUserSelect.js branches/wao-1.5.x/wao-ui/src/main/webapp/js/NewsHider.js Modified: branches/wao-1.5.x/changelog.txt branches/wao-1.5.x/src/announcement/release-email-1.5.4.txt branches/wao-1.5.x/src/site/rst/index.rst branches/wao-1.5.x/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java branches/wao-1.5.x/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Index.java branches/wao-1.5.x/wao-ui/src/main/webapp/js/contacts.js Modified: branches/wao-1.5.x/changelog.txt =================================================================== --- branches/wao-1.5.x/changelog.txt 2010-10-15 16:30:12 UTC (rev 681) +++ branches/wao-1.5.x/changelog.txt 2010-10-15 18:32:15 UTC (rev 682) @@ -9,8 +9,9 @@ Anomalies +++++++++ -- [fdesbois] Ano #2540 : La validation programme ne fonctionne plus sur un contact - refusé. +- [fdesbois] Ano #2526 : Mail automatique non fonctionnel sous IE. +- [fdesbois] Ano #2540 : La validation programme ne fonctionne plus sur un + contact avec l'état "refus", "refus définitif" ou "non abouti. 1.5.3 ----- Modified: branches/wao-1.5.x/src/announcement/release-email-1.5.4.txt =================================================================== --- branches/wao-1.5.x/src/announcement/release-email-1.5.4.txt 2010-10-15 16:30:12 UTC (rev 681) +++ branches/wao-1.5.x/src/announcement/release-email-1.5.4.txt 2010-10-15 18:32:15 UTC (rev 682) @@ -3,6 +3,7 @@ Résolution d'anomalies : +- Mail automatique non fonctionnel sous IE. [fdesbois-Ano #2526] - La validation programme ne fonctionne plus sur un contact refusé. [fdesbois-Ano #2540] Modified: branches/wao-1.5.x/src/site/rst/index.rst =================================================================== --- branches/wao-1.5.x/src/site/rst/index.rst 2010-10-15 16:30:12 UTC (rev 681) +++ branches/wao-1.5.x/src/site/rst/index.rst 2010-10-15 18:32:15 UTC (rev 682) @@ -26,3 +26,8 @@ .. - Application permettant le suivi des embarquements effectués sur des navires de pêche dans le cadre d'observations scientifiques. + +Cette application n'est pas complètement supporté par le navigateur Microsoft Internet Explorer. Il est préférable d'utiliser un +autre navigateur Internet comme `Mozilla Firefox`_ . + +.. _Mozilla Firefox: http://www.mozilla-europe.org/fr/firefox/ Modified: branches/wao-1.5.x/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java =================================================================== --- branches/wao-1.5.x/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java 2010-10-15 16:30:12 UTC (rev 681) +++ branches/wao-1.5.x/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java 2010-10-15 18:32:15 UTC (rev 682) @@ -85,7 +85,7 @@ */ @RequiresAuthentication(value = {UserRole.ADMIN, UserRole.COORDINATOR}, readOnlyAllowed = false) @IncludeStylesheet("context:css/administration.css") - at IncludeJavaScriptLibrary("context:js/AdminUserSelect.js") + at IncludeJavaScriptLibrary("context:js/administration.js") public class Administration { @InjectComponent Modified: branches/wao-1.5.x/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Index.java =================================================================== --- branches/wao-1.5.x/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Index.java 2010-10-15 16:30:12 UTC (rev 681) +++ branches/wao-1.5.x/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Index.java 2010-10-15 18:32:15 UTC (rev 682) @@ -56,7 +56,7 @@ */ @RequiresAuthentication @IncludeStylesheet("context:css/news.css") - at IncludeJavaScriptLibrary("context:js/NewsHider.js") + at IncludeJavaScriptLibrary("context:js/news.js") public class Index { @Inject Deleted: branches/wao-1.5.x/wao-ui/src/main/webapp/js/AdminUserSelect.js =================================================================== --- branches/wao-1.5.x/wao-ui/src/main/webapp/js/AdminUserSelect.js 2010-10-15 16:30:12 UTC (rev 681) +++ branches/wao-1.5.x/wao-ui/src/main/webapp/js/AdminUserSelect.js 2010-10-15 18:32:15 UTC (rev 682) @@ -1,53 +0,0 @@ -/* - * #%L - * Wao :: Web Interface - * %% - * Copyright (C) 2009 - 2010 Ifremer - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -/** - * This class is used to manage manually user select on Administration page. - * Options need style depends on inactivity of users. So we use javascript to - * manage dynamic states of the select. Initialization if needed (the correct - * option to select) then use a hidden field 'hiddenUserId' to keep userId - * context (ids are values of options). - * This hidden field will be interpreted by Tapestry when form will be submit. - */ -AdminUserSelect = Class.create({ - initialize: function() { - this.hiddenUserId = $('userActionsForm').hiddenUserId; - this.userSelect = $('userActionsForm').users; - this.userSelect.observe('change', this.updateUserId.bind(this)); - - var userId = $F(this.hiddenUserId); - - // Initialize selected option - if (userId) { - var options = this.userSelect.select('option'); - for (i = 0; i < options.length; i++) { - if (options[i].value == userId) { - options[i].selected = true; - break; - } - } - } - //Tapestry.debug('Initialized !'); - }, - updateUserId: function(event) { - //Tapestry.debug('select value : ' + $F(this.userSelect)); - this.hiddenUserId.setValue($F(this.userSelect)); - } -}); Deleted: branches/wao-1.5.x/wao-ui/src/main/webapp/js/NewsHider.js =================================================================== --- branches/wao-1.5.x/wao-ui/src/main/webapp/js/NewsHider.js 2010-10-15 16:30:12 UTC (rev 681) +++ branches/wao-1.5.x/wao-ui/src/main/webapp/js/NewsHider.js 2010-10-15 18:32:15 UTC (rev 682) @@ -1,100 +0,0 @@ -/* - * #%L - * Wao :: Web Interface - * %% - * Copyright (C) 2009 - 2010 Ifremer - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -/** - * This class is used to hide news details depends on an anchor. This anchor - * must be called 'details' and be surrounded by a paragraph block (<p>) in - * the news content. The anchor will be transformed in a clickable link, then - * the rest of the news will be hidden using NewsDetails object. - */ -NewsHider = Class.create({ - initialize: function() { - this.allNews = $('so-news').select('div.news-content'); - this.anchorPattern = 'a[name="details"]'; - }, - /** - * Method to call to hide all news that contains the anchor 'details' - */ - hideAllNewsDetails: function() { - for (j = 0; j < this.allNews.length; j++) { - this.hideNewsDetails(this.allNews[j]); - } - }, - /** - * Hide a {news} if contains an anchor called 'details'. A NewsDetails object - * will be instantiate to transform the anchor found and hide the rest of - * the news in a hiddenBlock. - */ - hideNewsDetails: function(news) { - // Select all paragraphs in the news - var paragraphs = news.select('p'); - //Tapestry.debug('nb paragraphs in news : ' + paragraphs.length); - - for (i = 0; i < paragraphs.length; i++) { - var paragraph = paragraphs[i]; - - // Check the firstDescendant in the paragraph, we take only anchor called 'details' - if (paragraph.firstDescendant() && paragraph.firstDescendant().match(this.anchorPattern)) { - var anchor = paragraph.firstDescendant(); - - //Tapestry.debug('Find anchor !'); - - // paragraphs to hide are the next siblings of current paragraph - var paragraphsToHide = paragraph.nextSiblings(); - - var details = new NewsDetails(anchor, paragraphsToHide); - - // append the hidden block to the news - news.appendChild(details.hiddenBlock); - break; - } - } - } -}); - -/** - * This class is used to transform an {anchor} in clickable link to display a - * hidden block as news details. The {paragraphsToHide} will be wrapped into - * a div hidden element. When user will click on the {anchor}, the hidden - * block will be toggled to be displayed or not. - */ -NewsDetails = Class.create({ - initialize: function(anchor, paragraphsToHide) { - - //Tapestry.debug('create NewsDetails'); - - // Update params of the anchor to be clickable - anchor.update('Lire la suite...'); - anchor.addClassName('news-details-link'); - // Bind the click on the anchor with the toggle on hiddenBlock - anchor.observe('click', this.toggleDetails.bind(this)); - - // Create hidden block - this.hiddenBlock = document.createElement('div'); - this.hiddenBlock.addClassName('hidden'); - - for (i = 0; i < paragraphsToHide.length; i++) { - this.hiddenBlock.appendChild(paragraphsToHide[i]); - } - }, - toggleDetails: function(event) { - this.hiddenBlock.toggleClassName('hidden'); - } -}); Copied: branches/wao-1.5.x/wao-ui/src/main/webapp/js/administration.js (from rev 678, branches/wao-1.5.x/wao-ui/src/main/webapp/js/AdminUserSelect.js) =================================================================== --- branches/wao-1.5.x/wao-ui/src/main/webapp/js/administration.js (rev 0) +++ branches/wao-1.5.x/wao-ui/src/main/webapp/js/administration.js 2010-10-15 18:32:15 UTC (rev 682) @@ -0,0 +1,53 @@ +/* + * #%L + * Wao :: Web Interface + * %% + * Copyright (C) 2009 - 2010 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +/** + * This class is used to manage manually user select on Administration page. + * Options need style depends on inactivity of users. So we use javascript to + * manage dynamic states of the select. Initialization if needed (the correct + * option to select) then use a hidden field 'hiddenUserId' to keep userId + * context (ids are values of options). + * This hidden field will be interpreted by Tapestry when form will be submit. + */ +AdminUserSelect = Class.create({ + initialize: function() { + this.hiddenUserId = $('userActionsForm').hiddenUserId; + this.userSelect = $('userActionsForm').users; + this.userSelect.observe('change', this.updateUserId.bind(this)); + + var userId = $F(this.hiddenUserId); + + // Initialize selected option + if (userId) { + var options = this.userSelect.select('option'); + for (i = 0; i < options.length; i++) { + if (options[i].value == userId) { + options[i].selected = true; + break; + } + } + } + //Tapestry.debug('Initialized !'); + }, + updateUserId: function(event) { + //Tapestry.debug('select value : ' + $F(this.userSelect)); + this.hiddenUserId.setValue($F(this.userSelect)); + } +}); Modified: branches/wao-1.5.x/wao-ui/src/main/webapp/js/contacts.js =================================================================== --- branches/wao-1.5.x/wao-ui/src/main/webapp/js/contacts.js 2010-10-15 16:30:12 UTC (rev 681) +++ branches/wao-1.5.x/wao-ui/src/main/webapp/js/contacts.js 2010-10-15 18:32:15 UTC (rev 682) @@ -142,7 +142,8 @@ initialize: function(message, contactState) { this.contactState = contactState; this.message = message; - $('contactsForm').saveContact.observe('click', this.doConfirm.bind(this)); + + $('saveContact').observe('click', this.doConfirm.bind(this)); }, doConfirm: function(event) { Copied: branches/wao-1.5.x/wao-ui/src/main/webapp/js/news.js (from rev 678, branches/wao-1.5.x/wao-ui/src/main/webapp/js/NewsHider.js) =================================================================== --- branches/wao-1.5.x/wao-ui/src/main/webapp/js/news.js (rev 0) +++ branches/wao-1.5.x/wao-ui/src/main/webapp/js/news.js 2010-10-15 18:32:15 UTC (rev 682) @@ -0,0 +1,100 @@ +/* + * #%L + * Wao :: Web Interface + * %% + * Copyright (C) 2009 - 2010 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +/** + * This class is used to hide news details depends on an anchor. This anchor + * must be called 'details' and be surrounded by a paragraph block (<p>) in + * the news content. The anchor will be transformed in a clickable link, then + * the rest of the news will be hidden using NewsDetails object. + */ +NewsHider = Class.create({ + initialize: function() { + this.allNews = $('so-news').select('div.news-content'); + this.anchorPattern = 'a[name="details"]'; + }, + /** + * Method to call to hide all news that contains the anchor 'details' + */ + hideAllNewsDetails: function() { + for (j = 0; j < this.allNews.length; j++) { + this.hideNewsDetails(this.allNews[j]); + } + }, + /** + * Hide a {news} if contains an anchor called 'details'. A NewsDetails object + * will be instantiate to transform the anchor found and hide the rest of + * the news in a hiddenBlock. + */ + hideNewsDetails: function(news) { + // Select all paragraphs in the news + var paragraphs = news.select('p'); + //Tapestry.debug('nb paragraphs in news : ' + paragraphs.length); + + for (i = 0; i < paragraphs.length; i++) { + var paragraph = paragraphs[i]; + + // Check the firstDescendant in the paragraph, we take only anchor called 'details' + if (paragraph.firstDescendant() && paragraph.firstDescendant().match(this.anchorPattern)) { + var anchor = paragraph.firstDescendant(); + + //Tapestry.debug('Find anchor !'); + + // paragraphs to hide are the next siblings of current paragraph + var paragraphsToHide = paragraph.nextSiblings(); + + var details = new NewsDetails(anchor, paragraphsToHide); + + // append the hidden block to the news + news.appendChild(details.hiddenBlock); + break; + } + } + } +}); + +/** + * This class is used to transform an {anchor} in clickable link to display a + * hidden block as news details. The {paragraphsToHide} will be wrapped into + * a div hidden element. When user will click on the {anchor}, the hidden + * block will be toggled to be displayed or not. + */ +NewsDetails = Class.create({ + initialize: function(anchor, paragraphsToHide) { + + //Tapestry.debug('create NewsDetails'); + + // Update params of the anchor to be clickable + anchor.update('Lire la suite...'); + anchor.addClassName('news-details-link'); + // Bind the click on the anchor with the toggle on hiddenBlock + anchor.observe('click', this.toggleDetails.bind(this)); + + // Create hidden block + this.hiddenBlock = new Element('div'); + this.hiddenBlock.addClassName('hidden'); + + for (i = 0; i < paragraphsToHide.length; i++) { + this.hiddenBlock.appendChild(paragraphsToHide[i]); + } + }, + toggleDetails: function(event) { + this.hiddenBlock.toggleClassName('hidden'); + } +});
participants (1)
-
fdesbois@users.labs.libre-entreprise.org