diff --git a/app/assets/javascripts/admin/fr.js b/app/assets/javascripts/admin/fr.js
new file mode 100644
index 0000000..6e6cf56
--- /dev/null
+++ b/app/assets/javascripts/admin/fr.js
@@ -0,0 +1,68 @@
+var RELANG = {};
+RELANG['fr'] = {
+ html: 'Code HTML',
+ video: 'Insérer une vidéo...',
+ image: 'Insérer une image...',
+ table: 'Tableau',
+ link: 'Lien',
+ link_insert: 'Insérer un lien...',
+ unlink: 'Supprimer le lien',
+ formatting: 'Styles',
+ paragraph: 'Paragraphe',
+ quote: 'Citation',
+ code: 'Code',
+ header1: 'Titre 1',
+ header2: 'Titre 2',
+ header3: 'Titre 3',
+ header4: 'Titre 4',
+ bold: 'Gras',
+ italic: 'Italique',
+ fontcolor: 'Couleur du texte',
+ backcolor: 'Couleur d\'arrière plan du texte',
+ unorderedlist: 'Liste à puces',
+ orderedlist: 'Liste numérotée',
+ outdent: 'Diminuer le trait',
+ indent: 'Augmenter le trait',
+ cancel: 'Annuler',
+ insert: 'Insérer',
+ save: 'Sauvegarder',
+ _delete: 'Supprimer',
+ insert_table: 'Insérer un tableau...',
+ insert_row_above: 'Ajouter une rangée au-dessus',
+ insert_row_below: 'Ajouter une rangée en-dessous',
+ insert_column_left: 'Ajouter une colonne à gauche',
+ insert_column_right: 'Ajouter une colonne à droite',
+ delete_column: 'Supprimer la colonne',
+ delete_row: 'Supprimer la rangée',
+ delete_table: 'Supprimer le tableau',
+ rows: 'Rangées',
+ columns: 'Colonnes',
+ add_head: 'Ajouter un en-tête',
+ delete_head: 'Supprimer l\'en-tête',
+ title: 'Titre',
+ image_position: 'Position',
+ none: 'Aucun',
+ left: 'Gauche',
+ right: 'Droite',
+ image_web_link: 'Adresse URL de l\'image',
+ text: 'Texte',
+ mailto: 'Courriel',
+ web: 'Adresse URL',
+ video_html_code: 'Code d\'intégration du vidéo',
+ file: 'Insérer un fichier...',
+ upload: 'Téléverser',
+ download: 'Télécharger',
+ choose: 'Choisir',
+ or_choose: 'Ou choisissez',
+ drop_file_here: 'Déposez le fichier ici',
+ align_left: 'Aligner à gauche',
+ align_center: 'Aligner au centre',
+ align_right: 'Aligner à droite',
+ align_justify: 'Justifier',
+ horizontalrule: 'Insérer une ligne horizontale',
+ deleted: 'Supprimé',
+ anchor: 'Ancre',
+ link_new_tab: 'Ouvrir le lien dans un nouvel onglet',
+ underline: 'Underline',
+ alignment: 'Alignment'
+};
\ No newline at end of file
diff --git a/app/assets/javascripts/admin/pages_actions.js.coffee b/app/assets/javascripts/admin/pages_actions.js.coffee
index 4ab0179..209682f 100644
--- a/app/assets/javascripts/admin/pages_actions.js.coffee
+++ b/app/assets/javascripts/admin/pages_actions.js.coffee
@@ -8,7 +8,7 @@ $('.menu_item_row .show_details').live "click", ->
$("#menu_item_detail").show().delay(1).css
"-webkit-transition-duration": "0.8s"
- "-webkit-transform": "scale(1)"
+
"-moz-transition-duration": "0.8s"
"margin-right": "0px"
@@ -32,7 +32,7 @@ $('#menu_item_detail .hide').live "click", ->
$("#menu_item_detail").css(
"-webkit-transition-duration": "0.8s"
- "-webkit-transform": "scale(0.2)"
+
"-moz-transition-duration": "0.8s"
"margin-right": "-110%").delay(800).queue ->
$("#menu_item_detail").html("").clearQueue()
diff --git a/app/assets/javascripts/admin/redactor.js b/app/assets/javascripts/admin/redactor.js
new file mode 100755
index 0000000..08b8ccf
--- /dev/null
+++ b/app/assets/javascripts/admin/redactor.js
@@ -0,0 +1,4210 @@
+/*
+ Redactor v8.2.2
+ Updated: January 17, 2013
+
+ http://redactorjs.com/
+
+ Copyright (c) 2009-2013, Imperavi Inc.
+ License: http://redactorjs.com/license/
+
+ Usage: $('#content').redactor();
+*/
+
+var rwindow, rdocument;
+
+if (typeof RELANG === 'undefined')
+{
+ var RELANG = {};
+}
+
+var RLANG = {
+ html: 'HTML',
+ video: 'Insert Video',
+ image: 'Insert Image',
+ table: 'Table',
+ link: 'Link',
+ link_insert: 'Insert link',
+ unlink: 'Unlink',
+ formatting: 'Formatting',
+ paragraph: 'Paragraph',
+ quote: 'Quote',
+ code: 'Code',
+ header1: 'Header 1',
+ header2: 'Header 2',
+ header3: 'Header 3',
+ header4: 'Header 4',
+ bold: 'Bold',
+ italic: 'Italic',
+ fontcolor: 'Font Color',
+ backcolor: 'Back Color',
+ unorderedlist: 'Unordered List',
+ orderedlist: 'Ordered List',
+ outdent: 'Outdent',
+ indent: 'Indent',
+ cancel: 'Cancel',
+ insert: 'Insert',
+ save: 'Save',
+ _delete: 'Delete',
+ insert_table: 'Insert Table',
+ insert_row_above: 'Add Row Above',
+ insert_row_below: 'Add Row Below',
+ insert_column_left: 'Add Column Left',
+ insert_column_right: 'Add Column Right',
+ delete_column: 'Delete Column',
+ delete_row: 'Delete Row',
+ delete_table: 'Delete Table',
+ rows: 'Rows',
+ columns: 'Columns',
+ add_head: 'Add Head',
+ delete_head: 'Delete Head',
+ title: 'Title',
+ image_position: 'Position',
+ none: 'None',
+ left: 'Left',
+ right: 'Right',
+ image_web_link: 'Image Web Link',
+ text: 'Text',
+ mailto: 'Email',
+ web: 'URL',
+ video_html_code: 'Video Embed Code',
+ file: 'Insert File',
+ upload: 'Upload',
+ download: 'Download',
+ choose: 'Choose',
+ or_choose: 'Or choose',
+ drop_file_here: 'Drop file here',
+ align_left: 'Align text to the left',
+ align_center: 'Center text',
+ align_right: 'Align text to the right',
+ align_justify: 'Justify text',
+ horizontalrule: 'Insert Horizontal Rule',
+ deleted: 'Deleted',
+ anchor: 'Anchor',
+ link_new_tab: 'Open link in new tab',
+ underline: 'Underline',
+ alignment: 'Alignment'
+};
+
+(function($){
+
+ // Plugin
+ jQuery.fn.redactor = function(option)
+ {
+ return this.each(function()
+ {
+ var $obj = $(this);
+
+ var data = $obj.data('redactor');
+ if (!data)
+ {
+ $obj.data('redactor', (data = new Redactor(this, option)));
+ }
+ });
+ };
+
+
+ // Initialization
+ var Redactor = function(element, options)
+ {
+ // Element
+ this.$el = $(element);
+
+ // Lang
+ if (typeof options !== 'undefined' && typeof options.lang !== 'undefined' && options.lang !== 'en' && typeof RELANG[options.lang] !== 'undefined')
+ {
+ RLANG = RELANG[options.lang];
+ }
+
+ // Options
+ this.opts = $.extend({
+
+ iframe: false,
+ css: false, // url
+
+ lang: 'en',
+ direction: 'ltr', // ltr or rtl
+
+ callback: false, // function
+ keyupCallback: false, // function
+ keydownCallback: false, // function
+ execCommandCallback: false, // function
+
+ plugins: false,
+ cleanup: true,
+
+ focus: false,
+ tabindex: false,
+ autoresize: true,
+ minHeight: false,
+ fixed: false,
+ fixedTop: 0, // pixels
+ fixedBox: false,
+ source: true,
+ shortcuts: true,
+
+ mobile: true,
+ air: false, // true or toolbar
+ wym: false,
+
+ convertLinks: true,
+ convertDivs: true,
+ protocol: 'http://', // for links http or https or ftp or false
+
+ autosave: false, // false or url
+ autosaveCallback: false, // function
+ interval: 60, // seconds
+
+ imageGetJson: false, // url (ex. /folder/images.json ) or false
+
+ imageUpload: false, // url
+ imageUploadCallback: false, // function
+ imageUploadErrorCallback: false, // function
+
+ fileUpload: false, // url
+ fileUploadCallback: false, // function
+ fileUploadErrorCallback: false, // function
+
+ uploadCrossDomain: false,
+ uploadFields: false,
+
+ observeImages: true,
+ overlay: true, // modal overlay
+
+ allowedTags: ["form", "input", "button", "select", "option", "datalist", "output", "textarea", "fieldset", "legend",
+ "section", "header", "hgroup", "aside", "footer", "article", "details", "nav", "progress", "time", "canvas",
+ "code", "span", "div", "label", "a", "br", "p", "b", "i", "del", "strike", "u",
+ "img", "video", "source", "track", "audio", "iframe", "object", "embed", "param", "blockquote",
+ "mark", "cite", "small", "ul", "ol", "li", "hr", "dl", "dt", "dd", "sup", "sub",
+ "big", "pre", "code", "figure", "figcaption", "strong", "em", "table", "tr", "td",
+ "th", "tbody", "thead", "tfoot", "h1", "h2", "h3", "h4", "h5", "h6"],
+
+ toolbarExternal: false, // ID selector
+
+ buttonsCustom: {},
+ buttonsAdd: [],
+ buttons: ['html', '|', 'formatting', '|', 'bold', 'italic', 'deleted', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|',
+ 'image', 'video', 'file', 'table', 'link', '|',
+ 'fontcolor', 'backcolor', '|', 'alignment', '|', 'horizontalrule'], // 'underline', 'alignleft', 'aligncenter', 'alignright', 'justify'
+
+ airButtons: ['formatting', '|', 'bold', 'italic', 'deleted', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'fontcolor', 'backcolor'],
+
+ formattingTags: ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4'],
+
+ activeButtons: ['deleted', 'italic', 'bold', 'underline', 'unorderedlist', 'orderedlist'], // 'alignleft', 'aligncenter', 'alignright', 'justify'
+ activeButtonsStates: {
+ b: 'bold',
+ strong: 'bold',
+ i: 'italic',
+ em: 'italic',
+ del: 'deleted',
+ strike: 'deleted',
+ ul: 'unorderedlist',
+ ol: 'orderedlist',
+ u: 'underline'
+ },
+
+ colors: [
+ '#ffffff', '#000000', '#eeece1', '#1f497d', '#4f81bd', '#c0504d', '#9bbb59', '#8064a2', '#4bacc6', '#f79646', '#ffff00',
+ '#f2f2f2', '#7f7f7f', '#ddd9c3', '#c6d9f0', '#dbe5f1', '#f2dcdb', '#ebf1dd', '#e5e0ec', '#dbeef3', '#fdeada', '#fff2ca',
+ '#d8d8d8', '#595959', '#c4bd97', '#8db3e2', '#b8cce4', '#e5b9b7', '#d7e3bc', '#ccc1d9', '#b7dde8', '#fbd5b5', '#ffe694',
+ '#bfbfbf', '#3f3f3f', '#938953', '#548dd4', '#95b3d7', '#d99694', '#c3d69b', '#b2a2c7', '#b7dde8', '#fac08f', '#f2c314',
+ '#a5a5a5', '#262626', '#494429', '#17365d', '#366092', '#953734', '#76923c', '#5f497a', '#92cddc', '#e36c09', '#c09100',
+ '#7f7f7f', '#0c0c0c', '#1d1b10', '#0f243e', '#244061', '#632423', '#4f6128', '#3f3151', '#31859b', '#974806', '#7f6000'],
+
+ // private
+ emptyHtml: '
',
+ buffer: false,
+ visual: true,
+
+ // modal windows container
+ modal_file: String() +
+ '',
+
+ modal_image_edit: String() +
+ '' +
+ '' + RLANG.title + ' ' +
+ ' ' +
+ '' + RLANG.link + ' ' +
+ ' ' +
+ '' + RLANG.image_position + ' ' +
+ '' +
+ '' + RLANG.none + ' ' +
+ '' + RLANG.left + ' ' +
+ '' + RLANG.right + ' ' +
+ ' ' +
+ '
' +
+ '',
+
+ modal_image: String() +
+ '' +
+ '
' +
+ '
' +
+ '
' +
+ '' + RLANG.image_web_link + ' ' +
+ ' ' +
+ '
' +
+ '
' +
+ '',
+
+ modal_link: String() +
+ '' +
+ '',
+
+ modal_table: String() +
+ '' +
+ '' + RLANG.rows + ' ' +
+ ' ' +
+ '' + RLANG.columns + ' ' +
+ ' ' +
+ '
' +
+ '',
+
+ modal_video: String() +
+ '' +
+ '' +
+ '
'+
+ '',
+
+ toolbar: {
+ html:
+ {
+ title: RLANG.html,
+ func: 'toggle'
+ },
+ formatting:
+ {
+ title: RLANG.formatting,
+ func: 'show',
+ dropdown:
+ {
+ p:
+ {
+ title: RLANG.paragraph,
+ exec: 'formatblock'
+ },
+ blockquote:
+ {
+ title: RLANG.quote,
+ exec: 'formatblock',
+ className: 'redactor_format_blockquote'
+ },
+ pre:
+ {
+ title: RLANG.code,
+ exec: 'formatblock',
+ className: 'redactor_format_pre'
+ },
+ h1:
+ {
+ title: RLANG.header1,
+ exec: 'formatblock',
+ className: 'redactor_format_h1'
+ },
+ h2:
+ {
+ title: RLANG.header2,
+ exec: 'formatblock',
+ className: 'redactor_format_h2'
+ },
+ h3:
+ {
+ title: RLANG.header3,
+ exec: 'formatblock',
+ className: 'redactor_format_h3'
+ },
+ h4:
+ {
+ title: RLANG.header4,
+ exec: 'formatblock',
+ className: 'redactor_format_h4'
+ }
+ }
+ },
+ bold:
+ {
+ title: RLANG.bold,
+ exec: 'bold'
+ },
+ italic:
+ {
+ title: RLANG.italic,
+ exec: 'italic'
+ },
+ deleted:
+ {
+ title: RLANG.deleted,
+ exec: 'strikethrough'
+ },
+ underline:
+ {
+ title: RLANG.underline,
+ exec: 'underline'
+ },
+ unorderedlist:
+ {
+ title: '• ' + RLANG.unorderedlist,
+ exec: 'insertunorderedlist'
+ },
+ orderedlist:
+ {
+ title: '1. ' + RLANG.orderedlist,
+ exec: 'insertorderedlist'
+ },
+ outdent:
+ {
+ title: '< ' + RLANG.outdent,
+ exec: 'outdent'
+ },
+ indent:
+ {
+ title: '> ' + RLANG.indent,
+ exec: 'indent'
+ },
+ image:
+ {
+ title: RLANG.image,
+ func: 'showImage'
+ },
+ video:
+ {
+ title: RLANG.video,
+ func: 'showVideo'
+ },
+ file:
+ {
+ title: RLANG.file,
+ func: 'showFile'
+ },
+ table:
+ {
+ title: RLANG.table,
+ func: 'show',
+ dropdown:
+ {
+ insert_table:
+ {
+ title: RLANG.insert_table,
+ func: 'showTable'
+ },
+ separator_drop1:
+ {
+ name: 'separator'
+ },
+ insert_row_above:
+ {
+ title: RLANG.insert_row_above,
+ func: 'insertRowAbove'
+ },
+ insert_row_below:
+ {
+ title: RLANG.insert_row_below,
+ func: 'insertRowBelow'
+ },
+ insert_column_left:
+ {
+ title: RLANG.insert_column_left,
+ func: 'insertColumnLeft'
+ },
+ insert_column_right:
+ {
+ title: RLANG.insert_column_right,
+ func: 'insertColumnRight'
+ },
+ separator_drop2:
+ {
+ name: 'separator'
+ },
+ add_head:
+ {
+ title: RLANG.add_head,
+ func: 'addHead'
+ },
+ delete_head:
+ {
+ title: RLANG.delete_head,
+ func: 'deleteHead'
+ },
+ separator_drop3:
+ {
+ name: 'separator'
+ },
+ delete_column:
+ {
+ title: RLANG.delete_column,
+ func: 'deleteColumn'
+ },
+ delete_row:
+ {
+ title: RLANG.delete_row,
+ func: 'deleteRow'
+ },
+ delete_table:
+ {
+ title: RLANG.delete_table,
+ func: 'deleteTable'
+ }
+ }
+ },
+ link:
+ {
+ title: RLANG.link,
+ func: 'show',
+ dropdown:
+ {
+ link:
+ {
+ title: RLANG.link_insert,
+ func: 'showLink'
+ },
+ unlink:
+ {
+ title: RLANG.unlink,
+ exec: 'unlink'
+ }
+ }
+ },
+ fontcolor:
+ {
+ title: RLANG.fontcolor,
+ func: 'show'
+ },
+ backcolor:
+ {
+ title: RLANG.backcolor,
+ func: 'show'
+ },
+ alignment:
+ {
+ title: RLANG.alignment,
+ func: 'show',
+ dropdown:
+ {
+ alignleft:
+ {
+ title: RLANG.align_left,
+ exec: 'JustifyLeft'
+ },
+ aligncenter:
+ {
+ title: RLANG.align_center,
+ exec: 'JustifyCenter'
+ },
+ alignright:
+ {
+ title: RLANG.align_right,
+ exec: 'JustifyRight'
+ },
+ justify:
+ {
+ title: RLANG.align_justify,
+ exec: 'JustifyFull'
+ }
+ }
+ },
+ alignleft:
+ {
+ exec: 'JustifyLeft',
+ title: RLANG.align_left
+ },
+ aligncenter:
+ {
+ exec: 'JustifyCenter',
+ title: RLANG.align_center
+ },
+ alignright:
+ {
+ exec: 'JustifyRight',
+ title: RLANG.align_right
+ },
+ justify:
+ {
+ exec: 'JustifyFull',
+ title: RLANG.align_justify
+ },
+ horizontalrule:
+ {
+ exec: 'inserthorizontalrule',
+ title: RLANG.horizontalrule
+ }
+ }
+
+
+ }, options, this.$el.data());
+
+ this.dropdowns = [];
+
+ // Init
+ this.init();
+ };
+
+ // Functionality
+ Redactor.prototype = {
+
+
+ // Initialization
+ init: function()
+ {
+ // get dimensions
+ this.height = this.$el.css('height');
+ this.width = this.$el.css('width');
+
+ rdocument = this.document = document;
+ rwindow = this.window = window;
+
+ // mobile
+ if (this.opts.mobile === false && this.isMobile())
+ {
+ this.build(true);
+ return false;
+ }
+
+ // iframe
+ if (this.opts.iframe)
+ {
+ this.opts.autoresize = false;
+ }
+
+ // extend buttons
+ if (this.opts.air)
+ {
+ this.opts.buttons = this.opts.airButtons;
+ }
+ else if (this.opts.toolbar !== false)
+ {
+ if (this.opts.source === false)
+ {
+ var index = this.opts.buttons.indexOf('html');
+ var next = this.opts.buttons[index+1];
+ this.opts.buttons.splice(index, 1);
+ if (typeof next !== 'undefined' && next === '|')
+ {
+ this.opts.buttons.splice(index, 1);
+ }
+ }
+
+ $.extend(this.opts.toolbar, this.opts.buttonsCustom);
+ $.each(this.opts.buttonsAdd, $.proxy(function(i,s)
+ {
+ this.opts.buttons.push(s);
+
+ }, this));
+ }
+
+ // formatting tags
+ if (this.opts.toolbar !== false)
+ {
+ $.each(this.opts.toolbar.formatting.dropdown, $.proxy(function(i,s)
+ {
+ if ($.inArray(i, this.opts.formattingTags) == '-1')
+ {
+ delete this.opts.toolbar.formatting.dropdown[i];
+ }
+
+ }, this));
+ }
+
+ function afterBuild()
+ {
+ // air enable
+ this.enableAir();
+
+ // toolbar
+ this.buildToolbar();
+
+ // PLUGINS
+ if (typeof this.opts.plugins === 'object')
+ {
+ $.each(this.opts.plugins, $.proxy(function(i,s)
+ {
+ if (typeof RedactorPlugins[s] !== 'undefined')
+ {
+ $.extend(this, RedactorPlugins[s]);
+
+ if (typeof RedactorPlugins[s].init !== 'undefined')
+ {
+ this.init();
+ }
+ }
+
+ }, this));
+ }
+
+ // buttons response
+ if (this.opts.activeButtons !== false && this.opts.toolbar !== false)
+ {
+ var observeFormatting = $.proxy(function() { this.observeFormatting(); }, this);
+ this.$editor.click(observeFormatting).keyup(observeFormatting);
+ }
+
+ // paste
+ var oldsafari = false;
+ if (this.browser('webkit') && navigator.userAgent.indexOf('Chrome') === -1)
+ {
+ var arr = this.browser('version').split('.');
+ if (arr[0] < 536) oldsafari = true;
+ }
+
+ if (this.isMobile(true) === false && oldsafari === false)
+ {
+ this.$editor.bind('paste', $.proxy(function(e)
+ {
+ if (this.opts.cleanup === false)
+ {
+ return true;
+ }
+
+ this.pasteRunning = true;
+
+ this.setBuffer();
+
+ if (this.opts.autoresize === true)
+ {
+ this.saveScroll = this.document.body.scrollTop;
+ }
+ else
+ {
+ this.saveScroll = this.$editor.scrollTop();
+ }
+
+ var frag = this.extractContent();
+
+ setTimeout($.proxy(function()
+ {
+ var pastedFrag = this.extractContent();
+ this.$editor.append(frag);
+
+ this.restoreSelection();
+
+ var html = this.getFragmentHtml(pastedFrag);
+ this.pasteCleanUp(html);
+ this.pasteRunning = false;
+
+ }, this), 1);
+
+ }, this));
+ }
+
+ // key handlers
+ this.keyup();
+ this.keydown();
+
+ // autosave
+ if (this.opts.autosave !== false)
+ {
+ this.autoSave();
+ }
+
+ // observers
+ setTimeout($.proxy(function()
+ {
+ this.observeImages();
+ this.observeTables();
+
+ }, this), 1);
+
+ // FF fix
+ if (this.browser('mozilla'))
+ {
+ this.$editor.click($.proxy(function()
+ {
+ this.saveSelection();
+ }, this));
+
+ try
+ {
+ this.document.execCommand('enableObjectResizing', false, false);
+ this.document.execCommand('enableInlineTableEditing', false, false);
+ }
+ catch (e) {}
+ }
+
+ // focus
+ if (this.opts.focus)
+ {
+ setTimeout($.proxy(function(){
+ this.$editor.focus();
+ }, this), 1);
+ }
+
+ // fixed
+ if (this.opts.fixed)
+ {
+ this.observeScroll();
+ $(document).scroll($.proxy(this.observeScroll, this));
+ }
+
+ // callback
+ if (typeof this.opts.callback === 'function')
+ {
+ this.opts.callback(this);
+ }
+
+ if (this.opts.toolbar !== false)
+ {
+ this.$toolbar.find('a').attr('tabindex', '-1');
+ }
+ }
+
+ // construct editor
+ this.build(false, afterBuild);
+
+ },
+ shortcuts: function(e, cmd)
+ {
+ e.preventDefault();
+ this.execCommand(cmd, false);
+ },
+ keyup: function()
+ {
+ this.$editor.keyup($.proxy(function(e)
+ {
+ var key = e.keyCode || e.which;
+
+ if (this.browser('mozilla') && !this.pasteRunning)
+ {
+ this.saveSelection();
+ }
+
+ // callback as you type
+ if (typeof this.opts.keyupCallback === 'function')
+ {
+ this.opts.keyupCallback(this, e);
+ }
+
+ // if empty
+ if (key === 8 || key === 46)
+ {
+ this.observeImages();
+ return this.formatEmpty(e);
+ }
+
+ // new line p
+ if (key === 13 && !e.shiftKey && !e.ctrlKey && !e.metaKey)
+ {
+ if (this.browser('webkit'))
+ {
+ this.formatNewLine(e);
+ }
+
+ // convert links
+ if (this.opts.convertLinks)
+ {
+ this.$editor.linkify();
+ }
+ }
+
+ this.syncCode();
+
+ }, this));
+ },
+ keydown: function()
+ {
+ this.$editor.keydown($.proxy(function(e)
+ {
+ var key = e.keyCode || e.which;
+ var parent = this.getParentNode();
+ var current = this.getCurrentNode();
+ var pre = false;
+ var ctrl = e.ctrlKey || e.metaKey;
+
+ if ((parent || current) && ($(parent).get(0).tagName === 'PRE' || $(current).get(0).tagName === 'PRE'))
+ {
+ pre = true;
+ }
+
+ // callback keydown
+ if (typeof this.opts.keydownCallback === 'function')
+ {
+ this.opts.keydownCallback(this, e);
+ }
+
+ if (ctrl && this.opts.shortcuts)
+ {
+ if (key === 90)
+ {
+ if (this.opts.buffer !== false)
+ {
+ e.preventDefault();
+ this.getBuffer();
+ }
+ else if (e.shiftKey)
+ {
+ this.shortcuts(e, 'redo'); // Ctrl + Shift + z
+ }
+ else
+ {
+ this.shortcuts(e, 'undo'); // Ctrl + z
+ }
+ }
+ else if (key === 77)
+ {
+ this.shortcuts(e, 'removeFormat'); // Ctrl + m
+ }
+ else if (key === 66)
+ {
+ this.shortcuts(e, 'bold'); // Ctrl + b
+ }
+ else if (key === 73)
+ {
+ this.shortcuts(e, 'italic'); // Ctrl + i
+ }
+ else if (key === 74)
+ {
+ this.shortcuts(e, 'insertunorderedlist'); // Ctrl + j
+ }
+ else if (key === 75)
+ {
+ this.shortcuts(e, 'insertorderedlist'); // Ctrl + k
+ }
+ else if (key === 76)
+ {
+ this.shortcuts(e, 'superscript'); // Ctrl + l
+ }
+ else if (key === 72)
+ {
+ this.shortcuts(e, 'subscript'); // Ctrl + h
+ }
+ }
+
+ // clear undo buffer
+ if (!ctrl && key !== 90)
+ {
+ this.opts.buffer = false;
+ }
+
+ // enter
+ if (pre === true && key === 13)
+ {
+ e.preventDefault();
+
+ var html = $(current).parent().text();
+ this.insertNodeAtCaret(this.document.createTextNode('\r\n'));
+ if (html.search(/\s$/) == -1)
+ {
+ this.insertNodeAtCaret(this.document.createTextNode('\r\n'));
+ }
+ this.syncCode();
+
+ return false;
+ }
+
+ // tab
+ if (this.opts.shortcuts && !e.shiftKey && key === 9)
+ {
+ if (pre === false)
+ {
+ this.shortcuts(e, 'indent'); // Tab
+ }
+ else
+ {
+ e.preventDefault();
+ this.insertNodeAtCaret(this.document.createTextNode('\t'));
+ this.syncCode();
+ return false;
+ }
+ }
+ else if (this.opts.shortcuts && e.shiftKey && key === 9 )
+ {
+ this.shortcuts(e, 'outdent'); // Shift + tab
+ }
+
+ // safari shift key + enter
+ if (this.browser('webkit') && navigator.userAgent.indexOf('Chrome') === -1)
+ {
+ return this.safariShiftKeyEnter(e, key);
+ }
+ }, this));
+ },
+ build: function(mobile, whendone)
+ {
+ if (mobile !== true)
+ {
+ // container
+ this.$box = $('
');
+
+ // air box
+ if (this.opts.air)
+ {
+ this.air = $('
');
+ }
+
+ this.$content = null;
+
+ function initFrame()
+ {
+ this.$editor = this.$content.contents().find("body").attr('contenteditable', true).attr('dir', this.opts.direction);
+
+ rdocument = this.document = this.$editor[0].ownerDocument;
+ rwindow = this.window = this.document.defaultView || window;
+
+ if (this.opts.css !== false)
+ {
+ this.$content.contents().find('head').append(' ');
+ }
+
+ this.$editor.html(html);
+
+ if (whendone)
+ {
+ whendone.call(this);
+ whendone = null;
+ }
+ }
+
+ // editor
+ this.textareamode = true;
+ if (this.$el.get(0).tagName === 'TEXTAREA')
+ {
+ if(this.opts.iframe)
+ {
+ var me = this;
+ this.$content = $('').load(function()
+ {
+ initFrame.call(me);
+ });
+ }
+ else
+ {
+ this.$content = this.$editor = $('
');
+ }
+
+ var classlist = this.$el.get(0).className.split(/\s+/);
+ $.each(classlist, $.proxy(function(i,s)
+ {
+ this.$content.addClass('redactor_' + s);
+ }, this));
+ }
+ else
+ {
+ this.textareamode = false;
+ this.$content = this.$editor = this.$el;
+ this.$el = $(' ').css('height', this.height);
+ }
+
+ if (this.$editor)
+ {
+ this.$editor.addClass('redactor_editor').attr('contenteditable', true).attr('dir', this.opts.direction);
+ }
+
+ if (this.opts.tabindex !== false)
+ {
+ this.$content.attr('tabindex', this.opts.tabindex);
+ }
+
+ if (this.opts.minHeight !== false)
+ {
+ this.$content.css('min-height', this.opts.minHeight + 'px');
+ }
+
+ if (this.opts.wym === true)
+ {
+ this.$content.addClass('redactor_editor_wym');
+ }
+
+ if (this.opts.autoresize === false)
+ {
+ this.$content.css('height', this.height);
+ }
+
+ // hide textarea
+ this.$el.hide();
+
+ // append box and frame
+ var html = '';
+ if (this.textareamode)
+ {
+ // get html
+ html = this.$el.val();
+ html = this.savePreCode(html);
+
+ this.$box.insertAfter(this.$el).append(this.$content).append(this.$el);
+ }
+ else
+ {
+ // get html
+ html = this.$editor.html();
+ html = this.savePreCode(html);
+
+ this.$box.insertAfter(this.$content).append(this.$el).append(this.$editor);
+
+ }
+
+ // conver newlines to p
+ html = this.paragraphy(html);
+
+ // enable
+ if (this.$editor)
+ {
+ this.$editor.html(html);
+ }
+
+ if (this.textareamode === false)
+ {
+ this.syncCode();
+ }
+ }
+ else
+ {
+ if (this.$el.get(0).tagName !== 'TEXTAREA')
+ {
+ var html = this.$el.val();
+ var textarea = $(' ').css('height', this.height).val(html);
+ this.$el.hide();
+ this.$el.after(textarea);
+ }
+ }
+
+ if (whendone && this.$editor)
+ {
+ whendone.call(this);
+ }
+
+ },
+ enableAir: function()
+ {
+ if (this.opts.air === false)
+ {
+ return false;
+ }
+
+ this.air.hide();
+
+ this.$editor.bind('textselect', $.proxy(function(e)
+ {
+ this.showAir(e);
+
+ }, this));
+
+ this.$editor.bind('textunselect', $.proxy(function()
+ {
+ this.air.hide();
+
+ }, this));
+
+ },
+ showAir: function(e)
+ {
+ $('.redactor_air').hide();
+
+ var width = this.air.innerWidth();
+ var left = e.clientX;
+
+ if ($(this.document).width() < (left + width))
+ {
+ left = left - width;
+ }
+
+ var top = e.clientY + $(document).scrollTop() + 14;
+ if (this.opts.iframe === true)
+ {
+ top = top + this.$box.position().top;
+ left = left + this.$box.position().left;
+ }
+
+ this.air.css({ left: left + 'px', top: top + 'px' }).show();
+ },
+ syncCode: function()
+ {
+ this.$el.val(this.$editor.html());
+ },
+
+ // API functions
+ setCode: function(html)
+ {
+ html = this.stripTags(html);
+ this.$editor.html(html).focus();
+
+ this.syncCode();
+ },
+ getCode: function()
+ {
+ var html = '';
+ if (this.opts.visual)
+ {
+ html = this.$editor.html()
+ }
+ else
+ {
+ html = this.$el.val();
+ }
+
+ return this.stripTags(html);
+ },
+ insertHtml: function(html)
+ {
+ this.$editor.focus();
+ this.pasteHtmlAtCaret(html);
+ this.observeImages();
+ this.syncCode();
+ },
+
+ pasteHtmlAtCaret: function (html)
+ {
+ var sel, range;
+ if (this.document.getSelection)
+ {
+ sel = this.window.getSelection();
+ if (sel.getRangeAt && sel.rangeCount)
+ {
+ range = sel.getRangeAt(0);
+ range.deleteContents();
+ var el = this.document.createElement("div");
+ el.innerHTML = html;
+ var frag = this.document.createDocumentFragment(), node, lastNode;
+ while (node = el.firstChild)
+ {
+ lastNode = frag.appendChild(node);
+ }
+ range.insertNode(frag);
+
+ if (lastNode)
+ {
+ range = range.cloneRange();
+ range.setStartAfter(lastNode);
+ range.collapse(true);
+ sel.removeAllRanges();
+ sel.addRange(range);
+ }
+ }
+ }
+ else if (this.document.selection && this.document.selection.type != "Control")
+ {
+ this.document.selection.createRange().pasteHTML(html);
+ }
+ },
+
+ destroy: function()
+ {
+ var html = this.getCode();
+
+ if (this.textareamode)
+ {
+ this.$box.after(this.$el);
+ this.$box.remove();
+ this.$el.height(this.height).val(html).show();
+ }
+ else
+ {
+ this.$box.after(this.$editor);
+ this.$box.remove();
+ this.$editor.removeClass('redactor_editor').removeClass('redactor_editor_wym').attr('contenteditable', false).html(html).show();
+ }
+
+ if (this.opts.toolbarExternal)
+ {
+ $(this.opts.toolbarExternal).empty();
+ }
+
+ $('.redactor_air').remove();
+
+ for (var i = 0; i < this.dropdowns.length; i++)
+ {
+ this.dropdowns[i].remove();
+ delete(this.dropdowns[i]);
+ }
+
+ if (this.opts.autosave !== false)
+ {
+ clearInterval(this.autosaveInterval);
+ }
+
+ },
+ // end API functions
+
+ // OBSERVERS
+ observeFormatting: function()
+ {
+ var parent = this.getCurrentNode();
+
+ this.inactiveAllButtons();
+
+ $.each(this.opts.activeButtonsStates, $.proxy(function(i,s)
+ {
+ if ($(parent).closest(i,this.$editor.get()[0]).length != 0)
+ {
+ this.setBtnActive(s);
+ }
+
+ }, this));
+
+ var tag = $(parent).closest(['p', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'td']);
+
+ if (typeof tag[0] !== 'undefined' && typeof tag[0].elem !== 'undefined' && $(tag[0].elem).size() != 0)
+ {
+ var align = $(tag[0].elem).css('text-align');
+
+ switch (align)
+ {
+ case 'right':
+ this.setBtnActive('alignright');
+ break;
+ case 'center':
+ this.setBtnActive('aligncenter');
+ break;
+ case 'justify':
+ this.setBtnActive('justify');
+ break;
+ default:
+ this.setBtnActive('alignleft');
+ break;
+ }
+ }
+ },
+ observeImages: function()
+ {
+ if (this.opts.observeImages === false)
+ {
+ return false;
+ }
+
+ this.$editor.find('img').each($.proxy(function(i,s)
+ {
+ if (this.browser('msie'))
+ {
+ $(s).attr('unselectable', 'on');
+ }
+
+ this.resizeImage(s);
+
+ }, this));
+
+ },
+ observeTables: function()
+ {
+ this.$editor.find('table').click($.proxy(this.tableObserver, this));
+ },
+ observeScroll: function()
+ {
+ var scrolltop = $(this.document).scrollTop();
+ var boxtop = this.$box.offset().top;
+ var left = 0;
+
+ if (scrolltop > boxtop)
+ {
+ var width = '100%';
+ if (this.opts.fixedBox)
+ {
+ left = this.$box.offset().left;
+ width = this.$box.innerWidth();
+ }
+
+ this.fixed = true;
+ this.$toolbar.css({ position: 'fixed', width: width, zIndex: 1005, top: this.opts.fixedTop + 'px', left: left });
+ }
+ else
+ {
+ this.fixed = false;
+ this.$toolbar.css({ position: 'relative', width: 'auto', zIndex: 1, top: 0, left: left });
+ }
+ },
+
+ // BUFFER
+ setBuffer: function()
+ {
+ this.saveSelection();
+ this.opts.buffer = this.$editor.html();
+ },
+ getBuffer: function()
+ {
+ if (this.opts.buffer === false)
+ {
+ return false;
+ }
+
+ this.$editor.html(this.opts.buffer);
+
+ if (!this.browser('msie'))
+ {
+ this.restoreSelection();
+ }
+
+ this.opts.buffer = false;
+ },
+
+
+
+ // EXECCOMMAND
+ execCommand: function(cmd, param)
+ {
+ if (this.opts.visual == false)
+ {
+ this.$el.focus();
+ return false;
+ }
+
+ try
+ {
+
+ var parent;
+
+ if (cmd === 'inserthtml')
+ {
+ if (this.browser('msie'))
+ {
+ this.$editor.focus();
+ this.document.selection.createRange().pasteHTML(param);
+ }
+ else
+ {
+ this.pasteHtmlAtCaret(param);
+ //this.execRun(cmd, param);
+ }
+
+ this.observeImages();
+ }
+ else if (cmd === 'unlink')
+ {
+ parent = this.getParentNode();
+ if ($(parent).get(0).tagName === 'A')
+ {
+ $(parent).replaceWith($(parent).text());
+ }
+ else
+ {
+ this.execRun(cmd, param);
+ }
+ }
+ else if (cmd === 'JustifyLeft' || cmd === 'JustifyCenter' || cmd === 'JustifyRight' || cmd === 'JustifyFull')
+ {
+ parent = this.getCurrentNode();
+ var tag = $(parent).get(0).tagName;
+
+ if (this.opts.iframe === false && $(parent).parents('.redactor_editor').size() == 0)
+ {
+ return false;
+ }
+
+ var tagsArray = ['P', 'DIV', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'BLOCKQUOTE', 'TD'];
+ if ($.inArray(tag, tagsArray) != -1)
+ {
+ var align = false;
+
+ if (cmd === 'JustifyCenter')
+ {
+ align = 'center';
+ }
+ else if (cmd === 'JustifyRight')
+ {
+ align = 'right';
+ }
+ else if (cmd === 'JustifyFull')
+ {
+ align = 'justify';
+ }
+
+ if (align === false)
+ {
+ $(parent).css('text-align', '');
+ }
+ else
+ {
+ $(parent).css('text-align', align);
+ }
+ }
+ else
+ {
+ this.execRun(cmd, param);
+ }
+ }
+ else if (cmd === 'formatblock' && param === 'blockquote')
+ {
+ parent = this.getCurrentNode();
+ if ($(parent).get(0).tagName === 'BLOCKQUOTE')
+ {
+ if (this.browser('msie'))
+ {
+ var node = $('' + $(parent).html() + '
');
+ $(parent).replaceWith(node);
+ }
+ else
+ {
+ this.execRun(cmd, 'p');
+ }
+ }
+ else if ($(parent).get(0).tagName === 'P')
+ {
+ var parent2 = $(parent).parent();
+ if ($(parent2).get(0).tagName === 'BLOCKQUOTE')
+ {
+ var node = $('' + $(parent).html() + '
');
+ $(parent2).replaceWith(node);
+ this.setSelection(node[0], 0, node[0], 0);
+ }
+ else
+ {
+ if (this.browser('msie'))
+ {
+ var node = $('' + $(parent).html() + ' ');
+ $(parent).replaceWith(node);
+ }
+ else
+ {
+ this.execRun(cmd, param);
+ }
+ }
+ }
+ else
+ {
+ this.execRun(cmd, param);
+ }
+ }
+ else if (cmd === 'formatblock' && (param === 'pre' || param === 'p'))
+ {
+ parent = this.getParentNode();
+
+ if ($(parent).get(0).tagName === 'PRE')
+ {
+ $(parent).replaceWith('' + this.encodeEntities($(parent).text()) + '
');
+ }
+ else
+ {
+ this.execRun(cmd, param);
+ }
+ }
+ else
+ {
+ if (cmd === 'inserthorizontalrule' && this.browser('msie'))
+ {
+ this.$editor.focus();
+ }
+
+ if (cmd === 'formatblock' && this.browser('mozilla'))
+ {
+ this.$editor.focus();
+ }
+
+ this.execRun(cmd, param);
+ }
+
+ if (cmd === 'inserthorizontalrule')
+ {
+ this.$editor.find('hr').removeAttr('id');
+ }
+
+ this.syncCode();
+
+ if (this.oldIE())
+ {
+ this.$editor.focus();
+ }
+
+ if (typeof this.opts.execCommandCallback === 'function')
+ {
+ this.opts.execCommandCallback(this, cmd);
+ }
+
+ if (this.opts.air)
+ {
+ this.air.hide();
+ }
+ }
+ catch (e) { }
+ },
+ execRun: function(cmd, param)
+ {
+ if (cmd === 'formatblock' && this.browser('msie'))
+ {
+ param = '<' + param + '>';
+ }
+
+ this.document.execCommand(cmd, false, param);
+ },
+
+ // FORMAT NEW LINE
+ formatNewLine: function(e)
+ {
+ var parent = this.getParentNode();
+
+ if (parent.nodeName === 'DIV' && parent.className === 'redactor_editor')
+ {
+ var element = $(this.getCurrentNode());
+
+ if (element.get(0).tagName === 'DIV' && (element.html() === '' || element.html() === ' '))
+ {
+ var newElement = $('').append(element.clone().get(0).childNodes);
+ element.replaceWith(newElement);
+ newElement.html(' ');
+ this.setSelection(newElement[0], 0, newElement[0], 0);
+ }
+ }
+ },
+
+ // SAFARI SHIFT KEY + ENTER
+ safariShiftKeyEnter: function(e, key)
+ {
+ if (e.shiftKey && key === 13)
+ {
+ e.preventDefault();
+ this.insertNodeAtCaret($(' ').get(0));
+ this.syncCode();
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ },
+
+ // FORMAT EMPTY
+ formatEmpty: function(e)
+ {
+ var html = $.trim(this.$editor.html());
+
+ if (this.browser('mozilla'))
+ {
+ html = html.replace(/ /i, '');
+ }
+
+ var thtml = html.replace(/<(?:.|\n)*?>/gm, '');
+
+ if (html === '' || thtml === '')
+ {
+ e.preventDefault();
+
+ var node = $(this.opts.emptyHtml).get(0);
+ this.$editor.html(node);
+ this.setSelection(node, 0, node, 0);
+
+ this.syncCode();
+ return false;
+ }
+ else
+ {
+ this.syncCode();
+ }
+ },
+
+ // PARAGRAPHY
+ paragraphy: function (str)
+ {
+ str = $.trim(str);
+ if (str === '' || str === '
')
+ {
+ return this.opts.emptyHtml;
+ }
+
+ // convert div to p
+ if (this.opts.convertDivs)
+ {
+ str = str.replace(/([\w\W]*?)<\/div>/gi, '
$2
');
+ }
+
+ // inner functions
+ var X = function(x, a, b) { return x.replace(new RegExp(a, 'g'), b); };
+ var R = function(a, b) { return X(str, a, b); };
+
+ // block elements
+ var blocks = '(table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|style|script|object|input|param|p|h[1-6])';
+
+ //str = '
' + str;
+ str += '\n';
+
+ R(' \\s* ', '\n\n');
+ R('(<' + blocks + '[^>]*>)', '\n$1');
+ R('(' + blocks + '>)', '$1\n\n');
+ R('\r\n|\r', '\n'); // newlines
+ R('\n\n+', '\n\n'); // remove duplicates
+ R('\n?((.|\n)+?)$', '
$1
\n'); // including one at the end
+ R('
\\s*?
', ''); // remove empty p
+ R('
(
]*>\\s*)', '$1
');
+ R('
([^<]+)\\s*?((div|address|form)[^>]*>)', '
$1
$2');
+ R('
\\s*(?' + blocks + '[^>]*>)\\s*
', '$1');
+ R('
(
', '$1');
+ R('\\s*(?' + blocks + '[^>]*>)', '$1');
+ R('(?' + blocks + '[^>]*>)\\s*
', '$1');
+ R('(?' + blocks + '[^>]*>)\\s* ', '$1');
+ R(' (\\s*?(p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)', '$1');
+
+ // pre
+ if (str.indexOf(')((.|\n)*?) ', function(m0, m1, m2, m3)
+ {
+ return X(m1, '\\\\([\'\"\\\\])', '$1') + X(X(X(m3, '', '\n'), '
| ', ''), '\\\\([\'\"\\\\])', '$1') + '';
+ });
+ }
+
+ return R('\n$', '');
+ },
+
+ // REMOVE TAGS
+ stripTags: function(html)
+ {
+ var allowed = this.opts.allowedTags;
+ var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi;
+ return html.replace(tags, function ($0, $1)
+ {
+ return $.inArray($1.toLowerCase(), allowed) > '-1' ? $0 : '';
+ });
+ },
+
+
+ savePreCode: function(html)
+ {
+ var pre = html.match(/([\w\W]*?)<\/pre>/gi);
+ if (pre !== null)
+ {
+ $.each(pre, $.proxy(function(i,s)
+ {
+ var arr = s.match(/([\w\W]*?)<\/pre>/i);
+ arr[2] = this.encodeEntities(arr[2]);
+ html = html.replace(s, '' + arr[2] + ' ');
+ }, this));
+ }
+
+ return html;
+ },
+ encodeEntities: function(str)
+ {
+ str = String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
+ return String(str).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"');
+ },
+ cleanupPre: function(s)
+ {
+ s = s.replace(/ /gi, '\n');
+ s = s.replace(/<\/p>/gi, '\n');
+ s = s.replace(/<\/div>/gi, '\n');
+
+ var tmp = this.document.createElement("div");
+ tmp.innerHTML = s;
+ return tmp.textContent||tmp.innerText;
+
+ },
+
+
+ // PASTE CLEANUP
+ pasteCleanUp: function(html)
+ {
+ var parent = this.getParentNode();
+
+ // clean up pre
+ if ($(parent).get(0).tagName === 'PRE')
+ {
+ html = this.cleanupPre(html);
+ this.pasteCleanUpInsert(html);
+ return true;
+ }
+
+ // remove comments and php tags
+ html = html.replace(/|<\?(?:php)?[\s\S]*?\?>/gi, '');
+
+ // remove nbsp
+ html = html.replace(/( ){2,}/gi, ' ');
+
+ // remove google docs marker
+ html = html.replace(/([\w\W]*?)<\/b>/gi, "$2");
+
+ // strip tags
+ html = this.stripTags(html);
+
+ // prevert
+ html = html.replace(/ <\/td>/gi, '[td]');
+ html = html.replace(/ <\/td>/gi, '[td]');
+ html = html.replace(/ <\/td>/gi, '[td]');
+ html = html.replace(/([\w\W]*?)<\/a>/gi, '[a href="$2"]$4[/a]');
+ html = html.replace(/ ', '', ''];
+ for (var i = 0; i < atags.length; ++i)
+ {
+ var aaa = atags[i];
+ html = html.replace(new RegExp(aaa,'gi'),aaa+lb);
+ }
+
+ return html;
+ },
+ formatting: function(html)
+ {
+ html = this.formattingRemove(html);
+
+ // empty tags
+ html = this.formattingEmptyTags(html);
+
+ // add formatting before
+ html = this.formattingAddBefore(html);
+
+ // add formatting after
+ html = this.formattingAddAfter(html);
+
+ // indenting
+ html = this.formattingIndenting(html);
+
+ return html;
+ },
+
+ // TOGGLE
+ toggle: function()
+ {
+ var html;
+
+ if (this.opts.visual)
+ {
+ var height = this.$editor.innerHeight();
+
+ this.$editor.hide();
+ this.$content.hide();
+
+ html = this.$editor.html();
+ //html = $.trim(this.formatting(html));
+
+ this.$el.height(height).val(html).show().focus();
+
+ this.setBtnActive('html');
+ this.opts.visual = false;
+ }
+ else
+ {
+ this.$el.hide();
+ var html = this.$el.val();
+
+ //html = this.savePreCode(html);
+
+ // clean up
+ //html = this.stripTags(html);
+
+ // set code
+ this.$editor.html(html).show();
+ this.$content.show();
+
+ if (this.$editor.html() === '')
+ {
+ this.setCode(this.opts.emptyHtml);
+ }
+
+ this.$editor.focus();
+
+ this.setBtnInactive('html');
+ this.opts.visual = true;
+
+ this.observeImages();
+ this.observeTables();
+ }
+ },
+
+ // AUTOSAVE
+ autoSave: function()
+ {
+ this.autosaveInterval = setInterval($.proxy(function()
+ {
+ $.ajax({
+ url: this.opts.autosave,
+ type: 'post',
+ data: this.$el.attr('name') + '=' + escape(encodeURIComponent(this.getCode())),
+ success: $.proxy(function(data)
+ {
+ // callback
+ if (typeof this.opts.autosaveCallback === 'function')
+ {
+ this.opts.autosaveCallback(data, this);
+ }
+
+ }, this)
+ });
+
+
+ }, this), this.opts.interval*1000);
+ },
+
+ // TOOLBAR
+ buildToolbar: function()
+ {
+ if (this.opts.toolbar === false)
+ {
+ return false;
+ }
+
+ this.$toolbar = $(' ').addClass('redactor_toolbar');
+
+ if (this.opts.air)
+ {
+ $(this.air).append(this.$toolbar);
+ $('body').append(this.air);
+ }
+ else
+ {
+ if (this.opts.toolbarExternal === false)
+ {
+ this.$box.prepend(this.$toolbar);
+ }
+ else
+ {
+ $(this.opts.toolbarExternal).html(this.$toolbar);
+ }
+ }
+
+ $.each(this.opts.buttons, $.proxy(function(i,key)
+ {
+
+ if (key !== '|' && typeof this.opts.toolbar[key] !== 'undefined')
+ {
+ var s = this.opts.toolbar[key];
+
+ if (this.opts.fileUpload === false && key === 'file')
+ {
+ return true;
+ }
+
+ this.$toolbar.append($('').append(this.buildButton(key, s)));
+ }
+
+
+ if (key === '|')
+ {
+ this.$toolbar.append($(' '));
+ }
+
+ }, this));
+
+ },
+ buildButton: function(key, s)
+ {
+ var button = $(' ');
+
+ if (typeof s.func === 'undefined')
+ {
+ button.click($.proxy(function()
+ {
+ if ($.inArray(key, this.opts.activeButtons) != -1)
+ {
+ this.inactiveAllButtons();
+ this.setBtnActive(key);
+ }
+
+ if (this.browser('mozilla'))
+ {
+ this.$editor.focus();
+ //this.restoreSelection();
+ }
+
+ this.execCommand(s.exec, key);
+
+ }, this));
+ }
+ else if (s.func !== 'show')
+ {
+ button.click($.proxy(function(e) {
+
+ this[s.func](e);
+
+ }, this));
+ }
+
+ if (typeof s.callback !== 'undefined' && s.callback !== false)
+ {
+ button.click($.proxy(function(e) { s.callback(this, e, key); }, this));
+ }
+
+ // dropdown
+ if (key === 'backcolor' || key === 'fontcolor' || typeof(s.dropdown) !== 'undefined')
+ {
+ var dropdown = $('');
+
+ if (key === 'backcolor' || key === 'fontcolor')
+ {
+ dropdown = this.buildColorPicker(dropdown, key);
+ }
+ else
+ {
+ dropdown = this.buildDropdown(dropdown, s.dropdown);
+ }
+
+ this.dropdowns.push(dropdown.appendTo($(document.body)));
+
+ // observing dropdown
+ this.hdlShowDropDown = $.proxy(function(e) { this.showDropDown(e, dropdown, key); }, this);
+
+ button.click(this.hdlShowDropDown);
+ }
+
+ return button;
+ },
+ buildDropdown: function(dropdown, obj)
+ {
+ $.each(obj, $.proxy(
+ function (x, d)
+ {
+ if (typeof(d.className) === 'undefined')
+ {
+ d.className = '';
+ }
+
+ var drop_a;
+ if (typeof d.name !== 'undefined' && d.name === 'separator')
+ {
+ drop_a = $('
');
+ }
+ else
+ {
+ drop_a = $(' ' + d.title + ' ');
+
+ if (typeof(d.callback) === 'function')
+ {
+ $(drop_a).click($.proxy(function(e) { d.callback(this, e, x); }, this));
+ }
+ else if (typeof(d.func) === 'undefined')
+ {
+ $(drop_a).click($.proxy(function() { this.execCommand(d.exec, x); }, this));
+ }
+ else
+ {
+ $(drop_a).click($.proxy(function(e) { this[d.func](e); }, this));
+ }
+ }
+
+ $(dropdown).append(drop_a);
+
+ }, this)
+ );
+
+ return dropdown;
+
+ },
+ buildColorPicker: function(dropdown, key)
+ {
+ var mode;
+ if (key === 'backcolor')
+ {
+ if (this.browser('msie'))
+ {
+ mode = 'BackColor';
+ }
+ else
+ {
+ mode = 'hilitecolor';
+ }
+ }
+ else
+ {
+ mode = 'forecolor';
+ }
+
+ $(dropdown).width(210);
+
+ var len = this.opts.colors.length;
+ for (var i = 0; i < len; ++i)
+ {
+ var color = this.opts.colors[i];
+
+ var swatch = $('
').css({ 'backgroundColor': color });
+ $(dropdown).append(swatch);
+
+ var _self = this;
+ $(swatch).click(function()
+ {
+ _self.execCommand(mode, $(this).attr('rel'));
+
+ if (mode === 'forecolor')
+ {
+ _self.$editor.find('font').replaceWith(function() {
+
+ return $('
' + $(this).html() + ' ');
+
+ });
+ }
+
+ if (_self.browser('msie') && mode === 'BackColor')
+ {
+ _self.$editor.find('font').replaceWith(function() {
+
+ return $('
' + $(this).html() + ' ');
+
+ });
+ }
+
+ });
+ }
+
+ var elnone = $('
').html(RLANG.none);
+
+ if (key === 'backcolor')
+ {
+ elnone.click($.proxy(this.setBackgroundNone, this));
+ }
+ else
+ {
+ elnone.click($.proxy(this.setColorNone, this));
+ }
+
+ $(dropdown).append(elnone);
+
+ return dropdown;
+ },
+ setBackgroundNone: function()
+ {
+ $(this.getParentNode()).css('background-color', 'transparent');
+ this.syncCode();
+ },
+ setColorNone: function()
+ {
+ $(this.getParentNode()).attr('color', '').css('color', '');
+ this.syncCode();
+ },
+
+ // DROPDOWNS
+ showDropDown: function(e, dropdown, key)
+ {
+ if (this.getBtn(key).hasClass('dropact'))
+ {
+ this.hideAllDropDown();
+ }
+ else
+ {
+ this.hideAllDropDown();
+
+ this.setBtnActive(key);
+ this.getBtn(key).addClass('dropact');
+
+ var left = this.getBtn(key).offset().left;
+
+ if (this.opts.air)
+ {
+ var air_top = this.air.offset().top;
+
+ $(dropdown).css({ position: 'absolute', left: left + 'px', top: air_top+30 + 'px' }).show();
+ }
+ else if (this.opts.fixed && this.fixed)
+ {
+ $(dropdown).css({ position: 'fixed', left: left + 'px', top: '30px' }).show();
+ }
+ else
+ {
+ var top = this.$toolbar.offset().top + 30;
+ $(dropdown).css({ position: 'absolute', left: left + 'px', top: top + 'px' }).show();
+ }
+ }
+
+ var hdlHideDropDown = $.proxy(function(e) { this.hideDropDown(e, dropdown, key); }, this);
+
+ $(document).one('click', hdlHideDropDown);
+ this.$editor.one('click', hdlHideDropDown);
+ this.$content.one('click', hdlHideDropDown);
+
+ e.stopPropagation();
+
+ },
+ hideAllDropDown: function()
+ {
+ this.$toolbar.find('a.dropact').removeClass('redactor_act').removeClass('dropact');
+ $('.redactor_dropdown').hide();
+ },
+ hideDropDown: function(e, dropdown, key)
+ {
+ if (!$(e.target).hasClass('dropact'))
+ {
+ $(dropdown).removeClass('dropact');
+ this.showedDropDown = false;
+ this.hideAllDropDown();
+ }
+ },
+
+ // BUTTONS MANIPULATIONS
+ getBtn: function(key)
+ {
+ if (this.opts.toolbar === false)
+ {
+ return false;
+ }
+
+ return $(this.$toolbar.find('a.redactor_btn_' + key));
+ },
+ setBtnActive: function(key)
+ {
+ this.getBtn(key).addClass('redactor_act');
+ },
+ setBtnInactive: function(key)
+ {
+ this.getBtn(key).removeClass('redactor_act');
+ },
+ inactiveAllButtons: function()
+ {
+ $.each(this.opts.activeButtons, $.proxy(function(i,s)
+ {
+ this.setBtnInactive(s);
+
+ }, this));
+ },
+ changeBtnIcon: function(key, classname)
+ {
+ this.getBtn(key).addClass('redactor_btn_' + classname);
+ },
+ removeBtnIcon: function(key, classname)
+ {
+ this.getBtn(key).removeClass('redactor_btn_' + classname);
+ },
+
+ addBtnSeparator: function()
+ {
+ this.$toolbar.append($('
'));
+ },
+ addBtnSeparatorAfter: function(key)
+ {
+ var $btn = this.getBtn(key);
+ $btn.parent().after($('
'));
+ },
+ addBtnSeparatorBefore: function(key)
+ {
+ var $btn = this.getBtn(key);
+ $btn.parent().before($('
'));
+ },
+ removeBtnSeparatorAfter: function(key)
+ {
+ var $btn = this.getBtn(key);
+ $btn.parent().next().remove();
+ },
+ removeBtnSeparatorBefore: function(key)
+ {
+ var $btn = this.getBtn(key);
+ $btn.parent().prev().remove();
+ },
+
+ setBtnRight: function(key)
+ {
+ if (this.opts.toolbar === false)
+ {
+ return false;
+ }
+
+ this.getBtn(key).parent().addClass('redactor_btn_right');
+ },
+ setBtnLeft: function(key)
+ {
+ if (this.opts.toolbar === false)
+ {
+ return false;
+ }
+
+ this.getBtn(key).parent().removeClass('redactor_btn_right');
+ },
+ addBtn: function(key, title, callback, dropdown)
+ {
+ if (this.opts.toolbar === false)
+ {
+ return false;
+ }
+
+ var btn = this.buildButton(key, { title: title, callback: callback, dropdown: dropdown });
+ this.$toolbar.append($('
').append(btn));
+ },
+ addBtnFirst: function(key, title, callback, dropdown)
+ {
+ if (this.opts.toolbar === false)
+ {
+ return false;
+ }
+
+ var btn = this.buildButton(key, { title: title, callback: callback, dropdown: dropdown });
+ this.$toolbar.prepend($(' ').append(btn));
+ },
+ addBtnAfter: function(afterkey, key, title, callback, dropdown)
+ {
+ if (this.opts.toolbar === false)
+ {
+ return false;
+ }
+
+ var btn = this.buildButton(key, { title: title, callback: callback, dropdown: dropdown });
+ var $btn = this.getBtn(afterkey);
+ $btn.parent().after($(' ').append(btn));
+ },
+ addBtnBefore: function(beforekey, key, title, callback, dropdown)
+ {
+ if (this.opts.toolbar === false)
+ {
+ return false;
+ }
+
+ var btn = this.buildButton(key, { title: title, callback: callback, dropdown: dropdown });
+ var $btn = this.getBtn(beforekey);
+ $btn.parent().before($(' ').append(btn));
+ },
+ removeBtn: function(key, separator)
+ {
+ var $btn = this.getBtn(key);
+
+ if (separator === true)
+ {
+ $btn.parent().next().remove();
+ }
+
+ $btn.parent().removeClass('redactor_btn_right');
+ $btn.remove();
+ },
+
+
+ // SELECTION AND NODE MANIPULATION
+ getFragmentHtml: function (fragment)
+ {
+ var cloned = fragment.cloneNode(true);
+ var div = this.document.createElement('div');
+ div.appendChild(cloned);
+ return div.innerHTML;
+ },
+ extractContent: function()
+ {
+ var node = this.$editor.get(0);
+ var frag = this.document.createDocumentFragment(), child;
+ while ((child = node.firstChild))
+ {
+ frag.appendChild(child);
+ }
+
+ return frag;
+ },
+
+ // Save and Restore Selection
+ saveSelection: function()
+ {
+ this.$editor.focus();
+
+ this.savedSel = this.getOrigin();
+ this.savedSelObj = this.getFocus();
+ },
+ restoreSelection: function()
+ {
+ if (typeof this.savedSel !== 'undefined' && this.savedSel !== null && this.savedSelObj !== null && this.savedSel[0].tagName !== 'BODY')
+ {
+ if (this.opts.iframe === false && $(this.savedSel[0]).closest('.redactor_editor').size() == 0)
+ {
+ this.$editor.focus();
+ }
+ else
+ {
+ if (this.browser('opera'))
+ {
+ this.$editor.focus();
+ }
+
+ this.setSelection(this.savedSel[0], this.savedSel[1], this.savedSelObj[0], this.savedSelObj[1]);
+
+ if (this.browser('mozilla'))
+ {
+ this.$editor.focus();
+ }
+ }
+ }
+ else
+ {
+ this.$editor.focus();
+ }
+ },
+
+ // Selection
+ getSelection: function()
+ {
+ var doc = this.document;
+
+ if (this.window.getSelection)
+ {
+ return this.window.getSelection();
+ }
+ else if (doc.getSelection)
+ {
+ return doc.getSelection();
+ }
+ else // IE
+ {
+ return doc.selection.createRange();
+ }
+
+ return false;
+ },
+ hasSelection: function()
+ {
+ if (!this.oldIE())
+ {
+ var sel;
+ return (sel = this.getSelection()) && (sel.focusNode != null) && (sel.anchorNode != null);
+ }
+ else // IE8
+ {
+ var node = this.$editor.get(0);
+
+ var range;
+ node.focus();
+ if (!node.document.selection)
+ {
+ return false;
+ }
+
+ range = node.document.selection.createRange();
+ return range && range.parentElement().document === node.document;
+ }
+ },
+ getOrigin: function()
+ {
+ if (!this.oldIE())
+ {
+ var sel;
+ if (!((sel = this.getSelection()) && (sel.anchorNode != null)))
+ {
+ return null;
+ }
+
+ return [sel.anchorNode, sel.anchorOffset];
+ }
+ else
+ {
+ var node = this.$editor.get(0);
+
+ var range;
+ node.focus();
+ if (!this.hasSelection())
+ {
+ return null;
+ }
+
+ range = node.document.selection.createRange();
+ return this._getBoundary(node.document, range, true);
+ }
+ },
+ getFocus: function()
+ {
+ if (!this.oldIE())
+ {
+ var sel;
+ if (!((sel = this.getSelection()) && (sel.focusNode != null)))
+ {
+ return null;
+ }
+
+ return [sel.focusNode, sel.focusOffset];
+ }
+ else
+ {
+ var node = this.$editor.get(0);
+
+ var range;
+ node.focus();
+ if (!this.hasSelection())
+ {
+ return null;
+ }
+
+ range = node.document.selection.createRange();
+ return this._getBoundary(node.document, range, false);
+
+ }
+ },
+ setSelection: function (orgn, orgo, focn, foco)
+ {
+ if (focn == null)
+ {
+ focn = orgn;
+ }
+
+ if (foco == null)
+ {
+ foco = orgo;
+ }
+
+ if (!this.oldIE())
+ {
+ var sel = this.getSelection();
+ if (!sel)
+ {
+ return;
+ }
+
+ if (sel.collapse && sel.extend)
+ {
+ sel.collapse(orgn, orgo);
+ sel.extend(focn, foco);
+ }
+ else // IE9
+ {
+ r = this.document.createRange();
+ r.setStart(orgn, orgo);
+ r.setEnd(focn, foco);
+
+ try
+ {
+ sel.removeAllRanges();
+ }
+ catch (e) {}
+
+ sel.addRange(r);
+ }
+ }
+ else
+ {
+ var node = this.$editor.get(0);
+ var range = node.document.body.createTextRange();
+
+ this._moveBoundary(node.document, range, false, focn, foco);
+ this._moveBoundary(node.document, range, true, orgn, orgo);
+ return range.select();
+ }
+ },
+
+ // Get elements, html and text
+ getCurrentNode: function()
+ {
+ if (typeof this.window.getSelection !== 'undefined')
+ {
+ return this.getSelectedNode().parentNode;
+ }
+ else if (typeof this.document.selection !== 'undefined')
+ {
+ return this.getSelection().parentElement();
+ }
+ },
+ getParentNode: function()
+ {
+ return $(this.getCurrentNode()).parent()[0]
+ },
+ getSelectedNode: function()
+ {
+ if (this.oldIE())
+ {
+ return this.getSelection().parentElement();
+ }
+ else if (typeof this.window.getSelection !== 'undefined')
+ {
+ var s = this.window.getSelection();
+ if (s.rangeCount > 0)
+ {
+ return this.getSelection().getRangeAt(0).commonAncestorContainer;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else if (typeof this.document.selection !== 'undefined')
+ {
+ return this.getSelection();
+ }
+ },
+
+
+ // IE8 specific selection
+ _getBoundary: function(doc, textRange, bStart)
+ {
+ var cursor, cursorNode, node, offset, parent;
+
+ cursorNode = doc.createElement('a');
+ cursor = textRange.duplicate();
+ cursor.collapse(bStart);
+ parent = cursor.parentElement();
+ while (true)
+ {
+ parent.insertBefore(cursorNode, cursorNode.previousSibling);
+ cursor.moveToElementText(cursorNode);
+ if (!(cursor.compareEndPoints((bStart ? 'StartToStart' : 'StartToEnd'), textRange) > 0 && (cursorNode.previousSibling != null)))
+ {
+ break;
+ }
+ }
+
+ if (cursor.compareEndPoints((bStart ? 'StartToStart' : 'StartToEnd'), textRange) === -1 && cursorNode.nextSibling)
+ {
+ cursor.setEndPoint((bStart ? 'EndToStart' : 'EndToEnd'), textRange);
+ node = cursorNode.nextSibling;
+ offset = cursor.text.length;
+ }
+ else
+ {
+ node = cursorNode.parentNode;
+ offset = this._getChildIndex(cursorNode);
+ }
+
+ cursorNode.parentNode.removeChild(cursorNode);
+ return [node, offset];
+ },
+ _moveBoundary: function(doc, textRange, bStart, node, offset)
+ {
+ var anchorNode, anchorParent, cursor, cursorNode, textOffset;
+
+ textOffset = 0;
+ anchorNode = this._isText(node) ? node : node.childNodes[offset];
+ anchorParent = this._isText(node) ? node.parentNode : node;
+
+ if (this._isText(node))
+ {
+ textOffset = offset;
+ }
+
+ cursorNode = doc.createElement('a');
+ anchorParent.insertBefore(cursorNode, anchorNode || null);
+ cursor = doc.body.createTextRange();
+ cursor.moveToElementText(cursorNode);
+ cursorNode.parentNode.removeChild(cursorNode);
+
+ textRange.setEndPoint((bStart ? 'StartToStart' : 'EndToEnd'), cursor);
+ return textRange[bStart ? 'moveStart' : 'moveEnd']('character', textOffset);
+ },
+ _isText: function (d)
+ {
+ return (d != null ? d.nodeType == 3 : false);
+ },
+ _getChildIndex: function (e)
+ {
+ var k = 0;
+ while (e = e.previousSibling) {
+ k++;
+ }
+ return k;
+ },
+
+ insertNodeAfterCaret: function(node)
+ {
+ this.saveSelection();
+ this.insertNodeAtCaret(node);
+ this.restoreSelection();
+ },
+
+ insertNodeAtCaret: function(node)
+ {
+ if (this.window.getSelection)
+ {
+ var sel = this.getSelection();
+ if (sel.rangeCount)
+ {
+ var range = sel.getRangeAt(0);
+ range.collapse(false);
+ range.insertNode(node);
+ range = range.cloneRange();
+ range.selectNodeContents(node);
+ range.collapse(false);
+ sel.removeAllRanges();
+ sel.addRange(range);
+ }
+ }
+ else if (this.document.selection)
+ {
+ var html = (node.nodeType === 1) ? node.outerHTML : node.data;
+ var id = "marker_" + ("" + Math.random()).slice(2);
+ html += ' ';
+ var textRange = this.getSelection();
+ textRange.collapse(false);
+ textRange.pasteHTML(html);
+ var markerSpan = this.document.getElementById(id);
+ textRange.moveToElementText(markerSpan);
+ textRange.select();
+ markerSpan.parentNode.removeChild(markerSpan);
+ }
+ },
+ getSelectedHtml: function()
+ {
+ var html = '';
+ if (this.window.getSelection)
+ {
+ var sel = this.window.getSelection();
+ if (sel.rangeCount)
+ {
+ var container = this.document.createElement("div");
+ for (var i = 0, len = sel.rangeCount; i < len; ++i)
+ {
+ container.appendChild(sel.getRangeAt(i).cloneContents());
+ }
+
+ html = container.innerHTML;
+
+ }
+ }
+ else if (this.document.selection)
+ {
+ if (this.document.selection.type === "Text")
+ {
+ html = this.document.selection.createRange().htmlText;
+ }
+ }
+
+ return html;
+ },
+
+ // RESIZE IMAGES
+ resizeImage: function(resize)
+ {
+ var clicked = false;
+ var clicker = false;
+ var start_x;
+ var start_y;
+ var ratio = $(resize).width()/$(resize).height();
+ var min_w = 10;
+ var min_h = 10;
+
+ $(resize).off('hover mousedown mouseup click mousemove');
+ $(resize).hover(function() { $(resize).css('cursor', 'nw-resize'); }, function() { $(resize).css('cursor',''); clicked = false; });
+
+ $(resize).mousedown(function(e)
+ {
+ e.preventDefault();
+
+ ratio = $(resize).width()/$(resize).height();
+
+ clicked = true;
+ clicker = true;
+
+ start_x = Math.round(e.pageX - $(resize).eq(0).offset().left);
+ start_y = Math.round(e.pageY - $(resize).eq(0).offset().top);
+ });
+
+ $(resize).mouseup($.proxy(function(e)
+ {
+ clicked = false;
+ $(resize).css('cursor','');
+ this.syncCode();
+
+ }, this));
+
+ $(resize).click($.proxy(function(e)
+ {
+ if (clicker)
+ {
+ this.imageEdit(e);
+ }
+
+ }, this));
+
+ $(resize).mousemove(function(e)
+ {
+ if (clicked)
+ {
+ clicker = false;
+
+ var mouse_x = Math.round(e.pageX - $(this).eq(0).offset().left) - start_x;
+ var mouse_y = Math.round(e.pageY - $(this).eq(0).offset().top) - start_y;
+
+ var div_h = $(resize).height();
+
+ var new_h = parseInt(div_h, 10) + mouse_y;
+ var new_w = new_h*ratio;
+
+ if (new_w > min_w)
+ {
+ $(resize).width(new_w);
+ }
+
+ if (new_h > min_h)
+ {
+ $(resize).height(new_h);
+ }
+
+ start_x = Math.round(e.pageX - $(this).eq(0).offset().left);
+ start_y = Math.round(e.pageY - $(this).eq(0).offset().top);
+ }
+ });
+ },
+
+ // TABLE
+ showTable: function()
+ {
+ this.saveSelection();
+
+ this.modalInit(RLANG.table, this.opts.modal_table, 300, $.proxy(function()
+ {
+ $('#redactor_insert_table_btn').click($.proxy(this.insertTable, this));
+
+ setTimeout(function()
+ {
+ $('#redactor_table_rows').focus();
+ }, 200);
+
+ }, this)
+ );
+ },
+ insertTable: function()
+ {
+ var rows = $('#redactor_table_rows').val();
+ var columns = $('#redactor_table_columns').val();
+
+ var table_box = $('
');
+
+ var tableid = Math.floor(Math.random() * 99999);
+ var table = $('');
+
+ for (var i = 0; i < rows; i++)
+ {
+ var row = $(' ');
+ for (var z = 0; z < columns; z++)
+ {
+ var column = $(' ');
+ $(row).append(column);
+ }
+ $(table).append(row);
+ }
+
+ $(table_box).append(table);
+ var html = $(table_box).html() + '
';
+
+ this.restoreSelection();
+ this.execCommand('inserthtml', html);
+ this.modalClose();
+ this.observeTables();
+
+ },
+ tableObserver: function(e)
+ {
+ this.$table = $(e.target).closest('table');
+
+ this.$table_tr = this.$table.find('tr');
+ this.$table_td = this.$table.find('td');
+
+ this.$tbody = $(e.target).closest('tbody');
+ this.$thead = $(this.$table).find('thead');
+
+ this.$current_td = $(e.target);
+ this.$current_tr = $(e.target).closest('tr');
+ },
+ deleteTable: function()
+ {
+ $(this.$table).remove();
+ this.$table = false;
+ this.syncCode();
+ },
+ deleteRow: function()
+ {
+ $(this.$current_tr).remove();
+ this.syncCode();
+ },
+ deleteColumn: function()
+ {
+ var index = $(this.$current_td).get(0).cellIndex;
+
+ $(this.$table).find('tr').each(function()
+ {
+ $(this).find('td').eq(index).remove();
+ });
+
+ this.syncCode();
+ },
+ addHead: function()
+ {
+ if ($(this.$table).find('thead').size() !== 0)
+ {
+ this.deleteHead();
+ }
+ else
+ {
+ var tr = $(this.$table).find('tr').first().clone();
+ tr.find('td').html(' ');
+ this.$thead = $(' ');
+ this.$thead.append(tr);
+ $(this.$table).prepend(this.$thead);
+ this.syncCode();
+ }
+ },
+ deleteHead: function()
+ {
+ $(this.$thead).remove();
+ this.$thead = false;
+ this.syncCode();
+ },
+ insertRowAbove: function()
+ {
+ this.insertRow('before');
+ },
+ insertRowBelow: function()
+ {
+ this.insertRow('after');
+ },
+ insertColumnLeft: function()
+ {
+ this.insertColumn('before');
+ },
+ insertColumnRight: function()
+ {
+ this.insertColumn('after');
+ },
+ insertRow: function(type)
+ {
+ var new_tr = $(this.$current_tr).clone();
+ new_tr.find('td').html(' ');
+ if (type === 'after')
+ {
+ $(this.$current_tr).after(new_tr);
+ }
+ else
+ {
+ $(this.$current_tr).before(new_tr);
+ }
+
+ this.syncCode();
+ },
+ insertColumn: function(type)
+ {
+ var index = 0;
+
+ this.$current_tr.find('td').each($.proxy(function(i,s)
+ {
+ if ($(s)[0] === this.$current_td[0])
+ {
+ index = i;
+ }
+ }, this));
+
+ this.$table_tr.each(function(i,s)
+ {
+ var current = $(s).find('td').eq(index);
+
+ var td = current.clone();
+ td.html(' ');
+
+ if (type === 'after')
+ {
+ $(current).after(td);
+ }
+ else
+ {
+ $(current).before(td);
+ }
+
+ });
+
+ this.syncCode();
+ },
+
+ // INSERT VIDEO
+ showVideo: function()
+ {
+ this.saveSelection();
+ this.modalInit(RLANG.video, this.opts.modal_video, 600, $.proxy(function()
+ {
+ $('#redactor_insert_video_btn').click($.proxy(this.insertVideo, this));
+
+ setTimeout(function()
+ {
+ $('#redactor_insert_video_area').focus();
+ }, 200);
+
+ }, this)
+ );
+ },
+ insertVideo: function()
+ {
+ var data = $('#redactor_insert_video_area').val();
+ data = this.stripTags(data);
+
+ this.restoreSelection();
+ this.execCommand('inserthtml', data);
+ this.modalClose();
+ },
+
+ // INSERT IMAGE
+ imageEdit: function(e)
+ {
+ var $el = $(e.target);
+ var parent = $el.parent();
+
+ var callback = $.proxy(function()
+ {
+ $('#redactor_file_alt').val($el.attr('alt'));
+ $('#redactor_image_edit_src').attr('href', $el.attr('src'));
+ $('#redactor_form_image_align').val($el.css('float'));
+
+ if ($(parent).get(0).tagName === 'A')
+ {
+ $('#redactor_file_link').val($(parent).attr('href'));
+ }
+
+ $('#redactor_image_delete_btn').click($.proxy(function() { this.imageDelete($el); }, this));
+ $('#redactorSaveBtn').click($.proxy(function() { this.imageSave($el); }, this));
+
+ }, this);
+
+ this.modalInit(RLANG.image, this.opts.modal_image_edit, 380, callback);
+
+ },
+ imageDelete: function(el)
+ {
+ $(el).remove();
+ this.modalClose();
+ this.syncCode();
+ },
+ imageSave: function(el)
+ {
+ var parent = $(el).parent();
+
+ $(el).attr('alt', $('#redactor_file_alt').val());
+
+ var floating = $('#redactor_form_image_align').val();
+
+ if (floating === 'left')
+ {
+ $(el).css({ 'float': 'left', margin: '0 10px 10px 0' });
+ }
+ else if (floating === 'right')
+ {
+ $(el).css({ 'float': 'right', margin: '0 0 10px 10px' });
+ }
+ else
+ {
+ $(el).css({ 'float': 'none', margin: '0' });
+ }
+
+ // as link
+ var link = $.trim($('#redactor_file_link').val());
+ if (link !== '')
+ {
+ if ($(parent).get(0).tagName !== 'A')
+ {
+ $(el).replaceWith('' + this.outerHTML(el) + ' ');
+ }
+ else
+ {
+ $(parent).attr('href', link);
+ }
+ }
+ else
+ {
+ if ($(parent).get(0).tagName === 'A')
+ {
+ $(parent).replaceWith(this.outerHTML(el));
+ }
+ }
+
+ this.modalClose();
+ this.observeImages();
+ this.syncCode();
+
+ },
+ showImage: function()
+ {
+ this.saveSelection();
+
+ var callback = $.proxy(function()
+ {
+ // json
+ if (this.opts.imageGetJson !== false)
+ {
+ $.getJSON(this.opts.imageGetJson, $.proxy(function(data) {
+
+ var folders = {};
+ var z = 0;
+
+ // folders
+ $.each(data, $.proxy(function(key, val)
+ {
+ if (typeof val.folder !== 'undefined')
+ {
+ z++;
+ folders[val.folder] = z;
+ }
+
+ }, this));
+
+ var folderclass = false;
+ $.each(data, $.proxy(function(key, val)
+ {
+ // title
+ var thumbtitle = '';
+ if (typeof val.title !== 'undefined')
+ {
+ thumbtitle = val.title;
+ }
+
+ var folderkey = 0;
+ if (!$.isEmptyObject(folders) && typeof val.folder !== 'undefined')
+ {
+ folderkey = folders[val.folder];
+ if (folderclass === false)
+ {
+ folderclass = '.redactorfolder' + folderkey;
+ }
+ }
+
+ var img = $(' ');
+ $('#redactor_image_box').append(img);
+ $(img).click($.proxy(this.imageSetThumb, this));
+
+
+ }, this));
+
+ // folders
+ if (!$.isEmptyObject(folders))
+ {
+ $('.redactorfolder').hide();
+ $(folderclass).show();
+
+ var onchangeFunc = function(e)
+ {
+ $('.redactorfolder').hide();
+ $('.redactorfolder' + $(e.target).val()).show();
+ }
+
+ var select = $('');
+ $.each(folders, function(k,v)
+ {
+ select.append($('' + k + ' '));
+ });
+
+ $('#redactor_image_box').before(select);
+ select.change(onchangeFunc);
+ }
+
+ }, this));
+ }
+ else
+ {
+ $('#redactor_tabs a').eq(1).remove();
+ }
+
+ if (this.opts.imageUpload !== false)
+ {
+
+ // dragupload
+ if (this.opts.uploadCrossDomain === false && this.isMobile() === false)
+ {
+
+ if ($('#redactor_file').size() !== 0)
+ {
+ $('#redactor_file').dragupload(
+ {
+ url: this.opts.imageUpload,
+ uploadFields: this.opts.uploadFields,
+ success: $.proxy(this.imageUploadCallback, this),
+ error: $.proxy(this.opts.imageUploadErrorCallback, this)
+ });
+ }
+ }
+
+ // ajax upload
+ this.uploadInit('redactor_file',
+ {
+ auto: true,
+ url: this.opts.imageUpload,
+ success: $.proxy(this.imageUploadCallback, this),
+ error: $.proxy(this.opts.imageUploadErrorCallback, this)
+ });
+ }
+ else
+ {
+ $('.redactor_tab').hide();
+ if (this.opts.imageGetJson === false)
+ {
+ $('#redactor_tabs').remove();
+ $('#redactor_tab3').show();
+ }
+ else
+ {
+ var tabs = $('#redactor_tabs a');
+ tabs.eq(0).remove();
+ tabs.eq(1).addClass('redactor_tabs_act');
+ $('#redactor_tab2').show();
+ }
+ }
+
+ $('#redactor_upload_btn').click($.proxy(this.imageUploadCallbackLink, this));
+
+ if (this.opts.imageUpload === false && this.opts.imageGetJson === false)
+ {
+ setTimeout(function()
+ {
+ $('#redactor_file_link').focus();
+ }, 200);
+
+ }
+
+ }, this);
+
+ this.modalInit(RLANG.image, this.opts.modal_image, 610, callback);
+
+ },
+ imageSetThumb: function(e)
+ {
+ this._imageSet(' ', true);
+ },
+ imageUploadCallbackLink: function()
+ {
+ if ($('#redactor_file_link').val() !== '')
+ {
+ var data = ' ';
+ this._imageSet(data, true);
+ }
+ else
+ {
+ this.modalClose();
+ }
+ },
+ imageUploadCallback: function(data)
+ {
+ this._imageSet(data);
+ },
+ _imageSet: function(json, link)
+ {
+ this.restoreSelection();
+
+ if (json !== false)
+ {
+ var html = '';
+ if (link !== true)
+ {
+ html = '
';
+ }
+ else
+ {
+ html = json;
+ }
+
+ this.execCommand('inserthtml', html);
+
+ // upload image callback
+ if (link !== true && typeof this.opts.imageUploadCallback === 'function')
+ {
+ this.opts.imageUploadCallback(this, json);
+ }
+ }
+
+ this.modalClose();
+ this.observeImages();
+ },
+
+ // INSERT LINK
+ showLink: function()
+ {
+ this.saveSelection();
+
+ var callback = $.proxy(function()
+ {
+ this.insert_link_node = false;
+ var sel = this.getSelection();
+ var url = '', text = '', target = '';
+
+ if (this.browser('msie'))
+ {
+ var parent = this.getParentNode();
+ if (parent.nodeName === 'A')
+ {
+ this.insert_link_node = $(parent);
+ text = this.insert_link_node.text();
+ url = this.insert_link_node.attr('href');
+ target = this.insert_link_node.attr('target');
+ }
+ else
+ {
+ if (this.oldIE())
+ {
+ text = sel.text;
+ }
+ else
+ {
+ text = sel.toString();
+ }
+ }
+ }
+ else
+ {
+ if (sel && sel.anchorNode && sel.anchorNode.parentNode.tagName === 'A')
+ {
+ url = sel.anchorNode.parentNode.href;
+ text = sel.anchorNode.parentNode.text;
+ target = sel.anchorNode.parentNode.target;
+
+ if (sel.toString() === '')
+ {
+ this.insert_link_node = sel.anchorNode.parentNode;
+ }
+ }
+ else
+ {
+ text = sel.toString();
+ }
+ }
+
+ $('.redactor_link_text').val(text);
+
+ var thref = self.location.href.replace(/\/$/i, '');
+ var turl = url.replace(thref, '');
+
+ if (url.search('mailto:') === 0)
+ {
+ this.setModalTab(2);
+
+ $('#redactor_tab_selected').val(2);
+ $('#redactor_link_mailto').val(url.replace('mailto:', ''));
+ }
+ else if (turl.search(/^#/gi) === 0)
+ {
+ this.setModalTab(3);
+
+ $('#redactor_tab_selected').val(3);
+ $('#redactor_link_anchor').val(turl.replace(/^#/gi, ''));
+ }
+ else
+ {
+ $('#redactor_link_url').val(turl);
+ }
+
+ if (target === '_blank')
+ {
+ $('#redactor_link_blank').attr('checked', true);
+ }
+
+ $('#redactor_insert_link_btn').click($.proxy(this.insertLink, this));
+
+ setTimeout(function()
+ {
+ $('#redactor_link_url').focus();
+ }, 200);
+
+ }, this);
+
+ this.modalInit(RLANG.link, this.opts.modal_link, 460, callback);
+
+ },
+ insertLink: function()
+ {
+ var tab_selected = $('#redactor_tab_selected').val();
+ var link = '', text = '', target = '';
+
+ if (tab_selected === '1') // url
+ {
+ link = $('#redactor_link_url').val();
+ text = $('#redactor_link_url_text').val();
+
+ if ($('#redactor_link_blank').attr('checked'))
+ {
+ target = ' target="_blank"';
+ }
+
+ // test url
+ var pattern = '/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/';
+ //var pattern = '((xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}';
+ var re = new RegExp('^(http|ftp|https)://' + pattern,'i');
+ var re2 = new RegExp('^' + pattern,'i');
+ if (link.search(re) == -1 && link.search(re2) == 0 && this.opts.protocol !== false)
+ {
+ link = this.opts.protocol + link;
+ }
+
+ }
+ else if (tab_selected === '2') // mailto
+ {
+ link = 'mailto:' + $('#redactor_link_mailto').val();
+ text = $('#redactor_link_mailto_text').val();
+ }
+ else if (tab_selected === '3') // anchor
+ {
+ link = '#' + $('#redactor_link_anchor').val();
+ text = $('#redactor_link_anchor_text').val();
+ }
+
+ this._insertLink('' + text + ' ', $.trim(text), link, target);
+
+ },
+ _insertLink: function(a, text, link, target)
+ {
+ this.$editor.focus();
+ this.restoreSelection();
+
+ if (text !== '')
+ {
+ if (this.insert_link_node)
+ {
+ $(this.insert_link_node).text(text);
+ $(this.insert_link_node).attr('href', link);
+ if (target !== '')
+ {
+ $(this.insert_link_node).attr('target', target);
+ }
+ else
+ {
+ $(this.insert_link_node).removeAttr('target');
+ }
+
+ this.syncCode();
+ }
+ else
+ {
+ this.execCommand('inserthtml', a);
+ }
+ }
+
+ this.modalClose();
+ },
+
+ // INSERT FILE
+ showFile: function()
+ {
+ this.saveSelection();
+
+ var callback = $.proxy(function()
+ {
+ var sel = this.getSelection();
+
+ var text = '';
+
+ if (this.oldIE())
+ {
+ text = sel.text;
+ }
+ else
+ {
+ text = sel.toString();
+ }
+
+ $('#redactor_filename').val(text);
+
+ // dragupload
+ if (this.opts.uploadCrossDomain === false && this.isMobile() === false)
+ {
+ $('#redactor_file').dragupload(
+ {
+ url: this.opts.fileUpload,
+ uploadFields: this.opts.uploadFields,
+ success: $.proxy(this.fileUploadCallback, this),
+ error: $.proxy(this.opts.fileUploadErrorCallback, this)
+ });
+ }
+
+ this.uploadInit('redactor_file',
+ {
+ auto: true,
+ url: this.opts.fileUpload,
+ success: $.proxy(this.fileUploadCallback, this),
+ error: $.proxy(this.opts.fileUploadErrorCallback, this)
+ });
+
+ }, this);
+
+ this.modalInit(RLANG.file, this.opts.modal_file, 500, callback);
+ },
+ fileUploadCallback: function(json)
+ {
+ this.restoreSelection();
+
+ if (json !== false)
+ {
+ var text = $('#redactor_filename').val();
+
+ if (text === '')
+ {
+ text = json.filename;
+ }
+
+ var link = '' + text + ' ';
+
+ // chrome fix
+ if (this.browser('webkit') && !!this.window.chrome)
+ {
+ link = link + ' ';
+ }
+
+ this.execCommand('inserthtml', link);
+
+ // file upload callback
+ if (typeof this.opts.fileUploadCallback === 'function')
+ {
+ this.opts.fileUploadCallback(this, json);
+ }
+ }
+
+ this.modalClose();
+ },
+
+
+
+ // MODAL
+ modalInit: function(title, content, width, callback)
+ {
+ // modal overlay
+ if ($('#redactor_modal_overlay').size() === 0)
+ {
+ this.overlay = $('
');
+ $('body').prepend(this.overlay);
+ }
+
+ if (this.opts.overlay)
+ {
+ $('#redactor_modal_overlay').show();
+ $('#redactor_modal_overlay').click($.proxy(this.modalClose, this));
+ }
+
+ if ($('#redactor_modal').size() === 0)
+ {
+ this.modal = $('');
+ $('body').append(this.modal);
+ }
+
+ $('#redactor_modal_close').click($.proxy(this.modalClose, this));
+
+ this.hdlModalClose = $.proxy(function(e) { if ( e.keyCode === 27) { this.modalClose(); return false; } }, this);
+
+ $(document).keyup(this.hdlModalClose);
+ this.$editor.keyup(this.hdlModalClose);
+
+ // set content
+ if (content.indexOf('#') == 0)
+ {
+ $('#redactor_modal_inner').empty().append($(content).html());
+ }
+ else
+ {
+ $('#redactor_modal_inner').empty().append(content);
+ }
+
+
+ $('#redactor_modal_header').html(title);
+
+ // draggable
+ if (typeof $.fn.draggable !== 'undefined')
+ {
+ $('#redactor_modal').draggable({ handle: '#redactor_modal_header' });
+ $('#redactor_modal_header').css('cursor', 'move');
+ }
+
+ // tabs
+ if ($('#redactor_tabs').size() !== 0)
+ {
+ var that = this;
+ $('#redactor_tabs a').each(function(i,s)
+ {
+ i++;
+ $(s).click(function()
+ {
+ $('#redactor_tabs a').removeClass('redactor_tabs_act');
+ $(this).addClass('redactor_tabs_act');
+ $('.redactor_tab').hide();
+ $('#redactor_tab' + i).show();
+ $('#redactor_tab_selected').val(i);
+
+ if (that.isMobile() === false)
+ {
+ var height = $('#redactor_modal').outerHeight();
+ $('#redactor_modal').css('margin-top', '-' + (height+10)/2 + 'px');
+ }
+ });
+ });
+ }
+
+ $('#redactor_modal .redactor_btn_modal_close').click($.proxy(this.modalClose, this));
+
+ if (this.isMobile() === false)
+ {
+ $('#redactor_modal').css({ position: 'fixed', top: '-2000px', left: '50%', width: width + 'px', marginLeft: '-' + (width+60)/2 + 'px' }).show();
+
+ this.modalSaveBodyOveflow = $(document.body).css('overflow');
+ $(document.body).css('overflow', 'hidden');
+ }
+ else
+ {
+ $('#redactor_modal').css({ position: 'fixed', width: '100%', height: '100%', top: '0', left: '0', margin: '0', minHeight: '300px' }).show();
+ }
+
+ // callback
+ if (typeof callback === 'function')
+ {
+ callback();
+ }
+
+ if (this.isMobile() === false)
+ {
+ setTimeout(function()
+ {
+ var height = $('#redactor_modal').outerHeight();
+ $('#redactor_modal').css({ top: '50%', height: 'auto', minHeight: 'auto', marginTop: '-' + (height+10)/2 + 'px' });
+
+ }, 20);
+ }
+
+ },
+ modalClose: function()
+ {
+ $('#redactor_modal_close').unbind('click', this.modalClose);
+ $('#redactor_modal').fadeOut('fast', $.proxy(function()
+ {
+ $('#redactor_modal_inner').html('');
+
+ if (this.opts.overlay)
+ {
+ $('#redactor_modal_overlay').hide();
+ $('#redactor_modal_overlay').unbind('click', this.modalClose);
+ }
+
+ $(document).unbind('keyup', this.hdlModalClose);
+ this.$editor.unbind('keyup', this.hdlModalClose);
+
+ }, this));
+
+
+ if (this.isMobile() === false)
+ {
+ $(document.body).css('overflow', this.modalSaveBodyOveflow ? this.modalSaveBodyOveflow : 'visible');
+ }
+
+ return false;
+
+ },
+ setModalTab: function(num)
+ {
+ $('.redactor_tab').hide();
+ var tabs = $('#redactor_tabs a');
+ tabs.removeClass('redactor_tabs_act');
+ tabs.eq(num-1).addClass('redactor_tabs_act');
+ $('#redactor_tab' + num).show();
+ },
+
+ // UPLOAD
+ uploadInit: function(element, options)
+ {
+ // Upload Options
+ this.uploadOptions = {
+ url: false,
+ success: false,
+ error: false,
+ start: false,
+ trigger: false,
+ auto: false,
+ input: false
+ };
+
+ $.extend(this.uploadOptions, options);
+
+ // Test input or form
+ if ($('#' + element).size() !== 0 && $('#' + element).get(0).tagName === 'INPUT')
+ {
+ this.uploadOptions.input = $('#' + element);
+ this.element = $($('#' + element).get(0).form);
+ }
+ else
+ {
+ this.element = $('#' + element);
+ }
+
+ this.element_action = this.element.attr('action');
+
+ // Auto or trigger
+ if (this.uploadOptions.auto)
+ {
+ $(this.uploadOptions.input).change($.proxy(function()
+ {
+ this.element.submit(function(e) { return false; });
+ this.uploadSubmit();
+ }, this));
+
+ }
+ else if (this.uploadOptions.trigger)
+ {
+ $('#' + this.uploadOptions.trigger).click($.proxy(this.uploadSubmit, this));
+ }
+ },
+ uploadSubmit : function()
+ {
+ this.uploadForm(this.element, this.uploadFrame());
+ },
+ uploadFrame : function()
+ {
+ this.id = 'f' + Math.floor(Math.random() * 99999);
+
+ var d = this.document.createElement('div');
+ var iframe = ' ';
+ d.innerHTML = iframe;
+ $(d).appendTo("body");
+
+ // Start
+ if (this.uploadOptions.start)
+ {
+ this.uploadOptions.start();
+ }
+
+ $('#' + this.id).load($.proxy(this.uploadLoaded, this));
+
+ return this.id;
+ },
+ uploadForm : function(f, name)
+ {
+ if (this.uploadOptions.input)
+ {
+ var formId = 'redactorUploadForm' + this.id;
+ var fileId = 'redactorUploadFile' + this.id;
+ this.form = $(' ');
+
+ // append hidden fields
+ if (this.opts.uploadFields !== false && typeof this.opts.uploadFields === 'object')
+ {
+ $.each(this.opts.uploadFields, $.proxy(function(k,v)
+ {
+ if (v.toString().indexOf('#') === 0)
+ {
+ v = $(v).val();
+ }
+
+ var hidden = $(' ', {'type': "hidden", 'name': k, 'value': v});
+ $(this.form).append(hidden);
+
+ }, this));
+ }
+
+ var oldElement = this.uploadOptions.input;
+ var newElement = $(oldElement).clone();
+ $(oldElement).attr('id', fileId);
+ $(oldElement).before(newElement);
+ $(oldElement).appendTo(this.form);
+ $(this.form).css('position', 'absolute');
+ $(this.form).css('top', '-2000px');
+ $(this.form).css('left', '-2000px');
+ $(this.form).appendTo('body');
+
+ this.form.submit();
+ }
+ else
+ {
+ f.attr('target', name);
+ f.attr('method', 'POST');
+ f.attr('enctype', 'multipart/form-data');
+ f.attr('action', this.uploadOptions.url);
+
+ this.element.submit();
+ }
+
+ },
+ uploadLoaded : function()
+ {
+ var i = $('#' + this.id)[0];
+ var d;
+
+ if (i.contentDocument)
+ {
+ d = i.contentDocument;
+ }
+ else if (i.contentWindow)
+ {
+ d = i.contentWindow.document;
+ }
+ else
+ {
+ d = window.frames[this.id].document;
+ }
+
+ // Success
+ if (this.uploadOptions.success)
+ {
+ if (typeof d !== 'undefined')
+ {
+ // Remove bizarre tag wrappers around our json data:
+ var rawString = d.body.innerHTML;
+ var jsonString = rawString.match(/\{(.|\n)*\}/)[0];
+ var json = $.parseJSON(jsonString);
+
+ if (typeof json.error == 'undefined')
+ {
+ this.uploadOptions.success(json);
+ }
+ else
+ {
+ this.uploadOptions.error(this, json);
+ this.modalClose();
+ }
+ }
+ else
+ {
+ alert('Upload failed!');
+ this.modalClose();
+ }
+ }
+
+ this.element.attr('action', this.element_action);
+ this.element.attr('target', '');
+
+ },
+
+ // UTILITY
+ browser: function(browser)
+ {
+ var ua = navigator.userAgent.toLowerCase();
+ var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || /(webkit)[ \/]([\w.]+)/.exec(ua) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || /(msie) ([\w.]+)/.exec(ua) || ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || [];
+
+ if (browser == 'version')
+ {
+ return match[2];
+ }
+
+ if (browser == 'webkit')
+ {
+ return (match[1] == 'chrome' || match[1] == 'webkit');
+ }
+
+ return match[1] == browser;
+ },
+ oldIE: function()
+ {
+ if (this.browser('msie') && parseInt(this.browser('version'), 10) < 9)
+ {
+ return true;
+ }
+
+ return false;
+ },
+ outerHTML: function(s)
+ {
+ return $("").append($(s).eq(0).clone()).html();
+ },
+ normalize: function(str)
+ {
+ return parseInt(str.replace('px',''), 10);
+ },
+ isMobile: function(ipad)
+ {
+ if (ipad === true && /(iPhone|iPod|iPad|BlackBerry|Android)/.test(navigator.userAgent))
+ {
+ return true;
+ }
+ else if (/(iPhone|iPod|BlackBerry|Android)/.test(navigator.userAgent))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ };
+
+
+ // API
+ $.fn.getObject = function()
+ {
+ return this.data('redactor');
+ };
+
+ $.fn.getEditor = function()
+ {
+ return this.data('redactor').$editor;
+ };
+
+ $.fn.getCode = function()
+ {
+ return $.trim(this.data('redactor').getCode());
+ };
+
+ $.fn.getText = function()
+ {
+ return this.data('redactor').$editor.text();
+ };
+
+ $.fn.getSelected = function()
+ {
+ return this.data('redactor').getSelectedHtml();
+ };
+
+ $.fn.setCode = function(html)
+ {
+ this.data('redactor').setCode(html);
+ };
+
+ $.fn.insertHtml = function(html)
+ {
+ this.data('redactor').insertHtml(html);
+ };
+
+ $.fn.destroyEditor = function()
+ {
+ this.each(function()
+ {
+ if (typeof $(this).data('redactor') != 'undefined')
+ {
+ $(this).data('redactor').destroy();
+ $(this).removeData('redactor');
+ }
+ });
+ };
+
+ $.fn.setFocus = function()
+ {
+ this.data('redactor').$editor.focus();
+ };
+
+ $.fn.execCommand = function(cmd, param)
+ {
+ this.data('redactor').execCommand(cmd, param);
+ };
+
+})(jQuery);
+
+/*
+ Plugin Drag and drop Upload v1.0.2
+ http://imperavi.com/
+ Copyright 2012, Imperavi Inc.
+*/
+(function($){
+
+ "use strict";
+
+ // Initialization
+ $.fn.dragupload = function(options)
+ {
+ return this.each(function() {
+ var obj = new Construct(this, options);
+ obj.init();
+ });
+ };
+
+ // Options and variables
+ function Construct(el, options) {
+
+ this.opts = $.extend({
+
+ url: false,
+ success: false,
+ error: false,
+ preview: false,
+ uploadFields: false,
+
+ text: RLANG.drop_file_here,
+ atext: RLANG.or_choose
+
+ }, options);
+
+ this.$el = $(el);
+ }
+
+ // Functionality
+ Construct.prototype = {
+ init: function()
+ {
+ if (navigator.userAgent.search("MSIE") === -1)
+ {
+ this.droparea = $('
');
+ this.dropareabox = $('' + this.opts.text + '
');
+ this.dropalternative = $('' + this.opts.atext + '
');
+
+ this.droparea.append(this.dropareabox);
+
+ this.$el.before(this.droparea);
+ this.$el.before(this.dropalternative);
+
+ // drag over
+ this.dropareabox.bind('dragover', $.proxy(function() { return this.ondrag(); }, this));
+
+ // drag leave
+ this.dropareabox.bind('dragleave', $.proxy(function() { return this.ondragleave(); }, this));
+
+ var uploadProgress = $.proxy(function(e)
+ {
+ var percent = parseInt(e.loaded / e.total * 100, 10);
+ this.dropareabox.text('Loading ' + percent + '%');
+
+ }, this);
+
+ var xhr = jQuery.ajaxSettings.xhr();
+
+ if (xhr.upload)
+ {
+ xhr.upload.addEventListener('progress', uploadProgress, false);
+ }
+
+ var provider = function () { return xhr; };
+
+ // drop
+ this.dropareabox.get(0).ondrop = $.proxy(function(event)
+ {
+ event.preventDefault();
+
+ this.dropareabox.removeClass('hover').addClass('drop');
+
+ var file = event.dataTransfer.files[0];
+ var fd = new FormData();
+
+ // append hidden fields
+ if (this.opts.uploadFields !== false && typeof this.opts.uploadFields === 'object')
+ {
+ $.each(this.opts.uploadFields, $.proxy(function(k,v)
+ {
+ if (v.toString().indexOf('#') === 0)
+ {
+ v = $(v).val();
+ }
+
+ fd.append(k, v);
+
+ }, this));
+ }
+
+ // append file data
+ fd.append('file', file);
+
+ $.ajax({
+ url: this.opts.url,
+ dataType: 'html',
+ data: fd,
+ xhr: provider,
+ cache: false,
+ contentType: false,
+ processData: false,
+ type: 'POST',
+ success: $.proxy(function(data)
+ {
+ var json = $.parseJSON(data);
+
+ if (typeof json.error == 'undefined')
+ {
+ this.opts.success(json);
+ }
+ else
+ {
+ this.opts.error(this, json);
+ this.opts.success(false);
+ }
+
+ }, this)
+ });
+
+
+ }, this);
+ }
+ },
+ ondrag: function()
+ {
+ this.dropareabox.addClass('hover');
+ return false;
+ },
+ ondragleave: function()
+ {
+ this.dropareabox.removeClass('hover');
+ return false;
+ }
+ };
+
+})(jQuery);
+
+
+
+// Define: Linkify plugin from stackoverflow
+(function($){
+
+ "use strict";
+
+ var protocol = 'http://';
+ var url1 = /(^|<|\s)(www\..+?\..+?)(\s|>|$)/g,
+ url2 = /(^|<|\s)(((https?|ftp):\/\/|mailto:).+?)(\s|>|$)/g,
+
+ linkifyThis = function ()
+ {
+ var childNodes = this.childNodes,
+ i = childNodes.length;
+ while(i--)
+ {
+ var n = childNodes[i];
+ if (n.nodeType === 3)
+ {
+ var html = n.nodeValue;
+ if (html)
+ {
+ html = html.replace(/&/g, '&')
+ .replace(//g, '>')
+ .replace(url1, '$1$2 $3')
+ .replace(url2, '$1$2 $5');
+
+ $(n).after(html).remove();
+ }
+ }
+ else if (n.nodeType === 1 && !/^(a|button|textarea)$/i.test(n.tagName))
+ {
+ linkifyThis.call(n);
+ }
+ }
+ };
+
+ $.fn.linkify = function ()
+ {
+ this.each(linkifyThis);
+ };
+
+})(jQuery);
+
+
+/* jQuery plugin textselect
+ * version: 0.9
+ * author: Josef Moravec, josef.moravec@gmail.com
+ * updated: Imperavi Inc.
+ *
+ */
+eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(5($){$.1.4.7={t:5(0,v){$(2).0("8",c);$(2).0("r",0);$(2).l(\'g\',$.1.4.7.b)},u:5(0){$(2).w(\'g\',$.1.4.7.b)},b:5(1){9 0=$(2).0("r");9 3=$.1.4.7.f(0).h();6(3!=\'\'){$(2).0("8",x);1.j="7";1.3=3;$.1.i.m(2,k)}},f:5(0){9 3=\'\';6(q.e){3=q.e()}o 6(d.e){3=d.e()}o 6(d.p){3=d.p.B().3}A 3}};$.1.4.a={t:5(0,v){$(2).0("n",0);$(2).0("8",c);$(2).l(\'g\',$.1.4.a.b);$(2).l(\'D\',$.1.4.a.s)},u:5(0){$(2).w(\'g\',$.1.4.a.b)},b:5(1){6($(2).0("8")){9 0=$(2).0("n");9 3=$.1.4.7.f(0).h();6(3==\'\'){$(2).0("8",c);1.j="a";$.1.i.m(2,k)}}},s:5(1){6($(2).0("8")){9 0=$(2).0("n");9 3=$.1.4.7.f(0).h();6((1.y=z)&&(3==\'\')){$(2).0("8",c);1.j="a";$.1.i.m(2,k)}}}}})(C);',40,40,'data|event|this|text|special|function|if|textselect|textselected|var|textunselect|handler|false|rdocument|getSelection|getSelectedText|mouseup|toString|handle|type|arguments|bind|apply|rttt|else|selection|rwindow|ttt|handlerKey|setup|teardown|namespaces|unbind|true|keyCode|27|return|createRange|jQuery|keyup'.split('|'),0,{}))
\ No newline at end of file
diff --git a/app/assets/javascripts/public.js.coffee b/app/assets/javascripts/public.js.coffee
index ac084d2..d72770f 100644
--- a/app/assets/javascripts/public.js.coffee
+++ b/app/assets/javascripts/public.js.coffee
@@ -1,11 +1,21 @@
-#= require jquery
-
+#= require ./shared/jquery
+#= require ./shared/jquery-ui
#= require jquery_ujs
+#= require ./shared/jquery.strings.js
+#= require ./shared/jquery.utils.js
+
+#= require ./admin/block
+#= require ./admin/image_files
+#= require ./admin/manager
+#= require ./admin/uploads
+#= require ./admin/redactor
+#= require ./admin/fr
+
$ ->
- #dfdf
\ No newline at end of file
+ #
\ No newline at end of file
diff --git a/app/assets/stylesheets/admin.css.scss b/app/assets/stylesheets/admin.css.scss
index f7ee795..c59df16 100644
--- a/app/assets/stylesheets/admin.css.scss
+++ b/app/assets/stylesheets/admin.css.scss
@@ -16,7 +16,7 @@
@import "admin/qi_core";
@import "admin/forms";
@import "admin/general";
-@import "admin/qi";
+
@@ -28,7 +28,7 @@
@import "admin/menu_items";
@import "admin/articles";
-@import "admin/wisihtml5";
+@import "admin/redactor";
@import "shared/wysiwg";
@@ -38,26 +38,6 @@
-ol {
- &.code {
- color: ($main-color*90);
- font: 0.875em / 1.714 Menlo, Monaco, "Courier New", Courier, monospace;
- margin: 1.1429em 0 1.1429em 2.8571em; }
- &.code li {
- list-style: decimal-leading-zero;
- background: #f0f0f0;
- margin: 0 0 -1px 0;
- border-top: 1px solid #fff;
- padding: 0 0.5em; }
- &.code li code {
- font-size: 1em; }
- }
-
-
-
-
-
-
.text_panel{
@include border-radius(5px);
@@ -72,27 +52,7 @@ ol {
position:relative;
-
- &:before,
- &:after {
- content:"";
- position:absolute;
- z-index:-1;
- bottom:15px;
- left:10px;
- width:50%;
- height:20%;
- max-width:300px;
-
- @include box-shadow(rgba(0, 0, 0, 0.7) 0 20px 15px );
- @include transform(rotate(-3deg));
- }
-
- &:after{
- right:10px;
- left:auto;
- @include transform(rotate(3deg));
- }
+ @include box-shadow(rgba(0, 0, 0, 0.5) 1px 1px 5px);
@@ -133,32 +93,6 @@ ol {
-
- &:before,
- &:after {
- content:"";
- position:absolute;
- z-index:-1;
- bottom:15px;
- left:10px;
- width:50%;
- height:20%;
- max-width:300px;
-
- @include box-shadow(rgba(0, 0, 0, 0.7) 0 20px 15px );
- @include transform(rotate(-3deg));
- }
-
- &:after{
- right:10px;
- left:auto;
- @include transform(rotate(3deg));
- }
-
-
-
-
-
display:block;
padding:15px;
@@ -175,21 +109,10 @@ ol {
height:100px;
}
+ @include box-shadow(rgba(0, 0, 0, 0.5) 1px 1px 5px);
- &:hover{
- @include border-radius(5px 5px 12px 5px / 5px 5px 25px 5px);
- @include background-image(linear-gradient(bottom right, #cccccc, white 10%,white));
- &:after{
-
-
- @include transform(rotate(10deg));
-
-
- }
-
- }
}
diff --git a/app/assets/stylesheets/admin/menu_items.css.scss b/app/assets/stylesheets/admin/menu_items.css.scss
index 7909943..df9013d 100644
--- a/app/assets/stylesheets/admin/menu_items.css.scss
+++ b/app/assets/stylesheets/admin/menu_items.css.scss
@@ -94,26 +94,25 @@
position:fixed;
- top:1%;
- right:1%;
+ top:0px;
+ right:0px;
z-index:1000;
- background:url('/assets/admin/backgrounds/bg-white.jpg') black;
- bottom:1%;
- width:98%;
+ background:#fbfbfb;
+ bottom:0px;
+ width:100%;
display:none;
margin-right:-100%;
- @include border-radius(10px 10px 7px 7px);
+
- @include box-shadow(0px 0px 5px rgba(0,0,0,0.8));
overflow:hidden;
- @include transform(scale(0.2));
- @include transition-duration(5s);
+
+ @include transition-duration(0.8s);
#content_types_draggables{
text-align:center;
@@ -136,7 +135,7 @@
left:0px;
right:0px;
padding:0px;
- @include border-radius(7px 0px 0px 0px);
+
h1{
font-family:'Gill Sans' ;
color:black;
@@ -160,7 +159,7 @@
right:0px;
bottom:0px;
- @include border-radius(0px 0px 7px 0px);
+
background:rgba(0,0,0,0.9);
h3{
diff --git a/app/assets/stylesheets/admin/public_admin.css.scss b/app/assets/stylesheets/admin/public_admin.css.scss
new file mode 100644
index 0000000..e95ab95
--- /dev/null
+++ b/app/assets/stylesheets/admin/public_admin.css.scss
@@ -0,0 +1,13 @@
+body{
+
+#edit_toolbar{
+position:fixed;
+top:0px;
+left:0px;
+bottom:0px;
+width:100px;
+background:black;
+
+}
+
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/admin/qi.scss b/app/assets/stylesheets/admin/qi.scss
deleted file mode 100644
index ea68d22..0000000
--- a/app/assets/stylesheets/admin/qi.scss
+++ /dev/null
@@ -1,58 +0,0 @@
-.QI_background_middle {
- background-color: #e2eef7; }
-
-.QI_background_middle_alt1 {
- background-color: #a9d64b; }
-
-.QI_padding_small {
- padding: 5px; }
-
-.QI_padding {
- padding: 10px; }
-
-.QI_table_alternate_alt1 tr {
- background-color: white; }
-
-
-.QI_table_alternate_alt1 tr:nth-child(odd) {
- background-color: #ebf4fa; }
-
-
-.QI_background_resize {
- background-position: center center;
- background-repeat: no-repeat;
- background-size: contain;
- -moz-background-size: contain;
- -webkit-background-size: contain; }
-
-.QI_box_shadow {
- -webkit-box-shadow: #AFAFAF 0px 0px 5px;
- -moz-box-shadow: #AFAFAF 0px 0px 5px;
- box-shadow: #AFAFAF 0px 0px 5px; }
-
-.QI_font_alt1 {
- font-family: Georgia; }
-
-.QI_font {
- font-family: Lucida grande; }
-
-.QI_color_white {
- color: white; }
-
-
-
-.bar_transparent_dark{
- background:rgba(0,0,0,0.8);
-
- height:34px;
-
-}
-
-.position_absolute_bottom{
- position:absolute;
- bottom:0px;
- right:0px;
- left:0px;
-
-}
-
diff --git a/app/assets/stylesheets/admin/qi_cms.css.scss b/app/assets/stylesheets/admin/qi_cms.css.scss
index 0ca8c19..6059185 100644
--- a/app/assets/stylesheets/admin/qi_cms.css.scss
+++ b/app/assets/stylesheets/admin/qi_cms.css.scss
@@ -1,3 +1,16 @@
+.menu_item_informations{
+
+position:fixed;
+top:1em;
+left:1em;
+width:300px;
+background:rgba(0,0,0,0.8);
+z-index:2;
+color:white;
+
+
+}
+
.separate_alt1{
@@ -7,7 +20,7 @@
}
-/* blocks.css */
+
.portlet_place_holder{
width:100%;
height:15px;
@@ -107,9 +120,7 @@
.portlet .render_admin.render_admin_block_content .col_1{
padding-right:11px;
margin-right:0px;
- //border-right:1px dotted rgb(127,127,127);
-
-}
+ }
@@ -126,10 +137,7 @@
}
-.portlet_hover .render_admin.render_admin_block_content .col_1{
-
- //border-right:1px solid rgb(127,127,127);
-}
+
.portlet.portlet_table_content {
diff --git a/app/assets/stylesheets/admin/qi_core.css.scss b/app/assets/stylesheets/admin/qi_core.css.scss
index b78c754..1a1394f 100644
--- a/app/assets/stylesheets/admin/qi_core.css.scss
+++ b/app/assets/stylesheets/admin/qi_core.css.scss
@@ -17,63 +17,6 @@
}
-body {
- -webkit-font-smoothing: antialiased;
- width:100%;
- font-size: 13px;
- font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, Arial, Verdana, sans-serif;
- padding: 0px;
- margin: 0px;
- background:url('/assets/admin/backgrounds/white_oak.png');
-
-
- &.wysihtml5-editor{
- background:transparent;
- }
-
-}
-
-
-
-/* bar.css */
-
-.bar{
- padding:10px;
-
-}
-
-.bar a{
- padding:5px;
-
-}
-
-.bar a.active{
- padding:5px;
-
- border-radius:10px;
- -moz-border-radius:5px;
-
-
-}
-
-
-.bar.dark_blue{
- background:#6FB7E9;
-
-
-}
-
-.bar.dark_blue a{
- color:white;
-
-}
-
-.bar.dark_blue a.active{
- color:#6FB7E9;
- background:white;
-
-}
-
@@ -108,33 +51,9 @@ body {
}
-.main_slide{
- width: 100%;
- min-height:600px;
-
- margin: auto;
-
-
-
-}
-
-.header{
- background:#6FB7E9;
- padding:16px;
-
-}
-
-.header h1{
-
- color:#ffffff;
-
- font-family:georgia;
- text-shadow: #357EB0 1px 1px 0px;
- font-size:20px;
-}
.right{
float:right;
@@ -312,34 +231,6 @@ body {
.menu_item_position td {
padding: 0px; }
-.exportation {
- color: #484848;
- padding: 5px; }
- .exportation em {
- text-decoration: none;
- padding: 2px 5px 2px 5px;
- border-radius: 10px;
- text-decoration: none;
- color: #484848;
- font-style: normal;
- margin-right: -3px;
- font-weight: normal;
- background-color: #ebf2fe; }
- .exportation a {
- text-decoration: none;
- padding: 1px 5px 2px 5px;
- text-decoration: none;
- margin-right: 2px;
- font-weight: normal;
- border-radius: 10px;
- background-color: #ebf2fe;
- color: #484848; }
- .exportation a:hover {
- padding: 2px 5px 2px 5px;
- margin-right: 2px;
- font-weight: bold;
- background-color: #484848;
- color: white; }
/* manager.css */
#manager_box_place{
@@ -383,588 +274,7 @@ body {
-/* styled_blocks.css */
-.image_square{
- float:left;
- padding:5px;
- margin:5px;
- position:relative;
- border : 1px solid rgb(230,230,230);
- border-radius:10px;
- background:white;
-}
-.image_square:hover{
- border : 1px solid rgba(0,0,0,0.8);
-}
-.image_square .img{
- text-align:center;
- width:150px;
- height:150px;
- margin:0px;
- background-position:center center;
- background-repeat:no-repeat;
-
- background-size: contain;
- -moz-background-size: contain; /* Gecko 1.9.2 (Firefox 3.6) */
- -webkit-background-size: contain;/* Safari 3.0 */
-
-
-}
-
-.image_square:hover .actions{
- display:block;
- border:none;
- padding:0px;
- margin:0px;
- left:0px;
- top:0px;
-
- opacity:0.5;
- background :rgb(10,10,10);
-
-}
-
-.image_square:hover .actions:hover{
-
- opacity:1;
-
-}
-
-/* core/elements */
-a{
- color : #3C74A8;
- text-decoration:none;
-}
-
-a:hover{
- color:#3F94EB;
-}
-
-/* core/fluid_grid */
-/*
- Variable Grid System (Fluid Version).
- Learn more ~ http://www.spry-soft.com/grids/
- Based on 960 Grid System - http://960.gs/ & 960 Fluid - http://www.designinfluences.com/
-
- Licensed under GPL and MIT.
-*/
-
-
-/* Containers
-----------------------------------------------------------------------------------------------------*/
-.container_12 {
- width: 100%;
-/*
- margin-left: 4%;
- margin-right: 4%;
-*/
-}
-
-/* Grid >> Global
-----------------------------------------------------------------------------------------------------*/
-
-.grid_1,
-.grid_2,
-.grid_3,
-.grid_4,
-.grid_5,
-.grid_6,
-.grid_7,
-.grid_8,
-.grid_9,
-.grid_10,
-.grid_11,
-.grid_12 {
- display:inline;
- float: left;
- position: relative;
- margin-left: 1%;
- margin-right: 1%;
-}
-
-/* Grid >> Children (Alpha ~ First, Omega ~ Last)
-----------------------------------------------------------------------------------------------------*/
-
-.alpha {
- margin-left: 0;
-}
-
-.omega {
- margin-right: 0;
-}
-
-/* Grid >> 12 Columns
-----------------------------------------------------------------------------------------------------*/
-
-
-.container_12 .grid_1 {
- width:6.333%;
-}
-
-.container_12 .grid_2 {
- width:14.667%;
-}
-
-.container_12 .grid_3 {
- width:23.0%;
-}
-
-.container_12 .grid_4 {
- width:31.333%;
-}
-
-.container_12 .grid_5 {
- width:39.667%;
-}
-
-.container_12 .grid_6 {
- width:48.0%;
-}
-
-.container_12 .grid_7 {
- width:56.333%;
-}
-
-.container_12 .grid_8 {
- width:64.667%;
-}
-
-.container_12 .grid_9 {
- width:73.0%;
-}
-
-.container_12 .grid_10 {
- width:81.333%;
-}
-
-.container_12 .grid_11 {
- width:89.667%;
-}
-
-.container_12 .grid_12 {
- width:98.0%;
-}
-
-
-
-/* Prefix Extra Space >> 12 Columns
-----------------------------------------------------------------------------------------------------*/
-
-
-.container_12 .prefix_1 {
- padding-left:8.333%;
-}
-
-.container_12 .prefix_2 {
- padding-left:16.667%;
-}
-
-.container_12 .prefix_3 {
- padding-left:25.0%;
-}
-
-.container_12 .prefix_4 {
- padding-left:33.333%;
-}
-
-.container_12 .prefix_5 {
- padding-left:41.667%;
-}
-
-.container_12 .prefix_6 {
- padding-left:50.0%;
-}
-
-.container_12 .prefix_7 {
- padding-left:58.333%;
-}
-
-.container_12 .prefix_8 {
- padding-left:66.667%;
-}
-
-.container_12 .prefix_9 {
- padding-left:75.0%;
-}
-
-.container_12 .prefix_10 {
- padding-left:83.333%;
-}
-
-.container_12 .prefix_11 {
- padding-left:91.667%;
-}
-
-
-
-/* Suffix Extra Space >> 12 Columns
-----------------------------------------------------------------------------------------------------*/
-
-
-.container_12 .suffix_1 {
- padding-right:8.333%;
-}
-
-.container_12 .suffix_2 {
- padding-right:16.667%;
-}
-
-.container_12 .suffix_3 {
- padding-right:25.0%;
-}
-
-.container_12 .suffix_4 {
- padding-right:33.333%;
-}
-
-.container_12 .suffix_5 {
- padding-right:41.667%;
-}
-
-.container_12 .suffix_6 {
- padding-right:50.0%;
-}
-
-.container_12 .suffix_7 {
- padding-right:58.333%;
-}
-
-.container_12 .suffix_8 {
- padding-right:66.667%;
-}
-
-.container_12 .suffix_9 {
- padding-right:75.0%;
-}
-
-.container_12 .suffix_10 {
- padding-right:83.333%;
-}
-
-.container_12 .suffix_11 {
- padding-right:91.667%;
-}
-
-
-
-/* Push Space >> 12 Columns
-----------------------------------------------------------------------------------------------------*/
-
-
-.container_12 .push_1 {
- left:8.333%;
-}
-
-.container_12 .push_2 {
- left:16.667%;
-}
-
-.container_12 .push_3 {
- left:25.0%;
-}
-
-.container_12 .push_4 {
- left:33.333%;
-}
-
-.container_12 .push_5 {
- left:41.667%;
-}
-
-.container_12 .push_6 {
- left:50.0%;
-}
-
-.container_12 .push_7 {
- left:58.333%;
-}
-
-.container_12 .push_8 {
- left:66.667%;
-}
-
-.container_12 .push_9 {
- left:75.0%;
-}
-
-.container_12 .push_10 {
- left:83.333%;
-}
-
-.container_12 .push_11 {
- left:91.667%;
-}
-
-
-
-/* Pull Space >> 12 Columns
-----------------------------------------------------------------------------------------------------*/
-
-
-.container_12 .pull_1 {
- left:-8.333%;
-}
-
-.container_12 .pull_2 {
- left:-16.667%;
-}
-
-.container_12 .pull_3 {
- left:-25.0%;
-}
-
-.container_12 .pull_4 {
- left:-33.333%;
-}
-
-.container_12 .pull_5 {
- left:-41.667%;
-}
-
-.container_12 .pull_6 {
- left:-50.0%;
-}
-
-.container_12 .pull_7 {
- left:-58.333%;
-}
-
-.container_12 .pull_8 {
- left:-66.667%;
-}
-
-.container_12 .pull_9 {
- left:-75.0%;
-}
-
-.container_12 .pull_10 {
- left:-83.333%;
-}
-
-.container_12 .pull_11 {
- left:-91.667%;
-}
-
-
-
-
-/* Clear Floated Elements
-----------------------------------------------------------------------------------------------------*/
-
-/* http://sonspring.com/journal/clearing-floats */
-
-.clear {
- clear: both;
- display: block;
- overflow: hidden;
- visibility: hidden;
- width: 0;
- height: 0;
-}
-
-/* http://perishablepress.com/press/2008/02/05/lessons-learned-concerning-the-clearfix-css-hack */
-
-.clearfix:after {
- clear: both;
- content: ' ';
- display: block;
- font-size: 0;
- line-height: 0;
- visibility: hidden;
- width: 0;
- height: 0;
-}
-
-.clearfix {
- display: inline-block;
-}
-
-* html .clearfix {
- height: 1%;
-}
-
-.clearfix {
- display: block;
-}
-
-/* forms.css */
-
-/* tutorial */
-
-input[type=text],input[type=password], textarea {
- padding: 5px;
- border: solid 1px #C9C9C9;
- outline: 0;
- font: normal 13px/100% Verdana, Tahoma, sans-serif;
- width: 200px;
-
- background: -webkit-gradient(linear, left top, left 25, from(#FFFFFF), color-stop(4%, #F7F7F7), to(#FFFFFF));
- background: -moz-linear-gradient(top, #FFFFFF, #F7F7F7 1px, #FFFFFF 25px);
-
- }
-
-textarea {
- width: 400px;
- max-width: 400px;
- height: 150px;
- line-height: 150%;
- }
-
-input:hover, textarea:hover,
-input:focus, textarea:focus {
- box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px;
- -moz-box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px;
- -webkit-box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px;
-
- }
-
-label {
-
-
- cursor:pointer;
- }
-
-
-
-
-.button{
- display: inline-block;
- background: #3c74a8;
- background: -webkit-gradient(linear, 0% 100%, 0% 0%, from(rgb(239,242,242)), to(rgb(255,255,255)));
- background: -moz-linear-gradient(bottom, rgb(239,242,242), rgb(255,255,255));
- box-shadow: rgba(0,0,0, 0.4) 0px 0px 3px;
- -moz-box-shadow: rgba(0,0,0, 0.4) 0px 0px 3px;
- -webkit-box-shadow: rgba(0,0,0, 0.4) 0px 0px 3px;
- border: none;
- -moz-border-radius: 20px;
- -webkit-border-radius: 20px;
- border-radius: 20px;
- color: RGB(46,46,46);
-
-
-
-
- padding: 5px 15px;
- margin:0px 5px 0px 5px;
- font-weight:normal;
-
- }
-
-
-
-
-.button:hover {
- box-shadow: rgba(0,0,0, 0.6) 0px 0px 5px;
- -moz-box-shadow: rgba(0,0,0, 0.6) 0px 0px 5px;
- -webkit-box-shadow: rgba(0,0,0, 0.6) 0px 0px 5px;
- color: RGB(46,46,46);
- cursor: pointer;
- }
-
-
-.actions{
- text-align:right;
-}
-
-button,input[type=submit] {
- display: inline-block;
- background: #3c74a8;
- background: -webkit-gradient(linear, 0% 100%, 0% 0%, from(rgb(60,116,168)), to(rgb(103,146,187)));
- background: -moz-linear-gradient(bottom, rgb(60,116,168), rgb(103,146,187));
- box-shadow: rgba(0,0,0, 0.4) 0px 0px 3px;
- -moz-box-shadow: rgba(0,0,0, 0.4) 0px 0px 3px;
- -webkit-box-shadow: rgba(0,0,0, 0.4) 0px 0px 3px;
- border: none;
- -moz-border-radius: 20px;
- -webkit-border-radius: 20px;
- border-radius: 20px;
- color: white;
-
- margin:0px 5px 0px 5px;
-
- padding: 5px 15px;
- text-shadow: 0 1px 1px rgba(0,0,0,0.6);
- font-weight:normal;
- font-size:13px;
-
- }
-
-button:hover,input[type=submit]:hover {
- box-shadow: rgba(0,0,0, 0.6) 0px 0px 5px;
- -moz-box-shadow: rgba(0,0,0, 0.6) 0px 0px 5px;
- -webkit-box-shadow: rgba(0,0,0, 0.6) 0px 0px 5px;
- cursor: pointer;
- }
-
-
-
-
-.field_with_errors{
- display:inline;
- color:red;
-
-}
-
-.field_with_errors input{
- display:inline;
- border-color:red;
-
-
-}
-
-.errorExplanation{
- border-top: 1px solid black;
- border-bottom: 1px solid black;
- padding:5px;
- border-color:#F2EDA1;
- background:#FEFCDB;
-
-}
-.errorExplanation h2{
- font-size:13px;
- margin:0px;
- padding:0px;
-}
-
-/* core/general */
-.message{
- border: 4px solid black;
- border-radius:10px;
- padding:5px;
- margin:20px;
- -webkit-box-shadow: rgba(0,0,0,0.5) 1px 1px 40px;
- -moz-box-shadow: rgba(0,0,0,0.5) 1px 1px 40px;
- box-shadow: rgba(0,0,0,0.5) 1px 1px 40px;
-}
-.alert{
- border-color: rgb(242,237,161);
- background: rgba(254,252,219,0.8);
-}
-
-.notice{
- border-color:rgb(205,230,245);
- background:rgba(236,248,254,0.8);
-}
-#flash{
- position:fixed;
- bottom:0px;
- width:100%;
-}
-
-a img{
- border:0px;
-}
-
-table{
- border-collapse:collapse;
- width:100%;
-}
-
-h1, h2, h3, h4, h5, h6 {
- margin:0px;
- padding:0px;
-}
diff --git a/app/assets/stylesheets/admin/redactor.css b/app/assets/stylesheets/admin/redactor.css
new file mode 100755
index 0000000..044d4f6
--- /dev/null
+++ b/app/assets/stylesheets/admin/redactor.css
@@ -0,0 +1,693 @@
+.redactor_box {
+ position: relative;
+ border: 1px solid #ddd;
+ overflow: visible;
+}
+.redactor_box, .redactor_box textarea {
+ background-color: #fff;
+}
+
+body .redactor_air {
+ position: absolute;
+ border: 1px solid #ddd;
+ border-bottom: none;
+ z-index: 2;
+}
+
+/*
+ Fullscreen
+*/
+body .redactor_box_fullscreen {
+ left: 0;
+ position: fixed;
+ overflow: hidden;
+ top: 0;
+ width: 100%;
+ z-index: 2000;
+}
+
+.redactor_box textarea {
+ font-family: Menlo, Monaco, monospace, sans-serif;
+ font-size: 13px;
+ overflow: auto;
+ resize: none;
+ margin: 0;
+ padding: 0;
+ display: block;
+ position: relative;
+ z-index: 1004;
+ outline: none;
+ border: none;
+ width: 100%;
+}
+
+
+
+.redactor_editor,
+.redactor_editor:focus,
+.redactor_editor div,
+.redactor_editor p,
+.redactor_editor ul,
+.redactor_editor ol,
+.redactor_editor table,
+.redactor_editor dl,
+.redactor_editor blockquote,
+.redactor_editor pre,
+.redactor_editor h1,
+.redactor_editor h2,
+.redactor_editor h3,
+.redactor_editor h4,
+.redactor_editor h5 {
+ font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif !important;
+}
+
+.redactor_editor code,
+.redactor_editor pre {
+ font-family: Menlo, Monaco, monospace, sans-serif !important;
+}
+
+.redactor_editor,
+.redactor_editor:focus,
+.redactor_editor div,
+.redactor_editor p,
+.redactor_editor ul,
+.redactor_editor ol,
+.redactor_editor table,
+.redactor_editor dl,
+.redactor_editor blockquote,
+.redactor_editor pre {
+ font-size: 15px !important;
+ line-height: 1.45em !important;
+}
+
+.redactor_editor, .redactor_editor:focus {
+ position: relative;
+ outline: none;
+ box-shadow: none !important;
+ padding: 15px !important;
+ margin: 0 !important;
+ background: none;
+ background: #fff !important;
+ overflow: auto;
+ white-space: normal;
+}
+.redactor_editor a {
+ color: #15c !important;
+ text-decoration: underline !important;
+}
+
+.redactor_editor object,
+.redactor_editor embed,
+.redactor_editor video,
+.redactor_editor img {
+ width: auto;
+ max-width: 100%;
+}
+.redactor_editor video,
+.redactor_editor img {
+ height: auto;
+}
+
+.redactor_editor div,
+.redactor_editor p,
+.redactor_editor ul,
+.redactor_editor ol,
+.redactor_editor table,
+.redactor_editor dl,
+.redactor_editor blockquote,
+.redactor_editor pre {
+ box-shadow: none !important;
+ background: none !important;
+ margin: 0 !important;
+ margin-bottom: 15px !important;
+ border: none;
+}
+.redactor_editor iframe,
+.redactor_editor object,
+.redactor_editor hr {
+ margin-bottom: 15px !important;
+}
+.redactor_editor blockquote {
+ margin-left: 3em !important;
+ font-style: italic !important;
+ color: #777;
+}
+.redactor_editor ul,
+.redactor_editor ol {
+ padding-left: 2em !important;
+}
+.redactor_editor ul ul,
+.redactor_editor ol ol,
+.redactor_editor ul ol,
+.redactor_editor ol ul {
+ border: none;
+ margin: 2px !important;
+ padding: 0 !important;
+ padding-left: 2em !important;
+}
+.redactor_editor dl dt { font-weight: bold; }
+.redactor_editor dd { margin-left: 1em;}
+
+.redactor_editor table {
+ border-collapse: collapse;
+ font-size: 1em !important;
+}
+.redactor_editor table td {
+ border: 1px solid #ddd;
+ padding: 5px !important;
+ vertical-align: top;
+}
+.redactor_editor table thead td {
+ border-bottom: 2px solid #000 !important;
+ font-weight: bold !important;
+}
+.redactor_editor code {
+ background-color: #d8d7d7 !important;
+}
+.redactor_editor pre {
+ font-size: 90% !important;
+ background: #f8f8f8 !important;
+ border: 1px solid #ddd !important;
+ border-radius: 3px !important;
+ padding: 1em !important;
+ white-space: pre;
+ overflow: auto;
+}
+.redactor_editor hr {
+ display: block;
+ height: 1px;
+ border: 0;
+ border-top: 1px solid #ccc;
+}
+
+.redactor_editor h1,
+.redactor_editor h2,
+.redactor_editor h3,
+.redactor_editor h4,
+.redactor_editor h5 {
+ color: #000;
+ background: none;
+ margin: 0 !important;
+ padding: 0 !important;
+ font-weight: bold;
+}
+
+.redactor_editor h1 {
+ font-size: 36px !important;
+ line-height: 40px !important;
+ margin-bottom: 10px !important;
+}
+.redactor_editor h2 {
+ font-size: 30px !important;
+ line-height: 38px !important;
+ margin-bottom: 15px !important;
+}
+.redactor_editor h3 {
+ font-size: 24px !important;
+ line-height: 30px !important;
+ margin-bottom: 10px !important;
+}
+.redactor_editor h4 {
+ font-size: 18px !important;
+ line-height: 24px !important;
+ margin-bottom: 10px !important;
+}
+.redactor_editor h5 {
+ font-size: 1em !important;
+ margin-bottom: 10px !important;
+}
+
+.redactor_editor.redactor_editor_wym {
+ background: #f6f6f6 !important;
+ padding: 5px 15px !important;
+}
+.redactor_editor_wym div,
+.redactor_editor_wym p,
+.redactor_editor_wym ul,
+.redactor_editor_wym ol,
+.redactor_editor_wym table,
+.redactor_editor_wym dl,
+.redactor_editor_wym pre,
+.redactor_editor_wym h1,
+.redactor_editor_wym h2,
+.redactor_editor_wym h3,
+.redactor_editor_wym h4,
+.redactor_editor_wym h5,
+.redactor_editor_wym blockquote {
+ background-color: #fff !important;
+ border: 1px solid #e4e4e4 !important;
+ padding: 10px !important;
+ margin: 10px 0 !important;
+}
+.redactor_editor_wym ul,
+.redactor_editor_wym ol {
+ padding-left: 2em !important;
+}
+
+/*
+ TOOLBAR
+*/
+.redactor_toolbar {
+ font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif !important;
+ position: relative;
+ left: 0;
+ top: 0;
+ margin: 0 !important;
+ padding: 0 !important;
+ padding-left: 2px !important;
+ line-height: 0 !important;
+ list-style: none !important;
+ font-size: 0;
+ background: #f1f1f1;
+ background: -moz-linear-gradient(top, #f1f1f1 0%, #e2e2e2 100%);
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f1f1f1), color-stop(100%,#e2e2e2));
+ background: -webkit-linear-gradient(top, #f1f1f1 0%,#e2e2e2 100%);
+ background: -o-linear-gradient(top, #f1f1f1 0%,#e2e2e2 100%);
+ background: -ms-linear-gradient(top, #f1f1f1 0%,#e2e2e2 100%);
+ background: linear-gradient(to bottom, #f1f1f1 0%,#e2e2e2 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f1f1f1', endColorstr='#e2e2e2',GradientType=0 );
+ overflow: hidden !important;
+ height: 32px !important;
+ border-bottom: 1px solid #bbb;
+}
+body .redactor_air .redactor_toolbar {
+ padding-right: 2px !important;
+}
+.redactor_toolbar li {
+ float: left !important;
+ margin: 0 !important;
+ padding: 3px 1px;
+ padding-right: 0;
+ list-style: none !important;
+ outline: none;
+}
+.redactor_toolbar li.redactor_separator {
+ float: left;
+ height: 34px;
+ border-left: 1px solid #d3d3d3;
+ border-right: 1px solid #f1f1f1;
+ padding: 0;
+ margin: 0 2px 0 3px !important;
+}
+.redactor_toolbar li a {
+ width: 25px;
+ height: 25px;
+ border: 1px solid transparent;
+ * border: 1px solid #eee;
+ display: block;
+ line-height: 0;
+ font-size: 0;
+ cursor: pointer;
+ zoom: 1;
+ outline: none;
+ text-decoration: none;
+}
+.redactor_toolbar li.redactor_btn_right {
+ float: none;
+ float: right !important;
+}
+.redactor_toolbar li a {
+ display: block;
+ text-indent: -9999px;
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAooAAAAZCAYAAAC2GQ9IAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAF4BJREFUeNrsXQlYFFe2LpoGgQZtVEARjYrigijuW9xIHNQxLsm4PWNERxhw17glE2OIz2U0xnFl1JeYoFGzqdHEMUHFLcaFuCBk3CKIyoAoNFtAoOn5T3sbO/0a6Oqqbsnk/t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1GS5GgYCLFecbfwamuglmCiaDjDplzNxYIKI0Mu46ZtTLWJDzCzP4Bax+Sw2+EyOilHVTMdmFjGjmWOk47NlW9g5k5c6Ac3Bw1CyQjtMIRS6zgeUy1t3MKIi29E8Rco0C5xR7N8Zviih+/vnnFRc7atQoB96XOTj++2AvPef2hIOD4xklHGgKnI+IIJqC5UwWvNsscK7MJv7mMop0I9yoc3D895NFe+g5tyccHBwcVdtEPvTMwcHBwcHBwcFhFpwocnBwcHBwcHBwmMV/BBgAHTxEUMWGlxEAAAAASUVORK5CYII=);
+ background-repeat: no-repeat;
+ background-position: 0;
+}
+@media all and (-webkit-min-device-pixel-ratio: 1.5) {
+
+ .redactor_toolbar li a {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABRQAAAAyCAYAAAAtK1dkAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAKodJREFUeNrsnQtcVNX2xzfDG+QtiG9QTE0rS4pMSVHDSjHN0Ewty/shzWumluY/zbTuVSz1qper9dcempl6y3c+/4Wamc98hyGCPARF3jA8Bpj/Wsw+eBgHGGBmzjnD+n4+mzmcOTOz93nsvfZvr72XjVarZQRBEARBEARBEARBEARBEMagolNAEARBEARBEARBEARBEISxkKBIEARBEARBEARBEARBEITRkKBIEARBEARBEARBEARBEITRkKBIEARBEARBEARBEARBEITRkKBIEARBEARBEARBEARBEITRkKBIEARBEARBEARBEARBEITRkKBIEARBEARBEARBEARBEITRkKBIEARBEARBEARBEARBEITRkKBIEARBEARBEARBEARBEITRkKBIEARBEARBEARBEARBEITR2NEpIAiCIIjmwejRoy36e1u3bqWTThAEQRAEQRBWCAmKBEEQBEEQBEEQBEEQRJ00dXB669atnvAdOXzbC15y6awqFxIUCYIgCIJoKC0g/R1Sb0gOkM5D+jekTDo1BEEQBEEQhqlLkBOLbfWhRDFOv3y4bYFyuEyaNOn7goKCCHP9gJub247169ePg011c7ufSVAkCIIgCKIh9IG0CVIgpO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pbT98LBblKmZZDw22UTCu7PgFMpmLR1q1bvx49evREvX01PCzhf0ErQWhpgmYICYr1k8TuuZgKLtXYiTjEK94kGeZZEOOUjDWUgSCaM9Yi+mi58fp/wcHBxZCeYjqhDaekmit4B/4mDpjg9G0U+Y7zPJh6+s4pSN0g4fxM9ESMEr2Hy1+8zI+RGxmvvvrqF5DCYNtLojzg4NvPTDeoRRjG1Gut0TpqBEEQDQeFxJs8KQq+znCTgbbIxsJZN7b9O8/zJ8fTnwRpJ+TNUwhsWct07SR2b+pzkkxvpbLHH388+fTp0x3M9QMhISFJrJk6OdnoRY4nCIIgCFOASxUMhyQH0WcX04lzTQEH4NA7CpeJwKk2uM6dOQVFHInHQBrC+kAm8U6sZ5pGEC8bGrgVpvg9MxnJuMyFP09SRfVGkTqdXx/ykjcMPi8BzHRehcL6PyQqEgRBNAMULCga2/7JvV3D/A+A9AL/Hx2sYhXYDneGNApSKKQWZvh+nHJ/jOlm/SQ0t+eUBEWCIAjCHJDoI0/j3KK/J9NRd4IgCIIgCKJ+BHEUSWLKHNTDWUWtmc4pwMEM3499DIxHcYs1w6VwSFAkCIIgCIIgCIIgCIIgCMJoVHQKCIIgCIIgCIIgCIIgCIIwFgrKYiG2bdtm0BU0MjLShs4OQRAEQVB7TuUgCIIgCIIglGInkoeihTBkoJPRThAEQRDUnlM5CIIgCIIgCKXZiSQoSnRRyGgnCIIgCGrPqRwEQRAEQRCEEu1ECspCEARBEARBEARBEARBEITRkIciQRAEQRAEQRAEQRAEQRBGQ4IiQRAEQRAEQRAEQRAEQRBGQ4IiQRAEQRAEQRAEQRAEQRBG8/8CDACn2Bhs7uzfIwAAAABJRU5ErkJggg==);
+ background-size: auto 25px;
+ }
+
+}
+
+.redactor_toolbar li a:hover {
+ border-color: #98a6ba;
+ background-color: #dde4ef;
+ outline: none;
+}
+.redactor_toolbar li a:active, .redactor_toolbar li a.redactor_act {
+ border-color: #b5b5b5;
+ background-color: #ddd;
+ outline: none;
+}
+
+
+/*
+ BUTTONS
+ step 25px
+*/
+body .redactor_toolbar li a.redactor_btn_html { background-position: 0px; }
+body .redactor_toolbar li a.redactor_btn_formatting { background-position: -25px; }
+body .redactor_toolbar li a.redactor_btn_bold { background-position: -50px; }
+body .redactor_toolbar li a.redactor_btn_italic { background-position: -75px; }
+body .redactor_toolbar li a.redactor_btn_deleted { background-position: -500px; }
+body .redactor_toolbar li a.redactor_btn_unorderedlist { background-position: -100px; }
+body .redactor_toolbar li a.redactor_btn_orderedlist { background-position: -125px; }
+body .redactor_toolbar li a.redactor_btn_outdent { background-position: -150px; }
+body .redactor_toolbar li a.redactor_btn_indent { background-position: -175px; }
+body .redactor_toolbar li a.redactor_btn_image { background-position: -200px; }
+body .redactor_toolbar li a.redactor_btn_video { background-position: -225px; }
+body .redactor_toolbar li a.redactor_btn_file { background-position: -250px; }
+body .redactor_toolbar li a.redactor_btn_table { background-position: -275px; }
+body .redactor_toolbar li a.redactor_btn_link { background-position: -300px; }
+body .redactor_toolbar li a.redactor_btn_fontcolor { background-position: -325px; }
+body .redactor_toolbar li a.redactor_btn_backcolor { background-position: -350px; }
+body .redactor_toolbar li a.redactor_btn_alignleft { background-position: -375px; }
+body .redactor_toolbar li a.redactor_btn_aligncenter { background-position: -400px; }
+body .redactor_toolbar li a.redactor_btn_alignright { background-position: -425px; }
+body .redactor_toolbar li a.redactor_btn_justify { background-position: -450px; }
+body .redactor_toolbar li a.redactor_btn_horizontalrule { background-position: -475px; }
+body .redactor_toolbar li a.redactor_btn_underline { background-position: -525px; }
+
+body .redactor_toolbar li a.redactor_btn_fullscreen { background-position: -550px; }
+body .redactor_toolbar li a.redactor_btn_normalscreen { background-position: -575px; }
+body .redactor_toolbar li a.redactor_btn_clips { background-position: -600px; }
+
+body .redactor_toolbar li a.redactor_btn_alignment { background-position: -625px; }
+
+/*
+ Toolbar classes
+*/
+.redactor_format_blockquote {
+ font-style: italic;
+ color: #666 !important;
+ padding-left: 10px;
+}
+.redactor_format_pre {
+ font-family: monospace, sans-serif;
+}
+.redactor_format_h1, .redactor_format_h2, .redactor_format_h3, .redactor_format_h4 {
+ font-weight: bold;
+}
+.redactor_format_h1 {
+ font-size: 30px;
+ line-height: 36px;
+}
+.redactor_format_h2 {
+ font-size: 24px;
+ line-height: 36px;
+}
+.redactor_format_h3 {
+ font-size: 20px;
+ line-height: 30px;
+}
+.redactor_format_h4 {
+ font-size: 16px;
+ line-height: 26px;
+}
+
+/*
+ DROPDOWN
+*/
+.redactor_dropdown {
+ font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif;
+ top: 28px;
+ left: 0;
+ z-index: 2004;
+ position: absolute;
+ width: 200px;
+ background-color: #fff;
+ border: 1px solid #ccc;
+ font-size: 13px;
+ -webkit-box-shadow: 0 2px 4px #ccc;
+ -moz-box-shadow: 0 2px 4px #ccc;
+ box-shadow: 0 2px 4px #ccc;
+ line-height: 21px;
+ padding: 10px;
+}
+.redactor_separator_drop {
+ border-top: 1px solid #ddd;
+ padding: 0 !important;
+ line-height: 0;
+ font-size: 0;
+}
+.redactor_dropdown a {
+ display: block;
+ color: #000;
+ padding: 3px 5px;
+ text-decoration: none;
+}
+.redactor_dropdown a:hover {
+ color: #444 !important;
+ text-decoration: none;
+ background-color: #dde4ef;
+}
+
+/* ColorPicker */
+.redactor_color_link {
+ padding: 0 !important;
+ width: 15px !important;
+ height: 15px !important;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, .2) inset !important;
+ border-radius: 4px !important;
+ float: left !important;
+ border: 2px solid #fff !important;
+ font-size: 0;
+}
+.redactor_color_none {
+ font-size: 11px;
+}
+
+
+
+/* MODAL */
+#redactor_modal_overlay {
+ position: fixed;
+ margin: auto;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 50000;
+
+ -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
+ filter:alpha(opacity=50);
+ opacity: 0.50;
+
+ background-color: #333 !important;
+}
+
+#redactor_modal {
+ background: #f7f7f7;
+ background: -moz-linear-gradient(top, #f7f7f7 0%, #e2e2e2 100%);
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f7f7f7), color-stop(100%,#e2e2e2));
+ background: -webkit-linear-gradient(top, #f7f7f7 0%,#e2e2e2 100%);
+ background: -o-linear-gradient(top, #f7f7f7 0%,#e2e2e2 100%);
+ background: -ms-linear-gradient(top, #f7f7f7 0%,#e2e2e2 100%);
+ background: linear-gradient(to bottom, #f7f7f7 0%,#e2e2e2 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f7f7f7', endColorstr='#e2e2e2',GradientType=0 );
+ text-shadow: 0 1px 0 #fff;
+ padding: 0;
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ box-shadow: 0px 5px 60px #000;
+ border-radius: 3px;
+ z-index: 50001;
+ font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif;
+ font-size: 12px !important;
+ color: #000;
+}
+#redactor_modal_header {
+ padding: 11px 30px 0 15px;
+ font-size: 12px;
+ border-radius: 3px 3px 0 0;
+ font-weight: bold;
+}
+#redactor_modal_content {
+ padding: 20px 30px;
+
+}
+#redactor_modal_close {
+ position: absolute;
+ right: 5px;
+ top: 5px;
+ font-size: 20px;
+ width: 20px;
+ height: 20px;
+ color: #777;
+ cursor: pointer;
+}
+#redactor_modal_close:hover {
+ color: #000;
+}
+#redactor_modal label {
+ margin: 10px 0 3px 0 !important;
+ padding: 0 !important;
+ float: none !important;
+ display: block !important;
+}
+#redactor_modal textarea {
+ margin-top: 4px;
+ display: block;
+}
+.redactor_input {
+ width: 99%;
+ font-size: 14px;
+}
+.redactor_modal_box {
+ height: 350px;
+ overflow: auto;
+ margin-bottom: 10px;
+}
+#redactor_image_box {
+ height: 270px;
+ overflow: auto;
+ margin-bottom: 10px;
+}
+#redactor_image_box_select {
+ display: block;
+ width: 200px;
+ margin-bottom: 15px;
+}
+#redactor_image_box img {
+ margin-right: 10px;
+ margin-bottom: 10px;
+ cursor: pointer;
+ max-width: 100px;
+}
+#redactor_tabs {
+ margin-bottom: 18px;
+}
+#redactor_tabs a {
+ display: inline-block;
+ border: 1px solid #d2d2d2;
+ padding: 4px 14px;
+ font-size: 12px;
+ background-color: #fff;
+ text-decoration: none;
+ color: #000;
+ line-height: 1;
+ border-radius: 10px;
+ margin-right: 5px;
+}
+#redactor_tabs a:hover, #redactor_tabs a.redactor_tabs_act {
+ background-color: #ddd;
+ padding: 5px 15px;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, .4) inset;
+ border: none;
+ text-shadow: 0 1px 0 #eee;
+ color: #777 !important;
+ text-decoration: none !important;
+}
+#redactor_modal_footer {
+ padding: 9px 30px 20px 30px;
+ border-radius: 0 0 3px 3px;
+ text-align: right;
+}
+
+#redactor_modal input[type="radio"],
+#redactor_modal input[type="checkbox"] {
+ position: relative;
+ top: -1px;
+}
+#redactor_modal input[type="text"],
+#redactor_modal input[type="password"],
+#redactor_modal input[type="email"],
+#redactor_modal textarea {
+ position: relative;
+ z-index: 2;
+ font-family: Helvetica, Arial, Tahoma, sans-serif;
+ height: 23px;
+ border: 1px solid #ccc;
+ margin: 0;
+ padding: 1px 2px;
+ background-color: white;
+ color: #333;
+ font-size: 13px;
+ line-height: 1;
+ border-radius: 1px;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) inset;
+ -webkit-transition: border 0.3s ease-in;
+ -moz-transition: border 0.3s ease-in;
+ -ms-transition: border 0.3s ease-in;
+ -o-transition: border 0.3s ease-in;
+ transition: border 0.3s ease-in;
+}
+#redactor_modal textarea {
+ line-height: 1.4em;
+}
+#redactor_modal input:focus,
+#redactor_modal textarea:focus {
+ outline: none;
+ border-color: #5ca9e4;
+ box-shadow: 0 0 0 2px rgba(70, 161, 231, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2) inset;
+}
+
+.redactor_modal_btn {
+ margin-left: 8px;
+ position: relative;
+ cursor: pointer;
+ outline: none;
+ display: inline-block;
+ text-align: center;
+ text-decoration: none;
+ font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif;
+ line-height: 1;
+ font-size: 12px;
+ font-weight: normal;
+ padding: 6px 16px 5px 16px;
+ border-radius: 4px;
+ background-color: #f3f3f3;
+ background-image: -moz-linear-gradient(top, #ffffff, #e1e1e1);
+ background-image: -ms-linear-gradient(top, #ffffff, #e1e1e1);
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e1e1e1));
+ background-image: -webkit-linear-gradient(top, #ffffff, #e1e1e1);
+ background-image: -o-linear-gradient(top, #ffffff, #e1e1e1);
+ background-image: linear-gradient(top, #ffffff, #e1e1e1);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e1e1e1', GradientType=0);
+ border: 1px solid #ccc;
+ border-bottom-color: #aaa;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
+ text-shadow: 0 1px 0px #ffffff;
+ color: #000;
+}
+.redactor_modal_btn:hover {
+ color: #555;
+}
+.redactor_modal_btn:hover {
+ filter: none;
+ background: none;
+ background: #f3f3f3;
+ text-shadow: 0 1px 0px rgba(255, 255, 255, 0.8);
+ text-decoration: none;
+}
+
+
+/* Drag and Drop Area */
+.redactor_droparea {
+ position: relative;
+ width: 100%;
+ margin: auto;
+ margin-bottom: 5px;
+}
+.redactor_droparea .redactor_dropareabox {
+ z-index: 1;
+ position: relative;
+ text-align: center;
+ width: 99%;
+ background-color: #fff;
+ padding: 60px 0;
+ border: 2px dashed #bbb;
+}
+.redactor_droparea .redactor_dropareabox, .redactor_dropalternative {
+ color: #555;
+ font-size: 12px;
+}
+.redactor_dropalternative {
+ margin: 4px 0 2px 0;
+}
+.redactor_dropareabox.hover {
+ background: #efe3b8;
+ border-color: #aaa;
+}
+.redactor_dropareabox.error {
+ background: #f7e5e5;
+ border-color: #dcc3c3;
+}
+.redactor_dropareabox.drop {
+ background: #f4f4ee;
+ border-color: #e0e5d6;
+}
diff --git a/app/assets/stylesheets/public.css.scss b/app/assets/stylesheets/public.css.scss
index f170de7..7f9f72f 100644
--- a/app/assets/stylesheets/public.css.scss
+++ b/app/assets/stylesheets/public.css.scss
@@ -1,7 +1,7 @@
$baseFontSize : 16px;
-$headerFontFamily : 'Avenir', 'arial', 'san-serif';
+$headerFontFamily : 'Verdana', 'arial', 'san-serif';
$headerFontWeight : normal;
$ratio : 1.35;
$rowWidth : 1200px;
@@ -39,6 +39,11 @@ $rowWidth : 1200px;
@import "foundation/common/typography";
+@import "admin/qi_cms";
+@import "admin/public_admin";
+@import "admin/redactor";
+@import "admin/qi_core";
+
body{
font-family : 'Avenir', 'arial', 'san-serif';
@@ -54,11 +59,15 @@ body{
}
#top{
- border-bottom:8px solid #00ade2;
+ border-bottom:8px solid #208dbb;
padding:1em 0;
+ margin-bottom:1em;
#menu{
+ .active{
+ font-weight:bold;
+ }
margin-top:90px;
text-align:right;
font-size:1.05em;
@@ -81,18 +90,30 @@ body{
color :#00ade2;
}
-
+ .sidebar{
+ background:#208dbb;
+ }
}
.menu{
+
+ .active{
+ font-weight:bold;
+ }
+ color:white;
+ h3{
+ a{
+ color:white;
+ }
+ }
ul{
a{
- color:black;
+ color:white;
- &:hover,&.active{
+ &:hover{
color :#00ade2;
}
diff --git a/app/controllers/admin/menu_items_controller.rb b/app/controllers/admin/menu_items_controller.rb
index 599139b..0b8e0b0 100644
--- a/app/controllers/admin/menu_items_controller.rb
+++ b/app/controllers/admin/menu_items_controller.rb
@@ -109,7 +109,7 @@ class Admin::MenuItemsController < ApplicationController
def edit
@menu_item= MenuItem.find(params[:id])
- render :layout => false
+ render :layout => "public"
end
def update
diff --git a/app/controllers/public/menu_items_controller.rb b/app/controllers/public/menu_items_controller.rb
index 65e5a00..c3ef6df 100644
--- a/app/controllers/public/menu_items_controller.rb
+++ b/app/controllers/public/menu_items_controller.rb
@@ -3,6 +3,8 @@ class Public::MenuItemsController < ApplicationController
layout "public"
def show
+ @admin = true if params[:admin]
+
@menu_item = MenuItem.find_by_permalink(params[:url])
if @menu_item
diff --git a/app/helpers/public/menu_items_helper.rb b/app/helpers/public/menu_items_helper.rb
index 789a10b..fde762e 100644
--- a/app/helpers/public/menu_items_helper.rb
+++ b/app/helpers/public/menu_items_helper.rb
@@ -1,7 +1,7 @@
# -*- encoding : utf-8 -*-
module Public::MenuItemsHelper
def menu_item_link(menu_item)
- link_to menu_item.name, menu_item_path(:url => menu_item.url)
+ link_to menu_item.name, menu_item_path(:url => menu_item.url), :class => ("active" if @menu_item and (@menu_item == menu_item or @menu_item.ancestors.include?(menu_item)))
end
end
diff --git a/app/views/admin/blocks/_block_allowed.html.haml b/app/views/admin/blocks/_block_allowed.html.haml
index 2ec8811..9e5f5f8 100644
--- a/app/views/admin/blocks/_block_allowed.html.haml
+++ b/app/views/admin/blocks/_block_allowed.html.haml
@@ -1,11 +1,6 @@
-#content_types_draggables
-
- -block.content_types.each do |content_type|
-
- .content_types_draggable{:id => content_type.id, :data_type => content_type.slug}
- =image_tag("admin/content_type/type_"+content_type.slug.to_s+".png", :alt => content_type.name)
-
+
+
diff --git a/app/views/admin/menu_items/_edit_form.html.haml b/app/views/admin/menu_items/_edit_form.html.haml
index f7d6993..6c9883a 100644
--- a/app/views/admin/menu_items/_edit_form.html.haml
+++ b/app/views/admin/menu_items/_edit_form.html.haml
@@ -1,10 +1,10 @@
#menu_item_edit
= semantic_form_for [:admin,@menu_item], :remote => true do |form|
- .form1=render :partial => "form", :locals => {:form => form}
+ =render :partial => "form", :locals => {:form => form}
- .form2
- =render :partial => "admin/"+@menu_item.menu_content_type.tableize.to_s+"/form", :locals => {:form => form}
+
+ =render :partial => "admin/"+@menu_item.menu_content_type.tableize.to_s+"/form", :locals => {:form => form}
.actions
= form.submit "Sauvegarder"
diff --git a/app/views/admin/menu_items/_menu_item.html.haml b/app/views/admin/menu_items/_menu_item.html.haml
index 105e4f0..20d85e2 100644
--- a/app/views/admin/menu_items/_menu_item.html.haml
+++ b/app/views/admin/menu_items/_menu_item.html.haml
@@ -22,7 +22,7 @@
=link_to i(:clone_page_stroke, :blue), clone_admin_menu_item_path(menu_item), :confirm => 'Voulez-vous vraiment cloner cet élément de menu ?', :style => "padding:0px 5px 0px 0px;"
= link_to i(:trash_stroke, :blue), [:admin, menu_item], :confirm => 'Voulez-vous vraiment supprimer cet élément de menu ?', :method => :delete, :style => "padding:0px 5px 0px 2px;" if current_admin.super_admin? || !menu_item.super_admin
- = link_to i(:pen_alt_fill, :blue), edit_admin_menu_item_path(menu_item), :style => "padding:0px 0px 0px 0px;", :class => "show_details"
+ = link_to i(:pen_alt_fill, :blue), edit_admin_menu_item_path(menu_item), :style => "padding:0px 0px 0px 0px;"
.receptable_position{:"data-position" => (menu_item.position.to_i+1)}
diff --git a/app/views/admin/menu_items/edit.html.haml b/app/views/admin/menu_items/edit.html.haml
index f310bb7..f7c2808 100644
--- a/app/views/admin/menu_items/edit.html.haml
+++ b/app/views/admin/menu_items/edit.html.haml
@@ -1,30 +1,14 @@
-.header
- .right
- =#link_to "modifier", edit_admin_menu_item_path(@menu_item), :remote => true,:class => "button"
+
+
+
+
+
+
+
+-if @menu_item.menu_content_type == "Page"
+ =render @menu_item.menu_content
+
+
- =link_to "Masquer", "#", :class => "hide button"
- .switch.menu_item_enabled_switch{:"data-menu_item_id" => @menu_item.id, :class => ('on' if @menu_item.enabled?)}
- %span.thumb
-
- =render :partial => "show"
-
-
-
-.menu_item_informations
-
-
- .tab
- %h3 Infos sur la page
- =render :partial => "edit_form"
- #menu_item_content_type
-
-
-#menu_item_block_edit
-
-
-
- -if @menu_item.menu_content_type == "Page"
- =render @menu_item.menu_content
-
\ No newline at end of file
diff --git a/app/views/admin/pages/_page.html.haml b/app/views/admin/pages/_page.html.haml
index 2e79a63..dc20a11 100644
--- a/app/views/admin/pages/_page.html.haml
+++ b/app/views/admin/pages/_page.html.haml
@@ -1 +1,25 @@
-=render page.blocks[0]
+.menu_item_informations
+
+
+ .tab
+ %h3 Infos sur la page
+ =render :partial => "edit_form"
+ .tab
+ %h3 éléments
+
+
+
+
+ -page.blocks[0].content_types.each do |content_type|
+
+ .content_types_draggable{:id => content_type.id, :data_type => content_type.slug}
+ =image_tag("admin/content_type/type_"+content_type.slug.to_s+".png", :alt => content_type.name)
+
+#menu_item_block_edit
+
+
+
+ =render page.blocks[0]
+
+
+
diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml
index 2a16063..2a000bc 100644
--- a/app/views/layouts/public.html.haml
+++ b/app/views/layouts/public.html.haml
@@ -26,13 +26,15 @@
.four.column=link_to image_tag( "front/logo.png", :id => "logo", :alt => ""), "/"
.eight.column
#menu=render(:partial => "public/shared/first_menu")
-
#main.row
- .four.column=yield :sidebar
- .eight.column=yield
-
- %p{:style => "clear:both;"}
- %br
+ .eight.column
+ =yield
+
+ .four.column.sidebar
+ =yield :sidebar
+
+
+
#bottom
%a#go_top{:href => "#top_anchor"}
diff --git a/app/views/portlet/portlets/_portlet.html.haml b/app/views/portlet/portlets/_portlet.html.haml
index cc77ff3..57db7c0 100644
--- a/app/views/portlet/portlets/_portlet.html.haml
+++ b/app/views/portlet/portlets/_portlet.html.haml
@@ -8,11 +8,5 @@
.render_admin{:class => "render_admin_"+portlet.content_type.tableize.singularize}
- =render :partial => "portlet/"+portlet.content_type.tableize+"/"+portlet.content_type.tableize.singularize, :object => portlet.content
-
-
-
-
-
-
+ =render :partial => "portlets/render_public/"+portlet.content_type.to_s.downcase, :locals => {:input => portlet.content}
\ No newline at end of file
diff --git a/app/views/portlet/text_contents/_form.html.haml b/app/views/portlet/text_contents/_form.html.haml
index 7c11ce8..2cc2ff8 100644
--- a/app/views/portlet/text_contents/_form.html.haml
+++ b/app/views/portlet/text_contents/_form.html.haml
@@ -1,86 +1,9 @@
=semantic_form_for( [:portlet, @text_content], :remote => true) do |f|
- .wysihtml5_area
- #toolbar{:draggable => "true"}
+
+ =f.text_area :content, :style => "width:98%;height:600px;", :class => "redactor_content"
- %div
-
- %a.rte-rte_justify_left{"data-wysihtml5-command" => "justifyLeft"}
- %a.rte-rte_justify_center{"data-wysihtml5-command" => "justifyCenter"}
- %a.rte-rte_justify_right{"data-wysihtml5-command" => "justifyRight"}
- %a.rte-rte_justify{"data-wysihtml5-command" => "justify"}
-
-
- %a.rte-rte_strong{"data-wysihtml5-command" => "strong"}
- %a.rte-rte_bold{"data-wysihtml5-command" => "bold", :title => "CTRL+B"}
-
- %a.rte-rte_em{"data-wysihtml5-command" => "em", :title => "CTRL+I"}
- %a.rte-rte_italic{"data-wysihtml5-command" => "italic"}
-
- %a.rte-rte_underline{"data-wysihtml5-command" => "underline", :title => "CTRL+S"}
-
- %a.rte-rte_sub{"data-wysihtml5-command" => "formatInline", "data-wysihtml5-command-value" => "sub"}
- %a.rte-rte_sup{"data-wysihtml5-command" => "formatInline", "data-wysihtml5-command-value" => "sup"}
-
-
-
-
-
- %a.rte-rte_link{"data-wysihtml5-command" => "createLink"}
-
- %a{"data-wysihtml5-command" => "formatBlock", "data-wysihtml5-command-value" => "h1"} h1
-
- %a{"data-wysihtml5-command" => "formatBlock", "data-wysihtml5-command-value" => "h2"} h2
- %a{"data-wysihtml5-command" => "formatBlock", "data-wysihtml5-command-value" => "h3"} h3
- %a{"data-wysihtml5-command" => "formatBlock", "data-wysihtml5-command-value" => "h4"} h4
-
- %a.rte-rte_unordered_list{"data-wysihtml5-command" => "insertUnorderedList"}
-
- %a.rte-rte_ordered_list{"data-wysihtml5-command" => "insertOrderedList"}
-
- %a.rte-rte_blockquote{"data-wysihtml5-command" => "formatBlock", "data-wysihtml5-command-value" => "blockquote"}
-
- .fore_color.rte-rte_fore_color{"data-wysihtml5-command-group"=>"foreColor"}
- %a
- .menu
- %a{"data-wysihtml5-command" => "foreColor", "data-wysihtml5-command-value" => "blue", :style => "background:blue;"}
-
- %a{"data-wysihtml5-command" => "foreColor", "data-wysihtml5-command-value" => "red", :style => "background:red;"}
-
- %a{"data-wysihtml5-command" => "foreColor", "data-wysihtml5-command-value" => "green", :style => "background:green;"}
-
-
-
- /%a{"data-wysihtml5-command" => "insertSpeech"} speech
-
-
-
-
- %a.rte-rte_html{"data-wysihtml5-action" => "change_view"}
-
-
- %div.link_dialog{"data-wysihtml5-dialog" => "createLink", :style => "display: none;"}
- %label
- Link:
- %input{"data-wysihtml5-dialog-field" => "href", :value => "http://"}
-
- %a{"data-wysihtml5-dialog-action" => "save"} OK
- %a{"data-wysihtml5-dialog-action" => "cancel"} Cancel
-
-
-
-
-
-
- =f.text_area :content, :style => "width:98%;height:600px;", :id => "wysihtml5"
- :javascript
- var editor = new wysihtml5.Editor("wysihtml5", {
- toolbar: "toolbar",
- stylesheets: "/assets/admin.css",
- parserRules: wysihtml5ParserRules,
- breakElement: 'p'
- });
-if TextContent::STYLES.size > 0
@@ -91,4 +14,15 @@
= f.submit "Sauvegarder"
+
+:javascript
+
+ $('.redactor_content').redactor({
+
+ fixed: true,
+ lang: 'fr',
+ buttons : ['html', '|', 'formatting', '|', 'bold', 'italic', 'deleted','underline','|', 'alignleft', 'aligncenter', 'alignright', 'justify', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'table', 'link', '|','fontcolor', 'backcolor','|', 'horizontalrule']
+
+
+ });
diff --git a/app/views/public/menu_items/show.html.haml b/app/views/public/menu_items/show.html.haml
index b1cd6c2..604c9a4 100644
--- a/app/views/public/menu_items/show.html.haml
+++ b/app/views/public/menu_items/show.html.haml
@@ -10,7 +10,7 @@
-if first_level_menu.children.size > 0
- %h3=@menu_item.name
+ %h3=menu_item_link(first_level_menu)
%ul
-first_level_menu.children.where(:enabled => true).order(:position).each do |menu_item|
@@ -19,6 +19,19 @@
-=render @menu_item.menu_content.blocks[0]
+-if @admin
+ =render :partial => "admin/blocks/block", :locals => {:block => @menu_item.menu_content.blocks[0]}
+-else
+ =render @menu_item.menu_content.blocks[0]
+
+
+
+-if @menu_item.menu_content_type == "Page" and @admin
+
+ #edit_toolbar
+ -@menu_item.menu_content.blocks[0].content_types.each do |content_type|
+
+ .content_types_draggable{:id => content_type.id, :data_type => content_type.slug}
+ =image_tag("admin/content_type/type_"+content_type.slug.to_s+".png", :alt => content_type.name)
diff --git a/app/views/public/shared/_first_menu.html.haml b/app/views/public/shared/_first_menu.html.haml
index b21aee9..f4aaef8 100644
--- a/app/views/public/shared/_first_menu.html.haml
+++ b/app/views/public/shared/_first_menu.html.haml
@@ -1,3 +1,3 @@
-MenuItem.where(:parent_id => nil, :enabled => true).order(:position).each do |menu_item|
- =link_to menu_item.name, menu_item_path(:url => menu_item.url), :class => ("active" if (@menu_item and @menu_item == menu_item) or ( @reference_menu_item and @reference_menu_item == menu_item))
+ =menu_item_link(menu_item)
diff --git a/config/database.yml b/config/database.yml
index c61aa76..8b007ef 100644
--- a/config/database.yml
+++ b/config/database.yml
@@ -6,7 +6,7 @@
development:
adapter: mysql2
encoding: utf8
- database: blog_app
+ database: ecoleeft_app
pool: 5
username: root
socket: /tmp/mysql.sock