Coder Social home page Coder Social logo

amplesdk's Introduction

 ------------------------------------
 Ample SDK - JavaScript GUI Framework
 http://www.amplesdk.com
 ------------------------------------

 About:
 ===============
   Ample SDK is a standard-based cross-browser JavaScript GUI Framework
   for building client-side Rich Internet Applications. It employs XML
   technologies (such as XUL, SVG or HTML5) for UI layout, CSS for UI style
   and JavaScript with DOM3 or jQuery-like APIs for application logic.
   It equalizes browsers and brings technologies support to those missing any.

 Running on source:
 ===============
   There are 2 options to run Ample SDK from source. First (slow) involves an HTTP web-server,
   the other (fast) requires the Apache web-server with mod_rewrite, PHP and .htaccess support.
   Note! It is not possible to run Ample SDK source version from the file system.

   1. Running with any HTTP web server
      In this scenario server returns source-only "loader" files which make additional
      requests for all other files referenced from it that make up certain library.

   2. Running with Apache HTTP web server with mod_rewrite, .htaccess support and PHP
      In this scenario server redirects the requests to resources/assemble.php script that
      concatenates source folders contents into single files on the fly. This is faster
      compared to the first option.

 Building with Ant:
 ===============
   The build script is located in "build.xml". Before running the script, verify and
   adjust path to your PHP executable and build destination in "build.properties"

 Pre-built distributives:
 ===============
   The latest stable build is available on Ample SDK website: http://www.amplesdk.com/download/

 Questions?
 ===============
   If you have any questions, please feel free to ask them on the Ample SDK mailing list,
   which can be found here: http://groups.google.com/group/amplesdk

amplesdk's People

Contributors

1ton avatar amicanoctis avatar estolk avatar h6w avatar ilinsky avatar robkrueger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amplesdk's Issues

README included with source downloads doesn't warn about running code from server

