Drukowanie po przyciśnięciu klawisza na klawiaturze numerycznej #29

Merged
krzysiej merged 1 commits from issue-23 into master 2018-05-13 12:09:26 +02:00
12 changed files with 535 additions and 61 deletions

View File

@@ -0,0 +1,93 @@
<?php
/**
* Created by PhpStorm.
* User: k
* Date: 10.02.2017
* Time: 20:10
*/
namespace App\Http\Controllers;
set_time_limit(-1);
use App\Paper\Airly;
use App\Paper\Paper;
use Illuminate\Http\Request;
class AirlyController extends Controller
{
private $paper = null;
public function __construct()
{
$this->paper = new Paper();
}
/**
* get:/airly_all
* @return \Illuminate\Http\RedirectResponse
*/
public function airly_all()
{
$airly = new Airly();
$this->paper->sendImagePrint($airly->icon);
$this->paper->sendHeaderPrint('Jakość powietrza:' . PHP_EOL . date('H:i d-m-Y'));
$airly->setStations(config('paper.airly.stations'));
foreach ($airly->getStations() as $stationId) {
$stationInfo = $airly->getStationInfo($stationId);
$this->paper->sendHeaderPrint($stationInfo['address']['locality'] . ' ' . $stationInfo['address']['route']);
$dataText = $airly->getInformationText($stationId);
$this->paper->sendPrint('', $dataText);
}
return back();
}
public function airly_rzeczypospolitej()
{
$airly = new Airly();
$this->paper->sendImagePrint($airly->icon);
$this->paper->sendHeaderPrint('Jakość powietrza:' . PHP_EOL . date('H:i d-m-Y'));
$airly->setStations([config('paper.airly.rzeczypospolitej')]);
foreach ($airly->getStations() as $stationId) {
$stationInfo = $airly->getStationInfo($stationId);
$this->paper->sendHeaderPrint($stationInfo['address']['locality'] . ' ' . $stationInfo['address']['route']);
$dataText = $airly->getInformationText($stationId);
$this->paper->sendPrint('', $dataText);
}
return back();
}
public function airly_grunwaldzka()
{
$airly = new Airly();
$this->paper->sendImagePrint($airly->icon);
$this->paper->sendHeaderPrint('Jakość powietrza:' . PHP_EOL . date('H:i d-m-Y'));
$airly->setStations([config('paper.airly.grunwaldzka')]);
foreach ($airly->getStations() as $stationId) {
$stationInfo = $airly->getStationInfo($stationId);
$this->paper->sendHeaderPrint($stationInfo['address']['locality'] . ' ' . $stationInfo['address']['route']);
$dataText = $airly->getInformationText($stationId);
$this->paper->sendPrint('', $dataText);
}
return back();
}
public function airly_sowinskiego()
{
$airly = new Airly();
$this->paper->sendImagePrint($airly->icon);
$this->paper->sendHeaderPrint('Jakość powietrza:' . PHP_EOL . date('H:i d-m-Y'));
$airly->setStations([config('paper.airly.sowinskiego')]);
foreach ($airly->getStations() as $stationId) {
$stationInfo = $airly->getStationInfo($stationId);
$this->paper->sendHeaderPrint($stationInfo['address']['locality'] . ' ' . $stationInfo['address']['route']);
$dataText = $airly->getInformationText($stationId);
$this->paper->sendPrint('', $dataText);
}
return back();
}
}

View File

