noodall-ui 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Noodall
2
2
  module UI
3
- VERSION = "0.3.4"
3
+ VERSION = "0.3.5"
4
4
  end
5
5
  end
@@ -45,7 +45,10 @@ $.extend(tiny_mce_config, lite_tiny_mce_config, {
45
45
  image : '/images/admin/image_small.png',
46
46
  href: '#asset-browser',
47
47
  onclick : function() {
48
- Browser.do_action_and_close = function() {
48
+ tinyMCE.activeEditor.focus();
49
+ tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark();
50
+ Browser.action = function(e) {
51
+ e.stopImmediatePropagation();
49
52
  asset_id = Browser.assets_to_add[0]
50
53
  if (asset_id) {
51
54
  add_url = $('#asset-' + asset_id).siblings('a.show').attr('href').split('?')[0] + '/add';
@@ -55,24 +58,23 @@ $.extend(tiny_mce_config, lite_tiny_mce_config, {
55
58
  choices = $('#asset-browser .choice');
56
59
  if (choices.length > 0) {
57
60
  $.each(choices, function(i, choice){
58
- $(choice).click(function(){
59
- tinyMCE.activeEditor.focus();
61
+ $(choice).click(function(e){
62
+ tinyMCE.activeEditor.selection.moveToBookmark(tinyMCE.activeEditor.windowManager.bookmark);
60
63
  tinyMCE.activeEditor.selection.setContent($(this).html());
61
- Browser.close();
64
+ $.fancybox.close();
62
65
  return false;
63
- })
66
+ });
64
67
  });
65
68
  } else {
66
- tinyMCE.activeEditor.focus();
69
+ tinyMCE.activeEditor.selection.moveToBookmark(tinyMCE.activeEditor.windowManager.bookmark);
67
70
  tinyMCE.activeEditor.selection.setContent(data);
68
- Browser.close();
71
+ $.fancybox.close();
69
72
  return false;
70
73
  }
71
74
  }, 'html');
72
75
  }
73
76
  return false;
74
77
  };
75
- Browser.after_close = $.fancybox.close;
76
78
  Browser.open();
77
79
  }
78
80
  });
@@ -82,6 +84,8 @@ $.extend(tiny_mce_config, lite_tiny_mce_config, {
82
84
  image : '/images/admin/top-level_small.png',
83
85
  href: '#asset-browser',
84
86
  onclick : function() {
87
+ tinyMCE.activeEditor.focus();
88
+ tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark();
85
89
  // open asset lightbox
86
90
  $.get("/admin/nodes/tree", function() {
87
91
  // reopen the opening form if you close this form
@@ -106,6 +110,7 @@ $.extend(tiny_mce_config, lite_tiny_mce_config, {
106
110
  // then insert the link, then remove containing span after all is good
107
111
  $('#tree-browser.tinymce li a').live('click', function(event) {
108
112
  add_url = $(this).attr('href').split('?')[0];
113
+ tinyMCE.activeEditor.selection.moveToBookmark(tinyMCE.activeEditor.windowManager.bookmark);
109
114
 
110
115
  if(tinyMCE.activeEditor.selection.getContent().length === 0){
111
116
  tinyMCE.execInstanceCommand(tinyMCE.activeEditor.id, 'mceInsertRawHTML', false, '<span class="tmp_tag">' + $(this).text() + '</span>');
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noodall-ui
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 4
10
- version: 0.3.4
9
+ - 5
10
+ version: 0.3.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Steve England
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-14 00:00:00 +01:00
18
+ date: 2011-04-15 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency