tinymce-rails 3.5.9 → 3.5.11

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.
@@ -1,122 +1,141 @@
1
- require "multi_json"
2
-
3
1
  module TinyMCE
4
2
  module Rails
5
3
  class AssetManifest
4
+ attr_reader :file
5
+
6
6
  def self.load(manifest_path)
7
- YamlManifest.try(manifest_path) ||
8
- JsonManifest.try(manifest_path) ||
7
+ JsonManifest.try(manifest_path, ".sprockets-manifest*.json") ||
8
+ JsonManifest.try(manifest_path, "manifest*.json") ||
9
+ YamlManifest.try(manifest_path) ||
9
10
  NullManifest.new
10
11
  end
11
- end
12
- end
13
-
14
- class YamlManifest
15
- def self.try(manifest_path)
16
- yaml_file = File.join(manifest_path, "manifest.yml")
17
- new(yaml_file) if File.exists?(yaml_file)
18
- end
12
+
13
+ def each(pattern)
14
+ assets.each_key do |asset|
15
+ if asset =~ pattern && !index_asset?(asset)
16
+ yield asset
17
+ end
18
+ end
19
+ end
20
+
21
+ def asset_path(logical_path)
22
+ if digested = assets[logical_path]
23
+ yield digested, logical_path if block_given?
24
+ end
25
+ end
26
+
27
+ def to_s
28
+ dump
29
+ end
19
30
 
20
- def initialize(file)
21
- @file = file
22
- @manifest = YAML.load_file(file)
31
+ protected
32
+ def index_asset?(asset)
33
+ asset =~ /\/index[^\/]*\.\w+$/
34
+ end
23
35
  end
36
+
37
+ class YamlManifest < AssetManifest
38
+ def self.try(manifest_path)
39
+ yaml_file = File.join(manifest_path, "manifest.yml")
40
+ new(yaml_file) if File.exists?(yaml_file)
41
+ end
24
42
 
25
- def append(logical_path, file)
26
- @manifest[logical_path] = logical_path
27
- end
43
+ def initialize(file)
44
+ @file = file
45
+ @manifest = YAML.load_file(file)
46
+ end
28
47
 
29
- def remove(logical_path)
30
- @manifest.delete(logical_path)
31
- end
48
+ def append(logical_path, file)
49
+ assets[logical_path] = logical_path
50
+ end
32
51
 
33
- def remove_digest(logical_path)
34
- if digested = @manifest[logical_path]
35
- @manifest[logical_path] = logical_path
36
- yield digested, logical_path if block_given?
52
+ def remove(logical_path)
53
+ assets.delete(logical_path)
37
54
  end
38
- end
39
55
 
40
- def each(pattern)
41
- @manifest.each_key do |asset|
42
- yield asset if asset =~ pattern
56
+ def remove_digest(logical_path)
57
+ asset_path(logical_path) do |digested, logical_path|
58
+ assets[logical_path] = logical_path
59
+
60
+ yield digested, logical_path if block_given?
61
+ end
43
62
  end
44
- end
45
63
 
46
- def to_s
47
- dump
48
- end
64
+ def assets
65
+ @manifest
66
+ end
49
67
 
50
- def dump(io=nil)
51
- YAML.dump(@manifest, io)
52
- end
68
+ def dump(io=nil)
69
+ YAML.dump(@manifest, io)
70
+ end
53
71
 
54
- def write
55
- File.open(@file, "wb") { |f| dump(f) }
72
+ def write
73
+ File.open(@file, "wb") { |f| dump(f) }
74
+ end
56
75
  end
57
- end
58
76
 
59
- class JsonManifest
60
- def self.try(manifest_path)
61
- paths = Dir[File.join(manifest_path, "manifest*.json")]
62
- new(paths.first) if paths.any?
63
- end
77
+ class JsonManifest < AssetManifest
78
+ def self.try(manifest_path, pattern)
79
+ paths = Dir[File.join(manifest_path, pattern)]
80
+ new(paths.first) if paths.any?
81
+ end
64
82
 
