Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
170 lines (147 sloc) 7.42 KB
- content_for :head_content do
:javascript
$(function() {
var wizard = $('#wizard');
$("ul.arrows", wizard).tabs("div.panes > div", function(event, index) {
if (index > 0) {
var title = $("#article_content_attributes_title");
if (title.val() == '') {
title.siblings("label").addClass("wizard-errors")
return false;
}
title.siblings("label").removeClass("wizard-errors");
var body = $("#article_body");
if (body.val() == '') {
body.siblings("label").addClass("wizard-errors")
return false;
}
body.siblings("label").removeClass("wizard-errors");
}
});
var api = $("ul.arrows", wizard).data("tabs");
// "next tab" button
$("input.button-input.next", wizard).click(function(event) {
event.preventDefault();
api.next();
});
// "previous tab" button
$("input.button-input.prev", wizard).click(function() {
event.preventDefault();
api.prev();
});
$('.toggle-embed-video').click(function(event) {
event.preventDefault();
$('textarea.embed-video', $(this).parents('fieldset.inputs')).removeClass('hide').show();
$(this).remove();
});
$('.toggle-embed-audio').click(function(event) {
event.preventDefault();
$('textarea.embed-audio', $(this).parents('fieldset.inputs')).removeClass('hide').show();
$(this).remove();
});
});
- content_for :sub_nav do
= render :partial => 'shared/subnav/news_subnav'
#full-col
.panel-3
.panel-bar
%h2= t '.header'
.form-wrap
#wizard
#flowplayer-block
%ul.arrows
%li
%a{:href => "#"}= t('wizard.compose')
%li
%a{:href => "#"}= t('wizard.details')
%li
%a{:href => "#"}= t('wizard.images')
%li
%a{:href => "#"}= t('wizard.more')
= semantic_form_for @article, :url => articles_path, :html => { :multipart => true, :class => "post_article" } do |form|
.panes
.panel1
= form.inputs do
= form.semantic_fields_for :content do |content_form|
= content_form.inputs do
= content_form.input :title
= form.input :body
= form.buttons do
= form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
.panel2
= form.semantic_fields_for :content do |content_form|
= content_form.inputs do
= content_form.input :url, :required => false, :label => t('article_url_label'), :hint => t('article_url_hint')
= content_form.input :tags_string, :required => false, :hint => t('tags_hint'), :as => :tags
#article_status= label_tag :status, t('articles.status')
= select_tag :is_draft, options_for_select( { t('articles.draft') => 1, t('articles.publish') => 0 }, (@article.is_draft ? 1 : 0) )
= form.buttons do
= form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
= form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
= form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
.panel3
= form.semantic_fields_for :content do |content_form|
= render :partial => 'shared/forms/images_simple', :locals => { :form => content_form, :item => @article.content }
#scrollbox
%a.prev.browse.left_scroll
.scrollable
.items
%a.next.browse.right_scroll
= form.buttons do
= form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
= form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
= form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
.panel4
= form.semantic_fields_for :content do |content_form|
= render :partial => 'shared/forms/media_items_simple', :locals => { :form => content_form, :item => @article.content }
= form.buttons do
= form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
= form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
= stylesheet_link_tag 'jquery.wysiwyg.css'
= javascript_include_tag 'jquery.wysiwyg.js'
:javascript
(function($)
{
$('textarea#article_body').wysiwyg({
controls: {
strikeThrough : { visible : true },
underline : { visible : true },
separator00 : { visible : false },
justifyLeft : { visible : true },
justifyCenter : { visible : true },
justifyRight : { visible : true },
justifyFull : { visible : true },
separator01 : { visible : false },
indent : { visible : true },
outdent : { visible : true },
separator02 : { visible : false },
subscript : { visible : true },
superscript : { visible : true },
separator03 : { visible : false },
undo : { visible : true },
redo : { visible : true },
separator04 : { visible : false },
insertOrderedList : { visible : true },
insertUnorderedList : { visible : true },
insertHorizontalRule : { visible : true },
createLink : {
visible : true,
},
insertImage : {
visible : false,
},
separator05 : { visible : false },
separator06 : { visible : false },
h4mozilla : { visible : true && $.browser.mozilla, className : 'h4', command : 'heading', arguments : ['h4'], tags : ['h4'], tooltip : "Header 4" },
h5mozilla : { visible : true && $.browser.mozilla, className : 'h5', command : 'heading', arguments : ['h5'], tags : ['h5'], tooltip : "Header 5" },
h6mozilla : { visible : true && $.browser.mozilla, className : 'h6', command : 'heading', arguments : ['h6'], tags : ['h6'], tooltip : "Header 6" },
h4 : { visible : true && !( $.browser.mozilla ), className : 'h4', command : 'formatBlock', arguments : ['<H4>'], tags : ['h4'], tooltip : "Header 4" },
h5 : { visible : true && !( $.browser.mozilla ), className : 'h5', command : 'formatBlock', arguments : ['<H5>'], tags : ['h5'], tooltip : "Header 5" },
h6 : { visible : true && !( $.browser.mozilla ), className : 'h6', command : 'formatBlock', arguments : ['<H6>'], tags : ['h6'], tooltip : "Header 6" },
separator07 : { visible : false },
cut : { visible : true },
copy : { visible : true },
paste : { visible : true }
}
});
})(jQuery);
Something went wrong with that request. Please try again.