Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKNk2-0000ae-J7 for pgadmin-hackers@arkaria.postgresql.org; Fri, 23 Dec 2016 11:10:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cKNk1-0004yD-WA for pgadmin-hackers@arkaria.postgresql.org; Fri, 23 Dec 2016 11:10:26 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cKNjn-0004gv-JJ for pgadmin-hackers@postgresql.org; Fri, 23 Dec 2016 11:10:11 +0000 Received: from mail-it0-x229.google.com ([2607:f8b0:4001:c0b::229]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cKNjf-0005qQ-Tw for pgadmin-hackers@postgresql.org; Fri, 23 Dec 2016 11:10:10 +0000 Received: by mail-it0-x229.google.com with SMTP id o141so80632722itc.0 for ; Fri, 23 Dec 2016 03:10:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=25MCVmCq9ablfNJihtMZo0LulspdxOaG98Ex3WpcaVc=; b=b1Gf2Eu44PLDk4ALhHXF9iELj+ylqTKb/jberqtLDMRgfgVNvxbB3gUO7je7BGkZrT EWGXRV5O/wSeRt/ej49X71FI1tDmAZ83ByfdpEpdSl/JFqlC0qWVYJ0MAq6y6qR5zsD2 BuXBom/bJ7ULk8FHvAl5VnIRFcMGYvtLqhlMA3smIDgWLoyci9/xqnbHIxKZ3RQQrLpu Wj5yH2Bv/BdFEhD4GR6gEt0YgeK3ODNNR+fkDc5SmRxbyMvtjpScxraG/sARgewk+C/a tUFakUSqXStQYbA73yMXPur97/nhOcJ3sNYB7xVqvkFwTq3CxiXR7ECr9RucfaW+kf/Q 5tQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=25MCVmCq9ablfNJihtMZo0LulspdxOaG98Ex3WpcaVc=; b=dd3+K7ZByDacmi/AG4WpnbUiX0k0Ocaw+A4ZBWVkG3nvxiVvzAooiNaqlUvoGobEeI eSO2zwosSMWOdBGXqWcpfvBrdvqgPhYOV19oni0xtP6YaqBsxSpXIJDYbh39tAjPeJgP 5wnIva16Cav4yCD9zDp9ICe4+eEpJ+7NLRtsRdbFMJM72whfEb7E2SPJnh1Y3gWBux// iuazx0Py9blkJxD1tgkcrueFeilwQthKE3g4L4tTjZwYrzTQjyC5sabvIeaMzTnHulv3 tSjqT28Ik0bphJjD7bYQHOycA9sN9A49/HPXk3rbJZSN83MsxvjoGYF6jdVZ4mCcaa5s 8zLw== X-Gm-Message-State: AIkVDXKeDP8AJ2d3A4vei5ixLs2DuEwwptOJDMRpV51rRV2ofQxMNafltQjZZNeh8bFXMrneV+64e47EVFaHUXbm X-Received: by 10.36.31.200 with SMTP id d191mr14035942itd.70.1482490361582; Fri, 23 Dec 2016 02:52:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.129.10 with HTTP; Fri, 23 Dec 2016 02:52:40 -0800 (PST) In-Reply-To: References: From: Akshay Joshi Date: Fri, 23 Dec 2016 16:22:40 +0530 Message-ID: Subject: Re: [pgAdmin4][Patch]: RM #1807 Query Tool Does Not Recognize When File Changes Have Been Saved To: Dave Page Cc: pgadmin-hackers Content-Type: multipart/mixed; boundary=001a11446e8662ebe40544512f2b X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --001a11446e8662ebe40544512f2b Content-Type: multipart/alternative; boundary=001a11446e8662ebde0544512f29 --001a11446e8662ebde0544512f29 Content-Type: text/plain; charset=UTF-8 Hi Dave I have fixed all the comments given by you. Attached is the modified patch file. Please review it. On Fri, Dec 16, 2016 at 7:08 PM, Dave Page wrote: > > > On Fri, Dec 16, 2016 at 1:24 PM, Akshay Joshi < > akshay.joshi@enterprisedb.com> wrote: > >> >> >> On Fri, Dec 16, 2016 at 6:28 PM, Dave Page wrote: >> >>> Hi >>> >>> On Fri, Dec 16, 2016 at 12:46 PM, Akshay Joshi < >>> akshay.joshi@enterprisedb.com> wrote: >>> >>>> Hi Dave >>>> >>>> On Fri, Dec 16, 2016 at 5:22 PM, Dave Page wrote: >>>> >>>>> Hi >>>>> >>>>> On Fri, Dec 16, 2016 at 8:47 AM, Akshay Joshi < >>>>> akshay.joshi@enterprisedb.com> wrote: >>>>> >>>>>> Hi All >>>>>> >>>>>> Please find the attached patch to fix the RM #1807 Query Tool Does >>>>>> Not Recognize When File Changes Have Been Saved. >>>>>> >>>>> >>>>> If I open a file with the patch applied, and make a change (add a >>>>> space to the end), it's correctly detected. >>>>> >>>>> If I then undo the change by deleting the space, the file is still >>>>> marked as dirty. >>>>> >>>> >>>> This was an old behaviour. To achieve this we need to compare the >>>> original content with changed content on each key press event. >>>> >>> >>> OK, but it's inconsistent with what happens if I'm not working with a >>> file - in that case if I add a character and then remove it (so the query >>> is empty again), then it does mark the editor as clean again. >>> >>> If you look at pgAdmin III, then any change to either an opened file, or >>> a blank editor will mark it dirty. It never marks it as clean again. That >>> means no content comparison, and consistent behaviour. >>> >> >> With current implementation if we are not working with file then there >> is no dirty(*) mark on the tab and if query is empty then no point in >> saving/creating empty file that's why save button is disabled. Do you want >> me to add an (*) mark there as well ? >> > > Yes - and allow saving the empty file. Use pgAdmin III for reference - > whilst there may be no point in saving an empty file, the behaviour is > consistent and appropriate here. You don't run into a situation where you > may have an empty editor with the ability to save one day, and without the > next day. > > >> >>> >>> >>>> >>>>> If I then clear the window entirely, the save button is disabled, but >>>>> the tab still shows the file is dirty (the *). >>>>> >>>> >>>> Again this was an old behaviour, I have added only one if condition >>>> to check whether to popped up "Unsaved Changes" message or not. >>>> >>> >>> Maybe - but the point is to fix the old behaviour :-). The dirty marker >>> and enabled/disabled state of the save option should be in sync shouldn't >>> they? I shouldn't expect to see a file marked as dirty that I cannot save >>> (even if it is empty). >>> >> >> OK. I'll enable the save button in that case for consistency. >> >>> >>> >>>> >>>>> Also - the patch seems to undo the change I made >>>>> in 4a280b251755091af9bf56bcdee964601df104ae. >>>>> >>>> >>>> As per commit id 4a280b251755091af9bf56bcdee964601df104ae, you >>>> have made following changes: >>>> >>>> - self.setTitle(self.gridView.current_file.re >>>> place(/^\/|\/$/g, '')); >>>> + self.setTitle(self.gridView.current_file.sp >>>> lit('\\').pop().split('/').pop()); >>>> >>>> And as per me I haven't change any thing there, I have only disabled >>>> the save button when file is loaded which was not there previously. >>>> >>> >>> Ahh, no - I see the issue. When the file is marked as dirty, it uses the >>> full path again. Can you fix that to use just the filename please? >>> >> >> Sure. >> > > Thanks. > > >> >>> Thanks. >>> >>> -- >>> Dave Page >>> Blog: http://pgsnake.blogspot.com >>> Twitter: @pgsnake >>> >>> EnterpriseDB UK: http://www.enterprisedb.com >>> The Enterprise PostgreSQL Company >>> >> >> >> >> -- >> *Akshay Joshi* >> *Principal Software Engineer * >> >> >> >> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91 976-788-8246* >> > > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > -- *Akshay Joshi* *Principal Software Engineer * *Phone: +91 20-3058-9517Mobile: +91 976-788-8246* --001a11446e8662ebde0544512f29 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Dave

I have fixed all the comments g= iven by you. Attached is the modified patch file. Please review it.=C2=A0

On Fri, Dec 16,= 2016 at 7:08 PM, Dave Page <dpage@pgadmin.org> wrote:


On Fri, Dec 16, 2016 at 1= :24 PM, Akshay Joshi <akshay.joshi@enterprisedb.com&g= t; wrote:


On Fri, Dec 16= , 2016 at 6:28 PM, Dave Page <dpage@pgadmin.org> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">
Hi

On Fri, Dec 16, 2016 at 12:46 PM,= Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Dave

On Fri, Dec 16, 20= 16 at 5:22 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Fri, Dec 16, 2016 at 8:47 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi All
Please f= ind the attached patch to fix the RM=C2=A0#1807 Query Tool Does Not Recogni= ze When File Changes Have Been Saved.

If I open a file with the patch applied, and make a change (a= dd a space to the end), it's correctly detected.=C2=A0

If I then undo the change by deleting the space, the file is still= marked as dirty.=C2=A0

=
=C2=A0 =C2=A0This was an old behaviour. To achieve this we need= to compare the original content with changed content on each key press eve= nt.

OK, but = it's inconsistent with what happens if I'm not working with a file = - in that case if I add a character and then remove it (so the query is emp= ty again), then it does mark the editor as clean again.

If you look at pgAdmin III, then any change to either an opened file,= or a blank editor will mark it dirty. It never marks it as clean again. Th= at means no content comparison, and consistent behaviour.
=

=C2=A0 =C2=A0With current imp= lementation if we are not working with file then there is no dirty(*) mark = on the tab and if query is empty then no point in saving/creating empty fil= e that's why save button is disabled. Do you want me to add an (*) mark= there as well ?=C2=A0

<= /span>
Yes - and allow saving the empty file. Use pgAdmin III for refer= ence - whilst there may be no point in saving an empty file, the behaviour = is consistent and appropriate here. You don't run into a situation wher= e you may have an empty editor with the ability to save one day, and withou= t the next day.
=C2=A0
=C2=A0
= =C2=A0

If I then clear the window entirely, the save button is disabled, but th= e tab still shows the file is dirty (the *).

=C2=A0 =C2=A0Again this was an old behavio= ur, I have added only one if condition to check whether to popped up "= Unsaved Changes" message or not.=C2=A0

Maybe - but the point is to fix the old beh= aviour :-). The dirty marker and enabled/disabled state of the save option = should be in sync shouldn't they? I shouldn't expect to see a file = marked as dirty that I cannot save (even if it is empty).
=

