signalpoint / jDrupal

A JavaScript Library and API for Drupal Applications
http://jdrupal.tylerfrankenstein.com/
GNU General Public License v2.0
76 stars 38 forks source link

jdrupal-7.0.2.min seems not working.. #37

Closed vinaysamant closed 8 years ago

vinaysamant commented 8 years ago

1st thing, i should thank you from bottom of my heart for this amazing jDrupal. This is something i really really craving for. I tried DrupalGap and all your tutorials and lot of stuff online, but jDrupal is really top of the world. While doing this i downloaded jdrupal-7.0.2 from http://jdrupal.easystreet3.com/7/docs/Download pointing to https://raw.githubusercontent.com/easystreet3/jDrupal/7.x-1.x/jdrupal.min.js. I included it properly and tried every possible setting. And nothing ever worked. I was about to give up thinking that jDrupal must be trial experiment and 'you' must have gone ahead with DrupalGap. But then 3.45AM in morning, i decided to re-read your docs and just downloaded the source from https://github.com/easystreet3/jDrupal/releases. I just ran your app, as it is and it displayed magic words : hello world.

I am developing this app for one of my client where my specific requirement was to have "Drupal" as module and sole. DrupalGap is completely dependent on Drupal and it doesn't work at all if you are not connected. I wanted to bundle some sample data/videos for offline access and then also avail "Drupal" inside. Currently we have Opigno on Drupal and this app is being developed for educational purpose. Somehow I found jDrupal and i m thrilled. Can you please provide more documentation and examples? I can help you also if you want. But I am not good/geek programmer as you! But i will surely like to help. I am thinking of writing a basic tutorial on this experience that should guide rookies like me to build phonegap based mobile apps.

signalpoint commented 8 years ago

@vinaysamant Thank you for the kind words about jDrupal and DrupalGap. I've not sure why the jdrupal.min.js file was/is not working for you. It's backed by unit testing, but either way I'm glad it is now working for you.

You are correct that DrupalGap isn't very helpful if there is no connection. Ideally effort would be put towards better offline capability in DrupalGap. All documentation will live in the docs folder of each project, so please submit pull requests with any improvements you would like to add.

Thank you again for your interest, good luck and happy coding!

vinaysamant commented 8 years ago

@signalpoint, I have seen all the documentation regarding jDrupal, whatever is online. Do you have anything additional to it in some archives or something? Is this jDrupal forms base for DrupalGap?

signalpoint commented 8 years ago

That is all the docs that are available for jDrupal, short and sweet. It definitely could use some more examples, but I personally spend the vast majority of my time then building DrupalGap on top of jDrupal, and then documenting DrupalGap.

vinaysamant commented 8 years ago

hii!

one small question.. i have written a simple function to check connection using system_connect, and then whether user already logged in : if(typeof user.uid === "undefined" || user.uid == 0). I am giving link to my drupal site where he may navigate and access other inbuilt functions. But this opens in new browser window. Why is that so? Why does not it use app where we load our html?

            system_connect({
                success: function(result) {
                    $("#userarea").html("online now..");
                    var user = Drupal.user;
                    if(typeof user.uid === "undefined" || user.uid == 0){
                        $("#userarea").html('<a href="#" id="login" class="ui-btn-icon-left" data-role="button" data-icon="star" onclick="login()">Login</a>');
                    }
                    else {
                        $("#userarea").html("welcome back " + user.name + '!');
                        $("#userarea").append('<a href="http://test.mipconline.org/my-courses" id="mycourses" class="ui-btn-icon-left" data-role="button" data-icon="star">My Courses</a><a href="#" id="logout" class="ui-btn-icon-left" data-role="button" data-icon="star" onclick="logout()">Logout</a>');
                        node_load(20, {
                            success: function(node) {
                                alert("Loaded " + node.title);
                            }
                        });
                    }
                },

                error: function(result) {
                    alert("Network error. Unable to connect MIPC Resources.");
                }
              });
vinaysamant commented 8 years ago

hey i got it.. there is setting in config.xml : This works like wonder! I have also deleted :

    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />

This means one shall not be able to access any link from my app. Isn't it??

jDrupal Rocks! Period!

signalpoint commented 8 years ago

@vinaysamant Thank you for sharing the solution. I noticed it looks like you are using jQuery Mobile to build your app. If that is the case, then I highly recommend checking out DrupalGap.

vinaysamant commented 8 years ago

Hii..

sorry for late reply. what i m trying to develop the app is as follows :

I think this is not possible with DrupalGap, or i dont know how! If you have some time kindly check "https://play.google.com/store/apps/details?id=org.mipconline.jd&hl=en". This is the app. Still in beta mode. You can download and register etc.

And many thanks to you for JDrupal.

signalpoint commented 8 years ago

@vinaysamant Your bullet points 1-2 would be the trickiest, best of luck. Offline capabilities in DrupalGap continue to improve, but it would need to be enhanced further to function with the scenario you've described.

kentr commented 8 years ago

@vinaysamant I'll be doing something similar with the D8 version & Ionic.

It would be great to collaborate on a local storage model and connection detection.

vinaysamant commented 8 years ago

@signalpoint those points are achieved nicely. Now thinking of adding downloadable content like movies, pdfs etc that can not be bundled within the app. I like jDrupal because it does not demand anything to be installed on Drupal side. Is this same about D8 also? or do we need to install additional modules?

@kentr i will also be doing similar thing on D8 & jDrupal8. I have a D8 website developed for a MP in India can be seen at www.narendrasawaikar.org. I will be writing an app for this.. but never used ionic. Have you tried jDrupal? My above listed app is Cordova + jDrupal. This version has offline capabilities. Next version will use local storage, downloads etc. Releasing in next week. I will post URL here.

signalpoint commented 8 years ago

In D8, there is a jDrupal Drupal module needed for jDrupal Connect to work, otherwise all other jDrupal calls will work without the module and just run through D8 core REST.