Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
716cc5ef
authored
Feb 12, 2013
by
Dányi Bence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: better template name checking (ajax)
parent
5685b1c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
20 deletions
+31
-20
one/templates/new-template-flow.html
+31
-20
No files found.
one/templates/new-template-flow.html
View file @
716cc5ef
...
@@ -69,26 +69,37 @@
...
@@ -69,26 +69,37 @@
$
(
"#new-template-size-summary-"
+
v
).
show
();
$
(
"#new-template-size-summary-"
+
v
).
show
();
});
});
$
(
'#new-template-step-2 nav .next'
).
attr
(
"disabled"
,
"disabled"
);
$
(
'#new-template-step-2 nav .next'
).
attr
(
"disabled"
,
"disabled"
);
$
(
"#new-template-name"
).
change
(
function
(
e
){
$
(
"#new-template-name"
).
keyup
(
function
(){
var
s
=
$
(
this
).
val
();
var
timer
;
$
.
ajax
({
return
function
(
e
){
'type'
:
'GET'
,
var
self
=
this
;
'url'
:
'/ajax/template_name_unique/'
+
s
,
clearTimeout
(
timer
);
'success'
:
function
(
data
,
b
,
c
)
{
console
.
log
(
'asdasdasdasd'
);
if
(
s
!=
$
(
"#new-template-name"
).
val
())
{
timer
=
setTimeout
(
function
(){
return
True
;
console
.
log
(
'asd'
);
}
var
s
=
$
(
self
).
val
();
if
(
data
==
"True"
)
{
$
.
ajax
({
$
(
'#new-template-name'
).
removeClass
(
"error"
);
'type'
:
'GET'
,
$
(
'#new-template-step-2 nav .next'
).
removeAttr
(
"disabled"
);
'url'
:
'/ajax/template_name_unique/'
+
s
,
}
'success'
:
function
(
data
,
b
,
c
)
{
else
{
if
(
s
!=
$
(
"#new-template-name"
).
val
())
{
$
(
'#new-template-name'
).
addClass
(
"error"
);
return
true
;
$
(
'#new-template-step-2 nav .next'
).
attr
(
"disabled"
,
"disabled"
);
}
}
if
(
data
==
"True"
)
{
}
$
(
'#new-template-name'
).
removeClass
(
"error"
);
});
$
(
'#new-template-step-2 nav .next'
).
removeAttr
(
"disabled"
);
});
$
(
'#new-template-name'
).
removeProp
(
"title"
);
}
else
{
$
(
'#new-template-name'
).
addClass
(
"error"
);
$
(
'#new-template-step-2 nav .next'
).
attr
(
"disabled"
,
"disabled"
);
$
(
'#new-template-name'
).
prop
(
"title"
,
gettext
(
'Please choose a different name.'
));
}
}
});
},
1000
)
}
}());
})
})
</script>
</script>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment