working on it ...

Filters

Explore Public Snippets

Sort by

Found 964 snippets matching: modal

    public by sTiLL-iLL  3359  1  7  19

    Dialog tag example

    Dialog tag example: dilogSnippet.html
    <dialog>
      <p>This is da dialog!</p>
      <button id="close">Close</button>
    </dialog>
    <button id="show">Open Dialog!</button>
    <script>
      var dialog = document.querySelector('dialog');
      document.querySelector('#show').onclick = function() {
        dialog.show();
      };
      document.querySelector('#close').onclick = function() {
        dialog.close();
      };
    </script>
    
    
    

    public by zer00ne  3492  15  6  0

    Modal Iframe

    http://stackoverflow.com/a/34611625/2813224
    <!doctype html>
    <html>
    
    <head>
      <meta charset="utf-8">
      <title>Modal Iframe</title>
      <style>
        html,
        body {
          box-sizing: border-box;
          font: 400 16px/1.45 "Verdana";
          height: 100vh;
          width: 100vw;
        }
        *,
        *:before,
        *:after {
          box-sizing: inherit;
          margin: 0;
          padding: 0;
          border: 0 none hlsa(0%, 0, 0, 0);
          outline: 0 none hlsa(0%, 0, 0, 0);
        }
        body {
          position: relative;
          background-color: #111;
          color: #EEE;
          padding: 10px;
        }
        #overlay {
          display: none;
          position: relative;
          left: 0;
          top: 0;
          width: 101vw;
          height: 101vh;
          text-align: center;
          z-index: 1111;
        }
        #overlay section {
          position: relative;
          top: 0;
          left: 0;
          width: 640px;
          height: 360px;
          margin: 10px auto;
          background-color: #fff;
          border: 1px solid yellow;
          border-radius: 8px;
          padding: 15px;
          text-align: center;
        }
        #test {
          position: absolute;
          top: 25%;
          left: 25%;
          width: 128px;
          height: 48px;
          border-radius: 8px;
          border: 1px outset yellow;
          font-size: 1.2rem;
          font-variant: small-caps;
          color: yellow;
          background: #222;
          cursor: pointer;
        }
      </style>
    </head>
    
    <body>
      <button id="test">Test Modal</button>
      <aside id="overlay">
        <section>
          <iframe id="iFrame" name="iFrame" src="http://example.com/" frameborder="0" scrolling="no"></iframe>
        </section>
      </aside>
      <script>
        document.getElementById('test').addEventListener('click', modal, false);
    
        function modal() {
          var ov = document.getElementById("overlay");
          ov.style.display = (ov.style.display == "block") ? "none" : "block";
        }
      </script>
    </body>
    
    </html>
    

    public by jlappano  1430  0  2  0

    Init remote modal

            <!-- Describes this modal header -->
            <div class="modal fade" id=“my-specific-id” tabindex="-1" role="dialog" aria-hidden="true" data-remote="{{ path(‘my_path_route’, {‘stub’: value}) }}">
                <div class="modal-dialog modal-settings">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-fw fa-times"></i></button>
                            <h1 class="modal-title">Modal Title<i class="loading fa fa-refresh fa-spin"></i></h1>
                        </div>
                        <div class="modal-body">
           			 <!-- Leave the Body Blank -->
    		   </div>
                    </div>
                </div>
            </div>

    public by msdn  159451  0  7  0

    Add: Opens ModalWindow to edit a newly created object

    Opens ModalWindow to edit a newly created object The type of the Object to edit The type of the Object.DetailClass The Screen object calling the extension method The newly created object
    using System;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Ink;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;
    using Base.SL.Contracts;
    using Microsoft.LightSwitch.Framework.Base;
    using Microsoft.LightSwitch.Details.Framework.Base;
    using Microsoft.LightSwitch.Presentation.Extensions;
    using Microsoft.LightSwitch.Client;
    using Microsoft.LightSwitch.Presentation;
    using Microsoft.LightSwitch.Presentation.Implementation;
    using System.Reflection;
    using Microsoft.LightSwitch.Runtime.Shell.Framework;
    
    /// <summary>
    /// Opens ModalWindow to edit a newly created object
    /// </summary>
    /// <typeparam name="TEntity">The type of the Object to edit</typeparam>
    /// <typeparam name="TDetails">The type of the Object.DetailClass</typeparam>
    /// <param name="screen">The Screen object calling the extension method</param>
    /// <param name="newObject">The newly created object</param>
    public static void Add<TEntity, TDetails>(this IScreenWithListAndCurrentObject<TEntity, TDetails> screen, TEntity newObject)
        where TEntity : EntityObject<TEntity, TDetails>
        where TDetails : EntityDetails<TEntity, TDetails>, new()
    {
        screen.CurrentObject = newObject;
        ShowModalWindow(screen);
    }

    public by msdn  1340  1  6  0

    CanSubmitModal: Called to check if the modal window can submit the changes made.

    Called to check if the modal window can submit the changes made. The type of the Object to edit The type of the Object.DetailClass The Screen object calling the extension method True if not validation issues exits. False otherwise
    using System;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Ink;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;
    using Base.SL.Contracts;
    using Microsoft.LightSwitch.Framework.Base;
    using Microsoft.LightSwitch.Details.Framework.Base;
    using Microsoft.LightSwitch.Presentation.Extensions;
    using Microsoft.LightSwitch.Client;
    using Microsoft.LightSwitch.Presentation;
    using Microsoft.LightSwitch.Presentation.Implementation;
    using System.Reflection;
    using Microsoft.LightSwitch.Runtime.Shell.Framework;
    
    /// <summary>
    /// Called to check if the modal window can submit the changes made.
    /// </summary>
    /// <typeparam name="TEntity">The type of the Object to edit</typeparam>
    /// <typeparam name="TDetails">The type of the Object.DetailClass</typeparam>
    /// <param name="screen">The Screen object calling the extension method</param>
    /// <returns>True if not validation issues exits. False otherwise</returns>
    public static bool CanSubmitModal<TEntity, TDetails>(this IScreenWithListAndCurrentObject<TEntity, TDetails> screen)
        where TEntity : EntityObject<TEntity, TDetails>
        where TDetails : EntityDetails<TEntity, TDetails>, new()
    {
        // Check to see if Screen.CurrentObject has validation issues pending
        return screen.CurrentObject.CanSubmit();
    }

    public by msdn  1571  0  6  0

    ModalWindowSubmit: Called when ModalWindow needs to close and keep changes.

    Called when ModalWindow needs to close and keep changes. The type of the Object to edit The type of the Object.DetailClass The Screen object calling the extension method
    using System;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Ink;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;
    using Base.SL.Contracts;
    using Microsoft.LightSwitch.Framework.Base;
    using Microsoft.LightSwitch.Details.Framework.Base;
    using Microsoft.LightSwitch.Presentation.Extensions;
    using Microsoft.LightSwitch.Client;
    using Microsoft.LightSwitch.Presentation;
    using Microsoft.LightSwitch.Presentation.Implementation;
    using System.Reflection;
    using Microsoft.LightSwitch.Runtime.Shell.Framework;
    
    /// <summary>
    /// Called when ModalWindow needs to close and keep changes.
    /// </summary>
    /// <typeparam name="TEntity">The type of the Object to edit</typeparam>
    /// <typeparam name="TDetails">The type of the Object.DetailClass</typeparam>
    /// <param name="screen">The Screen object calling the extension method</param>
    public static void ModalWindowSubmit<TEntity, TDetails>(this IScreenWithListAndCurrentObject<TEntity, TDetails> screen)
        where TEntity : EntityObject<TEntity, TDetails>
        where TDetails : EntityDetails<TEntity, TDetails>, new()
    {
        // Special care taken for the case that Validation has not been performed yet for the last field edited.
        // If Validation issues exist that window will not close.
        if (screen.CurrentObject.CanSubmit())
            CloseChildWindow(screen);
    }

    public by msdn  1345  0  6  0

    ModalWindowCancel: Called when ModalWindow needs to close and discard changes.

    Called when ModalWindow needs to close and discard changes. The type of the Object to edit The type of the Object.DetailClass The Screen object calling the extension method
    using System;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Ink;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;
    using Base.SL.Contracts;
    using Microsoft.LightSwitch.Framework.Base;
    using Microsoft.LightSwitch.Details.Framework.Base;
    using Microsoft.LightSwitch.Presentation.Extensions;
    using Microsoft.LightSwitch.Client;
    using Microsoft.LightSwitch.Presentation;
    using Microsoft.LightSwitch.Presentation.Implementation;
    using System.Reflection;
    using Microsoft.LightSwitch.Runtime.Shell.Framework;
    
    /// <summary>
    /// Called when ModalWindow needs to close and discard changes.
    /// </summary>
    /// <typeparam name="TEntity">The type of the Object to edit</typeparam>
    /// <typeparam name="TDetails">The type of the Object.DetailClass</typeparam>
    /// <param name="screen">The Screen object calling the extension method</param>
    public static void ModalWindowCancel<TEntity, TDetails>(this IScreenWithListAndCurrentObject<TEntity, TDetails> screen)
        where TEntity : EntityObject<TEntity, TDetails>
        where TDetails : EntityDetails<TEntity, TDetails>, new()
    {
        CloseChildWindow(screen);
        CancelModalWindowChanges(screen);
        // Make sure CurrentObject of the screen is valid in case of canceling a newly created object.
        screen.CurrentObject = screen.ObjectList.SelectedItem;
    }

    public by msdn  2064  1  6  0

    ShowModalWindow: Display the Screen's ModalWindow for editing a new or existing object.

    Display the Screen's ModalWindow for editing a new or existing object. The type of the Object to edit The type of the Object.DetailClass The Screen object calling the extension method
    using System;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Ink;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;
    using Base.SL.Contracts;
    using Microsoft.LightSwitch.Framework.Base;
    using Microsoft.LightSwitch.Details.Framework.Base;
    using Microsoft.LightSwitch.Presentation.Extensions;
    using Microsoft.LightSwitch.Client;
    using Microsoft.LightSwitch.Presentation;
    using Microsoft.LightSwitch.Presentation.Implementation;
    using System.Reflection;
    using Microsoft.LightSwitch.Runtime.Shell.Framework;
    
    /// <summary>
    /// Event Handler attached to the IContentItemProxy of the Screen representing the ModalWindow to display. It is attached to the IContentItemProxy.ControlAvailable event
    /// </summary>
    /// <remarks>This implementation is using one static delegate. This is because we take for granted that only one modal window is visible and manipulated at any time.
    /// If this is not the case, we need to handle somehow concurrency issues in the method implementing the delegate.</remarks>
    private static EventHandler<ControlAvailableEventArgs> childWindowAvailableHandler = new EventHandler<ControlAvailableEventArgs>(ChildWindowIsAvailable);
    
    /// <summary>
    /// Display the Screen's ModalWindow for editing a new or existing object.
    /// </summary>
    /// <typeparam name="TEntity">The type of the Object to edit</typeparam>
    /// <typeparam name="TDetails">The type of the Object.DetailClass</typeparam>
    /// <param name="screen">The Screen object calling the extension method</param>
    private static void ShowModalWindow<TEntity, TDetails>(this IScreenWithListAndCurrentObject<TEntity, TDetails> screen)
        where TEntity : EntityObject<TEntity, TDetails>
        where TDetails : EntityDetails<TEntity, TDetails>, new()
    {
        (screen as IScreenObject).OpenModalWindow(screen.ModalWindowName);
        (screen as IScreenObject).FindControl(screen.ModalWindowName).ControlAvailable += childWindowAvailableHandler;
    }

    public by msdn  1596  0  7  0

    Edit: Opens ModalWindow to edit an existing object

    Opens ModalWindow to edit an existing object The type of the Object to edit The type of the Object.DetailClass The Screen object calling the extension method If true sets CurrentObject property of the Screen to Screen.ObjectList.SelectedItem. Added for flexibility so the developer can either handle Concurrency of CurrentObject explicilty o
    using System;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Ink;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;
    using Base.SL.Contracts;
    using Microsoft.LightSwitch.Framework.Base;
    using Microsoft.LightSwitch.Details.Framework.Base;
    using Microsoft.LightSwitch.Presentation.Extensions;
    using Microsoft.LightSwitch.Client;
    using Microsoft.LightSwitch.Presentation;
    using Microsoft.LightSwitch.Presentation.Implementation;
    using System.Reflection;
    using Microsoft.LightSwitch.Runtime.Shell.Framework;
    
    /// <summary>
    /// Opens ModalWindow to edit an existing object
    /// </summary>
    /// <typeparam name="TEntity">The type of the Object to edit</typeparam>
    /// <typeparam name="TDetails">The type of the Object.DetailClass</typeparam>
    /// <param name="screen">The Screen object calling the extension method</param>
    /// <param name="updateCurrentObject">If true sets CurrentObject property of the Screen to Screen.ObjectList.SelectedItem.
    /// Added for flexibility so the developer can either handle Concurrency of CurrentObject explicilty or let the extension method do the default action </param>
    public static void Edit<TEntity, TDetails>(this IScreenWithListAndCurrentObject<TEntity, TDetails> screen, bool updateCurrentObject)
        where TEntity : EntityObject<TEntity, TDetails>
        where TDetails : EntityDetails<TEntity, TDetails>, new()
    {
        if (updateCurrentObject)
            screen.CurrentObject = screen.ObjectList.SelectedItem;
        ShowModalWindow(screen);
    }

    public by msdn  1241  0  5  0

    CloseChildWindow: Called to close the ModalWindow, either submiting or canceling changes

    Called to close the ModalWindow, either submiting or canceling changes The type of the Object to edit The type of the Object.DetailClass The Screen object calling the extension method
    using System;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Ink;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;
    using Base.SL.Contracts;
    using Microsoft.LightSwitch.Framework.Base;
    using Microsoft.LightSwitch.Details.Framework.Base;
    using Microsoft.LightSwitch.Presentation.Extensions;
    using Microsoft.LightSwitch.Client;
    using Microsoft.LightSwitch.Presentation;
    using Microsoft.LightSwitch.Presentation.Implementation;
    using System.Reflection;
    using Microsoft.LightSwitch.Runtime.Shell.Framework;
    
    /// <summary>
    /// Called to close the ModalWindow, either submiting or canceling changes
    /// </summary>
    /// <typeparam name="TEntity">The type of the Object to edit</typeparam>
    /// <typeparam name="TDetails">The type of the Object.DetailClass</typeparam>
    /// <param name="screen">The Screen object calling the extension method</param>
    private static void CloseChildWindow<TEntity, TDetails>(IScreenWithListAndCurrentObject<TEntity, TDetails> screen)
        where TEntity : EntityObject<TEntity, TDetails>
        where TDetails : EntityDetails<TEntity, TDetails>, new()
    {
        screen.CloseModalWindow(screen.ModalWindowName);
        screen.FindControl(screen.ModalWindowName).IsVisible = false;
    }
    • Public Snippets
    • Channels Snippets