65
- def initialize(file)
66
- @file = file
67
- @manifest = MultiJson.load(File.read(file))
68
- end
83
+ def initialize(file)
84
+ @file = file
85
+ @manifest = JSON.parse(File.read(file))
86
+ end
69
87
 
70
- def append(logical_path, file)
71
- stat = File.stat(file)
88
+ def append(logical_path, file)
89
+ stat = File.stat(file)
72
90
 
73
- @manifest["assets"][logical_path] = logical_path
74
- @manifest["files"][logical_path] = {
75
- "logical_path" => logical_path,
76
- "mtime" => stat.mtime.iso8601,
77
- "size" => stat.size,
78
- "digest" => nil
79
- }
80
- end
81
-
82
- def remove(logical_path)
83
- if digested = @manifest["assets"].delete(logical_path)
84
- @manifest["files"].delete(digested)
91
+ assets[logical_path] = logical_path
92
+ files[logical_path] = {
93
+ "logical_path" => logical_path,
94
+ "mtime" => stat.mtime.iso8601,
95
+ "size" => stat.size,
96
+ "digest" => nil
97
+ }
85
98
  end
86
- end
87
99
 
88
- def remove_digest(logical_path)
89
- if digested = @manifest["assets"][logical_path]
90
- @manifest["assets"][logical_path] = logical_path
91
- @manifest["files"][logical_path] = @manifest["files"].delete(digested).tap { |f| f["digest"] = nil }
92
- yield digested, logical_path if block_given?
100
+ def remove(logical_path)
101
+ if digested = assets.delete(logical_path)
102
+ files.delete(digested)
103
+ end
93
104
  end
94
- end
95
105
 
96
- def each(pattern)
97
- @manifest["assets"].each_key do |asset|
98
- yield asset if asset =~ pattern
106
+ def remove_digest(logical_path)
107
+ asset_path(logical_path) do |digested, logical_path|
108
+ assets[logical_path] = logical_path
109
+ files[logical_path] = files.delete(digested).tap { |f| f["digest"] = nil }
110
+
111
+ yield digested, logical_path if block_given?
112
+ end
113
+ end
114
+
115
+ def assets
116
+ @manifest["assets"]
117
+ end
118
+
119
+ def files
120
+ @manifest["files"]
99
121
  end
100
- end
101
-
102
- def to_s
103
- dump
104
- end
105
122
 
106
- def dump
107
- MultiJson.dump(@manifest)
108
- end
123
+ def dump
124
+ JSON.generate(@manifest)
125
+ end
109
126
 
110
- def write
111
- File.open(@file, "wb") { |f| f.write(dump) }
127
+ def write
128
+ File.open(@file, "wb") { |f| f.write(dump) }
129
+ end
112
130
  end
113
- end
114
131
 
115
- class NullManifest
116
- def append(*); end
117
- def remove(*); end
118
- def remove_digest(*); end
119
- def each(*); end
120
- def write; end
132
+ class NullManifest < AssetManifest
133
+ def append(*); end
134
+ def remove(*); end
135
+ def remove_digest(*); end
136
+ def assets; {}; end
137
+ def each(*); end
138
+ def write; end
139
+ end
121
140
  end
122
141
  end
@@ -3,7 +3,7 @@ require "active_support/hash_with_indifferent_access"
3
3
  module TinyMCE::Rails
4
4
  class Configuration
5
5
  class Function < String
6
- def encode_json(encoder)
6
+ def to_javascript
7
7
  self
8
8
  end
9
9
  end
@@ -46,6 +46,20 @@ module TinyMCE::Rails
46
46
  result
47
47
  end
48
48
 
49
+ def to_javascript
50
+ pairs = options_for_tinymce.inject([]) do |result, (k, v)|
51
+ if v.respond_to?(:to_javascript)
52
+ v = v.to_javascript
53
+ elsif v.respond_to?(:to_json)
54
+ v = v.to_json
55
+ end
56
+
57
+ result << [k, v].join(": ")
58
+ end
59
+
60
+ "{\n#{pairs.join(",\n")}\n}"
61
+ end
62
+
49
63
  def merge(options)
50
64
  self.class.new(self.options.merge(options))
51
65
  end
