• This repository has been archived on 17/Jan/2022
  • Stars
    star
    503
  • Rank 87,705 (Top 2 %)
  • Language
    JavaScript
  • License
    GNU Affero Genera...
  • Created about 11 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

AngularJS directives for intro.js

angular-intro.js Build Status

An angularjs directive that wraps intro.js functionality.

angularintro

See the project page for an overview.

NPM

You can install this package through NPM by using the following command :

npm install angular-intro.js --save

Webpack

You can use this package in your webpack project, first by including intro.js and its css file. Next you need to require this package.

import ngIntro from 'angular-intro.js';

This project will return the whole angular module so if you want to use as a dependency in your own angular module you would need to reference the name ngIntro.name.

How to use

It's possible to include on your controller the service ngIntroService and customize as you need, or you may configure on your view the directives which are ng-intro-options, ng-intro-method and ng-intro-disable-button.

Setting Options

As a directive - ng-intro-options="IntroOptions"

As a service - ngIntroService.setOptions(IntroOptions)

You should create a $scope.IntroOptions in your controller which contains the intro.js options. The options are exactly the same as the original. This also allows you to modify the options as part of your controller behavior if necessary. You don't have to use IntroOptions, you can specify some other name.

Start method

As a directive - ng-intro-method="CallMe"

As a service - ngIntroService.start()

The directive will create a method on $scope.CallMe so that you can invoke it yourself later. Make sure the there isn't a method CallMe already in your controller. To use the method be sure to wrap it with $timeout. You don't have to use CallMe, you can specify some other name.

Call the start method

You can invoke it from an event such as click. ng-click="CallMe();"

as long as you are still in the same controller scope. You can also specify a step number in the method call, CallMe(3);.

You can start the intro from code, either call $scope.CallMe();. If the $scope.CallMe(); doesn't work, it might be because your DOM isn't ready. Put it in a $timeout.

Autostart

If you set ng-intro-autostart="true", the intro will start as soon as the directive is ready.

Autorefresh

If an intro tour includes dynamic content, use ng-intro-autorefresh="true" to call Intro.js' refresh method.

Callbacks

Intro.js provides several callbacks. You can receive these callbacks in your controller. For example, for the onchange event, specify the function name in the directive.

As a directive

ng-intro-onchange="ChangeEvent"

In your controller, create ChangeEvent

    $scope.ChangeEvent = function (targetElement, scope) {
        console.log("Change Event called");
        console.log(targetElement); //The target element
        console.log(this); //The IntroJS object
    };

The other intro.js callbacks you can specify are ng-intro-oncomplete, ng-intro-onexit, ng-intro-onchange, ng-intro-onbeforechange, ng-intro-onafterchange, ng-intro-onhintsadded, ng-intro-onhintclick and ng-intro-onhintclose.

As a service

In your controller:

    ngIntroService.onComplete(function(){
        console.log('on complete callback!')
    });

the list of current callbacks are:

  • onComplete
  • onExit
  • onBeforeChange
  • onChange
  • onAfterChange
  • onHintClick
  • onHintClose
  • onHintsAdded

The current short Interface is: p.s. it's avaiable on build folder the .d.ts file

	intro: IntroJs;
	addListener(name: string, callback: Function): void;
	removeListener(name: string): void;
	setOptions: IntroJs.Options;
	start(stepId?: number): IntroJs;
	exit(): IntroJs;
	clear(callback: Function): IntroJs;
	goToStepNumber(stepId: number): IntroJs;
	addHints(): IntroJs;
	showHint(hintIdx: number): IntroJs;
	showHints(): IntroJs;
	hideHint(hintIdx: number): IntroJs;
	hideHints(): IntroJs;
	removeHint(stepid: number): IntroJs;
	removeHints(): IntroJs;
	previous(): IntroJs;
	next(): IntroJs;
	refresh(): IntroJs;
	onComplete(callback: Function): void;
	onExit(callback: Function): void;
	onBeforeChange(callback: Function): void;
	onAfterChange(callback: Function): void;
	onChange(callback: Function): void;
	onHintClick(callback: Function): void;
	onHintClose(callback: Function): void;
	onHintsAdded(callback: Function): void; 

