Permalink
Switch branches/tags
Nothing to show
Commits on Jun 15, 2012
  1. Typeahead control stops responding after item tapped - Mobile Safari

    Summary:
    Mobile Safari has a strange bug. When the Typeahead control is rendered
    within an iframe, once one of the typeahead items is tapped, the input
    box stops accepting keypresses. (New characters, as well as keys like
    backspace, are ignored). This also affects the Tokenizer control, in
    that once one token is chosen, the user cannot type additional tokens.
    
    This seems to be caused by calling e.prevent() within the Mousedown
    event of the typeahead items, though it's unclear why. Removing that
    line doesn't seem to cause any negative effects - the items lose focus
    and are hidden as part of the mousedown.
    
    I also included a fix for a 2nd bug that blocked testing this fix:
    the placeholder code currently clears the typeahead contents when it
    loses focus, which can result in the loss of user input.
    
    Test Plan:
     1. View typeahead control, rendered within an iframe, on mobile safari.
     2. Begin typing, and tap one of the suggestions.
    
    Reviewers: yungsters, jg, epriestley
    
    Reviewed By: epriestley
    
    CC: phunt, aran, Korvin
    
    Differential Revision: https://secure.phabricator.com/D2762
    Dave Alongi committed Jun 12, 2012
Commits on Jun 13, 2012
  1. Merge pull request #19 from yliang6/master

    Add CORS support and non-JSON response support to JX.Request
    epriestley committed Jun 13, 2012
  2. Add CORS support and non-JSON response support to JX.Request

    Summary:
     CORS
    - supports XHR w/ withCredentials and XDomainRequest as transport
    - added a flag 'CORS' to toggle this
    
    non-JSON response
    - added a property responseType to allow 'JSON', 'TEXT' and 'XML' as the response type
    - added a responseHandler property to handle response of non-JSON format
    
    Test Plan:
    1. rebuild packages;
    2. go to sandbox page that loads javelin;
    3. test request in chrome javascript console:
    
      window['call_result'] = '';
      var req = new JX.Request('http://bango.net/idxml/?bango=12345').setCORS(true).setMethod('GET').setExpectCSRFGuard(false).setResponseType('XML').setResponseHandler(function(resp){window.call_result = resp;});
      req.send();
    
    4. verified the request was sucessful and the result is expected.
    
    Reviewers: jeffmo, vrana, epriestley, aran, leebyron, erling
    
    Reviewed By: epriestley
    
    CC: Korvin
    
    Differential Revision: https://secure.phabricator.com/D2697
    Ying-Yi Liang committed Jun 13, 2012
Commits on Jun 12, 2012
  1. Merge pull request #17 from lifeinafolder/optimization

    Optimizing JX.Keys with native Object.Keys if available
    epriestley committed Jun 12, 2012
  2. Optimizing JX.Keys with native Object.Keys if available

    Rajat Mittal committed Jun 12, 2012
Commits on Jun 8, 2012
  1. Rename Javelin PHP class to JavelinHelper

    Summary:
    We use the same name in Phabricator which explodes HPHP compiler because we have Javelin linked there to `externals/`.
    
    I considered other solutions like renaming the Phabricator class, making a function from the only method `initBehavior()` but this seems that it will cause smallest troubles.
    
    Test Plan: Played Tic Tac Tao until I won.
    
    Reviewers: epriestley
    
    Reviewed By: epriestley
    
    CC: aran, Korvin
    
    Differential Revision: https://secure.phabricator.com/D2693
    vrana committed Jun 8, 2012
Commits on Jun 6, 2012
Commits on May 31, 2012
  1. Depend on class autoloading

    Test Plan:
      ./sync-to-facebook.php test
    
    Reviewers: epriestley
    
    Reviewed By: epriestley
    
    CC: aran, Koolvin
    
    Maniphest Tasks: T1103
    
    Differential Revision: https://secure.phabricator.com/D2613
    vrana committed May 30, 2012
