documentation-editor 0.7.4 → 0.8.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de6ab5535b10be65fab39e5972515d3c86606535
4
- data.tar.gz: e03d7aaab44c81e490bc1319d2dfc2c49e7ec667
3
+ metadata.gz: b7b80df188d0b484eb42a010dfc2239ece09f07d
4
+ data.tar.gz: e8a4f893a32b4833bf57a9eef026c4ae1eb3e281
5
5
  SHA512:
6
- metadata.gz: 010751dda66697d31eac0616851c702dedf4a0b006bff9f43a205a75994959c01c97adb4002f7b2386deace28d358bb44a6adfdae4aafe8e984c9d6308a106e1
7
- data.tar.gz: c335fcbc750559cf1aa8772892ab8f1b91a5989fde5af0c96f5c9e86b889e870ab552b879472a57374645ac38aa3e2a24ca4ab3a320b61aeea7189c26b19152b
6
+ metadata.gz: d0bfde7c50eb9451a7d4e1d640127ac37bb3f46188d7bdb511330c2c02e54b52c9166eea4d12550fb5a0523d809b1176d9a99c0b13523ff46e6a6c02f59b5165
7
+ data.tar.gz: fea268cca38c1f6a14f29a6d3729a0bac1f2f5f8b3c05c2c7dc599d1cf7c145d0e912cf8de6d63b134f6eadb89c4c7b4cd94472ae5f82aa46f882c2ca2170a81
@@ -68,6 +68,26 @@ angular.module('documentationEditorApp', ['ngFileUpload'])
68
68
  return data.join("\n");
69
69
  }
70
70
 
