Changeset 715
- Timestamp:
- 09/15/06 15:17:09 (2 years ago)
- Files:
-
- 1 modified
-
Branches/2.1/core/js/Macros.js (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Branches/2.1/core/js/Macros.js
r698 r715 29 29 if(this[type].handler) 30 30 results = this[type].handler(params); 31 for (var t = 0; t < results.length; t++)31 for(var t = 0; t < results.length; t++) 32 32 { 33 33 var theListItem = document.createElement("li") … … 138 138 config.macros.search.onKeyPress = function(e) 139 139 { 140 if (!e) var e = window.event;140 if(!e) var e = window.event; 141 141 switch(e.keyCode) 142 142 { 143 143 case 13: // Ctrl-Enter 144 144 case 10: // Ctrl-Enter on IE PC 145 config.macros.search.doSearch(this);146 break;145 config.macros.search.doSearch(this); 146 break; 147 147 case 27: // Escape 148 148 this.value = ""; … … 281 281 config.macros.slider.onClickSlider = function(e) 282 282 { 283 if (!e) var e = window.event;283 if(!e) var e = window.event; 284 284 var n = this.nextSibling; 285 285 var cookie = n.getAttribute("cookie"); … … 301 301 panel.setAttribute("cookie",cookie); 302 302 panel.style.display = config.options[cookie] ? "block" : "none"; 303 place.appendChild(panel);303 place.appendChild(panel); 304 304 return panel; 305 305 } … … 391 391 btn.setAttribute("newTemplate",getParam(params,"template",DEFAULT_EDIT_TEMPLATE)); 392 392 var text = getParam(params,"text"); 393 if (text !== undefined)393 if(text !== undefined) 394 394 btn.setAttribute("newText",text); 395 395 return btn; … … 404 404 story.displayTiddler(null,title,template); 405 405 var text = this.getAttribute("newText"); 406 if (typeof text == "string")406 if(typeof text == "string") 407 407 story.getTiddlerField(title,"text").value = text.format([title]); 408 408 for(var t=0;t<params.length;t++) … … 497 497 config.options[cookie] = params[1]; 498 498 this.switchTab(tabset,config.options[cookie]); 499 place.appendChild(wrapper);499 place.appendChild(wrapper); 500 500 } 501 501 … … 621 621 { 622 622 story.setDirty(tiddler.title,true); 623 if (field != "text")623 if(field != "text") 624 624 { 625 625 var e = createTiddlyElement(null,"input"); … … 629 629 e.setAttribute("type","text"); 630 630 var v = store.getValue(tiddler,field); 631 if (!v)631 if(!v) 632 632 v = ""; 633 633 e.value = v; 634 634 e.setAttribute("size","40"); 635 635 e.setAttribute("autocomplete","off"); 636 place.appendChild(e);636 place.appendChild(e); 637 637 } 638 638 else … … 644 644 e.setAttribute("readOnly","readOnly"); 645 645 var v = store.getValue(tiddler,field); 646 if (!v)646 if(!v) 647 647 v = ""; 648 648 e.value = v; … … 655 655 e.setAttribute("rows",rows); 656 656 e.setAttribute("edit",field); 657 place.appendChild(wrapper1);658 } 657 place.appendChild(wrapper1); 658 } 659 659 } 660 660 } … … 662 662 config.macros.tagChooser.onClick = function(e) 663 663 { 664 if (!e) var e = window.event;664 if(!e) var e = window.event; 665 665 var lingo = config.views.editor.tagChooser; 666 666 var popup = Popup.create(this); … … 668 668 if(tags.length == 0) 669 669 createTiddlyText(createTiddlyElement(popup,"li"),lingo.popupNone); 670 for (var t=0; t<tags.length; t++)670 for(var t=0; t<tags.length; t++) 671 671 { 672 672 var theTag = createTiddlyButton(createTiddlyElement(popup,"li"),tags[t][0],lingo.tagTooltip.format([tags[t][0]]),config.macros.tagChooser.onTagClick); … … 676 676 Popup.show(popup,false); 677 677 e.cancelBubble = true; 678 if (e.stopPropagation) e.stopPropagation();678 if(e.stopPropagation) e.stopPropagation(); 679 679 return(false); 680 680 } … … 682 682 config.macros.tagChooser.onTagClick = function(e) 683 683 { 684 if (!e) var e = window.event;684 if(!e) var e = window.event; 685 685 var tag = this.getAttribute("tag"); 686 686 var title = this.getAttribute("tiddler"); … … 733 733 if(theClass) 734 734 addClass(btn,theClass); 735 place.appendChild(btn);735 place.appendChild(btn); 736 736 } 737 737 } … … 740 740 config.macros.toolbar.onClickCommand = function(e) 741 741 { 742 if (!e) var e = window.event;742 if(!e) var e = window.event; 743 743 var command = config.commands[this.getAttribute("commandName")]; 744 744 return command.handler(e,this,this.getAttribute("tiddler")); … … 749 749 { 750 750 var children = place.getElementsByTagName("a") 751 for (var t=0; t<children.length; t++)751 for(var t=0; t<children.length; t++) 752 752 { 753 753 var c = children[t]; … … 967 967 // Create the iframe 968 968 var iframe = document.createElement("iframe"); 969 iframe.style.display = "none";969 iframe.style.display = "none"; 970 970 importer.insertBefore(iframe,importer.firstChild); 971 971 var doc = iframe.document; 972 if (iframe.contentDocument)972 if(iframe.contentDocument) 973 973 doc = iframe.contentDocument; // For NS6 974 else if (iframe.contentWindow)974 else if(iframe.contentWindow) 975 975 doc = iframe.contentWindow.document; // For IE5.5 and IE6 976 976 // Put the content in the iframe
