Git Product home page Git Product logo

layout's Introduction

jQuery UI Layout

Known Vulnerabilities

1.8.5

  • Default masking and iframefix to false, allow switching usage to either

    Can be applied per pane as well

    $().layout({draggableIframeFix:true,mask:false});
    $().layout({draggableIframeFix:false,mask:true});
    

    Applicable demo : layout_inside_dialog

1.8.4

  • Allows custom storage co-ordinates using Persist.JS
  • Updated Persist.JS to use HTML 5 cookie detection
  • Create NPM coordinates layout-jquery3

1.7.5

  • Update to JQuery 3.5.1
  • Add JQuery Migrate 3.3
  • A few more smaller fixes
  • Prep for the .css() update as brought up by @Melloware

1.7.1

  • Update to JQuery 3.5
  • Add JQuery Migrate 3.2
  • Fix deprecation warnings

1.7.0

@rsprinkle Add AMD Support,

@alexsielicki Fixing issue with running under webpack with jQuery 3.3.1 and jQuery Migrate plugin

Version bump for identification into AMD

1.6.0 - 1.6.3

  • Added addSlideToggle methods and addSlideToggleBtn utility
  • unbind() to off()

1.5.12.2 - 1.6.0

  • Updated responsive features to be more dynamic with size control and dynamic construction variations.
  • Updated the demo pages to reflect a true representation of JQuery 3 and JQuery UI 1.12
  • Allows for elements to be specified as toggle contents as well as the pre-existing html. These elements are moved to the toggle location and various classes are applied in the default manner.

1.4.4 - 1.5.12

  • **Responsiveness added directly to pane options. Use with .addToggle() to add a button to show in a certain state
  • **JQuery 3 Full Compatibility. Updated to use on instead of bind, remove the incompatible line from other post
  • **Bootstrap Compatibility. Updated to fully support drown downs and others easily
  • **Removed default demo page theming. Allows for full styling from a blank canvas in the css file
  • **resizeJQuery function that runs all 3 (Accordion, Tab, Datatable) in a single call to onresize_end
  • **Fixed bug where onResizeEnd would fail on resize if no function was supplied

The Ultimate Page Layout Manager

This widget was inspired by the extJS border-layout, and recreates that functionality in a jQuery plug-in. The Layout plug-in can create any UI look you want - from simple headers or sidebars, to a complex application with toolbars, menus, help-panels, status bars, sub-forms, etc.

Combined it with other jQuery UI widgets to create a sophisticated application. There are no limitations or issues - this widget is ready for production use. If you create a good looking application using UI Layout, please let us know.

Highlights

  • simple yet powerful"- syntax is easy to learn
  • unlimited layout capabilities: 5 regions per layout - unlimited nesting
  • dozens of options: every aspect is customizable, globally and by region
  • total CSS control: dozens of auto-generated classes create ANY UI look
  • extensible: callbacks, methods, and special utilities provide total control
  • custom buttons: integrates with your own buttons for a custom UI look
  • collapsable: each pane can be closed, using any UI animation you want
  • hidable: panes can be completely hidden, either on startup or at any time
  • resizable: each pane can be resized, within automatic or specified limits
  • slidable: panes can also 'slide open' for temporary access
  • headers & footers: each region has unlimited headers or footers
  • hotkeys: can use the cursor-keys and/or define custom hotkeys
  • use any elements: use divs, iframes or any elements you want as a 'pane'
  • compatible with UI widgets: integrates with jQuery widgets and plug-ins
  • demo mode: set applyDefaultStyles option for a fully functional layout
  • and MORE: see the documentation and demos

History & Future

UI Layout was created 8 years ago as an enhancement to the borderLayout widget. Sourcecode was transferred to GitHub, which also allowed it to be re-registered on the jQuery plugins site. You can find Layout on the jQuery site at: http://plugins.jquery.com/layout

Documentation and other information is being updated for the latest version and will be migrated to GitHub. In the meantime you can find information and demos on the widget's old website and in its forum...

More information will be added here soon. This is just to get the migration process started...

/Kevin

layout's People

Contributors

alexsielicki avatar allpro avatar gedmarc avatar melloware avatar rsprinkle avatar snyk-bot avatar solodyagin avatar steveorevo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

layout's Issues

JQMIGRATE 3.3

They updated JQMIGRATE and they added once which is kind of a pain in the butt and I wasn't sure if Layout was effected.

https://github.com/jquery/jquery-migrate/blob/master/warnings.md#jqmigrate-use-of-number-typed-values-is-deprecated-in-jqueryfncss

