lib/kaya/view/javascript.mote in kaya-0.0.7 vs lib/kaya/view/javascript.mote in kaya-0.0.8
- old
+ new
@@ -1,50 +1,63 @@
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script>
<script src='https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js'></script>
<script type='text/javascript'>
function my_alert(title, text){
- info(title,text);
+ startedInfo(title,text);
url = 'http://' + window.location.host + window.location.pathname;
$('#myModal').modal('show');
}
- function starter_link(formId){
+
+ function startedAlert(title, text){
+ startedInfo(title,text);
+ url = 'http://' + window.location.host + window.location.pathname;
+ $('#startedModal').modal('show');
+ }
+
+
+ function starterLink(formId){
var form = document.getElementById(formId);
var link = window.location.origin + '/{{Kaya::Support::Configuration.hostname}}/kaya/suites/' + formId + '/run?';
var elements = form.getElementsByClassName('customParam');
for(i=0; i < elements.length; i++){
if(elements[i].value.length > 0){
link += elements[i].getAttribute('name') + '=' + elements[i].value + '&';
}
}
- info_for_link('Use to the following link to start execution, share it!', link.slice(0,link.length-1));
+ infoForLink('Use to the following link to start execution, share it!', link.slice(0,link.length-1));
}
function info(title, text){
document.getElementById('myModalLabel').innerHTML= title;
document.getElementById('my-modal').innerHTML= text;
}
+
+ function startedInfo(title, text){
+ document.getElementById('startedModalLabel').innerHTML= title;
+ document.getElementById('started-modal').innerHTML= text;
+ }
function featureInfo(title, text){
start_html = '<pre lang="ruby" style="height:400px; overflow:scroll; white-space:pre; word-wrap:normal;">';
end_html = '</pre>'
replaced_text = text.replace(/%LT&/g,'<')
replaced_text = replaced_text.replace(/%GT&/g,'>')
all_html = start_html + replaced_text + end_html;
document.getElementById('myLargeModalLabel').innerHTML= title;
document.getElementById('my-largeModal').innerHTML= all_html;
}
- function go_clean(url){
+ function goClean(url){
window.location.href = url;
}
- function refresh_and_open(url){
+ function refreshAndOpen(url){
window.open(url, '_blank', 'toolbar=no, scrollbars=yes, resizable=yes, top=300, left=300, width=800, height=600');
location.reload();
}
function selectLink(){
document.getElementById('link-text-area').focus();
document.getElementById('link-text-area').select();
}
- function info_for_link(title, text){
+ function infoForLink(title, text){
document.getElementById('myModalLabel').innerHTML= title;
content = "<textarea id='link-text-area' rows='3' cols='63' style='resize: none; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 4px; font-weight:normal;' onfocus='selectLink()'>" + text + "</textarea><br>";
content += '<small>Click to select.<small>';
document.getElementById('my-modal').innerHTML= content;
}
@@ -58,27 +71,27 @@
if(plusFields.hasOwnProperty(document.getElementById(selectId + index).options[document.getElementById(selectId + index).selectedIndex].value)) {
document.getElementById(plusFields[document.getElementById(selectId + index).options[document.getElementById(selectId + index).selectedIndex].value] + index).style.display = 'block';
}
}
- function get_and_close(url){
+ function getAndClose(url){
xmlHttp = new XMLHttpRequest();
xmlHttp.open( 'GET', url, false );
xmlHttp.send();
window.close();
}
- function go_to_bottom(){
+ function goToBottom(){
window.scrollTo(0,document.body.scrollHeight);
}
- function go_to_top(){
+ function goToTop(){
window.scrollTo(0,0);
}
var collapsed = false;
- function auto_collapse(){
+ function autoCollapse(){
if(collapsed) {
collapsed = false;
document.getElementById('collapse_icon').innerHTML = "<span class='glyphicon glyphicon-minus' aria-hidden='true' style='font-size:18px;'></span>";
} else {
collapsed = true;
\ No newline at end of file