=C2=A0 =C2=A0 OK. I'll en= able the save button in that case for consistency. =C2=A0
=C2=A0
=

Also - the patch seems to undo the cha= nge I made in=C2=A04a280b251755091af9bf56bcdee964601df104ae.

=C2=A0 =C2=A0 As per = commit id 4a280b251755091af9bf56bcdee964601df104ae, you have made foll= owing changes:=C2=A0

-=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0self.setTitle(self.gri= dView.current_file.replace(/^\/|\/$/g,=C2=A0'')= );
+=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0self.setTitle(self.gridView.current_file.split(&= #39;\\').pop().split('/').pop());

And as per me I haven't change any thing the= re, I have only disabled the save button when file is loaded which was not = there previously.

Ahh, no - I see the issue. When the file is marked as dirty,= it uses the full path again. Can you fix that to use just the filename ple= ase?=C2=A0

= =C2=A0 =C2=A0Sure.=C2=A0

Thanks.
=C2=A0
<= br>
Thanks.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twi= tter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Pos= tgreSQL Company



--
Akshay Joshi
Principal Software = Engineer=C2=A0

<= /font>

=
Phone: +91 20-3058-9517
Mobile: +91 976-788-8246



--
Dave Page
Blog: http://pgsnake.blogspot.com
Tw= itter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Po= stgreSQL Company



--
Akshay Joshi


<= b>Phone: +91 20-3058-9517
Mobile: +91 976-788= -8246
--001a11446e8662ebde0544512f29-- --001a11446e8662ebe40544512f2b Content-Type: application/octet-stream; name="RM_1807_v2.patch" Content-Disposition: attachment; filename="RM_1807_v2.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ix1ohain0 ZGlmZiAtLWdpdCBhL3dlYi9wZ2FkbWluL3Rvb2xzL3NxbGVkaXRvci90ZW1w bGF0ZXMvc3FsZWRpdG9yL2pzL3NxbGVkaXRvci5qcyBiL3dlYi9wZ2FkbWlu L3Rvb2xzL3NxbGVkaXRvci90ZW1wbGF0ZXMvc3FsZWRpdG9yL2pzL3NxbGVk aXRvci5qcwppbmRleCA2OThlODRkLi41ZTQwMGM3IDEwMDY0NAotLS0gYS93 ZWIvcGdhZG1pbi90b29scy9zcWxlZGl0b3IvdGVtcGxhdGVzL3NxbGVkaXRv ci9qcy9zcWxlZGl0b3IuanMKKysrIGIvd2ViL3BnYWRtaW4vdG9vbHMvc3Fs ZWRpdG9yL3RlbXBsYXRlcy9zcWxlZGl0b3IvanMvc3FsZWRpdG9yLmpzCkBA IC0zMDcsMTUgKzMwNyw5IEBAIGRlZmluZSgKICAgICAgICAgICAgICAgICAg IG1zZyA9ICd7eyBfKCdUaGUgZGF0YSBoYXMgYmVlbiBtb2RpZmllZCwgYnV0 IG5vdCBzYXZlZC4gQXJlIHlvdSBzdXJlIHlvdSB3aXNoIHRvIGRpc2NhcmQg dGhlIGNoYW5nZXM/JykgfX0nOwogICAgICAgICAgICAgICAgICAgbm90aWZ5 ID0gdHJ1ZTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgIH0g ZWxzZSBpZihzZWxmLmhhbmRsZXIuaXNfcXVlcnlfdG9vbCkgewotICAgICAg ICAgICAgICAgIC8vIFdlIHdpbGwgY2hlY2sgZm9yIG1vZGlmaWVkIHNxbCBj b250ZW50Ci0gICAgICAgICAgICAgICAgdmFyIHNxbCA9IHNlbGYuaGFuZGxl ci5ncmlkVmlldy5xdWVyeV90b29sX29iai5nZXRWYWx1ZSgpOwotICAgICAg ICAgICAgICAgIHN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hbGVy dGlmeS5jb25maXJtKAorICAgICAgICAgICAgJ3t7IF8oJ1Vuc2F2ZWQgY2hh bmdlcycpIH19JywKKyAgICAgICAgICAgICd7eyBfKCdBcmUgeW91IHN1cmUg eW91IHdpc2ggdG8gZGlzY2FyZCB0aGUgY3VycmVudCBjaGFuZ2VzPycpIH19 JywKKyAgICAgICAgICAgIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAv LyBEbyBub3RoaW5nIGFzIHVzZXIgZG8gbm90IHdhbnQgdG8gc2F2ZSwganVz dCBjb250aW51ZQorICAgICAgICAgICAgICBzZWxmLnF1ZXJ5X3Rvb2xfb2Jq LnNldFZhbHVlKCcnKTsKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBm dW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAg ICAgICAgICB9CisgICAgICAgICAgKS5zZXQoJ2xhYmVscycsIHtvazonWWVz JywgY2FuY2VsOidObyd9KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAg ICBzZWxmLnF1ZXJ5X3Rvb2xfb2JqLnNldFZhbHVlKCcnKTsKKyAgICAgICAg fQogICAgICAgfSwKIAogICAgICAgLy8gQ2FsbGJhY2sgZnVuY3Rpb24gZm9y IHRoZSBjbGVhciBoaXN0b3J5IGJ1dHRvbiBjbGljay4KQEAgLTIyNDYsNyAr MjI0MSw2IEBAIGRlZmluZSgKIAogICAgICAgICAgIC8vIE9wZW4gc2F2ZSBm aWxlIGRpYWxvZyBpZiBxdWVyeSB0b29sCiAgICAgICAgICAgaWYgKHNlbGYu aXNfcXVlcnlfdG9vbCkgewotCiAgICAgICAgICAgICB2YXIgY3VycmVudF9m aWxlID0gc2VsZi5ncmlkVmlldy5jdXJyZW50X2ZpbGU7CiAgICAgICAgICAg ICBpZiAoIV8uaXNVbmRlZmluZWQoY3VycmVudF9maWxlKSAmJiAhc2F2ZV9h cykgewogICAgICAgICAgICAgICBzZWxmLl9zYXZlX2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oJ2xh YmVscycsIHtvazonWWVzJywgY2FuY2VsOidObyd9KTsKKyAgICAgICAgICAv KiBJZiBpc19xdWVyeV9jaGFuZ2VkIGZsYWcgaXMgc2V0IHRvIGZhbHNlIHRo ZW4gbm8gbmVlZCB0bworICAgICAgICAgICAqIGNvbmZpcm0gd2l0aCB0aGUg dXNlciBmb3IgdW5zYXZlZCBjaGFuZ2VzLgorICAgICAgICAgICAqLworICAg ICAgICAgIGlmIChzZWxmLmlzX3F1ZXJ5X2NoYW5nZWQpIHsKKyAgICAgICAg ICAgIGFsZXJ0aWZ5LmNvbmZpcm0oJ3t7IF8oJ1Vuc2F2ZWQgY2hhbmdlcycp IH19JywKKyAgICAgICAgICAgICAgJ3t7IF8oJ0FyZSB5b3Ugc3VyZSB5b3Ug d2lzaCB0byBkaXNjYXJkIHRoZSBjdXJyZW50IGNoYW5nZXM/JykgfX0nLAor ICAgICAgICAgICAgICBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAv LyBVc2VyIGRvIG5vdCB3YW50IHRvIHNhdmUsIGp1c3QgY29udGludWUKKyAg ICAgICAgICAgICAgICBzZWxmLl9vcGVuX3NlbGVjdF9maWxlX21hbmFnZXIo KTsKKyAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgZnVuY3Rpb24o KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICkuc2V0KCdsYWJlbHMnLCB7b2s6J1llcycs IGNhbmNlbDonTm8nfSk7CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAg ICAgIHNlbGYuX29wZW5fc2VsZWN0X2ZpbGVfbWFuYWdlcigpOworICAgICAg ICAgIH0KKwogICAgICAgICB9LAogCiAgICAgICAgIC8vIE9wZW4gRmlsZU1h bmFnZXIKQEAgLTI0ODYsNiArMjQ4MywxMyBAQCBkZWZpbmUoCiAgICAgICAg ICAgICAgIHNlbGYudHJpZ2dlcigncGdhZG1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ZWQnLCB0cnVlKTsKLSAgICAgICAgICB9IGVsc2Ug eworCisgICAgICAgICAgaWYgKCFzZWxmLmlzX3F1ZXJ5X2NoYW5nZWQpIHsK KyAgICAgICAgICAgIC8vIFVwZGF0ZSB0aGUgZmxhZyBhcyBxdWVyeSBpcyBn b2luZyB0byBjaGFuZ2VkLgorICAgICAgICAgICAgc2VsZi5pc19xdWVyeV9j aGFuZ2VkID0gdHJ1ZTsKKwogICAgICAgICAgICAgaWYoc2VsZi5ncmlkVmll dy5jdXJyZW50X2ZpbGUpIHsKLSAgICAgICAgICAgICAgdmFyIHRpdGxlID0g c2VsZi5ncmlkVmlldy5jdXJyZW50X2ZpbGUucmVwbGFjZSgvXlwvfFwvJC9n LCAnJykgKyAnIConCisgICAgICAgICAgICAgIHZhciB0aXRsZSA9IHNlbGYu Z3JpZFZpZXcuY3VycmVudF9maWxlLnJlcGxhY2UoL14uKltcXFwvXS9nLCAn JykgKyAnIConCisgICAgICAgICAgICAgIHNlbGYuc2V0VGl0bGUodGl0bGUp OworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgdmFyIHRp dGxlID0gJyc7CisKKyAgICAgICAgICAgICAgLy8gRmluZCB0aGUgdGl0bGUg b2YgdGhlIHZpc2libGUgcGFuZWwKKyAgICAgICAgICAgICAgXy5lYWNoKHdp bmRvdy50b3AucGdBZG1pbi5Ccm93c2VyLmRvY2tlci5maW5kUGFuZWxzKCdm cm1fZGF0YWdyaWQnKSwgZnVuY3Rpb24ocCkgeworICAgICAgICAgICAgICAg IGlmKHAuaXNWaXNpYmxlKCkpIHsKKyAgICAgICAgICAgICAgICAgIHNlbGYu Z3JpZFZpZXcucGFuZWxfdGl0bGUgPSBwLl90aXRsZTsKKyAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgIHRp dGxlID0gc2VsZi5ncmlkVmlldy5wYW5lbF90aXRsZSArICcgKic7CiAgICAg ICAgICAgICAgIHNlbGYuc2V0VGl0bGUodGl0bGUpOwogICAgICAgICAgICAg fQorCiAgICAgICAgICAgICAkKCIjYnRuLXNhdmUiKS5wcm9wKCdkaXNhYmxl ZCcsIGZhbHNlKTsKICAgICAgICAgICAgICQoIiNidG4tZmlsZS1tZW51LXNh dmUiKS5jc3MoJ2Rpc3BsYXknLCAnYmxvY2snKTsKICAgICAgICAgICAgICQo IiNidG4tZmlsZS1tZW51LWRyb3Bkb3duIikucHJvcCgnZGlzYWJsZWQnLCBm YWxzZSk7Cg== --001a11446e8662ebe40544512f2b Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers --001a11446e8662ebe40544512f2b--