SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
Library of UI components
 http://prototype-ui.com
Who?
• Samuel Lebeau, http://i.gotfresh.info/
  French student, JS/Rails developer, prototype contributor.
  Change Class.extend to allow for superclass method resolution and remove Class.inherit. Closes
  #9274. [Samuel Lebeau]



• Juriy Zaytsev (kangax), http://thinkweb2.com/
  New York based JS developer, UI expert.

• Sébastien Gruhier, http://www.xilinus.com
  PWC creator, creator of many prototype-based open-source projects.

• Vincent Le Moign, http://www.webalys.com
  Designer.
Why?
• Prototype Window Class (PWC)
• Prototype Carousel
• Prototype Portal
• ...
• ‣And classcourse Prototype 1.6:
       of
   New       architecture (true inheritance)
  ‣ New event model
  ‣ ...
How?
• Same license as Prototype (MIT).
• ‣Same approach as Prototype:
    Subversion repository
 ‣ Functionals and unit tests
 ‣ Trac
 ‣ Core Team + contributions from community
How?
• Documentation (automatic with NaturalDocs)
  that can be installed locally
• Full distrib file or per component (will be
  available with first stable version)
• PackR integration (25Kb only)
• Active forum
Features
• Independent components
• Easy and fun to use
• Highly configurable
• Fully skinnable
• Coherent API and documentation
• Most of the methods are chainable
Components
• Core (Adds methods to String, Array, etc.)

• Window
• Carousel
• Shadow
• Dock (experimental)
• Context Menu (experimental)
Core
• Adds core level methods (DOM, String,
  Array, etc. )


• UI.Option class to handle options of all
  components easily.
Class.Methods
      Method aliasing sample
