Completely disable ADAM in 2SXC - dotnetnuke

is there any way to completely disable ADAM in 2sxc?
or at least hide everything related to it?
I don't want the users to use it or even to ask me what is it , I completely prefer to use the old traditional way of managing files.
Thanks

This works for me to remove all Adam field hints:
var dropzone = document.getElementsByClassName('dropzone');
for (i = 0; i < dropzone.length; i++) {
var input = dropzone[i].getElementsByTagName('input');
input[0].removeAttribute("uib-tooltip");
var hint = dropzone[i].getElementsByTagName('adam-hint');
hint[0].remove();
}
Note the remove() function is DOM level 4 which may not be supported everywhere (https://catalin.red/removing-an-element-with-plain-javascript-remove-method/). You can do that with removeChild() also but you'll need to do a little more work to get the direct parent of the adam-hint.

Related

How do I store dynamically a movieclip in a array in Haxe/HTML5?

This is my code:
var buttons:Array<Dynamic> = new Array<Dynamic>();
var mc2:flash.display.MovieClip = new MovieClip();
mc2.graphics.beginFill(0xFF0000);
mc2.graphics.moveTo(50,50);
mc2.graphics.lineTo(100,50);
mc2.graphics.lineTo(100,100);
mc2.graphics.lineTo(50,100);
mc2.graphics.endFill();
buttons.push(addChild(mc2));
buttons[0].x = 1000;
And my question is why this work in Flash but not work in HTML5 when I compile it? How do I solve the problem?
The last line “buttons[0].x = 1000;” is not working in HTML5… :/
Sorry for my english...
Because you use in "flash.display.MovieClip" class that does not available from HTML5.
In Haxe, if you use in class that belongs to specific target (like MovieClip) you can compile it only to that target.
Maybe you will found OpenFl library useful, It's library that let you develop with Flash API and target to almost any device(and also for HTML5) from same base code!
see Here for more
Are you using a framework?
Maybe it works if you split the addChild and the push into separate lines? Not sure if addChild returns a MovieClip?
Otherwise, try to trace the array trace(buttons) and observe the browser console.

How to configure generate.py pretty to not break apart comments

How do I configure the generate.py pretty to stop breaking apart comments like this:
// this is a comment
// var a = 10;
after running the generator this becomes:
// this is a comment
// var a = 10;
I can't seem to track down how to stop this in the documentation. Thanks for your help in advance!
Currently, this behavior is not customizable through the config. You either use block comments for those cases, or hack the Python code (I can give you pointers if you want).
In any case you may want to open an enhancement bug for this.

Trouble referencing movieClips

I am working on a flash project that dynamically generates navigation from an XML. For now I am trying to get it to work with arrays so that I can adapt it to xml once I know the logic works. I am new to as3 and learning has been a tiny bit bumpy. I have been searching for a solution to this but many of the examples I have seen have either been too simple to answer my question or too complex to understand since I am on the new side. This is the code I am working with.
var clientList:Array = new Array("Client1","Client2","Client3","Client4","Client5","Client6","Client7","Client8","Client9","Client10","Client11","Client12","Client13","Client14","Client15");
for each (var cName in clientList){
var newClientBtn:btnClientNav = new btnClientNav();
newClientBtn.x = workX;
newClientBtn.y = workY;
workY += newClientBtn.height;
newClientBtn.mcClientName.text = cName;
lContent.mcWork.addChild(newClientBtn.name);
trace(newClientBtn);
}
I can't fingure out how to properly refernce the dynamically created clips. I have a dynamic text box in the button but can't figure out how to reference it properly to change it, then my next issue will be referencing the buttons to make rollover and click code. I know this probably something simple to fix but I have been looking at it for too long and my eyes are starting to cross.. Thank you in advance for any advice you can give.
Why not store the clips you are creating in an object you can access later?
If you want to reference a movie clip by name though, one way to do it is:
var referenceMC:MovieClip = MovieClip(containerMC.getChildByName(“targetMC”));
If it was a text field or a button you were after, I believe you would do the same but instead cast the result of getChildByName to your desired control.
I also believe you want to add the button itself as a child, not pass its name into your addChild call?

Unset all css, and add a single css for custom independent template at drupal 7

Ho do you unset all css core, contrib, theme, and then add a single custom CSS file for a single special page--special.tpl.php at drupal 7?
I tried using hook_css_alter, but I can not get it to work so far.
function mytheme_css_alter(&$css) {
$alias = drupal_get_path_alias($_GET['q']);
$parts = explode('/', $alias);
if ($parts[0] == 'special') {
unset($css);
}
}
I know there is a simple way to do it by commenting $styles at html.tpl.php, but maybe there is a better solution so I don't have to create different html.tpl file.
Any hint would be very much appreciated. Thanks
Your code works for me if I change the line unset($css); to $css = array();
I'm not an expert php programmer so I'm not sure if this is bad convention but clearing the array by overwriting it with a blank one seems to work.

EXTJS - How to verify if element exists?

I need to know if a boxComponent exists in a ext formPanel in order to take some actions... Is there some way to know that?
something like this:
if(getElementById("boxId") != 'undefined' ){
alert('exists');
}
The common pattern that most people use is this:
var myBoxCmp = Ext.getCmp('cmpId');
if(myBoxCmp){
myBoxCmp.doSomething();
}
Same thing for Elements:
var el = Ext.get('elId');
if(el){
el.doSomething();
}
You can also use methods like Container.findById, but if you have an id (assuming it is unique, which it should be) just use getCmp.
EDIT: Several years have passed since this original answer, and nowadays getCmp is generally frowned upon as a code smell and should typically be avoided in applications (promotes global references, which generally indicate poor design when they are required). It's typically better to use controller references (if using MVC) or the various ComponentQuery or Container methods to reference related components (e.g. down, child, getComponent, etc.)
I just do it the extjs way and i prefer not to use getElementById() which is a native js method and may cause incompatibility issues in diffrenet browsers:
if (!Ext.getCmp('componentid')) {
alert('boxId is empty');
}
You can use Ext.get('boxId'). It returns null if the object doesn't exist and returns an Ext.Element object.
Using getElementById would probably be much faster though. Do you have any specific objection against it?
Use the Ext.isEmpty(object) method.
if(Ext.isEmpty(getElementById("boxId")) {
alert('boxId is empty');
}
function openView(cid) {
shortName = cid.substr(cid.lastIndexOf(".")+1, cid.length);
if(Ext.get(shortName) == null) Ext.create(cid);
Ext.Viewport.setActiveItem(Ext.getCmp(shortName));
}
This function opens a view like
openView('MyApp.view.Oeffnungszeiten');
and if the View exists it accesses the old instance

Resources