diff --git a/lib/parchment.min.js b/lib/parchment.min.js index 1e7f67f5..4258fe6e 100644 --- a/lib/parchment.min.js +++ b/lib/parchment.min.js @@ -3,7 +3,7 @@ Parchment ========= -Built: 2011-05-01 +Built: 2011-05-02 Copyright (c) 2008-2011 The Parchment Contributors BSD licenced @@ -15,4 +15,4 @@ jQuery.ajaxSetup({cache:1,converters:{"* binary":true}});jQuery.ajaxPrefilter("s * Taken from "Remedial Javascript" by Douglas Crockford: * http://javascript.crockford.com/remedial.html */ -function typeOf(b){var a=typeof b;if(a==="object"){if(b){if(typeof b.length==="number"&&!(b.propertyIsEnumerable("length"))&&typeof b.splice==="function"){a="array"}}else{a="null"}}return a}function isEmpty(c){var b,a;if(typeOf(c)==="object"){for(b in c){a=c[b];if(a!==undefined&&typeOf(a)!=="function"){return false}}}return true}String.prototype.entityify=function(){return this.replace(/&/g,"&").replace(//g,">")};String.prototype.quote=function(){var e,b,a=this.length,d='"';for(b=0;b=" "){if(e==="\\"||e==='"'){d+="\\"}d+=e}else{switch(e){case"\b":d+="\\b";break;case"\f":d+="\\f";break;case"\n":d+="\\n";break;case"\r":d+="\\r";break;case"\t":d+="\\t";break;default:e=e.charCodeAt();d+="\\u00"+Math.floor(e/16).toString(16)+(e%16).toString(16)}}}return d+'"'};String.prototype.supplant=function(a){return this.replace(/{([^{}]*)}/g,function(d,c){var e=a[c];return typeof e==="string"||typeof e==="number"?e:d})};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};(function(a){window.FatalError=function(b){this.message=b;this.traceback=this._makeTraceback(arguments.callee);this.onError(this);if(a(".load").length>0){a(".load").detach()}};FatalError.prototype={onError:function(c){var b=c.message;if(typeof c.message=="string"){b=b.entityify()}a("#parchment").append('
An error occurred:
'+b+"\n\n"+c.traceback+"
");if(window.console){console.error(b)}},_makeTraceback:function(b){var f="";var d=0;var c=100;while(b!=null&&d4,a=function(q,r){var r=r||[],p=0,o;for(o=q.length%8;p>4);q=((x&15)<<4)+(w>>2);p=((w&3)<<6)+v;r.push(u,q,p)}if(v==64){r.pop()}if(w==64){r.pop()}return r},i=function(t,r){if(g.btoa){return btoa(l(t,r))}var r=r||"",u,q,p,y,x,w,v,s=0,o=t.length;while(s>2;x=((u&3)<<4)+(q>>4);w=((q&15)<<2)+(p>>6);v=p&63;r+=(h.charAt(y)+h.charAt(x)+h.charAt(w)+h.charAt(v))}if(isNaN(q)){r=r.slice(0,-2)+"=="}else{if(isNaN(p)){r=r.slice(0,-1)+"="}}return r},j=function(t){var u=VBCStr(t),s=VBLastAsc(t),o=[],q=0,p=u.length%4,r;while(q>8)}p=u.length;while(q>8,(r=u.charCodeAt(q++))&255,r>>8,(r=u.charCodeAt(q++))&255,r>>8,(r=u.charCodeAt(q++))&255,r>>8)}if(s>-1){o.push(s)}return o},m=jQuery.ajaxSettings.xhr(),k={binary:m.overrideMimeType&&!(e.browser.opera&&parseFloat(e.browser.version)<10.5)?"charset":"responseBody" in m?"responseBody":0},n=function(q,t,p){var s,o,r;q=e.trim(q);if(p.mode=="base64"){if(g.atob){r=atob(q);s=a(r)}else{s=b(q)}}else{if(p.mode=="charset"){s=a(q)}else{s=j(p.xhr.responseBody)}}p.responseArray=s;p.responseText=r};m=undefined;e.ajaxPrefilter("binary",function(p,s,q){var r=p.isLocal&&!p.crossDomain&&d?0:k.binary,o=p.xhr;p.xhr=function(){return q.xhr=o.apply(p)};p.binary=r;q.done(n);p.jsonp=false;p.jsonpCallback="processBase64Zcode";q.mode="base64";if(p.url.slice(-3).toLowerCase()==".js"){return"jsonp"}if(r&&!p.crossDomain){return"text"}if(p.legacy){p.url=p.legacy;return"jsonp"}p.data="url="+p.url;p.url=parchment.options.proxy_url;if(r&&e.support.cors){return"text"}p.data+="&encode=base64&callback=pproxy";p.jsonpCallback="pproxy";return"jsonp"});e.ajaxPrefilter("text",function(o,q,p){p.mode=o.binary;if(p.mode=="charset"){o.mimeType="text/plain; charset=x-user-defined"}});g.file={text_to_array:a,array_to_text:l,base64_decode:b,base64_encode:i,support:k}})(window,jQuery);(function(b){var d=this,a=b(d),j=b(document),c=b("body"),g=/iPhone|iPod|iPad|Android/i,k=/\S/,e=d.scrollByPages||function(m){var l=j[0].documentElement.clientHeight,n=l-Math.min(l/10,parseInt(c.css("line-height"))*2);scrollBy(0,n*m)},i=d.getSelection||(document.selection&&function(){return document.selection.createRange().text})||function(){return""},f='

'+l.desc.entityify()+"

"};d.gIsIphone=g.test(navigator.userAgent);if(b.browser.msie&&parseInt(b.browser.version)<7){b(function(){var m=b("#top-window"),l=function(){m.style.top=document.documentElement.scrollTop+"px"};m.css("position","absolute").resize(l).scroll(l)})}parchment.lib.UI=Object.subClass({init:function(l){this.library=l;this.panels={};this.load_indicator=b('

Parchment is loading.

> _

')},stylesheet_add:function(){var l=arguments,m;for(m=1;m",{rel:"alternate stylesheet",href:l[m],title:l[0],type:"text/css"}).appendTo("head")[0].disabled=true}}},stylesheet_switch:function(m,l){b('link[rel*="stylesheet"][title="'+m+'"]').each(function(){this.disabled=!l})},load_panels:function(){var l=parchment.options.panels,p,o,n,m=function(){var r=RegExp(o.val().replace(" ","( )?"),"i"),q=b.grep(p,function(s){return r.test(s.path+s.desc)});q=q.slice(0,30);n.html(b.map(q,h).join(""))};if(b.inArray("search",l)!=-1){this.panels.search=b('');o=this.panels.search.find("input");n=o.next();o.keydown(function(){o.unbind("keydown");b.getJSON("stories/if-archive.json").done(function(q){p=q;o.keyup(m);m()})})}if(b.inArray("url",l)!=-1){this.panels.url=b('
')}this.library.container.append(this.panels[l[0]]);this.panels.active=l[0]}});parchment.lib.TextInput=Object.subClass({init:function(l,q,n){var m=this,l=b(l),q=b(q),p=b("",{autocapitalize:"off",keydown:function(s){var t=s.which,r;if(t==38){m.prev_next(1);r=1}if(t==40){m.prev_next(-1);r=1}if(t==33){e(-1);r=1}if(t==34){e(1);r=1}s.stopPropagation();if(r){return false}}}),o=b("",{"class":"CharInput",keydown:function(r){m.keyCode=r.which},keypress:function(r){m.charCode=r.which;m.submitChar();return false},keyup:function(r){m.submitChar()}});m.form=b("
",{"class":"LineInput",submit:function(){m.submitLine();return false}}).append(p);j.bind("click.TextInput keydown.TextInput",function(r){if(r.target.nodeName!="INPUT"&&i()==""&&a.scrollTop()+a.height()-p.offset().top>-60){b(".LineInput input, .CharInput").focus().trigger(r)}});m.history=[];q.parents().each(function(){var r=b(this),s=r.css("overflow-y");if(s=="scroll"||s=="auto"){m.scrollParent=r;return false}});m.container=l;m.stream=q;m.topwindow=b(n);m.lineInput=p;m.charInput=o},die:function(){j.unbind(".TextInput")},getLine:function(r,o){var n=this,l=n.stream.children().last(),m=n.lineInput,p=b(".finished-input").last(),q=n.scrollParent;n.callback=r||b.noop;n.current=0;n.mutable_history=n.history.slice();n.mutable_history.unshift("");n.style=o||"";m.width(n.stream.width()-l.width()-1).val("").addClass(n.style);l.append(n.form);if(p.length){q.scrollTop(p.offset().top-q.offset().top-q.scrollTop()-this.topwindow.height()-10)}},submitLine:function(){var l=this,m=l.lineInput.val();l.form.detach();l.lineInput.removeClass(l.style);b(''+m.entityify()+"
").appendTo(l.stream.children().last());if(m!=l.history[0]&&k.test(m)){l.history.unshift(m)}j.trigger({type:"LineInput",input:m});l.callback(m)},prev_next:function(q){var m=this,l=m.lineInput,n=m.mutable_history,o=m.current,p=o+q;if(p=0){n[o]=l.val();l.val(n[p]);m.current=p}},getChar:function(n){var m=this,l=m.charInput;m.callback=n||b.noop;m.keyCode=m.charCode=0;m.container.append(l);setTimeout(function(){l.focus()},1)},submitChar:function(){var n=this,o=n.keyCode,l=n.charCode,m={keyCode:o,charCode:l};if(!o&&!l){return}n.charInput.detach();j.trigger({type:"CharInput",input:m});n.callback(m)}})})(jQuery);(function(g,d){var a=/story=([^;&]+)/,h=/vm=(\w+)/,i=/([-\w\s_]+)(\.[\w]+(\.js)?)?$/,k=/\.js$/,e=function(){throw new FatalError("Parchment could not load load the story. Check your connection, and that the URL is correct.")};parchment.lib.Story=IFF.subClass({init:function j(r,n){this.title=n;if(r[0]<9){this._super();this.chunks.push({type:"ZCOD",data:r});this.zcode=r}else{if(IFF.text_from(r,0)=="Glul"){this._super();this.chunks.push({type:"GLUL",data:r});this.glulx=r}else{if(IFF.text_from(r,0)=="FORM"){this._super(r);if(this.type=="IFRS"){for(var p=0,m=this.chunks.length;p
This should not be visible
12345678
12345678
12345678
12345678
');if(jQuery(".load").length>0){jQuery(".load").detach()}Quixe.prepare(c.glulx,e);Glk.init(e)}};parchment.vms.push(parchment.vms.quixe);parchment.vms.gnusto={id:"gnusto",match:/(z[1-8]|zlb|(z|zcode.+)(blorb|blb))(.js)?$/i,files:["gnusto.min.js","zmachine.min.js"],launcher:function(c){var h=window.console&&function(i){console.log(i)}||function(){},g=c[2],d=new GnustoEngine(h),b=new parchment.lib.ZUI(g.library,d,h),f=new EngineRunner(d,b,h),e=new parchment.lib.Story(g.responseArray,storyName),a=location.hash;h("Story type: "+e.filetype);e.load(d);if(a&&a!="#"){d.loadSavedGame(file.base64_decode(a.slice(1)));h("Loading savefile")}f.run()}};parchment.vms.push(parchment.vms.gnusto);(function(a,b){var c=a.parchment;b(function(){var e=/options=([^;&]+)/.exec(location.search),d;if(a.parchment_options){b.extend(c.options,parchment_options)}if(!c.options.lock_options&&e){b.extend(c.options,b.parseJSON(unescape(e[1])))}d=new c.lib.Library();c.library=d;d.load();if(location.href.indexOf("iplayif.com")!=-1){b.getScript("http://google-analytics.com/ga.js",function(){_gat._getTracker("UA-7949545-3")._trackPageview()})}})})(this,jQuery); \ No newline at end of file +function typeOf(b){var a=typeof b;if(a==="object"){if(b){if(typeof b.length==="number"&&!(b.propertyIsEnumerable("length"))&&typeof b.splice==="function"){a="array"}}else{a="null"}}return a}function isEmpty(c){var b,a;if(typeOf(c)==="object"){for(b in c){a=c[b];if(a!==undefined&&typeOf(a)!=="function"){return false}}}return true}String.prototype.entityify=function(){return this.replace(/&/g,"&").replace(//g,">")};String.prototype.quote=function(){var e,b,a=this.length,d='"';for(b=0;b=" "){if(e==="\\"||e==='"'){d+="\\"}d+=e}else{switch(e){case"\b":d+="\\b";break;case"\f":d+="\\f";break;case"\n":d+="\\n";break;case"\r":d+="\\r";break;case"\t":d+="\\t";break;default:e=e.charCodeAt();d+="\\u00"+Math.floor(e/16).toString(16)+(e%16).toString(16)}}}return d+'"'};String.prototype.supplant=function(a){return this.replace(/{([^{}]*)}/g,function(d,c){var e=a[c];return typeof e==="string"||typeof e==="number"?e:d})};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};(function(a){window.FatalError=function(b){this.message=b;this.traceback=this._makeTraceback(arguments.callee);this.onError(this);if(a(".load").length>0){a(".load").detach()}};FatalError.prototype={onError:function(c){var b=c.message;if(typeof c.message=="string"){b=b.entityify()}a("#parchment").append('
An error occurred:
'+b+"\n\n"+c.traceback+"
");if(window.console){console.error(b)}},_makeTraceback:function(b){var f="";var d=0;var c=100;while(b!=null&&d4,a=function(q,r){var r=r||[],p=0,o;for(o=q.length%8;p>4);q=((x&15)<<4)+(w>>2);p=((w&3)<<6)+v;r.push(u,q,p)}if(v==64){r.pop()}if(w==64){r.pop()}return r},i=function(t,r){if(g.btoa){return btoa(l(t,r))}var r=r||"",u,q,p,y,x,w,v,s=0,o=t.length;while(s>2;x=((u&3)<<4)+(q>>4);w=((q&15)<<2)+(p>>6);v=p&63;r+=(h.charAt(y)+h.charAt(x)+h.charAt(w)+h.charAt(v))}if(isNaN(q)){r=r.slice(0,-2)+"=="}else{if(isNaN(p)){r=r.slice(0,-1)+"="}}return r},j=function(t){var u=VBCStr(t),s=VBLastAsc(t),o=[],q=0,p=u.length%4,r;while(q>8)}p=u.length;while(q>8,(r=u.charCodeAt(q++))&255,r>>8,(r=u.charCodeAt(q++))&255,r>>8,(r=u.charCodeAt(q++))&255,r>>8)}if(s>-1){o.push(s)}return o},m=jQuery.ajaxSettings.xhr(),k={binary:m.overrideMimeType&&!(e.browser.opera&&parseFloat(e.browser.version)<10.5)?"charset":"responseBody" in m?"responseBody":0},n=function(q,t,p){var s,o,r;q=e.trim(q);if(p.mode=="base64"){if(g.atob){r=atob(q);s=a(r)}else{s=b(q)}}else{if(p.mode=="charset"){s=a(q)}else{s=j(p.xhr.responseBody)}}p.responseArray=s;p.responseText=r};m=undefined;e.ajaxPrefilter("binary",function(p,s,q){var r=p.isLocal&&!p.crossDomain&&d?0:k.binary,o=p.xhr;p.xhr=function(){return q.xhr=o.apply(p)};p.binary=r;q.done(n);p.jsonp=false;p.jsonpCallback="processBase64Zcode";q.mode="base64";if(p.url.slice(-3).toLowerCase()==".js"){return"jsonp"}if(r&&!p.crossDomain){return"text"}if(p.legacy){p.url=p.legacy;return"jsonp"}p.data="url="+p.url;p.url=parchment.options.proxy_url;if(r&&e.support.cors){return"text"}p.data+="&encode=base64&callback=pproxy";p.jsonpCallback="pproxy";return"jsonp"});e.ajaxPrefilter("text",function(o,q,p){p.mode=o.binary;if(p.mode=="charset"){o.mimeType="text/plain; charset=x-user-defined"}});g.file={text_to_array:a,array_to_text:l,base64_decode:b,base64_encode:i,support:k}})(window,jQuery);(function(b){var d=this,a=b(d),j=b(document),c,g=/iPhone|iPod|iPad|Android/i,k=/\S/,e=d.scrollByPages||function(m){var l=j[0].documentElement.clientHeight,n=l-Math.min(l/10,parseInt(c.css("line-height"))*2);scrollBy(0,n*m)},i=d.getSelection||(document.selection&&function(){return document.selection.createRange().text})||function(){return""},f='

'+l.desc.entityify()+"

"};b(function(){c=b("body")});d.gIsIphone=g.test(navigator.userAgent);if(b.browser.msie&&parseInt(b.browser.version)<7){b(function(){var m=b("#top-window"),l=function(){m.style.top=document.documentElement.scrollTop+"px"};m.css("position","absolute").resize(l).scroll(l)})}parchment.lib.UI=Object.subClass({init:function(l){this.library=l;this.panels={};this.load_indicator=b('

Parchment is loading.

> _

')},stylesheet_add:function(){var l=arguments,m;for(m=1;m",{rel:"alternate stylesheet",href:l[m],title:l[0],type:"text/css"}).appendTo("head")[0].disabled=true}}},stylesheet_switch:function(m,l){b('link[rel*="stylesheet"][title="'+m+'"]').each(function(){this.disabled=!l})},load_panels:function(){var l=parchment.options.panels,p,o,n,m=function(){var r=RegExp(o.val().replace(" ","( )?"),"i"),q=b.grep(p,function(s){return r.test(s.path+s.desc)});q=q.slice(0,30);n.html(b.map(q,h).join(""))};if(b.inArray("search",l)!=-1){this.panels.search=b('');o=this.panels.search.find("input");n=o.next();o.keydown(function(){o.unbind("keydown");b.getJSON("stories/if-archive.json").done(function(q){p=q;o.keyup(m);m()})})}if(b.inArray("url",l)!=-1){this.panels.url=b('')}this.library.container.append(this.panels[l[0]]);this.panels.active=l[0]}});parchment.lib.TextInput=Object.subClass({init:function(l,q,n){var m=this,p=b("",{autocapitalize:"off",keydown:function(s){var t=s.which,r;if(t==38){m.prev_next(1);r=1}if(t==40){m.prev_next(-1);r=1}if(t==33){e(-1);r=1}if(t==34){e(1);r=1}s.stopPropagation();if(r){return false}}}),o=b("",{"class":"CharInput",keydown:function(r){m.keyCode=r.which},keypress:function(r){m.charCode=r.which;m.submitChar();return false},keyup:function(r){m.submitChar()}});m.form=b("
",{"class":"LineInput",submit:function(){m.submitLine();return false}}).append(p);j.bind("click.TextInput keydown.TextInput",function(r){if(r.target.nodeName!="INPUT"&&i()==""&&a.scrollTop()+a.height()-p.offset().top>-60){b(".LineInput input, .CharInput").focus().trigger(r)}});m.history=[];m.lineInput=p;m.charInput=o;m.container=b(l);m.stream=b(q);m.topwindow=b(n);m.scrollParent=b.browser.webkit?c:b("html")},die:function(){j.unbind(".TextInput")},getLine:function(r,o){var n=this,l=n.stream.children().last(),m=n.lineInput,p=b(".finished-input").last(),q=n.scrollParent;n.callback=r||b.noop;n.current=0;n.mutable_history=n.history.slice();n.mutable_history.unshift("");n.style=o||"";m.width(n.stream.width()-l.width()-1).val("").addClass(n.style);l.append(n.form);if(p.length){q.scrollTop(p.offset().top-this.topwindow.height()-p.height())}},submitLine:function(){var l=this,m=l.lineInput.val();l.form.detach();l.lineInput.removeClass(l.style);b(''+m.entityify()+"
").appendTo(l.stream.children().last());if(m!=l.history[0]&&k.test(m)){l.history.unshift(m)}j.trigger({type:"LineInput",input:m});l.callback(m)},prev_next:function(q){var m=this,l=m.lineInput,n=m.mutable_history,o=m.current,p=o+q;if(p=0){n[o]=l.val();l.val(n[p]);m.current=p}},getChar:function(n){var m=this,l=m.charInput;m.callback=n||b.noop;m.keyCode=m.charCode=0;m.container.append(l);setTimeout(function(){l.focus()},1)},submitChar:function(){var n=this,o=n.keyCode,l=n.charCode,m={keyCode:o,charCode:l};if(!o&&!l){return}n.charInput.detach();j.trigger({type:"CharInput",input:m});n.callback(m)}})})(jQuery);(function(g,d){var a=/story=([^;&]+)/,h=/vm=(\w+)/,i=/([-\w\s_]+)(\.[\w]+(\.js)?)?$/,k=/\.js$/,e=function(){throw new FatalError("Parchment could not load load the story. Check your connection, and that the URL is correct.")};parchment.lib.Story=IFF.subClass({init:function j(r,n){this.title=n;if(r[0]<9){this._super();this.chunks.push({type:"ZCOD",data:r});this.zcode=r}else{if(IFF.text_from(r,0)=="Glul"){this._super();this.chunks.push({type:"GLUL",data:r});this.glulx=r}else{if(IFF.text_from(r,0)=="FORM"){this._super(r);if(this.type=="IFRS"){for(var p=0,m=this.chunks.length;p
This should not be visible
12345678
12345678
12345678
12345678
');if(jQuery(".load").length>0){jQuery(".load").detach()}Quixe.prepare(c.glulx,e);Glk.init(e)}};parchment.vms.push(parchment.vms.quixe);parchment.vms.gnusto={id:"gnusto",match:/(z[1-8]|zlb|(z|zcode.+)(blorb|blb))(.js)?$/i,files:["gnusto.min.js","zmachine.min.js"],launcher:function(c){var h=window.console&&function(i){console.log(i)}||function(){},g=c[2],d=new GnustoEngine(h),b=new parchment.lib.ZUI(g.library,d,h),f=new EngineRunner(d,b,h),e=new parchment.lib.Story(g.responseArray,storyName),a=location.hash;h("Story type: "+e.filetype);e.load(d);if(a&&a!="#"){d.loadSavedGame(file.base64_decode(a.slice(1)));h("Loading savefile")}f.run()}};parchment.vms.push(parchment.vms.gnusto);(function(a,b){var c=a.parchment;b(function(){var e=/options=([^;&]+)/.exec(location.search),d;if(a.parchment_options){b.extend(c.options,parchment_options)}if(!c.options.lock_options&&e){b.extend(c.options,b.parseJSON(unescape(e[1])))}d=new c.lib.Library();c.library=d;d.load();if(location.href.indexOf("iplayif.com")!=-1){b.getScript("http://google-analytics.com/ga.js",function(){_gat._getTracker("UA-7949545-3")._trackPageview()})}})})(this,jQuery); \ No newline at end of file diff --git a/src/parchment/ui.js b/src/parchment/ui.js index 5b83c657..7341a2a2 100644 --- a/src/parchment/ui.js +++ b/src/parchment/ui.js @@ -23,7 +23,7 @@ var window = this, // Wrap window, document and body $window = $( window ), doc = $( document ), -body = $( 'body' ), +body, // Set below // Cached regexs rmobileua = /iPhone|iPod|iPad|Android/i, @@ -51,6 +51,11 @@ map_results_callback = function( story ) return results_link + story.path + '">' + story.desc.entityify() + '

'; }; +// Set the body variable once the document is loaded +$(function(){ + body = $( 'body' ); +}); + window.gIsIphone = rmobileua.test( navigator.userAgent ); // Make the statusline always move to the top of the screen in MSIE < 7 @@ -177,8 +182,6 @@ parchment.lib.TextInput = Object.subClass({ init: function( container, stream, topwindow ) { var self = this, - container = $( container ), - stream = $( stream ), // The line input element lineInput = $( '', { @@ -277,23 +280,16 @@ parchment.lib.TextInput = Object.subClass({ self.history = []; // current and mutable_history are set in .get() - // Find the element which we calculate scroll offsets from - stream.parents() - .each( function(){ - var $this = $( this ), - overflow = $this.css( 'overflow-y' ); - if ( overflow == 'scroll' || overflow == 'auto' ) - { - self.scrollParent = $this; - return false; - } - }); - - self.container = container; - self.stream = stream; - self.topwindow = $( topwindow ); self.lineInput = lineInput; self.charInput = charInput; + + self.container = $( container ); + self.stream = $( stream ); + self.topwindow = $( topwindow ); + + // Find the element which we calculate scroll offsets from + // For now just decide by browser + self.scrollParent = $.browser.webkit ? body : $( 'html' ); }, // Cleanup so we can deconstruct @@ -334,14 +330,12 @@ parchment.lib.TextInput = Object.subClass({ if ( lastInput.length ) { scrollParent.scrollTop( - // The last input relative to document + // The last input relative to the top of the document lastInput.offset().top - // Minus the scroll parent relative to document - - scrollParent.offset().top - scrollParent.scrollTop() // Minus the height of the top window - this.topwindow.height() - // Minus a little bit more - - 10 + // Minus one further line + - lastInput.height() ); } }, diff --git a/tests/iframetest.html b/tests/iframetest.html new file mode 100644 index 00000000..a2d16ab2 --- /dev/null +++ b/tests/iframetest.html @@ -0,0 +1,18 @@ + + + +

paragraph +

paragraph +

paragraph +

paragraph +

paragraph +

paragraph +

paragraph +

paragraph

+ +

paragraph

+

paragraph

+

paragraph

+

paragraph

+

paragraph

+

paragraph

\ No newline at end of file