Login page example

can anyone show me an example of the code used to make a loginpage that works with parse as a backend and a register page because im struggling a lot with it please someone help :smiley:

Hi,

Please have a look a the new Examples section. We’ll soon be publishing an example of how to use Parse, but you can also just do this:

EDITED TO REFLECT LATEST VERSION

<JavaScript File="parse.js" ux:Global="Parse" />

Where parse.js is some version of Parse you downloaded from parse.com.

Then, to use Parse in your own scripts, do:

var Parse = require("Parse").Parse;

Anders Lassen: I try to implement this but I get this errors:

MainView.ux(10): E8001: 'JavaScript' does not have a property called 'Module'
MainView.ux(10): E8001: 'JavaScript' does not have a property called 'Id'

Good Factory Dev: The synatx for declaring global modules changed in the latest verison.

I’ve updated my post to reflect the new syntax.

I have have some problem to test a code… Im trying to make work this code (post a image in Parse) but only when I add this code:

<JavaScript File="parse-1.5.0.min.js" ux:Global="Parse" />

I get this errors:

MainView.ux(32): EUNKNOWN: 'DockPanel' is expected  Line 32, position 13.
/Users/cristiankarmy/Desktop/cameraTest/CameraTest/MainView.ux(32): E8001: 'DockPanel' is expected  Line 32, position 13.

MainView.ux: EUNKNOWN: 'DockPanel' is expected  Line 32, position 13.

The entire code is:

    <App Theme="Basic" ClearColor="#eeeeeeff">
        <DockPanel>
            <StatusBarBackground DockPanel.Dock="Top" />
                  <JavaScript File="parse-1.5.0.min.js" ux:Global="Parse" />
                  <JavaScript>
                      var Parse = require("Parse").Parse;
                    var Observable = require('FuseJS/Observable');
                    var Camera = require('FuseJS/Camera');
                    var Parse = require("Parse").Parse;
                    Parse.initialize("APP ID", "JAVASCRIPT ID"); 
                    var ParseTask = Parse.Object.extend("fotos");

                    function MyFuction(args) {
                        Camera.takePicture({ targetWith:640, targetHeight:360, correctOrientation:true }).then(function(file) {
                          module.exports.imageFile.value = file;

                              var picture = new Parse.Object("foto");
                            picture.set("name", file.name);
                            var parseFile = new Parse.File(file.name, file);
                            picture.set(file, parseFile);
                            return picture.save();
                        });
                      }

                    module.exports = {
                      MyFuction: MyFuction,
                      picture: picture,
                      parseFile: parseFile,
                      imageFile: Observable(null)
                    };

                  </JavaScript>

                      <Panel  Background="Red" Width="100%" Height="80." >
                          <Clicked Handler="{MyFuction}" />                      </Panel>

                <Image File="{imageFile}" Width="100%" Height="100%" StretchMode="UniformToFill" />

        </DockPanel>
    </App>

There is something bad?

Thanks!

Good Factory dev:

You’ve uncovered a bug in our regex parsers that captures the JavaScript code out of the XML. Thanks :slight_smile: We will get this fixed for the next release.

As a work-around for now, simply move your global modules to the bottom of the file:

...

    <JavaScript File="parse-1.5.0.min.js" ux:Global="Parse" />
</App>

Great! Thanks!

Fix has been pushed. Next release will include it for sure :slight_smile: