Giter Club home page Giter Club logo

Comments (7)

inferpse avatar inferpse commented on May 31, 2024

Hi, Tom!

Agreed. I've updated the master branch (006f258) and tested with the following script:

// configuration
requirejs.config({
    baseUrl: 'js',
    shim: {
        'jcf.number': {
            deps: ['jcf'],
            exports: 'jcf.modules.Number'
        },
        'jcf.select': {
            deps: ['jcf'],
            exports: 'jcf.modules.Select'
        },
        'jcf.checkbox': {
            deps: ['jcf'],
            exports: 'jcf.modules.Checkbox'
        }
    }
});

// test
require(['jquery', 'jcf', 'jcf.select', 'jcf.checkbox', 'jcf.number'], function($, jcf) {
    $(function() {
        jcf.replaceAll();
    });
});

I'm going to add a few more fixes in modules and create a new release after that.

from jcf.

Thorn1089 avatar Thorn1089 commented on May 31, 2024

Awesome, thanks for the quick turnaround!

from jcf.

jirkae avatar jirkae commented on May 31, 2024

Hi,

plase, is this issue really fixed? Because when I have this code, it doesnt work

requirejs.config({
    baseUrl: staticUrl+'js/ver2/',
    paths: {
        jcf: '../../bower_components/jcf/js/jcf',
        'jcf.checkbox': '../../bower_components/jcf/js/jcf.checkbox',
        'jcf.radio': '../../bower_components/jcf/js/jcf.radio',
        'jcf.select': '../../bower_components/jcf/js/jcf.select.min'
    },
    shim: {
        'imageFill': ['jquery'],
        'jcf.checkbox': {
            deps: ['jcf'],
            exports: 'jcf.modules.Checkbox'
        },
        'jcf.radio': {
            deps: ['jcf'],
            exports: 'jcf.modules.Radio'
        },
        'jcf.select': {
            deps: ['jcf'],
            exports: 'jcf.modules.Select'
        }
    }
});
requirejs(['jcf','jcf.checkbox', 'jcf.radio', 'jcf.select'], function (jcf) {
    jcf.replaceAll(pluginInterface.jcf.conf.selector);
});

Thanks a lot

from jcf.

inferpse avatar inferpse commented on May 31, 2024

Hey, @jirkae !

What kind of error do you have? jcf is undefined and it's coming from one of the jcf modules?

from jcf.

jirkae avatar jirkae commented on May 31, 2024

Oh, that was fast :D

jcf.checkbox.js:171 Uncaught ReferenceError: jcf is not defined

On each module

from jcf.

inferpse avatar inferpse commented on May 31, 2024

Ok, I think we broke AMD compatibility with previous commit.
Try to use jcf.js from 79ec1a8. Will it work for you?

from jcf.

jirkae avatar jirkae commented on May 31, 2024

Cool, thanks a lot, it works!

from jcf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.