Author: qmoriceau Date: 2013-04-25 18:03:02 +0200 (Thu, 25 Apr 2013) New Revision: 27 Url: http://chorem.org/projects/incubator/repository/revisions/27 Log: version des sources jeudi semaine 17 Added: jtimerhtml5/TestWebEngine.java jtimerhtml5/cssJavaFX/ jtimerhtml5/cssJavaFX/alert_box.css jtimerhtml5/cssJavaFX/confirm_box.css jtimerhtml5/cssJavaFX/prompt_box.css Modified: jtimerhtml5/alertes.html jtimerhtml5/apropos.html jtimerhtml5/aspect/alertes.css jtimerhtml5/aspect/apropos.css jtimerhtml5/aspect/jtimer.css jtimerhtml5/aspect/rapport.css jtimerhtml5/index.html jtimerhtml5/javascript/actionsMenus.js jtimerhtml5/javascript/menu.js jtimerhtml5/rapport.html Added: jtimerhtml5/TestWebEngine.java =================================================================== --- jtimerhtml5/TestWebEngine.java (rev 0) +++ jtimerhtml5/TestWebEngine.java 2013-04-25 16:03:02 UTC (rev 27) @@ -0,0 +1,294 @@ +import java.net.URL; + +import netscape.javascript.JSObject; + +import javafx.application.Application; +import javafx.beans.property.BooleanProperty; +import javafx.beans.property.SimpleBooleanProperty; +import javafx.beans.property.SimpleStringProperty; +import javafx.beans.property.StringProperty; +import javafx.beans.value.ChangeListener; +import javafx.beans.value.ObservableValue; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.concurrent.Worker.State; +import javafx.scene.Group; +import javafx.scene.Node; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.effect.BoxBlur; +import javafx.scene.input.MouseEvent; +import javafx.scene.layout.HBox; +import javafx.scene.layout.HBoxBuilder; +import javafx.scene.layout.VBox; +import javafx.scene.paint.Color; +import javafx.scene.web.PopupFeatures; +import javafx.scene.web.PromptData; +import javafx.scene.web.WebEngine; +import javafx.scene.web.WebEvent; +import javafx.scene.web.WebView; +import javafx.stage.Modality; +import javafx.stage.Stage; +import javafx.stage.StageStyle; +import javafx.util.Callback; + +public class TestWebEngine extends Application { + + @Override + public void start(final Stage stage) { + stage.setTitle("jTimer"); + + Scene scene = new Scene(new Group(), 450, 500); + + VBox root = new VBox(); + + final WebView browser = new WebView(); + final WebEngine webEngine = browser.getEngine(); + + // les différentes initialisation nécéssaire aux boites de dialogue + final VBox confirmationResults = new VBox(); + confirmationResults.getStyleClass().add("confirmation-results"); + confirmationResults.setMinWidth(100); + HBox layout = new HBox(); + layout.getChildren().addAll(confirmationResults, browser); + stage.setScene(new Scene(layout)); + stage.show(); + stage.getScene().getStylesheets().add(getClass().getResource("cssJavaFX/alert_box.css").toExternalForm()); + + // processus au chargement de la page, on crée le pont de Javascript vers javaFX + // Mais ne répond pas entièrement au problème. + /*webEngine.getLoadWorker().stateProperty().addListener( + new ChangeListener<State>() { + @Override + public void changed(ObservableValue<? extends State> ov, + State oldState, State newState) { + JSObject jsobj = (JSObject) webEngine.executeScript("window"); + jsobj.setMember("java", new Bridge()); + } + } + );*/ + + // permet d'ouvrir des popup. + webEngine.setCreatePopupHandler(new Callback<PopupFeatures, WebEngine>() { + public WebEngine call(PopupFeatures popupFeatures) { + final WebView popupWebView = new WebView(); + final Scene popupScene = new Scene(popupWebView); + final Stage popupStage = new Stage(); + popupStage.setScene(popupScene); + popupStage.setResizable(popupFeatures.isResizable()); + popupStage.show(); + + WebEngine popupEngine = popupWebView.getEngine(); + + popupEngine.setOnVisibilityChanged( new EventHandler<WebEvent<Boolean>>() { + public void handle(WebEvent<Boolean> we) { + if (!we.getData()){ + popupStage.close(); + } + } + }); + + popupEngine.getLoadWorker().stateProperty().addListener( + new ChangeListener<State>() { + @Override + public void changed(ObservableValue<? extends State> ov, + State oldState, State newState) { + JSObject jsobj = (JSObject) webEngine.executeScript("window"); + jsobj.setMember("java", new Bridge()); + } + } + ); + + return popupEngine; + } + }); + + // permet de fermer la fenêtre + webEngine.setOnVisibilityChanged( new EventHandler<WebEvent<Boolean>>() { + public void handle(WebEvent<Boolean> we) { + if (!we.getData()){ + stage.close(); + } + } + }); + + webEngine.setOnAlert(new EventHandler<WebEvent<String>>(){ + @Override + public void handle(WebEvent<String> we) { + alert(stage, we.getData()); + } + }); + + webEngine.setConfirmHandler(new Callback<String, Boolean>(){ + public Boolean call(String str){ + Boolean confirmed = confirm(stage, str); + confirmationResults.getChildren().add(new Label("Confirmed? " + confirmed)); + return confirmed; + } + }); + + webEngine.setPromptHandler(new Callback<PromptData, String>(){ + public String call(PromptData pdata){ + String result = prompt(stage, pdata.getMessage(), pdata.getDefaultValue()); + return result; + } + }); + + URL maPage = getClass().getResource("index.html"); + webEngine.load(maPage.toExternalForm()); + + root.getChildren().addAll(browser); + scene.setRoot(root); + + stage.setScene(scene); + stage.show(); + } + + // JavaJX n'a pas d'outils prédéfini pour les boites de dialogue, on les construits donc "manuelement" + // On retrouve donc a la suite des boîtes de dialogue personalisable. + + // boite de dialogue de question ouverte + private String prompt(final Stage parent, String msg, String dft) { + + final StringProperty reponse = new SimpleStringProperty(); + final Stage dialog = new Stage(StageStyle.TRANSPARENT); + dialog.initOwner(parent); + dialog.initModality(Modality.WINDOW_MODAL); + + Label label = new Label(msg); + final TextField textField = new TextField(dft); + Button buttonOk = new Button("OK"); + Button buttonAnn = new Button("Annuler"); + + Scene scn = new Scene(HBoxBuilder.create().styleClass("modal-dialog").children(label,textField,buttonOk,buttonAnn).build(), Color.TRANSPARENT); + dialog.setScene(scn); + + buttonOk.setOnAction(new EventHandler<ActionEvent>() { + @Override + public void handle(ActionEvent arg0) { + reponse.setValue(textField.getCharacters().toString()); + parent.getScene().getRoot().setEffect(null); + dialog.close(); + } + }); + + buttonAnn.setOnAction(new EventHandler<ActionEvent>() { + @Override + public void handle(ActionEvent arg0) { + reponse.setValue(null); + parent.getScene().getRoot().setEffect(null); + dialog.close(); + } + }); + + dragged(dialog); + + // style and show the dialog. + dialog.getScene().getStylesheets().add(getClass().getResource("cssJavaFX/prompt_box.css").toExternalForm()); + parent.getScene().getRoot().setEffect(new BoxBlur()); + dialog.showAndWait(); + + return reponse.get(); + } + + // boite de dialogue d'alerte + private void alert(final Stage parent, String msg) { + // initialize the alert dialog + final Stage dialog = new Stage(StageStyle.TRANSPARENT); + dialog.initOwner(parent); + dialog.initModality(Modality.WINDOW_MODAL); + + Label label = new Label(msg); + Button buttonOk = new Button("OK"); + + Scene scn = new Scene(HBoxBuilder.create().styleClass("modal-dialog").children(label,buttonOk).build(), Color.TRANSPARENT); + dialog.setScene(scn); + + buttonOk.setOnAction(new EventHandler<ActionEvent>() { + @Override + public void handle(ActionEvent arg0) { + parent.getScene().getRoot().setEffect(null); + dialog.close(); + } + }); + + dragged(dialog); + + // style and show the dialog. + dialog.getScene().getStylesheets().add(getClass().getResource("cssJavaFX/alert_box.css").toExternalForm()); + parent.getScene().getRoot().setEffect(new BoxBlur()); + dialog.showAndWait(); + } + + // boite de dialogue de confirmation + private Boolean confirm(final Stage parent, String msg) { + final BooleanProperty confirmationResult = new SimpleBooleanProperty(); + // initialize the confirmation dialog + final Stage dialog = new Stage(StageStyle.TRANSPARENT); + dialog.initOwner(parent); + dialog.initModality(Modality.WINDOW_MODAL); + + Label label = new Label(msg); + Button buttonOk = new Button("OK"); + Button buttonAnn = new Button("Annuler"); + + Scene scn = new Scene(HBoxBuilder.create().styleClass("modal-dialog").children(label,buttonOk,buttonAnn).build(), Color.TRANSPARENT); + dialog.setScene(scn); + + buttonOk.setOnAction(new EventHandler<ActionEvent>() { + @Override + public void handle(ActionEvent arg0) { + confirmationResult.set(true); + parent.getScene().getRoot().setEffect(null); + dialog.close(); + } + }); + + buttonAnn.setOnAction(new EventHandler<ActionEvent>() { + @Override + public void handle(ActionEvent arg0) { + confirmationResult.set(false); + parent.getScene().getRoot().setEffect(null); + dialog.close(); + } + }); + + dragged(dialog); + + + // style and show the dialog. + dialog.getScene().getStylesheets().add(getClass().getResource("cssJavaFX/confirm_box.css").toExternalForm()); + parent.getScene().getRoot().setEffect(new BoxBlur()); + dialog.showAndWait(); + + return confirmationResult.get(); + } + + // permet de déplacer le Stage entrer en paramètre. + private void dragged(final Stage dialog){ + final Node root = dialog.getScene().getRoot(); + final Delta dragDelta = new Delta(); + root.setOnMousePressed(new EventHandler<MouseEvent>() { + @Override public void handle(MouseEvent mouseEvent) { + // record a delta distance for the drag and drop operation. + dragDelta.x = dialog.getX() - mouseEvent.getScreenX(); + dragDelta.y = dialog.getY() - mouseEvent.getScreenY(); + } + }); + root.setOnMouseDragged(new EventHandler<MouseEvent>() { + @Override public void handle(MouseEvent mouseEvent) { + dialog.setX(mouseEvent.getScreenX() + dragDelta.x); + dialog.setY(mouseEvent.getScreenY() + dragDelta.y); + } + }); + } + + // records relative x and y co-ordinates. + class Delta { double x, y; } + + public static void main(String[] args) { + launch(args); + } +} Modified: jtimerhtml5/alertes.html =================================================================== --- jtimerhtml5/alertes.html 2013-04-19 15:38:31 UTC (rev 26) +++ jtimerhtml5/alertes.html 2013-04-25 16:03:02 UTC (rev 27) @@ -5,17 +5,18 @@ <title>jTimer - Alertes</title> <link rel="stylesheet" type="text/css" href="aspect/alertes.css"/> <link rel="stylesheet" type="text/css" href="aspect/style.css"/> + <script type="text/javascript" src="javascript/alertes.js"></script> </head> <body> - <p><b>Listes des alertes :</b></p> - <div width=100% id="tableAlertes"><span class="alerteG">Type</span><span class="alerteD">Durée</span> - </div> - <footer> - <input type="button" id="alerteAj" value="Ajouter"> - <input type="button" id="alerteSupp" value="Supprimer"> - <br> + <b>Listes des alertes :</b> + <span id="cadreHaut"> <input type="button" id="alerteAnn" value="Annuler" OnClick="javascript:window.close()"> <input type="button" id="alerteSave" value="Sauver"> - </footer> + </span> + <br> + <br> + <div width=100% id="listeAlertes">Type & Durée<br><br> + </div> + <input type="button" id="alerteAj" value="Ajouter" onclick="ajout()"> </body> </html> Modified: jtimerhtml5/apropos.html =================================================================== --- jtimerhtml5/apropos.html 2013-04-19 15:38:31 UTC (rev 26) +++ jtimerhtml5/apropos.html 2013-04-25 16:03:02 UTC (rev 27) @@ -10,18 +10,22 @@ function action(i){ if(i == 1){ document.getElementById('dataText').innerHTML='<b>jTimer - 1.4.1</b><br><br>Copyright 2007 - 2012, Code Lutin.<br><br><a href="http://maven-site.chorem.org/jtimer">http://maven-site.chorem.org/jtimer</a><br><br>Merci de rapporter les bugs de jTimer.'; + document.getElementById('bt1').style.backgroundColor = "#339999"; + document.getElementById('bt2').style.backgroundColor = "#ffffff"; } if(i == 2){ document.getElementById('dataText').innerHTML="Vous pouvez modifier et redistribuer ce programme sous les conditions énoncées par la licence GNU GPL (version 2 ou ultérieure). Une copie de la licence GPL est dans le fichier « LICENSE.txt » fourni avec jTimer. Tous droits réservés. Aucune garantie n'est fournie pour l'utilisation de ce programme."; + document.getElementById('bt1').style.backgroundColor = "#ffffff"; + document.getElementById('bt2').style.backgroundColor = "#339999"; } } //--> </script> </head> <body> - <img src="style/images/jtimer-logo-orange.jpg" /><br> - <input type="button" value="A propos de jTimer" onclick="action(1)"> - <input type="button" value="Licence" onclick="action(2)"><br> + <img src="aspect/images/jtimer-logo-orange.jpg" /><br> + <span id="bt1" onclick="action(1)">A propos de jTimer</span> + <span id="bt2" onclick="action(2)">Licence</span><br> <div id="cadre"><p id="dataText"><b>jTimer - 1.4.1</b><br><br>Copyright 2007 - 2013, Code Lutin.<br><br><a href="http://maven-site.chorem.org/jtimer">http://maven-site.chorem.org/jtimer</a><br / ><br / >Merci de rapporter les bugs de jTimer.</p></div> <input style="margin-left:300px;margin-top:5px;width:100px;height:25px" type="submit" value="Fermer" OnClick="javascript:window.close()"> </body> Modified: jtimerhtml5/aspect/alertes.css =================================================================== --- jtimerhtml5/aspect/alertes.css 2013-04-19 15:38:31 UTC (rev 26) +++ jtimerhtml5/aspect/alertes.css 2013-04-25 16:03:02 UTC (rev 27) @@ -1,33 +1,15 @@ -#alerteAj { - width:49%; - height: 35px; -} - -#alerteSupp { - width:49%; - height: 35px; -} - #alerteAnn { - width:49%; - height: 35px; + width:70px; + height:30px; } #alerteSave { - width:49%; - height: 35px; + width:70px; + height:30px; } -.alerteG{ - width:50%; - margin-left:0; - position:absolute; - text-align:center; +#cadreHaut{ + right:0px; + position:fixed; + margin-right:5px } - -.alerteD{ - width:49%; - margin-left:49%; - position:absolute; - text-align:center; -} Modified: jtimerhtml5/aspect/apropos.css =================================================================== --- jtimerhtml5/aspect/apropos.css 2013-04-19 15:38:31 UTC (rev 26) +++ jtimerhtml5/aspect/apropos.css 2013-04-25 16:03:02 UTC (rev 27) @@ -7,5 +7,23 @@ height:155px; border-style:solid; border-width:2px; - border-color:#339999 + border-color:#339999; + border-radius: 4px; } + +#bt1{ + border-style:solid; + border-width:2px; + border-color:#339999; + border-radius: 4px; + cursor:pointer; + background-color:#339999; +} + +#bt2{ + border-style:solid; + border-width:2px; + border-color:#339999; + border-radius: 4px; + cursor:pointer; +} Modified: jtimerhtml5/aspect/jtimer.css =================================================================== --- jtimerhtml5/aspect/jtimer.css 2013-04-19 15:38:31 UTC (rev 26) +++ jtimerhtml5/aspect/jtimer.css 2013-04-25 16:03:02 UTC (rev 27) @@ -1,59 +1,141 @@ /* Menus */ +#menu1 { + display:none; + position:absolute; + margin-left:2px; + top:30px; + border-radius: 4px; + border:2px solid #339999; +} +#menu2 { + display:none; + position:absolute; + margin-left:75px; + top:30px; + border-radius: 4px; + border:2px solid #339999; +} +#menu3 { + display:none; + position:absolute; + margin-left:139px; + top:30px; + border-radius: 4px; + border:2px solid #339999; +} + +#menu4 { + display:none; + position:absolute; + margin-left:201px; + top:30px; + border-radius: 4px; + border:2px solid #339999; +} + +#menu5 { + display:none; + position:absolute; + margin-left:282px; + top:30px; + border-radius: 4px; + border:2px solid #339999; +} + +#menu6 { + display:none; + position:absolute; + margin-left:360px; + top:30px; + border-radius: 4px; + border:2px solid #339999; +} + +.menu{ + padding:3px 3px; + border-radius: 4px; + border:2px solid #339999; + cursor:pointer; +} + +.options{ + padding:3px 3px; + cursor:pointer; +} + /* Boutons */ #demarreTache { background: url(images/go-next.png); background-repeat:no-repeat; background-position:center center; - width: 40px; - height: 40px; + padding-right: 40px; + padding-bottom: 20px; + border-radius: 4px; + border:2px solid black; + cursor:pointer; } #arretTache { background: url(images/process-stop.png); background-repeat:no-repeat; background-position:center center; - width: 40px; - height: 40px; + padding-right: 40px; + padding-bottom: 20px; + border-radius: 4px; + border:2px solid black; + cursor:pointer; } #nouveauProjet { background: url(images/bookmark-new.png); background-repeat:no-repeat; background-position:center center; - width: 40px; - height: 40px; + padding-right: 40px; + padding-bottom: 20px; + border-radius: 4px; + border:2px solid black; + cursor:pointer; } #nouvelleTache { background: url(images/document-new.png); background-repeat:no-repeat; background-position:center center; - width: 40px; - height: 40px; + padding-right: 40px; + padding-bottom: 20px; + border-radius: 4px; + border:2px solid black; + cursor:pointer; } #note { background: url(images/notes.png); background-repeat:no-repeat; background-position:center center; - width: 40px; - height: 40px; + padding-right: 40px; + padding-bottom: 20px; + border-radius: 4px; + border:2px solid black; + cursor:pointer; } #alerte { background: url(images/bell.png); background-repeat:no-repeat; background-position:center center; - width: 40px; - height: 40px; + padding-right: 40px; + padding-bottom: 20px; + border-radius: 4px; + border:2px solid black; + cursor:pointer; } .boutons { - margin-top:32px; + margin-top:10px; margin-bottom:20px } @@ -63,20 +145,27 @@ width:33%; margin-left:0; position:absolute; + cursor:pointer; } .colone2{ width:33%; margin-left:32%; position:absolute; + cursor:pointer; } .colone3{ width:33%; margin-left:65%; position:absolute; + cursor:pointer; } +#entete{ + margin-top:30px; +} + #entete span { text-align:center; border-bottom:2px solid #339999; Modified: jtimerhtml5/aspect/rapport.css =================================================================== --- jtimerhtml5/aspect/rapport.css 2013-04-19 15:38:31 UTC (rev 26) +++ jtimerhtml5/aspect/rapport.css 2013-04-25 16:03:02 UTC (rev 27) @@ -5,7 +5,8 @@ margin:0; border-style:solid; border-width:2px; - border-color:#339999 + border-color:#339999; + border-radius: 4px; } #divGauche{ @@ -48,23 +49,37 @@ } #generRapport{ - background: url(images/applications-system.png); - background-repeat:no-repeat; - background-position:left center; - width:16%; + width:15%; height:30px; + border-style:solid; + border-width:2px; + border-color:#339999; + border-radius: 4px; + cursor:pointer; + position:fixed; + text-align:center; + bottom:5px; } #mailRapport{ - background: url(images/mail-forward.png); - background-repeat:no-repeat; - background-position:left center; width:16%; height:30px; + border-style:solid; + border-width:2px; + border-color:#339999; + border-radius: 4px; + cursor:pointer; + position:fixed; + margin-left:16%; + text-align:center; + bottom:5px; } #fermerRapport{ width:16%; + margin-left:33%; + position:fixed; + bottom:10px; } #optionsRapport{ @@ -72,6 +87,7 @@ border-width:2px; border-color:#339999; height:100%; + border-radius: 4px; } #projetsRapport{ @@ -79,6 +95,7 @@ border-width:2px; border-color:#339999; height:100%; + border-radius: 4px; } #moisRapport{ Added: jtimerhtml5/cssJavaFX/alert_box.css =================================================================== --- jtimerhtml5/cssJavaFX/alert_box.css (rev 0) +++ jtimerhtml5/cssJavaFX/alert_box.css 2013-04-25 16:03:02 UTC (rev 27) @@ -0,0 +1,37 @@ +/** +* modal-dialog.css +* place in same directory as WebViewConfirm.java +* ensure your build system copies the file to your build output directory +*/ + +.root { +-fx-glass-color: rgba(255, 102, 102, 0.9); +} + +.modal-dialog { +-fx-padding: 10; +-fx-spacing: 5; +-fx-alignment: center; +-fx-font-size: 18; +-fx-font-weight:bold; +-fx-background-color: linear-gradient(to bottom, derive(-fx-glass-color, 20%), -fx-glass-color); +-fx-border-color: derive(-fx-glass-color, -20%); +-fx-border-width: 3; +-fx-background-insets: 6; +-fx-border-insets: 5; +-fx-border-radius: 3; +-fx-background-radius: 3; +} + +.modal-dialog:pressed { +-fx-cursor: move; +} + +.modal-dialog .button:pressed { +-fx-cursor: default; +} + +.confirmation-results { +-fx-background-color: cornsilk; +-fx-padding: 3; +} Added: jtimerhtml5/cssJavaFX/confirm_box.css =================================================================== --- jtimerhtml5/cssJavaFX/confirm_box.css (rev 0) +++ jtimerhtml5/cssJavaFX/confirm_box.css 2013-04-25 16:03:02 UTC (rev 27) @@ -0,0 +1,37 @@ +/** +* modal-dialog.css +* place in same directory as WebViewConfirm.java +* ensure your build system copies the file to your build output directory +*/ + +.root { +-fx-glass-color: rgba(95, 158, 160, 0.9); +} + +.modal-dialog { +-fx-padding: 10; +-fx-spacing: 5; +-fx-alignment: center; +-fx-font-size: 15; +-fx-font-weight:bold; +-fx-background-color: linear-gradient(to bottom, derive(-fx-glass-color, 20%), -fx-glass-color); +-fx-border-color: derive(-fx-glass-color, -20%); +-fx-border-width: 3; +-fx-background-insets: 6; +-fx-border-insets: 5; +-fx-border-radius: 3; +-fx-background-radius: 3; +} + +.modal-dialog:pressed { +-fx-cursor: move; +} + +.modal-dialog .button:pressed { +-fx-cursor: default; +} + +.confirmation-results { +-fx-background-color: cornsilk; +-fx-padding: 3; +} Added: jtimerhtml5/cssJavaFX/prompt_box.css =================================================================== --- jtimerhtml5/cssJavaFX/prompt_box.css (rev 0) +++ jtimerhtml5/cssJavaFX/prompt_box.css 2013-04-25 16:03:02 UTC (rev 27) @@ -0,0 +1,37 @@ +/** +* modal-dialog.css +* place in same directory as WebViewConfirm.java +* ensure your build system copies the file to your build output directory +*/ + +.root { +-fx-glass-color: rgba(153, 255, 153, 0.9); +} + +.modal-dialog { +-fx-padding: 10; +-fx-spacing: 5; +-fx-alignment: center; +-fx-font-size: 15; +-fx-font-weight:bold; +-fx-background-color: linear-gradient(to bottom, derive(-fx-glass-color, 20%), -fx-glass-color); +-fx-border-color: derive(-fx-glass-color, -20%); +-fx-border-width: 3; +-fx-background-insets: 6; +-fx-border-insets: 5; +-fx-border-radius: 3; +-fx-background-radius: 3; +} + +.modal-dialog:pressed { +-fx-cursor: move; +} + +.modal-dialog .button:pressed { +-fx-cursor: default; +} + +.confirmation-results { +-fx-background-color: cornsilk; +-fx-padding: 3; +} Modified: jtimerhtml5/index.html =================================================================== --- jtimerhtml5/index.html 2013-04-19 15:38:31 UTC (rev 26) +++ jtimerhtml5/index.html 2013-04-25 16:03:02 UTC (rev 27) @@ -1,29 +1,36 @@ -<!--<!DOCTYPE html>--> +<!DOCTYPE html> <html lang="fr"> <head> <meta charset="UTF-8"/> <title>jTimer</title> <link rel="stylesheet" type="text/css" href="aspect/style.css"/> <link rel="stylesheet" type="text/css" href="aspect/jtimer.css"/> - <script type="text/javascript" src="menu.js"></script> + <script type="text/javascript" src="javascript/menu.js"></script> <script type="text/javascript" src="javascript/actionsMenus.js"></script> </head> <body> <!-- Menu --> - + <div> + <span class="menu" id="mn1" onclick="menu(1)" onmouseover="over2(1)" onmouseout="out2(1)">Fichier</span> + <span class="menu" id="mn2" onclick="menu(2)" onmouseover="over2(2)" onmouseout="out2(2)">Projet</span> + <span class="menu" id="mn3" onclick="menu(3)" onmouseover="over2(3)" onmouseout="out2(3)">Tâche</span> + <span class="menu" id="mn4" onclick="menu(4)" onmouseover="over2(4)" onmouseout="out2(4)">Rapport</span> + <span class="menu" id="mn5" onclick="menu(5)" onmouseover="over2(5)" onmouseout="out2(5)">Options</span> + <span class="menu" id="mn6" onclick="menu(6)" onmouseover="over2(6)" onmouseout="out2(6)">Aide</span> + </div> <div class="boutons"> - <! Les boutons d'actions > - <! Réflechir à la possibilité de n'avoire qu'un bouton pour démarré et stoper une tache. > - <input type="button" id="demarreTache" value="" title="Démarre la tâche sélectionnée" onclick="demarTache()"> - <input type="button" id="arretTache" value="" title="Arrête la tâche sélectionnée" onclick="stopTache"> - <input type="button" id="nouveauProjet" value="" title="Création d'un nouveau projet" onclick="newProjet()"> - <input type="button" id="nouvelleTache" value="" title="Création d'une nouvelle tâche" onclick="newTache()"> + <!-- Les boutons d'actions + Réflechir à la possibilité de n'avoire qu'un bouton pour démarré et stoper une tache. --> + <span id="demarreTache" title="Démarre la tâche sélectionnée" onclick="demarTache()" onmouseover="over(this)" onmouseout="out(this)"></span> + <span id="arretTache" title="Arrête la tâche sélectionnée" onclick="stopTache()" onmouseover="over(this)" onmouseout="out(this)"></span> + <span id="nouveauProjet" title="Création d'un nouveau projet" onclick="newProjet()" onmouseover="over(this)" onmouseout="out(this)"></span> + <span id="nouvelleTache" title="Création d'une nouvelle tâche" onclick="newTache()" onmouseover="over(this)" onmouseout="out(this)"></span> - <input type="button" id="note" value="" title="Ajouter une annotation" onclick="addAnnotation()"> - <input type="button" id="alerte" value="" title="Edition des alertes" onclick="edAlertes()"> + <span id="note" title="Ajouter une annotation" onclick="addAnnotation()" onmouseover="over(this)" onmouseout="out(this)"></span> + <span id="alerte" title="Edition des alertes" onclick="edAlertes()" onmouseover="over(this)" onmouseout="out(this)"></span> </div> <div> - <! Arborescence des taches > + <!-- Arborescence des taches --> <div width=100%> <div id="entete"> <span class="colone1">Projet et tâches</span> @@ -41,8 +48,49 @@ </div> </div> <footer class="piedpage"> - <! footer à garder tel quel > + <!-- footer à garder tel quel --> <div id="cadreBas"><span id="statutTaches">Inactif</span><span id="recapAuj">Aujourd'hui : xx:xx:xx</span></div> </footer> + <!-- Les sous menus sont placé à la fin pour qu'il passe devant les autres blocks de texte --> + <div id="menu1"> + <span class="options" onclick="javascript:window.close()">Quitter</span> + </div> + <div id="menu2"> + <span class="options" onclick="newProjet()">Nouveau projet</span><br> + <span class="options" onclick="edProjet()">Édition du projet</span><br> + <span class="options" onclick="ofProjet()">Ouvrir/Fermer le projet</span><br> + <span class="options" onclick="supprProjet()">Suppression du projet</span> + </div> + <div id="menu3"> + <span class="options" onclick="newTache()">Nouvelle tâche</span><br> + <span class="options" onclick="edTache()">Édition de la tâche</span><br> + <span class="options" onclick="ofTache()">Ouvrir/Fermer la tâche</span><br> + <span class="options" onclick="supprTache()">Suppression de la tâche</span><br> + + <span style="padding-top:10px;" class="options" onclick="demarTache()">Démarrer</span><br> + <span class="options" onclick="stopTache()">Arrêter</span><br> + + <span style="padding-top:10px;" class="options" onclick="addAnnotation()">Ajouter une annotation</span><br> + <span class="options" onclick="edAlertes()">Édition des alertes</span><br> + <span class="options" onclick="add(1)">Ajouter 1 minute</span><br> + <span class="options" onclick="add(5)">Ajouter 5 minutes</span><br> + <span class="options" onclick="add(30)">Ajouter 30 minutes</span><br> + <span class="options" onclick="sou(1)">Enlever 1 minute</span><br> + <span class="options" onclick="sou(5)">Enlever 5 minutes</span><br> + <span class="options" onclick="sou(30)">Enlever 30 minutes</span><br> + <span class="options" onclick="zero()">Remettre à Zero</span><br> + <span class="options" onclick="fusion()">Fusionner</span> + </div> + <div id="menu4"> + <span class="options" onclick="rapport()">Rapport...</span> + </div> + <div id="menu5"> + <span class="options" onclick="affCachés()"><label><input type="checkbox">Afficher les cachés</label></span><br> + <span class="options" onclick="systray()"><label><input type="checkbox">Fermer vers le systray</label></span><br> + <span class="options" onclick="jSemaine()">Rapport - Premier jour de la semaine</span> + </div> + <div id="menu6"> + <span class="options" onclick="aPropos()">À propos...</span> + </div> </body> </html> Modified: jtimerhtml5/javascript/actionsMenus.js =================================================================== --- jtimerhtml5/javascript/actionsMenus.js 2013-04-19 15:38:31 UTC (rev 26) +++ jtimerhtml5/javascript/actionsMenus.js 2013-04-25 16:03:02 UTC (rev 27) @@ -5,6 +5,9 @@ if (nomNewProjet=="") { alert("Erreur : Le nom est vide !") } + else { + java.newProjet(); + } // vérifier si un autre projet n'a pas déjà ce nom } @@ -13,23 +16,29 @@ if (nomNewProjet=="") { alert("Erreur : Le nom est vide !") } + else { + java.edProjet(); + } // vérifier si un autre projet n'a pas déjà ce nom } function ofProjet(){ - + java.ofProjet(); } function supprProjet() { var bool = confirm("Voulez-vous supprimer le projet x ?") - // si bool alors action + if (bool){java.supprProjet();} } function newTache() { var nomNewTache = prompt("Nom de la tâche à créer pour x :", "" ) - if (nomNewProjet=="") { + if (nomNewTache=="") { alert("Erreur : Le nom est vide !") } + else { + java.newTache(); + } // vérifier si une autre tache n'a pas déjà ce nom } @@ -38,24 +47,25 @@ } function ofTache(){ - + java.ofTache(); } function supprTache(){ var bool = confirm("Voulez-vous supprimer la tâche x ?") - // si bool alors action + if (bool){java.supprTache();} } function demarTache(){ - + java.demarTache(); } function stopTache(){ - + java.stopTache(); } function addAnnotation(){ var newAnnot = prompt("Annotation pour la tâche x :","") + java.addAnnotation(newAnnot); } function edAlertes(){ @@ -63,19 +73,19 @@ } function add(nb){ - + java.add(nb); } function sou(nb){ - + java.sou(nb); } function zero(){ - + java.zero(); } function fusion(){ - + java.fusion(); } function rapport(){ @@ -83,15 +93,15 @@ } function affCachés(){ - + // uniquement lié à l'interface ? } function systray(){ - + java.systray(); } function jSemaine(){ - + java.jSemaine(); } function aPropos(){ @@ -102,17 +112,15 @@ function selecTache(cel, numligne) { // pour toute les lignes mettre en blanc - var nbLignes = 2 + var nbLignes = 2; for (var j=0; j<nbLignes; j++) { for (var k=0; k<3; k++) - (document.getElementById('cel'+(k+1)+'ligne'+(j+1))).style.backgroundColor = "#ffffff" + (document.getElementById('cel'+(k+1)+'ligne'+(j+1))).style.backgroundColor = "#ffffff"; } for (var i=0; i<3; i++) - (document.getElementById('cel'+(i+1)+'ligne'+numligne)).style.backgroundColor = "#00ccff" - - cel.style.backgroundColor = "#3399ff" + (document.getElementById('cel'+(i+1)+'ligne'+numligne)).style.backgroundColor = "#00ccff"; } function go(nb){ - (document.getElementById('go'+nb)).style.display = "" + (document.getElementById('go'+nb)).style.display = ""; } Modified: jtimerhtml5/javascript/menu.js =================================================================== --- jtimerhtml5/javascript/menu.js 2013-04-19 15:38:31 UTC (rev 26) +++ jtimerhtml5/javascript/menu.js 2013-04-25 16:03:02 UTC (rev 27) @@ -1,78 +1,43 @@ -function createMenu() { - document.write("<div class='menus'><table cellspacing=0;><tr>") - for (var i = 0; i < menu.length; i++) - document.write("<td id=menu"+i+" onmouseover=menuOver(this,"+i+") onmouseout=menuOut(this,"+i+") onclick=menuClick(this,"+i+")> "+menu[i]+"</td>") - - document.write("</tr></table></div>") - for (var i = 0; i < submenu.length; i++) { - document.write("<span class='ssmenu'><table border=1 style=display:none;left:"+(i*50)+";top:25; id=submenu"+i+" cellspacing=0 onmouseover=revealSubMenu("+i+") >") - - for (var j = 0; j < submenu[i].length; j++) - document.write("<tr><td onmouseover=styleOver(this) onmouseout=styleOut(this)> "+submenu[i][j]+"</td></tr>") - document.write("</table></span>") - } -} +var deroule = 0; -function menuClick(element, numMenu){ - if (click==false) { - click=true - menuOver(element, numMenu) +function menu(i){ + if (i==deroule){ + for(var j=0; j<6; j++){ + document.getElementById('menu'+(j+1)).style.display='none'; + document.getElementById('mn'+(j+1)).style.backgroundColor='#ffffff'; + } + deroule = 0; } - else { - click=false - menuOut(element, numMenu) - styleOut(element) + else{ + for(var j=0; j<6; j++){ + document.getElementById('menu'+(j+1)).style.display='none'; + document.getElementById('mn'+(j+1)).style.backgroundColor='#ffffff'; + } + document.getElementById('menu'+i).style.display='block'; + document.getElementById('menu'+i).style.backgroundColor='#00ccff'; + document.getElementById('mn'+i).style.backgroundColor='#00ccff'; + deroule = i; } } +/* Boutons */ -function menuOver(element, numMenu) { - if (click==true){ - setDefaultStyle(element) - styleOver(element) - revealSubMenu(numMenu) - } +function over(elem){ + elem.style.backgroundColor = "#339999"; } -function menuOut(element, numMenu) { - hideSubMenu(numMenu) +function out(elem){ + elem.style.backgroundColor = "#ffffff"; } -function styleOver(element) { - element.style.backgroundColor = "#33CC00" +function out2(j){ + if (j!=deroule){ + document.getElementById('mn'+j).style.backgroundColor = "#ffffff"; + } } -function styleOut(element) { - element.style.backgroundColor = "#FFFF9E" +function over2(k){ + if (k!=deroule){ + document.getElementById('mn'+k).style.backgroundColor = "#339999"; + } } - -function setDefaultStyle() { - for (var i = 0; i < menu.length; i++) - O("menu"+i).style.backgroundColor = "#FFFF9E" -} - -function revealSubMenu(numMenu) { - hideAll() - show( O("submenu"+numMenu) ) -} - -function hideSubMenu(numMenu) { - hide( O("submenu"+numMenu) ) -} - -function show(element) { - element.style.display = "" -} - -function hideAll() { - for (var i = 0; i < submenu.length; i++) - hideSubMenu(i) -} - -function hide(element) { - element.style.display = "none" -} - -function O(id) { - return document.getElementById(id) -} Modified: jtimerhtml5/rapport.html =================================================================== --- jtimerhtml5/rapport.html 2013-04-19 15:38:31 UTC (rev 26) +++ jtimerhtml5/rapport.html 2013-04-25 16:03:02 UTC (rev 27) @@ -24,27 +24,25 @@ <div id="divGauche"> <div id="optionsRapport"> Options :<br><br> - De : <input type="text" id="dateDeb"> - <input type="button" id="selecDateDeb"> + De : <input type="date" id="dateDeb"> <input type="button" name="Semaine courante" id="selecSemAct"><br> - A : <input type="text" id="dateFin"> - <input type="button" id="selecDateFin"> + A : <input type="date" id="dateFin"> <input type="button" name="Semaine précédente" id="selecSemPre"><br> <form> - <input type="radio" name="choixFormat" value="jour">Par jour - <input type="radio" name="choixFormat" value="mois" id="moisRapport">Par mois + <label><input type="radio" name="choixFormat" value="jour">Par jour</label> + <label><input type="radio" name="choixFormat" value="mois" id="moisRapport">Par mois</label> <br> - <input type="radio" name="choixFormat" value="semaine">Par semaine - <input type="radio" name="choixFormat" value="annee" id="anneeRapport">Par année + <label><input type="radio" name="choixFormat" value="semaine">Par semaine</label> + <label><input type="radio" name="choixFormat" value="annee" id="anneeRapport">Par année</label> <br> - <input type="radio" name="choixFormat" value="projet">Par projet + <label><input type="radio" name="choixFormat" value="projet">Par projet</label> </form> - <input type="checkbox" id="incAnno" onchange="checkHeure()">Inclure les annotations - <span id="avHeure" style="display:none;"><input type="checkbox">avec l'heure</span> + <label><input type="checkbox" id="incAnno" onchange="checkHeure()">Inclure les annotations</label> + <span id="avHeure" style="display:none;"><label><input type="checkbox">avec l'heure</label></span> </div><br> <div id="projetsRapport"> Projets :<br><br> - <input type="checkbox" id="affichCachésRapport">Afficher les cachés + <label><input type="checkbox" id="affichCachésRapport">Afficher les cachés</label> <div id="arboRapport"> </div> </div> @@ -54,8 +52,8 @@ Rapport :<br> <span id="zoneTexteRapport"><textarea id="texteRapport"></textarea></span> <footer> - <input type="button" value="Générer" id="generRapport"> - <input type="button" value="Envoyer par email" id="mailRapport"> + <span id="generRapport"><img src="aspect/images/applications-system.png">Générer</span> + <span id="mailRapport"><img src="aspect/images/mail-forward.png">Envoyer par email</span> <input type="button" value="Fermer" id="fermerRapport" onclick="javascript:window.close()"> </footer> </div>