Procházet zdrojové kódy

Removed Widget>>alert:,#confirm: and #prompt:

Nicolas Petton před 12 roky
rodič
revize
4ba53dbc59
6 změnil soubory, kde provedl 25 přidání a 151 odebrání
  1. 0 44
      js/Canvas.deploy.js
  2. 0 64
      js/Canvas.js
  3. 4 4
      js/IDE.deploy.js
  4. 7 7
      js/IDE.js
  5. 0 18
      st/Canvas.st
  6. 14 14
      st/IDE.st

+ 0 - 44
js/Canvas.deploy.js

@@ -1030,50 +1030,6 @@ smalltalk.TagBrush.klass);
 
 
 smalltalk.addClass('Widget', smalltalk.Object, [], 'Canvas');
-smalltalk.addMethod(
-'_alert_',
-smalltalk.method({
-selector: 'alert:',
-fn: function (aString){
-var self=this;
-alert(aString);
-return self;}
-}),
-smalltalk.Widget);
-
-smalltalk.addMethod(
-'_confirm_',
-smalltalk.method({
-selector: 'confirm:',
-fn: function (aString){
-var self=this;
-return window.confirm(aString);
-return self;}
-}),
-smalltalk.Widget);
-
-smalltalk.addMethod(
-'_prompt_',
-smalltalk.method({
-selector: 'prompt:',
-fn: function (aString){
-var self=this;
-return smalltalk.send(self, "_prompt_default_", [aString, ""]);
-return self;}
-}),
-smalltalk.Widget);
-
-smalltalk.addMethod(
-'_prompt_default_',
-smalltalk.method({
-selector: 'prompt:default:',
-fn: function (aString, anotherString){
-var self=this;
-return window.prompt(aString, anotherString);
-return self;}
-}),
-smalltalk.Widget);
-
 smalltalk.addMethod(
 '_appendToBrush_',
 smalltalk.method({

+ 0 - 64
js/Canvas.js

@@ -1490,70 +1490,6 @@ smalltalk.TagBrush.klass);
 
 
 smalltalk.addClass('Widget', smalltalk.Object, [], 'Canvas');
-smalltalk.addMethod(
-unescape('_alert_'),
-smalltalk.method({
-selector: unescape('alert%3A'),
-category: 'actions',
-fn: function (aString){
-var self=this;
-alert(aString);
-return self;},
-args: ["aString"],
-source: unescape('alert%3A%20aString%0A%20%20%20%20%3Calert%28aString%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Widget);
-
-smalltalk.addMethod(
-unescape('_confirm_'),
-smalltalk.method({
-selector: unescape('confirm%3A'),
-category: 'actions',
-fn: function (aString){
-var self=this;
-return window.confirm(aString);
-return self;},
-args: ["aString"],
-source: unescape('confirm%3A%20aString%0A%20%20%20%20%3Creturn%20window.confirm%28aString%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Widget);
-
-smalltalk.addMethod(
-unescape('_prompt_'),
-smalltalk.method({
-selector: unescape('prompt%3A'),
-category: 'actions',
-fn: function (aString){
-var self=this;
-return smalltalk.send(self, "_prompt_default_", [aString, ""]);
-return self;},
-args: ["aString"],
-source: unescape('prompt%3A%20aString%0A%20%20%20%20%5Eself%20prompt%3A%20aString%20default%3A%20%27%27'),
-messageSends: ["prompt:default:"],
-referencedClasses: []
-}),
-smalltalk.Widget);
-
-smalltalk.addMethod(
-unescape('_prompt_default_'),
-smalltalk.method({
-selector: unescape('prompt%3Adefault%3A'),
-category: 'actions',
-fn: function (aString, anotherString){
-var self=this;
-return window.prompt(aString, anotherString);
-return self;},
-args: ["aString", "anotherString"],
-source: unescape('prompt%3A%20aString%20default%3A%20anotherString%0A%20%20%20%20%3Creturn%20window.prompt%28aString%2C%20anotherString%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Widget);
-
 smalltalk.addMethod(
 unescape('_appendToBrush_'),
 smalltalk.method({

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 4 - 4
js/IDE.deploy.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 7 - 7
js/IDE.js


+ 0 - 18
st/Canvas.st

@@ -427,24 +427,6 @@ Object subclass: #Widget
 	instanceVariableNames: ''
 	category: 'Canvas'!
 
-!Widget methodsFor: 'actions'!
-
-alert: aString
-    <alert(aString)>
-!
-
-confirm: aString
-    <return window.confirm(aString)>
-!
-
-prompt: aString
-    ^self prompt: aString default: ''
-!
-
-prompt: aString default: anotherString
-    <return window.prompt(aString, anotherString)>
-! !
-
 !Widget methodsFor: 'adding'!
 
 appendToBrush: aTagBrush

+ 14 - 14
st/IDE.st

@@ -533,14 +533,14 @@ compileMethodDefinitionFor: aClass
     compiler source: source.
     node := compiler parse: source.
     node isParseFailure ifTrue: [
-	^self alert: 'PARSE ERROR: ', node reason, ', position: ', node position asString].
+	^window alert: 'PARSE ERROR: ', node reason, ', position: ', node position asString].
     compiler currentClass: aClass.
     method := compiler eval: (compiler compileNode: node).
     method category: selectedProtocol.
     compiler unknownVariables do: [:each |
          "Do not try to redeclare javascript's objects"
          (window at: each) ifNil: [
-	 	(self confirm: 'Declare ''', each, ''' as instance variable?') ifTrue: [
+	 	(window confirm: 'Declare ''', each, ''' as instance variable?') ifTrue: [
 			self addInstanceVariableNamed: each toClass: aClass.
 			^self compileMethodDefinitionFor: aClass]]].
     aClass addCompiledMethod: method.
@@ -561,12 +561,12 @@ compileDefinition
 
 cancelChanges
     ^unsavedChanges 
-	ifTrue: [self confirm: 'Cancel changes?']
+	ifTrue: [window confirm: 'Cancel changes?']
 	ifFalse: [true]
 !
 
 removeClass
-    (self confirm: 'Do you really want to remove ', selectedClass name, '?')
+    (window confirm: 'Do you really want to remove ', selectedClass name, '?')
 	ifTrue: [
 	    Smalltalk current removeClass: selectedClass.
 	    self resetClassesList.
@@ -575,7 +575,7 @@ removeClass
 
 removeMethod
     self cancelChanges ifTrue: [
-	(self confirm: 'Do you really want to remove #', selectedMethod selector, '?')
+	(window confirm: 'Do you really want to remove #', selectedMethod selector, '?')
 	    ifTrue: [
 		selectedTab = #instance 
 			ifTrue: [selectedClass removeCompiledMethod: selectedMethod]
@@ -599,7 +599,7 @@ setMethodProtocol: aString
 
 addNewProtocol
     | newProtocol |
-    newProtocol := self prompt: 'New method protocol'.
+    newProtocol := window prompt: 'New method protocol'.
     (newProtocol notNil and: [newProtocol notEmpty]) ifTrue: [
 	selectedMethod category: newProtocol.
 	self setMethodProtocol: newProtocol]
@@ -657,7 +657,7 @@ selectTab: aString
 
 renameClass
     | newName |
-    newName := self prompt: 'Rename class ', selectedClass name.
+    newName := window prompt: 'Rename class ', selectedClass name.
     (newName notNil and: [newName notEmpty]) ifTrue: [
 	selectedClass rename: newName.
 	self 
@@ -707,28 +707,28 @@ commitPackage
 			options: #{
 				'type' -> 'PUT'.
 				'data' -> (Exporter new exportPackage: selectedPackage).
-				'error' -> [self alert: 'Commit failed!!']
+				'error' -> [window alert: 'Commit failed!!']
 			}.
 		jQuery 
 			ajax: self class commitPathJs, '/', selectedPackage, '.deploy.js'
 			options: #{
 				'type' -> 'PUT'.
 				'data' -> (StrippedExporter new exportPackage: selectedPackage).
-				'error' -> [self alert: 'Commit failed!!']
+				'error' -> [window alert: 'Commit failed!!']
 			}.
 		jQuery 
 			ajax: self class commitPathSt, '/', selectedPackage, '.st'
 			options: #{
 				'type' -> 'PUT'.
 				'data' -> (ChunkExporter new exportPackage: selectedPackage).
-				'error' -> [self alert: 'Commit failed!!']
+				'error' -> [window alert: 'Commit failed!!']
 			}]
 !
 
 renamePackage
 
   | newName |
-  newName := self prompt: 'Rename package ', selectedPackage.
+  newName := window prompt: 'Rename package ', selectedPackage.
   newName ifNotNil: [
     newName notEmpty ifTrue: [
 	Smalltalk current renamePackage: selectedPackage to: newName.
@@ -737,7 +737,7 @@ renamePackage
 
 removePackage
 
-  (self confirm: 'Do you really want to remove the whole package ', selectedPackage, ' with all its classes?')
+  (window confirm: 'Do you really want to remove the whole package ', selectedPackage, ' with all its classes?')
 	ifTrue: [
 	    Smalltalk current removePackage: selectedPackage.
 	    self updateCategoriesList]
@@ -753,7 +753,7 @@ commitPackageToLocalStorage
 
 addNewClass
 	| className |
-	className := self prompt: 'New class'.
+	className := window prompt: 'New class'.
 	(className notNil and: [className notEmpty]) ifTrue: [
 		Object subclass: className instanceVariableNames: '' package: self selectedPackage.
           	 self 
@@ -1453,7 +1453,7 @@ eval: aString
 	| compiler  |
 	compiler := Compiler new.
 	[compiler parseExpression: aString] on: Error do: [:ex |
-		^self alert: ex messageText].
+		^window alert: ex messageText].
 	^(compiler load: 'doIt ^[', aString, '] value' forClass: DoIt) fn applyTo: self receiver arguments: #()
 !
 

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů