Browse Source

changes

pull/74/head
KodeStar 7 years ago
parent
commit
83f2a81e91
  1. 5
      .gitignore
  2. 13
      app/Http/Controllers/ItemController.php
  3. 3
      app/Http/Middleware/VerifyCsrfToken.php
  4. 2
      app/SupportedApps/Plex.php
  5. 40
      public/css/app.css
  6. 2
      public/mix-manifest.json
  7. 1
      public/storage
  8. 46
      resources/assets/sass/_app.scss
  9. 1
      resources/views/app.blade.php
  10. 3
      resources/views/items/create.blade.php
  11. 3
      resources/views/items/edit.blade.php
  12. 4
      resources/views/items/form.blade.php
  13. 20
      resources/views/items/scripts.blade.php
  14. 2
      routes/web.php

5
.gitignore

@ -1,6 +1,7 @@
/node_modules /node_modules
/public/hot /public/hot
/public/storage /public/storage/backgrounds
/public/storage/icons
/storage/*.key /storage/*.key
/.idea /.idea
/.vagrant /.vagrant
@ -8,3 +9,5 @@ Homestead.json
Homestead.yaml Homestead.yaml
npm-debug.log npm-debug.log
yarn-error.log yarn-error.log
storage/app/public/.DS_Store

13
app/Http/Controllers/ItemController.php

@ -237,4 +237,17 @@ class ItemController extends Controller
return redirect()->route('items.index') return redirect()->route('items.index')
->with('success','Item restored successfully'); ->with('success','Item restored successfully');
} }
/**
* Return details for supported apps
*
* @return Json
*/
public function appload(Request $request)
{
$app = $request->input('app');
return "a: ".$app;
}
} }

3
app/Http/Middleware/VerifyCsrfToken.php

@ -13,6 +13,7 @@ class VerifyCsrfToken extends Middleware
*/ */
protected $except = [ protected $except = [
// //
'order' 'order',
'appload'
]; ];
} }

2
app/SupportedApps/Plex.php

@ -3,6 +3,6 @@
class Plex implements Contracts\Applications { class Plex implements Contracts\Applications {
public function defaultColour() public function defaultColour()
{ {
return '#ccc'; return '#222';
} }
} }

40
public/css/app.css

@ -963,6 +963,46 @@ a.settinglink {
background: #d64d55; background: #d64d55;
} }
.ui-autocomplete {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
padding: 4px 0;
margin: 0 0 10px 25px;
list-style: none;
background-color: #ffffff;
border-color: #ccc;
border-color: rgba(0, 0, 0, 0.2);
border-style: solid;
border-width: 1px;
border-radius: 5px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
background-clip: padding-box;
*border-right-width: 2px;
*border-bottom-width: 2px;
}
.ui-menu-item {
display: block;
padding: 3px 15px;
clear: both;
font-weight: normal;
line-height: 18px;
color: #555555;
white-space: nowrap;
text-decoration: none;
}
.ui-state-hover,
.ui-state-active {
font-weight: 700;
}
/*! Huebee v2.0.0 /*! Huebee v2.0.0
http://huebee.buzz http://huebee.buzz
---------------------------------------------- */ ---------------------------------------------- */

2
public/mix-manifest.json

@ -1,4 +1,4 @@
{ {
"/css/app.css": "/css/app.css?id=2102f4e7317cba78bff5", "/css/app.css": "/css/app.css?id=e01da6a30207cefea3dd",
"/js/app.js": "/js/app.js?id=2dffa24cf7255229e085" "/js/app.js": "/js/app.js?id=2dffa24cf7255229e085"
} }

1
public/storage

@ -0,0 +1 @@
/Users/admin/Sites/heimdall/storage/app/public

46
resources/assets/sass/_app.scss

@ -595,3 +595,49 @@ div.create {
background: $app-red; background: $app-red;
} }
} }
.ui-autocomplete {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
padding: 4px 0;
margin: 0 0 10px 25px;
list-style: none;
background-color: #ffffff;
border-color: #ccc;
border-color: rgba(0, 0, 0, 0.2);
border-style: solid;
border-width: 1px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
*border-right-width: 2px;
*border-bottom-width: 2px;
}
.ui-menu-item {
display: block;
padding: 3px 15px;
clear: both;
font-weight: normal;
line-height: 18px;
color: #555555;
white-space: nowrap;
text-decoration: none;
}
.ui-state-hover, .ui-state-active {
font-weight: 700;
}

1
resources/views/app.blade.php

@ -77,6 +77,7 @@
<script>!window.jQuery && document.write('<script src="/js/jquery-3.3.1.min.js"><\/script>')</script> <script>!window.jQuery && document.write('<script src="/js/jquery-3.3.1.min.js"><\/script>')</script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="/js/app.js"></script> <script src="/js/app.js"></script>
@yield('scripts')
</body> </body>
</html> </html>

3
resources/views/items/create.blade.php

@ -7,3 +7,6 @@
{!! Form::close() !!} {!! Form::close() !!}
@endsection @endsection
@section('scripts')
@include('items.scripts')
@endsection

3
resources/views/items/edit.blade.php

@ -7,3 +7,6 @@
{!! Form::close() !!} {!! Form::close() !!}
@endsection @endsection
@section('scripts')
@include('items.scripts')
@endsection

4
resources/views/items/form.blade.php

@ -15,7 +15,7 @@
<div class="input"> <div class="input">
<label>Application name *</label> <label>Application name *</label>
{!! Form::text('title', null, array('placeholder' => 'Title','class' => 'form-control')) !!} {!! Form::text('title', null, array('placeholder' => 'Title', 'id' => 'appname', 'class' => 'form-control')) !!}
</div> </div>
<div class="input"> <div class="input">
<label>Colour *</label> <label>Colour *</label>
@ -61,3 +61,5 @@
</footer> </footer>
</section> </section>

20
resources/views/items/scripts.blade.php

@ -0,0 +1,20 @@
<script>
$( function() {
var availableTags = [
<?php
$supported = App\Item::supportedOptions();
foreach($supported as $sapp) {
echo '"'.$sapp.'",';
}
?>
];
$( "#appname" ).autocomplete({
source: availableTags,
select: function( event, ui ) {
$.post('/appload', { app: ui.item.value }, function(data) {
alert(data);
});
}
});
});
</script>

2
routes/web.php

@ -22,6 +22,8 @@ Route::get('items/unpin/{id}', 'ItemController@unpin')->name('items.unpin');
Route::get('items/pintoggle/{id}/{ajax?}', 'ItemController@pinToggle')->name('items.pintoggle'); Route::get('items/pintoggle/{id}/{ajax?}', 'ItemController@pinToggle')->name('items.pintoggle');
Route::post('order', 'ItemController@setOrder')->name('items.order'); Route::post('order', 'ItemController@setOrder')->name('items.order');
Route::post('appload', 'ItemController@appload')->name('appload');
/** /**
* Settings. * Settings.
*/ */

Loading…
Cancel
Save