Changeset 588 for trunk/grails-app/views


Ignore:
Timestamp:
Jun 18, 2010, 4:41:55 PM (11 years ago)
Author:
duh
Message:
  • general improvements to the termEditor

-- feedback is more clear (resolves feature request #120)
-- separated info / error and feedback info boxes
-- improved the layout
-- ontology-chooser now allows instance options to
--- show/hide a div element (usefull for buttons to show only when an autocomplete option was selected)
--- show a spinner when searching

  • general web application improvement to capture F4 page refreshes, backspace browser navigation events and accidental submits when pressing 'enter' in an input box
Location:
trunk/grails-app/views
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/layouts/dialog.gsp

    r538 r588  
    44<html xmlns="http://www.w3.org/1999/xhtml" lang="en-EN" xml:lang="en-EN">
    55 <head>
    6   <title><g:layoutTitle default="Grails"/></title>
     6  <title><g:layoutTitle default="Grails"/></title><g:if env="production">
    77  <link rel="stylesheet" href="${resource(dir: 'css', file: 'dialog.css')}"/>
     8  </g:if><g:else>
     9  <link rel="stylesheet" href="${resource(dir: 'css', file: 'dialog.min.css')}"/>       
     10  </g:else>
    811  <g:javascript library="jquery"/>
    912  <script type="text/javascript">var baseUrl = '${resource(dir: '')}';</script>
    1013  <script src="${createLinkTo(dir: 'js', file: 'jquery-ui-1.8.1.custom.min.js')}" type="text/javascript"></script>
     14  <script type="text/javascript" src="${resource(dir: 'js', file: 'disableKeys.js')}"></script>
    1115  <link rel="stylesheet" href="${createLinkTo(dir: 'css/cupertino', file: 'jquery-ui-1.8.1.custom.css')}"/>
    1216  <g:layoutHead/>
  • trunk/grails-app/views/layouts/main.gsp

    r587 r588  
    1212        <link rel="stylesheet" href="${createLinkTo(dir: 'css/cupertino', file: 'jquery-ui-1.8.1.custom.css')}"/>
    1313        <g:layoutHead/>
     14        <script type="text/javascript" src="${resource(dir: 'js', file: 'disableKeys.js')}"></script>
    1415        <script type="text/javascript" src="${resource(dir: 'js', file: 'login_panel.js')}"></script>
    1516        <script type="text/javascript" src="${resource(dir: 'js', file: 'topnav.js')}"></script>
  • trunk/grails-app/views/termEditor/pages/terms.gsp

    r456 r588  
    1717<html>
    1818 <head>
    19   <meta name="layout" content="dialog"/><g:if env="production">
     19  <meta name="layout" content="dialog"/>
     20  <style type="text/css">
     21#termForm {
     22        display: block;
     23}
     24#termForm #label {
     25    color:#006DBA;
     26    font-size:14px;
     27    font-weight:normal;
     28    display: inline-block;
     29    zoom: 1; /* IE 6 & 7 hack */
     30    *display: inline; /* IE 6 & 7 hack */
     31}
     32#termForm #term {
     33    display: inline-block;
     34    zoom: 1; /* IE 6 & 7 hack */
     35    *display: inline; /* IE 6 & 7 hack */
     36}
     37#termForm #button {
     38    display: inline-block;
     39    zoom: 1; /* IE 6 & 7 hack */
     40    *display: inline; /* IE 6 & 7 hack */
     41}
     42  </style>
     43<g:if env="production">
    2044  <script type="text/javascript" src="${resource(dir: 'js', file: 'ontology-chooser.min.js')}"></script>
    2145</g:if><g:else>
     
    2549 <body>
    2650
    27  <g:form action="pages" name="wizardForm" id="wizardForm">
    28  <g:textField name="term" rel="ontology-${ontologies}" />
    29  <g:submitButton name="add" value="Add term" />
    30  </g:form>
     51        <g:if test="${errors}">
     52                <span class="info">
     53                        <span class="error">Oops!</span>
     54                        <g:each in="${errors}" var="error">
     55                                ${error}<br/>
     56                        </g:each>
     57                </span>
     58        </g:if>
     59        <g:elseif test="${message}">
     60                <span class="info">
     61                        <span class="known">Success</span>
     62                        ${message}
     63                </span>
     64        </g:elseif>
     65        <g:else>
     66                <span class="info">
     67                        <span class="title">Add a term</span>
     68                        Use the search box below to find the term you would like to add.
     69                </span>
     70        </g:else>
    3171
    32  ${errors}
    33  ${message}
     72        <div id="termForm">
     73        <g:form action="pages" name="wizardForm" id="wizardForm">
     74                <div id="label">search term: </div>
     75                <div id="term"><g:textField name="term" rel="ontology-${ontologies}" /></div>
     76                <div id="button" style="inline-block;"><g:submitButton name="add" value="Add term" /></div>
     77        </g:form>
     78        </div>
    3479
    35  <script type="text/javascript">
    36         $(document).ready(function() {
    37         // initialize the ontology chooser
    38         new OntologyChooser().init();
    39         });
    40  </script>
     80        <script type="text/javascript">
     81                $(document).ready(function() {
     82                // initialize the ontology chooser
     83                new OntologyChooser().init({showHide: $('div#button')});
     84                });
     85        </script>
    4186
    4287 </body>
Note: See TracChangeset for help on using the changeset viewer.