Ticket #1126: ticketfixed.html

File ticketfixed.html, 3.4 KB (added by guest, 12 years ago)

Test case that is successful

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5<title>Problem with percent</title>
6<script type="text/javascript">
7
8var _editor_url  = document.location.href.replace(/examples\/ticketfixed\.html.*/, '');
9// And the language we need to use in the editor.
10var _editor_lang = "en";
11</script>
12<!-- Load up the actual editor core -->
13<script type="text/javascript" src="../XinhaCore.js"></script>
14<script type="text/javascript">
15
16        Xinha.prototype.fixRelativeLinks=function(html){
17        if(typeof this.config.expandRelativeUrl!="undefined"&&this.config.expandRelativeUrl){
18        var src=html.match(/(src|href)="([^"]*)"/gi);
19        }
20        var b=document.location.href;
21        if(src){
22        var url,url_m,relPath,base_m,absPath;
23        for(var i=0;i<src.length;++i){
24        url=src[i].match(/(src|href)="([^"]*)"/i);
25        url_m=url[2].match(/\.\.\//g);
26        if(url_m){
27        relPath=new RegExp("(.*?)(([^/]*/){"+url_m.length+"})[^/]*$");
28        base_m=b.match(relPath);
29        absPath=url[2].replace(/(\.\.\/)*/,base_m[1]);
30        html=html.replace(new RegExp(Xinha.escapeStringForRegExp(url[2])),absPath);
31        }
32        }
33        }
34        if(typeof this.config.stripSelfNamedAnchors!="undefined"&&this.config.stripSelfNamedAnchors){
35        var _190=new RegExp(Xinha.escapeStringForRegExp(unescape(document.location.href.replace(/&/g,"&amp;")))+"(#[^'\" ]*)","g");
36        html=html.replace(_190,"$1");
37        }
38        if(typeof this.config.stripBaseHref!="undefined"&&this.config.stripBaseHref){
39        var _191=null;
40        if(typeof this.config.baseHref!="undefined"&&this.config.baseHref!==null){
41        _191=new RegExp("((href|src|background)=\")("+Xinha.escapeStringForRegExp(this.config.baseHref)+")","g");
42        }else{
43        _191=new RegExp("((href|src|background)=\")("+Xinha.escapeStringForRegExp(document.location.href.replace(/^(https?:\/\/[^\/]*)(.*)/,"$1"))+")","g");
44        }
45        html=html.replace(_191,"$1");
46        }
47        return html;
48};
49
50var xinha_plugins =
51[
52 'CharacterMap',
53 'ContextMenu',
54 'FindReplace',
55 'GetHtml',
56 'ListType',
57 'PasteText',
58 'Stylist',
59 'TableOperations',
60 'InsertAnchor'
61];
62/************************************************************************
63 * Names of the textareas you will be turning into editors
64 ************************************************************************/
65var xinha_editors =
66[
67  'myTextArea'
68];
69/************************************************************************
70 * Initialisation function
71 ************************************************************************/
72function xinha_init()
73{
74  if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;
75
76  var xinha_config = new Xinha.Config();
77  xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
78  Xinha.startEditors(xinha_editors);
79}
80window.onload = xinha_init;
81</script>
82<link type="text/css" rel="stylesheet" title="blue-look" href="../skins/blue-look/skin.css">
83
84</head>
85
86<body>
87
88<form onsubmit="alert(this.myTextArea.value); return false;">
89<textarea id="myTextArea" name="myTextArea" rows="10" cols="80" style="width:100%">
90&lt;p&gt;Lien vers &lt;a href=&quot;#PlusBas&quot;&gt;plus bas&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&#160;&lt;/p&gt;&lt;p&gt;
91        &lt;a class=&quot;anchor&quot; id=&quot;PlusBas&quot; title=&quot;PlusBas&quot;&gt;&lt;/a&gt;Plus bas&lt;/p&gt;
92</textarea>
93
94<input type="submit">
95</form>
96
97</body>
98</html>