TagSpaces is an offline, open source, document manager with tagging support
Duplicating tagsgroup functionality replaced by a create taggroups
uggrockab020044eec8
diff --git a/data/index.html b/data/index.htmlindex a3a58d1a8..217fe56dc 100644--- a/data/index.html+++ b/data/index.html@@ -224,17 +224,17 @@</form></div>- <div id="dialog-taggroupDupicate" title="Duplicate Taggroup">+ <div id="dialog-taggroupCreate" title="Create Taggroup"><p class="validateTips">All form fields are required.</p><form action="javascript:void(0);"><fieldset><p><label for="name">Name</label><input type="text" name="name" id="newTagGroupName" />- </p><p>+ </p><!--p><label for="key">Key(unique key of 3 letters)</label><input type="text" name="key" id="newTagGroupKey" />- </p>+ </p--></fieldset></form></div>@@ -280,7 +280,8 @@<ul id="tagGroupMenu" class="dropdown-menu has-tip"><!--li action="toggleTagGroup" title="Opens or Close the selected tagroup"><a href="javascript:void(0);">Toggle Taggroup</a></li--><li action="createNewTag" title="Creates new tag"><a href="javascript:void(0);"><span class="ui-icon ui-icon-tag"></span>Create Tag</a></li>- <li action="duplicateTagGroup" title="Duplicate current tagroup"><a href="javascript:void(0);"><span class="ui-icon ui-icon-copy"></span>Duplicate Taggroup</a></li>+ <!--li action="duplicateTagGroup" title="Duplicate current tagroup"><a href="javascript:void(0);"><span class="ui-icon ui-icon-copy"></span>Duplicate Taggroup</a></li-->+ <li action="createTagGroup" title="Create new tagroup"><a href="javascript:void(0);"><span class="ui-icon ui-icon-copy"></span>Create Taggroup</a></li><li action="editTagGroup" title="Edit current tagroup"><a href="javascript:void(0);"><span class="ui-icon ui-icon-wrench"></span>Edit Taggroup</a></li><li action="deleteTagGroup" title="Delete current tagroup"><a href="javascript:void(0);"><span class="ui-icon ui-icon-trash"></span>Delete Taggroup</a></li></ul>diff --git a/data/js/settings.api.js b/data/js/settings.api.jsindex a76240ce0..d828f5e7b 100644--- a/data/js/settings.api.js+++ b/data/js/settings.api.js@@ -32,13 +32,10 @@ define(function(require, exports, module) {"path": undefined}- // not usedvar tagGroupTemplate = {"title": undefined,- "isFolder": true,"key": undefined,- "expand": true,- "noLink": false,+ "expanded": true,"children": []}@@ -333,6 +330,20 @@ define(function(require, exports, module) {exports.Settings["tagGroups"].push(newTagGroupModel);saveSettings();}++ var createTagGroup = function(tagData, tagGroupName) {+ var newTagGroupModel = JSON.parse( JSON.stringify( tagGroupTemplate ) );+ newTagGroupModel.title = tagGroupName;+ //newTagGroupModel.children = [];+ newTagGroupModel.key = ""+getRandomInt(10000,99999);+ console.debug("Creating taggroup: "+JSON.stringify(newTagGroupModel)+" with key: "+newTagGroupModel.key);+ exports.Settings["tagGroups"].push(newTagGroupModel);+ saveSettings();+ }++ var moveTagGroup = function(tagData, tagGroupName) {++ }var createFavorite = function(name, location) {var newFavoriteModel = JSON.parse( JSON.stringify(favoriteTemplate));@@ -398,6 +409,10 @@ define(function(require, exports, module) {console.debug('Tagspace Settings Saved!');}+ var getRandomInt = function(min, max) {+ return Math.floor(Math.random() * (max - min + 1)) + min;+ }+// Public API definitionexports.upgradeSettings = upgradeSettings;exports.getExtensions = getExtensions;@@ -415,6 +430,7 @@ define(function(require, exports, module) {exports.editTag = editTag;exports.createTag = createTag;exports.editTagGroup = editTagGroup;+ exports.createTagGroup = createTagGroup;exports.duplicateTagGroup = duplicateTagGroup;exports.createFavorite = createFavorite;exports.deleteFavorite = deleteFavorite;diff --git a/data/js/tags.ui.js b/data/js/tags.ui.jsindex 45ff3bd9c..45ca678ee 100644--- a/data/js/tags.ui.js+++ b/data/js/tags.ui.js@@ -90,8 +90,8 @@ define(function(require, exports, module) {case "deleteTagGroup":$( "#dialog-confirmtaggroupdelete" ).dialog( "open" );break;- case "duplicateTagGroup":- $( "#dialog-taggroupDupicate" ).dialog( "open" );+ case "createTagGroup":+ $( "#dialog-taggroupCreate" ).dialog( "open" );break;case "editTagGroup":$( "#tagGroupName" ).val(TSCORE.selectedTagData.title);@@ -291,24 +291,30 @@ define(function(require, exports, module) {Cancel: function() {$( this ).dialog( "close" );}- }+ },+ open: function() {+ $( "#newTagName" ).val("");+ }});- $( "#dialog-taggroupDupicate" ).dialog({+ $( "#dialog-taggroupCreate" ).dialog({autoOpen: false,resizable: false,height:240,modal: true,buttons: {- "Duplicate Taggroup": function() {- TSCORE.Config.duplicateTagGroup(TSCORE.selectedTagData, $( "#newTagGroupName" ).val(), $( "#newTagGroupKey" ).val() )+ "Create": function() {+ TSCORE.Config.createTagGroup(TSCORE.selectedTagData, $( "#newTagGroupName" ).val() )generateTagGroups();$( this ).dialog( "close" );},Cancel: function() {$( this ).dialog( "close" );}- }+ },+ open: function() {+ $( "#newTagGroupName" ).val("");+ }});$( "#dialog-taggroupEdit" ).dialog({diff --git a/data/loader.js b/data/loader.jsindex 6a6538276..5ec3e6b88 100644--- a/data/loader.js+++ b/data/loader.js@@ -166,9 +166,8 @@ define(function (require, exports, module) {var TSCORE = require("tscore");- require(['libs/requirejs/domReady!'], function (docu) {- //This function is called once the DOM is ready,- //the value for 'domReady!' is the current document.+ require(['libs/requirejs/domReady!'], function () {+ //This function is called once the DOM is readyTSCORE.initApp();});