├── .bowerrc
├── .gitignore
├── .travis.yml
├── .jshintrc
├── CONTRIBUTING.md
├── .editorconfig
├── libs
└── jquery-loader.js
├── test
├── .jshintrc
├── remodal.html
└── remodal_test.js
├── LICENSE
├── bower.json
├── src
├── remodal.css
├── remodal-default-theme.css
└── remodal.js
├── package.json
├── dist
├── remodal.css
├── remodal-default-theme.css
├── remodal.min.js
└── remodal.js
├── .jscsrc
├── CHANGELOG.md
├── Gruntfile.js
├── README.md
├── examples
├── index.html
└── index-zepto.html
└── .csscomb.json
/.bowerrc:
--------------------------------------------------------------------------------
1 | {
2 | "directory": "libs"
3 | }
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .idea/
3 | node_modules/
4 | libs/
5 | !libs/jquery-loader.js
6 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 0.12
4 | install: npm start
5 | sudo: false
6 |
--------------------------------------------------------------------------------
/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "boss": true,
3 | "curly": true,
4 | "eqeqeq": true,
5 | "eqnull": true,
6 | "expr": true,
7 | "immed": true,
8 | "noarg": true,
9 | "quotmark": "single",
10 | "unused": true
11 | }
12 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | CONTRIBUTING
2 | ====
3 |
4 | 1. Fork.
5 | 2. Run `npm start`.
6 | 3. Make your changes on the `src` folder.
7 | 4. Update tests.
8 | 5. Run `npm test`, make sure everything is okay.
9 | 6. Submit a pull request to the master branch.
10 |
11 | Thanks.
12 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # This file is for unifying the coding style for different editors and IDEs
2 | # editorconfig.org
3 |
4 | root = true
5 |
6 | [*]
7 | indent_style = space
8 | indent_size = 2
9 | end_of_line = lf
10 | charset = utf-8
11 | trim_trailing_whitespace = true
12 | insert_final_newline = true
13 |
--------------------------------------------------------------------------------
/libs/jquery-loader.js:
--------------------------------------------------------------------------------
1 | !(function() {
2 |
3 | // Get any lib=___ param from the query string.
4 | var library = location.search.match(/[?&]lib=(.*?)(?=&|$)/);
5 |
6 | /* jshint -W060 */
7 | if (library) {
8 | document.write('');
9 | } else {
10 | document.write('');
11 | }
12 | }());
13 |
--------------------------------------------------------------------------------
/test/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "boss": true,
3 | "curly": true,
4 | "eqeqeq": true,
5 | "eqnull": true,
6 | "expr": true,
7 | "immed": true,
8 | "noarg": true,
9 | "quotmark": "single",
10 | "unused": true,
11 | "predef": [
12 | "jQuery",
13 | "Zepto",
14 | "QUnit",
15 | "module",
16 | "test",
17 | "asyncTest",
18 | "expect",
19 | "start",
20 | "stop",
21 | "ok",
22 | "equal",
23 | "notEqual",
24 | "deepEqual",
25 | "notDeepEqual",
26 | "strictEqual",
27 | "notStrictEqual",
28 | "throws"
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Ilya Makarov
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "remodal",
3 | "homepage": "http://vodkabears.github.io/remodal/",
4 | "authors": [
5 | "Ilya Makarov "
6 | ],
7 | "description": "Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with hash tracking.",
8 | "main": [
9 | "dist/remodal.js",
10 | "dist/remodal.css",
11 | "dist/remodal-default-theme.css"
12 | ],
13 | "ignore": [
14 | "**/.*",
15 | "examples/",
16 | "libs/",
17 | "src/",
18 | "test/",
19 | "*.md",
20 | "Gruntfile.js",
21 | "package.json"
22 | ],
23 | "keywords": [
24 | "jquery",
25 | "plugin",
26 | "jquery-plugin",
27 | "flat",
28 | "responsive",
29 | "modal",
30 | "popup",
31 | "window",
32 | "dialog",
33 | "popin",
34 | "lightbox",
35 | "ui",
36 | "zepto",
37 | "synchronized",
38 | "animations"
39 | ],
40 | "license": "MIT",
41 | "dependencies": {
42 | "jquery": "*"
43 | },
44 | "devDependencies": {
45 | "qunit": "^1.19.0",
46 | "jquery": "jquery#^1.11.3",
47 | "jquery2": "jquery#^2.1.4",
48 | "zepto": "^1.1.6"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/remodal.css:
--------------------------------------------------------------------------------
1 | /* ==========================================================================
2 | Remodal's necessary styles
3 | ========================================================================== */
4 |
5 | /* Hide scroll bar */
6 |
7 | html.remodal-is-locked {
8 | overflow: hidden;
9 |
10 | touch-action: none;
11 | }
12 |
13 | /* Anti FOUC */
14 |
15 | .remodal,
16 | [data-remodal-id] {
17 | display: none;
18 | }
19 |
20 | /* Necessary styles of the overlay */
21 |
22 | .remodal-overlay {
23 | position: fixed;
24 | z-index: 9999;
25 | top: -5000px;
26 | right: -5000px;
27 | bottom: -5000px;
28 | left: -5000px;
29 |
30 | display: none;
31 | }
32 |
33 | /* Necessary styles of the wrapper */
34 |
35 | .remodal-wrapper {
36 | position: fixed;
37 | z-index: 10000;
38 | top: 0;
39 | right: 0;
40 | bottom: 0;
41 | left: 0;
42 |
43 | display: none;
44 | overflow: auto;
45 |
46 | text-align: center;
47 |
48 | -webkit-overflow-scrolling: touch;
49 | }
50 |
51 | .remodal-wrapper:after {
52 | display: inline-block;
53 |
54 | height: 100%;
55 | margin-left: -0.05em;
56 |
57 | content: "";
58 | }
59 |
60 | /* Fix iPad, iPhone glitches */
61 |
62 | .remodal-overlay,
63 | .remodal-wrapper {
64 | backface-visibility: hidden;
65 | }
66 |
67 | /* Necessary styles of the modal dialog */
68 |
69 | .remodal {
70 | position: relative;
71 |
72 | outline: none;
73 |
74 | text-size-adjust: 100%;
75 | }
76 |
77 | .remodal-is-initialized {
78 | /* Disable Anti-FOUC */
79 | display: inline-block;
80 | }
81 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "remodal",
3 | "version": "1.1.1",
4 | "description": "Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.",
5 | "keywords": [
6 | "jquery-plugin",
7 | "jquery",
8 | "plugin",
9 | "flat",
10 | "responsive",
11 | "modal",
12 | "popup",
13 | "window",
14 | "dialog",
15 | "popin",
16 | "lightbox",
17 | "ui",
18 | "zepto",
19 | "synchronized",
20 | "animations"
21 | ],
22 | "repository": {
23 | "type": "git",
24 | "url": "https://github.com/VodkaBears/Remodal.git"
25 | },
26 | "bugs": {
27 | "url": "https://github.com/VodkaBears/Remodal/issues"
28 | },
29 | "author": {
30 | "name": "Ilya Makarov",
31 | "email": "dfrost.00@gmail.com",
32 | "url": "https://github.com/VodkaBears"
33 | },
34 | "homepage": "http://vodkabears.github.io/remodal/",
35 | "license": "MIT",
36 | "main": "dist/remodal.js",
37 | "dependencies": {
38 | "jquery": "*"
39 | },
40 | "devDependencies": {
41 | "bower": "^1.5.3",
42 | "grunt": "^0.4.5",
43 | "grunt-autoprefixer": "^3.0.3",
44 | "grunt-browser-sync": "^2.1.3",
45 | "grunt-cli": "^0.1.13",
46 | "grunt-contrib-concat": "^0.5.1",
47 | "grunt-contrib-connect": "^0.11.2",
48 | "grunt-contrib-jshint": "^0.11.3",
49 | "grunt-contrib-qunit": "^1.2.0",
50 | "grunt-contrib-uglify": "^0.9.2",
51 | "grunt-contrib-watch": "^0.6.1",
52 | "grunt-csscomb": "3.0.0",
53 | "grunt-githooks": "^0.3.1",
54 | "grunt-jscs": "^2.1.0"
55 | },
56 | "scripts": {
57 | "start": "npm install && ./node_modules/.bin/bower install && ./node_modules/.bin/grunt githooks",
58 | "test": "./node_modules/.bin/grunt test",
59 | "dist": "./node_modules/.bin/grunt"
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/dist/remodal.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Remodal - v1.1.1
3 | * Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
4 | * http://vodkabears.github.io/remodal/
5 | *
6 | * Made by Ilya Makarov
7 | * Under MIT License
8 | */
9 |
10 | /* ==========================================================================
11 | Remodal's necessary styles
12 | ========================================================================== */
13 |
14 | /* Hide scroll bar */
15 |
16 | html.remodal-is-locked {
17 | overflow: hidden;
18 |
19 | -ms-touch-action: none;
20 | touch-action: none;
21 | }
22 |
23 | /* Anti FOUC */
24 |
25 | .remodal,
26 | [data-remodal-id] {
27 | display: none;
28 | }
29 |
30 | /* Necessary styles of the overlay */
31 |
32 | .remodal-overlay {
33 | position: fixed;
34 | z-index: 9999;
35 | top: -5000px;
36 | right: -5000px;
37 | bottom: -5000px;
38 | left: -5000px;
39 |
40 | display: none;
41 | }
42 |
43 | /* Necessary styles of the wrapper */
44 |
45 | .remodal-wrapper {
46 | position: fixed;
47 | z-index: 10000;
48 | top: 0;
49 | right: 0;
50 | bottom: 0;
51 | left: 0;
52 |
53 | display: none;
54 | overflow: auto;
55 |
56 | text-align: center;
57 |
58 | -webkit-overflow-scrolling: touch;
59 | }
60 |
61 | .remodal-wrapper:after {
62 | display: inline-block;
63 |
64 | height: 100%;
65 | margin-left: -0.05em;
66 |
67 | content: "";
68 | }
69 |
70 | /* Fix iPad, iPhone glitches */
71 |
72 | .remodal-overlay,
73 | .remodal-wrapper {
74 | -webkit-backface-visibility: hidden;
75 | backface-visibility: hidden;
76 | }
77 |
78 | /* Necessary styles of the modal dialog */
79 |
80 | .remodal {
81 | position: relative;
82 |
83 | outline: none;
84 |
85 | -webkit-text-size-adjust: 100%;
86 | -ms-text-size-adjust: 100%;
87 | text-size-adjust: 100%;
88 | }
89 |
90 | .remodal-is-initialized {
91 | /* Disable Anti-FOUC */
92 | display: inline-block;
93 | }
94 |
--------------------------------------------------------------------------------
/.jscsrc:
--------------------------------------------------------------------------------
1 | {
2 | "disallowSpacesInNamedFunctionExpression": {
3 | "beforeOpeningRoundBrace": true
4 | },
5 | "disallowSpacesInFunctionExpression": {
6 | "beforeOpeningRoundBrace": true
7 | },
8 | "disallowSpacesInAnonymousFunctionExpression": {
9 | "beforeOpeningRoundBrace": true
10 | },
11 | "disallowSpacesInFunctionDeclaration": {
12 | "beforeOpeningRoundBrace": true
13 | },
14 | "disallowEmptyBlocks": true,
15 | "disallowSpacesInCallExpression": true,
16 | "disallowSpacesInsideArrayBrackets": true,
17 | "disallowSpacesInsideParentheses": true,
18 | "disallowQuotedKeysInObjects": true,
19 | "disallowSpaceAfterObjectKeys": true,
20 | "disallowSpaceAfterPrefixUnaryOperators": true,
21 | "disallowSpaceBeforePostfixUnaryOperators": true,
22 | "disallowSpaceBeforeBinaryOperators": [
23 | ","
24 | ],
25 | "disallowMixedSpacesAndTabs": true,
26 | "disallowTrailingWhitespace": true,
27 | "disallowTrailingComma": true,
28 | "disallowYodaConditions": true,
29 | "disallowKeywords": [ "with" ],
30 | "disallowKeywordsOnNewLine": ["else"],
31 | "disallowMultipleLineBreaks": true,
32 | "disallowMultipleLineStrings": true,
33 | "disallowMultipleVarDecl": true,
34 | "requireSpaceBeforeBlockStatements": true,
35 | "requireParenthesesAroundIIFE": true,
36 | "requireSpacesInConditionalExpression": true,
37 | "requireBlocksOnNewline": 1,
38 | "requireCommaBeforeLineBreak": true,
39 | "requireSpaceBeforeBinaryOperators": true,
40 | "requireSpaceAfterBinaryOperators": true,
41 | "requireCamelCaseOrUpperCaseIdentifiers": true,
42 | "requireLineFeedAtFileEnd": true,
43 | "requireCapitalizedConstructors": true,
44 | "requireDotNotation": true,
45 | "requireSpacesInForStatement": true,
46 | "requireSpaceBetweenArguments": true,
47 | "requireCurlyBraces": [
48 | "do"
49 | ],
50 | "requireSpaceAfterKeywords": [
51 | "if",
52 | "else",
53 | "for",
54 | "while",
55 | "do",
56 | "switch",
57 | "case",
58 | "return",
59 | "try",
60 | "catch",
61 | "typeof"
62 | ],
63 | "requirePaddingNewLinesBeforeLineComments": {
64 | "allExcept": "firstAfterCurly"
65 | },
66 | "requirePaddingNewLinesAfterBlocks": true,
67 | "requireSemicolons": true,
68 | "validateLineBreaks": "LF",
69 | "validateQuoteMarks": "'",
70 | "validateIndentation": 2
71 | }
72 |
--------------------------------------------------------------------------------
/test/remodal.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Remodal Test Suite
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
29 |
30 |
31 |
32 |
36 |
37 |
43 |
44 |
53 |
54 |
57 |
58 |
61 |
62 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ### 1.1.1
2 | * Fix the blurry text issue at animation end
3 | * Fix function getScrollbarWidth
4 | * Fix issue caused by calling remodal.close() when it is already closed
5 |
6 | ### 1.1.0
7 | * Add `appendTo` option (#238)
8 |
9 | ### 1.0.7
10 | * Fixed getAnimationDuration
11 |
12 | ### 1.0.6
13 | * Fixed Bug on IE11 #173.
14 | * Fixed scroll bugs in WP8.
15 |
16 | ### 1.0.5
17 | * Support special symbols in the 'id' attribute.
18 |
19 | ### 1.0.4
20 | * Fix IOS 9 safari scaling issues.
21 | * Update dependencies.
22 |
23 | ### 1.0.3
24 | * Migrate from legacy to container-based infrastructure on Travis.
25 | * Fix keyboard navigation accessibility issue.
26 | * Shorten the description for Bower.
27 |
28 | ### 1.0.2
29 | * Handle keydown event instead of keyup for "Esc" key.
30 | * Code improvements.
31 | * Update dependencies.
32 |
33 | ### 1.0.1
34 | * Do not use namespaces in data attributes (fix).
35 |
36 | ### 1.0.0
37 | * Renamed the 'closeOnAnyClick' property to the 'closeOnOutsideClick'.
38 | * Separated base and theme styles.
39 | * Renamed the base files.
40 | * Added the ability to use CSS mixins.
41 | * Added `#destroy`.
42 | * Renamed the events.
43 | * Used states and CSS animations.
44 | * Made restyling of the default theme.
45 | * Added the watch task for Grunt.
46 | * Added Autoprefixer.
47 | * Used `backface-visibility` for the hardware acceleration instead of `translateZ`.
48 | * Disabled the auto-resizing of text on mobile devices.
49 | * Fixed the triggering of the close event, even if a modal is not opened.
50 | * Added '#getState'.
51 | * Changed names for the constants.
52 | * Removed the default custom font.
53 | * Introduced the `data-remodal-action` attribute.
54 | * Made code refactoring.
55 | * Improved anti-FOUC.
56 | * Updated examples.
57 | * Updated tests.
58 | * Updated dependencies.
59 |
60 | ### 0.6.4
61 | * Protocol-relative URL for fonts.
62 | * Scroll to the top, when a modal is displayed.
63 | * Pixels in the media-queries.
64 | * Added Browserify support.
65 | * Updated dependencies.
66 |
67 | ### 0.6.3
68 | * Fix codestyle configs.
69 |
70 | ### 0.6.2
71 | * Improved the codestyle.
72 | * Used package.json instead of jquery.json.
73 | * Updated dependencies.
74 |
75 | ### 0.6.1
76 | * Fix '#on' event handlers.
77 |
78 | ### 0.6.0
79 | * Added globals.
80 | * Added the ability to change the namespace for CSS and events.
81 | * Used '#on' instead of '#bind'.
82 | * Fixed double locking/unlocking issue.
83 | * Updated examples.
84 | * Updated dependencies.
85 | * Updated README.
86 |
87 | ### 0.5.0
88 | * Fixed a scrolling to the top of a page.
89 | * Added the 'reason' parameter to the close/closed events.
90 | * Updated examples.
91 | * Updated dependencies.
92 |
93 | ### 0.4.1
94 | * Constructor always returns an instance(#61).
95 |
96 | ### 0.4.0
97 | This version has incompatible changes!
98 |
99 | * Changed CSS class names.
100 | * Shared overlay.
101 | * Changed visual styles.
102 | * Improved IE8 styles.
103 | * Updated dependencies.
104 | * Fixes.
105 |
106 | ### 0.3.0
107 | * Added font-size of inputs to prevent iOs zooming.
108 | * Convert image for IE8 to base64.
109 | * Fix tests.
110 | * Fix scrollbar padding for Zepto.
111 | * Code refactoring.
112 | * Improved code linting.
113 | * Cleaned up the repository.
114 | * Updated dependencies.
115 |
116 | ### 0.2.1
117 | * Moved @import to the top of the file. Meteor requires the @import to be at the top.
118 | * Added some basic CSS support for IE8.
119 | * Added CloseOnEscape and CloseOnAnyClick options.
120 | * Updated README.md.
121 | * Updated tests.
122 |
123 | ### 0.2.0
124 | * Fix safari ghost padding bug(#26).
125 | * Add parsing of non-json strings with options. Read docs.
126 | * Fix jshint errors.
127 | * Update examples.
128 |
129 | ### 0.1.7
130 | * Catch syntax error if the hash is bad.
131 | * Add 'closeOnConfirm', 'closeOnCancel' options.
132 |
133 | ### 0.1.6
134 | * Fix #14, #11
135 |
136 | ### 0.1.5
137 | * Support for trailing slashes in URL.
138 | * Fix unnecessary body padding.
139 |
140 | ### 0.1.4
141 | * Works in the old android, ios browsers and other.
142 |
143 | ### 0.1.3
144 | * Fix page scrolling bug
145 | * Refactor CSS
146 |
147 | ### 0.1.2
148 | * Public collection of instances. Now you can get specific instance throw JS: `var inst = $.remodal.lookup[$('[data-remodal-id=modal]').data('remodal')];`;
149 | * Plugin constructor calling returns instance now. `var inst = $('[data-remodal-id=modal]').remodal()`.
150 |
151 | ### 0.1.1
152 | * Zepto support!
153 | * Blur is changed from 5px to 3px.
154 |
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function(grunt) {
2 |
3 | // Project configuration.
4 | grunt.initConfig({
5 |
6 | // Import package manifest
7 | pkg: grunt.file.readJSON('package.json'),
8 |
9 | meta: {
10 | banner: '/*\n' +
11 | ' * <%= pkg.name[0].toUpperCase() + pkg.name.slice(1) %> - v<%= pkg.version %>\n' +
12 | ' * <%= pkg.description %>\n' +
13 | ' * <%= pkg.homepage %>\n' +
14 | ' *\n' +
15 | ' * Made by <%= pkg.author.name %>\n' +
16 | ' * Under <%= pkg.license %> License\n' +
17 | ' */\n\n'
18 | },
19 |
20 | autoprefixer: {
21 | dist: {
22 | src: 'dist/**/*.css'
23 | },
24 | options: {
25 | browsers: ['> 0.1%'],
26 | cascade: false
27 | }
28 | },
29 |
30 | browserSync: {
31 | dev: {
32 | bsFiles: {
33 | src: ['dist/**/*', 'examples/**/*']
34 | },
35 | options: {
36 | watchTask: true,
37 | server: './'
38 | }
39 | }
40 | },
41 |
42 | concat: {
43 | dist: {
44 | files: {
45 | 'dist/remodal.js': 'src/remodal.js',
46 | 'dist/remodal.css': 'src/remodal.css',
47 | 'dist/remodal-default-theme.css': 'src/remodal-default-theme.css'
48 | },
49 | options: {
50 | banner: '<%= meta.banner %>'
51 | }
52 | }
53 | },
54 |
55 | connect: {
56 | server: {
57 | options: {
58 | port: 7770
59 | }
60 | }
61 | },
62 |
63 | csscomb: {
64 | all: {
65 | files: {
66 | 'src/remodal.css': 'src/remodal.css',
67 | 'src/remodal-default-theme.css': 'src/remodal-default-theme.css',
68 | 'dist/remodal.css': 'dist/remodal.css',
69 | 'dist/remodal-default-theme.css': 'dist/remodal-default-theme.css'
70 | }
71 | }
72 | },
73 |
74 | githooks: {
75 | all: {
76 | 'pre-commit': 'lint'
77 | },
78 | options: {
79 | command: 'node_modules/.bin/grunt'
80 | }
81 | },
82 |
83 | jshint: {
84 | gruntfile: {
85 | src: 'Gruntfile.js'
86 | },
87 | src: {
88 | src: 'src/**/*.js'
89 | },
90 | test: {
91 | src: ['test/**/*.js', 'libs/jquery-loader.js']
92 | },
93 | options: {
94 | jshintrc: '.jshintrc'
95 | }
96 | },
97 |
98 | jscs: {
99 | gruntfile: {
100 | src: 'Gruntfile.js'
101 | },
102 | src: {
103 | src: 'src/**/*.js'
104 | },
105 | test: {
106 | src: ['test/**/*.js', 'libs/jquery-loader.js']
107 | }
108 | },
109 |
110 | qunit: {
111 | all: {
112 | options: {
113 | urls: [
114 | 'jquery/dist/jquery.js',
115 | 'jquery2/dist/jquery.js',
116 | 'zepto/zepto.js'
117 | ].map(function(library) {
118 | return 'http://localhost:' +
119 | '<%= connect.server.options.port %>' +
120 | '/test/remodal.html?lib=' + library;
121 | })
122 | }
123 | }
124 | },
125 |
126 | uglify: {
127 | remodal: {
128 | files: {
129 | 'dist/remodal.min.js': 'src/remodal.js'
130 | }
131 | },
132 | options: {
133 | banner: '<%= meta.banner %>'
134 | }
135 | },
136 |
137 | watch: {
138 | src: {
139 | files: ['src/**/*', 'examples/**/*'],
140 | tasks: ['build']
141 | },
142 | options: {
143 | spawn: false
144 | }
145 | }
146 | });
147 |
148 | grunt.loadNpmTasks('grunt-contrib-concat');
149 | grunt.loadNpmTasks('grunt-contrib-connect');
150 | grunt.loadNpmTasks('grunt-contrib-jshint');
151 | grunt.loadNpmTasks('grunt-contrib-qunit');
152 | grunt.loadNpmTasks('grunt-contrib-uglify');
153 | grunt.loadNpmTasks('grunt-contrib-watch');
154 | grunt.loadNpmTasks('grunt-autoprefixer');
155 | grunt.loadNpmTasks('grunt-browser-sync');
156 | grunt.loadNpmTasks('grunt-csscomb');
157 | grunt.loadNpmTasks('grunt-githooks');
158 | grunt.loadNpmTasks('grunt-jscs');
159 |
160 | // Tasks
161 | grunt.registerTask('lint', ['jshint', 'jscs']);
162 | grunt.registerTask('test', ['connect', 'lint', 'qunit']);
163 | grunt.registerTask('build', ['concat', 'autoprefixer', 'csscomb', 'uglify', 'githooks']);
164 | grunt.registerTask('bsync', ['browserSync', 'watch']);
165 | grunt.registerTask('default', ['test', 'build']);
166 | };
167 |
--------------------------------------------------------------------------------
/src/remodal-default-theme.css:
--------------------------------------------------------------------------------
1 | /* ==========================================================================
2 | Remodal's default mobile first theme
3 | ========================================================================== */
4 |
5 | /* Default theme styles for the background */
6 |
7 | .remodal-bg.remodal-is-opening,
8 | .remodal-bg.remodal-is-opened {
9 | filter: blur(3px);
10 | }
11 |
12 | /* Default theme styles of the overlay */
13 |
14 | .remodal-overlay {
15 | background: rgba(43, 46, 56, 0.9);
16 | }
17 |
18 | .remodal-overlay.remodal-is-opening,
19 | .remodal-overlay.remodal-is-closing {
20 | animation-duration: 0.3s;
21 | animation-fill-mode: forwards;
22 | }
23 |
24 | .remodal-overlay.remodal-is-opening {
25 | animation-name: remodal-overlay-opening-keyframes;
26 | }
27 |
28 | .remodal-overlay.remodal-is-closing {
29 | animation-name: remodal-overlay-closing-keyframes;
30 | }
31 |
32 | /* Default theme styles of the wrapper */
33 |
34 | .remodal-wrapper {
35 | padding: 10px 10px 0;
36 | }
37 |
38 | /* Default theme styles of the modal dialog */
39 |
40 | .remodal {
41 | box-sizing: border-box;
42 | width: 100%;
43 | margin-bottom: 10px;
44 | padding: 35px;
45 |
46 | transform: translate3d(0, 0, 0);
47 |
48 | color: #2b2e38;
49 | background: #fff;
50 | }
51 |
52 | .remodal.remodal-is-opening,
53 | .remodal.remodal-is-closing {
54 | animation-duration: 0.3s;
55 | animation-fill-mode: forwards;
56 | }
57 |
58 | .remodal.remodal-is-opening {
59 | animation-name: remodal-opening-keyframes;
60 | }
61 |
62 | .remodal.remodal-is-closing {
63 | animation-name: remodal-closing-keyframes;
64 | }
65 |
66 | /* Vertical align of the modal dialog */
67 |
68 | .remodal,
69 | .remodal-wrapper:after {
70 | vertical-align: middle;
71 | }
72 |
73 | /* Close button */
74 |
75 | .remodal-close {
76 | position: absolute;
77 | top: 0;
78 | left: 0;
79 |
80 | display: block;
81 | overflow: visible;
82 |
83 | width: 35px;
84 | height: 35px;
85 | margin: 0;
86 | padding: 0;
87 |
88 | cursor: pointer;
89 | transition: color 0.2s;
90 | text-decoration: none;
91 |
92 | color: #95979c;
93 | border: 0;
94 | outline: 0;
95 | background: transparent;
96 | }
97 |
98 | .remodal-close:hover,
99 | .remodal-close:focus {
100 | color: #2b2e38;
101 | }
102 |
103 | .remodal-close:before {
104 | font-family: Arial, "Helvetica CY", "Nimbus Sans L", sans-serif !important;
105 | font-size: 25px;
106 | line-height: 35px;
107 |
108 | position: absolute;
109 | top: 0;
110 | left: 0;
111 |
112 | display: block;
113 |
114 | width: 35px;
115 |
116 | content: "\00d7";
117 | text-align: center;
118 | }
119 |
120 | /* Dialog buttons */
121 |
122 | .remodal-confirm,
123 | .remodal-cancel {
124 | font: inherit;
125 |
126 | display: inline-block;
127 | overflow: visible;
128 |
129 | min-width: 110px;
130 | margin: 0;
131 | padding: 12px 0;
132 |
133 | cursor: pointer;
134 | transition: background 0.2s;
135 | text-align: center;
136 | vertical-align: middle;
137 | text-decoration: none;
138 |
139 | border: 0;
140 | outline: 0;
141 | }
142 |
143 | .remodal-confirm {
144 | color: #fff;
145 | background: #81c784;
146 | }
147 |
148 | .remodal-confirm:hover,
149 | .remodal-confirm:focus {
150 | background: #66bb6a;
151 | }
152 |
153 | .remodal-cancel {
154 | color: #fff;
155 | background: #e57373;
156 | }
157 |
158 | .remodal-cancel:hover,
159 | .remodal-cancel:focus {
160 | background: #ef5350;
161 | }
162 |
163 | /* Remove inner padding and border in Firefox 4+ for the button tag. */
164 |
165 | .remodal-confirm::-moz-focus-inner,
166 | .remodal-cancel::-moz-focus-inner,
167 | .remodal-close::-moz-focus-inner {
168 | padding: 0;
169 |
170 | border: 0;
171 | }
172 |
173 | /* Keyframes
174 | ========================================================================== */
175 |
176 | @keyframes remodal-opening-keyframes {
177 | from {
178 | transform: scale(1.05);
179 |
180 | opacity: 0;
181 | }
182 | to {
183 | transform: none;
184 |
185 | opacity: 1;
186 |
187 | filter: blur(0);
188 | }
189 | }
190 |
191 | @keyframes remodal-closing-keyframes {
192 | from {
193 | transform: scale(1);
194 |
195 | opacity: 1;
196 | }
197 | to {
198 | transform: scale(0.95);
199 |
200 | opacity: 0;
201 |
202 | filter: blur(0);
203 | }
204 | }
205 |
206 | @keyframes remodal-overlay-opening-keyframes {
207 | from {
208 | opacity: 0;
209 | }
210 | to {
211 | opacity: 1;
212 | }
213 | }
214 |
215 | @keyframes remodal-overlay-closing-keyframes {
216 | from {
217 | opacity: 1;
218 | }
219 | to {
220 | opacity: 0;
221 | }
222 | }
223 |
224 | /* Media queries
225 | ========================================================================== */
226 |
227 | @media only screen and (min-width: 641px) {
228 | .remodal {
229 | max-width: 700px;
230 | }
231 | }
232 |
233 | /* IE8
234 | ========================================================================== */
235 |
236 | .lt-ie9 .remodal-overlay {
237 | background: #2b2e38;
238 | }
239 |
240 | .lt-ie9 .remodal {
241 | width: 700px;
242 | }
243 |
--------------------------------------------------------------------------------
/dist/remodal-default-theme.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Remodal - v1.1.1
3 | * Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
4 | * http://vodkabears.github.io/remodal/
5 | *
6 | * Made by Ilya Makarov
7 | * Under MIT License
8 | */
9 |
10 | /* ==========================================================================
11 | Remodal's default mobile first theme
12 | ========================================================================== */
13 |
14 | /* Default theme styles for the background */
15 |
16 | .remodal-bg.remodal-is-opening,
17 | .remodal-bg.remodal-is-opened {
18 | -webkit-filter: blur(3px);
19 | filter: blur(3px);
20 | }
21 |
22 | /* Default theme styles of the overlay */
23 |
24 | .remodal-overlay {
25 | background: rgba(43, 46, 56, 0.9);
26 | }
27 |
28 | .remodal-overlay.remodal-is-opening,
29 | .remodal-overlay.remodal-is-closing {
30 | -webkit-animation-duration: 0.3s;
31 | animation-duration: 0.3s;
32 | -webkit-animation-fill-mode: forwards;
33 | animation-fill-mode: forwards;
34 | }
35 |
36 | .remodal-overlay.remodal-is-opening {
37 | -webkit-animation-name: remodal-overlay-opening-keyframes;
38 | animation-name: remodal-overlay-opening-keyframes;
39 | }
40 |
41 | .remodal-overlay.remodal-is-closing {
42 | -webkit-animation-name: remodal-overlay-closing-keyframes;
43 | animation-name: remodal-overlay-closing-keyframes;
44 | }
45 |
46 | /* Default theme styles of the wrapper */
47 |
48 | .remodal-wrapper {
49 | padding: 10px 10px 0;
50 | }
51 |
52 | /* Default theme styles of the modal dialog */
53 |
54 | .remodal {
55 | box-sizing: border-box;
56 | width: 100%;
57 | margin-bottom: 10px;
58 | padding: 35px;
59 |
60 | -webkit-transform: translate3d(0, 0, 0);
61 | transform: translate3d(0, 0, 0);
62 |
63 | color: #2b2e38;
64 | background: #fff;
65 | }
66 |
67 | .remodal.remodal-is-opening,
68 | .remodal.remodal-is-closing {
69 | -webkit-animation-duration: 0.3s;
70 | animation-duration: 0.3s;
71 | -webkit-animation-fill-mode: forwards;
72 | animation-fill-mode: forwards;
73 | }
74 |
75 | .remodal.remodal-is-opening {
76 | -webkit-animation-name: remodal-opening-keyframes;
77 | animation-name: remodal-opening-keyframes;
78 | }
79 |
80 | .remodal.remodal-is-closing {
81 | -webkit-animation-name: remodal-closing-keyframes;
82 | animation-name: remodal-closing-keyframes;
83 | }
84 |
85 | /* Vertical align of the modal dialog */
86 |
87 | .remodal,
88 | .remodal-wrapper:after {
89 | vertical-align: middle;
90 | }
91 |
92 | /* Close button */
93 |
94 | .remodal-close {
95 | position: absolute;
96 | top: 0;
97 | left: 0;
98 |
99 | display: block;
100 | overflow: visible;
101 |
102 | width: 35px;
103 | height: 35px;
104 | margin: 0;
105 | padding: 0;
106 |
107 | cursor: pointer;
108 | -webkit-transition: color 0.2s;
109 | transition: color 0.2s;
110 | text-decoration: none;
111 |
112 | color: #95979c;
113 | border: 0;
114 | outline: 0;
115 | background: transparent;
116 | }
117 |
118 | .remodal-close:hover,
119 | .remodal-close:focus {
120 | color: #2b2e38;
121 | }
122 |
123 | .remodal-close:before {
124 | font-family: Arial, "Helvetica CY", "Nimbus Sans L", sans-serif !important;
125 | font-size: 25px;
126 | line-height: 35px;
127 |
128 | position: absolute;
129 | top: 0;
130 | left: 0;
131 |
132 | display: block;
133 |
134 | width: 35px;
135 |
136 | content: "\00d7";
137 | text-align: center;
138 | }
139 |
140 | /* Dialog buttons */
141 |
142 | .remodal-confirm,
143 | .remodal-cancel {
144 | font: inherit;
145 |
146 | display: inline-block;
147 | overflow: visible;
148 |
149 | min-width: 110px;
150 | margin: 0;
151 | padding: 12px 0;
152 |
153 | cursor: pointer;
154 | -webkit-transition: background 0.2s;
155 | transition: background 0.2s;
156 | text-align: center;
157 | vertical-align: middle;
158 | text-decoration: none;
159 |
160 | border: 0;
161 | outline: 0;
162 | }
163 |
164 | .remodal-confirm {
165 | color: #fff;
166 | background: #81c784;
167 | }
168 |
169 | .remodal-confirm:hover,
170 | .remodal-confirm:focus {
171 | background: #66bb6a;
172 | }
173 |
174 | .remodal-cancel {
175 | color: #fff;
176 | background: #e57373;
177 | }
178 |
179 | .remodal-cancel:hover,
180 | .remodal-cancel:focus {
181 | background: #ef5350;
182 | }
183 |
184 | /* Remove inner padding and border in Firefox 4+ for the button tag. */
185 |
186 | .remodal-confirm::-moz-focus-inner,
187 | .remodal-cancel::-moz-focus-inner,
188 | .remodal-close::-moz-focus-inner {
189 | padding: 0;
190 |
191 | border: 0;
192 | }
193 |
194 | /* Keyframes
195 | ========================================================================== */
196 |
197 | @-webkit-keyframes remodal-opening-keyframes {
198 | from {
199 | -webkit-transform: scale(1.05);
200 | transform: scale(1.05);
201 |
202 | opacity: 0;
203 | }
204 | to {
205 | -webkit-transform: none;
206 | transform: none;
207 |
208 | opacity: 1;
209 |
210 | -webkit-filter: blur(0);
211 | filter: blur(0);
212 | }
213 | }
214 |
215 | @keyframes remodal-opening-keyframes {
216 | from {
217 | -webkit-transform: scale(1.05);
218 | transform: scale(1.05);
219 |
220 | opacity: 0;
221 | }
222 | to {
223 | -webkit-transform: none;
224 | transform: none;
225 |
226 | opacity: 1;
227 |
228 | -webkit-filter: blur(0);
229 | filter: blur(0);
230 | }
231 | }
232 |
233 | @-webkit-keyframes remodal-closing-keyframes {
234 | from {
235 | -webkit-transform: scale(1);
236 | transform: scale(1);
237 |
238 | opacity: 1;
239 | }
240 | to {
241 | -webkit-transform: scale(0.95);
242 | transform: scale(0.95);
243 |
244 | opacity: 0;
245 |
246 | -webkit-filter: blur(0);
247 | filter: blur(0);
248 | }
249 | }
250 |
251 | @keyframes remodal-closing-keyframes {
252 | from {
253 | -webkit-transform: scale(1);
254 | transform: scale(1);
255 |
256 | opacity: 1;
257 | }
258 | to {
259 | -webkit-transform: scale(0.95);
260 | transform: scale(0.95);
261 |
262 | opacity: 0;
263 |
264 | -webkit-filter: blur(0);
265 | filter: blur(0);
266 | }
267 | }
268 |
269 | @-webkit-keyframes remodal-overlay-opening-keyframes {
270 | from {
271 | opacity: 0;
272 | }
273 | to {
274 | opacity: 1;
275 | }
276 | }
277 |
278 | @keyframes remodal-overlay-opening-keyframes {
279 | from {
280 | opacity: 0;
281 | }
282 | to {
283 | opacity: 1;
284 | }
285 | }
286 |
287 | @-webkit-keyframes remodal-overlay-closing-keyframes {
288 | from {
289 | opacity: 1;
290 | }
291 | to {
292 | opacity: 0;
293 | }
294 | }
295 |
296 | @keyframes remodal-overlay-closing-keyframes {
297 | from {
298 | opacity: 1;
299 | }
300 | to {
301 | opacity: 0;
302 | }
303 | }
304 |
305 | /* Media queries
306 | ========================================================================== */
307 |
308 | @media only screen and (min-width: 641px) {
309 | .remodal {
310 | max-width: 700px;
311 | }
312 | }
313 |
314 | /* IE8
315 | ========================================================================== */
316 |
317 | .lt-ie9 .remodal-overlay {
318 | background: #2b2e38;
319 | }
320 |
321 | .lt-ie9 .remodal {
322 | width: 700px;
323 | }
324 |
--------------------------------------------------------------------------------
/dist/remodal.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Remodal - v1.1.1
3 | * Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
4 | * http://vodkabears.github.io/remodal/
5 | *
6 | * Made by Ilya Makarov
7 | * Under MIT License
8 | */
9 |
10 | !function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return b(a,c)}):"object"==typeof exports?b(a,require("jquery")):b(a,a.jQuery||a.Zepto)}(this,function(a,b){"use strict";function c(a){if(w&&"none"===a.css("animation-name")&&"none"===a.css("-webkit-animation-name")&&"none"===a.css("-moz-animation-name")&&"none"===a.css("-o-animation-name")&&"none"===a.css("-ms-animation-name"))return 0;var b,c,d,e,f=a.css("animation-duration")||a.css("-webkit-animation-duration")||a.css("-moz-animation-duration")||a.css("-o-animation-duration")||a.css("-ms-animation-duration")||"0s",g=a.css("animation-delay")||a.css("-webkit-animation-delay")||a.css("-moz-animation-delay")||a.css("-o-animation-delay")||a.css("-ms-animation-delay")||"0s",h=a.css("animation-iteration-count")||a.css("-webkit-animation-iteration-count")||a.css("-moz-animation-iteration-count")||a.css("-o-animation-iteration-count")||a.css("-ms-animation-iteration-count")||"1";for(f=f.split(", "),g=g.split(", "),h=h.split(", "),e=0,c=f.length,b=Number.NEGATIVE_INFINITY;eb&&(b=d);return b}function d(){if(b(document).height()<=b(window).height())return 0;var a,c,d=document.createElement("div"),e=document.createElement("div");return d.style.visibility="hidden",d.style.width="100px",document.body.appendChild(d),a=d.offsetWidth,d.style.overflow="scroll",e.style.width="100%",d.appendChild(e),c=e.offsetWidth,d.parentNode.removeChild(d),a-c}function e(){if(!x){var a,c,e=b("html"),f=k("is-locked");e.hasClass(f)||(c=b(document.body),a=parseInt(c.css("padding-right"),10)+d(),c.css("padding-right",a+"px"),e.addClass(f))}}function f(){if(!x){var a,c,e=b("html"),f=k("is-locked");e.hasClass(f)&&(c=b(document.body),a=parseInt(c.css("padding-right"),10)-d(),c.css("padding-right",a+"px"),e.removeClass(f))}}function g(a,b,c,d){var e=k("is",b),f=[k("is",u.CLOSING),k("is",u.OPENING),k("is",u.CLOSED),k("is",u.OPENED)].join(" ");a.$bg.removeClass(f).addClass(e),a.$overlay.removeClass(f).addClass(e),a.$wrapper.removeClass(f).addClass(e),a.$modal.removeClass(f).addClass(e),a.state=b,!c&&a.$modal.trigger({type:b,reason:d},[{reason:d}])}function h(a,d,e){var f=0,g=function(a){a.target===this&&f++},h=function(a){a.target===this&&0===--f&&(b.each(["$bg","$overlay","$wrapper","$modal"],function(a,b){e[b].off(r+" "+s)}),d())};b.each(["$bg","$overlay","$wrapper","$modal"],function(a,b){e[b].on(r,g).on(s,h)}),a(),0===c(e.$bg)&&0===c(e.$overlay)&&0===c(e.$wrapper)&&0===c(e.$modal)&&(b.each(["$bg","$overlay","$wrapper","$modal"],function(a,b){e[b].off(r+" "+s)}),d())}function i(a){a.state!==u.CLOSED&&(b.each(["$bg","$overlay","$wrapper","$modal"],function(b,c){a[c].off(r+" "+s)}),a.$bg.removeClass(a.settings.modifier),a.$overlay.removeClass(a.settings.modifier).hide(),a.$wrapper.hide(),f(),g(a,u.CLOSED,!0))}function j(a){var b,c,d,e,f={};for(a=a.replace(/\s*:\s*/g,":").replace(/\s*,\s*/g,","),b=a.split(","),e=0,c=b.length;e").addClass(k("overlay")+" "+k("is",u.CLOSED)).hide(),e.append(f.$overlay)),f.$bg=b("."+k("bg")).addClass(k("is",u.CLOSED)),f.$modal=a.addClass(q+" "+k("is-initialized")+" "+f.settings.modifier+" "+k("is",u.CLOSED)).attr("tabindex","-1"),f.$wrapper=b("").addClass(k("wrapper")+" "+f.settings.modifier+" "+k("is",u.CLOSED)).hide().append(f.$modal),e.append(f.$wrapper),f.$wrapper.on("click."+q,'[data-remodal-action="close"]',function(a){a.preventDefault(),f.close()}),f.$wrapper.on("click."+q,'[data-remodal-action="cancel"]',function(a){a.preventDefault(),f.$modal.trigger(v.CANCELLATION),f.settings.closeOnCancel&&f.close(v.CANCELLATION)}),f.$wrapper.on("click."+q,'[data-remodal-action="confirm"]',function(a){a.preventDefault(),f.$modal.trigger(v.CONFIRMATION),f.settings.closeOnConfirm&&f.close(v.CONFIRMATION)}),f.$wrapper.on("click."+q,function(a){var c=b(a.target);c.hasClass(k("wrapper"))&&f.settings.closeOnOutsideClick&&f.close()})}var n,o,p="remodal",q=a.REMODAL_GLOBALS&&a.REMODAL_GLOBALS.NAMESPACE||p,r=b.map(["animationstart","webkitAnimationStart","MSAnimationStart","oAnimationStart"],function(a){return a+"."+q}).join(" "),s=b.map(["animationend","webkitAnimationEnd","MSAnimationEnd","oAnimationEnd"],function(a){return a+"."+q}).join(" "),t=b.extend({hashTracking:!0,closeOnConfirm:!0,closeOnCancel:!0,closeOnEscape:!0,closeOnOutsideClick:!0,modifier:"",appendTo:null},a.REMODAL_GLOBALS&&a.REMODAL_GLOBALS.DEFAULTS),u={CLOSING:"closing",CLOSED:"closed",OPENING:"opening",OPENED:"opened"},v={CONFIRMATION:"confirmation",CANCELLATION:"cancellation"},w=function(){var a=document.createElement("div").style;return void 0!==a.animationName||void 0!==a.WebkitAnimationName||void 0!==a.MozAnimationName||void 0!==a.msAnimationName||void 0!==a.OAnimationName}(),x=/iPad|iPhone|iPod/.test(navigator.platform);m.prototype.open=function(){var a,c=this;c.state!==u.OPENING&&c.state!==u.CLOSING&&(a=c.$modal.attr("data-remodal-id"),a&&c.settings.hashTracking&&(o=b(window).scrollTop(),location.hash=a),n&&n!==c&&i(n),n=c,e(),c.$bg.addClass(c.settings.modifier),c.$overlay.addClass(c.settings.modifier).show(),c.$wrapper.show().scrollTop(0),c.$modal.focus(),h(function(){g(c,u.OPENING)},function(){g(c,u.OPENED)},c))},m.prototype.close=function(a){var c=this;c.state!==u.OPENING&&c.state!==u.CLOSING&&c.state!==u.CLOSED&&(c.settings.hashTracking&&c.$modal.attr("data-remodal-id")===location.hash.substr(1)&&(location.hash="",b(window).scrollTop(o)),h(function(){g(c,u.CLOSING,!1,a)},function(){c.$bg.removeClass(c.settings.modifier),c.$overlay.removeClass(c.settings.modifier).hide(),c.$wrapper.hide(),f(),g(c,u.CLOSED,!1,a)},c))},m.prototype.getState=function(){return this.state},m.prototype.destroy=function(){var a,c=b[p].lookup;i(this),this.$wrapper.remove(),delete c[this.index],a=b.grep(c,function(a){return!!a}).length,0===a&&(this.$overlay.remove(),this.$bg.removeClass(k("is",u.CLOSING)+" "+k("is",u.OPENING)+" "+k("is",u.CLOSED)+" "+k("is",u.OPENED)))},b[p]={lookup:[]},b.fn[p]=function(a){var c,d;return this.each(function(e,f){d=b(f),null==d.data(p)?(c=new m(d,a),d.data(p,c.index),c.settings.hashTracking&&d.attr("data-remodal-id")===location.hash.substr(1)&&c.open()):c=b[p].lookup[d.data(p)]}),c},b(document).ready(function(){b(document).on("click","[data-remodal-target]",function(a){a.preventDefault();var c=a.currentTarget,d=c.getAttribute("data-remodal-target"),e=b('[data-remodal-id="'+d+'"]');b[p].lookup[e.data(p)].open()}),b(document).find("."+q).each(function(a,c){var d=b(c),e=d.data("remodal-options");e?("string"==typeof e||e instanceof String)&&(e=j(e)):e={},d[p](e)}),b(document).on("keydown."+q,function(a){n&&n.settings.closeOnEscape&&n.state===u.OPENED&&27===a.keyCode&&n.close()}),b(window).on("hashchange."+q,l)})});
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://npmjs.org/package/remodal)
2 | [](http://badge.fury.io/bo/remodal)
3 | [](https://travis-ci.org/VodkaBears/Remodal)
4 | Remodal
5 | =======
6 |
7 | **No longer actively maintained. I am not interested to maintain jQuery plugins anymore. If you have some fixes, feel free to make PR.**
8 |
9 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
10 |
11 | 
12 |
13 | ## Notes
14 | * All modern browsers are supported.
15 | * IE8+. To enable IE8 styles add the `lt-ie9` class to the `html` element, as modernizr does.
16 | * jQuery, jQuery2, Zepto support.
17 | * Browserify support.
18 |
19 | ## Start
20 |
21 | Download the latest version from [GitHub](https://github.com/VodkaBears/Remodal/releases/latest
22 | ) or via package managers:
23 | ```
24 | npm install remodal
25 | bower install remodal
26 | ```
27 |
28 | Include the CSS files from the dist folder in the head section:
29 | ```html
30 |
31 |
32 | ```
33 |
34 | Include the JS file from the dist folder before the `
27 |
28 |
Modal №1
29 |
Modal №2
30 |
31 |
32 |
Remodal
33 |
34 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
35 | with declarative configuration and hash tracking.
36 |
37 |
38 |
39 |
Remodal
40 |
41 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
42 | with declarative configuration and hash tracking.
43 |
44 |
45 |
46 |
Remodal
47 |
48 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
49 | with declarative configuration and hash tracking.
50 |
51 |
52 |
53 |
Remodal
54 |
55 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
56 | with declarative configuration and hash tracking.
57 |
58 |
59 |
60 |
Remodal
61 |
62 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
63 | with declarative configuration and hash tracking.
64 |
65 |
66 |
67 |
Remodal
68 |
69 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
70 | with declarative configuration and hash tracking.
71 |
72 |
73 |
74 |
Remodal
75 |
76 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
77 | with declarative configuration and hash tracking.
78 |
79 |
80 |
81 |
Remodal
82 |
83 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
84 | with declarative configuration and hash tracking.
85 |
86 |
87 |
88 |
Remodal
89 |
90 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
91 | with declarative configuration and hash tracking.
92 |
93 |
94 |
95 |
Remodal
96 |
97 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
98 | with declarative configuration and hash tracking.
99 |
100 |
101 |
102 |
Remodal
103 |
104 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
105 | with declarative configuration and hash tracking.
106 |
107 |
108 |
109 |
Remodal
110 |
111 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
112 | with declarative configuration and hash tracking.
113 |
114 |
115 |
116 |
Remodal
117 |
118 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
119 | with declarative configuration and hash tracking.
120 |
121 |
122 |
123 |
Remodal
124 |
125 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
126 | with declarative configuration and hash tracking.
127 |
128 |
129 |
130 |
Remodal
131 |
132 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
133 | with declarative configuration and hash tracking.
134 |
135 |
136 |
137 |
Remodal
138 |
139 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
140 | with declarative configuration and hash tracking.
141 |
142 |
143 |
144 |
Remodal
145 |
146 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
147 | with declarative configuration and hash tracking.
148 |
149 |
150 |
151 |
Remodal
152 |
153 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
154 | with declarative configuration and hash tracking.
155 |
156 |
157 |
158 |
Remodal
159 |
160 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
161 | with declarative configuration and hash tracking.
162 |
163 |
164 |
165 |
Remodal
166 |
167 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
168 | with declarative configuration and hash tracking.
169 |
170 |
171 |
172 |
Remodal
173 |
174 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
175 | with declarative configuration and hash tracking.
176 |
177 |
178 |
179 |
Remodal
180 |
181 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
182 | with declarative configuration and hash tracking.
183 |
184 |
185 |
186 |
Remodal
187 |
188 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
189 | with declarative configuration and hash tracking.
190 |
191 |
192 |
193 |
Remodal
194 |
195 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
196 | with declarative configuration and hash tracking.
197 |
198 |
199 |
200 |
Remodal
201 |
202 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
203 | with declarative configuration and hash tracking.
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
Remodal
212 |
213 | Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin
214 | with declarative state notation and hash tracking.
215 |
216 |
217 |
218 |
Cancel
219 |
OK
220 |
221 |
222 |
223 |
224 |
Another one window
225 |
226 | Hello!
227 |
228 |
229 |
230 |
Hello!
231 |
232 |
233 |
234 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
295 | `:
35 | ```html
36 |
37 | ```
38 |
39 | You can define the background container for the modal(for effects like a blur). It can be any simple content wrapper:
40 | ```html
41 |
58 | ```
59 |
60 | Don't use the `id` attribute, if you want to avoid the anchor jump, use `data-remodal-id`.
61 |
62 | So, now you can call it with the hash:
63 | ```html
64 | Call the modal with data-remodal-id="modal"
65 | ```
66 | Or:
67 | ```html
68 | Call the modal with data-remodal-id="modal"
69 | ```
70 |
71 | ## Options
72 |
73 | You can pass additional options with the `data-remodal-options` attribute.
74 | ```html
75 |
87 | ```
88 |
89 | #### hashTracking
90 | `Default: true`
91 |
92 | To open the modal without the hash, use the `data-remodal-target` attribute.
93 | ```html
94 | Call the modal with data-remodal-id="modal"
95 | ```
96 |
97 | #### closeOnConfirm
98 | `Default: true`
99 |
100 | If true, closes the modal window after clicking the confirm button.
101 |
102 | #### closeOnCancel
103 | `Default: true`
104 |
105 | If true, closes the modal window after clicking the cancel button.
106 |
107 | #### closeOnEscape
108 | `Default: true`
109 |
110 | If true, closes the modal window after pressing the ESC key.
111 |
112 | #### closeOnOutsideClick
113 | `Default: true`
114 |
115 | If true, closes the modal window by clicking anywhere on the page.
116 |
117 | #### modifier
118 | `Default: ''`
119 |
120 | Modifier CSS classes for the modal that is added to the overlay, modal, background and wrapper (see [CSS](#css)).
121 |
122 | #### appendTo
123 | `Default: document.body`
124 |
125 | ## Globals
126 |
127 | ```html
128 |
136 |
137 | ```
138 |
139 | #### NAMESPACE
140 |
141 | Base HTML class for your modals. CSS theme should be updated to reflect this.
142 |
143 | #### DEFAULTS
144 |
145 | Extends the default settings.
146 |
147 | ## Initialization with JavaScript
148 |
149 | Do not set the 'remodal' class, if you prefer a JS initialization.
150 | ```html
151 |
158 |
163 | ```
164 |
165 | ## Methods
166 |
167 | Get the instance of the modal and call a method:
168 | ```js
169 | var inst = $('[data-remodal-id=modal]').remodal();
170 |
171 | /**
172 | * Opens the modal window
173 | */
174 | inst.open();
175 |
176 | /**
177 | * Closes the modal window
178 | */
179 | inst.close();
180 |
181 | /**
182 | * Returns a current state of the modal
183 | * @returns {'closed'|'closing'|'opened'|'opening'}
184 | */
185 | inst.getState();
186 |
187 | /**
188 | * Destroys the modal window
189 | */
190 | inst.destroy();
191 | ```
192 |
193 | ## Events
194 |
195 | ```js
196 | $(document).on('opening', '.remodal', function () {
197 | console.log('Modal is opening');
198 | });
199 |
200 | $(document).on('opened', '.remodal', function () {
201 | console.log('Modal is opened');
202 | });
203 |
204 | $(document).on('closing', '.remodal', function (e) {
205 |
206 | // Reason: 'confirmation', 'cancellation'
207 | console.log('Modal is closing' + (e.reason ? ', reason: ' + e.reason : ''));
208 | });
209 |
210 | $(document).on('closed', '.remodal', function (e) {
211 |
212 | // Reason: 'confirmation', 'cancellation'
213 | console.log('Modal is closed' + (e.reason ? ', reason: ' + e.reason : ''));
214 | });
215 |
216 | $(document).on('confirmation', '.remodal', function () {
217 | console.log('Confirmation button is clicked');
218 | });
219 |
220 | $(document).on('cancellation', '.remodal', function () {
221 | console.log('Cancel button is clicked');
222 | });
223 | ```
224 |
225 | ## CSS
226 |
227 | #### Classes
228 |
229 | `.remodal` – the default class of modal dialogs.
230 |
231 | `.remodal-wrapper` – the additional wrapper for the `.remodal`, it is not the overlay and used for the alignment.
232 |
233 | `.remodal-overlay` – the overlay of modal dialogs, it is under the wrapper.
234 |
235 | `.remodal-bg` – the background of modal dialogs, it is under the overlay and usually it is the wrapper of your content. You should add it on your own.
236 |
237 | The `remodal` prefix can be changed in the global settings. See [the `NAMESPACE` option](#namespace).
238 |
239 | #### States
240 |
241 | States are added to the `.remodal`, `.remodal-overlay`, `.remodal-bg`, `.remodal-wrapper` classes.
242 |
243 | List:
244 | ```
245 | .remodal-is-opening
246 | .remodal-is-opened
247 | .remodal-is-closing
248 | .remodal-is-closed
249 | ```
250 |
251 | #### Modifier
252 |
253 | A modifier that is specified in the [options](#options) is added to the `.remodal`, `.remodal-overlay`, `.remodal-bg`, `.remodal-wrapper` classes.
254 |
255 | ## Using with other javascript libraries
256 |
257 | Remodal has wrappers that make it easy to use with other javascript libraries:
258 |
259 | ### Ember
260 |
261 | * [ember-remodal](https://github.com/sethbrasile/ember-remodal)
262 |
263 | ## License
264 |
265 | ```
266 | The MIT License (MIT)
267 |
268 | Copyright (c) 2015 Ilya Makarov
269 |
270 | Permission is hereby granted, free of charge, to any person obtaining a copy
271 | of this software and associated documentation files (the "Software"), to deal
272 | in the Software without restriction, including without limitation the rights
273 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
274 | copies of the Software, and to permit persons to whom the Software is
275 | furnished to do so, subject to the following conditions:
276 |
277 | The above copyright notice and this permission notice shall be included in all
278 | copies or substantial portions of the Software.
279 |
280 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
281 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
282 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
283 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
284 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
285 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
286 | SOFTWARE.
287 | ```
288 |
--------------------------------------------------------------------------------
/examples/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |