Commit 137dbb2d345c7720466ad351aa9b1e7ed8ba1e5a
- server/ui.js 483 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- server/wsgi/page_edit.js 73 ------------------------------------+++++++++++++++++++++++++++++++++++++
- Diff rendering mode:
- inline
- side by side
server/ui.js
4 | elementTagName: " ", | 4 | elementTagName: " ", |
---|---|---|---|
5 | elementId: " ", | 5 | elementId: " ", |
6 | flag : 0, | 6 | flag : 0, |
7 | showlinks : 0, | ||
8 | showbox : 0, | ||
9 | blog_flag : false, | ||
7 | testContext : function() | 10 | testContext : function() |
8 | { | 11 | { |
9 | 12 | ||
10 | |||
11 | |||
12 | |||
13 | |||
14 | |||
15 | |||
16 | |||
17 | |||
18 | |||
19 | |||
20 | |||
21 | 13 | $(document).ready(function(){$('body *').contents().filter(function() | |
14 | { | ||
15 | try{ | ||
16 | if(this.nodeType == 3) | ||
17 | { | ||
18 | return (this.nodeType == 3) && this.nodeValue.match(/\S/);}} | ||
19 | catch(err) | ||
20 | { | ||
21 | }}).wrap('<span m4pageedittype=text/>')}); | ||
22 | 22 | ||
23 | 23 | ||
24 | vimg = document.getElementsByTagName('img'); | 24 | vimg = document.getElementsByTagName('img'); |
25 | for(i=0; i<vimg.length; i++) | 25 | for(i=0; i<vimg.length; i++) |
26 | |||
27 | |||
28 | |||
29 | |||
30 | |||
31 | |||
32 | |||
33 | |||
34 | |||
35 | |||
36 | |||
37 | |||
38 | |||
39 | |||
40 | 26 | { | |
27 | vimg[i].setAttribute('m4pageedittype','image'); | ||
41 | } | 28 | } |
42 | |||
43 | 29 | ||
44 | }, | 30 | }, |
45 | 31 | ||
46 | createMenu: function(menu_list) { | 32 | createMenu: function(menu_list) { |
47 | 33 | var xyz = document.getElementById("show-box"); | |
34 | xyz.innerHTML = ""; | ||
48 | for(var i=0;i<menu_list.length;i++) | 35 | for(var i=0;i<menu_list.length;i++) |
49 | |||
50 | |||
51 | |||
52 | |||
53 | |||
54 | |||
55 | |||
56 | |||
57 | |||
58 | |||
59 | |||
60 | |||
61 | |||
62 | |||
63 | |||
64 | |||
65 | |||
66 | |||
67 | |||
68 | |||
69 | |||
70 | { | 36 | { |
71 | |||
72 | |||
73 | |||
74 | |||
75 | |||
76 | |||
77 | |||
78 | |||
79 | |||
80 | |||
81 | 37 | var para = document.createElement("p"); | |
38 | var newel = document.createElement("a"); | ||
39 | newel.textContent = menu_list[i]; | ||
40 | newel.setAttribute("href", "http://y.a11y.in/web?foruri="+encodeURIComponent(window.location.href)+"&lang="+menu_list[i]+"&interactive=1"); | ||
41 | para.appendChild(newel); | ||
42 | xyz.appendChild(para); | ||
82 | } | 43 | } |
83 | |||
84 | |||
85 | |||
86 | |||
87 | |||
88 | |||
89 | |||
90 | |||
91 | |||
92 | |||
93 | }, | 44 | }, |
94 | ajax1: function() { | 45 | ajax1: function() { |
95 | 46 | var xhr = new XMLHttpRequest(); | |
47 | xhr.onreadystatechange = function() | ||
96 | { | 48 | { |
97 | |||
98 | |||
99 | |||
100 | |||
101 | 49 | if(xhr.readyState == 4) | |
102 | { | 50 | { |
103 | if(xhr.responseText == "empty") | 51 | if(xhr.responseText == "empty") |
104 | |||
105 | |||
106 | 52 | { } | |
107 | else | 53 | else |
108 | |||
109 | |||
110 | 54 | { | |
55 | document.getElementById("see-narration").disabled = false; | ||
56 | document.getElementById("blog-filter").disabled = false; | ||
57 | document.getElementById("go").disabled = false; | ||
58 | a11ypi.showbox = JSON.parse(xhr.responseText); | ||
59 | } | ||
111 | } | 60 | } |
112 | |||
113 | |||
114 | |||
115 | |||
116 | |||
117 | |||
118 | |||
119 | |||
120 | |||
121 | |||
122 | |||
123 | |||
124 | } | 61 | } |
62 | xhr.open("POST","http://y.a11y.in/menu",true); | ||
63 | xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); | ||
64 | xhr.send('url='+encodeURIComponent(window.location.href)) ; | ||
125 | }, | 65 | }, |
126 | |||
127 | |||
128 | |||
129 | 66 | createDomainMenu: function() { | |
67 | var xyz = document.getElementById("show-links"); | ||
68 | xyz.innerHTML = ""; | ||
69 | menu_list = a11ypi.showlinks; | ||
70 | for(var i=0; i<menu_list.length;i++) | ||
71 | { | ||
72 | var para = document.createElement("p"); | ||
73 | var newel = document.createElement("a"); | ||
74 | newel.textContent = menu_list[i]; | ||
75 | newel.setAttribute("href", menu_list[i]); | ||
76 | para.appendChild(newel); | ||
77 | xyz.appendChild(para); | ||
78 | } | ||
79 | $('a').hover( | ||
80 | function() { | ||
81 | var xhr = new XMLHttpRequest(); | ||
82 | xhr.onreadystatechange = function() | ||
83 | { | ||
84 | if(xhr.readyState == 4) | ||
85 | { | ||
86 | if(xhr.responseText == "empty") | ||
87 | { } | ||
88 | else | ||
89 | { | ||
90 | menu_list = JSON.parse(xhr.responseText); | ||
91 | for(i=0; i<menu_list.length; i++) { | ||
92 | x = document.createElement('span'); | ||
93 | x.setAttribute('style', 'padding:15px;'); | ||
94 | x.textContent = menu_list[i]; | ||
95 | document.getElementById('show-links').appendChild(x); | ||
96 | } | ||
97 | $('span').tooltip(); | ||
98 | } | ||
99 | } | ||
100 | } | ||
101 | xhr.open("POST","http://y.a11y.in/menu",true); | ||
102 | xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); | ||
103 | xhr.send('url='+encodeURIComponent($(this).attr('href'))) ; | ||
104 | }, | ||
105 | function () {$('#show-links').find("span").remove();} | ||
106 | ); | ||
130 | }, | 107 | }, |
131 | |||
132 | 108 | ||
109 | ajaxLinks1: function() { | ||
133 | var xhr = new XMLHttpRequest(); | 110 | var xhr = new XMLHttpRequest(); |
134 | xhr.onreadystatechange = function() | 111 | xhr.onreadystatechange = function() |
135 | { | 112 | { |
136 | if(xhr.readyState == 4) | 113 | if(xhr.readyState == 4) |
137 | |||
138 | |||
139 | { | 114 | { |
140 | |||
141 | |||
142 | |||
143 | |||
144 | |||
145 | |||
146 | |||
147 | |||
148 | |||
149 | |||
150 | |||
151 | |||
152 | |||
153 | |||
154 | |||
155 | 115 | if(xhr.responseText == "empty") | |
116 | { } | ||
117 | else | ||
118 | { | ||
119 | document.getElementById("see-links").disabled = false; | ||
120 | a11ypi.showlinks = JSON.parse(xhr.responseText); | ||
156 | } | 121 | } |
157 | |||
158 | |||
159 | |||
160 | |||
161 | |||
162 | } | 122 | } |
163 | |||
164 | } | 123 | } |
165 | |||
166 | |||
167 | |||
168 | |||
169 | |||
170 | |||
171 | |||
172 | |||
173 | |||
174 | 124 | xhr.open("POST","http://y.a11y.in/domain",true); | |
175 | xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); | 125 | xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); |
176 | 126 | xhr.send('url='+encodeURIComponent(window.location.hostname)); | |
177 | }, | 127 | }, |
178 | |||
179 | |||
180 | |||
181 | |||
182 | |||
183 | |||
184 | |||
185 | |||
186 | |||
187 | |||
188 | |||
189 | |||
190 | |||
191 | |||
192 | |||
193 | |||
194 | |||
195 | |||
196 | |||
197 | |||
198 | |||
199 | |||
200 | |||
201 | |||
202 | |||
203 | |||
204 | |||
205 | |||
206 | |||
207 | |||
208 | |||
209 | |||
210 | |||
211 | |||
212 | |||
213 | |||
214 | 128 | ||
129 | |||
130 | |||
131 | |||
132 | editPage: function() { | ||
133 | a11ypi.testContext(); page_edit_nele('4seiz', '4l85060vb9', '336e2nootv6nxjsvyjov', 'VISUAL', 'false', ''); | ||
134 | document.getElementById("renarrated_overlay").style.display = "none"; | ||
215 | }, | 135 | }, |
216 | |||
217 | 136 | ||
137 | showBox: function() { | ||
138 | $(function() { | ||
139 | $( "#show-box" ).dialog( "destroy" ); | ||
140 | |||
141 | $( "#show-box" ).dialog({ | ||
142 | width: 300, | ||
143 | height: 300, | ||
144 | modal: true | ||
145 | }); | ||
146 | }); | ||
147 | a11ypi.createMenu(a11ypi.showbox); | ||
218 | }, | 148 | }, |
219 | |||
220 | 149 | ||
150 | showBox1: function() { | ||
151 | $(function() { | ||
152 | $( "#show-links" ).dialog( "destroy" ); | ||
153 | |||
154 | $( "#show-links" ).dialog({ | ||
155 | width: 500, | ||
156 | height: 300, | ||
157 | modal: true | ||
158 | }); | ||
159 | }); | ||
160 | a11ypi.createDomainMenu(); | ||
161 | }, | ||
162 | |||
163 | blogFilter: function() { | ||
164 | if (a11ypi.blog_flag == false) { | ||
165 | a11ypi.blog_flag = true; | ||
221 | var xhr = new XMLHttpRequest(); | 166 | var xhr = new XMLHttpRequest(); |
222 | xhr.onreadystatechange = function() | 167 | xhr.onreadystatechange = function() |
223 | { | 168 | { |
224 | if(xhr.readyState == 4) | 169 | if(xhr.readyState == 4) |
225 | |||
226 | |||
227 | { | 170 | { |
228 | |||
229 | |||
230 | 171 | if(xhr.responseText == "empty") | |
172 | { } | ||
231 | else | 173 | else |
232 | |||
233 | |||
234 | |||
235 | |||
236 | |||
237 | |||
238 | |||
239 | |||
240 | |||
241 | |||
242 | |||
243 | 174 | { | |
175 | var sel = document.getElementById("blog-filter"); | ||
176 | var menu_list = JSON.parse(xhr.responseText); | ||
177 | blogArray = []; | ||
178 | for (var i=0; i< menu_list.length; i++) | ||
179 | { | ||
180 | blogArray[i] = menu_list[i].split("http://")[1].split(".com")[0] + ".com"; | ||
181 | } | ||
182 | blogArray.sort(); | ||
183 | for (var i=0; i < blogArray.length; i++) | ||
184 | { | ||
185 | if ( i == 0 ) | ||
186 | { | ||
187 | opt = document.createElement("option"); | ||
188 | opt.textContent = blogArray[0]; | ||
189 | sel.appendChild(opt); | ||
190 | } | ||
191 | else if(blogArray[i] == blogArray[i-1]) | ||
192 | { } | ||
193 | else | ||
194 | { | ||
195 | opt = document.createElement("option"); | ||
196 | opt.textContent = blogArray[i]; | ||
197 | sel.appendChild(opt); | ||
198 | } | ||
199 | } | ||
244 | } | 200 | } |
245 | |||
246 | |||
247 | |||
248 | |||
249 | } | 201 | } |
250 | |||
251 | } | 202 | } |
252 | |||
253 | |||
254 | |||
255 | |||
256 | |||
257 | |||
258 | |||
259 | |||
260 | |||
261 | |||
262 | 203 | xhr.open("POST","http://y.a11y.in/blog",true); | |
263 | xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); | 204 | xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); |
264 | |||
265 | |||
266 | |||
267 | |||
268 | |||
269 | |||
270 | |||
271 | |||
272 | |||
273 | |||
274 | 205 | xhr.send('url='+encodeURIComponent(window.location.href)); | |
275 | } | 206 | } |
276 | }, | 207 | }, |
277 | |||
278 | |||
279 | |||
280 | |||
281 | 208 | go: function() { | |
209 | if (document.getElementById("blog-filter").value == "Choose a blog name") | ||
210 | { } | ||
211 | else { | ||
212 | window.open("http://y.a11y.in/web?foruri=" + encodeURIComponent(window.location.href) + "&blog=" + document.getElementById("blog-filter").value); | ||
282 | } | 213 | } |
283 | }, | 214 | }, |
284 | |||
285 | |||
286 | |||
287 | |||
288 | 215 | ||
289 | |||
290 | |||
291 | |||
292 | |||
293 | |||
294 | |||
295 | |||
296 | |||
297 | |||
298 | 216 | loadOverlay: function() { | |
217 | |||
218 | body = document.body; | ||
219 | |||
220 | jq = document.createElement("script"); | ||
221 | jq.setAttribute("type", "text/javascript"); | ||
222 | jq.setAttribute("src", "http://code.jquery.com/jquery-1.7.min.js"); | ||
223 | body.appendChild(jq); | ||
224 | |||
225 | jqlink = document.createElement("link"); | ||
226 | jqlink.setAttribute("rel", "stylesheet"); | ||
227 | jqlink.setAttribute("type", "text/css"); | ||
228 | jqlink.setAttribute("href", "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/ui-lightness/jquery-ui.css"); | ||
229 | body.appendChild(jqlink); | ||
230 | |||
231 | jscript = document.createElement("script"); | ||
232 | jscript.setAttribute("type", "text/javascript"); | ||
233 | jscript.setAttribute("src", "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"); | ||
234 | body.appendChild(jscript); | ||
235 | |||
236 | overlay = document.createElement("div"); | ||
237 | overlay.setAttribute("id", "renarrated_overlay"); | ||
238 | overlay.setAttribute("class", "ui-widget-header ui-corner-all"); | ||
239 | overlay.setAttribute("style", "position:fixed;top:0;width:80%;align:center;text-align:center;"); | ||
240 | body.appendChild(overlay); | ||
241 | |||
242 | show_box = document.createElement("div"); | ||
243 | show_box.setAttribute("id", "show-box"); | ||
244 | show_box.title = "Please choose one of the languages"; | ||
245 | body.appendChild(show_box); | ||
246 | |||
247 | show_links = document.createElement("div"); | ||
248 | show_links.setAttribute("id", "show-links"); | ||
249 | show_links.title = "Please choose one of the links"; | ||
250 | body.appendChild(show_links); | ||
251 | |||
252 | edit_current = document.createElement("input"); | ||
253 | edit_current.setAttribute("id", "edit-current"); | ||
254 | edit_current.setAttribute("type", "submit"); | ||
255 | edit_current.setAttribute("onclick", "a11ypi.editPage();"); | ||
256 | edit_current.setAttribute("value", "Re-narrate this page"); | ||
257 | overlay.appendChild(edit_current); | ||
258 | |||
259 | see_narration = document.createElement("input"); | ||
260 | see_narration.setAttribute("id", "see-narration"); | ||
261 | see_narration.setAttribute("type", "submit"); | ||
262 | see_narration.setAttribute("onclick", "a11ypi.showBox();"); | ||
263 | see_narration.setAttribute("value", "See other narrations"); | ||
264 | see_narration.disabled = true; | ||
265 | overlay.appendChild(see_narration); | ||
266 | a11ypi.ajax1(); | ||
267 | |||
268 | see_links = document.createElement("input"); | ||
269 | see_links.setAttribute("id", "see-links"); | ||
270 | see_links.setAttribute("type", "submit"); | ||
271 | see_links.setAttribute("onclick", "a11ypi.showBox1();"); | ||
272 | see_links.setAttribute("value", "Directory of narrations"); | ||
273 | see_links.disabled = true; | ||
274 | overlay.appendChild(see_links); | ||
275 | a11ypi.ajaxLinks1(); | ||
276 | |||
277 | blog_filter = document.createElement("select"); | ||
278 | blog_filter.setAttribute("id", "blog-filter"); | ||
279 | blog_filter.setAttribute("style", "min-width:200px;max-width:200px;"); | ||
280 | blog_filter.setAttribute("onclick", "a11ypi.blogFilter();"); | ||
281 | blog_option = document.createElement("option"); | ||
282 | blog_option.textContent = "Choose a blog name"; | ||
283 | blog_filter.appendChild(blog_option); | ||
284 | blog_filter.disabled = true; | ||
285 | overlay.appendChild(blog_filter); | ||
286 | |||
287 | go = document.createElement("input"); | ||
288 | go.setAttribute("id", "go"); | ||
289 | go.setAttribute("type", "submit"); | ||
290 | go.setAttribute("onclick", "a11ypi.go();"); | ||
291 | go.setAttribute("value", "Go"); | ||
292 | go.disabled = true; | ||
293 | overlay.appendChild(go); | ||
294 | }, | ||
295 | |||
299 | }; | 296 | }; |
297 | |||
298 | if (window.location.hostname != "y.a11y.in") { | ||
299 | $(document).load(a11ypi.loadOverlay()); | ||
300 | } |
server/wsgi/page_edit.js
1 | function page_edit( boltSlug, pageSlug, uploadSlug, editMode, hasEditPermission, successUrl) | 1 | function page_edit( boltSlug, pageSlug, uploadSlug, editMode, hasEditPermission, successUrl) |
---|---|---|---|
2 | { | 2 | { |
3 | 3 | ||
4 | 4 | var console, PopupControl, M4ImageElement,locName='',langName = '',styleName='',authorValue,locSel='',langSel=''; | |
5 | var editAttributes, elementAttributes, fontTypeAttributes, normalFontAttributes, popupContainerAttributes, editButtonAttributes, editTextInputAttributes, editSubmitAttributes, editTitleAttributes, panelButtonAttributes, buttonPanelAttributes, actionPanelAttributes, closeButtonAttributes, actionButtonAttributes, redButtonAttributes, leftBorderStyle, rightBorderStyle, titleButtonImageAttributes, titleButtonDisplayTextAttributes, actionButtonImageAttributes, actionButtonDisplayTextAttributes,greyArrowAttributes, pageEditor, splashWindow, loadingTimerId, keepOriginal = false; | 5 | var editAttributes, elementAttributes, fontTypeAttributes, normalFontAttributes, popupContainerAttributes, editButtonAttributes, editTextInputAttributes, editSubmitAttributes, editTitleAttributes, panelButtonAttributes, buttonPanelAttributes, actionPanelAttributes, closeButtonAttributes, actionButtonAttributes, redButtonAttributes, leftBorderStyle, rightBorderStyle, titleButtonImageAttributes, titleButtonDisplayTextAttributes, actionButtonImageAttributes, actionButtonDisplayTextAttributes,greyArrowAttributes, pageEditor, splashWindow, loadingTimerId, keepOriginal = false; |
6 | 6 | ||
7 | /** | 7 | /** |
… | … | ||
47 | buffer.push(string); | 47 | buffer.push(string); |
48 | return this; | 48 | return this; |
49 | }; | 49 | }; |
50 | 50 | console.log("inside buffer"); | |
51 | console.log(buffer); | ||
51 | this.toString = function toString() { | 52 | this.toString = function toString() { |
52 | return buffer.join(''); | 53 | return buffer.join(''); |
53 | }; | 54 | }; |
… | … | ||
1808 | overlayBar.blogpost(); | 1808 | overlayBar.blogpost(); |
1809 | } | 1809 | } |
1810 | }, | 1810 | }, |
1811 | 1811 | close: function() { | |
1812 | $( "#targetoverlay" ).hide(); | 1812 | $( "#targetoverlay" ).hide(); |
1813 | }, | 1813 | }, |
1814 | }); | 1814 | }); |
1815 | |||
1816 | |||
1817 | |||
1818 | |||
1819 | |||
1820 | |||
1821 | |||
1822 | |||
1823 | |||
1824 | }); | 1815 | }); |
1825 | 1816 | ||
1826 | $("#loc-bt").click(function () { | 1817 | $("#loc-bt").click(function () { |
1827 | if(document.getElementById('loc-bt').value == '+'){ | 1818 | if(document.getElementById('loc-bt').value == '+'){ |
1828 | //remove input field and create a combo box | 1819 | //remove input field and create a combo box |
1829 | $('#loc-select').hide(); | 1820 | $('#loc-select').hide(); |
1830 | 1821 | var def_loc = ['Srilanka','Colombo','Moratuwa']; | |
1831 | locSel= document.createElement("select"); | 1822 | locSel= document.createElement("select"); |
1832 | locSel.setAttribute("id","loct-select"); | 1823 | locSel.setAttribute("id","loct-select"); |
1833 | locSel.setAttribute("type","text"); | 1824 | locSel.setAttribute("type","text"); |
1834 | locSel.setAttribute("alipielements", "alipi"); | 1825 | locSel.setAttribute("alipielements", "alipi"); |
1835 | locSel.setAttribute("style","position:absolute;top:5%;left:40%;width:250px;"); | 1826 | locSel.setAttribute("style","position:absolute;top:5%;left:40%;width:250px;"); |
1836 | 1827 | for(i=0;i<def_loc.length;i++){ | |
1837 | locopt = document.createElement("option"); | 1828 | locopt = document.createElement("option"); |
1838 | 1829 | theText=document.createTextNode(def_loc[i]); | |
1839 | locopt.appendChild(theText); | 1830 | locopt.appendChild(theText); |
1840 | locSel.appendChild(locopt); | 1831 | locSel.appendChild(locopt); |
1841 | } | 1832 | } |
… | … | ||
1849 | if(document.getElementById('lang-bt').value == '+'){ | 1849 | if(document.getElementById('lang-bt').value == '+'){ |
1850 | //remove input field and create a combo box | 1850 | //remove input field and create a combo box |
1851 | $('#lang-select').hide(); | 1851 | $('#lang-select').hide(); |
1852 | 1852 | var def_lang = ['Sinhala','Tamil','English']; | |
1853 | langSel= document.createElement("select"); | 1853 | langSel= document.createElement("select"); |
1854 | langSel.setAttribute("id","langs-select"); | 1854 | langSel.setAttribute("id","langs-select"); |
1855 | langSel.setAttribute("type","text"); | 1855 | langSel.setAttribute("type","text"); |
1856 | langSel.setAttribute("alipielements", "alipi"); | 1856 | langSel.setAttribute("alipielements", "alipi"); |
1857 | langSel.setAttribute("style","position:absolute;top:25%;left:40%;width:250px;"); | 1857 | langSel.setAttribute("style","position:absolute;top:25%;left:40%;width:250px;"); |
1858 | 1858 | for(i=0;i<def_lang.length;i++){ | |
1859 | langopt = document.createElement("option"); | 1859 | langopt = document.createElement("option"); |
1860 | 1860 | theText=document.createTextNode(def_lang[i]); | |
1861 | langopt.appendChild(theText); | 1861 | langopt.appendChild(theText); |
1862 | langSel.appendChild(langopt); | 1862 | langSel.appendChild(langopt); |
1863 | } | 1863 | } |
… | … | ||
2960 | overlayDiv = document.createElement("div"); | 2960 | overlayDiv = document.createElement("div"); |
2961 | overlayDiv.setAttribute("id", "overlay-div"); | 2961 | overlayDiv.setAttribute("id", "overlay-div"); |
2962 | overlayDiv.setAttribute("alipielements", "alipi"); | 2962 | overlayDiv.setAttribute("alipielements", "alipi"); |
2963 | 2963 | overlayDiv.setAttribute("style", "position:fixed; z-index:1001; left:0; top:0; min-width:800px; width:100%; height:30px; background-color:rgba(0, 0, 0, 0.5);"); | |
2964 | document.body.appendChild(overlayDiv); | 2964 | document.body.appendChild(overlayDiv); |
2965 | 2965 | ||
2966 | 2966 | ||
… | … | ||
2968 | image.setAttribute("id", "close-image"); | 2968 | image.setAttribute("id", "close-image"); |
2969 | image.setAttribute("alipielements", "alipi"); | 2969 | image.setAttribute("alipielements", "alipi"); |
2970 | image.setAttribute("src", "http://dev.a11y.in/alipi/images/close_button.png"); | 2970 | image.setAttribute("src", "http://dev.a11y.in/alipi/images/close_button.png"); |
2971 | 2971 | image.setAttribute("style", "position:fixed;left:1px;width:25px;height:28px;"); | |
2972 | overlayDiv.appendChild(image); | 2972 | overlayDiv.appendChild(image); |
2973 | image.onclick=function(){ | 2973 | image.onclick=function(){ |
2974 | answer = confirm("Do you really want to exit the editor?") | 2974 | answer = confirm("Do you really want to exit the editor?") |
… | … | ||
2982 | messageDiv = document.createElement("div"); | 2982 | messageDiv = document.createElement("div"); |
2983 | messageDiv.setAttribute("id", "message-div"); | 2983 | messageDiv.setAttribute("id", "message-div"); |
2984 | messageDiv.setAttribute("alipielements", "alipi"); | 2984 | messageDiv.setAttribute("alipielements", "alipi"); |
2985 | 2985 | messageDiv.setAttribute("style", "position:fixed;left:10%;top:0;font-size:23px;font-weight:bold;color:#ffe;"); | |
2986 | overlayDiv.appendChild(messageDiv); | 2986 | overlayDiv.appendChild(messageDiv); |
2987 | 2987 | ||
2988 | helpLink = document.createElement("input"); | 2988 | helpLink = document.createElement("input"); |
… | … | ||
2990 | helpLink.setAttribute("alipielements", "alipi"); | 2990 | helpLink.setAttribute("alipielements", "alipi"); |
2991 | helpLink.setAttribute("type", "submit"); | 2991 | helpLink.setAttribute("type", "submit"); |
2992 | helpLink.setAttribute("Value", "Help"); | 2992 | helpLink.setAttribute("Value", "Help"); |
2993 | 2993 | helpLink.setAttribute("style", "position:fixed;top:0;right:35%;font-size:18px;font-weight:bold;width:100px;height:30px;"); | |
2994 | overlayDiv.appendChild(helpLink); | 2994 | overlayDiv.appendChild(helpLink); |
2995 | helpLink.onclick = function helpLinkOnClick() { | 2995 | helpLink.onclick = function helpLinkOnClick() { |
2996 | helpWindow = new HelpWindow(pageEditor); | 2996 | helpWindow = new HelpWindow(pageEditor); |
… | … | ||
3005 | undoButton.setAttribute("alipielements", "alipi"); | 3005 | undoButton.setAttribute("alipielements", "alipi"); |
3006 | undoButton.setAttribute("type", "submit"); | 3006 | undoButton.setAttribute("type", "submit"); |
3007 | undoButton.setAttribute("Value", "Undo"); | 3007 | undoButton.setAttribute("Value", "Undo"); |
3008 | 3008 | undoButton.setAttribute("style", "position:fixed;top:0;right:20%;font-size:18px;font-weight:bold;width:100px;height:30px;"); | |
3009 | overlayDiv.appendChild(undoButton); | 3009 | overlayDiv.appendChild(undoButton); |
3010 | undoButton.onclick = function undoButtonOnClick() { | 3010 | undoButton.onclick = function undoButtonOnClick() { |
3011 | pageEditor.commandUndo(); | 3011 | pageEditor.commandUndo(); |
… | … | ||
3018 | publishButton.setAttribute("alipielements", "alipi"); | 3018 | publishButton.setAttribute("alipielements", "alipi"); |
3019 | publishButton.setAttribute("type", "submit"); | 3019 | publishButton.setAttribute("type", "submit"); |
3020 | publishButton.setAttribute("Value", "Publish"); | 3020 | publishButton.setAttribute("Value", "Publish"); |
3021 | 3021 | publishButton.setAttribute("style", "position:fixed;top:0;right:5%;font-size:18px;font-weight:bold;width:100px;height:30px;"); | |
3022 | overlayDiv.appendChild(publishButton); | 3022 | overlayDiv.appendChild(publishButton); |
3023 | var dialog = 0; | 3023 | var dialog = 0; |
3024 | publishButton.onclick = function publishButtonOnClick() { | 3024 | publishButton.onclick = function publishButtonOnClick() { |
… | … | ||
3037 | 3037 | ||
3038 | 3038 | ||
3039 | this.blogpost = function blogpost() { | 3039 | this.blogpost = function blogpost() { |
3040 | 3040 | console.log("locSel.value"); | |
3041 | console.log(locSel.value); | ||
3042 | console.log("langSel.value"); | ||
3043 | console.log(langSel.value); | ||
3044 | if (styleSelect.value == "" || author.value == "" ||(ourcheck.checked == false && yourcheck.checked == false) || locName.value == "" && document.getElementById('loct-select') === null || langName.value == "" && document.getElementById('langs-select') === null){ | ||
3041 | alert("Please give all the details, it will be used further"); | 3045 | alert("Please give all the details, it will be used further"); |
3042 | 3046 | } else { | |
3043 | pageEditor.commandPublish(); | 3047 | pageEditor.commandPublish(); |
3044 | pageEditor.showMessage("... Please wait, your blog is being posted"); | 3048 | pageEditor.showMessage("... Please wait, your blog is being posted"); |
3045 | $('#targetoverlay').remove(); | 3049 | $('#targetoverlay').remove(); |
… | … | ||
3052 | // End of okButton function | 3052 | // End of okButton function |
3053 | 3053 | ||
3054 | this.show = function show(activate) { | 3054 | this.show = function show(activate) { |
3055 | |||
3056 | var disabled = true; | 3055 | var disabled = true; |
3057 | var opacity = '0.4'; | 3056 | var opacity = '0.4'; |
3058 | if (activate) { | 3057 | if (activate) { |
… | … | ||
3156 | switch (event.keyCode) { | 3156 | switch (event.keyCode) { |
3157 | case 27: | 3157 | case 27: |
3158 | // ESC | 3158 | // ESC |
3159 | |||
3160 | |||
3161 | |||
3162 | 3159 | // event.preventDefault(); | |
3160 | // event.stopPropagation(); | ||
3161 | // pageEditor.close(); | ||
3162 | // return false; | ||
3163 | // case 77: | 3163 | // case 77: |
3164 | // // "m" | 3164 | // // "m" |
3165 | // if (pageEditor.hasFocus()) { | 3165 | // if (pageEditor.hasFocus()) { |
… | … | ||
3354 | 3354 | ||
3355 | this.publish = function publish() { | 3355 | this.publish = function publish() { |
3356 | var result; | 3356 | var result; |
3357 | 3357 | if(document.getElementById('your-check').checked && window.location.hostname !='y.a11y.in') | |
3358 | { | 3358 | { |
3359 | localStorage.myContent = buildDataString(); | 3359 | localStorage.myContent = buildDataString(); |
3360 | window.location.href = "http://localhost/test.html"; | 3360 | window.location.href = "http://localhost/test.html"; |
… | … | ||
3418 | buffer.append('about='); //url=about //removed '&' on purpose | 3418 | buffer.append('about='); //url=about //removed '&' on purpose |
3419 | buffer.append(window.location.search.split('=')[1]); | 3419 | buffer.append(window.location.search.split('=')[1]); |
3420 | buffer.append('&lang=');//lang | 3420 | buffer.append('&lang=');//lang |
3421 | 3421 | if (langName.value != "") | |
3422 | buffer.append(encodeURIComponent(langName.value)); | ||
3423 | else | ||
3424 | buffer.append(encodeURIComponent(langSel.value)); | ||
3422 | buffer.append('&location=');//location | 3425 | buffer.append('&location=');//location |
3423 | 3426 | if (locName.value != "") | |
3427 | buffer.append(encodeURIComponent(locName.value)); | ||
3428 | else | ||
3429 | buffer.append(encodeURIComponent(locSel.value)); | ||
3424 | buffer.append('&style=');//style | 3430 | buffer.append('&style=');//style |
3425 | buffer.append(encodeURIComponent(styleSelect.value)); | 3431 | buffer.append(encodeURIComponent(styleSelect.value)); |
3426 | buffer.append('&blog='); //blog where to post | 3432 | buffer.append('&blog='); //blog where to post |
… | … | ||
3527 | // passthrough | 3527 | // passthrough |
3528 | } else if (event.target.getAttribute('m4pageedittype')) { | 3528 | } else if (event.target.getAttribute('m4pageedittype')) { |
3529 | // passthrough | 3529 | // passthrough |
3530 | 3530 | } else if (event.target.id == "lang-select" || event.target.id == "loc-select" || event.target.id == "loc-bt" || event.target.id == "lang-bt" || alipiElements) { | |
3531 | // passthrough | 3531 | // passthrough |
3532 | } else if (event.clientX > document.body.clientWidth || event.clientY > document.body.clientHeight) { | 3532 | } else if (event.clientX > document.body.clientWidth || event.clientY > document.body.clientHeight) { |
3533 | // passthrough if this click was outside of the html page, meaning on a scrollbar | 3533 | // passthrough if this click was outside of the html page, meaning on a scrollbar |