summaryrefslogtreecommitdiff
path: root/public/javascripts/tiny_mce/plugins/tabfocus
diff options
context:
space:
mode:
Diffstat (limited to 'public/javascripts/tiny_mce/plugins/tabfocus')
-rw-r--r--public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin.js1
-rw-r--r--public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js109
2 files changed, 0 insertions, 110 deletions
diff --git a/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin.js b/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin.js
deleted file mode 100644
index 7f1fe26..0000000
--- a/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin.js
+++ /dev/null
@@ -1 +0,0 @@
1(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(i){o=c.getParent(l.id,"form");n=o.elements;if(o){d(n,function(s,r){if(s.id==l.id){j=r;return false}});if(i>0){for(m=j+1;m<n.length;m++){if(n[m].type!="hidden"){return n[m]}}}else{for(m=j-1;m>=0;m--){if(n[m].type!="hidden"){return n[m]}}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(l=tinymce.EditorManager.get(n.id||n.name)){l.focus()}else{window.setTimeout(function(){window.focus();n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}f.onInit.add(function(){d(c.select("a:first,a:last",f.getContainer()),function(i){a.add(i,"focus",function(){f.focus()})})})},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js
deleted file mode 100644
index 0fa8d81..0000000
--- a/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js
+++ /dev/null
@@ -1,109 +0,0 @@
1/**
2 * $Id: editor_plugin_src.js 787 2008-04-10 11:40:57Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode;
10
11 tinymce.create('tinymce.plugins.TabFocusPlugin', {
12 init : function(ed, url) {
13 function tabCancel(ed, e) {
14 if (e.keyCode === 9)
15 return Event.cancel(e);
16 };
17
18 function tabHandler(ed, e) {
19 var x, i, f, el, v;
20
21 function find(d) {
22 f = DOM.getParent(ed.id, 'form');
23 el = f.elements;
24
25 if (f) {
26 each(el, function(e, i) {
27 if (e.id == ed.id) {
28 x = i;
29 return false;
30 }
31 });
32
33 if (d > 0) {
34 for (i = x + 1; i < el.length; i++) {
35 if (el[i].type != 'hidden')
36 return el[i];
37 }
38 } else {
39 for (i = x - 1; i >= 0; i--) {
40 if (el[i].type != 'hidden')
41 return el[i];
42 }
43 }
44 }
45
46 return null;
47 };
48
49 if (e.keyCode === 9) {
50 v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next')));
51
52 if (v.length == 1) {
53 v[1] = v[0];
54 v[0] = ':prev';
55 }
56
57 // Find element to focus
58 if (e.shiftKey) {
59 if (v[0] == ':prev')
60 el = find(-1);
61 else
62 el = DOM.get(v[0]);
63 } else {
64 if (v[1] == ':next')
65 el = find(1);
66 else
67 el = DOM.get(v[1]);
68 }
69
70 if (el) {
71 if (ed = tinymce.EditorManager.get(el.id || el.name))
72 ed.focus();
73 else
74 window.setTimeout(function() {window.focus();el.focus();}, 10);
75
76 return Event.cancel(e);
77 }
78 }
79 };
80
81 ed.onKeyUp.add(tabCancel);
82
83 if (tinymce.isGecko) {
84 ed.onKeyPress.add(tabHandler);
85 ed.onKeyDown.add(tabCancel);
86 } else
87 ed.onKeyDown.add(tabHandler);
88
89 ed.onInit.add(function() {
90 each(DOM.select('a:first,a:last', ed.getContainer()), function(n) {
91 Event.add(n, 'focus', function() {ed.focus();});
92 });
93 });
94 },
95
96 getInfo : function() {
97 return {
98 longname : 'Tabfocus',
99 author : 'Moxiecode Systems AB',
100 authorurl : 'http://tinymce.moxiecode.com',
101 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus',
102 version : tinymce.majorVersion + "." + tinymce.minorVersion
103 };
104 }
105 });
106
107 // Register plugin
108 tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin);
109})(); \ No newline at end of file