Revision 185

Date:
2012/02/02 14:47:08
Author:
ahitrov
Revision Log:
More accurate control implementation
Files:

Legend:

 
Added
 
Removed
 
Modified
  • koi8/core/comps/contenido/components/inputs/url.msn

     
    1 <a href="#" onclick="this.href = $('input[name=<% $name %>]').attr('value'); if ( this.href.slice(0,4) == 'http' || this.href.slice(0,3) == 'ftp' ) { return true } else { return false }"
    2 title="������� ������" target="_blank"><img src="/contenido/i/lookup-19x19.gif" width="19" height="19" align="right" style="border:0; margin:0 5px;"></a>
    1 3 <input <% $prop->{readonly} ? 'readonly ' : '' %> type="text" name="<% $name %>" id="<% $name%>_text" size="60" value="<% html_escape($check) || $prop->{default} %>"
    2 style="width: 95%;color:blue;text-decoration:underline;" onkeyup="<% $name %>_changed();" onclick="lookfor_<% $name %>()">
    4 style="width: 97%;color:blue;text-decoration:underline;" onkeyup="<% $name %>_changed();">
    3 5
    4 6 <table id="<% $name %>_prev_table" style="width: 95%; display: none;" cellspacing="0" cellpadding="0" border="0">
    5 7 <tr>
     
    7 9 <td style="padding-left: 3px; vertical-align: top;"><a href="#" onclick="return <% $name %>_undo();" title="�������� ���������"><img src="/contenido/i/undo-19x19.gif" width="19" height="19" class="bb gb"></a></td>
    8 10 </tr>
    9 11 </table>
    10
    12 % if ( exists $prop->{rem} && $prop->{rem} ) {
    13 <div style="color:gray; font-size:85%; padding:4px">&raquo; <% $prop->{rem} %></div>
    14 % }
    11 15 <textarea id="<% $name %>_prev_value" style="display: none;"><% $check %></textarea>
    12 16
    13 17 <script type="text/javascript">
    18 <!--
    14 19 function <% $name %>_changed() {
    15 20 var t = document.getElementById('<% $name %>_prev_table');
    16 21 if (document.getElementById('<% $name %>_text').value==document.getElementById('<% $name %>_prev_value').value) {
     
    24 29 }
    25 30 }
    26 31
    27 function lookfor_<% $name %>() {
    28 var id = document.getElementById('<% $name %>').value;
    29 if (id) {
    30 var Uri = id;
    31 var Width = screen.width;
    32 var Height = screen.height;
    33 window.open(Uri,'Interface','width='+Width+',height='+Height+',top=0,left=0,location=1,menubar=1,resizable=0,scrollbars=1,status=1,titlebar=1,toolbar=1,directories=1,hotkeys=1');
    34 }
    35 }
    36
    37 32 function <% $name %>_undo() {
    38 33 document.getElementById('<% $name %>_text').value = document.getElementById('<% $name %>_prev_value').value;
    39 34 <% $name %>_changed();
    40 35 return false;
    41 36 }
    37 //-->
    42 38 </script>
    43 39
    44 40 <%args>