Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php |
— | — | @@ -379,7 +379,7 @@ |
380 | 380 | // even if there are more |
381 | 381 | if ( $found_instance ) { |
382 | 382 | $matches = array(); |
383 | | - $search_pattern = '/{{' . $search_template_str . '\s*[\|}]/i'; |
| 383 | + $search_pattern = '/{{' . $preg_match_template_str . '\s*[\|}]/i'; |
384 | 384 | $content_str = str_replace( '_', ' ', $existing_page_content ); |
385 | 385 | preg_match($search_pattern, $content_str, $matches, PREG_OFFSET_CAPTURE); |
386 | 386 | // is this check necessary? |
Index: trunk/extensions/SemanticForms/libs/SF_ajax_form_preview.js |
— | — | @@ -134,7 +134,12 @@ |
135 | 135 | |
136 | 136 | if (aj2.readyState != 4) return; |
137 | 137 | |
138 | | - htm = aj2.responseText.replace(/>/g,'>').replace(/</g,'<').replace(/"/g,'"').replace(/&/g,'&').replace(/'/g,"'"); |
| 138 | + htm = aj2.responseText.replace(/>/g,'>') |
| 139 | + .replace(/</g,'<') |
| 140 | + .replace(/"/g,'"') |
| 141 | + .replace(/&/g,'&') |
| 142 | + .replace(/'/g,"'") |
| 143 | + .replace("</body>", "<span id='SF_PREVIEW_EOD'/></body>"); |
139 | 144 | |
140 | 145 | ifr = document.createElement('iframe'); |
141 | 146 | ifr.onload="alert('load')"; |
— | — | @@ -164,18 +169,18 @@ |
165 | 170 | |
166 | 171 | doc.open(); |
167 | 172 | doc.write(htm); |
168 | | - doc.close(); |
| 173 | + doc.close(); |
169 | 174 | |
170 | 175 | interval=setInterval(function(){ |
171 | 176 | |
| 177 | + if ( ! doc.getElementById("SF_PREVIEW_EOD") ) return; |
| 178 | + |
172 | 179 | var visible = null; |
173 | 180 | |
174 | 181 | visible = doc.getElementById("wikiPreview"); |
175 | 182 | |
176 | | - if (!visible) return; |
| 183 | + clearInterval(interval); |
177 | 184 | |
178 | | - clearInterval(interval); |
179 | | - |
180 | 185 | var currentfr=document.getElementById('ifrPreview'); |
181 | 186 | |
182 | 187 | if (currentfr && !window.opera){ |
— | — | @@ -214,9 +219,11 @@ |
215 | 220 | |
216 | 221 | visible = visible.parentNode; |
217 | 222 | } |
218 | | - |
219 | | - currentfr.style.height = " " + doc.body.scrollHeight + "px"; |
220 | 223 | |
| 224 | + doc.getElementById('content').style.background = "none white"; |
| 225 | + |
| 226 | + currentfr.style.height = " " + vish + "px"; |
| 227 | + |
221 | 228 | window.scrollTo(currentfr.offsetLeft, currentfr.offsetTop); |
222 | 229 | document.body.style.cursor = ''; |
223 | 230 | |