Commit 16a2c9e9 authored by Clément Fauconnier's avatar Clément Fauconnier

fixed widgets recently added

parent d30479de
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://uniboard.mnemis.com/widgets/calculator"
version="1.1"
width="460"
height="418"
minimum_width="460"
minimum_height="418"
ub:resizable="true"
ub:transparent="true">
<name>Calculator</name>
<content src="index.html"/>
</widget>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Unpredictable Calculator</title>
<script src="js/sankore.js" type="text/javascript"></script>
<script src="dist/calculator.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="css/calculator.css" />
</head>
<body>
<div id="ubwidget"></div>
<script type="text/javascript">
var unpredictable = false;
var c = Sankore.Calculator.create('ubwidget', {
locale: window.sankore ? window.sankore.locale() : 'fr_FR',
unpredictableMode: unpredictable,
ready: function () {
var self = this, state = {}, timer = null;
if (window.sankore) {
try {
state = JSON.parse(window.sankore.preference('state'));
} catch (e) {}
this.eventDispatcher.addEventSubscriber({
events: [
'calculator.output_changed', 'calculator.memory_changed', 'calculator.layout_changed',
'editor.layout_created', 'editor.layout_removed', 'editor.layout_changed', 'editor.button_selected',
'keystroke_line.changed'
],
listener: function () {
if (null !== timer) {
clearTimeout(timer);
}
timer = setTimeout(function() {
window.sankore.setPreference('state', JSON.stringify(self.getState()));
timer = null;
}, 350);
}
});
}
this.init(state);
}
});
</script>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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