|
70 | 70 |
|
71 | 71 | // Read hash
|
72 | 72 | if(location.hash){
|
73 |
| - code.value=decodeURI(location.hash.slice(1)); |
| 73 | + code.value=decodeURIComponent(location.hash.slice(1)); |
74 | 74 | location.hash="";
|
75 | 75 | }
|
76 | 76 |
|
|
82 | 82 | iframe.srcdoc=custom_console+editor.getValue();
|
83 | 83 |
|
84 | 84 | // Update download link
|
85 |
| -download.href="data:text/html,"+encodeURI(editor.getValue()); |
| 85 | +download.href="data:text/html,"+encodeURIComponent(editor.getValue()); |
86 | 86 |
|
87 |
| -// Update cpunt |
| 87 | +// Update count |
88 | 88 | document.title=input.length+" chars - Codegolf IDE";
|
89 | 89 |
|
90 | 90 | // After typing code, clear console and update iframe and export link
|
91 | 91 | editor.on("keyup",function(){
|
92 | 92 | console.clear();
|
93 | 93 | input=editor.getValue();
|
94 |
| - iframe.srcdoc=custom_console+input; |
95 |
| - download.href="data:text/html,"+encodeURI(input); |
| 94 | + iframe.srcdoc=custom_console+editor.getValue(); |
| 95 | + download.href="data:text/html,"+encodeURIComponent(input); |
96 | 96 | document.title=input.length+" chars - Codegolf IDE";
|
97 | 97 | });
|
98 | 98 |
|
|
106 | 106 | console.clear();
|
107 | 107 | editor.setValue(localStorage["code"]);
|
108 | 108 | input=editor.getValue();
|
109 |
| - iframe.srcdoc=custom_console+input; |
110 |
| - download.href="data:text/html,"+encodeURI(input); |
| 109 | + iframe.srcdoc=custom_console+editor.getValue(); |
| 110 | + download.href="data:text/html,"+encodeURIComponent(input); |
111 | 111 | document.title=input.length+" chars - Codegolf IDE";
|
112 | 112 | }
|
113 | 113 |
|
114 | 114 | // Share
|
115 | 115 | share.onclick=function(){
|
116 |
| - myconsole.innerHTML="http://codegolf.github.io/codegolfIDE/#"+encodeURI(editor.getValue()); |
| 116 | + myconsole.innerHTML="http://codegolf.github.io/codegolfIDE/#"+encodeURIComponent(editor.getValue()); |
117 | 117 | }
|
118 | 118 |
|
119 | 119 | // Minify
|
|
0 commit comments