Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScriptin formatointi #82

Merged
merged 3 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ b215abbc7ae11614bab50fb7c3b95c307cf933d5

# Format Django templates with djLint
047d51f497bdb08d6c092b05d917d331fb7cebd0

# Format JavaScript and CSS with prettier
11eff78408e2bb6bdf4c65efb4adf3117204172c
66 changes: 33 additions & 33 deletions web/media/highlight-active-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,44 +22,44 @@ written by Alf Magne Kalleland.
Alf Magne Kalleland, 2005
Owner of DHTMLgoodies.com

************************************************************************************************************/
************************************************************************************************************/

var currentlyActiveInputRef = false;
var currentlyActiveInputClassName = false;

function highlightActiveInput()
{
if(currentlyActiveInputRef){
currentlyActiveInputRef.className = currentlyActiveInputClassName;
}
currentlyActiveInputClassName = this.className;
this.className = 'inputHighlighted';
currentlyActiveInputRef = this;


function highlightActiveInput() {
if (currentlyActiveInputRef) {
currentlyActiveInputRef.className = currentlyActiveInputClassName;
}
currentlyActiveInputClassName = this.className;
this.className = "inputHighlighted";
currentlyActiveInputRef = this;
}

function blurActiveInput()
{
this.className = currentlyActiveInputClassName;


function blurActiveInput() {
this.className = currentlyActiveInputClassName;
}

function initInputHighlightScript() {
var tags = ["INPUT", "TEXTAREA"];

function initInputHighlightScript()
{
var tags = ['INPUT','TEXTAREA'];

for(tagCounter=0;tagCounter<tags.length;tagCounter++){
var inputs = document.getElementsByTagName(tags[tagCounter]);
for(var no=0;no<inputs.length;no++){
if(inputs[no].className && inputs[no].className=='doNotHighlightThisInput')continue;

if(inputs[no].tagName.toLowerCase()=='textarea' || (inputs[no].tagName.toLowerCase()=='input' && inputs[no].type.toLowerCase()=='text')){
inputs[no].onfocus = highlightActiveInput;
inputs[no].onblur = blurActiveInput;
}
}
}
}
for (tagCounter = 0; tagCounter < tags.length; tagCounter++) {
var inputs = document.getElementsByTagName(tags[tagCounter]);
for (var no = 0; no < inputs.length; no++) {
if (
inputs[no].className &&
inputs[no].className == "doNotHighlightThisInput"
)
continue;

if (
inputs[no].tagName.toLowerCase() == "textarea" ||
(inputs[no].tagName.toLowerCase() == "input" &&
inputs[no].type.toLowerCase() == "text")
) {
inputs[no].onfocus = highlightActiveInput;
inputs[no].onblur = blurActiveInput;
}
}
}
}
201 changes: 101 additions & 100 deletions web/media/jquery.jgrowl.css
Original file line number Diff line number Diff line change
@@ -1,100 +1,101 @@

div.jGrowl {
padding: 5px;
z-index: 9999;
color: #fff;
font-size: 12px;
}

/** Normal Style Positions **/
div.jGrowl {
position: absolute;
}

body > div.jGrowl {
position: fixed;
}

div.jGrowl.top-left {
left: 0px;
top: 0px;
}

div.jGrowl.top-right {
right: 0px;
top: 0px;
}

div.jGrowl.bottom-left {
left: 0px;
bottom: 0px;
}

div.jGrowl.bottom-right {
right: 0px;
bottom: 0px;
}

div.jGrowl.center {
top: 0px;
width: 50%;
left: 25%;
}

/** Cross Browser Styling **/
div.center div.jGrowl-notification, div.center div.jGrowl-closer {
margin-left: auto;
margin-right: auto;
}

div.jGrowl div.jGrowl-notification, div.jGrowl div.jGrowl-closer {
background-color: #000; /*#eefcb8;*/
opacity: .85;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)";
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85);
zoom: 1;
width: 600px;
padding: 10px;
margin-top: 5px;
margin-bottom: 5px;
font-family: Tahoma, Arial, Helvetica, sans-serif;
font-size: 1em;
text-align: left;
display: none;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border: 2px solid #9ac400;
}

