tandem 0.2.0.rc → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. data/lib/tandem/version.rb +1 -1
  2. data/vendor/assets/javascripts/tandem/jquery-fileupload/index.js +2 -0
  3. data/vendor/assets/javascripts/tandem/jquery-fileupload/jquery.fileupload.js +852 -0
  4. data/vendor/assets/javascripts/tandem/jquery-fileupload/jquery.iframe-transport.js +165 -0
  5. data/vendor/assets/javascripts/tandem/jquery.colorbox.js +888 -0
  6. data/vendor/assets/javascripts/tandem/jquery.ui.widget.js +282 -0
  7. data/vendor/assets/javascripts/tandem/modernizr-2.5.3.min.js +4 -0
  8. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-article.png +0 -0
  9. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-aside.png +0 -0
  10. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-blockquote.png +0 -0
  11. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-command.png +0 -0
  12. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-details.png +0 -0
  13. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-figcaption.png +0 -0
  14. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-figure.png +0 -0
  15. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-footer.png +0 -0
  16. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-h1.png +0 -0
  17. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-h2.png +0 -0
  18. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-h3.png +0 -0
  19. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-h4.png +0 -0
  20. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-h5.png +0 -0
  21. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-h6.png +0 -0
  22. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-header.png +0 -0
  23. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-hgroup.png +0 -0
  24. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-mark.png +0 -0
  25. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-meter.png +0 -0
  26. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-nav.png +0 -0
  27. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-p.png +0 -0
  28. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-pre.png +0 -0
  29. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-progress.png +0 -0
  30. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-rp.png +0 -0
  31. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-rt.png +0 -0
  32. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-ruby.png +0 -0
  33. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-section.png +0 -0
  34. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-summary.png +0 -0
  35. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/lbl-time.png +0 -0
  36. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/readme.md +1 -0
  37. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/wymiframe.css +98 -0
  38. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/wymiframe.css.scss +98 -0
  39. data/vendor/assets/javascripts/tandem/wymeditor/iframe/default/wymiframe.html +26 -0
  40. data/vendor/assets/javascripts/tandem/wymeditor/jquery.wymeditor.min.js +34 -0
  41. data/vendor/assets/javascripts/tandem/wymeditor/lang/bg.js +45 -0
  42. data/vendor/assets/javascripts/tandem/wymeditor/lang/ca.js +45 -0
  43. data/vendor/assets/javascripts/tandem/wymeditor/lang/cs.js +45 -0
  44. data/vendor/assets/javascripts/tandem/wymeditor/lang/cy.js +45 -0
  45. data/vendor/assets/javascripts/tandem/wymeditor/lang/de.js +45 -0
  46. data/vendor/assets/javascripts/tandem/wymeditor/lang/en.js +45 -0
  47. data/vendor/assets/javascripts/tandem/wymeditor/lang/es.js +45 -0
  48. data/vendor/assets/javascripts/tandem/wymeditor/lang/fa.js +46 -0
  49. data/vendor/assets/javascripts/tandem/wymeditor/lang/fi.js +44 -0
  50. data/vendor/assets/javascripts/tandem/wymeditor/lang/fr.js +45 -0
  51. data/vendor/assets/javascripts/tandem/wymeditor/lang/gl.js +45 -0
  52. data/vendor/assets/javascripts/tandem/wymeditor/lang/he.js +45 -0
  53. data/vendor/assets/javascripts/tandem/wymeditor/lang/hr.js +45 -0
  54. data/vendor/assets/javascripts/tandem/wymeditor/lang/hu.js +45 -0
  55. data/vendor/assets/javascripts/tandem/wymeditor/lang/it.js +45 -0
  56. data/vendor/assets/javascripts/tandem/wymeditor/lang/ja.js +44 -0
  57. data/vendor/assets/javascripts/tandem/wymeditor/lang/lt.js +45 -0
  58. data/vendor/assets/javascripts/tandem/wymeditor/lang/nb.js +45 -0
  59. data/vendor/assets/javascripts/tandem/wymeditor/lang/nl.js +45 -0
  60. data/vendor/assets/javascripts/tandem/wymeditor/lang/nn.js +45 -0
  61. data/vendor/assets/javascripts/tandem/wymeditor/lang/pl.js +45 -0
  62. data/vendor/assets/javascripts/tandem/wymeditor/lang/pt-br.js +45 -0
  63. data/vendor/assets/javascripts/tandem/wymeditor/lang/pt.js +45 -0
  64. data/vendor/assets/javascripts/tandem/wymeditor/lang/ru.js +45 -0
  65. data/vendor/assets/javascripts/tandem/wymeditor/lang/sv.js +46 -0
  66. data/vendor/assets/javascripts/tandem/wymeditor/lang/tr.js +45 -0
  67. data/vendor/assets/javascripts/tandem/wymeditor/lang/zh_cn.js +47 -0
  68. data/vendor/assets/javascripts/tandem/wymeditor/plugins/embed/jquery.wymeditor.embed.js +82 -0
  69. data/vendor/assets/javascripts/tandem/wymeditor/plugins/fullscreen/icon_fullscreen.gif +0 -0
  70. data/vendor/assets/javascripts/tandem/wymeditor/plugins/fullscreen/jquery.wymeditor.fullscreen.js +124 -0
  71. data/vendor/assets/javascripts/tandem/wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js +49 -0
  72. data/vendor/assets/javascripts/tandem/wymeditor/plugins/list/jquery.wymeditor.list.js +60 -0
  73. data/vendor/assets/javascripts/tandem/wymeditor/plugins/rdfa/jquery.wymeditor.rdfa.js +186 -0
  74. data/vendor/assets/javascripts/tandem/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js +77 -0
  75. data/vendor/assets/javascripts/tandem/wymeditor/plugins/resizable/readme.txt +124 -0
  76. data/vendor/assets/javascripts/tandem/wymeditor/plugins/table/jquery.wymeditor.table.js +721 -0
  77. data/vendor/assets/javascripts/tandem/wymeditor/plugins/table/table_delete_column.png +0 -0
  78. data/vendor/assets/javascripts/tandem/wymeditor/plugins/table/table_delete_row.png +0 -0
  79. data/vendor/assets/javascripts/tandem/wymeditor/plugins/table/table_insert_column.png +0 -0
  80. data/vendor/assets/javascripts/tandem/wymeditor/plugins/table/table_insert_row.png +0 -0
  81. data/vendor/assets/javascripts/tandem/wymeditor/plugins/table/table_join_row.png +0 -0
  82. data/vendor/assets/javascripts/tandem/wymeditor/plugins/tidy/README +19 -0
  83. data/vendor/assets/javascripts/tandem/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js +78 -0
  84. data/vendor/assets/javascripts/tandem/wymeditor/plugins/tidy/tidy.php +58 -0
  85. data/vendor/assets/javascripts/tandem/wymeditor/plugins/tidy/wand.png +0 -0
  86. data/vendor/assets/javascripts/tandem/wymeditor/skins/compact/icons.png +0 -0
  87. data/vendor/assets/javascripts/tandem/wymeditor/skins/compact/skin.css +134 -0
  88. data/vendor/assets/javascripts/tandem/wymeditor/skins/compact/skin.js +37 -0
  89. data/vendor/assets/javascripts/tandem/wymeditor/skins/default/icons.png +0 -0
  90. data/vendor/assets/javascripts/tandem/wymeditor/skins/default/skin.css +136 -0
  91. data/vendor/assets/javascripts/tandem/wymeditor/skins/default/skin.js +40 -0
  92. data/vendor/assets/javascripts/tandem/wymeditor/skins/minimal/images/bg.header.gif +0 -0
  93. data/vendor/assets/javascripts/tandem/wymeditor/skins/minimal/images/bg.selector.silver.gif +0 -0
  94. data/vendor/assets/javascripts/tandem/wymeditor/skins/minimal/images/bg.wymeditor.png +0 -0
  95. data/vendor/assets/javascripts/tandem/wymeditor/skins/minimal/images/icons.silver.gif +0 -0
  96. data/vendor/assets/javascripts/tandem/wymeditor/skins/minimal/skin.css +131 -0
  97. data/vendor/assets/javascripts/tandem/wymeditor/skins/minimal/skin.js +30 -0
  98. data/vendor/assets/javascripts/tandem/wymeditor/skins/silver/COPYING +674 -0
  99. data/vendor/assets/javascripts/tandem/wymeditor/skins/silver/README +27 -0
  100. data/vendor/assets/javascripts/tandem/wymeditor/skins/silver/images/bg.header.gif +0 -0
  101. data/vendor/assets/javascripts/tandem/wymeditor/skins/silver/images/bg.selector.silver.gif +0 -0
  102. data/vendor/assets/javascripts/tandem/wymeditor/skins/silver/images/bg.wymeditor.png +0 -0
  103. data/vendor/assets/javascripts/tandem/wymeditor/skins/silver/images/icons.silver.gif +0 -0
  104. data/vendor/assets/javascripts/tandem/wymeditor/skins/silver/skin.css +297 -0
  105. data/vendor/assets/javascripts/tandem/wymeditor/skins/silver/skin.js +61 -0
  106. data/vendor/assets/javascripts/tandem/wymeditor/skins/twopanels/icons.png +0 -0
  107. data/vendor/assets/javascripts/tandem/wymeditor/skins/twopanels/skin.css +134 -0
  108. data/vendor/assets/javascripts/tandem/wymeditor/skins/twopanels/skin.js +39 -0
  109. data/vendor/assets/javascripts/tandem/wymeditor/skins/wymeditor_icon.png +0 -0
  110. metadata +112 -4
