1.0.0 • Published 8 years ago

angular-bootstrap-feedback v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

angular-bootstrap-feedback

Bower version Build Status Coverage Status

Overview

A user feedback modal with screenshot and highlighting functionality built around Angular 1.5+.

Features
  • Angular component(s)
  • Modal popup
  • User can create Screenshots
  • User can highlight screenshots
  • Include custom inputs

View Demo

Requirements

  • angular - 1.5.0+
  • bootstrap - 3.3.6+
  • angular-bootstrap - 1.3.2+
  • html2canvas - 0.4.1+

Installation

Bower

bower install angular-bootstrap-feedback --save

npm

npm install angular-bootstrap-feedback --save

Manual

Or, you can download source files straight from this repo, they're located in the dist folder. Just include the minified version of both .js and .css files.

  • src/css/angular.bootstrap.feedback.styles.css
  • src/lib/angular.bootstrap.feedback.output.js
  • src/lib/angular.bootstrap.feedback.templates.js
Or, Minified
  • dist/angular.bootstrap.feedback.min.css
  • dist/angular.bootstrap.feedback.min.js

Usage

Make sure you have the required bower_components and included them in your html page as well as the angular-bootstrap-feedback files:

1. Injection

Inject the angular.bootstrap.feedback provider into your module

    var myApp = angular.module('myApp', [
        'angular.bootstrap.feedback'
    ]);

2. Options

Create an options object on the controller. All options are optional, see below for a detailed explanation of each property.

    myApp.controller('appController', ['angularBootstrapFeedbackFactory',

    function(feedbackFactory) {
        $scope.options = {
          modalTitle: 'Feedback',
          takeScreenshotButtonText: "Take screenshot",
          submitButtonText: "Submit",
          sendFeedbackButtonText: "Send Feedback",
          cancelScreenshotOptionsButtonText: "Cancel",
          takeScreenshotOptionsButtonText: "Take Screenshot",
          takeScreenshotButtonPressed: takeScreenshotButtonPressed,
          submitButtonPressed: submitButtonPressed,
          sendFeedbackButtonPressed: sendFeedbackButtonPressed,
          cancelScreenshotOptionsButtonPressed: cancelScreenshotOptionsButtonPressed,
          takeScreenshotOptionsButtonPressed: takeScreenshotOptionsButtonPressed,
          screenshotTaken: screenshotTaken,
          highlightDrawn: highlightDrawn,
          modalDismissed: modalDismissed
        }

        function takeScreenshotButtonPressed() {}
        function submitButtonPressed(form) {}
        function sendFeedbackButtonPressed() {}
        function cancelScreenshotOptionsButtonPressed() {}
        function takeScreenshotOptionsButtonPressed() {}
        function screenshotTaken(image, canvas) {}
        function highlightDrawn(element) {}
        function modalDismissed() {}
    }]);

3. Setup HTML

The angular components are split into 2 elements:

  • angular-bootstrap-feedback
  • angular-bootstrap-feedback-screenshot

Please note, the screenshot component is not required.

    <angular-bootstrap-feedback options="options">
        <div class="row">
          <div class="col-lg-6">
            // Your custom inputs here
          </div>

          <div class="col-lg-6">
            <angular-bootstrap-feedback-screenshot></angular-bootstrap-feedback-screenshot>
          </div>
        </div>
      </angular-bootstrap-feedback>

Options

Text properties

PropertyDescriptionDefault
modalTitleSets the title of the modal'Feedback'
submitButtonTextSets the submit button value of the modal'Submit'
takeScreenshotButtonTextSets the button text value that is fixed to the bottom of the users screen'Take Screenshot'
cancelScreenshotOptionsButtonTextThe screenshot options cancel button text'Cancel'
takeScreenshotOptionsButtonTextThe screenshot options capture button text'Take Screenshot'

Event callbacks

EventDescription
takeScreenshotButtonPressedFired when the take screenshot button is pressed from the modal
submitButtonPressedFired when the submit button is pressed from the modal
sendFeedbackButtonPressedFired when the send feedback button is pressed
cancelScreenshotOptionsButtonPressedFired when a user cancels screenshotting/highlighting
takeScreenshotOptionsButtonPressedFired when the take screenshot button is pressed
screenshotTakenFired when a user takes a screenshot
highlightDrawnFired when the user draws a highlight square
modalDismissedFired when the modal is dismissed

Contributing

Pull requests and issues are welcome.