Advanced search
Evgenij LegotskojJuly 22, 2019, 3:58 a.m.

DjangoПроверка орфографии на сайте. JavaScript?

JavaScript, EVILEG

Добрый день!

Нужен совет сообщества по разработке функционала проверки орфографии.
Одна из идей - добавить проверку орфографии при наборе текста статей.
Полагаю, что наиболее адекватным будет использование JavaScript.
Чтобы вы могли посоветовать в этом случае?
Возможн…

Evgenij LegotskojOct. 11, 2018, 2:04 p.m.

QtQt/C++ - Tutorial 084. How to run JavaScript code in a C ++ application using the example of working with two variables

Qt, QScriptEngine, QScriptValue, JavaScript, QScriptContext

Suppose you are faced with the task of executing JavaScript code in a C++ application. For example, there is a set of output data or variables whose names are known in advance, and there are pieces of JavaScript code that does something with these variables. And there is also an algorithm that, if there are any conditions, it will choose. which javascript code should be run.

Also, you can't just take and rewrite that JavaScript code into C++ code and hardcorely add it to the application. Since there are a lot of such pieces of code, at the same time other people are engaged in their maintenance and constantly add new pieces of code.

That is, in this case, the set of input data and JavaScript code for us is data, in some way the content that we launch using a certain algorithm, according to which we choose, under what conditions to choose one or another for the same set of input variables a piece of javascript code.

I hope that I clearly explained why we need to run the execution of JavaScript code in a C++ application.

I suggest to write an application that has two input fields for variable names, two input fields with input for the values of these variables in double format, in case of entering a value other than double data type, we will set the value to Undefined .

We will also add an TextEdit input field for writing JavaScript code that we will execute in our application.

And the last input field will be called Result (this will be TextEdit ), which will be responsible for the output of the new calculated values of the variables we entered.

Also add a QPushButton, which will run the execution of JavaScript code.

The application will look like the image below.

Evgenij LegotskojJan. 8, 2018, 2:52 a.m.

DjangoDjango - Tutorial 031. Change URL without reloading the page with partial content loading

Django, URL, JavaScript

The less information a site has to transmit to each request, the better. Because we get less load on the server and on the communication channel. The first such improvement on the site I did was loading the list of articles when navigating the page paginator.

The point is that when the user wants to go to the next page with a list of articles and clicks on the link in the paginator , the click event is intercepted, the event is canceled, but the AJAX request is sent to the server with the number of the requested page. When the server receives such a request, it only renders the list of articles and sends it back.

Evgenij LegotskojJan. 7, 2018, 2:52 p.m.

JavaScriptJavaScript - How to extract a parameter from a URL

JavaScript, URL

During the development of the site, small tasks arise, for example, how to extract a parameter from the URL.

For example, we have a URL like this:

http://www.example.com/?page=24&info=13

The parameters in this case are page and info .

Evgenij LegotskojNov. 6, 2017, 6:05 a.m.

QMLQML - Tutorial 033. Connecting JavaScript files to other JavaScript files in a Qt / QML project

QML, JavaScript, import

In the framework of the project on QML there is an opportunity not only to connect JavaScript files in QML files, but also in other JavaScript files. The syntax for connecting these files will be similar to that used in QML files.

For example, a variant of connecting a JavaScript file in a QML file

import "first.js" as FirstJs

Then, how to connect a JavaScript file to another JavaScript file will differ only by the presence of a dot before this line

.import "first.js" as FirstJs
Evgenij LegotskojSept. 17, 2017, 4:10 a.m.

DjangoDjango - Tutorial 026. Setting up the Minification of CSS and JavaScript code in PyCharm

Minification, CSS, JavaScript

When developing a website, it is often noticed that the site should have a short response time to the user's actions, so they apply various methods to improve the site's performance, such as caching data on the user side, using cookies, as well as minimizing CSS and JavaScript files. Minimizing the code of these files allows you to remove unnecessary spaces, symbols and comments that are not needed on the production server, but are only required for project development.

Traditionally, an additional file extension min is added to the original file extension, which means a minified file.

  • style.css -> style.min.css
  • scripts.js -> scripts.miin.js

I propose to set up the PyCharm development environment to automatically minify all these files in your Django project.

Minimizing the css and jsavascript code is only supported in PyCharm Professional Edition.

An important point, the configuration will be done under the Ubuntu-based operating system KDE Neon 5.8. Installing the necessary packages for Windows, I do not consider, because I believe that the development of Django project under this OS is a mauveton.

Evgenii LegotckoiApril 12, 2017, 12:03 a.m.

РазноеПринудительное обновление JavaScript и CSS у пользователя