Commits on May 30, 2012
  1. Upgrade javelin to libphutil v2

    Summary: Converted using `arc liberate --upgrade`.
    
    Test Plan:
      diviner .
    
    Reviewers: epriestley
    
    Reviewed By: epriestley
    
    CC: aran, Koolvin
    
    Maniphest Tasks: T1103
    
    Differential Revision: https://secure.phabricator.com/D2606
    vrana committed May 30, 2012
Commits on May 29, 2012
  1. [JX.Request] Add toggle for the expectation of a CSRF guard in the re…

    …sponse
    
    Summary:
    I am working on a project that needs to send out an XHR to the FB platform API.
    
    The FB API doesn't return responses that are pre-pended with a CSRF guard, so I need to be able to toggle the expectation of that on the request object.
    
    Test Plan: Copied this change into the code that tries to execute this API request an saw things work with and without toggling .setExpectCSRFGuard().
    
    Reviewers: epriestley, leebyron, al
    
    Reviewed By: epriestley
    
    CC: aran, Koolvin
    
    Differential Revision: https://secure.phabricator.com/D2573
    jeffmo committed May 29, 2012
Commits on May 7, 2012
  1. Add upload progress event to JX.Request, include request-type metadat…

    …a in File uploads
    
    Summary:
      - Adds an "uploadprogress" event to JX.Request so we can draw upload progress indicators.
      - When sending files, we currently encode "__ajax__=true" into POST data and then discard it. Instead, put it in GET data.
      - Move the file + data check to a slightly more logical place in the file.
    
    Test Plan: Used JX.Request with code that draws upload indicators and depends on request type.
    
    Reviewers: btrahan, vrana, jungejason
    
    Reviewed By: btrahan
    
    CC: aran
    
    Maniphest Tasks: T875
    
    Differential Revision: https://secure.phabricator.com/D2384
    epriestley committed May 7, 2012
Commits on May 2, 2012
  1. Provide onStateChange event from JX.Request

    Summary: Currently JX.Request only allows async responses to be processed when the request object has completed. There are a number of use cases for allowing processing to occur during a async response and not just after it, such as handling http chunked encoded response, showing request progress bars, detecting stalled requests, etc. This diff adds a 'statechange' event so that subclasses and consumers of JX.Request can bind to it here.
    
    Test Plan:
    in console:
    
    var req = new JX.Request('/');
    undefined
    req.listen('statechange', function(req) { console.log(req.getTransport().readyState); });
    Object
    req.send();
    1
    undefined
    2
    3
    4
    
    Reviewers: epriestley, jeffmo
    
    Reviewed By: epriestley
    
    CC: aran, Koolvin
    
    Differential Revision: https://secure.phabricator.com/D2364
    alpjor committed May 2, 2012
Commits on Apr 30, 2012
  1. Document extra parameters retrieved by arguments

    Summary: Also crosslink `JX.DOM.hide` and `JX.DOM.show`.
    
    Test Plan: /docs/class/JX.DOM.html#method_hide
    
    Reviewers: epriestley
    
    Reviewed By: epriestley
    
    CC: aran, Koolvin
    
    Differential Revision: https://secure.phabricator.com/D2349
    vrana committed Apr 30, 2012
Commits on Apr 20, 2012
  1. Allow JS.Resource.load to work when the resource list is empty

    Summary: Currently if you pass an empty resource array to the JX.Resource.load function it doesn't call the callback unless another resource is loaded after it. This diff adds a check to call the callback at the correct time.
    
    Test Plan:
    tested in console
    
    before:
    
    JX.Resource.load([], function() { console.log('called'); });
    undefined
    JX.Resource.load(['http://alpjor.com/test.css'], function() { console.log('called2'); });
    undefined
    called
    called2
    
    after:
    
    JX.Resource.load([], function() { console.log('called'); });
    undefined
    called
    JX.Resource.load(['http://alpjor.com/test.css'], function() { console.log('called2'); });
    undefined
    called2
    
    Reviewers: cpojer, jeffmo
    
    Reviewed By: cpojer
    
    CC: aran, epriestley
    
    Differential Revision: https://secure.phabricator.com/D2291
    alpjor committed Apr 20, 2012
Commits on Apr 17, 2012
  1. Support IE8

    Summary: [[ https://secure.phabricator.com/D714#inline-1387 | D714#inline-1387 ]]
    
    Test Plan: Open Phabricator in IE8.
    
    Reviewers: tomo, epriestley
    
    Reviewed By: epriestley
    
    CC: aran, epriestley
    
    Differential Revision: https://secure.phabricator.com/D2250
    vrana committed Apr 17, 2012
Commits on Apr 12, 2012
  1. Fix filenames of sync-facebook

    Summary: Does this belong to Javelin repository at all?
    
    Test Plan: Read.
    
    Reviewers: epriestley
    
    Reviewed By: epriestley
    
    CC: aran
    
    Differential Revision: https://secure.phabricator.com/D2212
    vrana committed Apr 12, 2012
Commits on Apr 2, 2012
  1. Typeahead: separate the name field from the field we complete on

    Summary:
    Let typeahead datasources provide an optional field: tokenizable.  If present,
    the typeahead tokenizes and completes on this field instead of name, but still
    uses the name when inputting data into the <input>.
    
    For example, I can have an input for Phabricator commit identifiers, and build
    typeahead from (commit-identifier, commit-message-summary-line) pairs.  The
    'display' field formats both prettily, the 'name' is the commit-identifier, and
    the 'tokenizable' contains both commit-identifier and commit-message
    concatenated.  The typeahead lets me search both, but the resulting value in
    the <input> is just the commit-identifier.
    
    Test Plan:
    Made an example as described above which queries all my commits to a
    repo from the past week.
    
    Reviewers: epriestley
    
    Reviewed By: epriestley
    
    CC: aran
    
    Differential Revision: https://secure.phabricator.com/D2070
    Edward Speyer committed Apr 1, 2012
Commits on Mar 29, 2012
  1. Merge pull request #16 from benhiller/master

    include input elements w/ type="tel" or "number" when encoding form value
    epriestley committed Mar 29, 2012
  2. include input elements w/ type="tel" or "number" when encoding form v…

    …alue
    
    Summary: Right now JX.DOM.convertFormToDictionary will skip over input
    elements with type="tel" (or type="number"), which are valid values for
    that attribute according to http://dev.w3.org/html5/markup/input.number.html
    and http://dev.w3.org/html5/markup/input.tel.html.
    
    This makes convertFormToListOfPairs include those input elements.
    
    Test Plan: used in subsequent change which uses input type="tel" in
    conjunction with JX.DOM.convertFormToDictionary.
    bhiller committed Mar 29, 2012
Commits on Mar 26, 2012
  1. Merge pull request #15 from jeffmo/javelinsymbols_behavior_support

    [javelinsymbols] -- Add support to javelinsymbols for JX.behavior()
    epriestley committed Mar 26, 2012
  2. [javelinsymbols] -- Add support to javelinsymbols for JX.behavior()

    Summary:
    Currently javelinsymbols can detect the installation of a class...but not behaviors. This adds support to the javelinsymbols processor to identify behavior-registrations and specify them using a new '*' directive.
    
    I plan to use javelinsymbols for a project to implicitly identify a unique name for a given JS resource based on the JX.install()s and JX.behavior()s calls that exist in the file.
    
    Test Plan: Compiled and ran javlinesymbols against a file with a JX.install(), a file with JX.behavior(), and a file with both to verify the output was as expected.
    
    Reviewers: leebyron, epriestley, jg
    
    Reviewed By: epriestley
    
    CC: aran, epriestley
    
    Differential Revision: https://secure.phabricator.com/D2023
    jeffmo committed Mar 26, 2012
  3. Fix bug in tic-tac-toe example

    Summary: JX.JSON.serialize got renamed to JX.JSON.stringify
    
    Test Plan: Played tic-tac-toe
    
    Reviewers: epriestley
    
    Reviewed By: epriestley
    
    CC: aran, epriestley
    
    Differential Revision: https://secure.phabricator.com/D2014
    Nick Harper committed Mar 26, 2012
Commits on Mar 13, 2012
  1. Throw when calling getData() before data has been provided by mergeDa…

    …ta()
    
    Summary: See https://www.facebook.com/groups/104578302983740/210002262441343/
    
    Test Plan: N/A
    
    Reviewers: hedger, tomo, mroch
    
    Reviewed By: hedger
    
    CC: aran, epriestley
    
    Differential Revision: https://secure.phabricator.com/D1879
    epriestley committed Mar 13, 2012
Commits on Mar 9, 2012
  1. Add placeholders to JX.Typeahead and JX.Tokenizer

    Summary: Placeholder text hints to the user about how to use the control, e.g. "Type a user name...".
    
    Test Plan: Added placeholders to typeaheads and tokenizers, they seemed to work correctly. Expanded examples, played around with them.
    
    Reviewers: btrahan, tomo, mroch
    
    Reviewed By: btrahan
    
    CC: aran, epriestley
    
    Maniphest Tasks: T772
    
    Differential Revision: https://secure.phabricator.com/D1817
    epriestley committed Mar 9, 2012
Commits on Mar 7, 2012
  1. Add a sort handler callback to Javelin datasources

    Summary: See T946. Required to implement improved sorting rules.
    
    Test Plan: Implemented improved sorting rules (see next diff).
    
    Reviewers: btrahan
    
    Reviewed By: btrahan
    
    CC: aran, epriestley
    
    Maniphest Tasks: T946
    
    Differential Revision: https://secure.phabricator.com/D1806
    epriestley committed Mar 7, 2012
Commits on Mar 5, 2012
  1. Merge pull request #14 from kdelong/master

    Typeahead: allow ideographic whitespace for token separation
    epriestley committed Mar 5, 2012
Commits on Mar 2, 2012
  1. Typeahead: allow ideographic whitespace for token separation

    Summary:Allow ideographic whitespace for token separation. This allows users to search for names in CJK languages without switching input modes between words, if searching for multiple tokens.
    
      児玉 太郎 // worked previously, still works now
      児玉 太郎 // works now, didn't work previously
    
    Reviewers:epriestley
    
    Test Plan:tried searching via typeahead using ' ' (ascii 32) and using ideographic whitespace (U+3000) to separate search tokens. got results for both.
    
    Revert Plan:
    
    Tags:
    kdelong committed Mar 2, 2012
  2. Fix up/down in Tokenizers

    Summary:
    D1371 added an overbroad rule here which we actually don't need.
    
    The intent was to clear the form if you hit "return" with a partial token, but
    that's actually sort of bad. The overall goal here (making it more clear when
    something isn't a token) is well-served by just the clear-on-blur part.
    
    Remove the problematic, overbroad rule.
    
    Test Plan:
      - Hit up/down on a tokenizer to choose between tokens, it worked.
      - Hit "return" with an invalid token, token was unaffected. This is fine.
    
    Reviewers: vrana, btrahan
    
    Reviewed By: vrana
    
    CC: aran, epriestley
    
    Maniphest Tasks: T927
    
    Differential Revision: https://secure.phabricator.com/D1749
    epriestley committed Mar 2, 2012
Commits on Feb 29, 2012
  1. Ignore right mouse button in typeahead

    Test Plan: Right click on typeahed in Firefox and Chrome.
    
    Reviewers: epriestley
    
    Reviewed By: epriestley
    
    CC: aran, epriestley
    
    Differential Revision: https://secure.phabricator.com/D1733
    vrana committed Feb 29, 2012
Commits on Feb 24, 2012
  1. Support paste event

    Summary: Required by D1681.
    
    Test Plan: See D1681.
    
    Reviewers: epriestley
    
    Reviewed By: epriestley
    
    CC: aran, epriestley
    
    Differential Revision: https://secure.phabricator.com/D1682
    vrana committed Feb 24, 2012
Commits on Feb 23, 2012
  1. Listen to 'scroll' event in Javelin

    Summary: Adding some scroll-jonx, need a scroll-jonx-event.
    
    Test Plan: Scrolled jonx.
    
    Reviewers: btrahan, mroch, tomo, aran
    
    Reviewed By: btrahan
    
    CC: aran, epriestley
    
    Differential Revision: https://secure.phabricator.com/D1672
    epriestley committed Feb 23, 2012
Commits on Jan 31, 2012
  1. Move typeahead sorting logic into separate function

    Summary:
    It turned out that previous implementation of typeahead entries sorting was
    still not flexible enough: certain applications need to be able to turn sorting
    off, or define more complex sorting comparator.
    Moving sorting logic into separate function allows derived classes to redefine
    the sorting step the way they want.
    
    Task ID: #T800
    
    Blame Rev:
    
    Test Plan:
    Tested in the following browsers: Firefox 2, Firefox 3.6.22, Firefox 8.0,
    Firefox 9.0.1, Opera 11.61, Chrome 16.0.912.77, IE9.
    
    In each of tested browsers test consisted of the following steps:
    1. Go to http://phabricator.dev3265.facebook.com/differential/
    2. Login with facebook account
    3. Remove yourself from the "View user" input box.
    4. Type "wayn". Verify that dropdown list shows up with typeahead suggestions.
    5. Verify that entries in dropdown box are sorted. For input "wayn" the dropdown
    list should show the following suggestions: wayne, waynekao, wharris, wsellers.
    
    Revert Plan:
    
    Tags:
    
    Reviewers: epriestley, aran
    
    Reviewed By: epriestley
    
    CC: rodrigo, aran, epriestley
    
    Differential Revision: https://secure.phabricator.com/D1532
    dneiter committed Jan 31, 2012
Commits on Jan 29, 2012
  1. Merge pull request #13 from subtleGradient/patch-1

    fixes typo
    epriestley committed Jan 29, 2012
  2. fixes typo

    subtleGradient committed Jan 29, 2012
Commits on Jan 26, 2012
  1. Rework typeahead sorting to avoid breaking sophisticated typeahead ap…

    …plications
    
    that redefine renderNodes() function
    
    Summary: It turned out that previous diff broke some sophisticated uses of
    javelin typeahead that redefine TypeaheadSoure.renderFunction to do some custom
    rendering. In this diff I moved typeahead entries sorting logic into
    renderNodes.
    
    Test Plan:
    Tested in the following browsers: Firefox 2, Firefox 3.6.22, Firefox 9.0.1,
    Opera 11.61, Chrome 16.0.912.77, IE9.
    
    In each of tested browsers test consisted of the following steps:
    1. Go to http://phabricator.dev3265.facebook.com/differential/
    2. Login with facebook account
    3. Remove yourself from the "View user" input box.
    4. Type "wayn". Verify that dropdown list shows up with typeahead suggestions.
    5. Verify that entries in dropdown box are sorted. For input "wayn" the dropdown
    list should show the following suggestions: wayne, waynekao, wharris, wsellers.
    
    In IE6 and IE7 I couldn't login into phabricator to make any tests.
    Neither original, nor updated versions of typeahead worked in IE8 - I couldn't
    edit "view user" input box.
    
    Revert Plan:
    
    Tags:
    
    Reviewers: epriestley, aran, linjeffrey
    
    Reviewed By: epriestley
    
    CC: rodrigo, aran, epriestley
    
    Maniphest Tasks: T800
    
    Differential Revision: https://secure.phabricator.com/D1497
    dneiter committed Jan 26, 2012