diff --git a/ChangeLog b/ChangeLog index 90292f788..598effd73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2012-03-04 Alexandre Duret-Lutz + + ltl2tgba.html: save state in URL to preserve history + + * wrap/python/ajax/js/jquery.ba-bbq.min.js: New file. + * wrap/python/ajax/Makefile.am: Distribute it. + * wrap/python/ajax/ltl2tgba.html: Include it, and + Adjust the code to update the URL's hash fragment, + and to read it. + 2012-03-04 Alexandre Duret-Lutz python: fix return value of emptiness_check_instantiator diff --git a/NEWS b/NEWS index a64832ec5..572241abf 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ New in spot 0.8.2a: * Support for both Python 2.x and Python 3.x. (Previous versions would only work with Python 2.x.) + * The online ltl2tgba.html now stores its state in the URL so that + history is preserved, and links to particular setups can be sent. * Bug fixes: - Fix a segfault in the compression code used by the -Z option of dve2check. diff --git a/wrap/python/ajax/Makefile.am b/wrap/python/ajax/Makefile.am index bd360e9de..c176b16be 100644 --- a/wrap/python/ajax/Makefile.am +++ b/wrap/python/ajax/Makefile.am @@ -1,6 +1,7 @@ -## Copyright (C) 2011 Laboratoire d'Informatique de Paris 6 (LIP6), -## département Systèmes Répartis Coopératifs (SRC), Université Pierre -## et Marie Curie. +## -*- encoding: utf-8 -*- +## Copyright (C) 2011, 2012 Laboratoire d'Informatique de Paris 6 +## (LIP6), département Systèmes Répartis Coopératifs (SRC), Université +## Pierre et Marie Curie. ## ## This file is part of Spot, a model checking library. ## @@ -21,9 +22,9 @@ nodist_noinst_SCRIPTS = spot.py EXTRA_DIST = $(srcdir)/spot.in README ltl2tgba.html css/ltl2tgba.css \ - css/tipTip.css js/jquery.tipTip.minified.js logos/lip6sys64.png \ - logos/lrde64.png logos/spot64s.png logos/mail.png \ - css/ui-lightness/jquery-ui-1.8.13.custom.css \ + css/tipTip.css js/jquery.tipTip.minified.js js/jquery.ba-bbq.min.js \ + logos/lip6sys64.png logos/lrde64.png logos/spot64s.png \ + logos/mail.png css/ui-lightness/jquery-ui-1.8.13.custom.css \ css/ui-lightness/images/ui-icons_222222_256x240.png \ css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png \ css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png \ @@ -37,7 +38,7 @@ EXTRA_DIST = $(srcdir)/spot.in README ltl2tgba.html css/ltl2tgba.css \ css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png \ css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png \ css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png \ - css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png \ + css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png \ protocol.txt CLEANFILES = $(nodist_noinst_SCRIPTS) diff --git a/wrap/python/ajax/js/jquery.ba-bbq.min.js b/wrap/python/ajax/js/jquery.ba-bbq.min.js new file mode 100644 index 000000000..80de36f1c --- /dev/null +++ b/wrap/python/ajax/js/jquery.ba-bbq.min.js @@ -0,0 +1,18 @@ +/* + * jQuery BBQ: Back Button & Query Library - v1.3pre - 8/26/2010 + * http://benalman.com/projects/jquery-bbq-plugin/ + * + * Copyright (c) 2010 "Cowboy" Ben Alman + * Dual licensed under the MIT and GPL licenses. + * http://benalman.com/about/license/ + */ +(function($,r){var h,n=Array.prototype.slice,t=decodeURIComponent,a=$.param,j,c,m,y,b=$.bbq=$.bbq||{},s,x,k,e=$.event.special,d="hashchange",B="querystring",F="fragment",z="elemUrlAttr",l="href",w="src",p=/^.*\?|#.*$/g,u,H,g,i,C,E={};function G(I){return typeof I==="string"}function D(J){var I=n.call(arguments,1);return function(){return J.apply(this,I.concat(n.call(arguments)))}}function o(I){return I.replace(H,"$2")}function q(I){return I.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(K,P,I,L,J){var R,O,N,Q,M;if(L!==h){N=I.match(K?H:/^([^#?]*)\??([^#]*)(#?.*)/);M=N[3]||"";if(J===2&&G(L)){O=L.replace(K?u:p,"")}else{Q=m(N[2]);L=G(L)?m[K?F:B](L):L;O=J===2?L:J===1?$.extend({},L,Q):$.extend({},Q,L);O=j(O);if(K){O=O.replace(g,t)}}R=N[1]+(K?C:O||!N[1]?"?":"")+O+M}else{R=P(I!==h?I:location.href)}return R}a[B]=D(f,0,q);a[F]=c=D(f,1,o);a.sorted=j=function(J,K){var I=[],L={};$.each(a(J,K).split("&"),function(P,M){var O=M.replace(/(?:%5B|=).*$/,""),N=L[O];if(!N){N=L[O]=[];I.push(O)}N.push(M)});return $.map(I.sort(),function(M){return L[M]}).join("&")};c.noEscape=function(J){J=J||"";var I=$.map(J.split(""),encodeURIComponent);g=new RegExp(I.join("|"),"g")};c.noEscape(",/");c.ajaxCrawlable=function(I){if(I!==h){if(I){u=/^.*(?:#!|#)/;H=/^([^#]*)(?:#!|#)?(.*)$/;C="#!"}else{u=/^.*#/;H=/^([^#]*)#?(.*)$/;C="#"}i=!!I}return i};c.ajaxCrawlable(0);$.deparam=m=function(L,I){var K={},J={"true":!0,"false":!1,"null":null};$.each(L.replace(/\+/g," ").split("&"),function(O,T){var N=T.split("="),S=t(N[0]),M,R=K,P=0,U=S.split("]["),Q=U.length-1;if(/\[/.test(U[0])&&/\]$/.test(U[Q])){U[Q]=U[Q].replace(/\]$/,"");U=U.shift().split("[").concat(U);Q=U.length-1}else{Q=0}if(N.length===2){M=t(N[1]);if(I){M=M&&!isNaN(M)?+M:M==="undefined"?h:J[M]!==h?J[M]:M}if(Q){for(;P<=Q;P++){S=U[P]===""?R.length:U[P];R=R[S]=P7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('