3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
15 Ext.example = function(){
18 function createBox(t, s){
19 // return ['<div class="msg">',
20 // '<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>',
21 // '<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc"><h3>', t, '</h3>', s, '</div></div></div>',
22 // '<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>',
23 // '</div>'].join('');
24 return '<div class="msg"><h3>' + t + '</h3><p>' + s + '</p></div>';
27 msg : function(title, format){
29 msgCt = Ext.DomHelper.insertFirst(document.body, {id:'msg-div'}, true);
31 var s = Ext.String.format.apply(String, Array.prototype.slice.call(arguments, 1));
32 var m = Ext.DomHelper.append(msgCt, createBox(title, s), true);
34 m.slideIn('t').ghost("t", { delay: 1000, remove: true});
38 // var t = Ext.get('exttheme');
39 // if(!t){ // run locally?
42 // var theme = Cookies.get('exttheme') || 'aero';
44 // t.dom.value = theme;
45 // Ext.getBody().addClass('x-'+theme);
47 // t.on('change', function(){
48 // Cookies.set('exttheme', t.getValue());
49 // setTimeout(function(){
50 // window.location.reload();
54 // var lb = Ext.get('lib-bar');
62 Ext.example.shortBogusMarkup = '<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, '+
63 'sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales '+
64 'non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet '+
65 'tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla.</p>';
67 Ext.example.bogusMarkup = '<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, '+
68 'porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, '+
69 'lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis '+
70 'vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna.<br/><br/>'+
71 'Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing '+
72 'eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt '+
73 'diam nec urna. Curabitur velit. Lorem ipsum dolor sit amet.</p>';
75 //Ext.onReady(Ext.example.init, Ext.example);
78 // old school cookie functions
80 Cookies.set = function(name, value){
82 var argc = arguments.length;
83 var expires = (argc > 2) ? argv[2] : null;
84 var path = (argc > 3) ? argv[3] : '/';
85 var domain = (argc > 4) ? argv[4] : null;
86 var secure = (argc > 5) ? argv[5] : false;
87 document.cookie = name + "=" + escape (value) +
88 ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
89 ((path == null) ? "" : ("; path=" + path)) +
90 ((domain == null) ? "" : ("; domain=" + domain)) +
91 ((secure == true) ? "; secure" : "");
94 Cookies.get = function(name){
96 var alen = arg.length;
97 var clen = document.cookie.length;
102 if (document.cookie.substring(i, j) == arg)
103 return Cookies.getCookieVal(j);
104 i = document.cookie.indexOf(" ", i) + 1;
111 Cookies.clear = function(name) {
112 if(Cookies.get(name)){
113 document.cookie = name + "=" +
114 "; expires=Thu, 01-Jan-70 00:00:01 GMT";
118 Cookies.getCookieVal = function(offset){
119 var endstr = document.cookie.indexOf(";", offset);
121 endstr = document.cookie.length;
123 return unescape(document.cookie.substring(offset, endstr));