roojs-ui.js
[roojs1] / roojs-debug.js
index a5e751f..ee87264 100644 (file)
@@ -46313,7 +46313,6 @@ Roo.apply(Roo.htmleditor.FilterBlock.prototype,
  * @constructor
  * @method Serializer
  * @param {Object} settings Name/value settings object.
- * @param {tinymce.html.Schema} schema Schema instance to use.
  */
 
 
@@ -46323,8 +46322,7 @@ Roo.htmleditor.TidySerializer = function(settings)
     
     this.writer = new Roo.htmleditor.TidyWriter(settings);
     
-    //settings.validate = !('validate' in settings) || settings.validate;
-    //      self.schema = schema = schema || new Schema();
+    
 
 };
 Roo.htmleditor.TidySerializer.prototype = {
@@ -46405,38 +46403,7 @@ Roo.htmleditor.TidySerializer.prototype = {
         var writer = this.writer;
         var attrs = node.attributes;
         // Sort attributes
-        /*
-        if (validate && attrs && attrs.length > 1) {
-            sortedAttrs = [];
-            sortedAttrs.map = {};
-            elementRule = schema.getElementRule(node.name);
-            if (elementRule) {
-                for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) {
-                    attrName = elementRule.attributesOrder[i];
-                    if (attrName in attrs.map) {
-                        attrValue = attrs.map[attrName];
-                        sortedAttrs.map[attrName] = attrValue;
-                        sortedAttrs.push({
-                            name: attrName,
-                            value: attrValue
-                        });
-                    }
-                }
-                for (i = 0, l = attrs.length; i < l; i++) {
-                    attrName = attrs[i].name;
-                    if (!(attrName in sortedAttrs.map)) {
-                        attrValue = attrs.map[attrName];
-                        sortedAttrs.map[attrName] = attrValue;
-                        sortedAttrs.push({
-                            name: attrName,
-                            value: attrValue
-                        });
-                    }
-                }
-                attrs = sortedAttrs;
-            }
-        }
-        */
+        
         writer.start(node.nodeName, attrs, isEmpty, node);
         if (isEmpty) {
             return;
@@ -47899,24 +47866,86 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
                 xns : rooui.Toolbar  //Boostrap?
             },
             {
-                xtype : 'TextField',
-                allowBlank : false,
-                width : 150,
-                name : 'image_src',
+                xtype : 'Button',
+                text: 'Change Image URL',
+                 
                 listeners : {
-                    keyup : function (combo, e)
-                    { 
-                        toolbar.editorcore.selectNode(toolbar.tb.selectedNode);
+                    click: function (btn, state)
+                    {
                         var b = block();
-                        b.image_src = this.getValue();
-                        b.updateElement();
-                        syncValue();
-                        toolbar.editorcore.onEditorEvent();
+                        
+                        Roo.MessageBox.show({
+                            title : "Image Source URL",
+                            msg : "Enter the url for the image",
+                            buttons: Roo.MessageBox.OKCANCEL,
+                            fn: function(btn, val){
+                                if (btn != 'ok') {
+                                    return;
+                                }
+                                b.image_src = val;
+                                b.updateElement();
+                                syncValue();
+                                toolbar.editorcore.onEditorEvent();
+                            },
+                            minWidth:250,
+                            prompt:true,
+                            //multiline: multiline,
+                            modal : true,
+                            value : b.image_src
+                        });
                     }
                 },
-                xns : rooui.form
-                
+                xns : rooui.Toolbar
+            },
+         
+            {
+                xtype : 'Button',
+                text: 'Change Link URL',
+                 
+                listeners : {
+                    click: function (btn, state)
+                    {
+                        var b = block();
+                        
+                        Roo.MessageBox.show({
+                            title : "Link URL",
+                            msg : "Enter the url for the link - leave blank to have no link",
+                            buttons: Roo.MessageBox.OKCANCEL,
+                            fn: function(btn, val){
+                                if (btn != 'ok') {
+                                    return;
+                                }
+                                b.href = val;
+                                b.updateElement();
+                                syncValue();
+                                toolbar.editorcore.onEditorEvent();
+                            },
+                            minWidth:250,
+                            prompt:true,
+                            //multiline: multiline,
+                            modal : true,
+                            value : b.href
+                        });
+                    }
+                },
+                xns : rooui.Toolbar
+            },
+            {
+                xtype : 'Button',
+                text: 'Show Video URL',
+                 
+                listeners : {
+                    click: function (btn, state)
+                    {
+                        Roo.MessageBox.alert("Video URL",
+                            block().video_url == '' ? 'This image is not linked ot a video' :
+                                'The image is linked to: <a target="_new" href="' + block().video_url + '">' + block().video_url + '</a>');
+                    }
+                },
+                xns : rooui.Toolbar
             },
+            
+            
             {
                 xtype : 'TextItem',
                 text : "Width: ",
@@ -51648,8 +51677,7 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
      */
 });
  
-    // <script type="text/javascript">
-/*
+    /*
  * Based on
  * Ext JS Library 1.1.1
  * Copyright(c) 2006-2007, Ext JS, LLC.
@@ -51658,9 +51686,9 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
  */
 
 /**
- * @class Roo.form.HtmlEditorToolbar1
+ * @class Roo.form.HtmlEditor.ToolbarStandard
  * Basic Toolbar
- * 
+
  * Usage:
  *
  new Roo.form.HtmlEditor({
@@ -51674,7 +51702,7 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
      
  * 
  * @cfg {Object} disable List of elements to disable..
- * @cfg {Array} btns List of additional buttons.
+ * @cfg {Roo.Toolbar.Item|Roo.Toolbar.Button|Roo.Toolbar.SplitButton|Roo.form.Field} btns[] List of additional buttons.
  * 
  * 
  * NEEDS Extra CSS? 
@@ -51699,7 +51727,7 @@ Roo.form.HtmlEditor.ToolbarStandard = function(config)
     // dont call parent... till later.
 }
 
-Roo.apply(Roo.form.HtmlEditor.ToolbarStandard.prototype,  {
+Roo.form.HtmlEditor.ToolbarStandard.prototype = {
     
     tb: false,
     
@@ -52175,9 +52203,12 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarStandard.prototype,  {
     },
     // private used internally
     createLink : function(){
-        Roo.log("create link?");
+        //Roo.log("create link?");
         var ec = this.editorcore;
-        Roo.MessageBox.prompt("Add Link URL",this.createLinkText, function(url) {
+        Roo.MessageBox.prompt("Add Link URL",this.createLinkText, function(btn, url) {
+            if (btn != 'ok') {
+                return;
+            }
             if(url && url != 'http:/'+'/'){
                 ec.relayCmd('createlink', url);
             }
@@ -52426,7 +52457,7 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarStandard.prototype,  {
            item.enable();
         });
     }
-});
+};