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

Pat Lockley patrick.lockley at googlemail.com
Mon Jul 16 23:27:58 BST 2012


and internationalised the file involved.... again

On Mon, Jul 16, 2012 at 11:27 PM, Pat Lockley
<patrick.lockley at googlemail.com> wrote:
> have commited a fix
>
> On Mon, Jul 16, 2012 at 10:24 PM, Ron Mitchell <ronm at mitchellmedia.co.uk> wrote:
>> 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.
>>
>>



More information about the Xerte-dev mailing list