Commit feb38041 authored by Tristan Cavelier's avatar Tristan Cavelier

Little change from elrte and login components

elrte new document is now empty.
We can now remember previous JSON login.
parent 2a40714a
...@@ -59,8 +59,6 @@ $().ready(function() { ...@@ -59,8 +59,6 @@ $().ready(function() {
Save Save
</button>&nbsp; </button>&nbsp;
</div> </div>
<div id="elrte_editor"> <div id="elrte_editor"></div>
<h1>OfficeJS elRTE texteditor</h1><p>This is a new document.<br></p>
</div>
</body> </body>
</html> </html>
<div class="control-group"> <div id="login-gadget">
<label class="control-label" <div class="control-group">
for="input_json_storage"> <label class="control-label"
JSON Storage for="input_json_storage">
</label> JSON Storage
<div class="controls docs-input-sizes"> </label>
<input class="input-xlarge" <div class="controls docs-input-sizes">
type="text" name="JSONstorage" id="input_json_storage" <input id="login_input"
value="{&quot;type&quot;:&quot;wait&quot;,&quot;storage&quot;:{&quot;type&quot;:&quot;dummyallok&quot;}}" class="input-xxlarge" value=""
placeholder="storage" /> type="text" name="JSONstorage" id="input_json_storage"
<!-- value="{&quot;type&quot;:&quot;local&quot;,&quot;username&quot;:&quot;tristan&quot;}" --> placeholder="{&quot;storage&quot;:&quot;description&quot;}" />
<!-- value="{&quot;type&quot;:&quot;replicate&quot;,&quot;storagelist&quot;:[{&quot;type&quot;:&quot;replicate&quot;,&quot;storagelist&quot;:[{&quot;type&quot;:&quot;dummyallfail&quot;,&quot;username&quot;:&quot;1&quot;},{&quot;type&quot;:&quot;dummyall3tries&quot;,&quot;username&quot;:&quot;2&quot;}]},{&quot;type&quot;:&quot;replicate&quot;,&quot;storagelist&quot;:[{&quot;type&quot;:&quot;dummyallfail&quot;,&quot;username&quot;:&quot;3&quot;},{&quot;type&quot;:&quot;dummyall3tries&quot;,&quot;username&quot;:&quot;4&quot;}]}]}" --> </div>
<!-- value="{&quot;type&quot;:&quot;replicate&quot;,&quot;storagelist&quot;:[{&quot;type&quot;:&quot;dummyallfail&quot;},{&quot;type&quot;:&quot;replicate&quot;,&quot;storagelist&quot;:[{&quot;type&quot;:&quot;dummyall3tries&quot;,&quot;username&quot;:&quot;1&quot;},{&quot;type&quot;:&quot;dummyallfail&quot;,&quot;username&quot;:&quot;2&quot;}]},{&quot;type&quot;:&quot;replicate&quot;,&quot;storagelist&quot;:[{&quot;type&quot;:&quot;dummyallnotfound&quot;,&quot;username&quot;:&quot;3&quot;}]}]}" -->
<!-- value="{&quot;type&quot;:&quot;local&quot;,&quot;username&quot;:&quot;tristan&quot;,&quot;applicationname&quot;:&quot;jiotests&quot;}" -->
<!-- value="{&quot;type&quot;:&quot;dav&quot;,&quot;username&quot;:&quot;tristan&quot;,&quot;password&quot;:&quot;mdp&quot;,&quot;url&quot;:&quot;http://localhost:80&quot;}" -->
<!-- value="{&quot;type&quot;:&quot;replicate&quot;,&quot;storagelist&quot;:[{&quot;type&quot;:&quot;local&quot;,&quot;username&quot;:&quot;tristan&quot;},{&quot;type&quot;:&quot;dav&quot;,&quot;username&quot;:&quot;tristan&quot;,&quot;password&quot;:&quot;mdp&quot;,&quot;url&quot;:&quot;http://localhost:80&quot;}]}" -->
</div> </div>
<div>
Remember me&nbsp;&nbsp;
<input id="remember_me" type="checkbox"
onclick="window.OfficeJS_login.toggleRememberMe();"/>
</div>
<div>
<button type="submit"
class="btn"
onclick="window.OfficeJS_login.createJIO();">
Create New JIO
</button>
</div>
<script type="text/javascript">
<!--
window.OfficeJS_login = {
storageId:'#login-gadget #login_input',
storagePath:'OfficeJS/login/login',
rememberId:'#login-gadget #remember_me',
rememberPath:'OfficeJS/login/remember_me',
localStorage: LocalOrCookieStorage,
fillLogin: function () {
$(this.storageId).attr(
'value',this.localStorage.getItem(this.storagePath) || '');
},
isRememberMe: function () {
return $(this.rememberId).attr('checked');
},
fillRememberMe: function () {
var t = this.localStorage.getItem(this.rememberPath);
if (t) {
this.rememberMe();
}
},
rememberMe: function () {
$(this.rememberId).attr('checked','1');
this.localStorage.setItem(this.rememberPath,'1');
},
dontRememberMe: function () {
$(this.rememberId).removeAttr('checked');
this.localStorage.deleteItem(this.rememberPath);
},
toggleRememberMe: function () {
var t = this.localStorage.getItem(this.rememberPath);
if (t) { this.dontRememberMe() } else { this.rememberMe(); }
},
createJIO: function() {
var spec = $('#login-gadget #login_input').attr('value');
this.localStorage.setItem(this.storagePath,spec);
OfficeJS.setJio(spec);
}
};
window.OfficeJS_login.fillRememberMe();
if (window.OfficeJS_login.isRememberMe()) {
window.OfficeJS_login.fillLogin();
}
//-->
</script>
</div> </div>
<button type="submit"
class="btn"
onclick="OfficeJS.setJio(
$('#input_json_storage').attr('value'),
$('#input_json_applicant').attr('value'));">
Create New JIO
</button>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment