From 01cd22752c25f0a5dc21afe7f3dad27a2b74cf3d Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Sat, 4 Aug 2018 13:46:23 +0200 Subject: [PATCH] - new filter for signature groups (e.g. Combat, Data, WH,..), closed #376 - UI improvements "signature module" -> smaller toolbar buttons, #629 - removed signatures filter for group from table footer --- js/app/map/util.js | 13 +- js/app/module_map.js | 4 +- js/app/ui/system_signature.js | 229 +++++++++----------- public/css/v1.4.1/pathfinder.css | 8 +- public/css/v1.4.1/pathfinder.css.map | 2 +- public/js/v1.4.1/app/map/util.js | 13 +- public/js/v1.4.1/app/module_map.js | 4 +- public/js/v1.4.1/app/ui/system_signature.js | 229 +++++++++----------- sass/layout/_main.scss | 34 ++- sass/layout/_system-info.scss | 15 +- 10 files changed, 265 insertions(+), 286 deletions(-) diff --git a/js/app/map/util.js b/js/app/map/util.js index 954f3fa1..062a5ccd 100644 --- a/js/app/map/util.js +++ b/js/app/map/util.js @@ -913,17 +913,18 @@ define([ }; /** - * store mapId for current user (IndexedDB) - * @param mapId + * store local data for current user (IndexDB) + * @param key + * @param value */ - let storeDefaultMapId = (mapId) => { - if(mapId > 0){ + let storeLocaleCharacterData = (key, value) => { + if(key.length && value){ let userData = Util.getCurrentUserData(); if( userData && userData.character ){ - storeLocalData('character', userData.character.id, 'defaultMapId', mapId); + storeLocalData('character', userData.character.id, key, value); } } }; @@ -1652,7 +1653,7 @@ define([ getTabContentElementByMapElement: getTabContentElementByMapElement, hasActiveConnection: hasActiveConnection, filterMapByScopes: filterMapByScopes, - storeDefaultMapId: storeDefaultMapId, + storeLocaleCharacterData: storeLocaleCharacterData, getLocaleData: getLocaleData, storeLocalData: storeLocalData, deleteLocalData: deleteLocalData, diff --git a/js/app/module_map.js b/js/app/module_map.js index 20f8c054..cab37cf5 100644 --- a/js/app/module_map.js +++ b/js/app/module_map.js @@ -743,7 +743,7 @@ define([ if(mapId > 0){ // save mapId as new "default" (local storage) - MapUtil.storeDefaultMapId(mapId); + MapUtil.storeLocaleCharacterData('defaultMapId', mapId); }else{ // add new Tab selected $(document).trigger('pf:menuShowMapSettings', {tab: 'new'}); @@ -1122,7 +1122,7 @@ define([ */ let showDefaultTabExecutor = (resolve, reject) => { let promiseStore = MapUtil.getLocaleData('character', currentUserData.character.id); - promiseStore.then((data) => { + promiseStore.then(data => { let activeTabLinkElement = false; // check for existing mapId URL identifier ------------------------------------------------------------ diff --git a/js/app/ui/system_signature.js b/js/app/ui/system_signature.js index dd8c74bd..4da02184 100644 --- a/js/app/ui/system_signature.js +++ b/js/app/ui/system_signature.js @@ -59,10 +59,10 @@ define([ sigTableActionCellClass: 'pf-table-action-cell', // class for "action" cells // xEditable - moduleIcon: 'pf-module-icon-button', // class for "filter" - icons editableDescriptionInputClass: 'pf-editable-description', // class for "description" textarea - editableFilterElementClass: 'pf-editable-filter', // class for "filter" selects (not active) - editableFilterSelectPopoverClass: 'pf-editable-filter-active' // class for active "filter" selects (popover) + + signatureGroupsLabels: Util.getSignatureGroupInfo('label'), + signatureGroupsNames: Util.getSignatureGroupInfo('name') }; // lock Signature Table update temporary (until. some requests/animations) are finished @@ -310,7 +310,7 @@ define([ * @param data */ let updateSignatureCell = (tableApi, rowElement, cellIndex, data) => { - let rowIndex = tableApi.row( rowElement ).index(); + let rowIndex = tableApi.row(rowElement).index(); let updateCell = tableApi.cell( rowIndex, cellIndex ); let updateCellElement = updateCell.nodes().to$(); @@ -685,7 +685,7 @@ define([ if(clipboard.length){ let signatureRows = clipboard.split(/\r\n|\r|\n/g); - let signatureGroupOptions = signatureGroupsNames; + let signatureGroupOptions = config.signatureGroupsNames; let invalidSignatures = 0; for(let i = 0; i < signatureRows.length; i++){ @@ -817,8 +817,8 @@ define([ tempData.group = { group: sigGroup, - sort: signatureGroupsLabels[data.groupId], - filter: signatureGroupsLabels[data.groupId] + sort: config.signatureGroupsLabels[data.groupId], + filter: config.signatureGroupsLabels[data.groupId] }; // set type id ---------------------------------------------------------------------------------------- @@ -900,62 +900,6 @@ define([ return formattedData; }; - /** - * get a labeled button - * @param options - * @returns {*|jQuery} - */ - let getLabeledButton = options => { - - let buttonClasses = ['btn', 'btn-sm', 'btn-labeled']; - - switch(options.type){ - case 'default': - buttonClasses.push('btn-default'); - break; - case 'primary': - buttonClasses.push('btn-primary'); - break; - case 'danger': - buttonClasses.push('btn-danger'); - break; - } - - // add optional classes - if(options.classes){ - buttonClasses = buttonClasses.concat(options.classes); - } - - - let buttonElement = $('