Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carousel won't allow edits #9

Closed
trf000 opened this issue Aug 10, 2015 · 8 comments
Closed

Carousel won't allow edits #9

trf000 opened this issue Aug 10, 2015 · 8 comments

Comments

@trf000
Copy link
Contributor

trf000 commented Aug 10, 2015

Upgraded to latest version of phpws, Carousel won't allow edits of any kind. Modal won't appear, checkbox for active does not set.

@jlbooker
Copy link
Contributor

@Stardog Would this have to do with Bower?

@trf000, you may need to install Bower (npm install bower) and then run bower install in the main phpws directory. Bower is a front-end javascript (really Node.js/npm) package manager. The bower install command will go out and download external javascript packages. We'll no longer need to include jQuery in the phpws repo, nor do we need to ship it. Bower will allow you to grab the latest compatible version directly from the jQuery folks on-demand.

To confirm my theory, look at the dev console. You'll probably see 404 for a lot of js files in phpws/bower_components/....

@trf000
Copy link
Contributor Author

trf000 commented Aug 10, 2015

didn't realize I needed to install anything else. I have zero access to my
server to install this, and I'm guessing I can't just ftp it there.

On Mon, Aug 10, 2015 at 2:34 PM Jeremy Booker notifications@github.com
wrote:

@Stardog https://github.com/Stardog Would this have to do with Bower?

@trf000 https://github.com/trf000, you may need to install Bower (npm
install bower) and then run bower install in the main phpws directory.
Bower is a front-end javascript (really Node.js/npm) package manager. The bower
install command will go out and download external javascript packages.
We'll no longer need to include jQuery in the phpws repo, nor do we need to
ship it. Bower will allow you to grab the latest compatible version
directly from the jQuery folks on-demand.

To confirm my theory, look at the dev console. You'll probably see 404 for
a lot of js files in phpws/bower_components/....


Reply to this email directly or view it on GitHub
#9 (comment).

@trf000
Copy link
Contributor Author

trf000 commented Aug 11, 2015

@jlbooker @Stardog

I'm not seeing any 404 errors regarding bower. And on a fresh installation, I was getting a ton of 500 errors regarding the settings table and a duplicate id of 0. Once I tracked down the error, I saw that i could manully change the id of each setting, but if i went into settings again and saved, it made each setting have an id of 0 again.

Again this is the default bootstrap theme. I'm not seeing a reference to bower anywhere.

@trf000
Copy link
Contributor Author

trf000 commented Aug 11, 2015

I think the issue is in here:

this.initEditClick = function ()
    {
        $('.pager-row').click(function (e) {
            if (!$(e.target).is('input.active-checkbox')) {
                _.initDeleteClick();
                $('#delete-slide').show();
                var row_id = $(this).data('rowId');
                $('#resource-id').val(row_id);
                $('#slide-update').modal('show');
                $('#slide-update .modal-title').html('Update slide');
                $.get('carousel/admin/', {
                    command: 'edit_slide',
                    slide_id: row_id
                }, function (data) {
                    $('#title').val(data.title);
                    $('#caption').val(data.caption);
                    $('#url').val(data.url);
                    $('#caption-zone-2').val(data.caption_zone);
                    if (data.show_title == 1) {
                        $('#show_title').prop('checked', true);
                    } else {
                        $('#show_title').prop('checked', false);
                    }
                }, 'json');
            }

        });
        $('.active-checkbox').click(function () {
            if ($(this).is(':checked')) {
                $.get('carousel/admin/', {
                    command: 'activate',
                    slide_id: $(this).data('slideId')
                });
            } else {
                $.get('carousel/admin/', {
                    command: 'deactivate',
                    slide_id: $(this).data('slideId')
                });
            }
        });
    };

@jlbooker
Copy link
Contributor

@trf000 Are you seeing any js errors from this section in the console? It's likely that the $.get() AJAX requests are failing. There's no error handling being done on those, so if the server throws an error, the error will be quietly hidden in your browser's network request log.

Turn on the network logging, then try to edit a slide, and then have a look at the response to the AJAX GET request.

@trf000
Copy link
Contributor Author

trf000 commented Aug 11, 2015

Weird, but I cannot see any thing like that. Every function in
slide_list.js seems to work except for the initEditClick. I'm at a complete
loss.

Can you duplicate this at all?

On Tue, Aug 11, 2015 at 3:05 PM Jeremy Booker notifications@github.com
wrote:

@trf000 https://github.com/trf000 Are you seeing any js errors from
this section in the console? It's likely that the $.get() AJAX requests are
failing. There's no error handling being done on those, so if the server
throws an error, the error will be quietly hidden in your browser's network
request log.

Turn on the network logging, then try to edit a slide, and then have a
look at the response to the AJAX GET request.


Reply to this email directly or view it on GitHub
#9 (comment).

@Stardog
Copy link
Contributor

Stardog commented Aug 12, 2015

Jeez. Sorry it took so long for me to get to this. The fix is here 562e2dd

@Stardog Stardog closed this as completed Aug 12, 2015
@trf000
Copy link
Contributor Author

trf000 commented Aug 12, 2015

Thanks Matt. I hate that I didn't figure it out on my own.

On Wed, Aug 12, 2015 at 11:01 AM Matthew McNaney notifications@github.com
wrote:

Jeez. Sorry it took so long for me to get to this. The fix is here 562e2dd
562e2dd


Reply to this email directly or view it on GitHub
#9 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants