Commit b32de30b authored by Mart Lubbers's avatar Mart Lubbers

Merge branch '162-including-svg-throws-nomatch-in-sapl-in-some-cases' into 'master'

Resolve "Including SVG throws nomatch in SAPL in some cases"

Closes #162

See merge request !98
parents 1a816fff 9512bc74
......@@ -101,7 +101,7 @@ fromSVGEditor svglet=:{initView,renderImage,updView,updModel}
}
where
genUI dp val world
# attr = 'DM'.unions [sizeAttr FlexSize FlexSize, valueAttr (toJSON val)]
# attr = 'DM'.unions [sizeAttr FlexSize FlexSize, valueAttr (encodeOnServer val)]
= (Ok (uia UIComponent attr,newFieldMask), world)
initUI me world
......
......@@ -16,6 +16,7 @@
<script type="text/javascript" src="/js/sapl-itasks.js"></script>
<script type="text/javascript" src="/js/sapl-rt.js"></script>
<script type="text/javascript" src="/js/sapl-support.js"></script>
<script type="text/javascript" src="/js/sapl-debug.js"></script>
<!-- iTasks framework -->
<script type="text/javascript" src="/js/itasks-core.js"></script>
......
......@@ -38,8 +38,15 @@ itasks.Component = {
var me = this, fun, evalfun;
//Initialize linked sapl functions
if(me.attributes.saplDeps != null && me.attributes.saplDeps != '') {
me.evalJs(me.attributes.saplDeps);
}
if(SAPL_DEBUG) {
console.log("BEGIN SAPL DEBUG");
console.log(me.attributes.saplDeps);
console.log("END SAPL DEBUG");
} else {
me.evalJs(me.attributes.saplDeps);
}
me.replaceJsDynamicUnify();
}
//Decode and evaluate the sapl initialization function
if(me.attributes.saplInit !=null && me.attributes.saplInit!= '') {
Sapl.feval([me.evalJsVal(me.attributes.saplInit),[___wrapJS(me),"JSWorld"]]);
......@@ -409,18 +416,19 @@ itasks.Component = {
s.appendChild(document.createTextNode(js));
h.appendChild(s);
h.removeChild(s);
//Make sure that the dynamics unification is specialized for javavascript functions
if(typeof ___SystemDynamic__unify === "function" && ___SystemDynamic__unify != _gen_unify){
_orig_unify_fun = ___SystemDynamic__unify;
___SystemDynamic__unify = _gen_unify;
}
return null;
},
evalJsVal: function(js) {
var out;
eval("out = " + js + ";");
return out;
},
replaceJsDynamicUnify: function() {
//Make sure that the dynamics unification is specialized for javavascript functions
if(typeof ___SystemDynamic__unify === "function" && ___SystemDynamic__unify != _gen_unify){
_orig_unify_fun = ___SystemDynamic__unify;
___SystemDynamic__unify = _gen_unify;
}
}
};
itasks.Loader = {
......
/* If the SAPL_DEBUG flag is set to 'true', the iTasks runtime will not evaluate any sapl
* functions it receives, but instead print them to the console. You can copy/paste them to this
* file, so that you can step through them with a javascript debugger.
*/
SAPL_DEBUG = false;
//Put the Sapl functions you want to debug below:
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