@@ -0,0 +1,124 @@
1
+ /*
2
+ * WYMeditor : what you see is What You Mean web-based editor
3
+ * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/
4
+ * Dual licensed under the MIT (MIT-license.txt)
5
+ * and GPL (GPL-license.txt) licenses.
6
+ *
7
+ * For further information visit:
8
+ * http://www.wymeditor.org/
9
+ *
10
+ * File Name:
11
+ * jquery.wymeditor.fullscreen.js
12
+ * Fullscreen plugin for WYMeditor
13
+ *
14
+ * File Authors:
15
+ * Luis Santos (luis.santos a-t openquest dotpt)
16
+ * Jonatan Lundin (jonatan.lundin a-t gmail dotcom)
17
+ * Gerd Riesselmann (gerd a-t gyro-php dot org) : Fixed issue with new skin layout
18
+ */
19
+
20
+ //Extend WYMeditor
21
+ WYMeditor.editor.prototype.fullscreen = function() {
22
+ var wym = this,
23
+ $box = jQuery(this._box),
24
+ $iframe = jQuery(this._iframe),
25
+ $overlay = null,
26
+ $window = jQuery(window),
27
+
28
+ editorMargin = 15; // Margin from window (without padding)
29
+
30
+
31
+ //construct the button's html
32
+ var html = '' +
33
+ "<li class='wym_tools_fullscreen'>" +
34
+ "<a name='Fullscreen' href='#' " +
35
+ "style='background-image: url(" +
36
+ wym._options.basePath +
37
+ "plugins/fullscreen/icon_fullscreen.gif)'>" +
38
+ "Fullscreen" +
39
+ "</a>" +
40
+ "</li>";
41
+ //add the button to the tools box
42
+ $box.find(wym._options.toolsSelector + wym._options.toolsListSelector)
43
+ .append(html);
44
+
45
+ function resize () {
46
+ // Calculate margins
47
+ var uiHeight = $box.outerHeight(true) - $iframe.outerHeight(true);
48
+ var editorPadding = $box.outerWidth() - $box.width();
49
+
50
+ // Calculate heights
51
+ var screenHeight = $window.height();
52
+ var iframeHeight = (screenHeight - uiHeight - (editorMargin * 2)) + 'px';
53
+
54
+ // Calculate witdths
55
+ var screenWidth = $window.width();
56
+ var boxWidth = (screenWidth - editorPadding - (editorMargin * 2)) + 'px';
57
+
58
+ $box.css('width', boxWidth);
59
+ $iframe.css('height', iframeHeight);
60
+ $overlay.css({
61
+ 'height': screenHeight + 'px',
62
+ 'width': screenWidth + 'px'
63
+ });
64
+ }
65
+
66
+ //handle click event
67
+ $box.find('li.wym_tools_fullscreen a').click(function() {
68
+ if ($box.css('position') != 'fixed') {
69
+ // Store previous inline styles
70
+ $box.data('wym-inline-css', $box.attr('style'));
71
+ $iframe.data('wym-inline-css', $iframe.attr('style'));
72
+
73
+ // Create overlay
74
+ $overlay = jQuery('<div id="wym-fullscreen-overlay"></div>')
75
+ .appendTo('body').css({
76
+ 'position': 'fixed',
77
+ 'background-color': 'rgb(0, 0, 0)',
78
+ 'opacity': '0.75',
79
+ 'z-index': '98',
80
+ 'top': '0px',
81
+ 'left': '0px'
82
+ });
83
+
84
+ // Possition the editor
85
+ $box.css({
86
+ 'position': 'fixed',
87
+ 'z-index': '99',
88
+ 'top': editorMargin + 'px',
89
+ 'left': editorMargin + 'px'
90
+ });
91
+
92
+ // Bind event listeners
93
+ $window.bind('resize', resize);
94
+ $box.find('li.wym_tools_html a').bind('click', resize);
95
+
96
+ // Force resize
97
+ resize();
98
+ } else {
99
+ // Unbind event listeners
100
+ $window.unbind('resize', resize);
101
+ $box.find('li.wym_tools_html a').unbind('click', resize);
102
+
103
+ // Remove inline styles
104
+ $box.css({
105
+ 'position': 'static',
106
+ 'z-index': '',
107
+ 'width': '',
108
+ 'top': '',
109
+ 'left': ''
110
+ });
111
+ $iframe.css('height', '');
112
+
113
+ // Remove overlay
114
+ $overlay.remove();
115
+ $overlay = null;
116
+
117
+ // Retore previous inline styles
118
+ $box.attr('style', $box.data('wym-inline-css'));
119
+ $iframe.attr('style', $iframe.data('wym-inline-css'));
120
+ }
121
+
122
+ return false;
123
+ });
124
+ };
@@ -0,0 +1,49 @@
1
+ /*jslint evil: true */
2
+ /**
3
+ WYMeditor.hovertools
4
+ ====================
5
+
6
+ A hovertools plugin.
7
+ */
8
+
9
+ WYMeditor.editor.prototype.hovertools = function() {
10
+ var wym = this;
11
+
12
+ wym.status('&nbsp;');
13
+
14
+ // Bind events on buttons
15
+ jQuery(this._box).find(this._options.toolSelector).hover(
16
+ function() {
17
+ wym.status(jQuery(this).html());
18
+ },
19
+ function() {
20
+ wym.status('&nbsp;');
21
+ }
22
+ );
23
+
24
+ // Classes: add/remove a style attr to matching elems
25
+ // while mouseover/mouseout
26
+ jQuery(this._box).find(this._options.classSelector).hover(
27
+ function() {
28
+ var aClasses = eval(wym._options.classesItems);
29
+ var sName = jQuery(this).attr(WYMeditor.NAME);
30
+ var oClass = WYMeditor.Helper.findByName(aClasses, sName);
31
+
32
+ if (oClass){
33
+ jqexpr = oClass.expr;
34
+ // Don't use jQuery.find() on the iframe body
35
+ // because of MSIE + jQuery + expando issue (#JQ1143)
36
+ if (!jQuery.browser.msie) {
37
+ jQuery(wym._doc).find(jqexpr).css('background-color','#cfc');
38
+ }
39
+ }
40
+ },
41
+ function() {
42
+ // Don't use jQuery.find() on the iframe body
43
+ // because of MSIE + jQuery + expando issue (#JQ1143)
44
+ if (!jQuery.browser.msie) {
45
+ jQuery(wym._doc).find('*').removeAttr('style');
46
+ }
47
+ }
48
+ );
49
+ };
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Copyright (c) 2011 PolicyStat LLC.
3
+ * MIT licensed (MIT-license.txt)
4
+ *
5
+ * This plugin adds the ability to use tab and shift+tab to indent/outdent
6
+ * lists, mimicking a user's expected behavior when inside an editor.
7
+ *
8
+ * @author Wes Winham (winhamwr@gmail.com)
9
+ */
10
+
11
+ function ListPlugin(options, wym) {
12
+ this._options = jQuery.extend({}, options);
13
+ this._wym = wym;
14
+
15
+ this.init();
16
+ }
17
+
18
+ ListPlugin.prototype.init = function() {
19
+ this._wym.listPlugin = this;
20
+
21
+ this.bindEvents();
22
+ };
23
+
24
+ ListPlugin.prototype.bindEvents = function() {
25
+ var listPlugin = this;
26
+ var wym = this._wym;
27
+
28
+ // Bind a key listener so we can handle tabs
29
+ // With jQuery 1.3, live() can be used to simplify handler logic
30
+ $(wym._doc).bind('keydown', listPlugin.handleKeyDown);
31
+ };
32
+
33
+ /**
34
+ * Handle any tab presses when inside list items and indent/outdent.
35
+ */
36
+ ListPlugin.prototype.handleKeyDown = function(evt) {
37
+ //'this' is the editor._doc
38
+ var wym = WYMeditor.INSTANCES[this.title];
39
+ var listPlugin = wym.listPlugin;
40
+
41
+ var container = wym.selected();
42
+ var name = container.tagName.toLowerCase();
43
+ // We only care about tabs when we're inside a list
44
+ if (name != "li") {
45
+ return null;
46
+ }
47
+
48
+ // Handle tab presses
49
+ if (evt.keyCode == WYMeditor.KEY.TAB) {
50
+ if (evt.shiftKey) {
51
+ wym.exec(WYMeditor.OUTDENT);
52
+ return false; // Short-circuit normal tab behavior
53
+ } else {
54
+ wym.exec(WYMeditor.INDENT);
55
+ return false;
56
+ }
57
+ }
58
+
59
+ return null;
60
+ };
@@ -0,0 +1,186 @@
1
+ /*
2
+ * WYMeditor : what you see is What You Mean web-based editor
3
+ * Copyright (c) 2005 - 2011 Jean-Francois Hovinne, http://www.wymeditor.org/
4
+ * Dual licensed under the MIT (MIT-license.txt)
5
+ * and GPL (GPL-license.txt) licenses.
6
+ *
7
+ * For further information visit:
8
+ * http://www.wymeditor.org/
9
+ *
10
+ * File Name:
11
+ * jquery.wymeditor.rdfa.js
12
+ * RDFa plugin for WYMeditor
13
+ *
14
+ * File Authors:
15
+ * Jean-Francois Hovinne (@jfhovinne)
16
+ */
17
+
18
+ //Extend WYMeditor
19
+ WYMeditor.editor.prototype.rdfa = function (options) {
20
+ var rdfa = new WYMeditor.RDFa(options, this);
21
+ return rdfa;
22
+ };
23
+
24
+ //RDFa constructor
25
+ WYMeditor.RDFa = function (options, wym) {
26
+ options = jQuery.extend({
27
+ setStdNameSpaces: true,
28
+ extendXHTMLParser: true,
29
+ buttons: {}
30
+ }, options);
31
+
32
+ this._options = options;
33
+ this._wym = wym;
34
+ this.init();
35
+ };
36
+
37
+ //RDFa plugin init
38
+ WYMeditor.RDFa.prototype.init = function () {
39
+ if (this._options.setStdNameSpaces) {
40
+ this.setStdNameSpaces();
41
+ }
42
+ if (this._options.extendXHTMLParser) {
43
+ this.extendXHTMLParser();
44
+ }
45
+ this.setButtons();
46
+ };
47
+
48
+ //Adding the namespaces to the document
49
+ WYMeditor.RDFa.prototype.setStdNameSpaces = function () {
50
+ this.addNameSpace('xmlns', 'http://www.w3.org/1999/xhtml');
51
+ this.addNameSpace('version', 'XHTML+RDFa 1.0');
52
+ };
53
+
54
+ WYMeditor.RDFa.prototype.addNameSpace = function (attr, value) {
55
+ jQuery('html', this._wym._doc)
56
+ .attr(attr, value);
57
+ };
58
+
59
+ WYMeditor.RDFa.prototype.extendXHTMLParser = function () {
60
+ this.extendAttributes();
61
+ this.setStdVocabularies();
62
+ this.extendLinkAttributes();
63
+ };
64
+
65
+ WYMeditor.RDFa.prototype.extendAttributes = function () {
66
+ //Add the RDFa attributes
67
+ WYMeditor.XhtmlValidator._attributes.core.attributes.push(
68
+ 'rel',
69
+ 'rev',
70
+ 'content',
71
+ 'href',
72
+ 'src',
73
+ 'about',
74
+ 'property',
75
+ 'resource',
76
+ 'datatype',
77
+ 'typeof'
78
+ );
79
+ };
80
+
81
+ WYMeditor.RDFa.prototype.setStdVocabularies = function () {
82
+ var _this = this;
83
+ //Add the 'standard' vocabularies
84
+ vocabularies = [
85
+ 'xmlns:biblio',
86
+ 'xmlns:cc',
87
+ 'xmlns:dbp',
88
+ 'xmlns:dbr',
89
+ 'xmlns:dc',
90
+ 'xmlns:ex',
91
+ 'xmlns:foaf',
92
+ 'xmlns:rdf',
93
+ 'xmlns:rdfs',
94
+ 'xmlns:taxo',
95
+ 'xmlns:xhv',
96
+ 'xmlns:xsd'
97
+ ];
98
+ jQuery.each(vocabularies, function (index, vocabulary) {
99
+ _this.addVocabulary(vocabulary);
100
+ });
101
+ };
102
+
103
+ WYMeditor.RDFa.prototype.addVocabulary = function (vocabulary) {
104
+ WYMeditor.XhtmlValidator._attributes.core.attributes.push(vocabulary);
105
+ };
106
+
107
+ WYMeditor.RDFa.prototype.extendLinkAttributes = function () {
108
+ //Overwrite the <a> attributes 'rel' and 'rev'
109
+ WYMeditor.XhtmlValidator._tags.a = {
110
+ "attributes": {
111
+ "0": "charset",
112
+ "1": "coords",
113
+ "2": "href",
114
+ "3": "hreflang",
115
+ "4": "name",
116
+ "5": "rel",
117
+ "6": "rev",
118
+ "shape": /^(rect|rectangle|circ|circle|poly|polygon)$/,
119
+ "7": "type"
120
+ }
121
+ };
122
+ };
123
+
124
+ WYMeditor.RDFa.prototype.setButtons = function () {
125
+ var _this = this,
126
+ list = jQuery(this._wym._box).find('div.wym_classes ul');
127
+ jQuery.each(this._options.buttons, function (index, button) {
128
+ list
129
+ .append('<li></li>')
130
+ .children(':last')
131
+ .append('<a></a>')
132
+ .children(':last')
133
+ .attr('href', '#')
134
+ .text(button.title)
135
+ .bind('click',
136
+ {
137
+ instance: _this._wym,
138
+ button: button,
139
+ ns: button.ns,
140
+ attr: button.attr,
141
+ value: button.value
142
+ },
143
+ _this.clickButtonHandler);
144
+ });
145
+ };
146
+
147
+ WYMeditor.RDFa.prototype.clickButtonHandler = function (evt) {
148
+ var wym = evt.data.instance,
149
+ selected = wym.selected();
150
+
151
+ //the attribute already exists, remove it
152
+ if (typeof jQuery(selected).attr(evt.data.attr) !== 'undefined' &&
153
+ jQuery(selected).attr(evt.data.attr) !== '') {
154
+ WYMeditor.console.log(
155
+ 'attribute already exists, remove it:',
156
+ evt.data.attr,
157
+ jQuery(selected).attr(evt.data.attr)
158
+ );
159
+ jQuery(selected)
160
+ .removeAttr(evt.data.attr)
161
+ .removeClass(evt.data.ns)
162
+ .removeClass(evt.data.attr)
163
+ .removeClass(evt.data.value);
164
+
165
+ //else, add it
166
+ } else {
167
+ WYMeditor.console.log('attribute does not exist, add it:', evt.data.attr, evt.data.value);
168
+ if (evt.data.value) { //value available
169
+ jQuery(selected)
170
+ .attr(evt.data.attr, evt.data.ns + ':' + evt.data.value)
171
+ .addClass(evt.data.ns)
172
+ .addClass(evt.data.attr)
173
+ .addClass(evt.data.value);
174
+ } else { //value not available
175
+ evt.data.value = prompt('Value', '');
176
+ if (evt.data.value !== null) {
177
+ jQuery(selected)
178
+ .attr(evt.data.attr, evt.data.value)
179
+ .addClass(evt.data.ns)
180
+ .addClass(evt.data.attr)
181
+ .addClass(evt.data.value);
182
+ }
183
+ }
184
+ }
185
+ return false;
186
+ };
@@ -0,0 +1,77 @@
1
+ /*
2
+ * WYMeditor : what you see is What You Mean web-based editor
3
+ * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/
4
+ * Dual licensed under the MIT (MIT-license.txt)
5
+ * and GPL (GPL-license.txt) licenses.
6
+ *
7
+ * For further information visit:
8
+ * http://www.wymeditor.org/
9
+ *
10
+ * File Name:
11
+ * jquery.wymeditor.resizable.js
12
+ * resize plugin for WYMeditor
13
+ *
14
+ * File Authors:
15
+ * Peter Eschler (peschler _at_ gmail.com)
16
+ * Jean-Francois Hovinne - http://www.hovinne.com/
17
+ *
18
+ * Version:
19
+ * 0.4
20
+ *
21
+ * Changelog:
22
+ *
23
+ * 0.4
24
+ * - Removed UI and UI.resizable scripts loading - see #167 (jfh).
25
+ *
26
+ * 0.3
27
+ * - Added 'iframeOriginalSize' and removed 'ui.instance' calls (jfh).
28
+ *
29
+ * 0.2
30
+ * - Added full support for all jQueryUI resizable plugin options.
31
+ * - Refactored and documented code.
32
+ * 0.1
33
+ * - Initial release.
34
+ */
35
+
36
+ /**
37
+ * The resizable plugin makes the wymeditor box vertically resizable.
38
+ * It it based on the ui.resizable.js plugin of the jQuery UI library.
39
+ *
40
+ * The WYMeditor resizable plugin supports all parameters of the jQueryUI
41
+ * resizable plugin. The parameters are passed like this:
42
+ *
43
+ * wym.resizable({ handles: "s,e",
44
+ * maxHeight: 600 });
45
+ *
46
+ * DEPENDENCIES: jQuery UI, jQuery UI resizable
47
+ *
48
+ * @param options options for the plugin
49
+ */
50
+ WYMeditor.editor.prototype.resizable = function(options) {
51
+
52
+ var wym = this;
53
+ var $iframe = jQuery(wym._box).find('iframe');
54
+ var $iframe_div = jQuery(wym._box).find('.wym_iframe');
55
+ var iframeOriginalSize = {};
56
+
57
+ // Define some default options
58
+ var default_options = {
59
+ resize: function() {
60
+ $iframe_div.height($iframe.height());
61
+ },
62
+ alsoResize: $iframe,
63
+ handles: "s,e,se",
64
+ minHeight: 250
65
+ };
66
+
67
+ // Merge given options with default options. Given options override
68
+ // default ones.
69
+ var final_options = jQuery.extend(default_options, options);
70
+
71
+ if (jQuery.isFunction(jQuery.fn.resizable)) {
72
+ jQuery(wym._box).resizable(final_options);
73
+ } else {
74
+ WYMeditor.console.error('Oops, jQuery UI.resizable unavailable.');
75
+ }
76
+
77
+ };