From 4381cab0a69e6d94e49aaffc7debc8bd86dc8a19 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 12 Sep 2019 19:07:59 -0400 Subject: [PATCH] af-api4-action - Rename 'msg-' and 'on-' options Here's the bash script... ``` for REGEX in \ s/msg-start/af-api4-start-msg/g \ s/msgStart/afApi4StartMsg/g \ s/msg-error/af-api4-error-msg/g \ s/msgError/afApi4ErrorMsg/g \ s/msg-success/af-api4-success-msg/g \ s/msgSuccess/afApi4SuccessMsg/g \ s/on-success/af-api4-success/g \ s/onSuccess/afApi4Success/g \ s/on-error/af-api4-error/g \ s/on-error/afApi4Error/g do DIRS="core docs gui html mock auditor" echo "Processing regex [$REGEX] in [$DIRS]" find $DIRS -name '*.js' -o -name '*.html' -o -name '*.json' -o -name '*.md' \ | grep -v /node_modules/ \ | xargs -L1 sed -i.bak "$REGEX" find $DIRS -name '*.bak' -delete done ``` --- ext/afform/core/ang/afCore/Api4Action.js | 12 ++++++------ ext/afform/core/ang/afCore/Api4Action.md | 8 ++++---- ext/afform/html/ang/afHtmlList.aff.html | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ext/afform/core/ang/afCore/Api4Action.js b/ext/afform/core/ang/afCore/Api4Action.js index da8ed8d22b..20c47c824a 100644 --- a/ext/afform/core/ang/afCore/Api4Action.js +++ b/ext/afform/core/ang/afCore/Api4Action.js @@ -5,10 +5,10 @@ restrict: 'A', scope: { afApi4Action: '@', - msgStart: '=', - msgError: '=', - msgSuccess: '=', - onSuccess: '@', + afApi4StartMsg: '=', + afApi4ErrorMsg: '=', + afApi4SuccessMsg: '=', + afApi4Success: '@', onError: '@' }, link: function($scope, $el, $attr) { @@ -17,11 +17,11 @@ running(false); $el.click(function(){ var parts = $parse($scope.afApi4Action)($scope.$parent); - var msgs = {start: $scope.msgStart || ts('Submitting...'), success: $scope.msgSuccess, error: $scope.msgError}; + var msgs = {start: $scope.afApi4StartMsg || ts('Submitting...'), success: $scope.afApi4SuccessMsg, error: $scope.afApi4ErrorMsg}; running(true); crmStatus(msgs, crmApi4(parts[0], parts[1], parts[2])) .finally(function(){running(false);}) - .then(function(response){$scope.$parent.$eval($scope.onSuccess, {response: response});}) + .then(function(response){$scope.$parent.$eval($scope.afApi4Success, {response: response});}) .catch(function(error){$scope.$parent.$eval($scope.onError, {error: error});}); }); } diff --git a/ext/afform/core/ang/afCore/Api4Action.md b/ext/afform/core/ang/afCore/Api4Action.md index 7e43867850..7d62d740ff 100644 --- a/ext/afform/core/ang/afCore/Api4Action.md +++ b/ext/afform/core/ang/afCore/Api4Action.md @@ -17,10 +17,10 @@ trigger further actions on failure or success. ```html ``` diff --git a/ext/afform/html/ang/afHtmlList.aff.html b/ext/afform/html/ang/afHtmlList.aff.html index f78ca5362c..e0e5f950ee 100644 --- a/ext/afform/html/ang/afHtmlList.aff.html +++ b/ext/afform/html/ang/afHtmlList.aff.html @@ -27,8 +27,8 @@ {{ts('Revert')}} -- 2.25.1