瀏覽代碼

Getting a sandbox going with the worst possible layout

Kevin van Zonneveld 9 年之前
父節點
當前提交
320c8a16ef
共有 5 個文件被更改,包括 32 次插入3 次删除
  1. 0 1
      LICENSE
  2. 2 0
      README.md
  3. 15 2
      build/index.html
  4. 9 0
      js/lib/transloadit-js-client.js
  5. 6 0
      scss/index.scss

+ 0 - 1
LICENSE

@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
-

+ 2 - 0
README.md

@@ -28,6 +28,8 @@ Now to get a sandbox environment set up, type:
 
 ```bash
 npm run preview
+# For instant rebuilds, in a new tab, type:
+npm run watch
 ```
 
 This will `npm run build` the project into `./build`, and then serve that

+ 15 - 2
build/index.html

@@ -10,6 +10,16 @@
     <h1>
       Loading..
     </h1>
+    <p>
+      With this file we can easily test the built js client locally (via <code>npm run preview</code>)
+      and online.
+    </p>
+
+    <div id="upload-target">
+    </div>
+
+
+
 
     <footer>
       <hr />
@@ -21,10 +31,13 @@
   </body>
   <script src="./transloadit-js-client.js"></script>
   <script>
-    var branch  = location.pathname.split('/')[2];
+    var tl = Transloadit("#upload-target");
+  </script>
+  <script>
+    var branch  = location.pathname.split('/')[2] || 'local-unknown';
     var elTitle = document.querySelector('title');
     var elH1    = document.querySelector('h1');
-    var title   = 'You are reviewing the latest push of branch: ' + branch;
+    var title   = 'You are reviewing branch: ' + branch;
     elTitle.innerHTML = title;
     elH1.innerHTML    = title;
   </script>

+ 9 - 0
js/lib/transloadit-js-client.js

@@ -0,0 +1,9 @@
+window.Transloadit = function (selector) {
+  var el    = document.querySelector(selector);
+  var inner = ''
+  inner += '<div class="transloadit-js-client">';
+  inner += 'Hello world :)';
+  inner += 'I am the new Transloadit js client, and as you can see, I need to be improved badly :)';
+  inner += '</div>';
+  el.innerHTML = inner;
+};

+ 6 - 0
scss/index.scss

@@ -0,0 +1,6 @@
+.transloadit-js-client {
+  font-family : "Comic Sans MS";
+  color       : purple;
+  border      : 1px dashed pink;
+  font-size   : 32px;
+}