From 95ff6440119775899164d309fe31027556806877 Mon Sep 17 00:00:00 2001 From: Jhon Klever Date: Fri, 3 Apr 2015 02:34:12 -0500 Subject: [PATCH] #5 #20 #21 File picker: showing files --- elements/pick.html | 81 +++++++++++++++++++++++++++++++++++++++++----- js/pick.js | 34 +++++++++++++++---- 2 files changed, 100 insertions(+), 15 deletions(-) diff --git a/elements/pick.html b/elements/pick.html index 44af66d..af89eec 100644 --- a/elements/pick.html +++ b/elements/pick.html @@ -28,9 +28,15 @@ File Picker + + + + + + @@ -38,29 +44,88 @@ + + + + +
+
+ + back + + + + + +

 

+
+ +
+
    +
  • + + 0 items + +
  • +
+
    +
    +
    +
    -
    -
    - - -

    Pick a file

    -
    -
    -
    +
    +
    +
    +
      +
      +
      +
      +
        +
        +
        +
        + +
        +
        +
        +
          +
          +
          +
          + +
          +
          + Logo +
          + +
          +
          +
          +
          + + + + + + + + diff --git a/js/pick.js b/js/pick.js index 4896a06..2fcc7d3 100644 --- a/js/pick.js +++ b/js/pick.js @@ -23,6 +23,7 @@ ;+function (window, document, undefined) { var activity; var _ = window.document.webL10n.get; + var selectedFolder = ''; window.navigator.mozSetMessageHandler('activity', function(request) { activity = request; @@ -32,14 +33,33 @@ if (option.name === 'pick') { var data = option.data; - document.querySelector('.content').textContent = JSON.stringify(data); - - document.querySelector('#close').onclick = document.querySelector('#done').onclick = function (e) { - window.close(); - }; + console.log('Recibido', data); } else { console.error('Not allowed'); } - }); -} (window, document, undefined); + + + window.utils = window.utils || {}; + window.Activity = window.Activity || window.MozActivity; + window.config.activity = 'pick'; + + function init() { + if (window.files.path.length > 0) { + window.storage.load(true); + } else { + window.utils.preload.complete(); + window.storage.load(false); + } + } + + window.addEventListener('localized', function() { + window.config.app = _('file-manager'); + + document.documentElement.lang = document.webL10n.getLanguage(); + document.documentElement.dir = document.webL10n.getDirection(); + + init(); + }, false); +}(window, document); +