summaryrefslogtreecommitdiffstats
path: root/src/navtree_js.h
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2012-07-29 10:11:12 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2012-07-29 10:11:12 (GMT)
commita934b38cd8b355648e0c07123a99e222ce7cd12b (patch)
treeb0768f059d8b116092a15f295347b3797f43e6c0 /src/navtree_js.h
parentae962ae4a4dd46f4730982f97110cbf3d2aef397 (diff)
downloadDoxygen-a934b38cd8b355648e0c07123a99e222ce7cd12b.zip
Doxygen-a934b38cd8b355648e0c07123a99e222ce7cd12b.tar.gz
Doxygen-a934b38cd8b355648e0c07123a99e222ce7cd12b.tar.bz2
Release-1.8.1.2-20120729
Diffstat (limited to 'src/navtree_js.h')
-rw-r--r--src/navtree_js.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/navtree_js.h b/src/navtree_js.h
index fee88b3..aa57a13 100644
--- a/src/navtree_js.h
+++ b/src/navtree_js.h
@@ -22,9 +22,15 @@
"\n"
"function localStorageSupported()\n"
"{\n"
-" return 'localStorage' in window && window['localStorage'] !== null;\n"
+" try {\n"
+" return 'localStorage' in window && window['localStorage'] !== null && window.localStorage.getItem;\n"
+" }\n"
+" catch(e) {\n"
+" return false;\n"
+" }\n"
"}\n"
"\n"
+"\n"
"function storeLink(link)\n"
"{\n"
" if (!$(\"#nav-sync\").hasClass('sync') && localStorageSupported()) {\n"
@@ -411,16 +417,26 @@
" }\n"
"}\n"
"\n"
+"function showSyncOff(n,relpath)\n"
+"{\n"
+" n.html('<img src=\"'+relpath+'sync_off.png\" title=\"'+SYNCOFFMSG+'\"/>');\n"
+"}\n"
+"\n"
+"function showSyncOn(n,relpath)\n"
+"{\n"
+" n.html('<img src=\"'+relpath+'sync_on.png\"/ title=\"'+SYNCONMSG+'\">');\n"
+"}\n"
+"\n"
"function toggleSyncButton(relpath)\n"
"{\n"
" var navSync = $('#nav-sync');\n"
" if (navSync.hasClass('sync')) {\n"
" navSync.removeClass('sync');\n"
-" navSync.html('<img src=\"'+relpath+'sync_off.png\"/>');\n"
+" showSyncOff(navSync,relpath);\n"
" storeLink(stripPath2($(location).attr('pathname'))+$(location).attr('hash'));\n"
" } else {\n"
" navSync.addClass('sync');\n"
-" navSync.html('<img src=\"'+relpath+'sync_on.png\"/>');\n"
+" showSyncOn(navSync,relpath);\n"
" deleteLink();\n"
" }\n"
"}\n"
@@ -448,10 +464,10 @@
" if (localStorageSupported()) {\n"
" var navSync = $('#nav-sync');\n"
" if (cachedLink()) {\n"
-" navSync.html('<img src=\"'+relpath+'sync_off.png\"/>');\n"
+" showSyncOff(navSync,relpath);\n"
" navSync.removeClass('sync');\n"
" } else {\n"
-" navSync.html('<img src=\"'+relpath+'sync_on.png\"/>');\n"
+" showSyncOn(navSync,relpath);\n"
" }\n"
" navSync.click(function(){ toggleSyncButton(relpath); });\n"
" }\n"