Basically if you do .css('opacity', 0); you can't do that now. No NUMBER values can be passed to the CSS attribute only strings so either .css('opacity', '0'); or .css('opacity', String(0));

I know you do some generic CSS handling in Layout so wasn't sure if it was affected or not but thought i would report!

Host on CDN? Merge with upstream?

Thank you for improving the base library. It has allowed me to move an application to jQuery 3 successfully!

But a small problem is that the various JavaScript CDNs are only hosting the "original" outdated jQuery Layout plugin, and this includes the official jQuery site. I made an effort to add your library to cdnjs, but it didn't fit within their rules.

I'm hoping we can find a solution to this. Perhaps to host on an alternate CDN? Or, if your code can be merged upstream with the original jQuery Layout plugin, then we won't have this duality. Any thoughts?

The latest version 1.9.0 is still stable?

@GedMarc Hi, firstly thank you for your elegant and useful library. It's very helpful to our team.
I noticed that some code was commited to upgrade jquery from 3.6.0 to 3.6.1 on September 17, 2022.
Will a new major version be released? Is the latest version 1.9.0 still stable?

Resize Bar issue when loading JS file dynamically

We are currently migrating source code to reactjs.

While migrating, we removed jQuery related resources(js, css, library files) from index.html and moved to js file(view component).

And we had to import those files dynamically, at this time we use code like below.

const linkTag = document.createElement('link');
linkTag.href = 'http://localhost:8888/ips-eng/lib/jQuery-UI-Layout/layout-default.min.css';
linkTag.rel = 'stylesheet';
linkTag.type = 'text/css';
document.head.appendChild(linkTag);
const scriptTag = document.createElement('script');
scriptTag.src = 'http://localhost:8888/ips-eng/lib/jQuery-UI-Layout/jquery.layout_and_plugins.min.js';
document.head.appendChild(scriptTag);

Everything works fine, except Resize Bar cursor is not showing if you hover on the element, and if you drag the bar it won't resize the panels.

I tried to install this library from npm, but I don't know how to(couldn't find the package from npm).

I even tried to import directly from the js file, but webpack shows errors while compiling. (see below)

// index.tsx
import './resources/lib/jQuery-UI-Layout/layout-default.min.css'
import './resources/lib/jQuery-UI-Layout/jquery.layout_and_plugins.min.js'
Compiling...
Failed to compile.

src\resources\lib\jQuery-UI-Layout\jquery.layout_and_plugins.min.js
  Line 1:45:     'define' is not defined                                                no-undef
  Line 1:57:     'define' is not defined                                                no-undef
  Line 1:85:     'jQuery' is not defined                                                no-undef
  Line 1:7696:   'debugData' is not defined                                             no-undef
  Line 1:7752:   'debugData' is not defined                                             no-undef
  Line 1:17589:  Expected an assignment or function call and instead saw an expression  no-unused-expressions
  Line 1:17920:  'string' is not defined                                                no-undef
  Line 1:25056:  Unexpected use of 'self'                                               no-restricted-globals
  Line 1:81727:  's' is not defined                                                     no-undef
  Line 1:81766:  'ar' is not defined                                                    no-undef
  Line 1:81829:  'ar' is not defined                                                    no-undef
  Line 1:81850:  'ar' is not defined                                                    no-undef
  Line 1:81883:  's' is not defined                                                     no-undef
  Line 1:82128:  's' is not defined                                                     no-undef
  Line 1:83915:  'parse' is not defined                                                 no-undef
  Line 1:88224:  'state' is not defined                                                 no-undef
  Line 1:89861:  Unexpected use of 'screen'                                             no-restricted-globals

The only way I can make it work is to put jQuery, jQuery UI, jQuery UI Layout to index.html.

I hope it works with dynamic loading.

Updated docs site?

Is there an updated version of the docs site that goes along with this fork? This forum post seems to indicate that Kevin had granted update rights, but I'm not finding any updated docs or merges into the official repo.

Cookie Warning Still?

Using 1.8.3 in Firefox I have verified my settings are getting stored in Local Storage but I am still getting this warning in Firefox from layout.js....

Cookie “EC_TEST” will be soon rejected because it has the “sameSite” attribute set to “none” or an invalid value, without the “secure” attribute. To know more about the “sameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite

Can you verify you are still creating cookie even though I have storageLocation: 'localStorage' ???

AMD Module

