Skip to content

Commit

Permalink
Add user option to delimit tags with single spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
rocketraman committed Jan 17, 2014
1 parent 4f29a30 commit f10b882
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
12 changes: 11 additions & 1 deletion assets/javascripts/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@
link['domain'] = link['href'].replace(/^(.*\/\/[^\/?#]*).*$/, '$1');
link['private'] = (link.shared === 'no') ? true : false;

link.tags = link.tag.split(' ');
var split = (localStorage.getItem('chrome-ext-delicious-parse-single-space')) === 'true' ? / [ ]?/ : " ";
link.tags = link.tag.split(split);
delete link.tag;

return link;
Expand Down Expand Up @@ -805,6 +806,15 @@
$scope.$watch('filterTime', function(value) {
localStorage.setItem('chrome-ext-delicious-filter-time', value);
});

// api options
$scope.parseSingleSpace = (localStorage.getItem('chrome-ext-delicious-parse-single-space')) === 'true' ? true : false;

$scope.$watch('parseSingleSpace', function(value) {
localStorage.setItem('chrome-ext-delicious-parse-single-space', value);
// need to reload links when this setting is changed
localStorage.removeItem('chrome-ext-delicious-links');
});
});


Expand Down
12 changes: 11 additions & 1 deletion updated.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h1>@Delicious 2.9.5</h1>

<section class="animated fadeIn">

<h4 class="latest">Note: When using Delicious.com and this extension, multiple tags could return as one tag. This is due to how the API returns these tags. Sometimes they're returned as double-spaced delimited, sometimes tags are single space delimited. This extension uses double-spaced delimiting for the ability to have multi-word tags. So as long as you save tags through this extension it will work in both locations. -Zach</h4>
<h4 class="latest">Note: When using Delicious.com and this extension, multiple tags could return as one tag. This is due to how the API returns these tags. Sometimes they're returned as double-spaced delimited, sometimes tags are single space delimited. This extension uses double-spaced delimiting for the ability to have multi-word tags. So as long as you save tags through this extension it will work in both locations. If none of your delicious tags contain any spaces, then you can check the "My tags have no spaces" option, and all tags will be delimited correctly. -Zach</h4>

<p class="twitter">Get New Feature updates on Twitter - <a href="https://twitter.com/@deliciousext">@DeliciousExt</a></p>

Expand All @@ -22,6 +22,9 @@ <h4 class="latest">Note: When using Delicious.com and this extension, multiple t
<h2>New Features</h2>
<ul>
<li class="latest">
Added option to single-space delimit tags when user's tags contain no spaces. Thanks @Rocketraman
</li>
<li>
Added ability for selected text to auto-fill extended description field when using context menu - Thanks for the idea @Tomasz
</li>
<li>
Expand Down Expand Up @@ -66,6 +69,13 @@ <h2>Changelog</h2>
<p>Found an issue or want to see a feature implemented? <a href="https://chrome.google.com/webstore/support/pplcoloalmjgljnbpkhcojpjnjbggppe?hl=en&gl=US#bug" target="_blank">Send Feedback</a></p>

<article class="latest">
<h4>Version 2.9.6 (in development)</h4>
<ul>
<li>Feature - handle single space delimited tags via user option.</li>
</ul>
</article>

<article>
<h4>Version 2.9.5</h4>
<ul>
<li>Fixed - increased limitation of bookmarks from 1000 to 10000 - Thanks @Matteo</li>
Expand Down
5 changes: 5 additions & 0 deletions views/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@ <h1>Options</h1>

</fieldset>

<fieldset>
<legend>API Settings (Advanced)</legend>
<input type="checkbox" id="parse-single-space" ng-model="parseSingleSpace" ng-checked="parseSingleSpace" />
<label for="parse-single-space">Parse single space between tags as a delimiter (my tags don't have spaces)</label>
</fieldset>
</main>
</section>

0 comments on commit f10b882

Please sign in to comment.