value__ntId__ntName __ntTemplate viewBounds stepChildrenviewSetupFormScriptformatReferenceReorientToScreen declareSelf citeCursorviewQuitScriptlast_t statusBarSlotinArray getAllEntries copyright  __ntDatatype __ntFlagsÿÌ PROT@    RECT ¾ç    ARAY     text  viewJustifyviewTransferModeviewFont viewFormat   ÿh @    EVAL4"CardCite Reference Tool"    lefttoprightbottomÿÿÿÿüP   ÿØ NUMB    /   *ROM_fontSystem10bold &    /protoStaticText title    __ntDeclare   viewFlags #     ÿ( CLAS@     * + , -\ÿÿÿÿ¤ÿÿÿÿ”    /„    /ÿ @         7   9 " #viewLineSpacing viewClickScript styles   ÿD ;@     * + , - ÿÿÿÿðÿÿÿÿì    /ÿ*„    &simpleFont10    /    /@   ÿ‚"CardCite Reference Utility\nFormats Reference Cards (Article,Book) in Newton Names ®1997, Sine of the Times - A CardMedia Utility\nVersion 1.01\nby Robert Lee & Ashish Mishra - October 1997" &   ÿ&func(unit) begin // Return true if click has been completely handled, nil otherwise self:sethilite(0,strlen(self.text),1); self:syncview(); end SCPT   ÿÀ /   [] &clParagraphViewref ÿ   ÿÀ /clViewrefHolder    ViewScroll2DScript   ÿ @ @   ÿðfunc(direction,extras) begin if (direction = 'down) then begin ref.viewbounds.top:=clone(ref.viewbounds.top-20); ref.viewbounds.bottom:=clone(ref.viewbounds.bottom+20); ref:syncview(); end; else begin if (ref.viewbounds.top < 0) then begin ref.viewbounds.top:=clone(ref.viewbounds.top+20); ref.viewbounds.bottom:=clone(ref.viewbounds.bottom-20); ref:syncview(); end; end; RefreshViews(); Inherited:?ViewScroll2DScript(direction,extras); end SprotoUpDownScroller       ÿp @           ÿŒ @protoLargeClosebox   buttonClickScripticon labelCommandspickActionScript     ÿ @    Slfunc() begin dopopup(labelcommands,0,14,self); end    __ntResId__ntExternFile__ntCreateMask __ntPictNamevdescÿPÿfsSpec Development¯0Á¹BDÒøIconÓ«k¨êrsrcRSEDCardMedia 1.62 ÒøBp’DDevelopment:Newton Development:Sine of the Times:CardMedia 1.62:Iconÿÿaction_buttonclassimagesmask maskstrategypictureresourcefilespecÿP | ‡ ˆÿP | PICT   T["Copy to Notes", "Copy to Newton Works"] &   ÿ:func(itemSelected) begin prefsEntry := GetAppPrefs('CardCite, {tag: "CardCite"}); if itemSelected = 0 then begin if prefsEntry.notesPrefs then getroot().paperroll:Open(); paperroll:MakeTextNote(ref.text,true); end; if itemSelected = 1 then begin local range, saveData, prefsEntry; if prefsEntry.wrksPrefs then if getroot().newtworks then begin getroot().newtworks:Open(); local textView := BuildContext( { _proto: protoTXView, viewBounds: SetBounds(0,0,0,0), viewFlags: 0, ReorientToScreen: ROM_DefRotateFunc, viewSetupFormScript: func() begin inherited:?viewSetupFormScript(); self:SetStore(GetDefaultStore()); end, }); textView:Open(); range := {first: 0, last: 0}; textView:Replace(range, {text: ref.text}, nil); range.last := textView:GetCountCharacters(); textView:ChangeRangeRuns(range, {size: 10}, nil, true); // get the data in an external form for the Works soup saveData := textView:Externalize(); textView:Close(); // Create a new Works document from the data GetRoot().NewtWorks:AdoptEntryFromStationery( { title: "CardCite Data", saveData: saveData, hiliteRange: {first: 0, last: 0}, margins: {top: 72, left: 72, right: 72, bottom: 72}, }, 'paper, GetDefaultStore()); end; else :Notify(kNotifyAlert,"CardCite","Newton Works is not installed or the package is frozen." & $\0D & $\0D & "The Newton Works package must be installed and unfrozen prior to copying citations."); end; end S    * + , -ÿÿÿÿ ÿÿÿÿä4    ÿ  /protoPictureButton    9 DoInfoAbout DoInfoPrefs     ÿx @    /ÿ    ÿRfunc() begin //Return true if click has been completely handled, nil otherwise self:notify(knotifyqalert,kAppName && "CardMEDIA","© 1997, Sine of the Times" & $\0D & "A CardMEDIA System Utility" & $\0D & $\0D & "Version 1.0" & $\0D & "by Robert Lee & Ashish Mishra"); //about:Open(); end S   ÿàfunc() begin local prefsBox := BuildContext( { _proto: protoFloatNGo, ReorientToScreen: ROM_DefRotateFunc, viewBounds:{left: 0, top: 85, right: 225, bottom: 175}, viewSetupFormScript: func() begin inherited:?viewSetupFormScript(); end;}); local ckWorksPrefs := {text: "Open NewtWorks on Paste", viewBounds:{left: 5, top: 35, right: 140, bottom: 45}, viewValue: nil, viewSetupFormScript: func() begin local prefsEntry; prefsEntry := GetAppPrefs('CardCite, {tag: "CardCite", wrksPrefs: nil, notesPrefs: nil, installDate: Time()}); Print(prefsEntry); if prefsEntry.wrksPrefs <> nil then SetValue(self, 'viewValue, true); end, valueChanged: func() begin local prefsEntry; prefsEntry := GetAppPrefs('CardCite, {tag: "CardCite", wrksPrefs: nil, notesPrefs: nil, installDate: Time()}); Print(self.viewValue); if self.viewValue then prefsEntry.wrksPrefs := 1; else prefsEntry.wrksPrefs := nil; EntryChangeXMit(prefsEntry,nil); end, _proto: @164 /* protoCheckBox */ }; local ckNotesPrefs := {text: "Open Notes on Paste", viewBounds:{left: 5, top: 55, right: 140, bottom: 65}, viewValue: nil, viewSetupFormScript: func() begin local prefsEntry; prefsEntry := GetAppPrefs('CardCite, {tag: "CardCite", wrksPrefs: nil, notesPrefs: nil, installDate: Time()}); if prefsEntry.notesPrefs <> nil then SetValue(self, 'viewValue, true); end, valueChanged: func() begin local prefsEntry; prefsEntry := GetAppPrefs('CardCite, {tag: "CardCite", wrksPrefs: nil, notesPrefs: nil, installDate: Time()}); if self.viewValue then prefsEntry.notesPrefs := 1; else prefsEntry.notesPrefs := nil; EntryChangeXMit(prefsEntry,nil); end, _proto: @164 /* protoCheckBox */ }; local prefsText := {text: "CardCite Preferences", viewBounds: {left: -8, top: -8, right: 8, bottom: 16}, viewFlags: 7, viewFormat: 1246, viewTransferMode: 4, viewJustify: 8388666, viewFont: ROM_fontSystem10Bold, _proto: @218 /* protoStaticText */ }; prefsBox:Open(); AddStepView(prefsBox, ckWorksPrefs); AddStepView(prefsBox, ckNotesPrefs); AddStepView(prefsBox, prefsText); prefsBox:Dirty(); RefreshViews(); end S    * + , -ÿÿÿÿ°ÿÿÿÿä4    ÿ  /protoInfoButtonÿprotoStatusBarÿ   ÿ // be sure to call inherited:?ViewSetupFormScript() func() begin local b, d, valEntries, spacing; valEntries := 0; if citeCursor then begin while citeCursor:Entry() <> nil do begin d := citeCursor:Entry(); Print(d.class); if d.class = '|CM Book:Soft| or d.class = '|CM Article:Soft| then valEntries := valEntries + 1; citeCursor:Next(); end; end; Print(valEntries); local b := getAppParams(); local appRatio := b.appareaheight/b.appareawidth; spacing := valEntries; if spacing >= 4 then spacing := 4; if spacing = 0 then spacing := 1; if appRatio > 1 then appLength := 100 * appRatio + (60 * (spacing - 1)); else appLength := 160 * appRatio + (60 * (spacing - 1)); self.viewbounds := relbounds(2,b.appareatop + 12,b.appareawidth - 30, RinttoL(appLength)); if citeCursor then begin if valEntries = 0 then :Notify(kNotifyAlert,"CiteCard","No valid reference entries were selected"); else begin citeCursor:Reset(); :getAllEntries(); end; end; inherited:?ViewSetupFormScript(); end S   ÿ!¦func(numEntries) begin local fa, r, m , c, fontdata, t, i, pageText, numEntries, workArray, outArray, numb; i := 0; outarray:=[]; workArray:=[]; numb := nil; workArray := clone(inArray); if numEntries > 1 then numb := true; for i := 0 to numEntries - 1 do begin b := workArray[i]; if b.class = '|CM Article:Soft| then begin fa:=[]; addarrayslot(fa,b.authors); addarrayslot(fa,b.title); addarrayslot(fa,b.journal); addarrayslot(fa,b.volume); addarrayslot(fa,b.issue); if b.release_date=nil then addarrayslot(fa, b.release_date) else addarrayslot(fa,longdatestr(b.release_date,rom_datetimestrspecs.numericYearStrSpec)); addarrayslot(fa,b.page); if b.page then if not IsNumber(StringToNumber(b.page)) then pageText := "pp."; else pageText := "p."; else pageText := ""; addarrayslot(fa,pageText); t:=paramstr("^?0^0||^?1, \"^1,\"||^?2, ^2||^?3, Vol. ^3||^?4, No. ^4||^?5, ^5||^?6, ^7 ^6||.",fa); if t[strlen(t)-1] <> $. then t:=t & "."; t := t & $\0D & $\0D; if numb then t := numberstr(i + 1) & ". " & t; if isstring(t) then begin strreplace(t,"..",".,",nil); //strreplace(t,".,",".",nil); strreplace(t,",,",",",nil); strreplace(t,",.",",",nil); strreplace(t, "\"," , "\"",nil); addarrayslot(outarray,t); end; r := strpos(t,b.journal,0); m := strlen(b.journal); fontData := []; fontData := deepclone(ref.styles); AddArraySlot(fontData, r); AddArraySlot(fontData, simpleFont10); AddArraySlot(fontData, m); AddArraySlot(fontData, simpleFont10 + tsItalic); AddArraySlot(fontData, strlen(t) - m - r); AddArraySlot(fontData, simpleFont10); setValue(ref,'styles, fontData); end; else if b.class = '|CM Book:Soft| then begin fa:=[]; addarrayslot(fa,b.authors); addarrayslot(fa,b.title); addarrayslot(fa,b.location); addarrayslot(fa,b.publisher); if b.release_date=nil then addarrayslot(fa, b.release_date) else addarrayslot(fa,longdatestr(b.release_date,rom_datetimestrspecs.numericYearStrSpec)); addarrayslot(fa,b.page); if b.page then if not IsNumber(StringToNumber(b.page)) then pageText := "pp."; else pageText := "p."; else pageText := ""; addarrayslot(fa,pageText); t:=paramstr("^?0^0,||^?1 ^1,||^?3 ^3,||^?2 ^2||^?4, ^4||^?5, ^6 ^5",fa); if t[strlen(t)-1] <> $. then t:=t & "."; t := t & $\0D & $\0D; if numb then t := numberstr(i + 1) & ". " & t; if isstring(t) then begin strreplace(t,"..",".,",nil); //strreplace(t,".,",".",nil); strreplace(t,",,",",",nil); strreplace(t,",.",",",nil); //strreplace(t, "\"," , ",\"",nil); addarrayslot(outarray,t); end; r := strpos(t,b.title,0); m := strlen(b.title); fontData := []; fontData := deepclone(ref.styles); AddArraySlot(fontData, r); AddArraySlot(fontData, simpleFont10); AddArraySlot(fontData, m); AddArraySlot(fontData, simpleFont10 + tsItalic); AddArraySlot(fontData, strlen(t) - m - r); AddArraySlot(fontData, simpleFont10); setValue(ref,'styles, fontData); end; else t:=nil; citeCursor:Next(); end; outtext:=""; if numEntries > 1 then begin foreach index, entry in outarray do begin outtext := outtext & entry; end; end; else outtext := outarray[0]; setvalue(ref,'text,outtext); end S   Bfunc() begin base:Close(); end S    'base &   nil &   ÿ‚// must return the value of inherited:?ViewQuitScript() func() begin citeCursor := nil; numEntries := nil; inArray := nil; //prefsBox:Close(); inherited:?ViewQuitScript(); end S    /   'status &    ® &   ÿôfunc() begin local numEntries := 0; local workArray := []; local d := nil; local athcheck := nil; while citeCursor:Entry() <> nil do begin d := citeCursor:Entry(); if d.class = '|CM Book:Soft| or d.class = '|CM Article:Soft| then begin AddArraySlot(workArray, citeCursor:Entry()); numEntries := numEntries + 1; if not d.authors then athcheck := true; end; citeCursor:Next(); end; if athcheck then :Notify(kNotifyAlert, "CardCite", "The citations have not been sorted. One or more the the selected records has no author(s) entered."); else Sort(workArray, '|str<|, 'authors); self.inArray := clone(workArray); :formatReference(numEntries); end S   ÿ°// Copyright 1997-1998 Sine of the Times. All Rights Reserved. // You may freely modify and distribute this source code // as long as you make it clear that it has originated from // Sine of the Times source files. EVAL€ protoFloaterbaseview