You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by kingIZZZY <gi...@git.apache.org> on 2014/11/06 21:30:01 UTC

[GitHub] cordova-app-hello-world pull request: more helpful stupid-friendly...

GitHub user kingIZZZY opened a pull request:

    https://github.com/apache/cordova-app-hello-world/pull/9

    more helpful stupid-friendly index.js

    3:07:37 PM	regedit:  i did actually look at index.js at first, but it seemed a little daunting so i put it aside and started coding my own stuff
    3:08:25 PM	regedit:  i saw this 'app' object and calling .initialize() on it, and for some reason I thought it must be some internal cordova stuff i must read about elsewhere
    3:08:43 PM	regedit:  didnt realize this 'app' object was all defined right then & there
    3:09:01 PM	regedit:  thought it might be set up from inside cordova.js or whatnot...
    3:09:11 PM	regedit:  gave up on it, wrote my own js
    3:09:23 PM	timeless:  so, if you can think about a way for that block of code that you did look at
    3:09:24 PM	regedit:  maybe index.js can be more stupid friendly?
    3:09:26 PM	timeless:  and did quickly discard
    3:09:39 PM	timeless:  could have been more friendly to prevent you from doing what you did
    3:09:43 PM	timeless:  i'm open to changes
    3:11:20 PM	timeless:  hrm
    3:11:31 PM	timeless:  yeah. js/index.js really isn't stupid-friendly
    3:11:34 PM	timeless:  please file a bug
    3:11:57 PM	regedit:  here http://hastebin.com/rugelupena.js
    3:12:33 PM	regedit:  my amateur newly proposed index.js :D
    3:13:19 PM	 timeless nods
    3:13:31 PM	timeless:  the problem is that their code was designed to be pluggable and object oriented
    3:13:50 PM	timeless:  which is well... nice and all, but... makes it hard to figure out what's important
    3:14:38 PM	regedit:  at least from a newcomer point of view, yeah. many (most?) newcomers dont even care much about OO
    3:14:53 PM	regedit:  if you want to appeal to them, it must be stupider

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kingIZZZY/cordova-app-hello-world master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-app-hello-world/pull/9.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #9
    
----
commit 4c1b7a04260f833d32052c3d276c9c5c77b6245f
Author: Yisroel Goldstein <yi...@journeymanweb.com>
Date:   2014-11-06T20:23:25Z

    more helpful stupid-friendly index.js

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-app-hello-world pull request: more helpful stupid-friendly...

Posted by kingIZZZY <gi...@git.apache.org>.
Github user kingIZZZY commented on a diff in the pull request:

    https://github.com/apache/cordova-app-hello-world/pull/9#discussion_r19973706
  
    --- Diff: www/js/index.js ---
    @@ -16,27 +16,15 @@
      * specific language governing permissions and limitations
      * under the License.
      */
    -var app = {
    -    // Application Constructor
    -    initialize: function() {
    -        this.bindEvents();
    -    },
    -    // Bind Event Listeners
    -    //
    -    // Bind any events that are required on startup. Common events are:
    -    // 'load', 'deviceready', 'offline', and 'online'.
    -    bindEvents: function() {
    -        document.addEventListener('deviceready', this.onDeviceReady, false);
    -    },
    -    // deviceready Event Handler
    -    //
    -    // The scope of 'this' is the event. In order to call the 'receivedEvent'
    -    // function, we must explicitly call 'app.receivedEvent(...);'
    -    onDeviceReady: function() {
    -        app.receivedEvent('deviceready');
    -    },
    -    // Update DOM on a Received Event
    -    receivedEvent: function(id) {
    +
    +// before any cordova functionality can be used, you must hook into this event
    --- End diff --
    
    perhaps compare to jQuery $(document).ready()


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org