jmpressjs / jmpress.js

A jQuery plugin to build a website on the infinite canvas
http://jmpressjs.github.com/jmpress.js
1.5k stars 237 forks source link

Syntax error with latest jQuery #185

Closed matatk closed 8 years ago

matatk commented 8 years ago

Hi and thank you for this brilliant tool. I just started using it, and noticed that if I am using jQuery 2.2.1 then I get a syntax error:

Syntax error, unrecognized expression: a[href^=#]

However if I use jQuery 2.1.4, as you do, the error does not occur.

I think it is to do with the need to quote special characters in CSS selectors.

FagnerMartinsBrack commented 8 years ago

Could you post a jsfiddle or jsbin that reproduces the issue?

matatk commented 8 years ago

Sure, this demonstrates the problem: http://jsbin.com/qozolo/edit?html,output

If you switch from jQuery 2.2.1 to 2.1.4 then the syntax error doesn't happen.

FagnerMartinsBrack commented 8 years ago

Thanks, it is much easier for the authors of the project fix the issue if you provide an example :)

shama commented 8 years ago

@FagnerMartinsBrack Now realizing that I don't have the time I thought I would for this project and you are actively helping, would you be interested in being added as a contributor?

FagnerMartinsBrack commented 8 years ago

@shama Thanks for the proposal.

Recently I have been added as a contributor in the original impress.js project in order to shift the code from a presentation only framework to a core-only, plugin-based library (see this comment). One of the reasons is that a have a project that depends on impress.js working like only the core, not as a full coupled presentation framework. Since there is a lot of issues/PR I expect that the end-goal will take many months because I am not as active in open-source as many ppl out there.

After impress.js becomes more decoupled, I see a very interesting use-case for jmpress.js. jmpress.js would be more about running an actual talk presentation on infinite canvas (in a website or slide projector) than provide only a decoupled core for extension, so it can consume impress.js in the future and reduce the amount of code that needs to be tested. Also, it might not need jQuery anymore in the future since the heavy stuff will be done by impress.js.

I would say that I have more stake in a project that contains only a simple, lightweight, core presentation lib than one with many features for specific use cases.

TL;DR for the future:

If you agree with the goals above, you can add me as a contributor. But I don't expect to work in jmpress.js anytime soon in this year, other than triaging a few issues/PRs here and there until impress.js is ready.

hroma commented 8 years ago

Quick fix for jQuery 2.2.1. Find hashLink = "a[href^=#]"; and replace with hashLink = 'a[href^="#"]';

Tested with jQuery 2.2.1. Result = syntax error is gone.

FagnerMartinsBrack commented 8 years ago

The selector a[href^=#] is invalid and jQuery fixed it recently, that's why it is breaking. See https://github.com/jquery/jquery/issues/2824