Subversion Repositories oidplus

Rev

Rev 1349 | Rev 1408 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1349 Rev 1400
Line 221... Line 221...
221
                        // TODO: Use oidplus_ajax_success(), since this checks the existance of "error" in data, and checks if status>=0
221
                        // TODO: Use oidplus_ajax_success(), since this checks the existance of "error" in data, and checks if status>=0
222
                        if ("error" in data) {
222
                        if ("error" in data) {
223
                                alertError(_L("Failed to load content: %1",data.error));
223
                                alertError(_L("Failed to load content: %1",data.error));
224
                                console.error(data.error);
224
                                console.error(data.error);
225
                        } else if (data.status >= 0) {
225
                        } else if (data.status >= 0) {
226
                                data.id = id;
226
                                if (!("id" in data)) data.id = id;
227
 
227
 
228
                                var state = {
228
                                var state = {
229
                                        "node_id":id,
229
                                        "node_id":data.id,
230
                                        "titleHTML":(data.icon ? '<img src="'+data.icon+'" width="48" height="48" alt="'+data.title.htmlentities()+'"> ' : '') + data.title.htmlentities(),
230
                                        "titleHTML":(data.icon ? '<img src="'+data.icon+'" width="48" height="48" alt="'+data.title.htmlentities()+'"> ' : '') + data.title.htmlentities(),
231
                                        "textHTML":data.text,
231
                                        "textHTML":data.text,
232
                                        "staticlinkHREF":oidplus_webpath_absolute_canonical+"?goto="+encodeURIComponent(id),
232
                                        "staticlinkHREF":oidplus_webpath_absolute_canonical+"?goto="+encodeURIComponent(data.id),
233
                                };
233
                                };
234
                                if (current_node != id) {
234
                                if (current_node != data.id) {
235
                                        window.history.pushState(state, data.title, "?goto="+encodeURIComponent(id));
235
                                        window.history.pushState(state, data.title, "?goto="+encodeURIComponent(data.id));
236
                                } else {
236
                                } else {
237
                                        window.history.replaceState(state, data.title, "?goto="+encodeURIComponent(id));
237
                                        window.history.replaceState(state, data.title, "?goto="+encodeURIComponent(data.id));
238
                                }
238
                                }
239
 
239
 
240
                                document.title = combine_systemtitle_and_pagetitle(getOidPlusSystemTitle(), data.title);
240
                                document.title = combine_systemtitle_and_pagetitle(getOidPlusSystemTitle(), data.title);
241
 
241
 
242
                                if (data.icon) {
242
                                if (data.icon) {
Line 244... Line 244...
244
                                } else {
244
                                } else {
245
                                        $('#real_title').html(data.title.htmlentities());
245
                                        $('#real_title').html(data.title.htmlentities());
246
                                }
246
                                }
247
                                $('#real_content').html(data.text);
247
                                $('#real_content').html(data.text);
248
                                document.title = combine_systemtitle_and_pagetitle(getOidPlusSystemTitle(), data.title);
248
                                document.title = combine_systemtitle_and_pagetitle(getOidPlusSystemTitle(), data.title);
249
                                current_node = id;
249
                                current_node = data.id;
250
 
250
 
251
                                executeAllCallbacks(pageLoadedCallbacks.anyPageLoad);
251
                                executeAllCallbacks(pageLoadedCallbacks.anyPageLoad);
252
                                executeAllCallbacks(pageLoadedCallbacks.ajaxPageLoad);
252
                                executeAllCallbacks(pageLoadedCallbacks.ajaxPageLoad);
253
 
253
 
254
                                if (anchor != '') {
254
                                if (anchor != '') {