rails_modular_admin 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +71 -0
- data/Rakefile +34 -0
- data/app/assets/config/rails_modular_admin_manifest.js +2 -0
- data/app/assets/javascripts/index.js +87 -0
- data/app/assets/javascripts/rails_modular_admin.js +3 -0
- data/app/assets/javascripts/rails_modular_admin/_common/_helpers/code-helper.js +36 -0
- data/app/assets/javascripts/rails_modular_admin/_common/_helpers/for-helper.js +8 -0
- data/app/assets/javascripts/rails_modular_admin/_common/_helpers/is-helper.js +98 -0
- data/app/assets/javascripts/rails_modular_admin/_common/_helpers/times-helper.js +11 -0
- data/app/assets/javascripts/rails_modular_admin/_common/animations/animations.js +14 -0
- data/app/assets/javascripts/rails_modular_admin/_common/items-list/items-list.js +19 -0
- data/app/assets/javascripts/rails_modular_admin/_common/nprogress/nprogress.js +9 -0
- data/app/assets/javascripts/rails_modular_admin/_common/sameheight-items/sameheight-items.js +44 -0
- data/app/assets/javascripts/rails_modular_admin/app.js +1429 -0
- data/app/assets/javascripts/rails_modular_admin/app/_common/editor/editor-helper.js +10 -0
- data/app/assets/javascripts/rails_modular_admin/app/_common/editor/editor.js +34 -0
- data/app/assets/javascripts/rails_modular_admin/app/_common/header/nav/nav.js +14 -0
- data/app/assets/javascripts/rails_modular_admin/app/_common/modals/modal-media/modal-media.js +23 -0
- data/app/assets/javascripts/rails_modular_admin/app/_common/sidebar/customize/customize.js +155 -0
- data/app/assets/javascripts/rails_modular_admin/app/_common/sidebar/sidebar.js +38 -0
- data/app/assets/javascripts/rails_modular_admin/app/charts/charts-flot/charts-flot.js +329 -0
- data/app/assets/javascripts/rails_modular_admin/app/charts/charts-morris/charts-morris.js +125 -0
- data/app/assets/javascripts/rails_modular_admin/app/dashboard/history/history.js +145 -0
- data/app/assets/javascripts/rails_modular_admin/app/dashboard/items/items.js +41 -0
- data/app/assets/javascripts/rails_modular_admin/app/dashboard/sales-breakdown/sales-breakdown.js +37 -0
- data/app/assets/javascripts/rails_modular_admin/app/dashboard/sales-by-countries/sales-by-countries.js +50 -0
- data/app/assets/javascripts/rails_modular_admin/app/dashboard/tasks/tasks.js +13 -0
- data/app/assets/javascripts/rails_modular_admin/app/forms/input-groups/input-groups.js +14 -0
- data/app/assets/javascripts/rails_modular_admin/app/items/editor/item-editor.js +34 -0
- data/app/assets/javascripts/rails_modular_admin/app/items/list/items-list.js +44 -0
- data/app/assets/javascripts/rails_modular_admin/app/pages/error.js +18 -0
- data/app/assets/javascripts/rails_modular_admin/auth/login/login.js +35 -0
- data/app/assets/javascripts/rails_modular_admin/auth/reset/reset.js +31 -0
- data/app/assets/javascripts/rails_modular_admin/auth/signup/signup.js +88 -0
- data/app/assets/javascripts/rails_modular_admin/config.js +51 -0
- data/app/assets/javascripts/rails_modular_admin/main.js +16 -0
- data/app/assets/javascripts/rails_modular_admin/vendor.js +60485 -0
- data/app/assets/stylesheets/rails_modular_admin.scss +1 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/_styles/_mixins.scss +103 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/_styles/layout.scss +74 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/_styles/misc.scss +115 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/_styles/typography.scss +60 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/alert/alert.scss +27 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/animations/animations.scss +4 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/button/button.scss +117 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/card/card.scss +200 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/chart/chart.scss +9 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/dropdown/dropdown.scss +28 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/flex/flex.scss +14 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/form/form.scss +235 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/images-container/images-container.scss +129 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/items-list/items-list.scss +388 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/logo/logo.scss +46 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/modal/modal-tabs.scss +27 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/navigation/navigation.scss +114 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/nprogress/nprogress.scss +22 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/pagination/pagination.scss +20 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/sameheight-items/sameheight-items.scss +5 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/scrollbar/scrollbar.scss +24 -0
- data/app/assets/stylesheets/rails_modular_admin/_common/table/table.scss +12 -0
- data/app/assets/stylesheets/rails_modular_admin/_main.scss +41 -0
- data/app/assets/stylesheets/rails_modular_admin/_themes/blue-theme.scss +1 -0
- data/app/assets/stylesheets/rails_modular_admin/_themes/custom-theme.scss +0 -0
- data/app/assets/stylesheets/rails_modular_admin/_themes/green-theme.scss +10 -0
- data/app/assets/stylesheets/rails_modular_admin/_themes/orange-theme.scss +12 -0
- data/app/assets/stylesheets/rails_modular_admin/_themes/purple-theme.scss +6 -0
- data/app/assets/stylesheets/rails_modular_admin/_themes/red-theme.scss +11 -0
- data/app/assets/stylesheets/rails_modular_admin/_themes/seagreen-theme.scss +9 -0
- data/app/assets/stylesheets/rails_modular_admin/_variables.scss +109 -0
- data/app/assets/stylesheets/rails_modular_admin/app/_common/editor/editor.scss +28 -0
- data/app/assets/stylesheets/rails_modular_admin/app/_common/footer/footer.scss +68 -0
- data/app/assets/stylesheets/rails_modular_admin/app/_common/header/buttons/buttons.scss +30 -0
- data/app/assets/stylesheets/rails_modular_admin/app/_common/header/collapse/collapse.scss +23 -0
- data/app/assets/stylesheets/rails_modular_admin/app/_common/header/header.scss +33 -0
- data/app/assets/stylesheets/rails_modular_admin/app/_common/header/nav/nav.scss +64 -0
- data/app/assets/stylesheets/rails_modular_admin/app/_common/header/nav/notifications/notifications.scss +126 -0
- data/app/assets/stylesheets/rails_modular_admin/app/_common/header/nav/profile/profile.scss +93 -0
- data/app/assets/stylesheets/rails_modular_admin/app/_common/header/search/search.scss +68 -0
- data/app/assets/stylesheets/rails_modular_admin/app/_common/modals/modal-media/modal-media.scss +56 -0
- data/app/assets/stylesheets/rails_modular_admin/app/_common/modals/modals.scss +19 -0
- data/app/assets/stylesheets/rails_modular_admin/app/_common/sidebar/customize/customize.scss +157 -0
- data/app/assets/stylesheets/rails_modular_admin/app/_common/sidebar/header/header.scss +14 -0
- data/app/assets/stylesheets/rails_modular_admin/app/_common/sidebar/sidebar.scss +240 -0
- data/app/assets/stylesheets/rails_modular_admin/app/app.scss +72 -0
- data/app/assets/stylesheets/rails_modular_admin/app/charts/charts-flot/charts-flot.scss +18 -0
- data/app/assets/stylesheets/rails_modular_admin/app/dashboard/dashboard.scss +7 -0
- data/app/assets/stylesheets/rails_modular_admin/app/dashboard/history/history.scss +6 -0
- data/app/assets/stylesheets/rails_modular_admin/app/dashboard/items/items-header.scss +81 -0
- data/app/assets/stylesheets/rails_modular_admin/app/dashboard/items/items-list.scss +102 -0
- data/app/assets/stylesheets/rails_modular_admin/app/dashboard/sales-breakdown/sales-breakdown.scss +7 -0
- data/app/assets/stylesheets/rails_modular_admin/app/dashboard/sales-by-countries/sales-by-countries.scss +14 -0
- data/app/assets/stylesheets/rails_modular_admin/app/dashboard/stats/stats.scss +70 -0
- data/app/assets/stylesheets/rails_modular_admin/app/dashboard/tasks/tasks.scss +47 -0
- data/app/assets/stylesheets/rails_modular_admin/app/items/editor/item-editor.scss +3 -0
- data/app/assets/stylesheets/rails_modular_admin/app/items/list/items-list.scss +330 -0
- data/app/assets/stylesheets/rails_modular_admin/app/pages/error.scss +73 -0
- data/app/assets/stylesheets/rails_modular_admin/app/pages/screenful/screenful.scss +101 -0
- data/app/assets/stylesheets/rails_modular_admin/app/tables/responsive-tables/responsive-tables.scss +77 -0
- data/app/assets/stylesheets/rails_modular_admin/application.scss +26 -0
- data/app/assets/stylesheets/rails_modular_admin/auth/auth.scss +72 -0
- data/app/controllers/rails_modular_admin/application_controller.rb +5 -0
- data/app/helpers/rails_modular_admin/application_helper.rb +4 -0
- data/app/jobs/rails_modular_admin/application_job.rb +4 -0
- data/app/mailers/rails_modular_admin/application_mailer.rb +6 -0
- data/app/models/rails_modular_admin/application_record.rb +5 -0
- data/app/views/layouts/rails_modular_admin/application.html.erb +16 -0
- data/config/initializers/assets.rb +1 -0
- data/config/routes.rb +2 -0
- data/lib/generators/rails_modular_admin/USAGE +8 -0
- data/lib/generators/rails_modular_admin/install_generator.rb +12 -0
- data/lib/generators/rails_modular_admin/templates/custom-theme.scss +14 -0
- data/lib/rails_modular_admin.rb +11 -0
- data/lib/rails_modular_admin/engine.rb +5 -0
- data/lib/rails_modular_admin/version.rb +3 -0
- data/lib/tasks/rails_modular_admin_tasks.rake +47 -0
- metadata +205 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b87a4389dafaf3e36acebc70d287b90dd3da6a16
|
4
|
+
data.tar.gz: 161253ecd0b57d646cbd0b2332ddb89c0c824eee
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7c4e18c9d696c3bb20214989a84ff250f4c1c0d95b56a4bce883caec2d334e12ec8d0659b8d723f96f5b50d0d76a885a027e8e12e80c215ef0c84e0c05032143
|
7
|
+
data.tar.gz: a07bc23eb1de6afea38b7a49a0206819b927ed95c527038ac655a498d97e974b63fbf27a71a3388b4688bb52e60f4a80d5220d2d298363bafc0b0f4d810c14e0
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2018 Will Payne
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
# RailsModularAdmin
|
2
|
+
This plugin is designed to quickly generate views for Rails applications in need of dashboard functionality. This includes admin panels and SaaS applications. I found that over the course of my projects, I needed Dashboard pages very often, so by creating this gem, I'm at least saving my self a bunch of time.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
Easiest way is to run the install task:
|
6
|
+
```bash
|
7
|
+
$ rails g rails_modular_admin:install
|
8
|
+
```
|
9
|
+
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
Add this line to your application's Gemfile:
|
13
|
+
```ruby
|
14
|
+
gem 'rails_modular_admin'
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
```bash
|
19
|
+
$ bundle
|
20
|
+
```
|
21
|
+
|
22
|
+
You will additionally need to install the dependencies, by adding these to your package.json:
|
23
|
+
```
|
24
|
+
"animate.css": "^3.5.2",
|
25
|
+
"bootstrap": "^4.0.0",
|
26
|
+
"dropzone": "^5.3.0",
|
27
|
+
"jquery": "^3.0.0",
|
28
|
+
"jquery-flot": "^0.8.3",
|
29
|
+
"jquery-sparkline": "^2.4.0",
|
30
|
+
"jquery-touchswipe": "^1.6.18",
|
31
|
+
"jquery-validation": "^1.17.0",
|
32
|
+
"jquery.browser": "^0.1.0",
|
33
|
+
"jquery.flot.tooltip": "^0.9.0",
|
34
|
+
"jqvmap": "^1.5.1",
|
35
|
+
"metismenu": "^2.7.2",
|
36
|
+
"morris.js": "^0.5.0",
|
37
|
+
"nprogress": "^0.2.0",
|
38
|
+
"opencollective": "^1.0.3",
|
39
|
+
"popper.js": "^1.12.9",
|
40
|
+
"quill": "^1.3.5",
|
41
|
+
"raphael": "^2.2.7",
|
42
|
+
"responsive-toolkit": "^2.6.3",
|
43
|
+
"sortablejs": "^1.7.0",
|
44
|
+
"tether": "^1.4.3",
|
45
|
+
"tinycolor2": "^1.4.1"
|
46
|
+
```
|
47
|
+
Then, run:
|
48
|
+
```bash
|
49
|
+
yarn install
|
50
|
+
```
|
51
|
+
|
52
|
+
Now install through the included generator:
|
53
|
+
```bash
|
54
|
+
rails g rails_modular_admin:install
|
55
|
+
```
|
56
|
+
|
57
|
+
The install generator copies over the custom theme.scss file, which you can use to include your own color scheme. Finally, add the following line to your application.scss:
|
58
|
+
```scss
|
59
|
+
@import "rails_modular_admin";
|
60
|
+
```
|
61
|
+
|
62
|
+
```javascript
|
63
|
+
//= require rails_modular_admin
|
64
|
+
```
|
65
|
+
|
66
|
+
## Contributing
|
67
|
+
Write a pull request and I'll get to it as soon as I can.
|
68
|
+
|
69
|
+
## License
|
70
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
71
|
+
# RailsModularAdmin
|
data/Rakefile
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'RailsModularAdmin'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
load 'rails/tasks/statistics.rake'
|
21
|
+
|
22
|
+
load 'lib/tasks/rails_modular_admin_tasks.rake'
|
23
|
+
|
24
|
+
require 'bundler/gem_tasks'
|
25
|
+
|
26
|
+
require 'rake/testtask'
|
27
|
+
|
28
|
+
Rake::TestTask.new(:test) do |t|
|
29
|
+
t.libs << 'test'
|
30
|
+
t.pattern = 'test/**/*_test.rb'
|
31
|
+
t.verbose = false
|
32
|
+
end
|
33
|
+
|
34
|
+
task default: :test
|
@@ -0,0 +1,87 @@
|
|
1
|
+
var path = require('path');
|
2
|
+
|
3
|
+
var rootDir = path.resolve("../"); // Root dir
|
4
|
+
var srcDir = path.resolve("../src"); // Source files
|
5
|
+
var destDir = path.resolve("../dist"); // Build destination
|
6
|
+
var npmDir = path.resolve("../node_modules"); // Npm dir
|
7
|
+
|
8
|
+
var config = {
|
9
|
+
rootDir: rootDir,
|
10
|
+
srcDir: srcDir,
|
11
|
+
destDir: destDir,
|
12
|
+
npmDir: npmDir,
|
13
|
+
port: 4000,
|
14
|
+
paths: {}
|
15
|
+
};
|
16
|
+
|
17
|
+
// Vendor libs paths
|
18
|
+
config.paths.vendor = {
|
19
|
+
scripts: [
|
20
|
+
npmDir + '/jquery/dist/jquery.js',
|
21
|
+
npmDir + '/jquery-flot/jquery.flot.js',
|
22
|
+
npmDir + '/jquery-flot/jquery.flot.resize.js',
|
23
|
+
npmDir + '/jquery-flot/jquery.flot.pie.js',
|
24
|
+
npmDir + '/jquery-flot/jquery.flot.time.js',
|
25
|
+
npmDir + '/jquery.flot.tooltip/js/jquery.flot.tooltip.js',
|
26
|
+
npmDir + '/jquery-validation/dist/jquery.validate.js',
|
27
|
+
npmDir + '/jquery-sparkline/jquery.sparkline.js',
|
28
|
+
npmDir + '/jqvmap/dist/jquery.vmap.js',
|
29
|
+
npmDir + '/jqvmap/dist/maps/jquery.vmap.world.js',
|
30
|
+
npmDir + '/metismenu/dist/metisMenu.js',
|
31
|
+
npmDir + '/nprogress/nprogress.js',
|
32
|
+
npmDir + '/quill/dist/quill.js',
|
33
|
+
npmDir + '/responsive-toolkit/dist/bootstrap-toolkit.js',
|
34
|
+
npmDir + '/sortablejs/Sortable.js',
|
35
|
+
npmDir + '/tether/dist/js/tether.js',
|
36
|
+
npmDir + '/tinycolor2/tinycolor.js',
|
37
|
+
npmDir + '/dropzone/dist/dropzone.js',
|
38
|
+
npmDir + '/jquery-touchswipe/jquery.touchSwipe.js',
|
39
|
+
npmDir + '/jquery.browser/dist/jquery.browser.js',
|
40
|
+
npmDir + '/popper.js/dist/umd/popper.js',
|
41
|
+
npmDir + '/bootstrap/dist/js/bootstrap.js',
|
42
|
+
npmDir + '/raphael/raphael.js',
|
43
|
+
npmDir + '/morris.js/morris.js',
|
44
|
+
],
|
45
|
+
styles: [
|
46
|
+
npmDir + '/animate.css/animate.css',
|
47
|
+
npmDir + '/font-awesome/css/font-awesome.css',
|
48
|
+
npmDir + '/jqvmap/dist/jqvmap.css',
|
49
|
+
npmDir + '/metismenu/dist/metisMenu.css',
|
50
|
+
npmDir + '/nprogress/nprogress.css',
|
51
|
+
npmDir + '/dropzone/dist/dropzone.css',
|
52
|
+
npmDir + '/quill/dist/quill.core.css',
|
53
|
+
npmDir + '/quill/dist/quill.snow.css',
|
54
|
+
npmDir + '/morris.js/morris.css',
|
55
|
+
npmDir + '/bootstrap/dist/css/bootstrap.css',
|
56
|
+
],
|
57
|
+
fonts: [
|
58
|
+
npmDir + '/font-awesome/fonts/*'
|
59
|
+
],
|
60
|
+
assets: [],
|
61
|
+
};
|
62
|
+
|
63
|
+
// Application Paths
|
64
|
+
config.paths.app = {
|
65
|
+
scripts: [
|
66
|
+
srcDir + "/config.js",
|
67
|
+
srcDir + "/**/!(_context|config|main|*-helper)*.js",
|
68
|
+
srcDir + "/main.js",
|
69
|
+
"!" + srcDir + "/_vendor/**"
|
70
|
+
],
|
71
|
+
styles: [
|
72
|
+
srcDir + "/_main.scss",
|
73
|
+
srcDir + "/**/!(_main|_variables|*-theme)*.scss",
|
74
|
+
],
|
75
|
+
themes: srcDir + "/**/*-theme.scss",
|
76
|
+
templates: srcDir + "/**/*.hbs",
|
77
|
+
pages: srcDir + "/**/*-page.hbs",
|
78
|
+
layouts: srcDir + "/**/*-layout.hbs",
|
79
|
+
helpers: [
|
80
|
+
srcDir + "/**/*-helper.js",
|
81
|
+
rootDir + '/node_modules/handlebars-layouts/index.js',
|
82
|
+
],
|
83
|
+
assets: srcDir + "/_assets/**/*"
|
84
|
+
};
|
85
|
+
|
86
|
+
|
87
|
+
module.exports = config;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module.exports.register = function (handlebars) {
|
2
|
+
handlebars.registerHelper('code', function(options) {
|
3
|
+
|
4
|
+
var className = options.hash.lang || "";
|
5
|
+
|
6
|
+
// Input html
|
7
|
+
var input = options.fn(this);
|
8
|
+
|
9
|
+
// Escale html to string
|
10
|
+
input = handlebars.Utils.escapeExpression(input);
|
11
|
+
|
12
|
+
// Break by lines
|
13
|
+
var lines = input.split("\n");
|
14
|
+
|
15
|
+
// Get number of tabs before first line
|
16
|
+
var numTabs = getNumFrontTabs(lines[0]);
|
17
|
+
|
18
|
+
// Remove tabs before
|
19
|
+
lines = lines.map(function(line) {
|
20
|
+
return line.substring(numTabs);
|
21
|
+
});
|
22
|
+
|
23
|
+
// Rejoin the lines
|
24
|
+
return "<pre><code class='" + className + "'>" + lines.join("\n") + "</code></pre>";
|
25
|
+
});
|
26
|
+
};
|
27
|
+
|
28
|
+
|
29
|
+
function getNumFrontTabs(line) {
|
30
|
+
var count = 0;
|
31
|
+
var index = 0;
|
32
|
+
while (line.charAt(index++) === "\t") {
|
33
|
+
count++;
|
34
|
+
}
|
35
|
+
return count;
|
36
|
+
}
|
@@ -0,0 +1,98 @@
|
|
1
|
+
/*
|
2
|
+
Custom handlebars helpers which allows to make
|
3
|
+
|
4
|
+
{{#is a '===' b}}}
|
5
|
+
|
6
|
+
{{/is}}
|
7
|
+
*/
|
8
|
+
|
9
|
+
module.exports.register = function (handlebars) {
|
10
|
+
|
11
|
+
var isArray = function(value) {
|
12
|
+
return Object.prototype.toString.call(value) === '[object Array]';
|
13
|
+
}
|
14
|
+
|
15
|
+
var ExpressionRegistry = function() {
|
16
|
+
this.expressions = [];
|
17
|
+
};
|
18
|
+
|
19
|
+
ExpressionRegistry.prototype.add = function (operator, method) {
|
20
|
+
this.expressions[operator] = method;
|
21
|
+
};
|
22
|
+
|
23
|
+
ExpressionRegistry.prototype.call = function (operator, left, right) {
|
24
|
+
if ( ! this.expressions.hasOwnProperty(operator)) {
|
25
|
+
throw new Error('Unknown operator "'+operator+'"');
|
26
|
+
}
|
27
|
+
|
28
|
+
return this.expressions[operator](left, right);
|
29
|
+
};
|
30
|
+
|
31
|
+
var eR = new ExpressionRegistry;
|
32
|
+
eR.add('not', function(left, right) {
|
33
|
+
return left != right;
|
34
|
+
});
|
35
|
+
eR.add('>', function(left, right) {
|
36
|
+
return left > right;
|
37
|
+
});
|
38
|
+
eR.add('<', function(left, right) {
|
39
|
+
return left < right;
|
40
|
+
});
|
41
|
+
eR.add('>=', function(left, right) {
|
42
|
+
return left >= right;
|
43
|
+
});
|
44
|
+
eR.add('<=', function(left, right) {
|
45
|
+
return left <= right;
|
46
|
+
});
|
47
|
+
|
48
|
+
eR.add('==', function(left, right) {
|
49
|
+
return left == right;
|
50
|
+
});
|
51
|
+
|
52
|
+
eR.add('===', function(left, right) {
|
53
|
+
return left === right;
|
54
|
+
});
|
55
|
+
eR.add('!==', function(left, right) {
|
56
|
+
return left !== right;
|
57
|
+
});
|
58
|
+
eR.add('in', function(left, right) {
|
59
|
+
if ( ! isArray(right)) {
|
60
|
+
right = right.split(',');
|
61
|
+
}
|
62
|
+
return right.indexOf(left) !== -1;
|
63
|
+
});
|
64
|
+
|
65
|
+
var isHelper = function() {
|
66
|
+
var args = arguments
|
67
|
+
, left = args[0]
|
68
|
+
, operator = args[1]
|
69
|
+
, right = args[2]
|
70
|
+
, options = args[3]
|
71
|
+
;
|
72
|
+
|
73
|
+
|
74
|
+
// console.log(args);
|
75
|
+
|
76
|
+
if (args.length == 2) {
|
77
|
+
options = args[1];
|
78
|
+
if (left) return options.fn(this);
|
79
|
+
return options.inverse(this);
|
80
|
+
}
|
81
|
+
|
82
|
+
if (args.length == 3) {
|
83
|
+
right = args[1];
|
84
|
+
options = args[2];
|
85
|
+
if (left == right) return options.fn(this);
|
86
|
+
return options.inverse(this);
|
87
|
+
}
|
88
|
+
|
89
|
+
if (eR.call(operator, left, right)) {
|
90
|
+
return options.fn(this);
|
91
|
+
}
|
92
|
+
return options.inverse(this);
|
93
|
+
};
|
94
|
+
|
95
|
+
handlebars.registerHelper('is', isHelper);
|
96
|
+
|
97
|
+
return eR;
|
98
|
+
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/***********************************************
|
2
|
+
* Animation Settings
|
3
|
+
***********************************************/
|
4
|
+
function animate(options) {
|
5
|
+
var animationName = "animated " + options.name;
|
6
|
+
var animationEnd = "webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend";
|
7
|
+
$(options.selector)
|
8
|
+
.addClass(animationName)
|
9
|
+
.one(animationEnd,
|
10
|
+
function(){
|
11
|
+
$(this).removeClass(animationName);
|
12
|
+
}
|
13
|
+
);
|
14
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
$(function() {
|
2
|
+
var $itemActions = $(".item-actions-dropdown");
|
3
|
+
|
4
|
+
$(document).on('click',function(e) {
|
5
|
+
if (!$(e.target).closest('.item-actions-dropdown').length) {
|
6
|
+
$itemActions.removeClass('active');
|
7
|
+
}
|
8
|
+
});
|
9
|
+
|
10
|
+
$('.item-actions-toggle-btn').on('click',function(e){
|
11
|
+
e.preventDefault();
|
12
|
+
|
13
|
+
var $thisActionList = $(this).closest('.item-actions-dropdown');
|
14
|
+
|
15
|
+
$itemActions.not($thisActionList).removeClass('active');
|
16
|
+
|
17
|
+
$thisActionList.toggleClass('active');
|
18
|
+
});
|
19
|
+
});
|
@@ -0,0 +1,44 @@
|
|
1
|
+
$(function() {
|
2
|
+
setSameHeights();
|
3
|
+
|
4
|
+
var resizeTimer;
|
5
|
+
|
6
|
+
$(window).resize(function() {
|
7
|
+
clearTimeout(resizeTimer);
|
8
|
+
resizeTimer = setTimeout(setSameHeights, 150);
|
9
|
+
});
|
10
|
+
});
|
11
|
+
|
12
|
+
|
13
|
+
function setSameHeights($container) {
|
14
|
+
|
15
|
+
$container = $container || $('.sameheight-container');
|
16
|
+
|
17
|
+
var viewport = ResponsiveBootstrapToolkit.current();
|
18
|
+
|
19
|
+
$container.each(function() {
|
20
|
+
|
21
|
+
var $items = $(this).find(".sameheight-item");
|
22
|
+
|
23
|
+
// Get max height of items in container
|
24
|
+
var maxHeight = 0;
|
25
|
+
|
26
|
+
$items.each(function() {
|
27
|
+
$(this).css({height: 'auto'});
|
28
|
+
maxHeight = Math.max(maxHeight, $(this).innerHeight());
|
29
|
+
});
|
30
|
+
|
31
|
+
|
32
|
+
// Set heights of items
|
33
|
+
$items.each(function() {
|
34
|
+
// Ignored viewports for item
|
35
|
+
var excludedStr = $(this).data('exclude') || '';
|
36
|
+
var excluded = excludedStr.split(',');
|
37
|
+
|
38
|
+
// Set height of element if it's not excluded on
|
39
|
+
if (excluded.indexOf(viewport) === -1) {
|
40
|
+
$(this).innerHeight(maxHeight);
|
41
|
+
}
|
42
|
+
});
|
43
|
+
});
|
44
|
+
}
|