@@ -2,25 +2,127 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Paper\CinemaMultikino;
use DiDom\Query;
use Illuminate\Http\Request;
use DiDom\Document;
use App\Paper\Paper; use App\Paper\Paper;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class Keyboard extends Controller class Keyboard extends Controller
{ {
public function press(Request $request, $key)
private $paper;
public function __construct()
{ {
$this->paper = new Paper();
}
public function press($key) $keyboardData = DB::table('keyboard')->where('key', $key)->first();
{
$this->paper->sendPrint($key); if (isset($keyboardData) && isset($keyboardData->action)) {
$keyboardAction = explode('_', $keyboardData->action);
switch ($keyboardAction[0]) {
case 'settings':
$settings = new Settings();
$settings->printMappedKeys();
break;
case 'airly':
$airly = new AirlyController();
switch ($keyboardAction[1]) {
case 'all':
$airly->airly_all();
break;
case 'rzeczypospolitej':
$airly->airly_rzeczypospolitej();
break;
case 'grunwaldzka':
$airly->airly_grunwaldzka();
break;
case 'sowinskiego':
$airly->airly_sowinskiego();
break;
}
break;
case 'note':
switch ($keyboardAction[1]) {
case 'last':
$main = new Main();
$main->noteLast();
break;
case $keyboardAction[1] > 0:
echo 'test';
$main = new Main();
$main->printNote((int)$keyboardAction[1]);
break;
}
break;
case 'repertoire':
switch ($keyboardAction[1]) {
case 'all':
switch ($keyboardAction[2]) {
case 'today':
$repertoire = new Repertoire();
$repertoire->today_repertoire($request);
break;
case 'tomorrow':
$repertoire = new Repertoire();
$repertoire->tomorrow_repertoire($request);
break;
}
break;
case 'helios':
switch ($keyboardAction[2]) {
case 'today':
$repertoire = new Repertoire();
$repertoire->today_helios($request);
break;
case 'tomorrow':
$repertoire = new Repertoire();
$repertoire->tomorrow_helios($request);
break;
}
break;
case 'multikino':
switch ($keyboardAction[2]) {
case 'today':
$repertoire = new Repertoire();
$repertoire->today_multikino($request);
break;
case 'tomorrow':
$repertoire = new Repertoire();
$repertoire->tomorrow_multikino($request);
break;
}
break;
case 'cinemacity':
switch ($keyboardAction[2]) {
case 'today':
$repertoire = new Repertoire();
$repertoire->today_cinemacity($request);
break;
case 'tomorrow':
$repertoire = new Repertoire();
$repertoire->tomorrow_cinemacity($request);
break;
}
break;
case 'gdynskiecentrumfilmowe':
switch ($keyboardAction[2]) {
case 'today':
$repertoire = new Repertoire();
$repertoire->today_gdynskiecentrumfilmowe($request);
break;
case 'tomorrow':
$repertoire = new Repertoire();
$repertoire->tomorrow_gdynskiecentrumfilmowe($request);
break;
}
break;
}
break;
}
}
} }
} }

View File

