Skip to content

Commit

Permalink
Removes the visual editor (and editor choice) as it has been decided …
Browse files Browse the repository at this point in the history
…to drop CKEditor and use something else.

The reason for this is: self dogfooding, as explained at http://indiewebcamp.com/selfdogfood. None of the maintainers actually use the visual editor, which means it was badly designed and coded. Everyone knows designing for the masses doesn't work, but everyone falls in that trap.

Fixes publify#224.
  • Loading branch information
Frédéric de Villamil committed Sep 4, 2013
1 parent 694b70f commit 8058ec5
Show file tree
Hide file tree
Showing 508 changed files with 17 additions and 9,099 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -73,7 +73,7 @@ core engine.
**Cool API:** Publify supports the various blogging engine APIs so you can
publish from desktop clients.

**On demand editor:** Publify supports various editors (visual, plain HTML,
**On demand syntax:** Publify supports various syntax (plain HTML,
Markdown, Textile)

**Multilingual**: Publify is (more or less) translated in English, French,
Expand Down
9 changes: 0 additions & 9 deletions app/controllers/admin/base_controller.rb
Expand Up @@ -6,15 +6,6 @@ class Admin::BaseController < ApplicationController
before_filter :look_for_needed_db_updates, :except => [:login, :signup, :update_database, :migrate]
before_filter :check_and_generate_secret_token, :except => [:login, :signup, :update_database, :migrate]

def insert_editor
editor = 'visual'
editor = 'simple' if params[:editor].to_s == 'simple'
current_user.editor = editor
current_user.save!

render :partial => "#{editor}_editor"
end

private

def update_settings_with!(params)
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/admin/content_controller.rb
Expand Up @@ -96,11 +96,6 @@ def autosave

@article.attributes = params[:article]

# Crappy workaround to have the visual editor work.
if current_user.visual_editor?
@article.body = params[:article][:body_and_extended]
end

@article.published = false
@article.set_author(current_user)
@article.save_attachments!(params[:attachments])
Expand Down
6 changes: 1 addition & 5 deletions app/controllers/admin/pages_controller.rb
Expand Up @@ -45,11 +45,7 @@ def destroy
private

def default_textfilter
if current_user.visual_editor?
"none"
else
current_user.text_filter || blog.text_filter
end
current_user.text_filter || blog.text_filter
end


Expand Down
15 changes: 1 addition & 14 deletions app/helpers/admin/base_helper.rb
Expand Up @@ -129,20 +129,7 @@ def published_or_not(item)
end

def macro_help_popup(macro, text)
unless current_user.editor == 'visual'
"<a href=\"#{url_for :controller => 'textfilters', :action => 'macro_help', :id => macro.short_name}\" onclick=\"return popup(this, 'Publify Macro Help')\">#{text}</a>"
end
end

def build_editor_link(label, action, id, update, editor)
link = link_to_remote(label,
:url => { :action => action, 'editor' => editor},
:method => :get,
:class => 'ui-button-text',
:loading => "new Element.show('update_spinner_#{id}')",
:success => "new Element.toggle('update_spinner_#{id}')",
:update => "#{update}")
link << image_tag("spinner-blue.gif", :id => "update_spinner_#{id}", :style => 'display:none;')
"<a href=\"#{url_for :controller => 'textfilters', :action => 'macro_help', :id => macro.short_name}\" onclick=\"return popup(this, 'Publify Macro Help')\">#{text}</a>"
end

def display_pagination(collection, cols, first='', last='')
Expand Down
1 change: 0 additions & 1 deletion app/models/blog.rb
Expand Up @@ -53,7 +53,6 @@ class Blog < ActiveRecord::Base
setting :ping_urls, :string, "http://blogsearch.google.com/ping/RPC2\nhttp://rpc.technorati.com/rpc/ping\nhttp://ping.blo.gs/\nhttp://rpc.weblogs.com/RPC2"
setting :send_outbound_pings, :boolean, true
setting :email_from, :string, 'publify@example.com'
setting :editor, :integer, 'visual'
setting :allow_signup, :integer, 0
setting :date_format, :string, '%d/%m/%Y'
setting :time_format, :string, '%Hh%M'
Expand Down
10 changes: 0 additions & 10 deletions app/models/user.rb
Expand Up @@ -21,7 +21,6 @@ class User < ActiveRecord::Base

# Settings
setting :notify_watch_my_articles, :boolean, true
setting :editor, :string, 'visual'
setting :firstname, :string, ''
setting :lastname, :string, ''
setting :nickname, :string, ''
Expand Down Expand Up @@ -110,7 +109,6 @@ def permalink_url(anchor=nil, only_path=false)
end

def default_text_filter
return "none" if visual_editor?
text_filter
end

Expand Down Expand Up @@ -148,14 +146,6 @@ def self.to_prefix
'author'
end

def simple_editor?
editor == 'simple'
end

def visual_editor?
editor == 'visual'
end

def password=(newpass)
@password = newpass
end
Expand Down
21 changes: 5 additions & 16 deletions app/views/admin/content/_form.html.erb
@@ -1,4 +1,3 @@
<input type="hidden" name="current_editor" id="current_editor" value="<%= current_user.editor %>" />
<input type="hidden" name="user_textfilter" id="user_textfilter" value="<%= current_user.text_filter_name %>" />
<div id="autosave"><%= set_autosave_tag(@article) %></div>
<div id="article_keywords_auto_complete" class="auto_complete"></div>
Expand All @@ -24,28 +23,18 @@

<div id='editor-menu'>
<ul class="nav nav-tabs">
<li id='image-link' <%= 'style="display: none"' if current_user.editor == 'visual' %>><%= toggle_element 'carousel-wrapper', _("Images") %></li>
<li id="f" class='pull-right <%= "active" if current_user.editor == 'visual' %>'>
<%= build_editor_link(_("Visual"), 'insert_editor', 'fck', 'visual_editor', 'visual') %>
</li>
<li id="s" class='pull-right <%= "active" if current_user.editor == 'simple' %> '>
<%= build_editor_link(_("HTML"), 'insert_editor', 'simple', 'simple_editor', 'simple') %>
</li>
<li id='image-link'><%= toggle_element 'carousel-wrapper', _("Images") %></li>
</ul>
</div>

<div id="editor">
<div id='quicktags' style='<%= "display: none;" if current_user.editor == 'visual' %>'>
<div id='quicktags'>
<script type="text/javascript">edToolbar('article_body_and_extended', '<%= @article.text_filter %>');</script>
</div>

<div id ='visual_editor' <%= "style='display: none;'" if current_user.editor == 'simple'%> >
<%= ckeditor_textarea('article', 'body_and_extended', {:class => 'large', :height => '300px', :rows => '20'}) if current_user.editor == 'visual' %>
</div>

<div id='simple_editor' <%= "style='display: none;'" if current_user.editor == 'visual'%> >
<%= text_area('article', 'body_and_extended', {:class => 'input-block-level', :height => '360px'}) if current_user.editor == 'simple' %>
<%= render 'admin/shared/macros' if current_user.editor == 'simple' %>
<div id='simple_editor'>
<%= text_area('article', 'body_and_extended', {:class => 'input-block-level', :height => '360px'}) %>
<%= render 'admin/shared/macros' %>
</div>
</div>

Expand Down
21 changes: 0 additions & 21 deletions app/views/admin/content/_simple_editor.html.erb

This file was deleted.

21 changes: 0 additions & 21 deletions app/views/admin/content/_visual_editor.html.erb

This file was deleted.

20 changes: 5 additions & 15 deletions app/views/admin/pages/_form.html.erb
@@ -1,4 +1,3 @@
<input type="hidden" name="current_editor" id="current_editor" value="<%= current_user.editor %>" />
<input type="hidden" name="user_textfilter" id="user_textfilter" value="<%= current_user.text_filter_name %>" />

<h2 class='page-header'>
Expand All @@ -20,26 +19,17 @@

<div id='editor-menu'>
<ul class="nav nav-tabs">
<li id='image-link' <%= 'style="display: none"' if current_user.editor == 'visual' %>><%= toggle_element 'carousel-wrapper', _("Images") %></li>
<li id="f" class='pull-right <%= "active" if current_user.editor == 'visual' %>'>
<%= build_editor_link(_("Visual"), 'insert_editor', 'fck', 'visual_editor', 'visual') %>
</li>
<li id="s" class='pull-right <%= "active" if current_user.editor == 'simple' %> '>
<%= build_editor_link("HTML", 'insert_editor', 'simple', 'simple_editor', 'simple') %>
</li>
<li id='image-link'><%= toggle_element 'carousel-wrapper', _("Images") %></li>
</ul>
</div>

<div id='editor'>
<div id='quicktags' style='<%= "display: none;" if current_user.editor == 'visual' %>'>
<div id='quicktags'>
<script type="text/javascript">edToolbar('page_body', '<%= @page.text_filter %>');</script>
</div>
<div id ='visual_editor' <%= "style='display: none;'" if current_user.editor == 'simple'%> >
<%= ckeditor_textarea('page', 'body', {:class => 'large', :height => '300px', :rows => '20'}) if current_user.editor == 'visual' %>
</div>
<div id='simple_editor' <%= "style='display: none;'" if current_user.editor == 'visual'%> >
<%= text_area('page', 'body', {:class => 'input-block-level', :height => '300px', :rows => '20'}) if current_user.editor == 'simple' %>
<%= render 'admin/shared/macros' if current_user.editor == 'simple' %>
<div id='simple_editor'>
<%= text_area('page', 'body', {:class => 'input-block-level', :height => '300px', :rows => '20'}) %>
<%= render 'admin/shared/macros' %>
</div>
</div>
<div class='separator'>
Expand Down
19 changes: 0 additions & 19 deletions app/views/admin/pages/_simple_editor.html.erb

This file was deleted.

16 changes: 0 additions & 16 deletions app/views/admin/pages/_visual_editor.html.erb

This file was deleted.

13 changes: 0 additions & 13 deletions app/views/admin/users/_form.html.erb
Expand Up @@ -75,19 +75,6 @@
</div>
</div>
<% end %>
<div class='control-group'>
<label class='control-label'><%= _("Editor")%></label>
<div class='controls'>
<label class='radio' for="editor_0">
<input type="radio" name="user[editor]" value="simple" id="editor_0" <%= 'checked="checked"' if @user.editor == 'simple' %>/>
<%= _("Use simple editor")%>
</label>
<label class='radio' for="editor_2">
<input type="radio" name="user[editor]" value="visual" id="editor_2" <%= 'checked="checked"' if @user.editor == 'visual' %>/>
<%= _("Use visual rich editor")%>
</label>
</div>
</div>
<div class='control-group'>
<label class='control-label' for="text_filter"><%= _("Article filter")%></label>
<div class='controls'>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/administration.html.erb
Expand Up @@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="imagetoolbar" content="no" />
<%= stylesheet_link_tag "growler", "bootstrap", "administration_structure", "lightbox" %>
<%= javascript_include_tag "prototype", "effects", "builder", "dragdrop", "controls", "publify", "lightbox", "growler", "publify_carousel", "administration", "ckeditor/ckeditor" %>
<%= javascript_include_tag "prototype", "effects", "builder", "dragdrop", "controls", "publify", "lightbox", "growler", "publify_carousel", "administration" %>
<%= calendar_date_select_includes %>
<style type="text/css">
#carousel-content .slide { width: <%= this_blog.image_thumb_size %>; }
Expand Down
1 change: 0 additions & 1 deletion config/application.rb
Expand Up @@ -44,7 +44,6 @@ class Application < Rails::Application
require 'publify_textfilters'
require 'publify_avatar_gravatar'
require 'calendar_date_select/lib/calendar_date_select.rb'
require 'easy-ckeditor'
require 'action_web_service'
## Required by the plugins themselves.
# require 'avatar_plugin'
Expand Down
13 changes: 0 additions & 13 deletions config/ckeditor.yml

This file was deleted.

5 changes: 0 additions & 5 deletions config/routes.rb
Expand Up @@ -7,10 +7,6 @@
end
end

# for CK Editor
match 'ckeditor/command', :to => 'ckeditor#command', :format => false
match 'ckeditor/upload', :to => 'ckeditor#upload', :format => false

# TODO: use only in archive sidebar. See how made other system
match ':year/:month', :to => 'articles#index', :year => /\d{4}/, :month => /\d{1,2}/, :as => 'articles_by_month', :format => false
match ':year/:month/page/:page', :to => 'articles#index', :year => /\d{4}/, :month => /\d{1,2}/, :as => 'articles_by_month_page', :format => false
Expand Down Expand Up @@ -121,7 +117,6 @@
# namespace :admin do
# resources :content do
# post :autosave, on: :collection
# get :insert_editor, on: :collection
# post :destroy, on: :member
# get :auto_complete_for_article_keywords, on: :collection
## get :attachment_box_add, on: :member
Expand Down
5 changes: 0 additions & 5 deletions lang/da_DK.rb
Expand Up @@ -583,9 +583,6 @@
l.store "Sorry the theme catalogue is not available", ""
l.store "Theme catalogue", ""

# app/views/admin/themes/editor.html.erb
l.store "Theme editor", ""

# app/views/admin/themes/index.html.erb
l.store "Active theme", "Aktiv tema"
l.store "Choose a theme", "Vælg et tema"
Expand All @@ -603,8 +600,6 @@
l.store "Lastname", "Efternavn"
l.store "Nickname", "Kælenavn"
l.store "Editor", ""
l.store "Use simple editor", ""
l.store "Use visual rich editor", ""
l.store "Send notification messages via email", "Send meddelelser via e-mail"
l.store "Send notification messages when new articles are posted", "Send meddelelser når ny artikler bliver udgivet"
l.store "Send notification messages when comments are posted", "Send meddelelser når der er nye kommentarer"
Expand Down
6 changes: 0 additions & 6 deletions lang/de_DE.rb
Expand Up @@ -583,9 +583,6 @@
l.store "Sorry the theme catalogue is not available", ""
l.store "Theme catalogue", ""

# app/views/admin/themes/editor.html.erb
l.store "Theme editor", ""

# app/views/admin/themes/index.html.erb
l.store "Active theme", "Aktives Motiv"
l.store "Choose a theme", "Motiv auswählen"
Expand All @@ -602,9 +599,6 @@
l.store "Firstname", ""
l.store "Lastname", ""
l.store "Nickname", ""
l.store "Editor", ""
l.store "Use simple editor", ""
l.store "Use visual rich editor", ""
l.store "Send notification messages via email", "Benachrichtigung via Email schicken"
l.store "Send notification messages when new articles are posted", "Benachrichtigung schicken, wenn neue Artikel veröffentlicht werden"
l.store "Send notification messages when comments are posted", "Benachrichtigung schicken, wenn neue Kommentare eintreffen"
Expand Down
5 changes: 0 additions & 5 deletions lang/es_MX.rb
Expand Up @@ -586,9 +586,6 @@
l.store "Sorry the theme catalogue is not available", ""
l.store "Theme catalogue", ""

# app/views/admin/themes/editor.html.erb
l.store "Theme editor", ""

# app/views/admin/themes/index.html.erb
l.store "Active theme", "Tema activo"
l.store "Choose a theme", "Escoge un tema"
Expand All @@ -606,8 +603,6 @@
l.store "Lastname", ""
l.store "Nickname", ""
l.store "Editor", ""
l.store "Use simple editor", ""
l.store "Use visual rich editor", ""
l.store "Send notification messages via email", "Enviar notificaciones por email"
l.store "Send notification messages when new articles are posted", "Enviar notificaciones cuando un nuevo art&iacute;culo sea publicado"
l.store "Send notification messages when comments are posted", "Enviar notificaciones cuando un nuevo comentario sea publicado"
Expand Down

0 comments on commit 8058ec5

Please sign in to comment.