256MbTeam / Redmine-Scrumbler

Easy to use plugin for Redmine. It allows users to use the Scrum/Agile process in projects. Scrumbler have interactive dashboard with the ability to configure for each sprint. Plugin adds Scrum Points field in every issue in project. Scrumbler as possible using the standard redmine structure of projects.
GNU General Public License v2.0
112 stars 41 forks source link

Replace Prototype with JQuery for Redmine >2.1 #94

Open Aradiv opened 11 years ago

Aradiv commented 11 years ago

Redmine 2.1 uses JQuery instead of Prototype. Instead of Growler-pack.js we can use the JQuery Growler plugin (https://github.com/ksylvest/jquery-growler) Instead of new Ajax.Request() use $.ajax() Instead of observe('click', function(){}); use live('click', function(){});

as you see porting to jquery is pretty simple and can be done pretty fast

cforce commented 11 years ago

Wel, please do it an create a fork to publish for all of us.

highfellow commented 11 years ago

Has anyone done this? I'm contemplating having a go, but don't want to duplicate work that's been done elsewhere.

Jim25 commented 11 years ago

@highfellow: Did you finish this? I did search for this but it seem to be not solved.

highfellow commented 11 years ago

I did manage to get scrumbler to work, but it was a quick hack not a proper port. I installed the prototype-rails gem, and added some lines to the plugin code to require it in the right context. Roughly, I did something like:

in redmine_scrumbler/init.rb:

require 'prototype-rails'

in all the views which have their own html <head> section:

  <%= javascript_include_tag 'prototype', :plugin => 'redmine_scrumbler' %>
  <%= javascript_include_tag 'prototype_ujs', :plugin => 'redmine_scrumbler' %>

I think I may have also copied some files to the site's javascript assets directory.

Hope this is some help.

Jim25 commented 11 years ago

Thanks for your help. I installed prototype-rails but my redmine had error. I download prototype.js and add to javascript assets directory and the backlog displays now, but there is still an other error remote_function not support.

marlonpascoal commented 11 years ago

I've just upgraded from v1.4.4 to 2.3.1 and got into this problem. I tried @highfellow patch but it didn't work.

I'll appreciate when it's ready..

[]s

cassianomonteiro commented 10 years ago

I was able to port it to Redmine 2.4.2 following @highfellow help, doing the following:

1 - Install the prototype-rails gem with the command:

gem install prototype-rails -v=3.2.1

2 - in redmine_scrumbler/init.rb, add the line:

require 'prototype-rails'

3 - in all the view files which have their own html head section, add the following lines before other javascript_include_tag (pre tag didn't work here, I don't know why...):

<%= javascript_include_tag 'prototype', :plugin => 'redmine_scrumbler' %> <%= javascript_include_tag 'prototype_ujs', :plugin => 'redmine_scrumbler' %> <%= javascript_include_tag 'effects', :plugin => 'redmine_scrumbler' %> <%= javascript_include_tag 'dragdrop', :plugin => 'redmine_scrumbler' %> <%= javascript_include_tag 'controls', :plugin => 'redmine_scrumbler' %>

4 - copy the following files from the gem prototype-rails assets folder to redmine_scrumbler\assets\javascripts :

prototype.js
prototype_ujs.js
effects.js
dragdrop.js
controls.js

I hope it helps. I tried to make a pull request, but the git is not working behind my company's proxy... =(

MauroAndreFlores commented 10 years ago

Cassiano and Andrew

Following your tips it's working almost everything, but I still have some issues. For instance:

Is the plugin working fine for you?

cassianomonteiro commented 10 years ago

Hello Mauro,

Yes, it has been working fine for me with the modifications I have mentioned... What browser are you using? I'm using Google Chrome.

It seems to be a JQuery problem.. Are you using what versions of ruby, rails and prototype-rails? And what's your environment?

Sorry I can't help much... Good luck over there!

MauroAndreFlores commented 10 years ago

browser - google chrome (ie and firefox) redmine version 2.4.2.stable ruby version 1.9.3-p231 (2012-05-25) [i386-mingw32] rails version 3.2.16 database adapter PostgreSQL prototype-rails 3.2.1 environment: windows 8 - bitnami

cassianomonteiro commented 10 years ago

I'm using ruby 1.9.3-p484 from Rails Installer. But this shouldn´t be a problem. Also, what ruby webserver are you using? I´m running on puma 2.0.0b7.

Other than that, I don´t know how to help you... Sorry about that.

MauroAndreFlores commented 10 years ago

Shouldn't jquery dependency be removed to make plugin work with prototype? If it's correct, how can it be done? The import of jquery.js is not explicit. For instance, the following function is returning null: $('#ajax-indicator'). It wouldn't return null if it was using prototype format: $('ajax-indicator').

(Cassiano, you have already helped a lot. Thanks)

cassianomonteiro commented 10 years ago

I don't know much about the JQuery and the prototype-rails, but as far as I could understand, Rails3 dropped the use of JQuery, that's why the plugin stopped working on Redmine 2.x. The prototype-rails solves this by adding the JQuery features embedding it the to the plugin.