Changeset 1755 for ZMS


Ignore:
Timestamp:
08.12.2011 22:31:39 (6 months ago)
Author:
zmsdev
Message:

[1] revised support for auto-save and restore of form-inputs (7): default off
[2] added support for "soft" request-parameters to search-links (highlight-info)

Location:
ZMS/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • ZMS/trunk/dtml/ZMS/f_bodycontent_search.dtml

    r1634 r1755  
    217217       <a href="<dtml-var "f.getHref(REQUEST)">" 
    218218       <dtml-else> 
    219        <a href="<dtml-var "url_append_params(url,{'ZMS_HIGHLIGHT':'raw','raw':raw})">" 
     219       <a href="<dtml-var url>#ZMS_HIGHLIGHT=raw&raw=<dtml-var raw>" 
    220220       </dtml-if> 
    221221        ><dtml-var "search_quote(title)"></a> 
     
    223223      </dtml-let> 
    224224     <dtml-else> 
    225       <a href="<dtml-var "url_append_params(url,{'ZMS_HIGHLIGHT':'raw','raw':raw})">" 
     225      <a href="<dtml-var url>#ZMS_HIGHLIGHT=raw&raw=<dtml-var raw>" 
    226226       ><dtml-var "search_quote(title)"></a> 
    227227     </dtml-if> 
     
    244244     ></dtml-let> 
    245245    <dtml-else> 
    246      <a href="<dtml-var "url_append_params(url,{'ZMS_HIGHLIGHT':'raw','raw':raw})">" 
     246     <a href="<dtml-var url>#ZMS_HIGHLIGHT=raw&raw=<dtml-var raw>" 
    247247      ><dtml-in "ob.breadcrumbs_obj_path()" 
    248248       >&raquo;&nbsp;<dtml-var "search_quote(getTitlealt(REQUEST),20)"><dtml-unless sequence-end> </dtml-unless 
  • ZMS/trunk/dtml/ZMS/manage_customize.dtml

    r1747 r1755  
    187187   {'key':'ASP.ip_or_domain','title':'ASP IP/Domain','desc':'ASP IP/Domain.','datatype':'string'}, 
    188188   {'key':'HTTP.proxy','title':'HTTP proxy','desc':'HTTP proxy (host:port).','datatype':'string'}, 
    189    {'key':'HTTP.noproxy','title':'HTTP noproxy','desc':'comma-delimited list of url-patterns that do not use HTTP proxy.','datatype':'string'}, 
    190189   {'key':'jquery.version','title':'JQuery version','desc':'JQuery version.','datatype':'string'}, 
    191    {'key':'jquery.ui.version','title':'JQuery UI version','desc':'JQuery UI version.','datatype':'string'}, 
     190   {'key':'jquery.ui','title':'JQuery UI version','desc':'JQuery UI version.','datatype':'string'}, 
    192191   {'key':'jquery.plugin.version','title':'JQuery plugin version','desc':'JQuery plugin version','datatype':'string'}, 
    193192   {'key':'jquery.plugin.extensions','title':'JQuery plugin extensions','desc':'JQuery plugin extensions','datatype':'string'}, 
  • ZMS/trunk/etc/zms.conf

    r1743 r1755  
    3838[ZMS] 
    3939input.file.plugin=input_file 
     40TempFormProperties=0 
  • ZMS/trunk/plugins/www/jquery/jquery-all.min.js

    r1753 r1755  
    2626return self},getPlugin:function(){return $.plugin.apply(this,arguments)} 
    2727})}); 
    28 String.prototype.removeWhiteSpaces=function(){return(this.replace(/\s+/g,""))};String.prototype.leftTrim=function(){return(this.replace(/^\s+/,""))};String.prototype.rightTrim=function(){return(this.replace(/\s+$/,""))};String.prototype.basicTrim=function(){return(this.replace(/\s+$/,"").replace(/^\s+/,""))};String.prototype.superTrim=function(){return(this.replace(/\s+/g," ").replace(/\s+$/,"").replace(/^\s+/,""))};String.prototype.startsWith=function(str){return(this.match("^"+str)==str)};String.prototype.endsWith=function(str){return(this.match(str+"$")==str)};Array.prototype.indexOf=function(obj){var i,idx=-1;for(i=0;i<this.length;i++){if(this[i]==obj){idx=i;break}}return idx};Array.prototype.lastIndexOf=function(obj){this.reverse();var i,idx=-1;for(i=0;i<this.length;i++){if(this[i]==obj){idx=(this.length-1-i);break}}this.reverse();return idx};Array.prototype.contains=function(obj){var i,listed=false;for(i=0;i<this.length;i++){if(this[i]==obj){listed=true;break}}return listed};var zmiParams={};$(function(){var href=self.location.href;var i=href.indexOf('?');href=href.substr(i+1);var l=href.split('&');for(var j=0;j < l.length;j++){i=l[j].indexOf('=');zmiParams[l[j].substr(0,i)]=unescape(l[j].substr(i+1))} 
     28String.prototype.removeWhiteSpaces=function(){return(this.replace(/\s+/g,""))};String.prototype.leftTrim=function(){return(this.replace(/^\s+/,""))};String.prototype.rightTrim=function(){return(this.replace(/\s+$/,""))};String.prototype.basicTrim=function(){return(this.replace(/\s+$/,"").replace(/^\s+/,""))};String.prototype.superTrim=function(){return(this.replace(/\s+/g," ").replace(/\s+$/,"").replace(/^\s+/,""))};String.prototype.startsWith=function(str){return(this.match("^"+str)==str)};String.prototype.endsWith=function(str){return(this.match(str+"$")==str)};Array.prototype.indexOf=function(obj){var i,idx=-1;for(i=0;i<this.length;i++){if(this[i]==obj){idx=i;break}}return idx};Array.prototype.lastIndexOf=function(obj){this.reverse();var i,idx=-1;for(i=0;i<this.length;i++){if(this[i]==obj){idx=(this.length-1-i);break}}this.reverse();return idx};Array.prototype.contains=function(obj){var i,listed=false;for(i=0;i<this.length;i++){if(this[i]==obj){listed=true;break}}return listed};var zmiParams={};$(function(){var href=self.location.href;var delimiter_list=['?','#'];for(var h=0;h < delimiter_list.length;h++){var delimiter=delimiter_list[h];var i=href.indexOf(delimiter);if(i > 0){var query_string=href.substr(i+1);var l=query_string.split('&');for(var j=0;j < l.length;j++){i=l[j].indexOf('=');if(i < 0){break} 
     29if(typeof zmiParams[l[j].substr(0,i)]=="undefined"){zmiParams[l[j].substr(0,i)]=unescape(l[j].substr(i+1))}} 
     30}} 
    2931if(self.location.href.indexOf('/manage')>0||self.location.href.indexOf('preview=preview')>0){$('.contentEditable,.zmiRenderShort').mouseover(function(evt){$(this).addClass('preview').addClass('highlight')}).mouseout(function(evt){$(this).removeClass('preview').removeClass('highlight')}).dblclick(function(evt){evt.stopPropagation();var href=""+self.location.href;if(href.indexOf('?')>0){href=href.substr(0,href.indexOf('?'))} 
    3032if(href.lastIndexOf('/')>0){href=href.substr(0,href.lastIndexOf('/'))} 
     
    8688else {$content.show('normal')} 
    8789$container.toggleClass('ui-state-active').toggleClass('ui-state-default');$icon.toggleClass('ui-icon-triangle-1-s').toggleClass('ui-icon-triangle-1-e');var zmi_form_section_id=$container.attr('id');if(typeof zmi_form_section_id !='undefined'){toggleCookie(zmi_form_section_id+'_collapsed')} 
    88 })});var zmiAutoSaveTimeout=null;var zmiAutoSaveIntervall=1000;var zmiAutoChangeArr={};function zmiAutoSave(){var els=$("form.ZMIPropertiesForm .form-element-modified");if(els){var values={};for(var i=0;i < els.length;i++){var $el=$(els[i]);var elid=$el.attr("id");if(typeof elid !="undefined"){var coords=$el.offset();var html='<div class="zmiAutoSave form-small zmiNeutralColorLight0" style="position:absolute;left:'+Math.round(coords.left)+'px;top:'+Math.round(coords.top)+'px;">saving...</div>';$("body").append(html);values[elid]=$el.val()}} 
     90})});var zmiAutoSaveTimeout=null;var zmiAutoSaveIntervall=10000;var zmiAutoChangeArr={};function zmiAutoSave(){var els=$("form.ZMIPropertiesForm .form-element-modified");if(els){var values={};for(var i=0;i < els.length;i++){var $el=$(els[i]);var elid=$el.attr("id");if(typeof elid !="undefined"){var coords=$el.offset();var html='<div class="zmiAutoSave form-small zmiNeutralColorLight0" style="position:absolute;left:'+Math.round(coords.left)+'px;top:'+Math.round(coords.top)+'px;">saving...</div>';$("body").append(html);values[elid]=$el.val()}} 
    8991runPluginJSON(function(){$.post("setTempFormProperties",{lang:zmiParams["lang"],key:self.location.href,values:$.toJSON(values)},function(result){$("div.zmiAutoSave").remove()})})}} 
    9092function zmiAutoChange(el){var elid=$(el).attr("id");if(typeof elid !="undefined"&&typeof zmiAutoChangeArr[elid] !="undefined"){if(!($(el).hasClass("form-element-modified"))&&zmiAutoChangeArr[elid]["init"] !=$(el).val()){$(el).addClass("form-element-modified")} 
     
    9799if($(".form-element-modified").length > 0){$.get("getTempFormProperties",{"lang":zmiParams["lang"],key:self.location.href},function(result){})} 
    98100return true} 
    99 $(function(){$("select.form-element,input.form-element,textarea.form-element,select.form-small,input.form-small,textarea.form-small",$("form.ZMIPropertiesForm")).keydown(function(evt){zmiAutoChange(this)}).keyup(function(evt){zmiAutoChange(this)}).click(function(evt){zmiAutoChange(this)}).change(function(evt){zmiAutoChange(this)}).each(function(){var elid=$(this).attr("id");if(typeof elid !="undefined"&&$(this).attr("type")!="file"){zmiAutoChangeArr[elid]={'init':$(this).val(),'last':$(this).val()}} 
     101$(function(){if(getZMIConfProperty("ZMS.TempFormProperties",1)==1){$("select.form-element,input.form-element,textarea.form-element,select.form-small,input.form-small,textarea.form-small",$("form.ZMIPropertiesForm")).keydown(function(evt){zmiAutoChange(this)}).keyup(function(evt){zmiAutoChange(this)}).click(function(evt){zmiAutoChange(this)}).change(function(evt){zmiAutoChange(this)}).each(function(){var elid=$(this).attr("id");if(typeof elid !="undefined"&&$(this).attr("type")!="file"){zmiAutoChangeArr[elid]={'init':$(this).val(),'last':$(this).val()}} 
    100102});if($("form.ZMIPropertiesForm").length > 0){$.get("getTempFormProperties",{"lang":zmiParams["lang"],key:self.location.href},function(result){var data=eval("("+result+")");var modified=false;if(data){for(var i in data){var v=data[i];modified|=$("#"+i).val()!=v}} 
    101103if(modified){if(confirm("Form was closed before without saving pending changes. Do you want to restore form?")){for(var i in data){var v=data[i];$("#"+i).val(v).addClass("form-element-modified");zmiAutoChangeArr[i]['last']=v}}} 
    102 })} 
     104})}} 
    103105});var zmiActionPrefix='select_actions_';function zmiActionPopulate(el){if(el.options[el.options.length-1].text.indexOf('---')!=0){return} 
    104106$(document.body).css("cursor","wait");var action=self.location.href;action=action.substr(0,action.indexOf('?')>0?action.substr(0,action.indexOf('?')).lastIndexOf('/'):action.lastIndexOf('/'));var extrapath='';var $anchor=$('a:first',$(el).parents('td')[0]);if($anchor){var anchorpath=$anchor.attr('href');if(typeof anchorpath !='undefined'){var extrapath=anchorpath.split('/');if(extrapath.length > 2){for(var i=0;i < extrapath.length-2;i++){action+='/'+extrapath[i]}} 
  • ZMS/trunk/plugins/www/jquery/plugin/jquery.plugin.extensions.js

    r1753 r1755  
    2020 
    2121$(function(){ 
    22         // Parse params. 
    2322        var href = self.location.href; 
    24         var i = href.indexOf('?'); 
    25         href = href.substr(i+1); 
    26         var l = href.split('&'); 
    27         for ( var j = 0; j < l.length; j++) { 
    28                 i = l[j].indexOf('='); 
    29                 zmiParams[l[j].substr(0,i)] = unescape(l[j].substr(i+1)); 
     23        // Parse params (?) and pseudo-params (#). 
     24        var delimiter_list = ['?','#']; 
     25        for (var h = 0; h < delimiter_list.length; h++) { 
     26                var delimiter = delimiter_list[h]; 
     27                var i = href.indexOf(delimiter); 
     28                if (i > 0) { 
     29                        var query_string = href.substr(i+1); 
     30                        var l = query_string.split('&'); 
     31                        for ( var j = 0; j < l.length; j++) { 
     32                                i = l[j].indexOf('='); 
     33                                if (i < 0) { 
     34                                        break; 
     35                                } 
     36                                if (typeof zmiParams[l[j].substr(0,i)] == "undefined") { 
     37                                        zmiParams[l[j].substr(0,i)] = unescape(l[j].substr(i+1)); 
     38                                } 
     39                        } 
     40                } 
    3041        } 
    3142        // Content-Editable //////////////////////////////////////////////////////// 
  • ZMS/trunk/plugins/www/jquery/plugin/jquery.plugin.zmi.js

    r1753 r1755  
    148148// ############################################################################# 
    149149var zmiAutoSaveTimeout = null; 
    150 var zmiAutoSaveIntervall = 1000; 
     150var zmiAutoSaveIntervall = 10000; 
    151151var zmiAutoChangeArr = {}; 
    152152 
     
    216216 
    217217$(function() { 
    218         $("select.form-element,input.form-element,textarea.form-element,select.form-small,input.form-small,textarea.form-small",$("form.ZMIPropertiesForm")) 
    219                 .keydown( function (evt) { zmiAutoChange(this); }) 
    220                 .keyup( function (evt) { zmiAutoChange(this); }) 
    221                 .click( function (evt) { zmiAutoChange(this); }) 
    222                 .change( function (evt) { zmiAutoChange(this); }) 
    223                 .each(function() { 
    224                                 var elid = $(this).attr("id"); 
    225                                 if (typeof elid != "undefined" && $(this).attr("type") != "file") { 
    226                                         zmiAutoChangeArr[elid] = {'init':$(this).val(),'last':$(this).val()}; 
    227                                 } 
    228                         }) 
    229         ; 
    230         // Read stored temp-form properties. 
    231         if ($("form.ZMIPropertiesForm").length > 0) { 
    232                 $.get("getTempFormProperties",{"lang":zmiParams["lang"],key:self.location.href},function(result) { 
    233                                 var data = eval("("+result+")"); 
    234                                 var modified = false; 
    235                                 if (data) { 
    236                                         for (var i in data) { 
    237                                                 var v = data[i]; 
    238                                                 modified |= $("#"+i).val() != v; 
     218        if (getZMIConfProperty("ZMS.TempFormProperties",1)==1) { 
     219                $("select.form-element,input.form-element,textarea.form-element,select.form-small,input.form-small,textarea.form-small",$("form.ZMIPropertiesForm")) 
     220                        .keydown( function (evt) { zmiAutoChange(this); }) 
     221                        .keyup( function (evt) { zmiAutoChange(this); }) 
     222                        .click( function (evt) { zmiAutoChange(this); }) 
     223                        .change( function (evt) { zmiAutoChange(this); }) 
     224                        .each(function() { 
     225                                        var elid = $(this).attr("id"); 
     226                                        if (typeof elid != "undefined" && $(this).attr("type") != "file") { 
     227                                                zmiAutoChangeArr[elid] = {'init':$(this).val(),'last':$(this).val()}; 
    239228                                        } 
    240                                 } 
    241                                 if (modified) { 
    242                                         if (confirm("Form was closed before without saving pending changes. Do you want to restore form?")) { 
     229                                }) 
     230                ; 
     231                // Read stored temp-form properties. 
     232                if ($("form.ZMIPropertiesForm").length > 0) { 
     233                        $.get("getTempFormProperties",{"lang":zmiParams["lang"],key:self.location.href},function(result) { 
     234                                        var data = eval("("+result+")"); 
     235                                        var modified = false; 
     236                                        if (data) { 
    243237                                                for (var i in data) { 
    244238                                                        var v = data[i]; 
    245                                                         $("#"+i).val(v).addClass("form-element-modified"); 
    246                                                         zmiAutoChangeArr[i]['last'] = v; 
     239                                                        modified |= $("#"+i).val() != v; 
    247240                                                } 
    248241                                        } 
    249                                 } 
    250                         }); 
     242                                        if (modified) { 
     243                                                if (confirm("Form was closed before without saving pending changes. Do you want to restore form?")) { 
     244                                                        for (var i in data) { 
     245                                                                var v = data[i]; 
     246                                                                $("#"+i).val(v).addClass("form-element-modified"); 
     247                                                                zmiAutoChangeArr[i]['last'] = v; 
     248                                                        } 
     249                                                } 
     250                                        } 
     251                                }); 
     252                } 
    251253        } 
    252254}); 
  • ZMS/trunk/zms.py

    r1711 r1755  
    247247  obj.setConfProperty('ZMS.autocommit',1) 
    248248  obj.setConfProperty('ZMS.Version.autopack',2) 
     249  obj.setConfProperty('ZMS.input.file.plugin','ajax_upload') 
     250  obj.setConfProperty('ZMS.TempFormProperties',1) 
    249251   
    250252  ### Init zcatalog. 
Note: See TracChangeset for help on using the changeset viewer.