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

Implement support for file field in Drupalgap #825

Open
wants to merge 8 commits into
base: 7.x-1.x
Choose a base branch
from

Conversation

luxio
Copy link

@luxio luxio commented Jul 17, 2016

Here is my current work on uploading (unlimited) media files in Drupal Gap using the raw file services resource.

It is not ready yet, but I'm interested in your feedback to this approach.

Here is short demo:

Drupal Gap Video

@signalpoint
Copy link
Owner

@luxio Awesome video! You've done some great things here. I am reviewing this now. Initial recommendation would be, it looks like we'll want to leave the binaries out of the pull request, and only commit the src directory changes (I'm sorry for telling you the opposite earlier). I'll follow up shortly with a more thorough review.

if (element.field_info_field &&
element.field_info_field.cardinality == -1) {
var add_another_item_variables = {
text: 'Add another item',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luxio Please wrap this in a t(), text: t('Add another item')

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@signalpoint
Copy link
Owner

@luxio Looks great, very nice work. Is this in any ways tied to how the Media module is operating in Drupal, or is this independent of it and only for DrupalGap Core Files/Images ?

@luxio
Copy link
Author

luxio commented Jul 21, 2016

Thanks for the Feedback.

@luxio Looks great, very nice work. Is this in any ways tied to how the Media module is operating in Drupal, or is this independent of it and only for DrupalGap Core Files/Images ?

It is independent of the media module.

dpm(s[0]);
var mediaHTML = "<video style='max-width:100%;' controls><source src='" + s[0].fullPath + "'></video>";
$("#" + input_id + "-media").html(mediaHTML);
uploadFile(s[0].fullPath);
Copy link

@devasghar devasghar Oct 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file.toURL() worked for me on
L228
L230
L239
L241

file.toURL(); // if file.nativeURL is set, uses file.nativeURL, otherwise use file.toInternalURL() or file.fullPath.

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

Successfully merging this pull request may close these issues.

3 participants