Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jenky committed Feb 1, 2016
1 parent da559d3 commit b61d8d6
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 24 deletions.
4 changes: 2 additions & 2 deletions assets/js/upload.js → resources/assets/js/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function createUploader(uploaderId)
$filelist.append(
'<div id="' + file.id + '" class="alert alert-file">' +
'<div class="filename hide">' + file.name + ' (' + plupload.formatSize(file.size) + ') <button type="button" class="close cancelUpload">&times;</button></div>' +
'<div class="progress progress-striped"><div class="progress-bar" style="width: 1%;"></div></div></div>');
'<div class="progress progress-striped"><div class="progress-bar" style="width: 0;"></div></div></div>');

$filelist.on('click', '#' + file.id + ' button.cancelUpload', function() {
var $this = $(this),
Expand Down Expand Up @@ -66,7 +66,7 @@ function createUploader(uploaderId)
});
});
up.refresh(); // Reposition Flash/Silverlight
if (autoStart || !options.multi_selection) {
if (autoStart) {
$uploadAction.hide();
up.start();
}
Expand Down
19 changes: 19 additions & 0 deletions resources/views/uploader.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@if (!empty($options['url']))
<div id="uploader-{{ $id }}"
data-options="{{ json_encode($options) }}"
data-autostart="{{ intval($autoStart) }}"
data-uploadbtn="uploader-{{ $id }}-upload">
<div id="{{ $options['container'] }}" class="controls uploader">
<div class="filelist"></div>
<div class="upload-actions">
{!! $buttons['pickFiles'] !!}
@if (!$autoStart)
{!! $buttons['upload'] !!}
@endif
</div>
<div class="uploaded row" style="margin-top: 10px"></div>
</div>
</div>
@else
Missing URL option.
@endif
2 changes: 2 additions & 0 deletions src/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ public function render($view = 'plupload::uploader', array $extra = [])
{
$this->init();

$this->data = array_merge($this->data, $extra);

return $this->app['view']->make($view, $this->data);
}
}
8 changes: 5 additions & 3 deletions src/PluploadServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,20 @@ public function boot()
protected function setupConfig()
{
$configPath = __DIR__.'/../config/plupload.php';
$viewsPath = __DIR__.'/../views';
$assetsPath = __DIR__.'/../assets';
$viewsPath = __DIR__.'/../resources/views';
$assetsPath = __DIR__.'/../resources/assets';
$translationsPath = __DIR__.'/../resources/lang';

$this->mergeConfigFrom($configPath, 'plupload');
$this->loadViewsFrom($viewsPath, 'plupload');
$this->loadTranslationsFrom($translationsPath, 'plupload');

$this->publishes([$configPath => config_path('plupload.php')], 'config');
$this->publishes([
$viewsPath => base_path('resources/views/vendor/plupload'),
$assetsPath.'/js' => base_path('resources/assets/plupload'),
$translationsPath => base_path('resources/lang'),
]);
$this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'plupload');
}

/**
Expand Down
19 changes: 0 additions & 19 deletions views/uploader.blade.php

This file was deleted.

0 comments on commit b61d8d6

Please sign in to comment.