tawork 0.0.38 → 0.0.39

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjlkOGRmODk5MDg2NjVhMjA3MDhmYzZiYWI3NTBhM2QyZjlhOGI4NQ==
4
+ ZTM5ZWRjOTBmODlhMzc0OGVhM2ExNGY0Y2NlYWRjMTRlZGUzMWI4OQ==
5
5
  data.tar.gz: !binary |-
6
- OTdiYTkwNjc1ZTRhMzlmODllNTE1ZWRmNTU3ODU3MTRhNWM5ZGIzZg==
6
+ NTZjZjJiZDYzNDhhZGUyNDhhMTY5MjZhZDM0OWM2NzY4ODMwMDZmMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZGU3NzlkNzA2ODkwYWI1MmMyNjlkM2YxOTUwZjBhNTE1NmZiMmU5MmQ5NGNi
10
- NjNhZTY3ZmQ2OWVmYmQ5ZmVlYWJlYjk0ZDVlMDIxMzY3ZGYzY2QzMTljNDM0
11
- YzIxYzNjZDI1MTdlNjkyNTQzMGI5MzI1ZmE2ZDlmM2Y0MDE2Mzk=
9
+ OGYwMjc0YzQzZmU3ZWZmMmMxNDJkNDc0ZGY0ZjlmZjE3OWEwNjNmMTYwMWEy
10
+ YjEzYTY0OTZkZWUyZTU0NGM4ZGVjZjc4NGMzNjQxOGYwYWQ5MTUzMjhkYTlj
11
+ NGNiNTQ2ZDhlYTlmYTFmZTVmZWZkNjJmMmUzYmUxMTdlZTJhMWE=
12
12
  data.tar.gz: !binary |-
13
- NzgwYmU0NTU5ZTQ4YmFmMjJlZWUxZWNmMWMyMmY3ZDMyNmU0NDU2ZDU1MzU4
14
- YWFmYmMxNWFmNDQ2YjEyZjJkMjYxZmJmNzg4Mjg4NzlmYTkyMTNiOGNhMTIz
15
- MTlhMGNmMjJiNjZjNTQwODcyMTkwMjVmNTMwZmVlNTRiODdmOGY=
13
+ YjBjMThhNTVmZmE0NTlkMTFlOTRlYWU3MTZmYzQyYWNjZDBkZGY1MjUxODQ3
14
+ NjFjZWJkMzE5ZGJkMDBmNDJjMGFjMmM2YTE0MDNhMzZhZTRiYjRlZmYxYzkx
15
+ ZWJhZGNiNzIyNGY1ZDdiMTNkZDU4OTI3ZDZkZWFjYTFmMjQxZGQ=
data/Gemfile CHANGED
@@ -47,6 +47,7 @@ gem 'rails-assets-backbone'
47
47
  gem 'rails-assets-jquery-ui'
48
48
  gem 'rails-assets-jquery-autosize'
49
49
  gem 'rails-assets-highlightjs'
50
+ gem 'rails-assets-jquery.scrollTo'
50
51
 
51
52
 
52
53
  # Use SCSS for stylesheets
data/Gemfile.lock CHANGED
@@ -267,6 +267,8 @@ GEM
267
267
  rails-assets-jquery (>= 1.7)
268
268
  rails-assets-jquery-ui (1.10.4)
269
269
  rails-assets-jquery (>= 1.6)
270
+ rails-assets-jquery.scrollTo (1.4.11)
271
+ rails-assets-jquery (>= 1.8)
270
272
  rails-assets-underscore (1.6.0)
271
273
  rails-timeago (2.9.0)
272
274
  actionpack (>= 3.1)
@@ -372,6 +374,7 @@ DEPENDENCIES
372
374
  rails-assets-highlightjs
373
375
  rails-assets-jquery-autosize
374
376
  rails-assets-jquery-ui
377
+ rails-assets-jquery.scrollTo
375
378
  rails-assets-underscore
376
379
  rails-timeago
377
380
  redcarpet
@@ -30,6 +30,7 @@
30
30
  //= require rails-timeago
31
31
  //= require underscore
32
32
  //= require jquery.blockUI
33
+ //= require jquery.scrollTo
33
34
  //= require backbone
34
35
  //= require backbone/tawork
35
36
  //= require global_search
