diff --git a/deploy/gulpfile.js b/deploy/gulpfile.js index e5de90a5ec0106f2c73967ddee9e1f6be2bb0bea..2133e0f88a159364432d471dbe36d89fa1db33ef 100644 --- a/deploy/gulpfile.js +++ b/deploy/gulpfile.js @@ -68,12 +68,18 @@ gulp.task('folders:create', function() { var dirs = [ sysPath.app + 'application/logs/', sysPath.app + 'application/cache/', - sysPath.app + 'application/cache/twig/' + sysPath.app + 'application/cache/twig/', + sysPath.app + 'support', + sysPath.app + 'support/img' ]; fs.mkdir(dirs[0], function() {}); fs.mkdir(dirs[1], function() { fs.mkdir(dirs[2], function() {}); }); + + fs.mkdir(dirs[3], function() { + fs.mkdir(dirs[4], function() {}); + }); }); // gulp.task('css', ['less'], function() { diff --git a/media/js/supportDialog.js b/media/js/supportDialog.js index 617c7ff5050d8addf59c2bf0b234ee772c2b7709..0df5e702a407fba19422819e47a0be2c6454b88b 100644 --- a/media/js/supportDialog.js +++ b/media/js/supportDialog.js @@ -8,19 +8,15 @@ $(function(){ var err_ready = true; - - $(document) - .on('change', '#imageFile', function() - { - document.forms["loadPicture"].action = URLdir + "handler/uploader/imageupload"; - document.forms["loadPicture"].submit(); - - // now result in #hiddenframe :-/ - $("#hiddenframe").load(function () { - var ret = this.contentWindow.document.body.innerHTML; - console.log(ret); - }); + // $('#imageFile').change(function () { // does not work + $(document).on('change', '#imageFile', function () { + document.forms["loadPicture"].submit(); + // now result in #hiddenframe :-/ + $("#hiddenframe").load(function () { + var ret = this.contentWindow.document.body.innerHTML; + // console.log(ret); }); + }); @@ -78,4 +74,4 @@ $(function(){ } }); }); -}); \ No newline at end of file +}); diff --git a/~dev_rating/application/classes/Controller/Handler/Uploader.php b/~dev_rating/application/classes/Controller/Handler/Uploader.php index ae2b9e43e8143dfc03e273aa18f0cff4a3fddc21..f07a44427901b7df8a7332f391cb8d1fa568e4fb 100644 --- a/~dev_rating/application/classes/Controller/Handler/Uploader.php +++ b/~dev_rating/application/classes/Controller/Handler/Uploader.php @@ -12,12 +12,11 @@ class Controller_Handler_Uploader extends Controller_Handler $data['success'] = false; // TODO: process file /* - $uploaddir = 'support/img/'; + $uploaddir = DOCROOT . 'support/img/'; $uploadfile = $uploaddir . basename($_FILES['imageFile']['name']); move_uploaded_file($_FILES['imageFile']['tmp_name'], $uploadfile); $data['file'] = $uploadfile; */ - $this->response->body(json_encode($data)); } -} \ No newline at end of file +} diff --git a/~dev_rating/application/views/popup/support.twig b/~dev_rating/application/views/popup/support.twig index 4a6070abc3bd1e8de7557d614e6c71a5ed65ef1b..178f4c31acb74986b8057925c152320ff513453c 100644 --- a/~dev_rating/application/views/popup/support.twig +++ b/~dev_rating/application/views/popup/support.twig @@ -7,6 +7,7 @@ или же желаете внести предложение по улучшению системы, просим Вас оставить сообщение с описанием вопроса, ошибки или своего предложения в ниже приведенной форме. </p> + <p> Давайте вместе сделаем наш любимый сервис лучше! </p> @@ -18,10 +19,10 @@ <input id="messageTitle" class="defaultForm FullWidth marginBetween" type="text" placeholder="Тема сообщения" maxlength="60"> <textarea id="message" class="defaultForm FullWidth marginBetween" placeholder="Сообщение"></textarea> - <form enctype="multipart/form-data" action="" method="POST" name="loadPicture" id="loadPicture" target="hiddenframe"> + <form enctype="multipart/form-data" action="{{ URL.site("handler/uploader/imageupload") }}" method="POST" name="loadPicture" id="loadPicture" target="hiddenframe"> <input id="imageFile" name="imageFile" type="file"> </form> <iframe id="hiddenframe" name="hiddenframe" style="width:0px; height:0px; border:0px"></iframe> <button class="defaultForm BlueButton FullWidth marginBetween" id="dialogSendButton">Отправить сообщение</button> -</div> \ No newline at end of file +</div>