New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize Anchor Tags options #187

Closed
neocotic opened this Issue May 13, 2013 · 3 comments

Comments

Projects
None yet
1 participant
@neocotic
Member

neocotic commented May 13, 2013

I want to make the "Anchor Tags" section of the options page more general and applicable to links.

anchorTarget should be something like linkNew to show that templates should be instructed to render links that open in new tabs/windows where possible.

anchorTitle should be something like linkTitle to show that templates should be instructed to render links with a corresponding title where possible.

Emphasis on the "where possible" as this can be implemented by predefined and custom templates to generate any kind of markup link (HTML, Wiki, Markdown etc.), some of which don't support the functionality.

Backwards compatibility is obviously vital here and predefined templates should be updated to reflect this, again, where possible.

@ghost ghost assigned neocotic May 13, 2013

neocotic added a commit that referenced this issue May 13, 2013

completes #187 by making the anchor tags section of the options page …
…and its corresponding options more general for links

@neocotic neocotic referenced this issue May 14, 2013

Merged

General links #190

@neocotic

This comment has been minimized.

Member

neocotic commented May 14, 2013

Backup/restore developer functionality on store appears to be broken. Will have to have a look into this as it's preventing me from testing updates from previous version(s).

@neocotic

This comment has been minimized.

Member

neocotic commented May 14, 2013

Backup/restore will be fixed as part of #190 for convenience sake. Also, executing the following on the background page of older versions works as a good polyfiller:

(function () {
  var __store__ = window.__store__ = {};
  __store__.backup = function () {
    var obj = {}, prop;
    for (prop in localStorage) {
      if (localStorage.hasOwnProperty(prop)) {
        obj[prop] = JSON.parse(localStorage[prop]);
      }
    }
    return encodeURIComponent(JSON.stringify(obj));
  };
  __store__.clear = function () {
    localStorage.clear();
  };
  __store__.restore = function (str) {
    var obj, prop;
    obj = JSON.parse(decodeURIComponent(str));
    for (prop in obj) {
      if (obj.hasOwnProperty(prop)) {
        localStorage[prop] = JSON.stringify(obj[prop]);
      }
    }
  };
}());

Unfortunately, the JS console can sometimes truncate strings with ... meaning they can't be used to restore or the do so badly. If you do this in the background page console you can leverage Template's internal clipboard interface. For example;

ext.copy(__store__.backup(), true);
@neocotic

This comment has been minimized.

Member

neocotic commented May 14, 2013

These changes have been implemented as part of PR #190.

Additionally, the backup/restore developer functionality in store.coffee has been fixed.

@neocotic neocotic closed this May 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment