0001-Feature-600-Auto-escape-double-quotes-in-ranks-and-r.patch

Hector Sanjuan, 05/11/2011 02:34 PM

Download (2.14 KB)

View differences:

src/sunstone/public/js/plugins/templates-tab.js
1809 1809
            vm_json["CONTEXT"][name]=value;
1810 1810
        });
1811 1811

  
1812
		//placement -> fetch with value
1813
		scope = section_placement;
1814
		addSectionJSON(vm_json,scope);
1812
        //placement -> fetch with value, escape double quotes
1813
        scope = section_placement;
1814
        var requirements = $('input#REQUIREMENTS',scope).val();
1815
        requirements = escapeDoubleQuotes(requirements);
1816
        $('input#REQUIREMENTS',scope).val(requirements);
1817
        var rank = $('input#RANK',scope).val();
1818
        rank = escapeDoubleQuotes(rank);
1819
        $('input#RANK',scope).val(rank);
1820
        addSectionJSON(vm_json,scope);
1815 1821

  
1816 1822
		//raw -> if value set type to driver and fetch
1817 1823
		scope = section_raw;
src/sunstone/public/js/sunstone-util.js
405 405
    return select;
406 406
}
407 407

  
408
//Escape " in a string and return it
409
function escapeDoubleQuotes(string){
410
    string = string.replace(/\\"/g,'"');
411
    return string.replace(/"/g,'\\"');
412
}
413

  
408 414
//functions that used as true and false conditions for testing mainly
409 415
function True(){
410 416
    return true;
411
-