71
+ var sourceWatcher = null;
72
+ $scope.$watch('source', function(newValue, oldValue) {
73
+ if (newValue === oldValue) {
74
+ return;
75
+ }
76
+ if (sourceWatcher) {
77
+ clearTimeout(sourceWatcher);
78
+ }
79
+ sourceWatcher = setTimeout(function() {
80
+ $scope.$apply(function() {
81
+ $scope.undoRedo.push({
82
+ type: 'source',
83
+ data: {
84
+ source: newValue
85
+ }
86
+ });
87
+ });
88
+ }, 1000);
89
+ });
90
+
71
91
  $scope.init = function(id, slug, thumbnailUrl, path, published_revision_id, last_revision_id) {
72
92
  $scope.id = id;
73
93
  $scope.slug = slug;
@@ -104,6 +124,8 @@ angular.module('documentationEditorApp', ['ngFileUpload'])
104
124
  $scope.sections = $.grep($scope.sections, function(e) { return e.id !== o.data.obj.id });
105
125
  } else if (o.type === 'deleteSection') {
106
126
  $scope.sections = o.data.sections;
127
+ } else if (o.type === 'source') {
128
+ $scope.source = o.data.source;
107
129
  } else if (o.type === 'text') {
108
130
  o.model.$setViewValue(o.data);
109
131
  o.model.$render();
@@ -121,7 +143,7 @@ angular.module('documentationEditorApp', ['ngFileUpload'])
121
143
  var index = getIndex(o.data.id);
122
144
  var obj = {
123
145
  id: $scope.sections[index].id,
124
- type: 'buttonse',
146
+ type: 'buttons',
125
147
  content: {
126
148
  buttons: o.data.buttons
127
149
  }
@@ -131,7 +153,7 @@ angular.module('documentationEditorApp', ['ngFileUpload'])
131
153
  var index = getIndex(o.data.id);
132
154
  $scope.sections[index] = {
133
155
  id: $scope.sections[index].id,
134
- type: 'parameters',
156
+ type: 'table',
135
157
  content: o.data.content
136
158
  };
137
159
  } else if (o.type === 'moveDown') {
@@ -225,7 +247,7 @@ angular.module('documentationEditorApp', ['ngFileUpload'])
225
247
  content: {
226
248
  codes: [
227
249
  {
228
- language: 'fixme',
250
+ language: 'FIXME:language|label',
229
251
  code: '// FIXME'
230
252
  }
231
253
  ]
@@ -474,7 +496,7 @@ angular.module('documentationEditorApp', ['ngFileUpload'])
474
496
  $event.preventDefault();
475
497
  add(id, {
476
498
  id: getNextID(),
477
- type: 'parameters',
499
+ type: 'table',
478
500
  content: {
479
501
  cols: 2,
480
502
  rows: 2,
@@ -519,7 +541,7 @@ angular.module('documentationEditorApp', ['ngFileUpload'])
519
541
  $event.preventDefault();
520
542
  if (confirm('Are you sure you want to publish this page?')) {
521
543
  save(false).then(function(content) {
522
- $window.location.href = $scope.path + '/' + $scope.slug;
544
+ $window.open($scope.path + '/' + $scope.slug);
523
545
  });
524
546
  }
525
547
  }
@@ -50,11 +50,11 @@
50
50
 
51
51
  .markdown
52
52
  color: black
53
- border-left: 4px solid #DDD !important
53
+ border: 2px solid #DDD !important
54
54
  background: white
55
55
  padding: 5px 10px
56
56
  margin: 0
57
- font-family: inherit
57
+ font-family: Courier
58
58
  &:focus
59
59
  outline: none
60
60
  textarea.markdown
@@ -64,7 +64,7 @@
64
64
  %li
65
65
  Width:
66
66
  %input{"ng-model" => "sections[sectionIndex].content.width", type: 'number'}
67
- %table.table.parameters{"ng-if" => "section.type === 'parameters'"}
67
+ %table.table.parameters{"ng-if" => "section.type === 'table'"}
68
68
  %thead
69
69
  %tr
70
70
  %th{contenteditable: true, "ng-repeat" => "col in getIntegerIterator(section.content.cols)", 'ng-model' => "sections[sectionIndex].content.data['h-' + col]"}
@@ -107,7 +107,7 @@
107
107
  %i.fa.fa-remove>
108
108
  %a{contenteditable: true, 'ng-href' => '#snippet_{{section.id}}_{{$index}}'.html_safe, 'data-toggle' => 'tab', 'ng-model' => 'sections[sectionIndex].content.codes[$index].language' }>
109
109
  .tab-content
110
- %pre.tab-pane{contenteditable: true, "ng-repeat" => "code in section.content.codes track by $index", "ng-class" => "{ 'in active': ($index === 0) }", id: 'snippet_{{section.id}}_{{$index}}'.html_safe, 'ng-model' => 'sections[sectionIndex].content.codes[$index].code'}
110
+ %pre.tab-pane{contenteditable: true, "ng-repeat" => "code in section.content.codes track by $index", "ng-class" => "{ 'in active': ($index === 0) }",'ng-attr-id' => 'snippet_{{section.id}}_{{$index}}'.html_safe, 'ng-model' => 'sections[sectionIndex].content.codes[$index].code'}
111
111
  .html{"ng-if" => "section.type === 'html'"}
112
112
  %pre{contenteditable: true, 'ng-model' => 'sections[sectionIndex].content.body'}
113
113
 
@@ -22,29 +22,35 @@
22
22
  %td
23
23
  - if p.thumbnail
24
24
  = image_tag p.thumbnail_url
25
- %td.nowrap= best_in_place p, :position, url: update_path(p)
26
- %td.nowrap= best_in_place p, :title, url: update_path(p)
27
- %td.nowrap= best_in_place p, :slug, url: update_path(p)
25
+ %td.nowrap
26
+ = best_in_place p, :position, url: update_path(p)
27
+ %i.fa.fa-pencil
28
+ %td.nowrap
29
+ = best_in_place p, :title, url: update_path(p)
30
+ %i.fa.fa-pencil
31
+ %td.nowrap
32
+ = best_in_place p, :slug, url: update_path(p)
33
+ %i.fa.fa-pencil
28
34
  %td
29
35
  %ul.list-unstyled
30
36
  %li
31
37
  %strong Description:
32
38
  = best_in_place p, :description, url: update_path(p)
39
+ %i.fa.fa-pencil
33
40
  %li
34
41
  %strong Languages:
35
42
  = best_in_place p, :languages_raw, url: update_path(p)
43
+ %i.fa.fa-pencil
36
44
  %li
37
45
  %strong Section:
38
46
  = best_in_place p, :section, url: update_path(p)
47
+ %i.fa.fa-pencil
39
48
  %li
40
49
  %strong Last modification:
41
50
  = l p.created_at, format: :short
42
51
  %li
43
52
  %strong Published at:
44
53
  = p.published_revision ? l(p.published_revision.created_at, format: :long) : ''
45
- %li
46
- %strong Published by:
47
- = p.published_revision ? p.published_revision.author_id : ''
48
54
  %td.text-right.nowrap
49
55
  = link_to edit_page_path(p), class: 'btn btn-default btn-xs' do
50
56
  %i.fa.fa-edit
@@ -1,3 +1,3 @@
1
1
  module DocumentationEditor
2
- VERSION = "0.7.4"
2
+ VERSION = "0.8.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: documentation-editor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-03 00:00:00.000000000 Z
11
+ date: 2016-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails