| <?xml version="1.0"?> |
| |
| <!-- |
| ~ Licensed to the Apache Software Foundation (ASF) under one |
| ~ or more contributor license agreements. See the NOTICE file |
| ~ distributed with this work for additional information |
| ~ regarding copyright ownership. The ASF licenses this file |
| ~ to you under the Apache License, Version 2.0 (the |
| ~ "License"); you may not use this file except in compliance |
| ~ with the License. You may obtain a copy of the License at |
| ~ |
| ~ http://www.apache.org/licenses/LICENSE-2.0 |
| ~ |
| ~ Unless required by applicable law or agreed to in writing, |
| ~ software distributed under the License is distributed on an |
| ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| ~ KIND, either express or implied. See the License for the |
| ~ specific language governing permissions and limitations |
| ~ under the License. |
| --> |
| |
| <document> |
| <properties> |
| <title>Generics Javascript</title> |
| <author>Olivier Lamy</author> |
| </properties> |
| <body> |
| |
| <script src="../js/jquery.fancybox.pack.2.1.5.js" type="text/javascript"></script> |
| <script src="../js/jquery.mousewheel-3.0.6.pack.js" type="text/javascript"></script> |
| <link rel="stylesheet" href="../css/jquery.fancybox.2.1.5.css" type="text/css" media="screen" /> |
| <script type="text/javascript" src="../js/fancy-box-activation.js"></script> |
| |
| <macro name="toc"/> |
| |
| <section name="Generics Javascript"> |
| <p>Some common/generic javascript methods are available.</p> |
| <subsection name="User messages"> |
| <p>A div "user-messages" is reserved for user messages.</p> |
| <subsection name="Success message"> |
| <p> |
| Javascript function: |
| <source> |
| displaySuccessMessage($.i18n.prop('managedrepository.added')); |
| // the second parameter is optionnal by default #user-messages id is used |
| displaySuccessMessage=function(text,idToAppend){ |
| </source> |
| <a href="../images/success-message.png" class="single_image" title="Success Message"> |
| <img src="../images/success-message.png" width="150" height="93" style="border: 1px solid silver; margin-left: 0.25em; margin-bottom: 0.25em" alt="" /><br/> |
| Success Message |
| </a> |
| </p> |
| </subsection> |
| |
| <subsection name="Error message"> |
| <p> |
| Javascript function: |
| <source> |
| displayErrorMessage($.i18n.prop('managedrepository.added')); |
| // the second parameter is optionnal by default #user-messages id is used |
| displayErrorMessage=function(text,idToAppend){ |
| </source> |
| <a href="../images/error-message.png" class="single_image" title="Error Message"> |
| <img src="../images/error-message.png" width="150" height="93" style="border: 1px solid silver; margin-left: 0.25em; margin-bottom: 0.25em" alt="" /><br/> |
| Error Message |
| </a> |
| </p> |
| </subsection> |
| </subsection> |
| <subsection name="Modal Confirm dialog"> |
| <p> |
| Javascript function: |
| <source> |
| /** |
| * open a confirm dialog based on bootstrap modal |
| * @param okFn callback function to call on ok confirm |
| * @param okMessage message in the ok button |
| * @param cancelMessage message in the cancel button |
| * @param title title of the modal box |
| * @param bodyText html content of the modal box |
| */ |
| openDialogConfirm=function(okFn, okMessage, cancelMessage, title,bodyText){ |
| </source> |
| <a href="../images/modal-confirm-dialog.png" class="single_image" title="Modal Confirm dialog"> |
| <img src="../images/modal-confirm-dialog.png" width="150" height="93" style="border: 1px solid silver; margin-left: 0.25em; margin-bottom: 0.25em" alt="" /><br/> |
| Modal Confirm dialog |
| </a> |
| </p> |
| </subsection> |
| </section> |
| </body> |
| </document> |
| |
| |