For your consideration. This patch does the following:

  1. Eliminates the need to use JS for getting/setting paths.
  2. Does not require any CSS/JS magic to show or hide the home button.
  3. Only interferes with the Home buttons of Navbar and Toolbar when necessary.
  4. Provides a helper function to return the correct escape admin path.
  5. Fixes title attribute for the Navbar escape admin to 'Return to site content'
  6. Retains Drupal path aliases (ex: changes link to '/test-node' rather than '/node/1')
  7. Replaces JS localstorage with a PHP Session variable.

Comments

dave reid’s picture

Status: Needs review » Postponed

Because this represents a regression in functionality from D8 (storing the path in $_SESSION means that having two different tabs overwrites the 'Back to site' context of the other's tab), this will not be committed. Because I am not adding anything to this module aside from backporting any changes from Drupal 8 core's toolbar, or adding integrations with other D7 toolbars (but not changing functionality), I will leave this as postponed so that others may find it and use it in make files.

dave reid’s picture

Feel free to also discuss in #2208473: Backport the 'Back to Site' link from Drupal 8 core with the Spark/Navbar maintainers about this proposal as well.

dave reid’s picture

I did commit #5 in the list for the fixing the title attribute. That was a valid necessary change to match D8's exact functionality: http://drupalcode.org/project/escape_admin.git/commit/ecd3f58

saltednut’s picture

Thanks for your review, I was just about to post a followup about #5 since it was somewhat unrelated.

saltednut’s picture

Title: Cleanup Escape Admin to be better than D8 counterpart » Change Escape Admin to use sessions & Fix Navbar title attribute
rkent_87’s picture

Has this been updated? iOS7 does not allow for localStorage or sessionStorage when in private mode. I have found that one of my sites does not run javascript properly in iOS7 Safari private mode while this module is enabled. Disabling the module fixes the issue but I'd rather keep this enabled tbh.

http://stackoverflow.com/questions/18860098/on-a-browser-sessionstorage-...