chr 0.3.5 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.coveralls.yml +2 -0
- data/.gitignore +6 -1
- data/.ruby-version +1 -0
- data/.travis.yml +18 -0
- data/README.md +4 -0
- data/Rakefile +17 -2
- data/app/assets/javascripts/chr.coffee +13 -26
- data/app/assets/javascripts/chr/{core/chr.coffee → chr.coffee} +4 -1
- data/app/assets/javascripts/chr/{core/chr_router.coffee → chr_router.coffee} +0 -0
- data/app/assets/javascripts/chr/{core/item.coffee → item.coffee} +2 -1
- data/app/assets/javascripts/chr/{core/list.coffee → list.coffee} +1 -1
- data/app/assets/javascripts/chr/{core/list_config.coffee → list_config.coffee} +0 -0
- data/app/assets/javascripts/chr/{core/list_pagination.coffee → list_pagination.coffee} +15 -4
- data/app/assets/javascripts/chr/{core/list_reorder.coffee → list_reorder.coffee} +0 -0
- data/app/assets/javascripts/chr/{core/list_search.coffee → list_search.coffee} +1 -1
- data/app/assets/javascripts/chr/{core/module.coffee → module.coffee} +0 -0
- data/app/assets/javascripts/chr/{core/utils.coffee → utils.coffee} +0 -0
- data/app/assets/javascripts/chr/{core/view.coffee → view.coffee} +21 -9
- data/app/assets/javascripts/chr/{core/view_local-storage.coffee → view_local-storage.coffee} +0 -0
- data/app/assets/javascripts/{chr/store/array-store.coffee → stores/array.coffee} +0 -0
- data/app/assets/javascripts/{chr/store/object-store.coffee → stores/object.coffee} +0 -0
- data/app/assets/javascripts/{chr/store/rails-array-store.coffee → stores/rails-array.coffee} +0 -0
- data/app/assets/javascripts/{chr/store → stores}/rails-form-object-parser.coffee +4 -1
- data/app/assets/javascripts/{chr/store/rails-object-store.coffee → stores/rails-object.coffee} +0 -0
- data/app/assets/javascripts/{chr/store/rest-array-store.coffee → stores/rest-array.coffee} +5 -2
- data/app/assets/javascripts/{chr/store/rest-object-store.coffee → stores/rest-object.coffee} +0 -0
- data/app/assets/stylesheets/{_chr.scss → chr.scss} +2 -7
- data/app/assets/stylesheets/chr/{_icons.scss → icons.scss} +0 -0
- data/app/assets/stylesheets/chr/{_main.scss → main.scss} +10 -3
- data/app/assets/stylesheets/chr/{_mixins.scss → mixins.scss} +0 -77
- data/app/assets/stylesheets/chr/{_settings.scss → settings.scss} +1 -1
- data/bin/chr +13 -0
- data/bin/rake +16 -0
- data/bin/setup +13 -0
- data/chr.gemspec +41 -21
- data/docs/tests.md +64 -0
- data/lib/chr.rb +10 -2
- data/lib/chr/app_builder.rb +385 -0
- data/lib/chr/generators/app_generator.rb +213 -0
- data/lib/chr/version.rb +3 -1
- data/lib/generators/chr/controller_generator.rb +18 -0
- data/templates/Gemfile.erb +38 -0
- data/templates/Procfile +1 -0
- data/templates/README.md.erb +45 -0
- data/templates/_analytics.html.erb +9 -0
- data/templates/_flashes.html.erb +7 -0
- data/templates/_javascript.html.erb +12 -0
- data/templates/application.coffee +2 -0
- data/templates/application.scss +1 -0
- data/templates/application.yml +6 -0
- data/templates/application_gitignore +14 -0
- data/templates/application_layout.html.erb.erb +29 -0
- data/templates/asset_sync.rb +28 -0
- data/templates/bin_setup.erb +36 -0
- data/templates/body_class_helper.rb +19 -0
- data/templates/bundler_audit.rake +12 -0
- data/templates/carrierwave.rb +23 -0
- data/templates/character_admin.coffee.erb +28 -0
- data/templates/character_admin.scss +3 -0
- data/templates/character_admin_index.html.erb +2 -0
- data/templates/character_admin_layout.html.erb +21 -0
- data/templates/character_base_controller.rb +16 -0
- data/templates/development_seeds.rb +12 -0
- data/templates/devise_overrides_passwords_controller.rb +10 -0
- data/templates/devise_overrides_passwords_edit.html.erb +30 -0
- data/templates/devise_overrides_passwords_new.html.erb +21 -0
- data/templates/devise_overrides_sessions_controller.rb +12 -0
- data/templates/devise_overrides_sessions_new.html.erb +31 -0
- data/templates/errors.rb +34 -0
- data/templates/json_encoding.rb +1 -0
- data/templates/newrelic.yml.erb +34 -0
- data/templates/puma.rb +18 -0
- data/templates/routes.rb +90 -0
- data/templates/sample.env +6 -0
- data/templates/secrets.yml +14 -0
- data/templates/smtp.rb +9 -0
- data/templates/staging.rb +5 -0
- data/test/factories/article_factory.rb +19 -0
- data/test/files/test.jpg +0 -0
- data/test/integration/article_fullsize_test.rb +33 -0
- data/test/integration/article_test.rb +33 -0
- data/test/integration/magazine_article_test.rb +33 -0
- data/test/integration/restricted_article_test.rb +33 -0
- data/test/integration/sport_article_test.rb +34 -0
- data/test/rails_app/Rakefile +6 -0
- data/test/rails_app/app/assets/javascripts/admin.coffee +137 -0
- data/test/rails_app/app/assets/javascripts/application.js +1 -0
- data/test/rails_app/app/assets/stylesheets/admin.scss +1 -0
- data/test/rails_app/app/assets/stylesheets/application.css +1 -0
- data/test/rails_app/app/controllers/admin/articles_controller.rb +7 -0
- data/test/rails_app/app/controllers/admin/base_controller.rb +8 -0
- data/test/rails_app/app/controllers/application_controller.rb +5 -0
- data/test/rails_app/app/helpers/application_helper.rb +2 -0
- data/test/rails_app/app/models/article.rb +46 -0
- data/test/rails_app/app/uploaders/article_image_uploader.rb +16 -0
- data/test/rails_app/app/views/admin/index.html.erb +4 -0
- data/test/rails_app/app/views/layouts/admin.html.erb +17 -0
- data/test/rails_app/app/views/layouts/application.html.erb +14 -0
- data/test/rails_app/bin/bundle +3 -0
- data/test/rails_app/bin/rails +8 -0
- data/test/rails_app/bin/rake +8 -0
- data/test/rails_app/bin/setup +29 -0
- data/test/rails_app/bin/spring +15 -0
- data/test/rails_app/config.ru +4 -0
- data/test/rails_app/config/application.rb +36 -0
- data/test/rails_app/config/boot.rb +3 -0
- data/test/rails_app/config/environment.rb +5 -0
- data/test/rails_app/config/environments/development.rb +38 -0
- data/test/rails_app/config/environments/production.rb +76 -0
- data/test/rails_app/config/environments/test.rb +46 -0
- data/test/rails_app/config/initializers/assets.rb +12 -0
- data/test/rails_app/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails_app/config/initializers/carrierwave.rb +5 -0
- data/test/rails_app/config/initializers/cookies_serializer.rb +3 -0
- data/test/rails_app/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/rails_app/config/initializers/inflections.rb +16 -0
- data/test/rails_app/config/initializers/mime_types.rb +4 -0
- data/test/rails_app/config/initializers/session_store.rb +3 -0
- data/test/rails_app/config/initializers/wrap_parameters.rb +9 -0
- data/test/rails_app/config/locales/en.yml +23 -0
- data/test/rails_app/config/mongoid.yml +9 -0
- data/test/rails_app/config/routes.rb +8 -0
- data/test/rails_app/config/secrets.yml +22 -0
- data/test/rails_app/db/seeds.rb +7 -0
- data/test/rails_app/public/404.html +67 -0
- data/test/rails_app/public/422.html +67 -0
- data/test/rails_app/public/500.html +66 -0
- data/{app/assets/javascripts/form/input-date.coffee → test/rails_app/public/favicon.ico} +0 -0
- data/test/rails_app/public/robots.txt +5 -0
- data/test/support/character_front_end.rb +196 -0
- data/test/support/chr/item.rb +32 -0
- data/test/support/chr/list.rb +31 -0
- data/test/support/chr/list_pagination.rb +163 -0
- data/test/support/chr/list_reorder.rb +46 -0
- data/test/support/chr/list_search.rb +41 -0
- data/test/support/chr/view.rb +112 -0
- data/test/support/stores/array.rb +20 -0
- data/test/support/stores/rest-array.rb +34 -0
- data/test/test_helper.rb +68 -0
- metadata +373 -80
- data/Gruntfile.coffee +0 -101
- data/app/assets/javascripts/form/expandable-group.coffee +0 -30
- data/app/assets/javascripts/form/form.coffee +0 -221
- data/app/assets/javascripts/form/input-checkbox.coffee +0 -83
- data/app/assets/javascripts/form/input-color.coffee +0 -55
- data/app/assets/javascripts/form/input-file.coffee +0 -144
- data/app/assets/javascripts/form/input-form.coffee +0 -171
- data/app/assets/javascripts/form/input-form_reorder.coffee +0 -67
- data/app/assets/javascripts/form/input-hidden.coffee +0 -57
- data/app/assets/javascripts/form/input-list.coffee +0 -154
- data/app/assets/javascripts/form/input-list_reorder.coffee +0 -39
- data/app/assets/javascripts/form/input-list_typeahead.coffee +0 -55
- data/app/assets/javascripts/form/input-password.coffee +0 -32
- data/app/assets/javascripts/form/input-select.coffee +0 -84
- data/app/assets/javascripts/form/input-select2.coffee +0 -33
- data/app/assets/javascripts/form/input-string.coffee +0 -160
- data/app/assets/javascripts/form/input-text.coffee +0 -43
- data/app/assets/javascripts/input-html.coffee +0 -81
- data/app/assets/javascripts/input-markdown.coffee +0 -93
- data/app/assets/javascripts/input-redactor.coffee +0 -1
- data/app/assets/javascripts/redactor/input-redactor.coffee +0 -53
- data/app/assets/javascripts/redactor/input-redactor_character.coffee +0 -83
- data/app/assets/javascripts/redactor/input-redactor_images.coffee +0 -166
- data/app/assets/javascripts/vendor/ace.js +0 -18280
- data/app/assets/javascripts/vendor/jquery.scrollparent.js +0 -14
- data/app/assets/javascripts/vendor/jquery.textarea_autosize.js +0 -55
- data/app/assets/javascripts/vendor/jquery.typeahead.js +0 -1782
- data/app/assets/javascripts/vendor/marked.js +0 -1272
- data/app/assets/javascripts/vendor/mode-html.js +0 -2436
- data/app/assets/javascripts/vendor/mode-markdown.js +0 -2820
- data/app/assets/javascripts/vendor/redactor.fixedtoolbar.js +0 -107
- data/app/assets/javascripts/vendor/select2.js +0 -5274
- data/app/assets/stylesheets/_input-redactor.scss +0 -35
- data/app/assets/stylesheets/form/_expandable-group.scss +0 -16
- data/app/assets/stylesheets/form/_input-select2.scss +0 -94
- data/app/assets/stylesheets/form/_main.scss +0 -180
- data/app/assets/stylesheets/vendor/select2.css +0 -258
- data/bower.json +0 -38
- data/dist/chr.js +0 -5949
- data/dist/input-ace.js +0 -24946
- data/dist/input-redactor.js +0 -1
- data/lib/mongoid/character.rb +0 -30
- data/package.json +0 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 169823bd19263619ab77cad99e39dc2ce2be85cd
|
|
4
|
+
data.tar.gz: 59297731059ca511038bfd95152519dd80d42750
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: be0677f767643cac2529520c2b12b90e78e17dda59ceb4148b51fb900598603695de1ed090df233d31aafce1a5e6d32f30eaf4c0964ea160d3a08a26e851af42
|
|
7
|
+
data.tar.gz: b240a37078f759f47aae0f26dc802aee807f4d1c988571c43622000519f8deea817138b5b5509261dd9854ddff500b9a5e7e43d1e1ded9d2983b0fe0d39e4921
|
data/.coveralls.yml
ADDED
data/.gitignore
CHANGED
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.2.2
|
data/.travis.yml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Travis CI will consult .ruby-version in the root of the repository and use the
|
|
2
|
+
# indicated Ruby runtime
|
|
3
|
+
language: ruby
|
|
4
|
+
rvm:
|
|
5
|
+
- 2.2.2
|
|
6
|
+
|
|
7
|
+
# Make Travis CI to start the MongoDB service on boot
|
|
8
|
+
services:
|
|
9
|
+
- mongodb
|
|
10
|
+
|
|
11
|
+
notifications:
|
|
12
|
+
email: false
|
|
13
|
+
|
|
14
|
+
before_install:
|
|
15
|
+
- sh -c 'if [ -n "$QMAKE" ]; then sudo apt-add-repository -y ppa:ubuntu-sdk-team/ppa && sudo apt-get update && sudo apt-get install libqt5webkit5-dev qtdeclarative5-dev; fi'
|
|
16
|
+
|
|
17
|
+
script:
|
|
18
|
+
- xvfb-run rake test
|
data/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Character
|
|
2
2
|
|
|
3
|
+
[](https://travis-ci.org/slate-studio/chr)
|
|
4
|
+
|
|
5
|
+
|
|
3
6
|
*Powerful responsive javascript CMS for apps.*
|
|
4
7
|
|
|
5
8
|
|
|
@@ -41,6 +44,7 @@ Styles setup:
|
|
|
41
44
|
|
|
42
45
|
* [Rails Setup](docs/rails.md)
|
|
43
46
|
* [Bootstrap Data](docs/bootstrap.md)
|
|
47
|
+
* [Tests](docs/tests.md)
|
|
44
48
|
|
|
45
49
|
More documentation and samples comming soon...
|
|
46
50
|
|
data/Rakefile
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
|
-
require
|
|
3
|
-
require
|
|
2
|
+
require 'rubygems'
|
|
3
|
+
require 'bundler/setup'
|
|
4
|
+
require 'bundler/gem_tasks'
|
|
5
|
+
require 'rake/testtask'
|
|
6
|
+
require 'rdoc/task'
|
|
7
|
+
|
|
8
|
+
desc 'Default: run tests for all ORMs.'
|
|
9
|
+
task default: :test
|
|
10
|
+
|
|
11
|
+
desc 'Run Character unit tests.'
|
|
12
|
+
Rake::TestTask.new(:test) do |t|
|
|
13
|
+
t.libs << 'lib'
|
|
14
|
+
t.libs << 'test'
|
|
15
|
+
t.test_files = FileList['test/**/*_test.rb']
|
|
16
|
+
t.verbose = true
|
|
17
|
+
t.warning = false
|
|
18
|
+
end
|
|
@@ -1,28 +1,15 @@
|
|
|
1
|
-
#= require ./chr/
|
|
2
|
-
#= require ./chr/
|
|
1
|
+
#= require ./chr/utils
|
|
2
|
+
#= require ./chr/chr
|
|
3
|
+
#= require ./chr/module
|
|
4
|
+
#= require ./chr/list
|
|
5
|
+
#= require ./chr/item
|
|
6
|
+
#= require ./chr/view
|
|
3
7
|
|
|
4
|
-
#= require ./
|
|
5
|
-
#= require ./
|
|
6
|
-
#= require ./
|
|
7
|
-
#= require ./
|
|
8
|
+
#= require ./stores/object
|
|
9
|
+
#= require ./stores/array
|
|
10
|
+
#= require ./stores/rest-object
|
|
11
|
+
#= require ./stores/rest-array
|
|
12
|
+
#= require ./stores/rails-object
|
|
13
|
+
#= require ./stores/rails-array
|
|
8
14
|
|
|
9
|
-
#= require
|
|
10
|
-
#= require ./chr/store/array-store
|
|
11
|
-
#= require ./chr/store/rest-object-store
|
|
12
|
-
#= require ./chr/store/rest-array-store
|
|
13
|
-
#= require ./chr/store/rails-object-store
|
|
14
|
-
#= require ./chr/store/rails-array-store
|
|
15
|
-
|
|
16
|
-
#= require ./form/form
|
|
17
|
-
#= require ./form/input-form
|
|
18
|
-
#= require ./form/input-hidden
|
|
19
|
-
#= require ./form/input-string
|
|
20
|
-
#= require ./form/input-text
|
|
21
|
-
#= require ./form/input-checkbox
|
|
22
|
-
#= require ./form/input-password
|
|
23
|
-
#= require ./form/input-color
|
|
24
|
-
#= require ./form/input-file
|
|
25
|
-
#= require ./form/input-list
|
|
26
|
-
#= require ./form/input-select
|
|
27
|
-
#= require ./form/input-select2
|
|
28
|
-
#= require ./form/expandable-group
|
|
15
|
+
#= require formagic
|
|
@@ -86,7 +86,7 @@ class @Chr
|
|
|
86
86
|
window.location.hash = path
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
start: (@config) ->
|
|
89
|
+
start: (title, @config) ->
|
|
90
90
|
@$el =$ (@config.selector ? 'body')
|
|
91
91
|
@$navBar =$ "<nav class='sidebar'>"
|
|
92
92
|
@$mainMenu =$ "<div class='menu'>"
|
|
@@ -109,6 +109,9 @@ class @Chr
|
|
|
109
109
|
showError: (message) ->
|
|
110
110
|
alert 'Error: ' + message
|
|
111
111
|
|
|
112
|
+
showNotification: (message) ->
|
|
113
|
+
alert message
|
|
114
|
+
|
|
112
115
|
|
|
113
116
|
include(Chr, chrRouter)
|
|
114
117
|
|
|
File without changes
|
|
File without changes
|
|
@@ -52,6 +52,18 @@ chr._bind_mobile_scroll = ->
|
|
|
52
52
|
@_mobile_scroll_binded = true
|
|
53
53
|
|
|
54
54
|
|
|
55
|
+
chr._list_height = ($items) ->
|
|
56
|
+
height = 0
|
|
57
|
+
offset = null
|
|
58
|
+
|
|
59
|
+
$items.children().each ->
|
|
60
|
+
if offset != $(this).position().top
|
|
61
|
+
offset = $(this).position().top
|
|
62
|
+
height += $(this).height()
|
|
63
|
+
|
|
64
|
+
return height
|
|
65
|
+
|
|
66
|
+
|
|
55
67
|
chr._load_next_page = ($viewport, list, scroll_top) ->
|
|
56
68
|
$items = list.$items
|
|
57
69
|
store = list.config.arrayStore
|
|
@@ -61,11 +73,10 @@ chr._load_next_page = ($viewport, list, scroll_top) ->
|
|
|
61
73
|
if store.lastPageLoaded then return
|
|
62
74
|
|
|
63
75
|
# check if scroll is near bottom of the $viewport
|
|
64
|
-
viewport_height
|
|
65
|
-
|
|
66
|
-
$items.children().each -> list_items_height += $(this).height()
|
|
76
|
+
viewport_height = $viewport.height()
|
|
77
|
+
list_height = chr._list_height($items)
|
|
67
78
|
|
|
68
|
-
if
|
|
79
|
+
if list_height - scroll_top - 100 > viewport_height
|
|
69
80
|
return
|
|
70
81
|
|
|
71
82
|
list.showSpinner()
|
|
File without changes
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
_bind_search: ->
|
|
10
10
|
@$search =$ "<div class='search'></div>"
|
|
11
11
|
@$searchIcon =$ "<a href='#' class='icon'></a>"
|
|
12
|
-
@$searchInput =$ "<input type='text' placeholder='Search
|
|
12
|
+
@$searchInput =$ "<input type='text' placeholder='Search' />"
|
|
13
13
|
@$searchCancel =$ "<a href='#' class='cancel'>Cancel</a>"
|
|
14
14
|
|
|
15
15
|
@$header.append(@$search)
|
|
File without changes
|
|
File without changes
|
|
@@ -11,12 +11,15 @@
|
|
|
11
11
|
# -----------------------------------------------------------------------------
|
|
12
12
|
#
|
|
13
13
|
# Config options:
|
|
14
|
-
# formClass
|
|
15
|
-
# formSchema
|
|
16
|
-
# disableDelete
|
|
17
|
-
# disableSave
|
|
18
|
-
# fullsizeView
|
|
19
|
-
# onViewShow
|
|
14
|
+
# formClass - custom form class to be used
|
|
15
|
+
# formSchema - form schema for object, autogenerated if missing
|
|
16
|
+
# disableDelete - do not add delete button below the form
|
|
17
|
+
# disableSave - do not add save button in header
|
|
18
|
+
# fullsizeView — use fullsize layout in desktop mode
|
|
19
|
+
# onViewShow - on show callback
|
|
20
|
+
# onSaveSuccess - on document succesfully saved callback
|
|
21
|
+
# defaultNewObject - used to generate new form
|
|
22
|
+
# disableFormCache - do not cache form changes
|
|
20
23
|
#
|
|
21
24
|
# Public methods:
|
|
22
25
|
# show(objectId)
|
|
@@ -39,6 +42,10 @@ class @View
|
|
|
39
42
|
if @config.fullsizeView
|
|
40
43
|
@$el.addClass 'fullsize'
|
|
41
44
|
|
|
45
|
+
# disable local storage cache, as that has to be
|
|
46
|
+
# refactored to be more secure and obvious to user
|
|
47
|
+
@config.disableFormCache ||= true
|
|
48
|
+
|
|
42
49
|
# header
|
|
43
50
|
@$header =$ "<header class='header'></header>"
|
|
44
51
|
@$spinner =$ "<div class='spinner'></div>"
|
|
@@ -90,6 +97,8 @@ class @View
|
|
|
90
97
|
@form.updateValues(@object)
|
|
91
98
|
@_clear_local_storage_cache()
|
|
92
99
|
|
|
100
|
+
@config.onSaveSuccess?(@)
|
|
101
|
+
|
|
93
102
|
|
|
94
103
|
_save_error: (message, validationErrors) ->
|
|
95
104
|
@$el.removeClass('view-saving')
|
|
@@ -153,10 +162,12 @@ class @View
|
|
|
153
162
|
@$header.append @$saveBtn
|
|
154
163
|
|
|
155
164
|
# sync with local storage cache
|
|
156
|
-
@
|
|
165
|
+
if ! @config.disableFormCache
|
|
166
|
+
@_update_object_from_local_storage()
|
|
157
167
|
|
|
158
168
|
# form
|
|
159
|
-
|
|
169
|
+
object = @object || @config.defaultNewObject || null
|
|
170
|
+
@form = new (@config.formClass ? Form)(object, @config)
|
|
160
171
|
@$content.append @form.$el
|
|
161
172
|
@form.initializePlugins()
|
|
162
173
|
|
|
@@ -164,7 +175,8 @@ class @View
|
|
|
164
175
|
@config.onViewShow?(@)
|
|
165
176
|
|
|
166
177
|
# enable local storage caching
|
|
167
|
-
@
|
|
178
|
+
if ! @config.disableFormCache
|
|
179
|
+
@_bind_form_change()
|
|
168
180
|
|
|
169
181
|
|
|
170
182
|
_show_error: ->
|
data/app/assets/javascripts/chr/{core/view_local-storage.coffee → view_local-storage.coffee}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/app/assets/javascripts/{chr/store/rails-array-store.coffee → stores/rails-array.coffee}
RENAMED
|
File without changes
|
data/app/assets/javascripts/{chr/store/rails-object-store.coffee → stores/rails-object.coffee}
RENAMED
|
File without changes
|
|
@@ -220,12 +220,15 @@ class @RestArrayStore extends ArrayStore
|
|
|
220
220
|
|
|
221
221
|
if @_is_pagination_edge_case() && d.positionHasChanged
|
|
222
222
|
if d.position >= (@nextPage - 1) * @objectsPerPage - 1
|
|
223
|
+
|
|
224
|
+
console.log ':: reloading current page ::'
|
|
225
|
+
# @TODO: test this scenario
|
|
226
|
+
|
|
223
227
|
# if object added to the end of the list reload page to
|
|
224
228
|
# sync last item on the page
|
|
225
229
|
@_reload_current_page(callbacks)
|
|
226
230
|
|
|
227
|
-
|
|
228
|
-
callbacks.onSuccess(data)
|
|
231
|
+
callbacks.onSuccess(data)
|
|
229
232
|
|
|
230
233
|
), callbacks.onError
|
|
231
234
|
|
data/app/assets/javascripts/{chr/store/rest-object-store.coffee → stores/rest-object.coffee}
RENAMED
|
File without changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@import "normalize-rails";
|
|
1
2
|
@import "bourbon";
|
|
2
3
|
|
|
3
4
|
@import "chr/settings";
|
|
@@ -5,10 +6,4 @@
|
|
|
5
6
|
@import "chr/icons";
|
|
6
7
|
@import "chr/main";
|
|
7
8
|
|
|
8
|
-
@import "
|
|
9
|
-
@import "form/expandable-group";
|
|
10
|
-
@import "form/main";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
@import "formagic";
|
|
File without changes
|
|
@@ -5,7 +5,7 @@ html a { text-decoration: none; }
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
/* Menu -------------------------------------------------------------------- */
|
|
8
|
-
.menu { font-size: .8em;
|
|
8
|
+
.menu { font-size: .8em; }
|
|
9
9
|
.menu:before { @include menu-title($contrastColor); content: 'CHARACTER'; }
|
|
10
10
|
|
|
11
11
|
|
|
@@ -16,10 +16,17 @@ html a { text-decoration: none; }
|
|
|
16
16
|
.new { @include position(absolute, 0 0 null null); @extend .icon-plus; }
|
|
17
17
|
.new + .search { @include position(absolute, 0 40px inherit inherit); }
|
|
18
18
|
.spinner { @include spinner; @include hide; position: absolute; margin: 6px 0 0 -36px; }
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
// this is disabled until local storage is back
|
|
21
|
+
//.save { @include position(absolute, 0 1em null null); @include header-button($stableColor); font-weight: 500; }
|
|
22
|
+
.save { @include position(absolute, 0 1em null null); @include header-button($positiveColor); font-weight: 500; }
|
|
20
23
|
}
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
// these are ignored until local storage is back
|
|
26
|
+
.view.has-unsaved-changes .save { color: $positiveColor; }
|
|
27
|
+
.view.has-unsaved-changes .title:after { content: ' (not saved)'; font-weight: 300; font-size: .8em; }
|
|
28
|
+
// ------------------------------------------------------
|
|
29
|
+
|
|
23
30
|
.show-spinner .spinner { display: inline-block; }
|
|
24
31
|
|
|
25
32
|
|
|
@@ -54,83 +54,6 @@
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
/* Switch ------------------------------------------------- */
|
|
58
|
-
@mixin switch {
|
|
59
|
-
$switch-width: 52px;
|
|
60
|
-
$switch-padding: 2px;
|
|
61
|
-
$switch-height: 32px;
|
|
62
|
-
$switch-radius: $switch-height;
|
|
63
|
-
$knob-size: $switch-height - ($switch-padding * 2);
|
|
64
|
-
$knob-radius: $switch-height - ($switch-padding * 2);
|
|
65
|
-
$knob-width: $knob-size;
|
|
66
|
-
$switch-background: $white;
|
|
67
|
-
$switch-border-background: $contrastColor;
|
|
68
|
-
$switch-shadow: 0 0px 2px transparentize(black, 0.6);
|
|
69
|
-
|
|
70
|
-
border-radius: $switch-radius;
|
|
71
|
-
cursor: pointer;
|
|
72
|
-
display: inline-block;
|
|
73
|
-
height: $switch-height;
|
|
74
|
-
position: relative;
|
|
75
|
-
width: $switch-width;
|
|
76
|
-
|
|
77
|
-
input[type="checkbox"] {
|
|
78
|
-
display: none;
|
|
79
|
-
|
|
80
|
-
+ .checkbox {
|
|
81
|
-
@include transition(all 0.3s ease);
|
|
82
|
-
background: $switch-border-background;
|
|
83
|
-
border-radius: $switch-radius;
|
|
84
|
-
border: none;
|
|
85
|
-
cursor: pointer;
|
|
86
|
-
height: $switch-height;
|
|
87
|
-
margin: 0;
|
|
88
|
-
padding: 0;
|
|
89
|
-
position: relative;
|
|
90
|
-
width: $switch-width;
|
|
91
|
-
z-index: 0;
|
|
92
|
-
|
|
93
|
-
&:before {
|
|
94
|
-
@include position(absolute, 2px 0 0 2px);
|
|
95
|
-
@include transform(scale(1));
|
|
96
|
-
@include transition(all 0.3s ease);
|
|
97
|
-
background: $switch-background;
|
|
98
|
-
border-radius: $switch-radius;
|
|
99
|
-
content: "";
|
|
100
|
-
height: $knob-radius;
|
|
101
|
-
width: $switch-width - ($switch-padding * 2);
|
|
102
|
-
z-index: 1;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
&:after {
|
|
106
|
-
@include position(absolute, 2px 0 0 2px);
|
|
107
|
-
@include transition(all 0.3s ease);
|
|
108
|
-
@include size($knob-size);
|
|
109
|
-
background: $switch-background;
|
|
110
|
-
border-radius: $knob-radius;
|
|
111
|
-
box-shadow: $switch-shadow;
|
|
112
|
-
content: "";
|
|
113
|
-
z-index: 2;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
&:checked {
|
|
118
|
-
+ .checkbox {
|
|
119
|
-
background: $positiveColor;
|
|
120
|
-
|
|
121
|
-
&:before {
|
|
122
|
-
@include transform(scale(0));
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
&:after {
|
|
126
|
-
left: $switch-width - $knob-width - ($switch-padding);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
57
|
/* Spinner ------------------------------------------------ */
|
|
135
58
|
@mixin spinner {
|
|
136
59
|
border: .25em solid rgba($contrastColor, 0.2);
|