inesita 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6cbf39b243230b8e9a44c7ee475a19fa8589c5f
|
4
|
+
data.tar.gz: f22ba1827671d5e05629c97fd400ba745bf162fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02b386388c4404405b4e52d7fa4eeca179cd1b8323ead435b3a1120e824ca228b86a6203cd56fa91280315eb0e191981b9fba0f556ed6b7babc91c92193c3697
|
7
|
+
data.tar.gz: bebd8120f2b2844af9bc082aa72709615ab6a68cc7ecea9b5aeecc51b8147d57fc23c8966cdb08216a97b729b87feaa25d932040d1a52380bc57ef358f4edd20
|
data/inesita.gemspec
CHANGED
@@ -3,11 +3,11 @@ html
|
|
3
3
|
head
|
4
4
|
title Inesita
|
5
5
|
- if $DEVELOPMENT_MODE
|
6
|
-
link href=asset_path('
|
6
|
+
link href=asset_path('stylesheet.css') rel='stylesheet' type='text/css'
|
7
7
|
- $SCRIPT_FILES.each do |file|
|
8
8
|
script src=asset_path(file)
|
9
9
|
- else
|
10
|
-
link href='
|
10
|
+
link href='stylesheet.css' rel='stylesheet' type='text/css'
|
11
11
|
script src='application.js'
|
12
12
|
javascript:
|
13
13
|
#{{$LOAD_ASSETS_CODE}}
|
File without changes
|
data/opal/inesita/router.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module Inesita
|
2
2
|
class Router
|
3
3
|
include Inesita::Component
|
4
|
+
class << self; attr_accessor :handle_browser_history; end
|
4
5
|
attr_reader :routes
|
5
6
|
|
6
7
|
def initialize(routes)
|
@@ -12,16 +13,18 @@ module Inesita
|
|
12
13
|
@routes[route] = component.new
|
13
14
|
@routes[route].parent(self)
|
14
15
|
end
|
16
|
+
|
17
|
+
handle_browser_history
|
15
18
|
end
|
16
19
|
|
17
20
|
def render
|
18
21
|
component routes[url]
|
19
22
|
end
|
20
23
|
|
21
|
-
def
|
22
|
-
`window.onpopstate = function(){#{
|
23
|
-
`window.addEventListener("hashchange", function(){#{
|
24
|
-
|
24
|
+
def handle_browser_history
|
25
|
+
`window.onpopstate = function(){#{update}}`
|
26
|
+
`window.addEventListener("hashchange", function(){#{update}})`
|
27
|
+
self.class.handle_browser_history = true
|
25
28
|
end
|
26
29
|
|
27
30
|
def self.handle_link(path, component)
|
@@ -5,8 +5,7 @@ module VirtualDOM
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def a(params, &block)
|
8
|
-
|
9
|
-
params = { onclick: -> { Inesita::Router.handle_link(params[:href], @parent) } }.merge(params) if params[:href]
|
8
|
+
params = { onclick: -> { Inesita::Router.handle_link(params[:href], @parent) } }.merge(params) if params[:href] && Inesita::Router.handle_browser_history
|
10
9
|
@nodes << VirtualNode.new(
|
11
10
|
'a',
|
12
11
|
process_params(params),
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inesita
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michał Kalbarczyk
|
@@ -128,7 +128,6 @@ files:
|
|
128
128
|
- lib/inesita/cli/server.rb
|
129
129
|
- lib/inesita/cli/template/.gitignore
|
130
130
|
- lib/inesita/cli/template/Gemfile
|
131
|
-
- lib/inesita/cli/template/app/application.css.sass
|
132
131
|
- lib/inesita/cli/template/app/application.js.rb
|
133
132
|
- lib/inesita/cli/template/app/components/goodbye.rb
|
134
133
|
- lib/inesita/cli/template/app/components/home.rb
|
@@ -136,6 +135,7 @@ files:
|
|
136
135
|
- lib/inesita/cli/template/app/components/navbar.rb
|
137
136
|
- lib/inesita/cli/template/app/components/welcome.rb
|
138
137
|
- lib/inesita/cli/template/app/index.html.slim
|
138
|
+
- lib/inesita/cli/template/app/stylesheet.css.sass
|
139
139
|
- lib/inesita/cli/template/config.ru
|
140
140
|
- lib/inesita/server.rb
|
141
141
|
- opal/inesita.rb
|