mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
Updated AuthorsModel. Added utility script for generating QML ListElements of authors.
This commit is contained in:
parent
01309d50b5
commit
9683ddc37a
@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>CREDITS Utility</title>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://dl.dropboxusercontent.com/u/11670/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
|
||||
<style>
|
||||
body { margin: 40px;}
|
||||
.hidden { display:none; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Author Dialog authorModel Utility</h1>
|
||||
<p>This utility will parse a \n delimited list of names and generate ListElement components for entry into the QML model located in /qml/AuthorsModel.qml.</p>
|
||||
<div class="output"></div>
|
||||
<form onSubmit="javascript:handleForm($('.authors').val()); return false;">
|
||||
<textarea class="authors" rows="30"></textarea>
|
||||
<button type="submit" class="btn">Generate</button>
|
||||
</form>
|
||||
<script src="http://code.jquery.com/jquery-latest.js"></script>
|
||||
<script src="https://dl.dropboxusercontent.com/u/11670/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script>
|
||||
function handleForm(str){
|
||||
console.log(str);
|
||||
|
||||
var lines = str.split(/\n/);
|
||||
var texts = [];
|
||||
$('<div class="alert-block alert-info"><strong>Instructions: </strong>Cut/Paste the ListElements below into /qml/AuthorsModel.qml</div><br>').appendTo('.output');
|
||||
for (var i=0; i < lines.length; i++) {
|
||||
// only push this line if it contains a non whitespace character.
|
||||
if (/\S/.test(lines[i])) {
|
||||
texts.push($.trim(lines[i]));
|
||||
}
|
||||
//Make string to append to output
|
||||
var listelement = '<p>ListElement { name: "' + texts[i] + '" }</p>';
|
||||
$(listelement).appendTo('.output');
|
||||
}
|
||||
$('button').detach();
|
||||
$('.authors').detach();
|
||||
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html
|
@ -69,6 +69,7 @@ Dr. Erhard Siegl
|
||||
Mike Smith
|
||||
Alex Sowa
|
||||
Pete Stapley
|
||||
Vova Starikh
|
||||
Rowan Taubitz
|
||||
Andrew Thoms
|
||||
Jasper van Loenen
|
||||
@ -79,6 +80,7 @@ Brian Webb
|
||||
Justin Welander
|
||||
Mat Wellington
|
||||
Kendal Wells
|
||||
David Willis
|
||||
Dmitriy Zaitsev
|
||||
</pre>
|
||||
</body>
|
||||
|
@ -130,6 +130,8 @@ ListModel {
|
||||
ListElement{ name:"Alex Sowa" }
|
||||
|
||||
ListElement{ name:"Pete Stapley" }
|
||||
|
||||
ListElement{ name:"Vova Starikh" }
|
||||
|
||||
ListElement{ name:"Rowan Taubitz" }
|
||||
|
||||
@ -151,5 +153,7 @@ ListModel {
|
||||
|
||||
ListElement{ name:"Kendal Wells" }
|
||||
|
||||
ListElement { name: "David Willis" }
|
||||
|
||||
ListElement{ name:"Dmitriy Zaitsev" }
|
||||
}
|
Loading…
Reference in New Issue
Block a user