Why button tag of matbuttonmodule in angular7 is not working? - button

My app.module.ts looks like this As you can see I have imported matbuttonmodule
In assignments.component.html file I have imported the button tag to print the "ADD ASSIGNMENT"
I wrote button tag
This is my output screen
Only the button tag is not displaying in the screen and I don't know what really gone wrong.
I tried to print the statement from button tag But it is not displaying .
not only with the tag
I have tried for this
Click!
Even this is not working..
Can anyone help me ..

Related

how to hide half the homepage with a show more button WORDPRESS

So I have been searching for a good plugin but was unable to find any - On the homepage of the WP website that I am working on, I want to hide half the page and want to add a button and in middle of the page at the end of the first half that would say "Show More" - When the visitor clicks that button, the rest of the page should show. The button would then go to the end of the page saying "Show Less". The page is static and is just some text and images, nothing complex.
You can do this putting a html block and writing:
<!--nextpage-->
you can read more about this on:
https://codex.wordpress.org/Styling_Page-Links
and to get other solutions you can try:
https://es.wordpress.org/plugins/automatically-paginate-posts/
https://es.wordpress.org/plugins/sgr-nextpage-titles/
https://es.wordpress.org/plugins/page-links-single-page-option/
I hope this will help you to get what you want.
You must create a div with css display none. And then in your html code put an element with a jquery behaviour to display the previously div created. It will be something like:
$(document).ready(function(){
$('#show_content_button').click(function(){
$(this).hide();
$('#content_hide_on_home').show();
});
$('#hide_content_button').click(function(){
$('#show_content_button').show();
$('#content_hide_on_home').hide();
});
});
#content_hide_on_home { display:none; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<p>Text on home</p>
Show content
<div id="content_hide_on_home">
Your extra content on home
Hide content
</div>
I hope this is what you're searching.

css hover menu stops working after Update Panel renders elements

I am using <ul> <li> menu on master page. For menu hover I am using csshover.htc file.
I am <updatepanel> on my child pages, but when I click on any link or button inside update panel, my menu stops working. i.e hover does not work. What can be solution for this?
You need to re-initialise your menu after your updatepanel has fired. In order to do this you need to include something like the following at the bottom of your page:
<script type="text/javascript">
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(CSSHover());‌
</script>
You will find the name of the function to be called at the top of your htc file - You will see something like this:
<public:attach event="ondocumentready" onevent="CSSHover()" />
The function that needs to be fired is the part in the onevent
I got updated htc file from here, and my issue was resolved..

Concrete5: How to open TinyMCE in a modal dialog from inside the custom block?

I'd like to open TinyMCE in a modal dialog from inside the custom block I am building. I know how to implement a modal dialog but couldn't figure out a way to integrate TinyMCE inside the dialog.
What I am trying to achieve is when a text is clicked in the block add/edit popup, it should open up a dialog with TinyMCE to edit that clicked text. Anyone done this before?
This is what I am trying to achieve in add/edit forms:
$this->addHeaderItem(Loader::helper('html')->javascript('tiny_mce/tiny_mce.js'));
Loader::element('editor_init');
Loader::element('editor_config');
Loader::element('editor_controls');
<textarea name="field-name" class="text-area-value ccm-input-textarea">Some text here or empty....</textarea>
$bt = BlockType::getByHandle('myblock');
<a class="dialog-launch ccm-block-type-inner"
dialog-on-close="ccm_blockWindowAfterClose()" dialog-append-buttons="true"
dialog-modal="false" dialog-width="500"
dialog-height="500" dialog-title="<?php echo t('Add/Edit Text)?>"
href="<?php echo $th->getBlockTypeToolsURL($bt); ?>/tinymce_dialog.php?text=<?php echo $text-area-value; ?>">
Edit the above text in TinyMCE
</a>
In tinymce_dialog.php in tools folder:
<textarea name="textarea-name"
class="ccm-input-textarea advancedEditor ccm-advanced-editor">
<?php echo $_GET['text']; ?>
</textarea>
<div class="ccm-buttons dialog-buttons">
<a href="javascript:void(0)" onClick="ccm_blockWindowClose();"
class="ccm-button-left btn">Cancel</a>
Ok
</div>
But I am unable to pass the value of textarea into the modal dialog popup. I tried using href in the anchor tag to pass the value of textarea to a script that resides in the tools folder but that does not seem to work either.
Edit: I've also added buttons in tinymce_dialog.php (See the code above). Not sure if it's possible to pass those buttons through <a dialog-on-close="ccm_blockWindowAfterClose()" dialog-append-buttons="true".....> in the form.
Should work the same as anywhere else. First, include this line of code once in your dialog (you only need it once, regardless of how many TinyMCE's you have):
<?php Loader::element('editor_config'); ?>
Then, for each TinyMCE you want, use this:
<?php Loader::element('editor_controls'); ?>
<textarea name="your-field-name" class="ccm-advanced-editor"></textarea>
There's two ways to go about this:
As you describe in your question edits, where you load a tools file. There are a few points here:
URLs aren't great for passing text data, especially the kind of text that'd be edited in tinymce (long and formatted). With that being said, it should work. I don't see why the $_GET wouldnt' work. Make sure that the URL contains the text in the first place (you can see by looking at your developer console).
Better is to pass an ID (tinymce_dialog?id=[ID]). This is assuming that the text is saved in the DB, but it looks like you might be providing them an interface to basically "wysiwyg edit in a modal text that they're not-wyswiwyg editing already". I'm not sure if you've thought through how this will work, though. By default, they'll have to deal with a bunch of HTML tags ?
The alternative is to create the dialog out of an DOM element. Create a div hidden in the form, with CSS display: none;, save the text into it (if already initialized, tinymce has a .update() or something), and then show the hidden div (with Example 3 from http://www.concrete5.org/documentation/how-tos/developers/javascript-jquery-and-concrete5/). When they click (SAVE), you can then (presumably) copy the data out of tinymce and put it back where it needs to go.
Note that in many cases, the tinymce initialize code only runs on page load. I think that's what Loader::element('editor_init') does. And it works by detecting the appropriate textareas (based on class name). So if the page with the editor_init is loaded before the textarea is loaded (such as how it looks now), you'll have to reinit tinymce. That's a vote for #2. In general, I suggest you go that route.

Preview codes of IFrame in JQuery dialog box

OK guys, I am making a basic text editor. I have an Iframe where the user will write their HTML codes. I am using JavaScript execommand for some WYSIWYG functions like Bold, Italic etc.. Everything is working fine like a BOSS.
I want to preview their codes what have written in a JQuery dialog box or open in a new window. I want to know if it is possible for this? We can do this with a textarea, but I am using IFrame here.
Here is my code Iframe:
<iframe name="code" id="code"></iframe>
Here is my DIV to preview the written code in the dialog box of JQuery UI:
<div id="preview"></div>
Here is my JavaScript code to preview in the dialog box of JQuery UI:
<script>
$(function() {
$( "#preview" ).dialog();
});
</script>
Of course, I just put the dialog box basic code, but how to preview the written codes from the IFrame to the dialog box? For example, if the user has written "Hello" in the Iframe in bold using CSS or HTML, the word "Hello" should be in bold in the dialog box when previewing. Also, can I know how to do the preview by opening in a new window as well?
Thank

How to click on Toolbar element with Sahi for Test Automation?

Web page contain a button with some text for example "Test". This button actually is a toolbar element. (class ="tbButton" id="id",text="Test") and redirects to a certain table when press on it.
When I tried to use the following click methods, the button did not react.
browser.div("Test").click();
browser.click("id");
browser.click("");
browser.div("id").click();
browser.byId("id").click();
browser.containsText(browser.byId("id"),"Test");
browser.div("Test").in(browser.table("Generar")).click();
browser.byXPath("//div/Test").click();
Could anybody suggest me an alternative methods that is able to resolve the above problem?
Try with:
browser.xy(browser.div("Test"), 10, 10).click();
This will click a little inside the div.

Resources