Exit Method

Directive - ng-intro-exit-method="ExitMe"

Callback - $scope.ExitMe(function() { //callback } );

You can also call $scope.ExitMe() from your controller.

Service - ngIntroService.exit()

Callback - ngIntroService.onExit(function(){ console.log('do something.'); });

Plunker

You may use as Directive standalone without injecting ngIntroService as shown here

or

alternatively as Service, as shown here i've added the directive, but it's not required, it's there to show the compatibility between both

How to build

If you want to build or contribute, first, get the node modules needed (grunt, etc)

npm install 

Then, get grunt to build the typescript into .js and the minified angular-intro.min.js

node_modules/.bin/grunt watch
p.s.: for faster build use `tsc --watch`, but you need run grunt after finish 

Finally, view the demo page to make sure everything's working; start a web server:

./node_modules/.bin/grunt connect:server

And browse to http://localhost:8000/example/index.html

License

Same as intro.js, this is AGPL

More Repositories

1

gpslogger

📡 Lightweight GPS Logging Application For Android.
Java
1,945
star
2

docker-http-https-echo

Docker image that echoes request data as JSON; listens on HTTP/S, useful for debugging.
Shell
609
star
3

waveshare-epaper-display

At-a-glance dashboard for Raspberry Pi with a Waveshare ePaper 7.5 Inch HAT. Date/Time, Weather, Alerts, Google/Outlook Calendar
Python
442
star
4

angular-performance

Directives for measuring and reporting perceived page performance
JavaScript
99
star
5

Airflow-MS-Teams-Operator

Airflow operator that can send messages to MS Teams
Python
78
star
6

teamcity-stash

TeamCity - Stash integration. Plugin for TeamCity which updates Stash with build statuses
Java
54
star
7

keepass-and-keeagent-setup

Security setup instructions for using KeePass with KeeAgent for SSH keypairs
47
star
8

grub-reboot-picker

Helps with dual booting. Ubuntu tray application to reboot into different OSes or UEFI/BIOS
Python
46
star
9

eleventy-satisfactory

Content-first eleventy blog template with basic layout and various features
JavaScript
21
star
10

docker-udp-listener

Python
18
star
11

Gradle-Travis-Colored-Output

Gradle script plugin which formats test output in a slightly colorful way (made for Travis CI but works in terminal)
16
star
12

xbox-controller-off

Shutdown script for XBox Wireless Controller for PCs
C#
15
star
13

Conscrypt-Provider

Conscrypt Provider app, which can be included from other applications (WIP)
Kotlin
13
star
14

trivy-template-output-to-sonarqube

Attempt at getting a Trivy output into Sonarqube's generic issue format
Smarty
13
star
15

selenium-grid-ecs

Selenium Grid in ECS using Fargate Spot Containers
HCL
13
star
16

Codeplex-Issues-Importer

This script imports issues (work items) from a Codeplex project into your github project
Python
11
star
17

teamcity-graphite

Teamcity plugin which sends various build, code and test metrics to Graphite.
Java
10
star
18

SeenFromSpace

A 'live' earth wallpaper which includes day/night phases, night lights, clouds and satellites in different projections
Python
10
star
19

gradle-crowdin-plugin

Build task plugin for downloading and uploading translations from Crowdin.com
Groovy
10
star
20

node-hashcat

hash, concat, minify, replace
JavaScript
9
star
21

bitbucket-all-pull-requests

Plugin to show all pull requests in Bitbucket Server.
Java
8
star
22

llm-cli-helper

CLI helper tool to lookup commands based on a description
Python
8
star
23

googledocs-upload-sample

Android sample code to authorize with OAuth2, upload a doc and update it.
Java
8
star
24

Kindle-Time-and-Weather

Time and Weather display for Kindle
Python
7
star
25

docker-openvpn-adblock

Docker containers setup with OpenVPN on TCP and UDP, with adblocking dnsmasq
Shell
6
star
26

docker-calibre-web-cloudflared

Example setup of a public facing Calibre Web server exposed through Cloudflare Tunnel
Python
6
star
27

Crowdin-Android-Importer

Python script to download translated language files from Crowdin.net and write to Android Project
Python
6
star
28

automated-wsl-dev-setup

Scripts to automate WSL, Ubuntu, Docker, Permissions/Tweaks setup
PowerShell
5
star
29

calibre-gdrive-fix

Script to fix broken Calibre paths caused by Google Drive
Python
5
star
30

aismapping

Places AIVDM NMEA data on Google Maps
Python
4
star
31

rpi-internet-radio

Internet radio using breadboard, mpc and mpd
Python
4
star
32

noodles

Instant Noodles 🍜 for the office (no cooking). Ratings and reviews.
HTML
3
star
33

Gradle-Github-Colored-Output

Colored test output for Github Actions when using Gradle
3
star
34

docker-arm32v6-influxdb

Influxdb image for Raspberry Pi Zero (ARM32v6)
Dockerfile
3
star
35

gpstracka

(Mirror) Windows Mobile 6.5 GPS Logging application
C#
3
star
36

mendhak.github.io

JavaScript
3
star
37

teambuildtray

Mirror for Team Build Tray
C#
2
star
38

raspberrypi-systeminfo

Python web page to display basic Raspberry Pi system info
Python
2
star
39

rhythmbox-gmusic-sync

Plugin to sync metadata from Rhythmbox to Google Music.
Python
2
star
40

gpsmapper

Java
2
star
41

docker-arm32v6-chronograf

Chronograf Docker image for Raspberry Pi Zero (ARM32v6)
Dockerfile
2
star
42

flickrsignature

Flickr signature generator with dynamic URLs. Currently on http://flkr.me
Python
2
star
43

firefox-flickr-new-tab

Firefox New Tab replacement, showcase mendhak photos from Flickr.
JavaScript
2
star
44

aws-elb-logster

Logster module for AWS Elastic Load Balancer access logs
Python
2
star
45

docs.fleetsearch.apiary.io

1
star
46

utils

Shell
1
star
47

angular-dynamic-configuration-with-auth0

Angular application. With dynamic configuration loaded from an API call. With Auth0 integration secured API requests.
TypeScript
1
star
48

flickrapi

Simple Python library for basic flickr method calls
Python
1
star
49

docker-unprivileged

WIP: Collection of unprivileged Docker samples for different languages and tools
1
star
50

expandable-textview-in-expandable-listview-problem

Demo code for https://github.com/Manabu-GT/ExpandableTextView/issues/25
Java
1
star
51

API-Gateway-Self-Hosted-Documentation

Sample repo for self hosted API Gateway documentation
HCL
1
star
52

javamail-android

[Mirror] Automatically exported from code.google.com/p/javamail-android
Java
1
star
53

docs.flightinternal.apiary.io

1
star
54

wintersmith-testing

CSS
1
star
55

android-gradle-test-sample

Sample test project created for http://stackoverflow.com/questions/23046259/is-there-a-way-to-only-run-a-specific-set-of-tests-in-an-android-gradle-project
Shell
1
star
56

curiosityfeeds

Google App Engine project for MSL Curiosity feeds
Python
1
star
57

hammer-api

1
star
58

gpslogger-support-files

Shell
1
star
59

android-file-dialog

Fork of original android-file-dialog from https://code.google.com/p/android-file-dialog
Java
1
star
60

GSF-archive

Bintray mirror for https://bintray.com/mendhak/maven/gpslogger-support-files
1
star
61

smashtest-tutorial

Sample repo for the writeup at
1
star
62

AskUbuntu-Dark-Theme

CSS
1
star
63

flickrbackground

View flickr photos on any color/magic background, or full browser width.
JavaScript
1
star
64

docker-spark-experimental

Experimental Spark master and worker with spark-shell and pyspark
1
star
65

Sheepy-Horn-Old

Productivity tool to assist with joke telling by playing the 'wah wah waah' sound.
Java
1
star
66

automated-wsl2-dev-setup

PowerShell
1
star
67

flickrsig.net

.NET version of flickrsignature - very old
JavaScript
1
star
68

steam-github-profile-status

Set your Github profile status with the game currently being played on Steam. Available as Docker image, Github Action or script.
JavaScript
1
star
69

buildbunny

Mirror of TeamCity Nabaztag plugin
Java
1
star