[Xerte-dev] Re: XOT - Deleting a folder throws a message with html in it.

Pat Lockley patrick.lockley at googlemail.com
Tue Jul 17 10:24:12 BST 2012


it isn't that bad, a bit of copying and pasting fixes it (basically
look for long strings, find the string in the languages version, copy
variable in).

If it had been everything I'd have cried

On Tue, Jul 17, 2012 at 10:22 AM, Julian Tenney
<Julian.Tenney at nottingham.ac.uk> wrote:
> Phew. I think.
>
> Is it a pain to put right? If it was there at some point it must be retrievable...
>
> -----Original Message-----
> From: xerte-dev-bounces at lists.nottingham.ac.uk [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] On Behalf Of Pat Lockley
> Sent: 17 July 2012 10:11
> To: For Xerte technical developers
> Subject: [Xerte-dev] Re: XOT - Deleting a folder throws a message with html in it.
>
> I checked out the SVN last night for the first time on my laptop
>
> in template_management.js, all of the fixed strings had come back -
> hence it wasn't "international".
>
> checking the code
>
> http://code.google.com/p/xerteonlinetoolkits/source/browse/trunk/website_code/scripts/folders.js
>
> appears to be "non-international", the rest seem ok.
>
>
> On Tue, Jul 17, 2012 at 10:01 AM, Julian Tenney
> <Julian.Tenney at nottingham.ac.uk> wrote:
>> What do you mean? You've lost all the internationalised code?
>>
>> -----Original Message-----
>> From: xerte-dev-bounces at lists.nottingham.ac.uk [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] On Behalf Of Pat Lockley
>> Sent: 17 July 2012 10:00
>> To: For Xerte technical developers
>> Subject: [Xerte-dev] Re: XOT - Deleting a folder throws a message with html in it.
>>
>> I just have a hunch, and don't want to check, but I'm guessing all the
>> JS is now "english"
>>
>> On Tue, Jul 17, 2012 at 9:58 AM, Julian Tenney
>> <Julian.Tenney at nottingham.ac.uk> wrote:
>>> If it works, it works.
>>>
>>>
>>>
>>> From: xerte-dev-bounces at lists.nottingham.ac.uk
>>> [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] On Behalf Of Ron Mitchell
>>> Sent: 16 July 2012 22:25
>>>
>>>
>>> To: 'For Xerte technical developers'
>>> Subject: [Xerte-dev] XOT - Deleting a folder throws a message with html in
>>> it.
>>>
>>>
>>>
>>> Hi all and I guess mainly Pat...
>>>
>>>
>>>
>>> Julian previously reported this visual error e.g. the confirmation dialogue
>>> when trying to delete an empty folder works but shows some rogue html
>>> instead of the folder name as well as a typo in the message e.g. something
>>> like:
>>>
>>>
>>>
>>> <img style="vertical-align:middle"
>>> src="website_code/images/Icon_Folder_Empty.gif"
>>>
>>>
>>>
>>> Are you sure you with to delete?
>>>
>>>
>>>
>>> As far as I can tell this has existed for ages and isn't new to 1.8 but
>>> still exists in 1.8.
>>>
>>>
>>>
>>> Fixing the typo e.g. replacing 'with' with 'wish' in both
>>> \website_code\scripts\template_management.js and
>>> \languages\en-GB\website_code\scripts\template_management.js is obviously
>>> easy and I have done that on the files I've been testing. However the main
>>> issue seems to be with the split used to display the name of the item
>>> selected...
>>>
>>>
>>>
>>> in \website_code\scripts\template_management.js the relevant section is the
>>> following:
>>>
>>>
>>>
>>> if(drag_manager.selected_items.length!=1){
>>>
>>>
>>>
>>>             var response = confirm("Are you sure you wish to delete these
>>> item?");
>>>
>>>
>>>
>>>         }else{
>>>
>>>
>>>
>>>             data_string = drag_manager.selected_items[0].innerHTML;
>>>
>>>
>>>
>>>             name_string = data_string.split(">");
>>>
>>>
>>>
>>>             var response = confirm(name_string[1] + "\n\nAre you sure you
>>> wish to delete?");
>>>
>>>
>>>
>>>         }
>>>
>>>
>>>
>>> when a folder is selected for deletion data_string equals something like:
>>>
>>> <P><IMG style="VERTICAL-ALIGN:middle"
>>> src="website_code/images/Icon_Folder_Empty.gif">new folder2</P>
>>>
>>>
>>>
>>> when a file is selected for deletion data_string equals something like:
>>>
>>> <IMG style="VERTICAL-ALIGN:middle"
>>> src="http://localhost/newxottrunktest//website_code/images/Icon_Page.gif">test
>>> lo
>>>
>>>
>>>
>>> so when a file is selected for deletion var response =
>>> confirm(name_string[1] correctly results in just the file name but when a
>>> folder is selected var response = confirm(name_string[2] would be a closer
>>> match displaying the folder name but ending with </P
>>>
>>>
>>>
>>> The easiest way I could think of to fix this is to first strip out the <P>
>>> and </P> so that the spit is correct for both file and folder deletion. So
>>> the section of code now looks like:
>>>
>>>
>>>
>>> if(drag_manager.selected_items.length!=1){
>>>
>>>
>>>
>>>             var response = confirm("Are you sure you wish to delete these
>>> item?");
>>>
>>>
>>>
>>>         }else{
>>>
>>>
>>>
>>>             data_string = drag_manager.selected_items[0].innerHTML;
>>>
>>>
>>>
>>>                                              data_string =
>>> data_string.replace("<P>","");
>>>
>>>                                              data_string =
>>> data_string.replace("</P>","");
>>>
>>>
>>>
>>>             name_string = data_string.split(">");
>>>
>>>
>>>
>>>             var response = confirm(name_string[1] + "\n\nAre you sure you
>>> wish to delete?");
>>>
>>>
>>>
>>>         }
>>>
>>>
>>>
>>> This seems to work fine and correctly displays the file name or folder name
>>> in the deletion confirmation dialogue.
>>>
>>>
>>>
>>> So question mainly for Pat - is this ok and if so shall I commit the changes
>>> or is there a better way to fix this?
>>>
>>>
>>>
>>> Cheers
>>>
>>> Ron
>>>
>>>
>>> This message and any attachment are intended solely for the addressee and
>>> may contain confidential information. If you have received this message in
>>> error, please send it back to me, and immediately delete it. Please do not
>>> use, copy or disclose the information contained in this message or in any
>>> attachment. Any views or opinions expressed by the author of this email do
>>> not necessarily reflect the views of the University of Nottingham.
>>>
>>> This message has been checked for viruses but the contents of an attachment
>>> may still contain software viruses which could damage your computer system:
>>> you are advised to perform your own checks. Email communications with the
>>> University of Nottingham may be monitored as permitted by UK legislation.
>>>
>>>
>>> _______________________________________________
>>> Xerte-dev mailing list
>>> Xerte-dev at lists.nottingham.ac.uk
>>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev
>>>
>>> This message and any attachment are intended solely for the addressee and
>>> may contain confidential information. If you have received this message in
>>> error, please send it back to me, and immediately delete it.   Please do not
>>> use, copy or disclose the information contained in this message or in any
>>> attachment.  Any views or opinions expressed by the author of this email do
>>> not necessarily reflect the views of the University of Nottingham.
>>>
>>> This message has been checked for viruses but the contents of an attachment
>>> may still contain software viruses which could damage your computer system:
>>> you are advised to perform your own checks. Email communications with the
>>> University of Nottingham may be monitored as permitted by UK legislation.
>>>
>>>
>>
>> _______________________________________________
>> Xerte-dev mailing list
>> Xerte-dev at lists.nottingham.ac.uk
>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev
>>
>> _______________________________________________
>> Xerte-dev mailing list
>> Xerte-dev at lists.nottingham.ac.uk
>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev
>
> _______________________________________________
> Xerte-dev mailing list
> Xerte-dev at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev
>
> _______________________________________________
> Xerte-dev mailing list
> Xerte-dev at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev



More information about the Xerte-dev mailing list