Open Demfier opened 6 years ago
Can you assign me this issue?
@142ayushkumar - I have assigned this issue to you. Make sure when you make the PR you enumerate a list of keyboard shortcuts that you've added.
Update: @142ayushkumar working demo isn't required. #33 will take care if it.
I have a separate .js and .html file and tab works in text area (just to check that my js file is working or not) but they don't work in this project, any idea where i did mistake?
@142ayushkumar : It would greatly help if you could provide us with the code or something. And by the way you'll have to run python manage.py collectstatic
command if you've introduced new static files (html, js, css, images etc) to make sure they are loaded in the app. This is just a hinch though. I would be able to tell you better if you "show" me what you are doing :smile:
Added this in index.html
{% load staticfiles %}
<script src="{% static "js/my.js" %}"></script>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="static/js/my.js"></script>
</head>
and in my.js
$(document).delegate('#textbox', 'keydown', function(e) {
var keyCode = e.keyCode || e.which;
if (keyCode == 9) {
e.preventDefault();
var start = this.selectionStart;
var end = this.selectionEnd;
// set textarea value to: text before caret + tab + text after caret
$(this).val($(this).val().substring(0, start)
+ "\t"
+ $(this).val().substring(end));
// put caret at right position again
this.selectionStart =
this.selectionEnd = start + 1;
}
});
and yes, i did this python manage.py collectstatic
too
I think the issue stands here with the way you are referring to them. Try using /static/js/my.js
instead the way you are using now. Also, as a thumb rule, you should always check your browser's console to get a direction to start you debugging. Let me know if that helps.
Sorry for my bad, i used /static/js/my.js
, was just tweaking and then i copied the code, i used
/static/js/my.js
,it doesn't work
What does the console show? ᐧ
On 14 December 2017 at 17:36, Kumar Ayush notifications@github.com wrote:
Sorry for my bad, i used /static/js/my.js , was just tweaking and then i copied the code, i used /static/js/my.js ,it doesn't work
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kaustubhhiware/c0derunR/issues/15#issuecomment-351692882, or mute the thread https://github.com/notifications/unsubscribe-auth/AMAyBoaQ91eOXX4UEv23pfi1EiMFK5_Jks5tAQ9WgaJpZM4QocR8 .
Also, I think it's better if you make a PR.
[14/Dec/2017 12:15:29] "GET / HTTP/1.1" 200 13504 [14/Dec/2017 12:15:29] "GET /static/js/my.js HTTP/1.1" 304 0 [14/Dec/2017 12:15:29] "GET /static/css/mystyle.css HTTP/1.1" 304 0 [14/Dec/2017 12:15:29] "GET /static/js/terminal_fill.js HTTP/1.1" 304 0 [14/Dec/2017 12:15:29] "GET /static/js/my.js HTTP/1.1" 304 0 [14/Dec/2017 12:15:30] "GET /static/img/logo.ico HTTP/1.1" 304 0
That's all?
Make a PR. No errors exist in the snippet. Also, I meant your browser's console back then. My bad, I should've specified earlier :sweat_smile: ᐧ
It would be nice to have support for keyboard shortcuts such as
Tab
to give indentation, shortcuts to move a line of code up/down etc.