UI.Window.addMethods({
  methodsAdded: function(base) {
     base.aliasMethodChain('destroy', 'buttons');
  },
  destroyWithButtons: function() {
     this.buttons.stopObserving();
     this.destroyWithoutButtons();
  }
}
UI.Options
                 Before
Effect.DefaultOptions = {
  transition: Effect.Transitions.sinoidal,
  duration:   1.0,   // seconds
  fps:        100,   // 100= assume 66fps max.
  sync:       false, // true for combining
  from:       0.0,
  to:         1.0,
  delay:      0.0,
  queue:      'parallel'
}

initialize: function(element) {
  this.options = Object.extend(Object.extend({
    from: this.element.getOpacity() || 0.0,
    to:   1.0
  },Effect.DefaultOptions), options || {});
}
UI.Options
                After
UI.Window = Class.create(UI.Options, {
  // Options by default
  options: {
     theme:        null,
     id:           null,
     top:          null,
     left:         null,
     width:        200,
     height:       300
  },

    initialize: function(options) {
      this.setOptions(options);
    }
}
UI.Options
       And more!
UI.Window.optionsAccessor('top');

window.setTop(12);
// 12

window.getTop();
// => 12 (window.options.top)
Window
• Skinnable Design and Shadow


• Modal mode
• HTML and Ajax content
• All PWC options and more
Carousel
• Horizontal and Vertical



• Always 100% skinnable
Context Menu

• One more time: skinnable


• Uses Shadow class
Example
Let’s create a desktop behavior
Example
                                         Some includes
             <!-- Javascripts -->
             <script src=quot;../lib/prototype.jsquot; type=quot;text/javascriptquot;></script>
             <script src=quot;../lib/effects.jsquot;   type=quot;text/javascriptquot;></script>
             <script src=quot;../dist/window.jsquot;   type=quot;text/javascriptquot;></script>

             <!-- CSS -->
             <link href=quot;../themes/window/window.cssquot;     rel=quot;stylesheetquot; type=quot;text/cssquot;>
             <link href=quot;../themes/window/mac_os_x.cssquot;   rel=quot;stylesheetquot; type=quot;text/cssquot;>
             <link href=quot;../themes/shadow/mac_shadow.cssquot; rel=quot;stylesheetquot; type=quot;text/cssquot;>



                                   1
                           And 3 line of Javascript code!
<body>
  URL: <input type=quot;textquot; id=quot;urlquot;/>
       <input type=quot;buttonquot; value=quot;openquot; onclick=quot;openWindow()quot;/>

  <script type=quot;text/javascriptquot;>
    function openWindow() {
      new UI.URLWindow({url: $F('url'), theme: quot;mac_os_xquot;, shadow:true}).setHeader($F('url')).show().focus();
  
}

 </script>
</body>
Example
               Simplify creation code by using Option class
function openWindow() {

    new UI.URLWindow({url: $F('url'), theme: quot;mac_os_xquot;, shadow: true}).setHeader(url).show().focus();
}




              UI.Window.setOptions({theme: quot;mac_os_xquot;,
                                    shadow: true,
                                    top:    40,
                                    left:   100,
                                    width: 700,
                                    height: 400 });

              function openWindow() {

                  new UI.URLWindow({url: $F('url')}).setHeader($F('url')).show().focus();
              }
Example
Let’s create an desktop icon when closing a window
Example
                             Add action on hide

• Let's change default closing behavior from destroy to hide
           UI.Window.setOptions({theme: quot;mac_os_xquot;,
                                 shadow: true,
                                 top:    40,
                                 left:   100,
                                 width: 700,
                                 height: 400,
                                 close: quot;hidequot;
            });




• And add an event when a window is hidden
       function openWindow() {

           var win = new UI.URLWindow({url: $F('url')}).setHeader(url).show().focus();
           win.observe(quot;hiddenquot;, hideWindow);
       }
Example
                    Now the hideWindow function
function hideWindow(data) {
    var win = data.memo.window;

     // Create a icon on desktop
     var icon = new Element(quot;divquot;, {className: quot;iconquot;}).update(win.header.innerHTML);
     icon.observe(quot;dblclickquot;, function(){
         win.show();
         icon.remove();
     });
     document.body.appendChild(icon);
}


                          And some CSS for icon
                .icon {
                  position: absolute;
                  top: 40px;
                  left: 20px;
                  background: url(quot;safari.pngquot;) no-repeat top center;
                  width: 128px;
                  height: 64px;
                  text-align:center;
                  padding-top: 64px;
                  font-size: 12px;
                }
Example
                                  Ohter method

  Using addMethods toadd iconify to UI.Window class
UI.Window.addMethods({
  iconify: function() {
        var icon = new Element(quot;divquot;, {class: quot;iconquot;}).update(this.header.innerHTML);
        icon.observe(quot;dblclickquot;, function() {
            this.show();
            icon.remove();
        }.bind(this));

        this.hide();
        document.body.appendChild(icon);
    return this.fire('iconified');
  }
});
function openWindow() {
  var url = $('url').value;
  var win = new UI.URLWindow({url: url, close: 'iconify'}).setHeader(url).show().focus();
}
Full sample with icon dragging
UI.Window.setOptions({theme: quot;mac_os_xquot;, shadow: true, width:    700, height: 400, close:   quot;hidequot;});
var windowPosition = {top: 40, left: 100};

function hideWindow(data) {
    var win = data.memo.window;
    if (win.icon)
        win.icon.show();
    else {
      var pos = win.getPosition();

         // Create a icon on desktop at window position
         var style = 'top: #{top}px; left:#{left}px'.interpolate(pos);
         var icon = new Element(quot;divquot;, {className: quot;iconquot;, style: style})
         icon.update(win.header.innerHTML);

         // Observe double click to hide icon and show window
         icon.observe(quot;dblclickquot;, function(){
             win.show();
             icon.hide();
         });
         new Draggable(icon);
         document.body.appendChild(icon);
         win.icon = icon;
     }
}

function openWindow() {

     var win = new UI.URLWindow(Object.extend({url: $F('url')}, windowPosition)).setHeader(url).show().focus();
      win.observe(quot;hiddenquot;, hideWindow);
      windowPosition.top += 40;
      windowPosition.left += 40;
}
Next
• Stable version
• More tests, more documentation and more
  demos
• Custom builds
• Dialog class
• New components (portal, layout manager,
  tooltips ...)
• Questions?
• And see you soon on http://prototype-ui.com

Weitere ähnliche Inhalte

Was ist angesagt?

Processing and Processing.js
Processing and Processing.jsProcessing and Processing.js
Processing and Processing.jsjeresig
 
jQuery (BostonPHP)
jQuery (BostonPHP)jQuery (BostonPHP)
jQuery (BostonPHP)jeresig
 
Yearning jQuery
Yearning jQueryYearning jQuery
Yearning jQueryRemy Sharp
 
Building Single Page Apps with Backbone.js, Coffeescript and Rails 3.1
Building Single Page Apps with Backbone.js, Coffeescript and Rails 3.1Building Single Page Apps with Backbone.js, Coffeescript and Rails 3.1
Building Single Page Apps with Backbone.js, Coffeescript and Rails 3.1Vagmi Mudumbai
 
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJSJavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJSphilogb
 
JavaScript 1.5 to 2.0 (TomTom)
JavaScript 1.5 to 2.0 (TomTom)JavaScript 1.5 to 2.0 (TomTom)
JavaScript 1.5 to 2.0 (TomTom)jeresig
 
jQuery('#knowledge').appendTo('#you');
jQuery('#knowledge').appendTo('#you');jQuery('#knowledge').appendTo('#you');
jQuery('#knowledge').appendTo('#you');mikehostetler
 
Webgl para JavaScripters
Webgl para JavaScriptersWebgl para JavaScripters
Webgl para JavaScriptersgerbille
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCpootsbook
 
Clickable DIVs and other icebergs
Clickable DIVs and other icebergsClickable DIVs and other icebergs
Clickable DIVs and other icebergsBen Buchanan
 
Advanced jQuery
Advanced jQueryAdvanced jQuery
Advanced jQuerysergioafp
 
Reactive Type-safe WebComponents
Reactive Type-safe WebComponentsReactive Type-safe WebComponents
Reactive Type-safe WebComponentsMartin Hochel
 
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012YUI3 and AlloyUI Introduction for Pernambuco.JS 2012
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012Eduardo Lundgren
 
Creating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todayCreating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todaygerbille
 
Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using RoomNelson Glauber Leal
 
Introducing AlloyUI DiagramBuilder
Introducing AlloyUI DiagramBuilderIntroducing AlloyUI DiagramBuilder
Introducing AlloyUI DiagramBuilderEduardo Lundgren
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ EtsyNishan Subedi
 

Was ist angesagt? (20)

Processing and Processing.js
Processing and Processing.jsProcessing and Processing.js
Processing and Processing.js
 
jQuery (BostonPHP)
jQuery (BostonPHP)jQuery (BostonPHP)
jQuery (BostonPHP)
 
Yearning jQuery
Yearning jQueryYearning jQuery
Yearning jQuery
 
Building Single Page Apps with Backbone.js, Coffeescript and Rails 3.1
Building Single Page Apps with Backbone.js, Coffeescript and Rails 3.1Building Single Page Apps with Backbone.js, Coffeescript and Rails 3.1
Building Single Page Apps with Backbone.js, Coffeescript and Rails 3.1
 
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJSJavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
 
JavaScript 1.5 to 2.0 (TomTom)
JavaScript 1.5 to 2.0 (TomTom)JavaScript 1.5 to 2.0 (TomTom)
JavaScript 1.5 to 2.0 (TomTom)
 
JQuery UI
JQuery UIJQuery UI
JQuery UI
 
jQuery('#knowledge').appendTo('#you');
jQuery('#knowledge').appendTo('#you');jQuery('#knowledge').appendTo('#you');
jQuery('#knowledge').appendTo('#you');
 
Webgl para JavaScripters
Webgl para JavaScriptersWebgl para JavaScripters
Webgl para JavaScripters
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
 
Clickable DIVs and other icebergs
Clickable DIVs and other icebergsClickable DIVs and other icebergs
Clickable DIVs and other icebergs
 
Advanced jQuery
Advanced jQueryAdvanced jQuery
Advanced jQuery
 
Reactive Type-safe WebComponents
Reactive Type-safe WebComponentsReactive Type-safe WebComponents
Reactive Type-safe WebComponents
 
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012YUI3 and AlloyUI Introduction for Pernambuco.JS 2012
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012
 
Creating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todayCreating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of today
 
Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using Room
 
Introducing AlloyUI DiagramBuilder
Introducing AlloyUI DiagramBuilderIntroducing AlloyUI DiagramBuilder
Introducing AlloyUI DiagramBuilder
 
Seti 09
Seti 09Seti 09
Seti 09
 
Backbone - TDC 2011 Floripa
Backbone - TDC 2011 FloripaBackbone - TDC 2011 Floripa
Backbone - TDC 2011 Floripa
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ Etsy
 

Andere mochten auch

1998Narrativepgs02-22 auto nation
1998Narrativepgs02-22 auto nation1998Narrativepgs02-22 auto nation
1998Narrativepgs02-22 auto nationfinance14
 
QMUL @ MediaEval 2012: Social Event Detection in Collaborative Photo Collections
QMUL @ MediaEval 2012: Social Event Detection in Collaborative Photo CollectionsQMUL @ MediaEval 2012: Social Event Detection in Collaborative Photo Collections
QMUL @ MediaEval 2012: Social Event Detection in Collaborative Photo CollectionsMediaEval2012
 
Position paper Marijnissen Brussel
Position paper Marijnissen BrusselPosition paper Marijnissen Brussel
Position paper Marijnissen Brusselmarija
 
Towards Carfree Cities: The Technology Component (Michael Smith, NextBus)
Towards Carfree Cities: The Technology Component (Michael Smith, NextBus)Towards Carfree Cities: The Technology Component (Michael Smith, NextBus)
Towards Carfree Cities: The Technology Component (Michael Smith, NextBus)Joe Hughes
 

Andere mochten auch (7)

brechadigital
brechadigitalbrechadigital
brechadigital
 
Designing for mobile
Designing for mobileDesigning for mobile
Designing for mobile
 
1998Narrativepgs02-22 auto nation
1998Narrativepgs02-22 auto nation1998Narrativepgs02-22 auto nation
1998Narrativepgs02-22 auto nation
 
QMUL @ MediaEval 2012: Social Event Detection in Collaborative Photo Collections
QMUL @ MediaEval 2012: Social Event Detection in Collaborative Photo CollectionsQMUL @ MediaEval 2012: Social Event Detection in Collaborative Photo Collections
QMUL @ MediaEval 2012: Social Event Detection in Collaborative Photo Collections
 
Position paper Marijnissen Brussel
Position paper Marijnissen BrusselPosition paper Marijnissen Brussel
Position paper Marijnissen Brussel
 
Designers can Open Source
Designers can Open SourceDesigners can Open Source
Designers can Open Source
 
Towards Carfree Cities: The Technology Component (Michael Smith, NextBus)
Towards Carfree Cities: The Technology Component (Michael Smith, NextBus)Towards Carfree Cities: The Technology Component (Michael Smith, NextBus)
Towards Carfree Cities: The Technology Component (Michael Smith, NextBus)
 

Ähnlich wie Prototype UI

Writing Maintainable JavaScript
Writing Maintainable JavaScriptWriting Maintainable JavaScript
Writing Maintainable JavaScriptAndrew Dupont
 
Leaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGLLeaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGLgerbille
 
A test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobileA test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobileGlobalLogic Ukraine
 
Aplicacoes dinamicas Rails com Backbone
Aplicacoes dinamicas Rails com BackboneAplicacoes dinamicas Rails com Backbone
Aplicacoes dinamicas Rails com BackboneRafael Felix da Silva
 
Secrets of JavaScript Libraries
Secrets of JavaScript LibrariesSecrets of JavaScript Libraries
Secrets of JavaScript Librariesjeresig
 
HTML5 & The Open Web - at Nackademin
HTML5 & The Open Web -  at NackademinHTML5 & The Open Web -  at Nackademin
HTML5 & The Open Web - at NackademinRobert Nyman
 
CSS3 Takes on the World
CSS3 Takes on the WorldCSS3 Takes on the World
CSS3 Takes on the WorldJonathan Snook
 
Javascript Frameworks for Joomla
Javascript Frameworks for JoomlaJavascript Frameworks for Joomla
Javascript Frameworks for JoomlaLuke Summerfield
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoRob Bontekoe
 
Hack U - YUI - 2012 IIT Kharagpur
Hack U - YUI - 2012 IIT KharagpurHack U - YUI - 2012 IIT Kharagpur
Hack U - YUI - 2012 IIT KharagpurSumana Hariharan
 
Paris js extensions
Paris js extensionsParis js extensions
Paris js extensionserwanl
 
Building mobile web apps with Mobello
Building mobile web apps with MobelloBuilding mobile web apps with Mobello
Building mobile web apps with MobelloJeong-Geun Kim
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptGuy Royse
 
Single page webapps & javascript-testing
Single page webapps & javascript-testingSingle page webapps & javascript-testing
Single page webapps & javascript-testingsmontanari
 

Ähnlich wie Prototype UI (20)

Prototype UI Intro
Prototype UI IntroPrototype UI Intro
Prototype UI Intro
 
Writing Maintainable JavaScript
Writing Maintainable JavaScriptWriting Maintainable JavaScript
Writing Maintainable JavaScript
 
Leaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGLLeaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGL
 
A test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobileA test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobile
 
Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
J queryui
J queryuiJ queryui
J queryui
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
 
Aplicacoes dinamicas Rails com Backbone
Aplicacoes dinamicas Rails com BackboneAplicacoes dinamicas Rails com Backbone
Aplicacoes dinamicas Rails com Backbone
 
Secrets of JavaScript Libraries
Secrets of JavaScript LibrariesSecrets of JavaScript Libraries
Secrets of JavaScript Libraries
 
HTML5 & The Open Web - at Nackademin
HTML5 & The Open Web -  at NackademinHTML5 & The Open Web -  at Nackademin
HTML5 & The Open Web - at Nackademin
 
CSS3 Takes on the World
CSS3 Takes on the WorldCSS3 Takes on the World
CSS3 Takes on the World
 
Javascript Frameworks for Joomla
Javascript Frameworks for JoomlaJavascript Frameworks for Joomla
Javascript Frameworks for Joomla
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
 
Hack U - YUI - 2012 IIT Kharagpur
Hack U - YUI - 2012 IIT KharagpurHack U - YUI - 2012 IIT Kharagpur
Hack U - YUI - 2012 IIT Kharagpur
 
Paris js extensions
Paris js extensionsParis js extensions
Paris js extensions
 
Building mobile web apps with Mobello
Building mobile web apps with MobelloBuilding mobile web apps with Mobello
Building mobile web apps with Mobello
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
 
Single page webapps & javascript-testing
Single page webapps & javascript-testingSingle page webapps & javascript-testing
Single page webapps & javascript-testing
 
#JavaFX.forReal()
#JavaFX.forReal()#JavaFX.forReal()
#JavaFX.forReal()
 

Kürzlich hochgeladen

Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfalexjohnson7307
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهMohamed Sweelam
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
Navigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiNavigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiRaviKumarDaparthi
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
Microsoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfMicrosoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfOverkill Security
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)Wonjun Hwang
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...SOFTTECHHUB
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfAnubhavMangla3
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 

Kürzlich hochgeladen (20)

Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهله
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Navigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiNavigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi Daparthi
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Microsoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfMicrosoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdf
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 

Prototype UI

  • 1. Library of UI components http://prototype-ui.com
  • 2. Who? • Samuel Lebeau, http://i.gotfresh.info/ French student, JS/Rails developer, prototype contributor. Change Class.extend to allow for superclass method resolution and remove Class.inherit. Closes #9274. [Samuel Lebeau] • Juriy Zaytsev (kangax), http://thinkweb2.com/ New York based JS developer, UI expert. • Sébastien Gruhier, http://www.xilinus.com PWC creator, creator of many prototype-based open-source projects. • Vincent Le Moign, http://www.webalys.com Designer.
  • 3. Why? • Prototype Window Class (PWC) • Prototype Carousel • Prototype Portal • ... • ‣And classcourse Prototype 1.6: of New architecture (true inheritance) ‣ New event model ‣ ...
  • 4. How? • Same license as Prototype (MIT). • ‣Same approach as Prototype: Subversion repository ‣ Functionals and unit tests ‣ Trac ‣ Core Team + contributions from community
  • 5. How? • Documentation (automatic with NaturalDocs) that can be installed locally • Full distrib file or per component (will be available with first stable version) • PackR integration (25Kb only) • Active forum
  • 6. Features • Independent components • Easy and fun to use • Highly configurable • Fully skinnable • Coherent API and documentation • Most of the methods are chainable
  • 7. Components • Core (Adds methods to String, Array, etc.) • Window • Carousel • Shadow • Dock (experimental) • Context Menu (experimental)
  • 8. Core • Adds core level methods (DOM, String, Array, etc. ) • UI.Option class to handle options of all components easily.
  • 9. Class.Methods Method aliasing sample UI.Window.addMethods({ methodsAdded: function(base) { base.aliasMethodChain('destroy', 'buttons'); }, destroyWithButtons: function() { this.buttons.stopObserving(); this.destroyWithoutButtons(); } }
  • 10. UI.Options Before Effect.DefaultOptions = { transition: Effect.Transitions.sinoidal, duration: 1.0, // seconds fps: 100, // 100= assume 66fps max. sync: false, // true for combining from: 0.0, to: 1.0, delay: 0.0, queue: 'parallel' } initialize: function(element) { this.options = Object.extend(Object.extend({ from: this.element.getOpacity() || 0.0, to: 1.0 },Effect.DefaultOptions), options || {}); }
  • 11. UI.Options After UI.Window = Class.create(UI.Options, { // Options by default options: { theme: null, id: null, top: null, left: null, width: 200, height: 300 }, initialize: function(options) { this.setOptions(options); } }
  • 12. UI.Options And more! UI.Window.optionsAccessor('top'); window.setTop(12); // 12 window.getTop(); // => 12 (window.options.top)
  • 13. Window • Skinnable Design and Shadow • Modal mode • HTML and Ajax content • All PWC options and more
  • 14. Carousel • Horizontal and Vertical • Always 100% skinnable
  • 15. Context Menu • One more time: skinnable • Uses Shadow class
  • 16. Example Let’s create a desktop behavior
  • 17. Example Some includes <!-- Javascripts --> <script src=quot;../lib/prototype.jsquot; type=quot;text/javascriptquot;></script> <script src=quot;../lib/effects.jsquot; type=quot;text/javascriptquot;></script> <script src=quot;../dist/window.jsquot; type=quot;text/javascriptquot;></script> <!-- CSS --> <link href=quot;../themes/window/window.cssquot; rel=quot;stylesheetquot; type=quot;text/cssquot;> <link href=quot;../themes/window/mac_os_x.cssquot; rel=quot;stylesheetquot; type=quot;text/cssquot;> <link href=quot;../themes/shadow/mac_shadow.cssquot; rel=quot;stylesheetquot; type=quot;text/cssquot;> 1 And 3 line of Javascript code! <body> URL: <input type=quot;textquot; id=quot;urlquot;/> <input type=quot;buttonquot; value=quot;openquot; onclick=quot;openWindow()quot;/> <script type=quot;text/javascriptquot;> function openWindow() { new UI.URLWindow({url: $F('url'), theme: quot;mac_os_xquot;, shadow:true}).setHeader($F('url')).show().focus(); } </script> </body>
  • 18. Example Simplify creation code by using Option class function openWindow() { new UI.URLWindow({url: $F('url'), theme: quot;mac_os_xquot;, shadow: true}).setHeader(url).show().focus(); } UI.Window.setOptions({theme: quot;mac_os_xquot;, shadow: true, top: 40, left: 100, width: 700, height: 400 }); function openWindow() { new UI.URLWindow({url: $F('url')}).setHeader($F('url')).show().focus(); }
  • 19. Example Let’s create an desktop icon when closing a window
  • 20. Example Add action on hide • Let's change default closing behavior from destroy to hide UI.Window.setOptions({theme: quot;mac_os_xquot;, shadow: true, top: 40, left: 100, width: 700, height: 400, close: quot;hidequot; }); • And add an event when a window is hidden function openWindow() { var win = new UI.URLWindow({url: $F('url')}).setHeader(url).show().focus(); win.observe(quot;hiddenquot;, hideWindow); }
  • 21. Example Now the hideWindow function function hideWindow(data) { var win = data.memo.window; // Create a icon on desktop var icon = new Element(quot;divquot;, {className: quot;iconquot;}).update(win.header.innerHTML); icon.observe(quot;dblclickquot;, function(){ win.show(); icon.remove(); }); document.body.appendChild(icon); } And some CSS for icon .icon { position: absolute; top: 40px; left: 20px; background: url(quot;safari.pngquot;) no-repeat top center; width: 128px; height: 64px; text-align:center; padding-top: 64px; font-size: 12px; }
  • 22. Example Ohter method Using addMethods toadd iconify to UI.Window class UI.Window.addMethods({ iconify: function() { var icon = new Element(quot;divquot;, {class: quot;iconquot;}).update(this.header.innerHTML); icon.observe(quot;dblclickquot;, function() { this.show(); icon.remove(); }.bind(this)); this.hide(); document.body.appendChild(icon); return this.fire('iconified'); } }); function openWindow() { var url = $('url').value; var win = new UI.URLWindow({url: url, close: 'iconify'}).setHeader(url).show().focus(); }
  • 23. Full sample with icon dragging UI.Window.setOptions({theme: quot;mac_os_xquot;, shadow: true, width: 700, height: 400, close: quot;hidequot;}); var windowPosition = {top: 40, left: 100}; function hideWindow(data) { var win = data.memo.window; if (win.icon) win.icon.show(); else { var pos = win.getPosition(); // Create a icon on desktop at window position var style = 'top: #{top}px; left:#{left}px'.interpolate(pos); var icon = new Element(quot;divquot;, {className: quot;iconquot;, style: style}) icon.update(win.header.innerHTML); // Observe double click to hide icon and show window icon.observe(quot;dblclickquot;, function(){ win.show(); icon.hide(); }); new Draggable(icon); document.body.appendChild(icon); win.icon = icon; } } function openWindow() { var win = new UI.URLWindow(Object.extend({url: $F('url')}, windowPosition)).setHeader(url).show().focus(); win.observe(quot;hiddenquot;, hideWindow); windowPosition.top += 40; windowPosition.left += 40; }
  • 24. Next • Stable version • More tests, more documentation and more demos • Custom builds • Dialog class • New components (portal, layout manager, tooltips ...)
  • 25. • Questions? • And see you soon on http://prototype-ui.com