Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add .gitignore, remove tempfiles

  • Loading branch information...
commit 2c57a9c48f5149685f0b9ffc8ea259d7523c2dc9 1 parent 1fa2fc7
@pdl authored
View
19 .gitignore
@@ -0,0 +1,19 @@
+*.bak
+*~
+*.old
+Makefile
+blib/
+pm_to_blib
+Build
+_build
+cover_db/
+nytprof*
+*.patch
+.DS_Store
+MYMETA.*
+*.o
+*.bs
+.DocumentRevisions-*
+.TemporaryItems
+.Trashes
+.fseventsd
View
26 js/bexcommon.js~
@@ -1,26 +0,0 @@
-(function( $ ){
-
- var methods = {
- parseXMLText : function( content ) {
- // !!!
- }
- parseXMLElement : function( content ) {
- // !!!
- }
- };
-
- $.fn.bex = function( method ) {
-
- // Method calling logic
- if ( methods[method] ) {
- return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
- } else if ( typeof method === 'object' || ! method ) {
- return methods.init.apply( this, arguments );
- } else {
- $.error( 'Method ' + method + ' does not exist on jQuery.bex' );
- }
-
- };
-
-})( jQuery );
-
View
24 js/jquery.ui.bexcdatasection.js~
@@ -1,24 +0,0 @@
-(function($) {
- $.widget("ui.bexcdatasection", {
- options: {
-
- },
- _create: function() {
- $(this.element).bextextnode().addClass('bex-cdatasection ui-state-highlight');
- return this;
- },
- xml: function(){
- $(this.element).bextextnode('sleep');
- var cdata = $(this.element).find(".bex-textcontainer")[0].textContent;
- cdata.replace(']]>', ']]>');
- return '<![CDATA['+ cdata + ']]>';
- },
- destroy: function(){
- $(this.element).removeClass('bex-cdatasection ui-state-highlight');
- }
- _setOption: function(option, value) {
- $.Widget.prototype._setOption.apply( this, arguments );
-
- }
- });
-})(jQuery);
View
77 js/jquery.ui.bexchildnode.js~
@@ -1,77 +0,0 @@
-/*
-
-Child Node
-
-Provides methods relating to a node's role as a child of an element or of the document root, for instance "parent" and "insertPreceding".
-
-Used by:
-
-* Element Nodes
-* Text Nodes
-* CDATA Sections
-* Comment nodes
-* Processing instructions
-
-*/
-(function($) {
- $.widget("ui.bexchildnode", {
- options: {
-
- },
- _create: function() {
- var self = this;
- return self;
- },
- parent: function(){
- var self = this;
- return $(self.element).parents('.bex-element,.bex-document').first();
- },
- ancestors: function(){ /*todo: add optional selector*/
- var self = this;
- return $(self.element).parents('.bex-element,.bex-document');
- },
- precedingSibling: function(){ /*todo: add optional selector*/
- var self = this;
- return $(self.element).prev();
- },
- precedingSiblings: function(){ /*todo: add optional selector*/
- var self = this;
- return $(self.element).prevAll();
- },
- followingSibling: function(){ /*todo: add optional selector*/
- var self = this;
- return $(self.element).next();
- },
- followingSiblings: function(){ /*todo: add optional selector*/
- var self = this;
- return self.nextAll();
- },
- insertPreceding: function(newNode){
- var self = this;
- /*todo: check if newNode is ok*/
- return $(self.element).before(newNode);
- },
- insertFollowing: function(newNode){
- var self = this;
- /*todo: check if newNode is ok*/
- return $(self.element).after(newNode);
- },
- removeNode: function() {
- var focusfallback = $(this.element).bexchildnode('followingSibling');
- if (!$(focusfallback).is('li')){
- focusfallback = $(this.element).bexchildnode('precedingSibling')
- }
- if (!$(focusfallback).is('li')) {
- focusfallback = $(this.element).bexchildnode('parent');
- }
- this.element.remove();
- $(focusfallback).find('button').first().focus();
- },
- destroy: function() {
-
- },
- _setOption: function(option, value) {
- $.Widget.prototype._setOption.apply( this, arguments );
- }
- });
-})(jQuery);
View
21 js/jquery.ui.bexcommentnode.js~
@@ -1,21 +0,0 @@
-(function($) {
- $.widget("ui.bexcommentnode", {
- options: {
-
- },
- _create: function() {
- $(this.element).bextextnode().addClass('bex-commentnode ui-state-disabled');
- return this;
- },
- xml: function(){
- $(this.element).bextextnode('sleep');
- return '<!--'+$(this.element).find(".bex-textcontainer")[0].textContent + '-->';
- },
- destroy: function(){
- $(this.element).removeClass('bex-commentnode ui-state-highlight');
- }
- _setOption: function(option, value) {
- $.Widget.prototype._setOption.apply( this, arguments );
- }
- });
-})(jQuery);
View
26 js/jquery.ui.bexcontents.js~
@@ -1,26 +0,0 @@
-(function($) {
- $.widget("ui.bextextcontainer", {
- options: {
- },
- _create: function() {
-
- var self = this,
- o = self.options,
- el = self.element
- .addClass("ui-helper-reset bex-contents")
- .sortable({
- connectWith: ".bex-contents",
- placeholder: "ui-state-highlight"
- })
- .disableSelection();
- return self;
- },
- destroy: function() {
- this.sleep();
- },
- _setOption: function(option, value) {
- $.Widget.prototype._setOption.apply( this, arguments );
-
- }
- });
-})(jQuery);
View
104 js/jquery.ui.bexdocument.js~
@@ -1,104 +0,0 @@
-(function($) {
- $.widget("ui.bexdocument", {
- options: {
- },
- _create: function() {
-
- var self = this;
- var o = self.options;
- var el = self.element;
-
-
- self.bexdocument = $('<div></div>')
- .addClass("ui-widget ui-widget-contents ui-helper-reset bex-document")
- .insertAfter(el).append(el);
- self.bexpreview = $('<div></div>')
- .addClass("ui-widget ui-widget-contents ui-helper-reset bex-preview")
- .appendTo(self.bexdocument);
- self.bexheader = $('<div></div>')
- .addClass("ui-widget-header ui-corner-all bex-document-header")
- .prependTo(self.bexdocument)
- .append(
- $('<button class="bex-show-tree">Tree</button>').button().click(function(){
- self.showtree();
- })
- )
- .append(
- $('<button class="bex-show-source">Source</button>').button().click(function(){
- self.showsource();
- })
- )
- .append(
- $('<button class="bex-show-preview">Preview</button>').button().click(function(){
- self.showpreview();
- })
- );
- $(self.bexdocument).bexparentnode();
- self.showtree();
- var bexdialogconfirmdelete = $('<div id="bex-dlg-confirm-delete"></div>').hide().appendTo(self.bexdocument);
- var bexdialoginsertnode = $('<div id="bex-dlg-insert">\
-<form>\
- <div id="bex-insert-location">\
- <input type="radio" id="insertPreceding" value="insertPreceding" name="bex-insert-location" /><label for="insertPreceding">Preceding</label>\
- <input type="radio" id="insertFollowing" value="insertFollowing" name="bex-insert-location"" /><label for="insertFollowing">Following</label>\
- <br/>\
- <input type="radio" id="append" value="append" name="bex-insert-location" checked="checked" /><label for="append">Append</label>\
- <input type="radio" id="prepend" value="prepend" name="bex-insert-location" /><label for="prepend">Prepend</label>\
- <br/>\
- <input type="radio" id="aroundSelf" name="bex-insert-location" /><label for="aroundSelf">Around</label>\
- <input type="radio" id="aroundContents" name="bex-insert-location" /><label for="aroundContents">Wrap Contents</label>\
- <textarea id="bex-xmlforinsertion" type="text"/>\
- </div>\
-</form>\
-</div>').hide().appendTo(self.bexdocument);
- $('#bex-insert-location').buttonset();
- zen_textarea.setup({pretty_break: true, use_tab: false});
- return self;
- },
- showpreview: function(){
- $(this.element).hide();
- $(this.bexdocument).find('>ul').hide();
- $(this.bexpreview).show();
- $(this.bexpreview).html(this.xmlpreview());
- },
- showtree: function(){
- this.tree();
- $(this.element).hide();
- $(this.bexpreview).hide();
- $(this.bexdocument).find('>ul').show();
- },
- showsource: function(){
- $(this.bexpreview).hide();
- $(this.bexdocument).find('>ul').hide();
- $(this.element).show().val(this.xml());
- },
- xml: function(){
- var source = '';
- $(this.bexdocument).bexparentnode("children").each(function(){
- source += $(this).bexelement('xml');
- });
- return source;
- },
- xmlpreview: function(){
- return this.xml(); // TODO: Add a callback so that users can insert their own XSLT.
- },
- tree: function(){
- var xml = $(this.element).val();
- var xmldoc = $.parseXML(xml);
- var root = $(xmldoc.documentElement);
- $(this.bexdocument).find('>ul').empty();
- $(this.bexdocument).bexparentnode(
- "append",
- $("<li></li>")
- .bexelement({"from": root})
- ).find('button').first().focus();
- },
- destroy: function() {
- this.element.after('.bex-document').first.unbindNode();
- },
- _setOption: function(option, value) {
- $.Widget.prototype._setOption.apply( this, arguments );
-
- }
- });
-})(jQuery);
View
116 js/jquery.ui.bexelement.js~
@@ -1,116 +0,0 @@
-(function($) {
- $.widget("ui.bexelement", {
- options: {
- from: $('<element/>')
- },
- _create: function() {
- var self = this;
- var o = self.options;
- var el = self.element
- .addClass("ui-widget ui-widget-contents ui-helper-reset bex-element");
- var bexheader = $('<div></div>').addClass("ui-widget-header ui-corner-all bex-element-header").appendTo(el);
- el.bexparentnode().bexchildnode();
- var menu = $("<button></button>").bexmenubutton().appendTo(bexheader);
- var bexnodename = $('<span></span>')
- .text(o.from[0].nodeName)
- .bextextcontainer({pattern:'[a-zA-Z][\w]*'})
- .addClass("bex-element-name")
- .appendTo(bexheader);
- self.bexnodename = bexnodename;
- $(o.from).contents().each(function(){ /*use contents().each() then determine nodetype*/
- if (this.nodeType == 1)
- {
- $(self.element).bexparentnode(
- "append", $("<li></li>").bexelement({from: $(this)})
- );
- }
- else if (this.nodeType == 3)
- {
- $(self.element).bexparentnode(
- "append", $("<li></li>").text(this.data).bextextnode()
- );
- }
- else if (this.nodeType == 4)
- {
- $(self.element).bexparentnode(
- "append", $("<li></li>").text(this.data).bexcdatasection()
- );
- }
- else if (this.nodeType == 8)
- {
- $(self.element).bexparentnode(
- "append", $("<li></li>").text(this.data).bexcommentnode()
- );
- }
- else
- {
- alert("Don't know how to handle node type " + this.nodeType);
- }
- });
- return self;
- },
- insertPreceding: function(newNode){
- var self = this;
- /*todo: check if newNode is ok*/
- return $(self.element).before(newNode);
- },
- insertFollowing: function(newNode){
- var self = this;
- /*todo: check if newNode is ok*/
- return $(self.element).after(newNode);
- },
- nodeName: function(){ /*todo: add optional selector*/
- var self = this;
- return $(self.bexnodename).bextextcontainer('val');
- },
- /*
- Todo: core methods
- insertBefore
- insertAfter
- appendNode
- setData
- setName
- unbind
- */
- xml: function(){
- var self = this;
- var xml = '<' + self.nodeName();
- /* attributes*/
-
- var children = self.element.bexparentnode('children');
- if (children.length>0) {
- xml += '>';
- children.each(function(){
- if ($(this).is('.bex-element'))
- {
- xml += $(this).bexelement('xml');
- }
- else if ($(this).is('.bex-commentnode'))
- {
- xml += $(this).bexcommentnode('xml');
- }
- else if ($(this).is('.bex-cdatasection'))
- {
- xml += $(this).bexcdatasection('xml');
- }
- else if ($(this).is('.bex-textnode'))
- {
- xml += $(this).bextextnode('xml');
- }
- });
- xml +='</'+self.nodeName()+'>';
- }
- else {
- xml += '/>';
- }
- return xml;
-
- },
- destroy: function() {
-
- },
- _setOption: function(option, value) {
- $.Widget.prototype._setOption.apply( this, arguments );
- }
- });
-})(jQuery);
View
208 js/jquery.ui.bexmenubutton.js~
@@ -1,208 +0,0 @@
-(function($) {
- $.widget("ui.bexmenubutton", {
- options: {
- },
- _create: function() {
- var self = this;
- var o = self.options;
- var el = self.element
- .button({
- text: false,
- icons: {
- primary: "ui-icon-triangle-1-s"
- }
- })
- .addClass("bex-handle ui-corner-left")
- .removeClass("ui-corner-all")
- .click(function(){
- /* todo: menu here */
- var menuoptions = [
- {
- label: "Move...",
- contains: [
- {
- label: "Before Preceding",
- action: function(){
- var controller = self.controller();
- $(controller).bexchildnode('precedingSibling').bexchildnode("insertPreceding", controller);
- $(self.element).focus();
- }
- }
- ]
- },
- {
- label: "Delete",
- action: function(){
- $(self.controller()).bexchildnode('removeNode');
- }
- }
- ];
- $('.bex-contextmenu').remove();
- var bexcontextmenu = $('<ul class="bex-contextmenu"></ul>');
- var add_menuoption = function(menu, menuoption){
- var listitem = $('<li></li>');
- listitem.append($('<a href="#"></a>').text(menuoption.label).click(menuoption.action));
- if (menuoption.contains !== undefined && menuoption.contains.length > 0) {
- var newmenu = $('<ul></ul>').appendTo(listitem);
- for (var i=0; i<menuoption.contains.length; i++) {
- add_menuoption(newmenu, menuoption.contains[i]);
- }
- }
- menu.append(listitem);
- };
- for (var i=0; i<menuoptions.length; i++){
- add_menuoption(bexcontextmenu, menuoptions[i]);
- }
- bexcontextmenu.menu().show().appendTo(self.controller());
- })
- /* Define the keyboard commands */
- .keyup(function(e){
- /* alert( "Keyup " + e.keyCode + " CtrlKey: "+e.ctrlKey); */
- var controller = self.controller();
- var keyCode = e.keyCode;
-
- if (e.ctrlKey)
- {
- switch (keyCode)
- {
- case 37: /*LEFT: Insert after parent*/
- $(controller).bexchildnode('parent').bexchildnode("insertFollowing", controller);
- $(self.element).focus();
- break;
- case 38: /*UP: Insert before previous*/
- $(controller).bexchildnode('precedingSibling').bexchildnode("insertPreceding", controller);
- $(self.element).focus();
- break;
- case 39: /*RIGHT: Append to previous*/
- $(controller).bexchildnode('precedingSibling').bexparentnode("append", controller);
- $(self.element).focus();
- break;
- case 40: /*DOWN: Insert after following */
- $(controller).bexchildnode('followingSibling').bexchildnode("insertFollowing", controller);
- $(self.element).focus();
- break;
- case 46: /*DELETE*/
- $( "#bex-dlg-confirm-delete" ).dialog({
- resizable: false,
- height: 140,
- modal: true,
- title: 'Confirm node deletion',
- close: function(){
- if (self.element){
- self.element.focus();
- }
- },
- buttons: {
- "Delete": function() {
- $(controller).bexchildnode('removeNode');
- $( this ).dialog( "close" );
- },
- "Cancel": function() {
- $( this ).dialog( "close" );
- }
- }
- });
- break;
- case 73: /* CTRL + I */
- $( "#bex-dlg-insert" ).dialog({
- modal: true,
- title: 'Insert Node',
- close: function(){
- if (self.element){
- self.element.focus();
- }
- },
- buttons: {
- "Add Element": function() {
- var xmlforinsertion = '' + $( this ).find('#bex-xmlforinsertion').val();
- if(xmlforinsertion == '' ){xmlforinsertion = '<element/>';}
- var method = $( this ).find(':checked').val();
- /* alert (method+' ' + xmlforinsertion); */
- $(controller).bexparentnode(
- method,
- $('<li/>')
- .bexelement(
- {'from': $($.parseXML(xmlforinsertion).documentElement) }
- )
- );
- $( this ).dialog( "close" );
- },
- "Cancel": function() {
- $( this ).dialog( "close" );
- }
- }
- });
- break;
-
- }
- }
- else{
- switch (keyCode)
- {
- case 37: /*LEFT: focus on parentnode */
- $(controller).bexchildnode('parent').find('button').first().focus();
- break;
- case 38: /*UP: Focus on preceding sibling */
- $(controller).bexchildnode('precedingSibling').find('button').first().focus();
- break;
- case 39: /*RIGHT: Focus on first child OR edit text node*/
- if ($(controller).is('.bex-textnode'))
- {
- $(controller).bextextnode('wake');
- }
- else if ($(controller).is('.bex-element') && $(controller).bexparentnode('children').length > 0)
- {
- $(controller).bexparentnode('children').first().find('button').first().focus();
- }
- break;
- case 40: /*DOWN: Focus on following sibling */
- $(controller).bexchildnode('followingSibling').find('button').first().focus();
- break;
- }
-
- }
- });
- return self;
- },
- controller: function() {
- var self = this;
- return $(self.element).parents('.bex-textnode, .bex-element').first();
- },
- destroy: function() {
-
- },
- _setOption: function(option, value) {
- $.Widget.prototype._setOption.apply( this, arguments );
-
- }
- });
-})(jQuery);
-
-/*
-
- TODO: Make bexmenubutton apply to the controlling element. It will either find and use an existing button as the button or, if it cannot, it will just append a button.
-
- Commands are always user-facing and if they require parameters, will demand them.
-
- addCommand ( {
- name: 'insertBefore',
- action: function(){}
- }); # also overwrites existing commands.
- removeCommand ( {
- name: 'insertBefore',
- }); # also iterates through the menu and keyboard shortcuts and unbinds them.
- replaceCommand # alias for addCommand
- addMenuCommand ({
- name: 'insertBeforePreceding'
- path: []
- action: function(){} | commandName ==> function(){execCommand()}
- });
- addKeyboardShortcut ({
- ctrl: 1,
- keyCode: 39
- action: function(){} | commandName ==> function(){execCommand()}
- });
- execCommand ({
-
- });
-*/
View
40 js/jquery.ui.bexparentnode.js~
@@ -1,40 +0,0 @@
-(function($) {
- $.widget("ui.bexparentnode", {
- options: {
- },
- _create: function() {
- /*self._trigger("added", null);*/
- var self = this;
- var bexcontents = $('<ul></ul>')
- .addClass("ui-helper-reset bex-contents")
- .sortable({
- connectWith: ".bex-contents",
- placeholder: "ui-state-highlight"
- })
- .appendTo(self.element)
- .disableSelection();
- self.bexcontents = bexcontents;
- alert (self.element.html());
- return this;
- },
- append: function(newNode){
- var self = this;
- /*todo: check if newNode is ok*/
- return $(self.bexcontents).append(newNode);
- },
- prepend: function(newNode){
- var self = this;
- /*todo: check if newNode is ok*/
- return $(self.bexcontents).prepend(newNode);
- },
- children: function(){
- var self = this;
- return $(self.bexcontents).children();
- },
- destroy: function() {
- },
- _setOption: function(option, value) {
- $.Widget.prototype._setOption.apply( this, arguments );
- }
- });
-})(jQuery);
View
42 js/jquery.ui.bextextnode.js~
@@ -1,42 +0,0 @@
-(function($) {
- $.widget("ui.bextextnode", {
- options: {
-
- },
- _create: function() {
- var self = this,
- o = self.options,
- el = self.element,
- textcontent = el.text();
- el .empty()
- .addClass("ui-widget bex-textnode ui-helper-reset")
- .bexchildnode();
- var
- menu = $("<button></button>").bexmenubutton().appendTo(el),
- textcontainer = $("<span></span>").text(textcontent).bextextcontainer().appendTo(el);
- self._trigger("added", null);
- return self;
- },
- wake: function() {
- var textcontainer = this.element.find(".bex-textcontainer");
- textcontainer.bextextcontainer('wake');
- return this;
- },
- sleep: function() {
- var textcontainer = this.element.find(".bex-textcontainer");
- textcontainer.bextextcontainer('sleep');
- return this;
- },
- destroy: function() {
- var textcontent = this.element.find(".bex-textcontainer").text();
- this.element.empty().text(textcontent);
- },
- xml: function(){
- return this.sleep().element.find(".bex-textcontainer")[0].innerHTML;
- },
- _setOption: function(option, value) {
- $.Widget.prototype._setOption.apply( this, arguments );
-
- }
- });
-})(jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.