Permalink
Browse files

remove yui partial.

  • Loading branch information...
1 parent d4fc715 commit 530281e1715d2be3008cf5e6ee194dabd3ede012 @peterberkenbosch peterberkenbosch committed Feb 21, 2012
Showing with 0 additions and 221 deletions.
  1. +0 −221 app/views/shared/editor_engines/_yui_rich_editor.html.erb
@@ -1,221 +0,0 @@
-
-<!-- Skin CSS file -->
-
-<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/editor/assets/skins/sam/editor.css"/>
-<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/menu/assets/skins/sam/menu.css"/>
-<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/button/assets/skins/sam/button.css"/>
-<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/container/assets/skins/sam/container.css"/>
-<%= stylesheet_link_tag 'admin/spree_editor' %>
-
-<!-- Utility Dependencies -->
-<script src="http://yui.yahooapis.com/2.8.2r1/build/yahoo-dom-event/yahoo-dom-event.js"></script>
-<script src="http://yui.yahooapis.com/2.8.2r1/build/element/element-min.js"></script>
-<!-- Needed for Menus, Buttons and Overlays used in the Toolbar -->
-<script src="http://yui.yahooapis.com/2.8.2r1/build/container/container_core-min.js"></script>
-<script src="http://yui.yahooapis.com/2.8.2r1/build/menu/menu-min.js"></script>
-<script src="http://yui.yahooapis.com/2.8.2r1/build/button/button-min.js"></script>
-<!-- Source file for Rich Text Editor-->
-<script src="http://yui.yahooapis.com/2.8.2r1/build/editor/editor-min.js"></script>
-
-<%= javascript_include_tag 'admin/jquery.ocupload' %>
-
-<script type="text/javascript">
- $(function() {
- var Dom = YAHOO.util.Dom,
- Event = YAHOO.util.Event;
- var myConfig = { dompath: true };
- var ids = [<%= ids.map{|id| "'#{id}'"}.join(', ') %>];
- $.each(ids, function(index, id) {
- if ($('textarea#' + id).length) {
- var state = 'off';
- var newEditor = window[id + '_editor'] = new YAHOO.widget.Editor(id, {
- height: '350px',
- width: 'auto',
- animate: true,
- handleSubmit: true,
- toolbar: {
- collapse: true,
- titlebar: false,
- draggable: false,
- buttonType: 'advanced',
- buttons: [
- { group: 'fontstyle', label: '<%= t("editor.font_name_and_size") %>',
- buttons: [
- { type: 'select', label: 'Arial', value: 'fontname', disabled: true,
- menu: [
- { text: 'Arial', checked: true },
- { text: 'Arial Black' },
- { text: 'Comic Sans MS' },
- { text: 'Courier New' },
- { text: 'Lucida Console' },
- { text: 'Tahoma' },
- { text: 'Times New Roman' },
- { text: 'Trebuchet MS' },
- { text: 'Verdana' }
- ]
- },
- { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true }
- ]
- },
- { type: 'separator' },
- { group: 'textstyle', label: '<%= t("editor.font_style") %> ',
- buttons: [
- { type: 'push', label: '<%= t("editor.bold") %> CTRL + SHIFT + B', value: 'bold' },
- { type: 'push', label: '<%= t("editor.italic") %> CTRL + SHIFT + I', value: 'italic' },
- { type: 'push', label: '<%= t("editor.underline") %> CTRL + SHIFT + U', value: 'underline' },
- { type: 'separator' },
- { type: 'push', label: '<%= t("editor.subscript") %>', value: 'subscript', disabled: true },
- { type: 'push', label: '<%= t("editor.superscript") %>', value: 'superscript', disabled: true },
- { type: 'separator' },
- { type: 'color', label: '<%= t("editor.font_color") %>', value: 'forecolor', disabled: true },
- { type: 'color', label: '<%= t("editor.background_color") %>', value: 'backcolor', disabled: true },
- { type: 'separator' },
- { type: 'push', label: '<%= t("editor.remove_formatting") %>', value: 'removeformat', disabled: true },
- { type: 'push', label: '<%= t("editor.show_and_hide_hidden_elements") %>', value: 'hiddenelements' }
- ]
- },
- { type: 'separator' },
- { group: 'alignment', label: '<%= t("editor.alignment") %>',
- buttons: [
- { type: 'push', label: '<%= t("editor.align_left") %> CTRL + SHIFT + [', value: 'justifyleft' },
- { type: 'push', label: '<%= t("editor.align_center") %> CTRL + SHIFT + |', value: 'justifycenter' },
- { type: 'push', label: '<%= t("editor.align_right") %> CTRL + SHIFT + ]', value: 'justifyright' },
- { type: 'push', label: '<%= t("editor.justify") %>', value: 'justifyfull' }
- ]
- },
- { type: 'separator' },
- { group: 'parastyle', label: '<%= t("editor.paragraph_style") %>',
- buttons: [
- { type: 'select', label: '<%= t("editor.normal") %>', value: 'heading', disabled: true,
- menu: [
- { text: '<%= t("editor.normal") %>', value: 'none', checked: true },
- { text: '<%= t("editor.header") %> 1', value: 'h1' },
- { text: '<%= t("editor.header") %> 2', value: 'h2' },
- { text: '<%= t("editor.header") %> 3', value: 'h3' },
- { text: '<%= t("editor.header") %> 4', value: 'h4' },
- { text: '<%= t("editor.header") %> 5', value: 'h5' },
- { text: '<%= t("editor.header") %> 6', value: 'h6' }
- ]
- }
- ]
- },
- { type: 'separator' },
- { group: 'indentlist', label: '<%= t("editor.indenting_and_lists") %>',
- buttons: [
- { type: 'push', label: '<%= t("editor.indent") %>', value: 'indent', disabled: true },
- { type: 'push', label: '<%= t("editor.outdent") %>', value: 'outdent', disabled: true },
- { type: 'push', label: '<%= t("editor.create_an_unordered_list") %>', value: 'insertunorderedlist' },
- { type: 'push', label: '<%= t("editor.create_an_ordered_list") %>', value: 'insertorderedlist' }
- ]
- },
- { type: 'separator' },
- { group: 'insertitem', label: '<%= t("editor.insert_item") %>',
- buttons: [
- { type: 'push', label: '<%= t("editor.html_link") %> CTRL + SHIFT + L', value: 'createlink', disabled: true },
- { type: 'push', label: '<%= t("editor.insert_image") %>', value: 'insertimage' },
- { type: 'push', label: '<%= t("editor.edit_html_code") %>', value: 'editcode' }
- ]
- },
- { type: 'separator' },
- { group: 'uploaditem', label: '<%= t("editor.upload") %>',
- buttons: [
- { type: 'push', label: '<%= t("editor.upload_image") %>', value: 'imageUpload' },
- { type: 'push', label: '<%= t("editor.upload_file") %>', value: 'fileUpload' }
- ]
- }
-
- ]
- }
- });
-
- newEditor.addListener('editorContentLoaded', function() {
- $(".yui-toolbar-imageUpload").upload({
- name: 'content_image[attachment]',
- action: '/content_images',
- enctype: 'multipart/form-data',
- //params: {'content_image[viewable_type]': '<%# object.class.name %>', 'content_image[viewable_id]': '<%# object.id %>'},
- autoSubmit: true,
- onSubmit: function() {
- $(".editor-mask-container").addClass("active");
- },
- onComplete: function(image_src) {
- var img_html = "<img src='" + image_src + "'/>";
- newEditor.execCommand('inserthtml', img_html);
- $(".editor-mask-container").removeClass("active");
- }
- });
-
- $(".yui-toolbar-fileUpload").upload({
- name: 'content_file[attachment]',
- action: '/content_files',
- enctype: 'multipart/form-data',
- //params: {'content_file[viewable_type]': '<%# object.class.name %>', 'content_file[viewable_id]': '<%# @object.id %>'},
- autoSubmit: true,
- onSubmit: function() {
- $(".editor-mask-container").addClass("active");
- },
- onComplete: function(file_url_and_name) {
- var file_url = file_url_and_name.split(",")[0];
- var file_name_original = file_url_and_name.split(",")[1];
- $(".editor-mask-container").removeClass("active");
- var file_name = prompt('<%= t("editor.enter_file_name") %>', file_name_original);
- var link_html = "<a href='" + file_url + "'/>" + file_name + "</a>";
- newEditor.execCommand('inserthtml', link_html);
- }
- });
- });
-
-
- newEditor.on('toolbarLoaded', function() {
- this.toolbar.on('editcodeClick', function() {
- var ta = this.get('element'),
- iframe = this.get('iframe').get('element');
-
- if (state == 'on') {
- state = 'off';
- this.toolbar.set('disabled', false);
- this.setEditorHTML(ta.value);
- if (!this.browser.ie) {
- this._setDesignMode('on');
- }
-
- Dom.removeClass(iframe, 'editor-hidden');
- Dom.addClass(ta, 'editor-hidden');
- this.show();
- this._focusWindow();
- } else {
- state = 'on';
- this.cleanHTML();
- Dom.addClass(iframe, 'editor-hidden');
- Dom.removeClass(ta, 'editor-hidden');
- this.toolbar.set('disabled', true);
- this.toolbar.getButtonByValue('editcode').set('disabled', false);
- this.toolbar.selectButton('editcode');
- this.dompath.innerHTML = 'Editing HTML Code';
- this.hide();
- }
- return false;
- }, this, true);
-
- this.on('cleanHTML', function(ev) {
- this.get('element').value = ev.html;
- }, this, true);
-
- this.on('afterRender', function() {
- var wrapper = this.get('editor_wrapper');
- wrapper.appendChild(this.get('element'));
- this.setStyle('width', '100%');
- this.setStyle('height', '100%');
- this.setStyle('visibility', '');
- this.setStyle('top', '');
- this.setStyle('left', '');
- this.setStyle('position', '');
-
- this.addClass('editor-hidden');
- }, this, true);
- }, newEditor, true);
- newEditor.render();
- }
- });
- });
-</script>

0 comments on commit 530281e

Please sign in to comment.