Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D2E43C857 for ; Mon, 21 May 2012 22:56:15 +0000 (UTC) Received: (qmail 45589 invoked by uid 500); 21 May 2012 22:56:15 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 45552 invoked by uid 500); 21 May 2012 22:56:15 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 45537 invoked by uid 99); 21 May 2012 22:56:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 May 2012 22:56:15 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fil@adobe.com designates 64.18.1.208 as permitted sender) Received: from [64.18.1.208] (HELO exprod6og107.obsmtp.com) (64.18.1.208) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 May 2012 22:56:07 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob107.postini.com ([64.18.5.12]) with SMTP ID DSNKT7rH8u24a8CFZ9lSt8+oryZM97cmnkgS@postini.com; Mon, 21 May 2012 15:55:47 PDT Received: from inner-relay-4.eur.adobe.com (inner-relay-4.adobe.com [193.104.215.14]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q4LMrVJ0021085 for ; Mon, 21 May 2012 15:53:32 -0700 (PDT) Received: from nacas01.corp.adobe.com (nacas01.corp.adobe.com [10.8.189.99]) by inner-relay-4.eur.adobe.com (8.12.10/8.12.9) with ESMTP id q4LMtdYs014477 for ; Mon, 21 May 2012 15:55:43 -0700 (PDT) Received: from nambxv01a.corp.adobe.com ([10.8.189.95]) by nacas01.corp.adobe.com ([10.8.189.99]) with mapi; Mon, 21 May 2012 15:55:43 -0700 From: Filip Maj To: "callback-dev@incubator.apache.org" Date: Mon, 21 May 2012 15:59:35 -0700 Subject: Re: js commit: callback issue, require not working for global object Media Thread-Topic: js commit: callback issue, require not working for global object Media Thread-Index: Ac03pNmnoLsjRRFXQtOBntJJLlv1KQ== Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.2.120421 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/apache/incubator-cordova-js/blob/master/lib/common/commo n.js#L169-170 var _media =3D require('cordova/plugin/Media'); All "common" plugins map to cordova/plugin/ All platform-specific plugins map to cordova/plugin// When in doubt, check the platform definition files for exact "routes" to the plugins. On 5/21/12 2:41 PM, "Jesse" wrote: >Not sure why, I do not see that error. >Also, I could not get var _media =3D require('Media'); to work. ( which is >what I think it should be. ) >At runtime the Media is available on the window object, but how do I >require it? > >On Mon, May 21, 2012 at 1:13 PM, Anis KADRI wrote: > >> I am getting >> >> lib\wp7\plugin\wp7\CordovaMediaonStatus.js: line 10, col 9, 'Media' is >>not >> defined. >> >> When I run jake >> >> On Sat, May 19, 2012 at 1:56 AM, wrote: >> >> > Updated Branches: >> > refs/heads/master 58a213de4 -> 019c7af39 >> > >> > >> > callback issue, require not working for global object Media >> > >> > >> > Project: >> http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo >> > Commit: >> > >>=20 >>http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/019c7a >>f3 >> > Tree: >> > >>=20 >>http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/019c7af3 >> > Diff: >> > >>=20 >>http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/019c7af3 >> > >> > Branch: refs/heads/master >> > Commit: 019c7af398bae01813cbd401a90f1053790814d0 >> > Parents: 58a213d >> > Author: Jesse MacFadyen >> > Authored: Sat May 19 01:54:47 2012 -0700 >> > Committer: Jesse MacFadyen >> > Committed: Sat May 19 01:54:47 2012 -0700 >> > >> > ---------------------------------------------------------------------- >> > lib/wp7/plugin/wp7/CordovaMediaonStatus.js | 13 ++++++++++--- >> > 1 files changed, 10 insertions(+), 3 deletions(-) >> > ---------------------------------------------------------------------- >> > >> > >> > >> > >>=20 >>http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/019c7af3 >>/lib/wp7/plugin/wp7/CordovaMediaonStatus.js >> > ---------------------------------------------------------------------- >> > diff --git a/lib/wp7/plugin/wp7/CordovaMediaonStatus.js >> > b/lib/wp7/plugin/wp7/CordovaMediaonStatus.js >> > index 6302b2c..6d27626 100644 >> > --- a/lib/wp7/plugin/wp7/CordovaMediaonStatus.js >> > +++ b/lib/wp7/plugin/wp7/CordovaMediaonStatus.js >> > @@ -1,9 +1,16 @@ >> > >> > var cordova =3D require('cordova'); >> > >> > + >> > module.exports =3D function(args) { >> > + try { >> > + var res =3D JSON.parse(args); >> > + // NOTE: had issues with require here. -jm >> > + // technically this should be var _media =3D require('Media')= ; >>/// >> > me thinks >> > + Media.onStatus(res.id, res.msg, res.value); >> > + } >> > + catch(e) { >> > + console.log("Error calling media.onStatus :: " + e); >> > + } >> > >> > - console.log("media on status :: " + args); >> > - //var res =3D JSON.parse(args); >> > - //require("cordova/media").onStatus(res.id, res.msg, res.value); >> > }; >> > \ No newline at end of file >> > >> > >> > > > >--=20 >@purplecabbage >risingj.com