| | 682 | window.removeArguments = function() { |
| | 683 | function removeParam( key, sourceURL ) { |
| | 684 | var rtn = sourceURL.split("?")[0], param, params_arr = [], |
| | 685 | queryString = (sourceURL.indexOf("?") !== -1) ? sourceURL.split("?")[1] : ""; |
| | 686 | if (queryString !== "") { |
| | 687 | params_arr = queryString.split("&"); |
| | 688 | for (var i = params_arr.length - 1; i >= 0; i -= 1) { |
| | 689 | param = params_arr[i].split("=")[0]; |
| | 690 | if ($.inArray( param, key ) > -1 ) { |
| | 691 | params_arr.splice(i, 1); |
| | 692 | } |
| | 693 | } |
| | 694 | rtn = rtn + "?" + params_arr.join("&"); |
| | 695 | } |
| | 696 | return rtn; |
| | 697 | } |
| | 698 | |
| | 699 | var remove_query_args=[ 'user_switched', 'switched_off', 'switched_back', |
| | 700 | 'message', 'updated', 'settings-updated', 'saved', |
| | 701 | 'activated', 'activate', 'deactivate', |
| | 702 | 'locked', 'skipped', 'deleted', 'trashed', 'untrashed' ]; |
| | 703 | |
| | 704 | url = $location.attr( 'href' ); |
| | 705 | url = removeParam( remove_query_args, url ); |
| | 706 | |
| | 707 | if ( typeof history.replaceState === 'function' ) { |
| | 708 | history.replaceState( {},'', url ); |
| | 709 | } |
| | 710 | }; |
| | 711 | |