@@ -0,0 +1,40 @@
1
+ class Tawork.Views.CompareView extends Backbone.View
2
+ events:
3
+ "click .change-item": "scroll_to_change"
4
+
5
+ initialize: (options = {}) ->
6
+ $('.nav.nav-pills li a').click (e) ->
7
+ e.preventDefault()
8
+ $(this).tab('show')
9
+ @setup_change_list()
10
+
11
+ setup_change_list: ->
12
+ $changes = $("[changeid][id]")
13
+ console.log $changes
14
+ change_ids = []
15
+ $changes.each (index, change) ->
16
+ $change = $(change)
17
+
18
+ $li = $("<li/>", class: "page-list-item")
19
+ id = $change.attr("id")
20
+ if id.indexOf("added") != -1
21
+ name = "Added"
22
+ else
23
+ name = "Removed"
24
+
25
+ $link = $("<a/>", href: "#", class: "change-item").html(name).attr("data-id", $change.attr("id"))
26
+ $li.append $link
27
+ $(".compare-change-list").append($li)
28
+
29
+ scroll_to_change: (event) ->
30
+ $diff_link = @$("a[href='#version-diff']")
31
+
32
+ if !$diff_link.closest("li").hasClass("active")
33
+ $diff_link.click()
34
+
35
+ $link = $(event.target).closest("a")
36
+ $change = $("#" + $link.attr("data-id"))
37
+ $changes = $("[changeid=" + $link.attr("data-id") + "], [changeid=" + $link.attr("data-id") + "] img")
38
+ $(document).scrollTo $change, 100, onAfter: ->
39
+ $changes.effect("highlight")
40
+ false
@@ -237,6 +237,9 @@ li.mjs-nestedSortable-expanded
237
237
  h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6
238
238
  font-family: "Ubuntu", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif
239
239
 
240
+ img
241
+ max-width: 100%
242
+
240
243
  .content-description
241
244
  clear: both
242
245
 
@@ -313,8 +316,6 @@ div.tokenfield.form-control
313
316
 
314
317
  .compare-column
315
318
  min-height: 300px
316
- border-right: 1px solid gray
317
- border-left: 1px solid gray
318
- img
319
- width: 100%
320
- max-width: 100%
319
+ // img
320
+ // width: 100%
321
+ // max-width: 100%
@@ -1,3 +1,7 @@
1
1
  .container-fluid
2
- .row
2
+ .row.compare-view
3
3
  = yield
4
+
5
+ :coffeescript
6
+ $ ->
7
+ new Tawork.Views.CompareView el: $(".compare-view").get(0)
@@ -1,4 +1,19 @@
1
- .col-md-12
1
+ .col-md-3.sidebar
2
+ %br/
3
+ %ul.nav.nav-pills{style: "margin-left: 10px"}
4
+ %li
5
+ %a{href: "#version-previous"} Previous Version
6
+ %li.active
7
+ %a{href: "#version-diff"} Diff
8
+ %li
9
+ %a{href: "#version-new"} Applied Changes
10
+
11
+ %ul.nav.nav-list.nav-list-panel.compare-change-list
12
+ %li.nav-header
13
+ Change List
14
+
15
+
16
+ .col-md-9.col-md-offset-3
2
17
  - page_title = title "Comparing version #{params[:version]} for #{@page.title}"
3
18
  = render 'breadcrumb', link_last: true
4
19
 
@@ -10,9 +25,16 @@
10
25
 
11
26
  %hr/
12
27
 
13
- -# .col-md-6.compare-column
14
- -# #wiki-content.wiki-content.content-description
15
- -# = raw @old_html
16
- .col-md-12.compare-column
28
+ .col-md-9.col-md-offset-3
29
+
30
+ %hr/
31
+
32
+ .col-md-9.col-md-offset-3.compare-column
17
33
  #wiki-content.wiki-content.content-description
18
- = raw @diff_html
34
+ .tab-content
35
+ #version-previous.tab-pane.fade
36
+ = raw @old_html
37
+ #version-diff.tab-pane.fade.active.in
38
+ = raw @diff_html
39
+ #version-new.tab-pane.fade
40
+ = raw @new_html
@@ -1,3 +1,3 @@
1
1
  module Tawork
2
- VERSION = '0.0.38'
2
+ VERSION = '0.0.39'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tawork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.38
4
+ version: 0.0.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adnan Ali
@@ -47,6 +47,7 @@ files:
47
47
  - app/assets/javascripts/backbone/templates/.gitkeep
48
48
  - app/assets/javascripts/backbone/views/.gitkeep
49
49
  - app/assets/javascripts/backbone/views/attachment.js.coffee
50
+ - app/assets/javascripts/backbone/views/compare.js.coffee
50
51
  - app/assets/javascripts/backbone/views/page.js.coffee
51
52
  - app/assets/javascripts/backbone/views/ticket.js.coffee
52
53
  - app/assets/javascripts/backbone/views/tree_node_page.js.coffee