I'm new at using github, so when I wanted to try out Ample SDK, I clicked on the "Download source" button on the project page, and started playing with the examples. The README file included in the archive did not warn that the example files need to be served from a server, and don't work when read by the browser right from the filesystem (i.e., I saw this: http://github.com/clientside/amplesdk/blob/master/README).

When I mentioned this on the mailing list, I was pointed to the following version: http://github.com/clientside/amplesdk/blob/master/ample/README. This contained helpful information, but as a beginner with github, I never would have found this file on my own.

I suggest you ensure that the version of the README with the helpful information about running from the server is included with source archive downloads, for the benefit of naive users like myself.

Instance variables become class variables through inheritance

<title>Class Variables</title> <script type="text/javascript" src="../ample-0.9.3/ample.js"></script> <script type="text/javascript" src="../ample-0.9.3/xhtml.js"></script>

Class Variables

<script type="text/javascript"> (function () {
        // Source
        var Source = function(){
            this.observers = [];
        };
        Source.prototype = new AMLElement();
        Source.prototype.namespaceURI = 'http://www.finalstep.com.au/2010/sandbox';
        Source.prototype.localName = 'source';
        Source.prototype.registerObserver = function(oWidget) {
            this.observers.push(oWidget);
        };

        ample.extend(Source);

        // MoreSource
        var MoreSource = function(){
        };
        MoreSource.prototype = new Source();
        MoreSource.prototype.namespaceURI = 'http://www.finalstep.com.au/2010/sandbox';
        MoreSource.prototype.localName = 'moresource';

        ample.extend(MoreSource);

        })();

        window.checkw1 = function() {
            var w1 = ample.getElementById('w1');
            var w2 = ample.getElementById('w2');
            w1.registerObserver(document.body); // doesn't matter what is being registered
            if (w1.observers !== w2.observers) {
                alert('ok - observers is an instance variable so w1 and w2 have different arrays.');
            }
        }
        window.checkw3 = function() {
            var w3 = ample.getElementById('w3');
            var w4 = ample.getElementById('w4');
            w3.registerObserver(document.documentElement);  // doesn't matter what is being registered
            if (w3.observers === w4.observers) {
                alert('Fail - observers has been converted into a class variable through inheritance - tricky! ;-)');
            }
        }

    </script>

    <script type="application/ample+xml" 
        xmlns="http://www.w3.org/1999/xhtml" 
        xmlns:x="http://www.finalstep.com.au/2010/sandbox">

        <x:source id="w1" />
        <x:source id="w2" />

        <x:moresource id="w3" />
        <x:moresource id="w4" />

    </script>

        <button onclick="checkw1()">Add observer to Source element</button>
        <button onclick="checkw3()">Add observer to MoreSource element</button>

</body>

smil:animate SVG transform in IE

smil:animate некорректно поворачивает svg:image в IE. То же самое для Chrome работает корректно. svg:rect корректно поворачивается и в IE и в Chrome. Пример:

<svg:svg viewBox="0,0 600,250" width="600px" height="250px"
xmlns:smil="http://www.w3.org/2008/SMIL30/"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svg="http://www.w3.org/2000/svg">
<svg:rect x="0" y="0" width="464" height="294" rx="10" ry="10">
<smil:animate begin="click" dur="2s" from="rotate(0, 232, 148)"
to="rotate(360, 232, 148)" attributeName="transform" />
/svg:rect
<svg:image xlink:href="http://www.amplesdk.com/design/img/ample-logo.gif"
x="100" y="100" width="264" height="94">
<smil:animate begin="click" dur="2s" from="rotate(0, 232, 148)"
to="rotate(360, 232, 148)" attributeName="transform" />
/svg:image
/svg:svg

xul:toolbarbutton down arrow clickability issue

It seems to me that the capture area for the down-arrow section of a
xul:toolbarbutton (type="menu-button") is too small - it seems to be
bounded by the GIF image (toolbarbutton_arrow.gif) instead of the
implied area of the divided section within the button. Unless I click
the image, or very close to it, the menu does not drop down.

You can see this behaviour in the XUL Toolbar demo code supplied with
Ample.

transform="rotate()" does not work for HTML inside <foreignObject/> in Internet Explorer

If you for instance have a code like this:

<script type="application/ample+xml">
Rotate me!
</script>

then, on the positive side, Internet Explorer 6-8 will display the embedded XHTML. But, on the negative side, it fails to rotate the embedded XHTML.

I don't know how to implement this in VML. May be (A) through re-intepreting HTML elements as if the were VML elements? Or (B) making use of MS filters:
http://www.useragentman.com/blog/2010/04/05/cross-browser-animated-css-transforms-even-in-ie/
http://samuli.hakoniemi.net/cross-browser-rotation-transformation-with-css/

$pressable - Feature request

We have $hoverable and $selectable which are frequently useful.
I find myself adding a _press class manually in many widgets (button, checkbox, radio options, slider, lists, etc)
_press is added on mousedown and removed on mouseup and also removed on mouseleave

Do you think its a useful enhancement?

FirebugLite causes unexpcted behavior in ample.ajax

With FirebugLite (latest version) installed, I noticed that ample.ajax failed in IE6.
With async == true, the error and complete callbacks executed immediately, and of course the responseText was undefined. The second argument to the callbacks was "error".

With async == false, the call completed ok, but no callbacks executed (success, error, complete).

My test page below: add FirebugLite and change async.

<title>Ajax Test</title> <script type="text/javascript" src="../ample-0.9.3/ample.js"></script> <script type="text/javascript" src="../ample-0.9.3/xhtml.js"></script>

Ajax Test

<script type="text/javascript"> var oReq = {}; oReq.type = 'GET'; oReq.url='vanuatu-page1.xml'; oReq.dataType = 'xml'; //oReq.timeout = 10000; oReq.async = false; // true causes error to be executed before the request is completed on IE6! oReq.success = function() { console.log('success', arguments); }; oReq.error = function() { console.log('error', arguments); }; oReq.complete = function() { console.log('complete', arguments); }; ample.ajax(oReq); //ample.get(oReq.url, null, function() {alert('hi')}, 'xml'); </script>

Disabling descendants

$isAccessible has been implemented in XUL and XHTML in this way:
return !this.attributes["disabled"];

While this disables the immediate element, it does not disable descendants, which is highly desirable. If an element checks recursively for a disabled parent, we can ensure that all descendants are also disabled.

    StandardWidget.prototype.$isAccessible = function() {
        // fixme: to work, this same logic must be applied to XHTML elements!
        var oParent = this.parentNode;
        if (!oParent || oParent === ample.lastChild) {
            return(true);
        }
        if (!oParent.$isAccessible()) {
            return(false);
        }
        return(this.getAttribute('disabled') != 'true');    
    };

Similar code may be added to each language (XUL, XHTML).
If it is not added, then wrapping in a DIV would re-enable the DIV's descendants.

Could this ancestor-checking logic instead be added to AMLElement so that it is the default behavior for all languages?

Publish Ample SDK classes into ample namespace

How about moving the 35 AML classes from the global namespace under the ample object?
It would tidy up the global namespace and looks like it might require only minor changes to the languages.
from
cXULElement = new AMLElement();
to
cXULElement = new ample.AMLElement();

Low priority

Multiple blurs instead of one

If I place 10 widgets of the same type on a page and tab from one to the next, I see a blur event on the activeWidget 10 times.
If I have 100 widgets on the page, I see 100 of the same blur events.

insertBefore sever problem: model out of sync with shadow

    <div id="parent" style="background-color: pink">
        <div id="child1" style="background-color: lightyellow;">1</div>
        <div id="child2" style="background-color: lightgreen;">2</div>
        <div id="child3" style="background-color: lightblue;">3</div>
    </div>

var parent = ample.getElementById("parent"),
child1 = ample.getElementById("child1"),
child2 = ample.getElementById("child2"),
child3 = ample.getElementById("child3");
parent.insertBefore(child1, child3);
console.log(parent.toXML());

the output is wrong: 2, 3, 1, visually is right: 2, 1, 3

ample.publish doesn't like one class

I have several widgets which inherit, so I've published the ancestor widget classes:
ample.publish(TextFieldBase, 'TextFieldBase', fs);
No problem.
Input.prototype = new fs.TextFieldBase();
No problem.

I have been using ample.extend for the Input class (an enhanced text field) with no problem.
But now I have a widget which subclasses Input, so I want to publish it.
ample.publish(Input, 'Input', fs);
results in an error message: The definition for s:input is not found in the namespace 'http://www.finalstep.com.au/2010/standard'

The namespace is correctly specified - all works fine with extend().
Tried renaming from Input (in case it collided with a reserved name) to ABC.
ample.publish(ABC, 'ABC', fs)
No good.
Tried changing the locaName from input to 'notinput'.
No good.

So I'm a bit puzzled as to why this particular class causes a problem for publish().

My workaround is to simply define the class as a property of the global fs.
fs.Input = function() {};
This appears to work ok.

So two questions:
(1) any idea why a class might be extended ok but not get published?
(2) what am I losing if I define my classes directly under the global fs?

xul:tree / xul-treebody--area scroll behaviour incorrect

Two problems:
1 - Mouse: only the scrollbar "thumb" appears to respond to the mouse; track, left/right/up/down buttons are ignored.
2 - Keyboard: no response at all that I can find.

I scraped this from Firebug:
div class="xul-treebody--area" style="height: 100%; width: 100%; overflow: scroll; position: relative;" onscroll="return ample.$instance(this)._onScroll(event)"

Tested in Firefox 3.6.2

Subsequent animation doesn't work in Opera 10.63 build 3516

Subsequent animation doesn't work in Opera 10.63 build 3516 (but still work in Opera 10.00 build 1750).

Here is a sample:

<title>Test</title> <style type="text/css"> html, body { width: 100%; margin: 0; } </style> <script type="text/javascript" src="ample/runtime.js"></script> <script type="text/javascript" src="ample/languages/xhtml/xhtml.js"></script> <script id="ample" type="application/ample+xml"> animate reset
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
</script>

Try to test subsequent animation via:

  • press "animate"
  • press "reset"
  • press "animate"
  • press "reset"
  • press "animate"
  • press "reset"
  • press "animate"
  • press "reset"
  • press "animate"

Incorrect animation of css properties given in %

Animating left is incorrect in FF3, animating width seems to be incorrect in all browsers but IE.

<title></title> <style type="text/css"> html, body { width: 100%; margin: 0; } .test2 { position: absolute; left: 33%; width: 33%; border: 1px solid blue; height: 20px; } </style> <script> function test(element) { ample.query(element).animate({'left' : '66%', 'width' : '66%'}, 7000, 'ease-out'); } </script> <script type="application/ample+xml" xmlns="http://www.w3.org/1999/xhtml">
1
</script> <script type="application/ample+xml" xmlns="http://www.w3.org/1999/xhtml">
2
</script> <script type="text/javascript" src="/amplesdk/ample/runtime.js"></script> <script type="text/javascript" src="/amplesdk/ample/languages/xhtml/xhtml.js"></script>

hbox doesn't stretch in the following case

Code:

<xul:page style="background-color:lightblue">

<xul:hbox flex="1">
<xul:tree treelines="true" width="500" height="200">
  <xul:treecols>

    <xul:treecol label="0" Xminwidth="230" flex="1" />
    <xul:treecol label="1" Xminwidth="230" flex="1" />
    <xul:treecol label="2" maxwidth="20" Xflex="1" />
    <xul:treecol label="3" maxwidth="20" Xflex="1" />
  </xul:treecols>
  <xul:treebody tfs_notes="required non-standard element defined by AmpleSDK">
    <xul:treechildren>
      <xul:treeitem>
        <xul:treerow>

          <xul:treecell label="This" />
          <xul:treecell label="is" />
          <xul:treecell label="r" />
          <xul:treecell label="0" />
        </xul:treerow>
      </xul:treeitem>
      <xul:treeitem>
        <xul:treerow>
          <xul:treecell label="This" />

          <xul:treecell label="is" />
          <xul:treecell label="r" />
          <xul:treecell label="1" />
        </xul:treerow>
      </xul:treeitem>
    </xul:treechildren>
  </xul:treebody>
</xul:tree>
<xul:hbox flex="1" debug="true"><xul:label value="just a spacer"/></xul:hbox>

</xul:hbox>

/xul:page

xul:listbox performance

xul:listbox is a useful control but performance is disastrous when loading large numbers of records (>3000 in my case). The browser becomes unresponsive when attempting to scroll the listbox or sort a column. I have had to switch to jqGrid for better performance.

inline handlers ignored on dynamically created elements

It seems that inline handlers are only effective on original markup.
If an element is created dynamically, it dos no good to add an onclick attribute before appending it to the ample tree.
Instead, an event listener needs to be added.

Is this the desired behavior? or should inline handlers work for dynamically inserted elements?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.