# HG changeset patch # User Edho Arief # Date 1352708461 -25200 # Node ID a836cfe4092fe28b7f119534f14ed7a2a3d06468 # Parent dd7181c021de3c6ec32e4d13e80f2f48f41ddc60 Use hash instead of search because IE can't into replaceState. Also probably better cached by browsers. diff -r dd7181c021de -r a836cfe4092f app/assets/javascripts/init.tabs.js --- a/app/assets/javascripts/init.tabs.js Mon Nov 12 14:38:32 2012 +0700 +++ b/app/assets/javascripts/init.tabs.js Mon Nov 12 15:21:01 2012 +0700 @@ -14,14 +14,14 @@ var paste = $('#paste'), mode = paste.data('mode'), width = paste.data('width'), - qstring = '?' + mode + '.' + width; + qstring = '#' + mode + '.' + width; if (width == 'auto') { - qstring = '?'; + qstring = '#'; if (mode != 'plain') { qstring += mode; } } - history.replaceState(null, '', qstring); + window.location = qstring; }; paste_resize = function(size) { @@ -48,7 +48,7 @@ return false; }); - mode = window.location.search.substr(1).split('.'); + mode = window.location.hash.substr(1).split('.'); if (mode[0] == 'highlight') { $('#paste-tabs li:eq(1) a').click(); } else if (mode[0] == 'markdown') { $('#paste-tabs li:eq(2) a').click(); } if (mode[1] && mode[1].match(/^\d+px$/)) { paste_resize(mode[1]); }