Would you accept a patch to convert this to a loadable module? AMD, CommonJS, etc...

Move to jQuery 3.

Update code to only support browsers supported by jQuery 3. This means dropping support for IE6-8.

If this is considered desirable I am willing to begin submitting changes removing deprecated jQuery features.

$.isArray is deprecated

jquery-migrate-3.2.0.js:102 JQMIGRATE: jQuery.isArray is deprecated; use Array.isArray

When running JqMigrate gettting this warning on Layout.

Hope all is well!

Sorry forgot to mention using latest JQMigrate 3.2.0

Use jQuery UI Draggable iframeFix instead of maskContents?

Hi, firstly thank you for maintaining this really useful library.

The following line (dating back 6+ years) disables jQuery UI Draggable's iframeFix option and says "TODO: consider using when bug is fixed":

//, iframeFix: o.draggableIframeFix // TODO: consider using when bug is fixed

I've tested using the iframeFix option (instead of maskContents) and it seems to work fine for layouts with iframes in current Chrome, Firefox, Edge & IE 11 (actually it seems to work better than maskContents because it fixes a problem I occasionally see where the drag doesn't always start when dragging from the edge of the slider).

I'm not sure what bug it was referring to, but maybe it has been fixed now. Is there any reason why maskContents can't be replaced with Draggable's iframeFix?

Remove IE Support

IE is dead as of June 15, 2022 so you can remove all the isIE and browser.isIE6 hacks in the code!

Jquery Cookie Still Included?

I just debugged a crazy PF issue. I am using PrimeFaces.getCookie() which uses $.cookie which PF includes jquery.Cookie plugin.

However since layout.js loads aftre its loading your version of Jquery Cookie which looks like is old and has a bug in it.

Now that you are using Persist JS in this plugin can the old jquery cookie plugin be removed from the distribution of layout.js?

EncodeJSON/DecodeJSON

It looks like you removed these methods somewhere along the way but PF Extensions uses them.

            /**
             * Stringify a JSON hash so can save in a cookie or db-field
             */
            , encodeJSON: function (json) {
                var local = window.JSON || {};
                return (local.stringify || stringify)(json);

                function stringify(h) {
                    var D = [], i = 0, k, v, t // k = key, v = value
                        , a = $.isArray(h)
                    ;
                    for (k in h) {
                        v = h[k];
                        t = typeof v;
                        if (t == 'string')  // STRING - add quotes
                            v = '"' + v + '"';
                        else if (t == 'object') // SUB-KEY - recurse into it
                            v = parse(v);
                        D[i++] = (!a ? '"' + k + '":' : '') + v;
                    }
                    return (a ? '[' : '{') + D.join(',') + (a ? ']' : '}');
                }
            }

            /**
             * Convert stringified JSON back to a hash object
             * @see  $.parseJSON(), adding in jQuery 1.4.1
             */
            , decodeJSON: function (str) {
                try {
                    return JSON.parse(str);
                } catch (e) {
                    return {};
                }
            }

Weird behavior in IE

image

If I set a border on .ui-layout-pane, the resizer position is being placed wrongly. left position should be -2px from the result.

This is stylesheet which makes the problem.

.ui-layout-pane {
    border: 1px solid #BBB;
}

It is showing correctly in Chrome, but IE11 is showing weirdly, but If I drag the resizer it showing fine again.

Saving state in nested layouts

I specify the layout like this:

$(".pane").layout({
	applyDefaultStyles: true,
	north: {minSize: 100, size: 300},
	north__childOptions: {
		applyDefaultStyles: true,
		west__minSize: 100,
		west__maxSize: 300,
		west__paneSelector: ".n-west",
		center__paneSelector: ".n-center",
	},
	stateManagement__enabled: true,
	stateManagement__includeChildren: true,  // this should already be by default
	center__paneSelector: ".c-pane",
	north__paneSelector: ".n-pane",
});

but only the top layout state gets saved. Am I doing anything wrong or is there a bug? If I put the stateManagement__enabled in the child options, then only this one would be saved and the top one wouldn't.
Edit: also the demo saved_state_nested.html is not saving the state.

Buggy on Chrome

The latest version works fine with IE but broke on Chrome.

What browser do you use to test?

Cookie: Use SameSite=Strict if secure

I use the client side cookie storage of Layout to remember my layout. The cookie needs to add SameSite=Strict and secure=true if the URL is HTTPS.

  1. We need to detect if the url is HTTPS

  2. If yes apply both secure=true and SameSite=Strict to the cookie.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.