@@ -58,10 +72,20 @@ module TinyMCE::Rails
58
72
  # Searches asset paths for TinyMCE language files.
59
73
  def self.available_languages
60
74
  assets.paths.map { |path|
61
- files = assets.entries(File.join(path, "tinymce/langs"))
62
- files.map { |file|
63
- asset = assets.attributes_for(File.join(path, file))
64
- asset.logical_path.sub(/\.js$/, "")
75
+ # Find all assets within tinymce/langs
76
+ entries = assets.entries(File.join(path, "tinymce/langs"))
77
+ entries.map { |entry|
78
+ if assets.respond_to?(:attributes_for)
79
+ assets.attributes_for(File.join(path, entry))
80
+ else
81
+ assets.find_asset(File.join("tinymce/langs", entry))
82
+ end
83
+ }.select { |asset|
84
+ # Select only JavaScript files
85
+ asset.logical_path =~ /\.js$/
86
+ }.map { |asset|
87
+ # Strip path and extension
88
+ asset.logical_path.sub(/^tinymce\/langs\//, "").sub(/\.js$/, "")
65
89
  }
66
90
  }.flatten.uniq
67
91
  end
@@ -5,7 +5,16 @@ module TinyMCE::Rails
5
5
  # Set an explicit base path for TinyMCE assets (usually defaults to /assets/tinymce)
6
6
  config.tinymce.base = nil
7
7
 
8
+ # Set default configuration file path (defaults to config/tinymce.yml within the Rails root if unset)
9
+ config.tinymce.config_path = nil
10
+
11
+ # Set default installation method (:compile or :copy) for TinyMCE assets
12
+ # :compile - adds TinyMCE to the Sprockets load paths and creates non-digested symlinks to the digested versions
13
+ # :copy - copies across the TinyMCE assets statically
14
+ config.tinymce.install = :copy
15
+
8
16
  initializer "precompile", :group => :all do |app|
17
+ app.config.assets.precompile << "tinymce/*" if config.tinymce.install == :compile
9
18
  app.config.assets.precompile << "tinymce.js"
10
19
  end
11
20
 
@@ -20,7 +29,9 @@ module TinyMCE::Rails
20
29
  end
21
30
 
22
31
  def self.default_base
23
- File.join(relative_url_root || "", Rails.application.config.assets.prefix || "/", "tinymce")
32
+ File.join(asset_host || "", relative_url_root || "",
33
+ Rails.application.config.assets.prefix || "/",
34
+ "tinymce")
24
35
  end
25
36
 
26
37
  def self.relative_url_root
@@ -33,5 +44,33 @@ module TinyMCE::Rails
33
44
  config.action_controller.relative_url_root
34
45
  end
35
46
  end
47
+
48
+ def self.asset_host
49
+ host = Rails.application.config.action_controller.asset_host
50
+
51
+ if host.respond_to?(:call)
52
+ # Callable asset hosts cannot be supported during
53
+ # precompilation as there is no request object
54
+ nil
55
+ elsif host =~ /%d/
56
+ # Load all TinyMCE assets from the first asset host
57
+ normalize_host(host % 0)
58
+ else
59
+ normalize_host(host)
60
+ end
61
+ end
62
+
63
+ def self.normalize_host(host)
64
+ if host =~ /^https?:\/\// || host =~ /^\/\//
65
+ host
66
+ else
67
+ # Use a protocol-relative URL if not otherwise specified
68
+ "//#{host}"
69
+ end
70
+ end
71
+
72
+ def self.config_path
73
+ Rails.application.config.tinymce.config_path || ::Rails.root.join("config/tinymce.yml")
74
+ end
36
75
  end
37
76
  end
@@ -21,11 +21,11 @@ module TinyMCE::Rails
21
21
 
22
22
  # Returns the JavaScript code required to initialize TinyMCE.
23
23
  def tinymce_javascript(config=:default, options={})
24
- "tinyMCE.init(#{tinymce_configuration(config, options).to_json});".html_safe
24
+ "tinyMCE.init(#{tinymce_configuration(config, options).to_javascript});".html_safe
25
25
  end
26
26
 
27
- # Returns the TinyMCE configuration as a hash.
28
- # It should be converted to JSON (via #to_json) for use within JavaScript.
27
+ # Returns the TinyMCE configuration object.
28
+ # It should be converted to JavaScript (via #to_javascript) for use within JavaScript.
29
29
  def tinymce_configuration(config=:default, options={})
30
30
  options, config = config, :default if config.is_a?(Hash)
31
31
  options.stringify_keys!
@@ -36,7 +36,7 @@ module TinyMCE::Rails
36
36
  base_configuration = base_configuration.fetch(config)
37
37
  end
38
38
 
39
- base_configuration.merge(options).options_for_tinymce
39
+ base_configuration.merge(options)
40
40
  end
41
41
 
42
42
  # Includes TinyMCE javascript assets via a script tag.
@@ -1,6 +1,6 @@
1
1
  module TinyMCE
2
2
  module Rails
3
- VERSION = "3.5.9"
4
- TINYMCE_VERSION = "3.5.9"
3
+ VERSION = "3.5.11"
4
+ TINYMCE_VERSION = "3.5.11"
5
5
  end
6
6
  end
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <title></title>
5
5
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
- <script type="text/javascript" src="../../tiny_mce_dev.js"></script>
6
+ <script type="text/javascript" src="../../tiny_mce.js"></script>
7
7
  <script type="text/javascript">
8
8
  function patchCallback(settings, key) {
9
9
  if (settings[key])
@@ -1 +1 @@
1
- (function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(s,j){var z=this,i,k="",r=z.editor,g=0,v=0,h,m,o,q,l,x,y,n;s=s||{};j=j||{};if(!s.inline){return z.parent(s,j)}n=z._frontWindow();if(n&&d.get(n.id+"_ifr")){n.focussedElement=d.get(n.id+"_ifr").contentWindow.document.activeElement}if(!s.type){z.bookmark=r.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240)+(tinymce.isIE?8:0);s.min_width=parseInt(s.min_width||150);s.min_height=parseInt(s.min_height||100);s.max_width=parseInt(s.max_width||2000);s.max_height=parseInt(s.max_height||2000);s.left=s.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(s.width/2)));s.top=s.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(s.height/2)));s.movable=s.resizable=true;j.mce_width=s.width;j.mce_height=s.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=s.auto_focus;z.features=s;z.params=j;z.onOpen.dispatch(z,s,j);if(s.type){k+=" mceModal";if(s.type){k+=" mce"+s.type.substring(0,1).toUpperCase()+s.type.substring(1)}s.resizable=false}if(s.statusbar){k+=" mceStatusbar"}if(s.resizable){k+=" mceResizable"}if(s.minimizable){k+=" mceMinimizable"}if(s.maximizable){k+=" mceMaximizable"}if(s.movable){k+=" mceMovable"}z._addAll(d.doc.body,["div",{id:i,role:"dialog","aria-labelledby":s.type?i+"_content":i+"_title","class":(r.settings.inlinepopups_skin||"clearlooks2")+(tinymce.isIE&&window.getSelection?" ie9":""),style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},s.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft",tabindex:"0"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight",tabindex:"0"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!s.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;v+=d.get(i+"_top").clientHeight;v+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:s.top,left:s.left,width:s.width+g,height:s.height+v});y=s.url||s.file;if(y){if(tinymce.relaxedDomain){y+=(y.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}y=tinymce._addVer(y)}if(!s.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:s.width,height:s.height});d.setAttrib(i+"_ifr","src",y)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(s.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",s.content.replace("\n","<br />"));a.add(i,"keyup",function(f){var p=27;if(f.keyCode===p){s.button_func(false);return a.cancel(f)}});a.add(i,"keydown",function(f){var t,p=9;if(f.keyCode===p){t=d.select("a.mceCancel",i+"_wrapper")[0];if(t&&t!==f.target){t.focus()}else{d.get(i+"_ok").focus()}return a.cancel(f)}})}o=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=z.windows[i];z.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceClose"){z.close(null,i);return a.cancel(t)}else{if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return z._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return z._startDrag(i,t,u.className.substring(13))}}}}}}});q=a.add(i,"click",function(f){var p=f.target;z.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":z.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":s.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});a.add([i+"_left",i+"_right"],"focus",function(p){var t=d.get(i+"_ifr");if(t){var f=t.contentWindow.document.body;var u=d.select(":input:enabled,*[tabindex=0]",f);if(p.target.id===(i+"_left")){u[u.length-1].focus()}else{u[0].focus()}}else{d.get(i+"_ok").focus()}});x=z.windows[i]={id:i,mousedown_func:o,click_func:q,element:new b(i,{blocker:1,container:r.getContainer()}),iframeElement:new b(i+"_ifr"),features:s,deltaWidth:g,deltaHeight:v};x.iframeElement.on("focus",function(){z.focus(i)});if(z.count==0&&z.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(z.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:z.zIndex-1}});d.show("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","true")}else{d.setStyle("mceModalBlocker","z-index",z.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}d.setAttrib(i,"aria-hidden","false");z.focus(i);z._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}z.count++;return x},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h;if(f.focussedElement){f.focussedElement.focus()}else{if(d.get(h+"_ok")){d.get(f.id+"_ok").focus()}else{if(d.get(f.id+"_ifr")){d.get(f.id+"_ifr").focus()}}}}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;g<h.length;g++){f._addAll(k,h[g])}}}},_startDrag:function(v,G,E){var o=this,u,z,C=d.doc,f,l=o.windows[v],h=l.element,y=h.getXY(),x,q,F,g,A,s,r,j,i,m,k,n,B;g={x:0,y:0};A=d.getViewPort();A.w-=2;A.h-=2;j=G.screenX;i=G.screenY;m=k=n=B=0;u=a.add(C,"mouseup",function(p){a.remove(C,"mouseup",u);a.remove(C,"mousemove",z);if(f){f.remove()}h.moveBy(m,k);h.resizeBy(n,B);q=h.getSize();d.setStyles(v+"_ifr",{width:q.w-l.deltaWidth,height:q.h-l.deltaHeight});o._fixIELayout(v,1);return a.cancel(p)});if(E!="Move"){D()}function D(){if(f){return}o._fixIELayout(v,0);d.add(C.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(o.editor.settings.inlinepopups_skin||"clearlooks2"),style:{zIndex:o.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceEventBlocker",{position:"absolute",left:A.x,top:A.y,width:A.w-2,height:A.h-2})}f=new b("mceEventBlocker");f.update();x=h.getXY();q=h.getSize();s=g.x+x.x-A.x;r=g.y+x.y-A.y;d.add(f.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:s,top:r,width:q.w,height:q.h}});F=new b("mcePlaceHolder")}z=a.add(C,"mousemove",function(w){var p,H,t;D();p=w.screenX-j;H=w.screenY-i;switch(E){case"ResizeW":m=p;n=0-p;break;case"ResizeE":n=p;break;case"ResizeN":case"ResizeNW":case"ResizeNE":if(E=="ResizeNW"){m=p;n=0-p}else{if(E=="ResizeNE"){n=p}}k=H;B=0-H;break;case"ResizeS":case"ResizeSW":case"ResizeSE":if(E=="ResizeSW"){m=p;n=0-p}else{if(E=="ResizeSE"){n=p}}B=H;break;case"mceMove":m=p;k=H;break}if(n<(t=l.features.min_width-q.w)){if(m!==0){m+=n-t}n=t}if(B<(t=l.features.min_height-q.h)){if(k!==0){k+=B-t}B=t}n=Math.min(n,l.features.max_width-q.w);B=Math.min(B,l.features.max_height-q.h);m=Math.max(m,A.x-(s+A.x));k=Math.max(k,A.y-(r+A.y));m=Math.min(m,(A.w+A.x)-(s+q.w+A.x));k=Math.min(k,(A.h+A.y)-(r+q.h+A.y));if(m+k!==0){if(s+m<0){m=0}if(r+k<0){k=0}F.moveTo(s+m,r+k)}if(n+B!==0){F.resizeTo(q.w+n,q.h+B)}return a.cancel(w)});return a.cancel(G)},resizeBy:function(g,h,i){var f=this.windows[i];if(f){f.element.resizeBy(g,h);f.iframeElement.resizeBy(g,h)}},close:function(i,k){var g=this,f,j=d.doc,h,k;k=g._findId(k||i);if(!g.windows[k]){g.parent(i);return}g.count--;if(g.count==0){d.remove("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","false");g.editor.focus()}if(f=g.windows[k]){g.onClose.dispatch(g);a.remove(j,"mousedown",f.mousedownFunc);a.remove(j,"click",f.clickFunc);a.clear(k);a.clear(k+"_ifr");d.setAttrib(k+"_ifr","src",'javascript:""');f.element.remove();delete g.windows[k];h=g._frontWindow();if(h){g.focus(h.id)}}},_frontWindow:function(){var g,f=0;e(this.windows,function(h){if(h.zIndex>f){g=h;f=h.zIndex}});return g},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})();
1
+ (function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(s,j){var z=this,i,k="",r=z.editor,g=0,v=0,h,m,o,q,l,x,y,n;s=s||{};j=j||{};if(!s.inline){return z.parent(s,j)}n=z._frontWindow();if(n&&d.get(n.id+"_ifr")){n.focussedElement=d.get(n.id+"_ifr").contentWindow.document.activeElement}if(!s.type){z.bookmark=r.selection.getBookmark(1)}i=d.uniqueId("mce_inlinepopups_");h=d.getViewPort();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240)+(tinymce.isIE?8:0);s.min_width=parseInt(s.min_width||150);s.min_height=parseInt(s.min_height||100);s.max_width=parseInt(s.max_width||2000);s.max_height=parseInt(s.max_height||2000);s.left=s.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(s.width/2)));s.top=s.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(s.height/2)));s.movable=s.resizable=true;j.mce_width=s.width;j.mce_height=s.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=s.auto_focus;z.features=s;z.params=j;z.onOpen.dispatch(z,s,j);if(s.type){k+=" mceModal";if(s.type){k+=" mce"+s.type.substring(0,1).toUpperCase()+s.type.substring(1)}s.resizable=false}if(s.statusbar){k+=" mceStatusbar"}if(s.resizable){k+=" mceResizable"}if(s.minimizable){k+=" mceMinimizable"}if(s.maximizable){k+=" mceMaximizable"}if(s.movable){k+=" mceMovable"}z._addAll(d.doc.body,["div",{id:i,role:"dialog","aria-labelledby":s.type?i+"_content":i+"_title","class":(r.settings.inlinepopups_skin||"clearlooks2")+(tinymce.isIE&&window.getSelection?" ie9":""),style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},s.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft",tabindex:"0"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight",tabindex:"0"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!s.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;v+=d.get(i+"_top").clientHeight;v+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:s.top,left:s.left,width:s.width+g,height:s.height+v});y=s.url||s.file;if(y){if(tinymce.relaxedDomain){y+=(y.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}y=tinymce._addVer(y)}if(!s.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:s.width,height:s.height});d.setAttrib(i+"_ifr","src",y)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(s.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",s.content.replace("\n","<br />"));a.add(i,"keyup",function(f){var p=27;if(f.keyCode===p){s.button_func(false);return a.cancel(f)}});a.add(i,"keydown",function(f){var t,p=9;if(f.keyCode===p){t=d.select("a.mceCancel",i+"_wrapper")[0];if(t&&t!==f.target){t.focus()}else{d.get(i+"_ok").focus()}return a.cancel(f)}})}o=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=z.windows[i];z.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceClose"){z.close(null,i);return a.cancel(t)}else{if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return z._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return z._startDrag(i,t,u.className.substring(13))}}}}}}});q=a.add(i,"click",function(f){var p=f.target;z.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":z.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":s.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});a.add([i+"_left",i+"_right"],"focus",function(p){var t=d.get(i+"_ifr");if(t){var f=t.contentWindow.document.body;var u=d.select(":input:enabled,*[tabindex=0]",f);if(p.target.id===(i+"_left")){u[u.length-1].focus()}else{u[0].focus()}}else{d.get(i+"_ok").focus()}});x=z.windows[i]={id:i,mousedown_func:o,click_func:q,element:new b(i,{blocker:1,container:r.getContainer()}),iframeElement:new b(i+"_ifr"),features:s,deltaWidth:g,deltaHeight:v};x.iframeElement.on("focus",function(){z.focus(i)});if(z.count==0&&z.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(z.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:z.zIndex-1}});d.show("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","true")}else{d.setStyle("mceModalBlocker","z-index",z.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}d.setAttrib(i,"aria-hidden","false");z.focus(i);z._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}z.count++;return x},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h;if(f.focussedElement){f.focussedElement.focus()}else{if(d.get(h+"_ok")){d.get(f.id+"_ok").focus()}else{if(d.get(f.id+"_ifr")){d.get(f.id+"_ifr").focus()}}}}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;g<h.length;g++){f._addAll(k,h[g])}}}},_startDrag:function(v,G,E){var o=this,u,z,C=d.doc,f,l=o.windows[v],h=l.element,y=h.getXY(),x,q,F,g,A,s,r,j,i,m,k,n,B;g={x:0,y:0};A=d.getViewPort();A.w-=2;A.h-=2;j=G.screenX;i=G.screenY;m=k=n=B=0;u=a.add(C,"mouseup",function(p){a.remove(C,"mouseup",u);a.remove(C,"mousemove",z);if(f){f.remove()}h.moveBy(m,k);h.resizeBy(n,B);q=h.getSize();d.setStyles(v+"_ifr",{width:q.w-l.deltaWidth,height:q.h-l.deltaHeight});o._fixIELayout(v,1);return a.cancel(p)});if(E!="Move"){D()}function D(){if(f){return}o._fixIELayout(v,0);d.add(C.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(o.editor.settings.inlinepopups_skin||"clearlooks2"),style:{zIndex:o.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceEventBlocker",{position:"absolute",left:A.x,top:A.y,width:A.w-2,height:A.h-2})}f=new b("mceEventBlocker");f.update();x=h.getXY();q=h.getSize();s=g.x+x.x-A.x;r=g.y+x.y-A.y;d.add(f.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:s,top:r,width:q.w,height:q.h}});F=new b("mcePlaceHolder")}z=a.add(C,"mousemove",function(w){var p,H,t;D();p=w.screenX-j;H=w.screenY-i;switch(E){case"ResizeW":m=p;n=0-p;break;case"ResizeE":n=p;break;case"ResizeN":case"ResizeNW":case"ResizeNE":if(E=="ResizeNW"){m=p;n=0-p}else{if(E=="ResizeNE"){n=p}}k=H;B=0-H;break;case"ResizeS":case"ResizeSW":case"ResizeSE":if(E=="ResizeSW"){m=p;n=0-p}else{if(E=="ResizeSE"){n=p}}B=H;break;case"mceMove":m=p;k=H;break}if(n<(t=l.features.min_width-q.w)){if(m!==0){m+=n-t}n=t}if(B<(t=l.features.min_height-q.h)){if(k!==0){k+=B-t}B=t}n=Math.min(n,l.features.max_width-q.w);B=Math.min(B,l.features.max_height-q.h);m=Math.max(m,A.x-(s+A.x));k=Math.max(k,A.y-(r+A.y));m=Math.min(m,(A.w+A.x)-(s+q.w+A.x));k=Math.min(k,(A.h+A.y)-(r+q.h+A.y));if(m+k!==0){if(s+m<0){m=0}if(r+k<0){k=0}F.moveTo(s+m,r+k)}if(n+B!==0){F.resizeTo(q.w+n,q.h+B)}return a.cancel(w)});return a.cancel(G)},resizeBy:function(g,h,i){var f=this.windows[i];if(f){f.element.resizeBy(g,h);f.iframeElement.resizeBy(g,h)}},close:function(i,k){var g=this,f,j=d.doc,h,k;k=g._findId(k||i);if(!g.windows[k]){g.parent(i);return}g.count--;if(g.count==0){d.remove("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","false");g.editor.focus()}if(f=g.windows[k]){g.onClose.dispatch(g);a.remove(j,"mousedown",f.mousedownFunc);a.remove(j,"click",f.clickFunc);a.clear(k);a.clear(k+"_ifr");d.setAttrib(k+"_ifr","src",'javascript:""');f.element.remove();delete g.windows[k];h=g._frontWindow();if(h){g.focus(h.id)}}},_frontWindow:function(){var g,f=0;e(this.windows,function(h){if(h.zIndex>f){g=h;f=h.zIndex}});return g},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})();
@@ -55,12 +55,12 @@
55
55
  if (parentWindow && DOM.get(parentWindow.id + '_ifr')) {
56
56
  parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement;
57
57
  }
58
-
58
+
59
59
  // Only store selection if the type is a normal window
60
60
  if (!f.type)
61
61
  t.bookmark = ed.selection.getBookmark(1);
62
62
 
63
- id = DOM.uniqueId();
63
+ id = DOM.uniqueId("mce_inlinepopups_"); // Use a prefix so this can't conflict with other ids
64
64
  vp = DOM.getViewPort();
65
65
  f.width = parseInt(f.width || 320);
66
66
  f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0);
@@ -111,17 +111,17 @@
111
111
  opt += ' mceMovable';
112
112
 
113
113
  // Create DOM objects
114
- t._addAll(DOM.doc.body,
115
- ['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'},
114
+ t._addAll(DOM.doc.body,
115
+ ['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'},
116
116
  ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt},
117
- ['div', {id : id + '_top', 'class' : 'mceTop'},
117
+ ['div', {id : id + '_top', 'class' : 'mceTop'},
118
118
  ['div', {'class' : 'mceLeft'}],
119
119
  ['div', {'class' : 'mceCenter'}],
120
120
  ['div', {'class' : 'mceRight'}],
121
121
  ['span', {id : id + '_title'}, f.title || '']
122
122
  ],
123
123
 
124
- ['div', {id : id + '_middle', 'class' : 'mceMiddle'},
124
+ ['div', {id : id + '_middle', 'class' : 'mceMiddle'},
125
125
  ['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}],
126
126
  ['span', {id : id + '_content'}],
127
127
  ['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}]
@@ -188,7 +188,7 @@
188
188
 
189
189
  DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'});
190
190
  DOM.setHTML(id + '_content', f.content.replace('\n', '<br />'));
191
-
191
+
192
192
  Event.add(id, 'keyup', function(evt) {
193
193
  var VK_ESCAPE = 27;
194
194
  if (evt.keyCode === VK_ESCAPE) {
@@ -268,7 +268,7 @@
268
268
  }
269
269
  }
270
270
  });
271
-
271
+
272
272
  // Make sure the tab order loops within the dialog.
273
273
  Event.add([id + '_left', id + '_right'], 'focus', function(evt) {
274
274
  var iframe = DOM.get(id + '_ifr');
@@ -284,7 +284,7 @@
284
284
  DOM.get(id + '_ok').focus();
285
285
  }
286
286
  });
287
-
287
+
288
288
  // Add window
289
289
  w = t.windows[id] = {
290
290
  id : id,
@@ -341,7 +341,7 @@
341
341
  DOM.removeClass(t.lastId, 'mceFocus');
342
342
  DOM.addClass(id, 'mceFocus');
343
343
  t.lastId = id;
344
-
344
+
345
345
  if (w.focussedElement) {
346
346
  w.focussedElement.focus();
347
347
  } else if (DOM.get(id + '_ok')) {
@@ -486,7 +486,7 @@
486
486
 
487
487
  dw = v;
488
488
  }
489
-
489
+
490
490
  if (dh < (v = w.features.min_height - sz.h)) {
491
491
  if (dy !== 0)
492
492
  dy += dh - v;
@@ -505,7 +505,7 @@
505
505
  if (dx + dy !== 0) {
506
506
  if (sx + dx < 0)
507
507
  dx = 0;
508
-
508
+
509
509
  if (sy + dy < 0)
510
510
  dy = 0;
511
511
 
@@ -567,7 +567,7 @@
567
567
  t.focus(fw.id);
568
568
  }
569
569
  },
570
-
570
+
571
571
  // Find front most window
572
572
  _frontWindow : function() {
573
573
  var fw, ix = 0;