Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mercury-rails no editable area js error 'Uncaught TypeError: Cannot read property 'konqueror' of undefined '

I cannot for the life of me figure out why this isn't working!
I'm working through the railscast for mercury and I can't get the editable area to show up.

gemfile

source 'https://rubygems.org'
gem 'rails', '3.2.13'
gem 'mercury-rails', git: 'https://github.com/jejacks0n/mercury.git'
gem 'sqlite3'
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'

routes

MercuryRelational::Application.routes.draw do
  mount Mercury::Engine => '/'

  root to: "pages#show"

show page

<h1>Show Page</h1>
<div id="page_content" class="mercury-region" data-type="editable"><%= raw(@page.content)     %></div>

url to the show page is http://localhost:4002/editor

still there is no editable blue box around the text.

However! I do get an error in the javascript terminal though "Uncaught TypeError: Cannot read property 'konqueror' of undefined"

Please help!

like image 547
Patrick Dougall Avatar asked Aug 23 '13 20:08

Patrick Dougall


2 Answers

I've found the problem and have solved it in the following way!

It turns out that mercury is using the jquery method jQuery.browser, which is deprecated in the jquery 1.9 upgrade.

I'm using gem 'mercury-rails', git: 'git://github.com/jejacks0n/mercury' so this will probably get fixed and I don't know how else to document if this solution is relevant to you, but this is the latest commit I'm using from the mercury gem, d065b2c31b895af03749254b521f0c0ee18fb25a.

Including this gem solved the issue for me.

gem 'jquery-migrate-rails'

and don't forget //= require jquery-migrate-min in the application.js file, after requiring the other jquery files.

like image 93
Patrick Dougall Avatar answered Sep 22 '22 03:09

Patrick Dougall


I have same issue here by following railscast for mercury.

after re-read mercury documentation on the mercury js file, then i found a solution by changing :

<span id="page_name" class="mercury-region" data-type="editable">

to

<span id="page_name" data-mercury="full" contenteditable="true">

hope this will works properly with same issue

like image 20
Ardian Avatar answered Sep 25 '22 03:09

Ardian