
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
angular-confirmable
Advanced tools
An intuitive way to re-confirm user intentions using a single widget, and provide inline feedback without confirm dialogs or flash messages.
An intuitive way to re-confirm user intentions using a single widget, and provide inline feedback without distracting confirmation popups or flash messages.
Allows you to decorate a standard HTML button with 2 or 3 states, to allow the user to re-confirm their intent before performing a destructive or important operation. Can also be used to simply confirm or feedback an action to the user on the same button they clicked. If you define it with 3 states, the directive will reset the state back after a time period (configurable).
This behaviour allows you to conserve space on the current view, without taking the users attention away from what they are currently doing and avoids distracting confirmation popups and flash messages.
Tested and can be used with / without JQuery / Bootstrap.
bower install angular-confirmable --save
angular-confirmable.css
in your app (optional, this demonstrates CSS class customisation using Bootstrap):<link rel="stylesheet" href="bower_components/angular-confirmable/angular-confirmable.css" />
angular-confirmable.js
in your app:<script src="bower_components/angular-confirmable/angular-confirmable.js"></script>
angular-confirmable
as a new module dependency in your angular app.var myapp = angular.module('myapp', ['angular-confirmable']);
<confirmable ...></confirmable>
tag with matching open and closing tags.<confirmable-outlet></confirmable-outlet>
which will mark
where the dynamic text appears. This allows the directive to be very flexible in what you wrap around it (ie. button / div / whatever).unconfirmed-text="Do something irreversable"
confirming-text="Are you sure?"
confirmed-text="Processing..."
when-confirmed='eraseData'
Complete (minimal) example:
<confirmable when-confirmed="confirmed" unconfirmed-text="Don't press this button" confirming-text="Please don't click me again!">
<button class="btn btn-default">
<confirmable-outlet></confirmable-outlet>
</button>
</confirmable>
You can use either the SASS styles directly file under /src
or the compiled CSS files, up to you :)
You can use this directive for either a re-confirmable action (3 states) or inline feedback (2 states) or both.
You can wrap the text in all states within brackets, or anything really using the following
optional attributes: text-before="("
and text-after=")"
You can define the delay between reverting from confirming
state to default
state
by specifying reset-delay="1000"
(in milliseconds)
<confirmable>
tag supports class="..."
and disabled="true|false"
attributes
an acts as you would assume.
The attribute confirmable-state
will change to either unconfirmed
, confirming
or confirmed
which can be used.
for CSS class styles or watching on the $scope
to trigger other effects.
Specifically tested with the angular-ladda directive in mind, so it is compatible with this applied to the same button.
git clone git@github.com:rpocklin/angular-confirmable.git
npm install
bower install
grunt serve
http://localhost:9000/example/
in your browser to see the example.git checkout -b my-new-feature
)grunt karma
to ensure all tests pass. (Ideally add more tests!)git commit -am 'Added some feature'
)git push origin my-new-feature
)1.1.0 Allow directive to be used in attributes as well as elements. 1.0.0 Initial release
compile()
method.angular-ladda
.completed-text="Processing Complete"
?Released under the MIT License. See the LICENSE file for further details.
FAQs
An intuitive way to re-confirm user intentions using a single widget, and provide inline feedback without confirm dialogs or flash messages.
We found that angular-confirmable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.