@@ -34,6 +34,7 @@ class Main extends Controller
* post::/printImage * post::/printImage
* @param Request $request * @param Request $request
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* @throws \Exception
*/ */
public function imagePrint(Request $request) public function imagePrint(Request $request)
{ {
@@ -138,28 +139,6 @@ class Main extends Controller
]); ]);
} }
/**
* get:/airly
* @param Request $request
* @return \Illuminate\Http\RedirectResponse
*/
public function airly(Request $request)
{
$airly = new Airly();
$this->paper->sendImagePrint($airly->icon);
$this->paper->sendHeaderPrint('Jakość powietrza:' . PHP_EOL . date('H:i d-m-Y'));
$airly->setStations(config('paper.airly.stations'));
foreach ($airly->getStations() as $stationId) {
$stationInfo = $airly->getStationInfo($stationId);
$this->paper->sendHeaderPrint($stationInfo['address']['locality'] . ' ' . $stationInfo['address']['route']);
$dataText = $airly->getInformationText($stationId);
$this->paper->sendPrint('', $dataText);
}
return back();
}
/** /**
* post::/print/{id} * post::/print/{id}
* @param Request $request * @param Request $request
@@ -168,15 +147,24 @@ class Main extends Controller
*/ */
public function printText(Request $request, $id) public function printText(Request $request, $id)
{ {
$note = DB::table('note')->where('id', $id)->first(); $note = $this->printNote($id);
$this->paper->sendPrint($note->topic, $note->text, $note->icon);
$request->session()->flash('print_status', 'Wydrukowano notatkę: ' . $note->topic . '!'); $request->session()->flash('print_status', 'Wydrukowano notatkę: ' . $note->topic . '!');
return back(); return back();
} }
public function printNote($noteId){
$note = DB::table('note')->where('id', $noteId)->first();
$this->paper->sendPrint($note->topic, $note->text, $note->icon);
return $note;
}
public function noteLast(){
$note = DB::table('note')->orderBy('id', 'desc')->first();
$this->printNote($note->id);
}
private function templateReplace($input) private function templateReplace($input)
{ {
return str_replace(['[d]', '[m]', '[y]', '[h]', '[i]', '[s]'], return str_replace(['[d]', '[m]', '[y]', '[h]', '[i]', '[s]'],
[date('d'), date('m'), date('Y'), date('H'), date('i'), date('s')], [date('d'), date('m'), date('Y'), date('H'), date('i'), date('s')],
$input); $input);

View File

@@ -0,0 +1,119 @@
<?php
/**
* Created by PhpStorm.
* User: k
* Date: 10.02.2017
* Time: 20:10
*/
namespace App\Http\Controllers;
set_time_limit(-1);
use App\Paper\Paper;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
class Settings extends Controller
{
private $paper = null;
public function __construct()
{
$this->paper = new Paper();
}
/**
* get:/
* @param Request $request
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function mainView(Request $request)
{
$keyboard = DB::select('SELECT * FROM keyboard');
return view('settings', [
'keyboard' => $keyboard,
'actions' => $this->getActions()
]);
}
public function getMappedKeys()
{
$keys = DB::table('keyboard')->get();
$text = '';
$actions = $this->getActions('');
foreach ($keys as $key) {
$text .= '[' . $key->key . '] ' . $actions[$key->action] . "\n";
}
return $text;
}
public function printMappedKeys()
{
$this->paper->sendPrint('Zmapowane klawisze', $this->getMappedKeys());
}
public function save(Request $request)
{
foreach ($request->input('key') as $keyid => $keyValue) {
DB::table('keyboard')
->where('id', $keyid)
->update([
'action' => $keyValue,
]);
}
return redirect()->route('settingsList');
}
private function getActions($noActionText = 'Bez akcji')
{
$actions = [];
$actions[''] = $noActionText;
$actions['separator0'] = 'separator';
$actions['settings_list'] = 'Lista zmapowanych klawiszy';
$actions['separator1'] = 'separator';
$actions['repertoire_all_today'] = 'Repertuar wszystkie kina dzisiaj';
$actions['repertoire_all_tomorrow'] = 'Repertuar wszystkie kina jutro';
$actions['repertoire_helios_today'] = 'Repertuar Helios dzisiaj';
$actions['repertoire_helios_tomorrow'] = 'Repertuar Helios jutro';
$actions['repertoire_multikino_today'] = 'Repertuar Multikino dzisiaj';
$actions['repertoire_multikino_tomorrow'] = 'Repertuar Multikino jutro';
$actions['repertoire_cinemacity_today'] = 'Repertuar Cinema-City dzisiaj';
$actions['repertoire_cinemacity_tomorrow'] = 'Repertuar Cinema-City jutro';
$actions['repertoire_gdynskiecentrumfilmowe_today'] = 'Repertuar Gdyńskie Centrum filmowe dzisiaj';
$actions['repertoire_gdynskiecentrumfilmowe_tomorrow'] = 'Repertuar Gdyńskie Centrum filmowe jutro';
$actions['separator2'] = 'separator';
$actions['airly_all'] = 'Airly wszystkie stacje';
$actions['airly_rzeczypospolitej'] = 'Airly (Rzeczypospolitej)';
$actions['airly_grunwaldzka'] = 'Airly (Grunwaldzka)';
$actions['airly_sowinskiego'] = 'Airly (Sowińskiego)';
// $actions['separator3'] = 'separator';
// $actions['spacex_next_flight'] = 'Najbliższy lot SpaceX';
// $actions['spacex_prev_flight'] = 'Poprzedni lot SpaceX';
// $actions['spacex_all_next_summary'] = 'Wszystkie zaplanowane loty SpaceX (skrót)';
$actions['separator4'] = 'separator';
$actions['note_last'] = 'Ostatnia zapisana notatka';
$actions['separator5'] = 'separator';
$notes = DB::select('SELECT * FROM note WHERE type = "note" ORDER BY updated_at DESC');
foreach ($notes as $note) {
$actions['note_' . $note->id] = 'Notatka: ' . $note->topic;
}
return $actions;
}
}

View File

@@ -24,7 +24,7 @@ class Airly
return $this->stations; return $this->stations;
} }
public function setStations($stations){ public function setStations(array $stations){
$this->stations = $stations; $this->stations = $stations;
} }

View File

@@ -26,9 +26,6 @@ class CinemaCinemaCity implements Cinema
if (is_null($this->cinemaId) || is_null($this->day)) if (is_null($this->cinemaId) || is_null($this->day))
throw new \Exception('Day or cinemaid not set.'); throw new \Exception('Day or cinemaid not set.');
// if (!is_array($this->cinemaId)) {
// $this->cinemaId = (array)$this->cinemaId;
// }
$url = 'https://www.cinema-city.pl/pgm-list-byfeat?si=' . $this->cinemaId . '&sort=cin&bd=' . $this->day; $url = 'https://www.cinema-city.pl/pgm-list-byfeat?si=' . $this->cinemaId . '&sort=cin&bd=' . $this->day;
return file_get_contents($url); return file_get_contents($url);
@@ -41,9 +38,6 @@ class CinemaCinemaCity implements Cinema
$document = json_decode($document); $document = json_decode($document);
// $cinemaData = [];
// $text = "Repertuar Cinema-City\n";
// $text .= str_replace('/', '-', $this->day) . "\n\n";
$movies = []; $movies = [];
$date = date('d/m/Y', strtotime($this->day)); $date = date('d/m/Y', strtotime($this->day));
@@ -55,9 +49,6 @@ class CinemaCinemaCity implements Cinema
foreach ($movieData->BD as $projections) { foreach ($movieData->BD as $projections) {
if ($projections->date == $date) { if ($projections->date == $date) {
foreach ($projections->P as $projection) { foreach ($projections->P as $projection) {
// var_dump($projection);
// die();
$movie['hours'][] = $projection->time; $movie['hours'][] = $projection->time;
} }
} }

View File

@@ -11,5 +11,8 @@ return ['airly' =>
[ [
'api_key' => '8b6d77b2950e4e018b0684912bf7b9ed', 'api_key' => '8b6d77b2950e4e018b0684912bf7b9ed',
'stations' => ['2210', '2256', '2180'], 'stations' => ['2210', '2256', '2180'],
'rzeczypospolitej' => 2210,
'grunwaldzka' => 2256,
'sowinskiego' => 2180,
] ]
]; ];

128
public/css/app.css vendored
View File

@@ -28,6 +28,21 @@ form {
display: none; display: none;
} }
.flex {
display: flex;
align-items: center;
}
.flex.space-between {
justify-content: space-between;
}
.flex.header {
margin-bottom: 1rem;
}
.flex .header {
margin-bottom: 0;
}
.icon { .icon {
cursor: pointer; cursor: pointer;
height: 25px; height: 25px;
@@ -55,342 +70,455 @@ form {
height: 29px; height: 29px;
margin: 0; margin: 0;
} }
.icon.address-card-o { .icon.address-card-o {
background-position-x: -0px; background-position-x: -0px;
} }
.icon.anchor { .icon.anchor {
background-position-x: -25px; background-position-x: -25px;
} }
.icon.archive-3 { .icon.archive-3 {
background-position-x: -50px; background-position-x: -50px;
} }
.icon.at { .icon.at {
background-position-x: -75px; background-position-x: -75px;
} }
.icon.balance-scale { .icon.balance-scale {
background-position-x: -100px; background-position-x: -100px;
} }
.icon.ban { .icon.ban {
background-position-x: -125px; background-position-x: -125px;
} }
.icon.bar-chart-o { .icon.bar-chart-o {
background-position-x: -150px; background-position-x: -150px;
} }
.icon.barcode { .icon.barcode {
background-position-x: -175px; background-position-x: -175px;
} }
.icon.battery-empty { .icon.battery-empty {
background-position-x: -200px; background-position-x: -200px;
} }
.icon.battery-full { .icon.battery-full {
background-position-x: -225px; background-position-x: -225px;
} }
.icon.battery-half { .icon.battery-half {
background-position-x: -250px; background-position-x: -250px;
} }
.icon.battery-quarter { .icon.battery-quarter {
background-position-x: -275px; background-position-x: -275px;
} }
.icon.battery-three-quarters { .icon.battery-three-quarters {
background-position-x: -300px; background-position-x: -300px;
} }
.icon.bed { .icon.bed {
background-position-x: -325px; background-position-x: -325px;
} }
.icon.beer { .icon.beer {
background-position-x: -350px; background-position-x: -350px;
} }
.icon.bell-o { .icon.bell-o {
background-position-x: -375px; background-position-x: -375px;
} }
.icon.bell-slash-o { .icon.bell-slash-o {
background-position-x: -400px; background-position-x: -400px;
} }
.icon.bicycle { .icon.bicycle {
background-position-x: -425px; background-position-x: -425px;
} }
.icon.birthday-cake { .icon.birthday-cake {
background-position-x: -450px; background-position-x: -450px;
} }
.icon.bolt { .icon.bolt {
background-position-x: -475px; background-position-x: -475px;
} }
.icon.bomb { .icon.bomb {
background-position-x: -500px; background-position-x: -500px;
} }
.icon.book { .icon.book {
background-position-x: -525px; background-position-x: -525px;
} }
.icon.bug { .icon.bug {
background-position-x: -550px; background-position-x: -550px;
} }
.icon.building-o { .icon.building-o {
background-position-x: -575px; background-position-x: -575px;
} }
.icon.bullhorn { .icon.bullhorn {
background-position-x: -600px; background-position-x: -600px;
} }
.icon.bus { .icon.bus {
background-position-x: -625px; background-position-x: -625px;
} }
.icon.camera { .icon.camera {
background-position-x: -650px; background-position-x: -650px;
} }
.icon.car { .icon.car {
background-position-x: -675px; background-position-x: -675px;
} }
.icon.chain { .icon.chain {
background-position-x: -700px; background-position-x: -700px;
} }
.icon.chat-2 { .icon.chat-2 {
background-position-x: -725px; background-position-x: -725px;
} }
.icon.check { .icon.check {
background-position-x: -750px; background-position-x: -750px;
} }
.icon.cloud { .icon.cloud {
background-position-x: -775px; background-position-x: -775px;
} }
.icon.code { .icon.code {
background-position-x: -800px; background-position-x: -800px;
} }
.icon.coffee { .icon.coffee {
background-position-x: -825px; background-position-x: -825px;
} }
.icon.cog { .icon.cog {
background-position-x: -850px; background-position-x: -850px;
} }
.icon.cutlery { .icon.cutlery {
background-position-x: -875px; background-position-x: -875px;
} }
.icon.dashboard { .icon.dashboard {
background-position-x: -900px; background-position-x: -900px;
} }
.icon.database { .icon.database {
background-position-x: -925px; background-position-x: -925px;
} }
.icon.diamond { .icon.diamond {
background-position-x: -950px; background-position-x: -950px;
} }
.icon.dollar { .icon.dollar {
background-position-x: -975px; background-position-x: -975px;
} }
.icon.dribbble { .icon.dribbble {
background-position-x: -1000px; background-position-x: -1000px;
} }
.icon.envelope-o { .icon.envelope-o {
background-position-x: -1025px; background-position-x: -1025px;
} }
.icon.envira { .icon.envira {
background-position-x: -1050px; background-position-x: -1050px;
} }
.icon.exclamation-triangle { .icon.exclamation-triangle {
background-position-x: -1075px; background-position-x: -1075px;
} }
.icon.female { .icon.female {
background-position-x: -1100px; background-position-x: -1100px;
} }
.icon.file-text-o { .icon.file-text-o {
background-position-x: -1125px; background-position-x: -1125px;
} }
.icon.film { .icon.film {
background-position-x: -1150px; background-position-x: -1150px;
} }
.icon.fingerprint { .icon.fingerprint {
background-position-x: -1175px; background-position-x: -1175px;
} }
.icon.fire-extinguisher { .icon.fire-extinguisher {
background-position-x: -1200px; background-position-x: -1200px;
} }
.icon.fire { .icon.fire {
background-position-x: -1225px; background-position-x: -1225px;
} }
.icon.flag-o { .icon.flag-o {
background-position-x: -1250px; background-position-x: -1250px;
} }
.icon.flask { .icon.flask {
background-position-x: -1275px; background-position-x: -1275px;
} }
.icon.floppy-o { .icon.floppy-o {
background-position-x: -1300px; background-position-x: -1300px;
} }
.icon.folder-o { .icon.folder-o {
background-position-x: -1325px; background-position-x: -1325px;
} }
.icon.folder-open-o { .icon.folder-open-o {
background-position-x: -1350px; background-position-x: -1350px;
} }
.icon.frown-o { .icon.frown-o {
background-position-x: -1375px; background-position-x: -1375px;
} }
.icon.gamepad { .icon.gamepad {
background-position-x: -1400px; background-position-x: -1400px;
} }
.icon.gift { .icon.gift {
background-position-x: -1425px; background-position-x: -1425px;
} }
.icon.git { .icon.git {
background-position-x: -1450px; background-position-x: -1450px;
} }
.icon.glass { .icon.glass {
background-position-x: -1475px; background-position-x: -1475px;
} }
.icon.graduation-cap { .icon.graduation-cap {
background-position-x: -1500px; background-position-x: -1500px;
} }
.icon.grav { .icon.grav {
background-position-x: -1525px; background-position-x: -1525px;
} }
.icon.group { .icon.group {
background-position-x: -1550px; background-position-x: -1550px;
} }
.icon.hand-o-left { .icon.hand-o-left {
background-position-x: -1575px; background-position-x: -1575px;
} }
.icon.heart-o { .icon.heart-o {
background-position-x: -1600px; background-position-x: -1600px;
} }
.icon.home { .icon.home {
background-position-x: -1625px; background-position-x: -1625px;
} }
.icon.lemon-o { .icon.lemon-o {
background-position-x: -1650px; background-position-x: -1650px;
} }
.icon.lightbulb-o { .icon.lightbulb-o {
background-position-x: -1675px; background-position-x: -1675px;
} }
.icon.list-alt { .icon.list-alt {
background-position-x: -1700px; background-position-x: -1700px;
} }
.icon.location-arrow { .icon.location-arrow {
background-position-x: -1725px; background-position-x: -1725px;
} }
.icon.lock { .icon.lock {
background-position-x: -1750px; background-position-x: -1750px;
} }
.icon.male { .icon.male {
background-position-x: -1775px; background-position-x: -1775px;
} }
.icon.map-1 { .icon.map-1 {
background-position-x: -1800px; background-position-x: -1800px;
} }
.icon.map-marker { .icon.map-marker {
background-position-x: -1825px; background-position-x: -1825px;
} }
.icon.microchip { .icon.microchip {
background-position-x: -1850px; background-position-x: -1850px;
} }
.icon.money { .icon.money {
background-position-x: -1875px; background-position-x: -1875px;
} }
.icon.moon-o { .icon.moon-o {
background-position-x: -1900px; background-position-x: -1900px;
} }
.icon.music { .icon.music {
background-position-x: -1925px; background-position-x: -1925px;
} }
.icon.paper-plane { .icon.paper-plane {
background-position-x: -1950px; background-position-x: -1950px;
} }
.icon.paperclip { .icon.paperclip {
background-position-x: -1975px; background-position-x: -1975px;
} }
.icon.paw { .icon.paw {
background-position-x: -2000px; background-position-x: -2000px;
} }
.icon.pencil { .icon.pencil {
background-position-x: -2025px; background-position-x: -2025px;
} }
.icon.phone { .icon.phone {
background-position-x: -2050px; background-position-x: -2050px;
} }
.icon.pie-chart { .icon.pie-chart {
background-position-x: -2075px; background-position-x: -2075px;
} }
.icon.piggy-bank { .icon.piggy-bank {
background-position-x: -2100px; background-position-x: -2100px;
} }
.icon.plane { .icon.plane {
background-position-x: -2125px; background-position-x: -2125px;
} }
.icon.question-circle-o { .icon.question-circle-o {
background-position-x: -2150px; background-position-x: -2150px;
} }
.icon.rocket { .icon.rocket {
background-position-x: -2175px; background-position-x: -2175px;
} }
.icon.search { .icon.search {
background-position-x: -2200px; background-position-x: -2200px;
} }
.icon.ship { .icon.ship {
background-position-x: -2225px; background-position-x: -2225px;
} }
.icon.shopping-cart { .icon.shopping-cart {
background-position-x: -2250px; background-position-x: -2250px;
} }
.icon.smile-o { .icon.smile-o {
background-position-x: -2275px; background-position-x: -2275px;
} }
.icon.snowflake-o { .icon.snowflake-o {
background-position-x: -2300px; background-position-x: -2300px;
} }
.icon.steam { .icon.steam {
background-position-x: -2325px; background-position-x: -2325px;
} }
.icon.subway { .icon.subway {
background-position-x: -2350px; background-position-x: -2350px;
} }
.icon.success { .icon.success {
background-position-x: -2375px; background-position-x: -2375px;
} }
.icon.support { .icon.support {
background-position-x: -2400px; background-position-x: -2400px;
} }
.icon.thermometer-2 { .icon.thermometer-2 {
background-position-x: -2425px; background-position-x: -2425px;
} }
.icon.thumbs-o-down { .icon.thumbs-o-down {
background-position-x: -2450px; background-position-x: -2450px;
} }
.icon.thumbs-o-up { .icon.thumbs-o-up {
background-position-x: -2475px; background-position-x: -2475px;
} }
.icon.ticket { .icon.ticket {
background-position-x: -2500px; background-position-x: -2500px;
} }
.icon.times { .icon.times {
background-position-x: -2525px; background-position-x: -2525px;
} }
.icon.trash-o { .icon.trash-o {
background-position-x: -2550px; background-position-x: -2550px;
} }
.icon.tree { .icon.tree {
background-position-x: -2575px; background-position-x: -2575px;
} }
.icon.trophy { .icon.trophy {
background-position-x: -2600px; background-position-x: -2600px;
} }
.icon.truck { .icon.truck {
background-position-x: -2625px; background-position-x: -2625px;
} }
.icon.umbrella { .icon.umbrella {
background-position-x: -2650px; background-position-x: -2650px;
} }
.icon.usd { .icon.usd {
background-position-x: -2675px; background-position-x: -2675px;
} }
.icon.warning { .icon.warning {
background-position-x: -2700px; background-position-x: -2700px;
} }
.icon.wifi { .icon.wifi {
background-position-x: -2725px; background-position-x: -2725px;
} }
.icon.wpexplorer { .icon.wpexplorer {
background-position-x: -2750px; background-position-x: -2750px;
} }
.icon.wrench { .icon.wrench {
background-position-x: -2775px; background-position-x: -2775px;
} }
.icon.youtube-play { .icon.youtube-play {
background-position-x: -2800px; background-position-x: -2800px;
} }

View File

@@ -12,17 +12,11 @@
name="text">{{ $text }}</textarea> name="text">{{ $text }}</textarea>
<input type="hidden" name="icon" id="icon" value="{{ $icon_selected }}"/> <input type="hidden" name="icon" id="icon" value="{{ $icon_selected }}"/>
<div class="icons"> <div class="icons">
<span class="icon @if(!isset($icon_selected) ) selected @endif empty" title="empty"></span> <span class="icon @if(!isset($icon_selected) ) selected @endif empty" title="empty"></span>
@foreach ($icons as $icon)<span @foreach ($icons as $icon)<span
class="icon {{ str_before($icon, '.') }} @if(isset($icon_selected) && $icon == basename($icon_selected)) selected @endif " title="{{ $icon }}"> class="icon {{ str_before($icon, '.') }} @if(isset($icon_selected) && $icon == basename($icon_selected)) selected @endif "
title="{{ $icon }}">
</span>@endforeach </span>@endforeach
</div> </div>
</div> </div>
@@ -38,8 +32,6 @@
<button class="ui reset button js-reset" type="reset">Wyczyść</button> <button class="ui reset button js-reset" type="reset">Wyczyść</button>
@if(isset($id)) @if(isset($id))
<button class="ui delete button js-delete red" type="submit" name="delete">Usuń</button> <button class="ui delete button js-delete red" type="submit" name="delete">Usuń</button>
@endif @endif
</form> </form>

View File

@@ -12,8 +12,10 @@
</div> </div>
@endif @endif
<h1 class="ui header">Szybka notatka</h1> <div class="flex header space-between">
<h1 class="ui header">Szybka notatka</h1>
<a class="ui right floated" href="/settings">Ustawienia</a>
</div>
<div class="ui container"> <div class="ui container">
<div class="ui one column middle aligned stackable grid"> <div class="ui one column middle aligned stackable grid">
<div class="ui column"> <div class="ui column">

View File

@@ -0,0 +1,54 @@
@extends('layouts.base')
@section('content')
<div class="ui container">
@if(Session::has('print_status'))
<div class="ui info message">
<div class="header">
{{ Session::get('print_status') }}
</div>
</div>
@endif
<div class="flex header space-between">
<h1 class="ui header">Ustawienia</h1>
<a class="ui right floated" href="/">Notatki</a>
</div>
</div>
<div class="ui container">
<h3 class="ui header">Przypisanie klawiszy</h3>
<form class="ui form" method="POST">
{{ csrf_field() }}
@foreach($keyboard as $element)
<div class="inline fields">
<div class="three wide field">
Klawisz: {{ $element->key }}
</div>
<div class="left floated content">
<div class="field">
Akcja:
<select class="ui" name="key[{{ $element->id }}]">
@foreach($actions as $actionKey => $action)
@if($action == 'separator')
<optgroup label=""></optgroup>
@else
<option @if($element->action == $actionKey)selected="selected"
@endif
value="{{ $actionKey }}">{{ $action }}</optionvalue>
@endif
@endforeach
</select>
</div>
</div>
</div>
@endforeach
<button class="ui blue button" type="submit">Zapisz</button>
</form>
</div>
@endsection

View File

@@ -12,6 +12,8 @@
*/ */
Route::get('/', 'Main@listView')->name('list'); Route::get('/', 'Main@listView')->name('list');
Route::get('/settings', 'Settings@mainView')->name('settingsList');
Route::post('/settings', 'Settings@save');
//Route::post('/', 'Main@listView'); //Route::post('/', 'Main@listView');
Route::get('/edit/{id}/{slug}', 'Main@edit')->name('edit'); Route::get('/edit/{id}/{slug}', 'Main@edit')->name('edit');
Route::post('/print/{id}/', 'Main@printText')->name('print'); Route::post('/print/{id}/', 'Main@printText')->name('print');
@@ -23,7 +25,7 @@ Route::post('/printImage', 'Main@imagePrint');
Route::post('/', 'Main@main'); Route::post('/', 'Main@main');
Route::get('/airly', 'Main@airly'); Route::get('/airly', 'AirlyController@airly_all');