Changeset 1794
- Timestamp:
- 19.01.2012 22:37:09 (4 months ago)
- Location:
- ZMS/trunk/plugins
- Files:
-
- 3 edited
-
rte/ckeditor/manage_form.dtml (modified) (1 diff)
-
www/jquery/jquery-all.min.js (modified) (1 diff)
-
www/jquery/plugin/jquery.plugin.zmi.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ZMS/trunk/plugins/rte/ckeditor/manage_form.dtml
r1793 r1794 54 54 // Get value from editor. 55 55 var data = CKEDITOR.instances['editor_'+elName].getData(); 56 // Relativate urls. 57 data = zmiRelativateUrls(data); 56 58 // Assign value to textarea. 57 59 $('#'+elName).val( data); -
ZMS/trunk/plugins/www/jquery/jquery-all.min.js
r1784 r1794 91 91 else {$content.show('normal')} 92 92 $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')} 93 })});function confirmChanges(el){if(el&&self.name=='cameFromForm'){el.target='_parent'} 93 })});function zmiRelativateUrl(path,url){var protocol=self.location.href;protocol=protocol.substr(0,protocol.indexOf(":")+3);var server_url=self.location.href;server_url=server_url.substr(protocol.length);server_url=protocol+server_url.substr(0,server_url.indexOf("/"));var currntPath=path;if(currntPath.indexOf(server_url)==0){currntPath=currntPath.substr(server_url.length+1)} 94 else if(currntPath.indexOf('/')==0){currntPath=currntPath.substr(1)} 95 var targetPath=url;if(targetPath.indexOf(server_url)==0){targetPath=targetPath.substr(server_url.length+1)} 96 else if(targetPath.indexOf('/')==0){targetPath=targetPath.substr(1)} 97 while(currntPath.length > 0&&targetPath.length > 0){var i=currntPath.indexOf('/');var j=targetPath.indexOf('/');if(i < 0){currntElmnt=currntPath} 98 else {currntElmnt=currntPath.substring(0,i)} 99 if(j < 0){targetElmnt=targetPath} 100 else {targetElmnt=targetPath.substring(0,j)} 101 if(currntElmnt !=targetElmnt){break} 102 if(i < 0){currntPath=''} 103 else {currntPath=currntPath.substring(i+1)} 104 if(j < 0){targetPath=''} 105 else {targetPath=targetPath.substring(j+1)}} 106 while(currntPath.length > 0){var i=currntPath.indexOf('/');if(i < 0){currntElmnt=currntPath;currntPath=''} 107 else {currntElmnt=currntPath.substring(0,i);currntPath=currntPath.substring(i+1)} 108 targetPath='../'+targetPath} 109 url='./'+targetPath;return url} 110 function zmiRelativateUrls(s){var url0=self.location.href;url0=url0.substr(0,url0.lastIndexOf("/"));var splitTags=['<a href="','<img src="'];for(var j=0;j < splitTags.length;j++){var vSplit=s.split(splitTags[j]);var v=vSplit[0];for(var i=1;i < vSplit.length;i++){var j=vSplit[i].indexOf("\"");var url=vSplit[i].substring(0,j);if(url.indexOf('./')<0){url=zmiRelativateUrl(url0,url)} 111 v+=splitTag+url+vSplit[i].substring(j)} 112 s=v} 113 return s} 114 function confirmChanges(el){if(el&&self.name=='cameFromForm'){el.target='_parent'} 94 115 if(navigator.platform.indexOf("Mac")<0){var anyFormModified=false;for(i=0;i<document.forms.length;i++){anyFormModified|=isFormModified(document.forms[i])} 95 116 if(anyFormModified){if(!confirm(getZMILangStr('MSG_CONFIRM_DISCARD_CHANGES'))){return false}}} -
ZMS/trunk/plugins/www/jquery/plugin/jquery.plugin.zmi.js
r1756 r1794 143 143 }); 144 144 145 // ############################################################################# 146 // ### ZMI Pathcropping 147 // ############################################################################# 148 149 150 function zmiRelativateUrl(path, url) { 151 var protocol = self.location.href; 152 protocol = protocol.substr(0,protocol.indexOf(":")+3); 153 var server_url = self.location.href; 154 server_url = server_url.substr(protocol.length); 155 server_url = protocol + server_url.substr(0,server_url.indexOf("/")); 156 var currntPath = path; 157 if (currntPath.indexOf(server_url)==0) { 158 currntPath = currntPath.substr(server_url.length+1); 159 } 160 else if (currntPath.indexOf('/')==0) { 161 currntPath = currntPath.substr(1); 162 } 163 var targetPath = url; 164 if (targetPath.indexOf(server_url)==0) { 165 targetPath = targetPath.substr(server_url.length+1); 166 } 167 else if (targetPath.indexOf('/')==0) { 168 targetPath = targetPath.substr(1); 169 } 170 while ( currntPath.length > 0 && targetPath.length > 0) { 171 var i = currntPath.indexOf( '/'); 172 var j = targetPath.indexOf( '/'); 173 if ( i < 0) { 174 currntElmnt = currntPath; 175 } 176 else { 177 currntElmnt = currntPath.substring( 0, i); 178 } 179 if ( j < 0) { 180 targetElmnt = targetPath; 181 } 182 else { 183 targetElmnt = targetPath.substring( 0, j); 184 } 185 if ( currntElmnt != targetElmnt) { 186 break; 187 } 188 if ( i < 0) { 189 currntPath = ''; 190 } 191 else { 192 currntPath = currntPath.substring( i + 1); 193 } 194 if ( j < 0) { 195 targetPath = ''; 196 } 197 else { 198 targetPath = targetPath.substring( j + 1); 199 } 200 } 201 while ( currntPath.length > 0) { 202 var i = currntPath.indexOf( '/'); 203 if ( i < 0) { 204 currntElmnt = currntPath; 205 currntPath = ''; 206 } 207 else { 208 currntElmnt = currntPath.substring( 0, i); 209 currntPath = currntPath.substring( i + 1); 210 } 211 targetPath = '../' + targetPath; 212 } 213 url = './' + targetPath; 214 return url; 215 } 216 217 function zmiRelativateUrls(s) { 218 var url0 = self.location.href; 219 url0 = url0.substr(0,url0.lastIndexOf("/")); 220 var splitTags = ['<a href="','<img src="']; 221 for ( var j = 0; j < splitTags.length; j++) { 222 var vSplit = s.split(splitTags[j]); 223 var v = vSplit[0]; 224 for ( var i = 1; i < vSplit.length; i++) { 225 var j = vSplit[i].indexOf("\""); 226 var url = vSplit[i].substring(0,j); 227 if (url.indexOf('./')<0) { 228 url = zmiRelativateUrl(url0,url); 229 } 230 v += splitTag + url + vSplit[i].substring(j); 231 } 232 s = v; 233 } 234 return s; 235 } 145 236 146 237 // #############################################################################
Note: See TracChangeset
for help on using the changeset viewer.