CSS, JavaScript, Nginx

Всем привет!!
Разираюсь с nginx и включил кеширование статичных файлов, ну там скриптов, CSS, картинок и т.д на стороне пользовательского браузера. Так вот, когда я меняю что-то в CSS или javascript, то изменения не применяются пока не нажать последовательно CTRL+R CTRL+F5. Только тогда б…

R
Rus6lanFeb. 6, 2017, 3:06 p.m.

QMLУправление QML объектами в JavaScript

JavaScript, QML

У меня есть JS файл, в котором я отправляю запросы, как мне в этой же функции управлять QML компонентами в main.qml или другом QML файле.

.pragma library
function login(username, password) {        
        var params = 'username=' + encodeURIComponent(username) +
        '&…
Evgenij LegotskojJuly 14, 2016, 5:57 a.m.

QMLGame on QML - Lesson 1. Games arena and dynamic objects

JavaScript, QML, Qt, динамические объекты, игровая арена

After the first experience of writing games on Qt for Android, I want to share this experience together and offer to write a simple game in the style of "kill the mole." This is a game in which you need to have time to hit the moles, which climbs out of their holes, but considering that this is a simplified game, instead of moles using the circular target, which will appear on the playing field. As the playing field will use the net 6 6 cells. But to create a field will not be used to some special object of type GridLayout . In the game board will be formed of a grid of rows, columns and the side length of a square cell. Data on occupancy cells to be stored in a two-dimensional array, which will be formed in javascript component (to forget that QML - a declarative JSON-like language with javascript enabled).

Project structure

The project consists of the following files:

  • TargetGame.pro - the profile of the project;
  • deployment.pri - build file and project deploya;
  • main.cpp - the file with the main function of the project;
  • main.qml - basic QML-layer file with the object of the main application window;
  • Target.qml - QML file with the description of the target object;
  • Target.png - the appearance of the target pattern is png;
  • GameArea.qml - gaming arena with the grid to accommodate the targets;
  • logic.js - file with javascript logic games.

We will study the contents of only those files that are different from the default content when creating the project.

Timeweb

Let me recommend you the excellent hosting on which EVILEG is located.

For many years, Timeweb has been proving his stability.

For projects on Django I recommend VDS hosting

View Hosting
L

C++ - Test 001. The first program and data types

  • Result:80points,
  • Rating points4
DTs

C++ - Test 001. The first program and data types

  • Result:46points,
  • Rating points-6
SB

Qt - Test 001. Signals and slots

  • Result:94points,
  • Rating points8
Last comments
JaO

Как соответствовать новым требованиям Google Play

Ку всем! Вопрос! Как с помощью JNI вызвать оплату на android устройстве? Попробовал Qt Purchasing вроде пошло... но android пишет что библиотека устарела. В qt6 пока поддержки purchasing нет. Р…

Django - Tutorial 014. Displays a list of popular articles on Django

Я как понял, этот метод создает статистику каждый день (на каждый день), не удаляя старые данные за день и выводит все данные за сегодняшние просмотры у всех статей?

Qt/C++ - Lesson 006. QSqlQueryModel – Tables in Qt with SQL-query

Изменить запрос при создании модели.
L
  • Livis
  • May 30, 2021, 1:18 p.m.

Django - Tutorial 001. Deploying a site on Django + PostgreSQL + Gunicorn + Nginx

Отвечал на все команды после sudo service supervisor start Исправил таким образом sudo killall supervisordsudo supervisord -c /etc/supervisor/supervisord.conf
D

Django - Tutorial 001. Deploying a site on Django + PostgreSQL + Gunicorn + Nginx

Это на какую команду так отвечает?
Now discuss on the forum
v
  • vika
  • June 17, 2021, 12:19 a.m.

Вопрос новичка ui-форма

все получилось. создала обьект, исправила ошибки и все заработало. спасибо, что есть с кем поговорить.
s

Ключевое слово class

Разобрался,на стаковерфлоу нашел топик и понял почему так происходило .
KM

Django как воспользоваться результатом метода?

Priv = 2020 Now = 2021 Next = 2022 Rok = ( (None, "Nie wybran"), (Priv, '2020'), (Now, '2021'), (Next, '2022') ) Rok = models.IntegerField(choices=Rok, de…

QScrollArea dynamically add QCheckBoxes

Всё правильно. Это просто спамер, который отправился в вечный бан.

Папка с шаблоном сайта

Есть проект с поддержкой динамического создания поддоменов. Как назначить разные пути к шаблонам в templates from django.shortcuts import renderfrom horticulture.utilities import get_horticu…
About
Services
© EVILEG 2015-2021
Recommend hosting TIMEWEB