-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
some fixes for locale strings, along with a new heading plugin and ex…
…perimental font selection
- Loading branch information
Showing
15 changed files
with
158 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* @author Shea Frederick - http://www.vinylfox.com | ||
* @class Ext.ux.form.HtmlEditor.Font | ||
* @extends Ext.util.Observable | ||
* <p>A plugin that creates a menu on the HtmlEditor for selecting a font. Uses the HtmlEditors default font settings which can be overriden on that component to change the list of fonts or default font.</p> | ||
*/ | ||
Ext.ux.form.HtmlEditor.Font = Ext.extend(Ext.util.Observable, { | ||
init: function(cmp){ | ||
this.cmp = cmp; | ||
this.cmp.on('render', this.onRender, this); | ||
}, | ||
// private | ||
onRender: function(){ | ||
var cmp = this.cmp; | ||
var fonts = function(){ | ||
var fnts = []; | ||
Ext.each(cmp.fontFamilies, function(itm){ | ||
fnts.push([itm.toLowerCase(),itm]); | ||
}); | ||
return fnts; | ||
}(); | ||
var btn = this.cmp.getToolbar().addItem({ | ||
xtype: 'combo', | ||
displayField: 'display', | ||
valueField: 'value', | ||
name: 'fontfamily', | ||
forceSelection: true, | ||
mode: 'local', | ||
triggerAction: 'all', | ||
width: 80, | ||
emptyText: 'Font', | ||
tpl: '<tpl for="."><div class="x-combo-list-item" style="font-family:{value};">{display}</div></tpl>', | ||
store: { | ||
xtype: 'arraystore', | ||
autoDestroy: true, | ||
fields: ['value','display'], | ||
data: fonts | ||
}, | ||
listeners: { | ||
'select': function(combo,rec){ | ||
this.relayCmd('fontname', rec.get('value')); | ||
this.deferFocus(); | ||
combo.reset(); | ||
}, | ||
scope: cmp | ||
} | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/** | ||
* @author Shea Frederick - http://www.vinylfox.com | ||
* @contributor Somani - http://www.sencha.com/forum/member.php?51567-Somani | ||
* @class Ext.ux.form.HtmlEditor.HeadingButtons | ||
* @extends Ext.ux.form.HtmlEditor.MidasCommand | ||
* <p>A plugin that creates a button on the HtmlEditor that will have H1 and H2 options. This is used when you want to restrict users to just a few heading types.</p> | ||
* NOTE: while 'heading' should be the command used, it is not supported in IE, so 'formatblock' is used instead. Thank you IE. | ||
*/ | ||
|
||
Ext.ux.form.HtmlEditor.HeadingButtons = Ext.extend(Ext.ux.form.HtmlEditor.MidasCommand, { | ||
// private | ||
midasBtns: ['|', { | ||
enableOnSelection: true, | ||
cmd: 'formatblock', | ||
value: '<h1>', | ||
tooltip: { | ||
title: '1st Heading' | ||
}, | ||
overflowText: '1st Heading' | ||
}, { | ||
enableOnSelection: true, | ||
cmd: 'formatblock', | ||
value: '<h2>', | ||
tooltip: { | ||
title: '2nd Heading' | ||
}, | ||
overflowText: '2nd Heading' | ||
}] | ||
}); | ||
|
||
/** | ||
* @author Shea Frederick - http://www.vinylfox.com | ||
* @class Ext.ux.form.HtmlEditor.HeadingMenu | ||
* @extends Ext.util.Observable | ||
* <p>A plugin that creates a menu on the HtmlEditor for selecting a heading size. Takes up less room than the heading buttons if your going to have all six heading sizes available.</p> | ||
*/ | ||
Ext.ux.form.HtmlEditor.HeadingMenu = Ext.extend(Ext.util.Observable, { | ||
init: function(cmp){ | ||
this.cmp = cmp; | ||
this.cmp.on('render', this.onRender, this); | ||
}, | ||
// private | ||
onRender: function(){ | ||
var cmp = this.cmp; | ||
var btn = this.cmp.getToolbar().addItem({ | ||
xtype: 'combo', | ||
displayField: 'display', | ||
valueField: 'value', | ||
name: 'headingsize', | ||
forceSelection: true, | ||
mode: 'local', | ||
triggerAction: 'all', | ||
width: 65, | ||
emptyText: 'Heading', | ||
store: { | ||
xtype: 'arraystore', | ||
autoDestroy: true, | ||
fields: ['value','display'], | ||
data: [['H1','1st Heading'],['H2','2nd Heading'],['H3','3rd Heading'],['H4','4th Heading'],['H5','5th Heading'],['H6','6th Heading']] | ||
}, | ||
listeners: { | ||
'select': function(combo,rec){ | ||
this.relayCmd('formatblock', '<'+rec.get('value')+'>'); | ||
combo.reset(); | ||
}, | ||
scope: cmp | ||
} | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters