miniyard 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module MiniYard
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -4,29 +4,16 @@
4
4
  %title [ MiniYard ]
5
5
  %link{rel: 'stylesheet', type: 'text/css', href: './bootstrap.1.4.0.min.css'}
6
6
  :javascript
7
- var folderSelected = false;
8
7
  function selectFolder(anchor, folder) {
9
- folderSelected = true;
10
- var ul = anchor.parentElement.parentElement;
11
- for (var i = 0; i < ul.children.length; i++) {
12
- var li = ul.children[i];
13
- li.classList.remove('active');
14
- }
15
- anchor.parentNode.classList.add('active');
16
- document.getElementById('frame').src = './'+folder+'/index.html';
17
- selectFrameNav(document.getElementById('index-frame-link'), 'index');
8
+ document.getElementById('index-frame-link').href = './'+folder+'/index.html';
9
+ document.getElementById('frames-frame-link').href = './'+folder+'/frames.html';
10
+ setActive(anchor);
11
+ setActive(document.getElementById('index-frame-link'));
18
12
  }
19
- function selectFrameNav(anchor, fileToShow) {
20
- if (!folderSelected) return;
21
- var src = document.getElementById('frame').src;
22
- var newSrc = src.replace(/(.+\/).+\.html/, '$1'+fileToShow+'.html');
23
- document.getElementById('frame').src = newSrc;
24
-
25
- var pills = document.getElementById('pill-nav');
26
- for (var i = 0; i < pills.children.length; i++) {
27
- var li = pills.children[i];
28
- li.classList.remove('active');
29
- }
13
+ function setActive(anchor) {
14
+ var ul = anchor.parentElement.parentElement;
15
+ for (var i = 0; i < ul.children.length; i++)
16
+ ul.children[i].classList.remove('active');
30
17
  anchor.parentNode.classList.add('active');
31
18
  }
32
19
  :css
@@ -48,19 +35,19 @@
48
35
  %body
49
36
  .container-fluid
50
37
  .sidebar
51
-
52
38
  %ul
53
39
  - folders.each do |folder|
54
40
  %li
55
- %a{id: "#{folder}-link", href: '#', onclick: "javascript: selectFolder(this, '#{folder}')"}= folder
41
+ %a{id: "#{folder}-link", href: "./#{folder}/index.html", target: 'frame', onclick: "javascript: selectFolder(this, '#{folder}')"}
42
+ = folder
56
43
 
57
44
  .content
58
45
  %ul#pill-nav.pills{"data-pills" => "pills"}
59
46
  %li
60
- %a{id: "index-frame-link", href: '#', onclick: "javascript: selectFrameNav(this, 'index', false)"} No Frames
47
+ %a{id: "index-frame-link", href: '#', target: "frame", onclick: "javascript: setActive(this)"} No Frames
61
48
  %li
62
- %a{id: "frames-frame-link", href: '#', onclick: "javascript: selectFrameNav(this, 'frames', false)"} Frames
63
- %iframe#frame{frameborder: '0'}
49
+ %a{id: "frames-frame-link", href: '#', target: "frame", onclick: "javascript: setActive(this)"} Frames
50
+ %iframe#frame{name: 'frame', frameborder: '0'}
64
51
  %h3.title
65
52
  %span.bracket [
66
53
  MiniYard
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miniyard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-12-23 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: haml
16
- requirement: &2153363260 !ruby/object:Gem::Requirement
16
+ requirement: &2152046380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2153363260
24
+ version_requirements: *2152046380
25
25
  description: A static html framebuilder to host multiple documentation folders
26
26
  email:
27
27
  - bj.neilsen@gmail.com