div.jGrowl div.jGrowl-notification {
min-height: 15px;
}

div.jGrowl div.jGrowl-notification div.jGrowl-header {
font-weight: bold;
font-size: .85em;
}

div.jGrowl div.jGrowl-notification div.jGrowl-close {
z-index: 99;
float: right;
font-weight: bold;
font-size: 1em;
cursor: pointer;
}

div.jGrowl div.jGrowl-closer {
padding-top: 4px;
padding-bottom: 4px;
cursor: pointer;
font-size: .9em;
font-weight: bold;
text-align: center;
}

/** Hide jGrowl when printing **/
@media print {
div.jGrowl {
display: none;
}
}
div.jGrowl {
padding: 5px;
z-index: 9999;
color: #fff;
font-size: 12px;
}

/** Normal Style Positions **/
div.jGrowl {
position: absolute;
}

body > div.jGrowl {
position: fixed;
}

div.jGrowl.top-left {
left: 0px;
top: 0px;
}

div.jGrowl.top-right {
right: 0px;
top: 0px;
}

div.jGrowl.bottom-left {
left: 0px;
bottom: 0px;
}

div.jGrowl.bottom-right {
right: 0px;
bottom: 0px;
}

div.jGrowl.center {
top: 0px;
width: 50%;
left: 25%;
}

/** Cross Browser Styling **/
div.center div.jGrowl-notification,
div.center div.jGrowl-closer {
margin-left: auto;
margin-right: auto;
}

div.jGrowl div.jGrowl-notification,
div.jGrowl div.jGrowl-closer {
background-color: #000; /*#eefcb8;*/
opacity: 0.85;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)";
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85);
zoom: 1;
width: 600px;
padding: 10px;
margin-top: 5px;
margin-bottom: 5px;
font-family: Tahoma, Arial, Helvetica, sans-serif;
font-size: 1em;
text-align: left;
display: none;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border: 2px solid #9ac400;
}

div.jGrowl div.jGrowl-notification {
min-height: 15px;
}

div.jGrowl div.jGrowl-notification div.jGrowl-header {
font-weight: bold;
font-size: 0.85em;
}

div.jGrowl div.jGrowl-notification div.jGrowl-close {
z-index: 99;
float: right;
font-weight: bold;
font-size: 1em;
cursor: pointer;
}

div.jGrowl div.jGrowl-closer {
padding-top: 4px;
padding-bottom: 4px;
cursor: pointer;
font-size: 0.9em;
font-weight: bold;
text-align: center;
}

/** Hide jGrowl when printing **/
@media print {
div.jGrowl {
display: none;
}
}
81 changes: 40 additions & 41 deletions web/media/keyhandler.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
function checkForEnter(event) {
switch(event.keyCode)
{
// up arrow
case 40:
$(this).parent()
.parent()
.next()
.children("td")
.children("input[class="
+$(this).attr("class")+"]")
.focus()
.select();
break;

// down arrow
case 38:
$(this).parent()
.parent()
.prev()
.children("td")
.children("input[class="
+$(this).attr("class")+"]")
.focus()
.select();
break;

// Enter key
case 13:
$(this).parent()
.parent()
.next()
.children("td")
.children("input[class="
+$(this).attr("class")+"]")
.focus()
.select();
event.preventDefault();
return false;
break;
}
}
switch (event.keyCode) {
// up arrow
case 40:
$(this)
.parent()
.parent()
.next()
.children("td")
.children("input[class=" + $(this).attr("class") + "]")
.focus()
.select();
break;

// down arrow
case 38:
$(this)
.parent()
.parent()
.prev()
.children("td")
.children("input[class=" + $(this).attr("class") + "]")
.focus()
.select();
break;

// Enter key
case 13:
$(this)
.parent()
.parent()
.next()
.children("td")
.children("input[class=" + $(this).attr("class") + "]")
.focus()
.select();
event.preventDefault();
return false;
break;
}
}
Loading