├── images ├── border.png ├── loading.gif ├── overlay.png ├── controls.png └── cbversuszoterovid.jpg ├── .scrutinizer.yml ├── index.php ├── LICENSE.txt ├── includes ├── colorbox.css ├── css.css ├── jquery_plugins │ ├── jquery.colorboxmin.js │ └── jquery.form.js ├── js │ └── document_ready.js ├── functions.php └── formats │ ├── apa6_format.php │ └── mla7_format.php ├── cite.php ├── README.md ├── templates ├── websitetemplate.php ├── scholarjournaltemplate.php ├── bookchaptertemplate.php ├── magazinetemplate.php ├── booktemplate.php └── newspapertemplate.php └── citationbuild.php /images/border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpforfree/citationbuilder/HEAD/images/border.png -------------------------------------------------------------------------------- /images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpforfree/citationbuilder/HEAD/images/loading.gif -------------------------------------------------------------------------------- /images/overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpforfree/citationbuilder/HEAD/images/overlay.png -------------------------------------------------------------------------------- /images/controls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpforfree/citationbuilder/HEAD/images/controls.png -------------------------------------------------------------------------------- /images/cbversuszoterovid.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpforfree/citationbuilder/HEAD/images/cbversuszoterovid.jpg -------------------------------------------------------------------------------- /.scrutinizer.yml: -------------------------------------------------------------------------------- 1 | # .scrutinizer.yml 2 | 3 | checks: 4 | php: 5 | code_rating: true 6 | duplication: true 7 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 17 | 18 |
Cite a... 8 | 16 |
19 | 20 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | * Citation Builder 2 | * Documentation at: https://github.com/phpforfree/citationbuilder 3 | * Developed by Jason Walsh 4 | * Version: 1.0 (12-DEC-2011) 5 | * https://github.com/phpforfree/citationbuilder/LICENSE.txt 6 | * Copyright (c) 2011 North Carolina State University 7 | 8 | Licensed under the Educational Community License version 1.0 9 | 10 | This Original Work, including software, source code, documents, 11 | or other related items, is being provided by the copyright holder(s) 12 | subject to the terms of the Educational Community License. By 13 | obtaining, using and/or copying this Original Work, you agree that you 14 | have read, understand, and will comply with the following terms and 15 | conditions of the Educational Community License: 16 | 17 | Permission to use, copy, modify, merge, publish, distribute, and 18 | sublicense this Original Work and its documentation, with or without 19 | modification, for any purpose, and without fee or royalty to the 20 | copyright holder(s) is hereby granted, provided that you include the 21 | following on ALL copies of the Original Work or portions thereof, 22 | including modifications or derivatives, that you make: 23 | 24 | 25 | The full text of the Educational Community License in a location viewable to 26 | users of the redistributed or derivative work. 27 | 28 | 29 | Any pre-existing intellectual property disclaimers, notices, or terms and 30 | conditions. 31 | 32 | 33 | 34 | Notice of any changes or modifications to the Original Work, including the 35 | date the changes were made. 36 | 37 | 38 | Any modifications of the Original Work must be distributed in such a manner as 39 | to avoid any confusion with the Original Work of the copyright holders. 40 | 41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 42 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 43 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 44 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 45 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 46 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 47 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 48 | 49 | The name and trademarks of copyright holder(s) may NOT be used 50 | in advertising or publicity pertaining to the Original or Derivative 51 | Works without specific, written prior permission. Title to copyright in 52 | the Original Work and any associated documentation will at all times 53 | remain with the copyright holders. -------------------------------------------------------------------------------- /includes/colorbox.css: -------------------------------------------------------------------------------- 1 | /* 2 | ColorBox Core Style 3 | The following rules are the styles that are consistant between themes. 4 | Avoid changing this area to maintain compatability with future versions of ColorBox. 5 | */ 6 | #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} 7 | #cboxOverlay{position:fixed; width:100%; height:100%;} 8 | #cboxMiddleLeft, #cboxBottomLeft{clear:left;} 9 | #cboxContent{position:relative; overflow:hidden;} 10 | #cboxLoadedContent{overflow:auto;} 11 | #cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;} 12 | #cboxTitle{margin:0;} 13 | #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;} 14 | #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} 15 | 16 | /* 17 | Example user style 18 | The following rules are ordered and tabbed in a way that represents the 19 | order/nesting of the generated HTML, so that the structure easier to understand. 20 | */ 21 | #cboxOverlay{background:url(../images/overlay.png) 0 0 repeat;} 22 | #colorbox{} 23 | #cboxTopLeft{width:21px; height:21px; background:url(../images/controls.png) -100px 0 no-repeat;} 24 | #cboxTopRight{width:21px; height:21px; background:url(../images/controls.png) -129px 0 no-repeat;} 25 | #cboxBottomLeft{width:21px; height:21px; background:url(../images/controls.png) -100px -29px no-repeat;} 26 | #cboxBottomRight{width:21px; height:21px; background:url(../images/controls.png) -129px -29px no-repeat;} 27 | #cboxMiddleLeft{width:21px; background:url(../images/controls.png) left top repeat-y;} 28 | #cboxMiddleRight{width:21px; background:url(../images/controls.png) right top repeat-y;} 29 | #cboxTopCenter{height:21px; background:url(../images/border.png) 0 0 repeat-x;} 30 | #cboxBottomCenter{height:21px; background:url(../images/border.png) 0 -29px repeat-x;} 31 | #cboxContent{background:#fff;} 32 | #cboxLoadedContent{margin-bottom:28px;} 33 | #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;} 34 | #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;} 35 | #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;} 36 | #cboxPrevious{position:absolute; bottom:0; left:0px; background:url(../images/controls.png) -75px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;} 37 | #cboxPrevious.hover{background-position:-75px -25px;} 38 | #cboxNext{position:absolute; bottom:0; left:27px; background:url(../images/controls.png) -50px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;} 39 | #cboxNext.hover{background-position:-50px -25px;} 40 | #cboxLoadingGraphic{background:url(../images/loading.gif) center center no-repeat;} 41 | #cboxClose{bottom: 0px; color: #4C83AF; display: block; position: absolute; right: 0px; font-size: 12px;} 42 | #cboxClose.hover{background-position:-25px -25px;} -------------------------------------------------------------------------------- /cite.php: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |

Citation Builder

25 |
26 |
27 |
28 | 51 |
52 |
53 | Cite a... 54 | 55 | 56 | 66 | 67 | 68 | 71 | 72 |
57 | 65 |
69 | x Close 70 |
73 |
74 |
75 | 76 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | Citation Builder, version 1.0 4 | Developed by Jason Walsh 5 | December 12, 2011 6 | 7 | 8 | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/royopa/citationbuilder/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/royopa/citationbuilder/?branch=master) 9 | [![Build Status](https://scrutinizer-ci.com/g/royopa/citationbuilder/badges/build.png?b=master)](https://scrutinizer-ci.com/g/royopa/citationbuilder/build-status/master) 10 | 11 | CONTENTS OF THIS FILE 12 | ------------------------------------ 13 | 14 | * About Citation Builder 15 | * Installing Citation Builder 16 | * Customizing Citation Builder 17 | * Extending Citation Builder 18 | 19 | 20 | ABOUT CITATION BUILDER 21 | --------------------------------------- 22 | 23 | Citation Builder is a web-based tool designed to quickly and easily generate citations for sources consulted during the research process. While powerful tools such as RefWorks, Zotero, and Endnote exist to generate citations, understanding how to use these tools can require an investment of time. Citation Builder is an attempt to provide a low-barrier method for users to generate citations for commonly consulted source media in either APA (American Psychological Association) or MLA (Modern Language Association) formats. 24 | 25 | For more information, visit our Github space at: http://github.com/phpforfree/citationbuilder or the North Carolina State University project page at: http://www.lib.ncsu.edu/dli/projects/citationbuilder/ 26 | 27 | For a demo of Citation Builder, visit the North Carolina State University Libraries installation at: http://www.lib.ncsu.edu/citationbuilder/ 28 | 29 | INSTALLING CITATION BUILDER 30 | ---------------------------------------------- 31 | 32 | Please note: Citation Builder installation requires the inclusion of jQuery libraries and plugins that are neither developed nor maintained by the Citation Builder developer. 33 | 34 | Citation Builder installation requires the following: 35 | 1. A web server running PHP 5.2.6 or later: http://php.net 36 | 2. Inclusion of jQuery 1.4 or later: http://jquery.com 37 | 3. Inclusion of jQuery UI 1.8.6 or later: http://jqueryui.com 38 | 4. Inclusion of jQuery Form Plugin: http://jquery.malsup.com/form/ 39 | 5. Inclusion of jQuery Colorbox Plugin: http://colorpowered.com/colorbox/ 40 | 6. Knowledge of PHP scripting and Javascripting 41 | 42 | To install Citation Builder: 43 | 1. Copy the Citation Builder source code to a directory on your web server. 44 | 2. Visit the directory you created in a web browser. 45 | 46 | EXTENDING CITATION BUILDER 47 | ---------------------------------------------- 48 | 49 | Citation Builder only supports APA and MLA citation formats. In addition, Citation Builder only supports books (in entirety), chapters or essays from books, magazines, newspapers, scholarly journal articles, and web sites as citation mediums. Additional citation formats or citation mediums could be added to Citation Builder, if desired. Development and support of any and all additions to the Citation Builder framework are the responsibility of the developing entity. Feel free to fork the project. 50 | 51 | RECOMMENDATIONS FOR ADDING ADDITIONAL FORMATS 52 | -------------------------------------------- 53 | 54 | 1. Store your format specific functions in an identifiable file in the directory: includes/formats/ 55 | 2. Include the format specific functions file you created in #1 at the end of the file: includes/functions.php. The includes/functions.php file is a set of functions that 56 | any format/medium in Citation Builder can use. 57 | 3. Add the appropriate PHP logic to the end of the PHP switch cases in the file 58 | citationbuild.php to call the medium specific citation parsing functions you created in #1 59 | 4. Add your new format to the Citation Builder interface. This can be found as the 60 | first function in the file: includes/functions.php. The function is named: heading. 61 | -------------------------------------------------------------------------------- /includes/css.css: -------------------------------------------------------------------------------- 1 | input[type="text"] { 2 | font-size: 14px; 3 | padding: 3px; 4 | } 5 | 6 | input[type="text"]:focus { 7 | color:#000; 8 | outline:none; 9 | border:#4C83AF 1px solid; 10 | box-shadow: 0 0 5px rgba(76, 131, 175, 1); 11 | -webkit-box-shadow: 0 0 5px rgba(76, 131, 175, 1); 12 | -moz-box-shadow: 0 0 5px rgba(76, 131, 175, 1); 13 | } 14 | 15 | table { 16 | border-collapse: separate !important; 17 | border-spacing: 2px !important; 18 | } 19 | 20 | .styleheading { 21 | font-style: italic; 22 | text-decoration: underline; 23 | } 24 | 25 | .italics { 26 | font-style: italic; 27 | } 28 | 29 | .small { 30 | font-size: 12px; 31 | padding-left: 2px; 32 | } 33 | 34 | .sectionlabel { 35 | font-size: 14px !important; 36 | vertical-align: top; 37 | padding-right: 15px !important; 38 | padding-top: 6px !important; 39 | text-align: right; 40 | width: 180px; 41 | } 42 | 43 | .required { 44 | color: #cc0000; 45 | } 46 | 47 | .addcontributor { 48 | border-top: 1px solid #AAAAAA; 49 | padding-top: 8px !important; 50 | padding-bottom: 20px !important; 51 | text-align: right; 52 | } 53 | 54 | .contribaddlink { 55 | font-weight: bold; 56 | } 57 | 58 | .section { 59 | background-color: #F0F0F0; 60 | border-top: 1px solid #AAAAAA; 61 | } 62 | 63 | .sectionchild { 64 | background-color: #F0F0F0; 65 | border-left: 1px solid #AAAAAA; 66 | border-right: 1px solid #AAAAAA; 67 | } 68 | 69 | .header { 70 | background-color: #F0F0F0; 71 | border-top: 1px solid #AAAAAA; 72 | border-left: 1px solid #AAAAAA; 73 | border-right: 1px solid #AAAAAA; 74 | padding-bottom: 10px; 75 | padding-left: 20px; 76 | padding-top: 10px; 77 | } 78 | 79 | .footer { 80 | background-color: #F0F0F0; 81 | border-bottom: 1px solid #AAAAAA; 82 | border-left: 1px solid #AAAAAA; 83 | border-right: 1px solid #AAAAAA; 84 | padding-bottom: 20px; 85 | } 86 | 87 | #change { 88 | font-size: 12px; 89 | padding-left: 3px; 90 | padding-top: 9px; 91 | } 92 | 93 | .remove { 94 | padding-top: 8px; 95 | padding-left: 3px; 96 | } 97 | 98 | .submitclass { 99 | margin-top: 20px; 100 | background-color:#666666; 101 | color:white; 102 | } 103 | 104 | .submitclass:hover { 105 | margin-top: 20px; 106 | background-color:#AAAAAA; 107 | color:white; 108 | } 109 | 110 | .citationholder { 111 | background-color: #ffa; 112 | padding: 20px; 113 | border-top: 1px solid #AAAAAA; 114 | border-bottom: 1px solid #AAAAAA; 115 | } 116 | 117 | .placeholder { 118 | display: none; 119 | } 120 | 121 | .sourcechangeholder { 122 | display: none; 123 | background: #FFFFFF; 124 | z-index: 2; 125 | position: absolute; 126 | left: 0px; 127 | top: 0px; 128 | border-top: 1px solid #AAAAAA; 129 | border-left: 1px solid #AAAAAA; 130 | border-right: 1px solid #AAAAAA; 131 | border-bottom: 1px solid #AAAAAA; 132 | padding: 20px; 133 | } 134 | 135 | .monthdropdown { 136 | padding-top: 10px; 137 | } 138 | 139 | #mysourcewas { 140 | font-weight: normal; 141 | float: left; 142 | padding-right: 5px; 143 | padding-top: 4px; 144 | } 145 | 146 | #pagenccheck { 147 | padding-top: 15px; 148 | padding-left: 3px; 149 | } 150 | 151 | #stylechoice { 152 | padding-top: 13px; 153 | font-size: 14px; 154 | } 155 | 156 | .styleselected { 157 | font-weight: bold; 158 | color: #555555; 159 | } 160 | 161 | /*jQuery UI Tabs*/ 162 | .ui-tabs .ui-tabs-panel { 163 | padding: 0px; 164 | } 165 | 166 | .ui-widget-header { 167 | background: #FFF; 168 | border: 0px; 169 | } 170 | 171 | .ui-widget-content { 172 | border: 0px; 173 | } 174 | 175 | .ui-corner-bottom { 176 | border: 1pz solid #AAAAAA; 177 | } 178 | 179 | /* Interaction states 180 | ----------------------------------*/ 181 | .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { 182 | border: 1px solid #d3d3d3; 183 | font-weight: normal; 184 | color: #555555; 185 | } 186 | .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { 187 | color: #555555; 188 | text-decoration: none; 189 | } 190 | .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { 191 | border: 1px solid #999999; 192 | font-weight: normal; 193 | color: #212121; 194 | } 195 | .ui-state-hover a, .ui-state-hover a:hover { 196 | color: #212121; 197 | text-decoration: none; 198 | } 199 | .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { 200 | border: 1px solid #aaaaaa; 201 | font-weight: normal; 202 | color: #212121; 203 | } 204 | .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { 205 | color: #212121; 206 | text-decoration: none; 207 | } 208 | .ui-widget :active { 209 | outline: none; 210 | } -------------------------------------------------------------------------------- /templates/websitetemplate.php: -------------------------------------------------------------------------------- 1 | 51 |
52 | 55 |
56 | 65 |
66 |
67 |
68 | 113 |
114 |
115 | 127 |
128 | -------------------------------------------------------------------------------- /templates/scholarjournaltemplate.php: -------------------------------------------------------------------------------- 1 | 64 |
65 | 70 |
71 | 105 |
106 |
107 |
108 |
109 |
110 | 136 |
137 |
138 | 171 |
172 |
173 | 185 |
186 | -------------------------------------------------------------------------------- /templates/bookchaptertemplate.php: -------------------------------------------------------------------------------- 1 | 68 |
69 | 74 |
75 | 104 |
105 |
106 |
107 |
108 |
109 | 142 |
143 |
144 | 173 |
174 |
175 | 187 |
188 | -------------------------------------------------------------------------------- /templates/magazinetemplate.php: -------------------------------------------------------------------------------- 1 | 72 |
73 | 78 |
79 | 103 |
104 |
105 |
106 | 119 |
120 |
121 | 161 |
162 |
163 | 195 |
196 |
197 | 209 |
210 | -------------------------------------------------------------------------------- /templates/booktemplate.php: -------------------------------------------------------------------------------- 1 | 64 |
65 | 71 |
72 | 91 |
92 |
93 |
94 |
95 |
96 | 129 |
130 |
131 | 164 |
165 |
166 | 192 |
193 |
194 | 206 |
207 | -------------------------------------------------------------------------------- /includes/jquery_plugins/jquery.colorboxmin.js: -------------------------------------------------------------------------------- 1 | // ColorBox v1.3.10 - a full featured, light-weight, customizable lightbox based on jQuery 1.3 2 | // Copyright (c) 2010 Jack Moore - jack@colorpowered.com 3 | // Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php 4 | (function(c,lb){var v="none",N="LoadedContent",b=false,x="resize.",o="y",r="auto",f=true,u="click",O="nofollow",q="on",m="x";function e(a,b){a=a?' id="'+j+a+'"':"";b=b?' style="'+b+'"':"";return c("")}function p(a,b){b=b===m?n.width():n.height();return typeof a==="string"?Math.round(a.match(/%/)?b/100*parseInt(a,10):parseInt(a,10)):a}function U(b,d){b=c.isFunction(b)?b.call(d):b;return a.photo||b.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function eb(a){for(var b in a)if(c.isFunction(a[b])&&b.substring(0,2)!==q)a[b]=a[b].call(l);a.rel=a.rel||l.rel||O;a.href=a.href||c(l).attr("href");a.title=a.title||l.title;return a}function y(b,a){a&&a.call(l);c.event.trigger(b)}function mb(){var c,b=j+"Slideshow_",e,f;if(a.slideshow&&i[1]){e=function(){z.text(a.slideshowStop).bind(V,function(){c=setTimeout(d.next,a.slideshowSpeed)}).bind(W,function(){clearTimeout(c)}).one(u,function(){f()});h.removeClass(b+"off").addClass(b+q)};f=function(){clearTimeout(c);z.text(a.slideshowStart).unbind(V+" "+W).one(u,function(){e();c=setTimeout(d.next,a.slideshowSpeed)});h.removeClass(b+q).addClass(b+"off")};z.bind(fb,function(){z.unbind();clearTimeout(c);h.removeClass(b+"off "+b+q)});a.slideshowAuto?e():f()}}function gb(b){if(!P){l=b;a=eb(c.extend({},c.data(l,s)));i=c(l);g=0;if(a.rel!==O){i=c("."+I).filter(function(){return (c.data(this,s).rel||this.rel)===a.rel});g=i.index(l);if(g===-1){i=i.add(l);g=i.length-1}}if(!w){w=H=f;h.show();X=l;try{X.blur()}catch(e){}A.css({opacity:+a.opacity,cursor:a.overlayClose?"pointer":r}).show();a.w=p(a.initialWidth,m);a.h=p(a.initialHeight,o);d.position(0);Y&&n.bind(x+Q+" scroll."+Q,function(){A.css({width:n.width(),height:n.height(),top:n.scrollTop(),left:n.scrollLeft()})}).trigger("scroll."+Q);y(hb,a.onOpen);Z.add(J).add(K).add(z).add(ab).hide();bb.html(a.close).show()}d.load(f)}}var ib={transition:"elastic",speed:300,width:b,initialWidth:"600",innerWidth:b,maxWidth:b,height:b,initialHeight:"450",innerHeight:b,maxHeight:b,scalePhotos:f,scrolling:f,inline:b,html:b,iframe:b,photo:b,href:b,title:b,rel:b,opacity:.9,preloading:f,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:b,loop:f,slideshow:b,slideshowAuto:f,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:b,onLoad:b,onComplete:b,onCleanup:b,onClosed:b,overlayClose:f,escKey:f,arrowKey:f},s="colorbox",j="cbox",hb=j+"_open",W=j+"_load",V=j+"_complete",jb=j+"_cleanup",fb=j+"_closed",R=j+"_purge",kb=j+"_loaded",D=c.browser.msie&&!c.support.opacity,Y=D&&c.browser.version<7,Q=j+"_IE6",A,h,E,t,cb,db,T,S,i,n,k,L,M,ab,Z,z,K,J,bb,F,G,B,C,l,X,g,a,w,H,P=b,d,I=j+"Element";d=c.fn[s]=c[s]=function(b,e){var a=this,d;if(!a[0]&&a.selector)return a;b=b||{};if(e)b.onComplete=e;if(!a[0]||a.selector===undefined){a=c("");b.open=f}a.each(function(){c.data(this,s,c.extend({},c.data(this,s)||ib,b));c(this).addClass(I)});d=b.open;if(c.isFunction(d))d=d.call(a);d&&gb(a[0]);return a};d.init=function(){var l="hover",m="clear:left";n=c(lb);h=e().attr({id:s,"class":D?j+"IE":""});A=e("Overlay",Y?"position:absolute":"").hide();E=e("Wrapper");t=e("Content").append(k=e(N,"width:0; height:0; overflow:hidden"),M=e("LoadingOverlay").add(e("LoadingGraphic")),ab=e("Title"),Z=e("Current"),K=e("Next"),J=e("Previous"),z=e("Slideshow").bind(hb,mb),bb=e("Close"));E.append(e().append(e("TopLeft"),cb=e("TopCenter"),e("TopRight")),e(b,m).append(db=e("MiddleLeft"),t,T=e("MiddleRight")),e(b,m).append(e("BottomLeft"),S=e("BottomCenter"),e("BottomRight"))).children().children().css({"float":"left"});L=e(b,"position:absolute; width:9999px; visibility:hidden; display:none");c("body").prepend(A,h.append(E,L));t.children().hover(function(){c(this).addClass(l)},function(){c(this).removeClass(l)}).addClass(l);F=cb.height()+S.height()+t.outerHeight(f)-t.height();G=db.width()+T.width()+t.outerWidth(f)-t.width();B=k.outerHeight(f);C=k.outerWidth(f);h.css({"padding-bottom":F,"padding-right":G}).hide();K.click(d.next);J.click(d.prev);bb.click(d.close);t.children().removeClass(l);c("."+I).live(u,function(a){if(!(a.button!==0&&typeof a.button!=="undefined"||a.ctrlKey||a.shiftKey||a.altKey)){a.preventDefault();gb(this)}});A.click(function(){a.overlayClose&&d.close()});c(document).bind("keydown",function(b){if(w&&a.escKey&&b.keyCode===27){b.preventDefault();d.close()}if(w&&a.arrowKey&&!H&&i[1])if(b.keyCode===37&&(g||a.loop)){b.preventDefault();J.click()}else if(b.keyCode===39&&(g").children();a.h=b.height();b.replaceWith(b.children())}k.css({height:a.h});d.position(a.transition===v?0:a.speed)}};d.prep=function(o){var f="hidden";function m(t){var m,r,f,o,e=i.length,q=a.loop;d.position(t,function(){if(w){D&&p&&k.fadeIn(100);k.show();y(kb);ab.show().html(a.title);if(e>1){Z.html(a.current.replace(/\{current\}/,g+1).replace(/\{total\}/,e)).show();K[q||g")[0].src=o;if(U(r,m))c("")[0].src=r}}M.hide();if(a.transition==="fade")h.fadeTo(l,1,function(){if(D)h[0].style.filter=b});else if(D)h[0].style.filter=b;n.bind(x+j,function(){d.position(0)});y(V,a.onComplete)}})}if(w){var p,l=a.transition===v?0:a.speed;n.unbind(x+j);k.remove();k=e(N).html(o);k.hide().appendTo(L.show()).css({width:function(){a.w=a.w||k.width();a.w=a.mw&&a.mw");b[0].src=a.href;b.appendTo(k).one(R,function(){b[0].src="about:blank"})});q(" ")}else if(a.html)q(a.html);else if(U(n,l)){b=new Image;b.onload=function(){var e;b.onload=null;b.id=j+"Photo";c(b).css({border:v,display:"block",cssFloat:"left"});if(a.scalePhotos){r=function(){b.height-=b.height*e;b.width-=b.width*e};if(a.mw&&b.width>a.mw){e=(b.width-a.mw)/b.width;r()}if(a.mh&&b.height>a.mh){e=(b.height-a.mh)/b.height;r()}}if(a.h)b.style.marginTop=Math.max(a.h-b.height,0)/2+"px";i[1]&&(g 77 |
78 | 83 |
84 | 103 |
104 |
105 |
106 | 136 |
137 |
138 | 169 |
170 |
171 | 223 |
224 |
225 | 237 |
238 | -------------------------------------------------------------------------------- /includes/js/document_ready.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | $('#stylechoice a').live('click', function() { 3 | $.get($(this).attr("href"), function(data) { 4 | var selectedtab = $('#citeform #tabs').tabs('option', 'selected'); 5 | $('#tabs').tabs('destroy'); 6 | //see if user has filled out form, save old data 7 | //common variables 8 | var articletitleinput = $('#articletitleinput').val(); 9 | var datepublishedday = $('#datepublishedday').val(); 10 | var datepublishedmonth = $('#datepublishedmonth').val(); 11 | var datepublishedyear = $('#datepublishedyear').val(); 12 | var pagesstartinput = $('#pagesstartinput').val(); 13 | var pagesendinput = $('#pagesendinput').val(); 14 | var urlwebsiteinput = $('#urlwebsiteinput').val(); 15 | var electronicpublishday = $('#electronicpublishday').val(); 16 | var electronicpublishmonth = $('#electronicpublishmonth').val(); 17 | var electronicpublishyear = $('#electronicpublishyear').val(); 18 | var webaccessdateday = $('#webaccessdateday').val(); 19 | var webaccessdatemonth = $('#webaccessdatemonth').val(); 20 | var webaccessdateyear = $('#webaccessdateyear').val(); 21 | var dbdatepublisheddateday = $('#dbdatepublisheddateday').val(); 22 | var dbdatepublisheddatemonth = $('#dbdatepublisheddatemonth').val(); 23 | var dbdatepublisheddateyear = $('#dbdatepublisheddateyear').val(); 24 | var dbpagesstartinput = $('#dbpagesstartinput').val(); 25 | var dbpagesendinput = $('#dbpagesendinput').val(); 26 | var dbpagesnonconsecutiveinput = $('#dbpagesnonconsecutiveinput').attr('checked'); 27 | var databaseinput = $('#databaseinput').val(); 28 | var urldbinput = $('#urldbinput').val(); 29 | var dbaccessdateday = $('#dbaccessdateday').val(); 30 | var dbaccessdatemonth = $('#dbaccessdatemonth').val(); 31 | var dbaccessdateyear = $('#dbaccessdateyear').val(); 32 | //source specific variables 33 | var newspapertitleinput = $('#newspapertitleinput').val(); 34 | var editioninput = $('#editioninput').val(); 35 | var sectioninput = $('#sectioninput').val(); 36 | var dbeditioninput = $('#dbeditioninput').val(); 37 | $('#stylechoice').html($(data).find('#stylechoice').html()); 38 | $('#revolvecontent').html($(data).find('#revolvecontent').html()); 39 | //set saved data into new form 40 | //common variables 41 | $('#articletitleinput').val(articletitleinput); 42 | //Date published 43 | if (datepublishedday && !dbdatepublisheddateday) { 44 | $('#datepublishedday').val(datepublishedday); 45 | $('#dbdatepublisheddateday').val(datepublishedday); 46 | } 47 | if (!datepublishedday && dbdatepublisheddateday) { 48 | $('#datepublishedday').val(dbdatepublisheddateday); 49 | $('#dbdatepublisheddateday').val(dbdatepublisheddateday); 50 | } 51 | if (datepublishedmonth && !dbdatepublisheddatemonth) { 52 | $('#datepublishedmonth').val(datepublishedmonth); 53 | $('#dbdatepublisheddatemonth').val(datepublishedmonth); 54 | } 55 | if (!datepublishedmonth && dbdatepublisheddatemonth) { 56 | $('#datepublishedmonth').val(dbdatepublisheddatemonth); 57 | $('#dbdatepublisheddatemonth').val(dbdatepublisheddatemonth); 58 | } 59 | if (datepublishedyear && !dbdatepublisheddateyear) { 60 | $('#datepublishedyear').val(datepublishedyear); 61 | $('#dbdatepublisheddateyear').val(datepublishedyear); 62 | } 63 | if (!datepublishedyear && dbdatepublisheddateyear) { 64 | $('#datepublishedyear').val(dbdatepublisheddateyear); 65 | $('#dbdatepublisheddateyear').val(dbdatepublisheddateyear); 66 | } 67 | //Pages 68 | if (pagesstartinput && !dbpagesstartinput) { 69 | $('#pagesstartinput').val(pagesstartinput); 70 | $('#dbpagesstartinput').val(pagesstartinput); 71 | } 72 | if (pagesendinput && !dbpagesendinput) { 73 | $('#pagesendinput').val(pagesendinput); 74 | $('#dbpagesendinput').val(pagesendinput); 75 | } 76 | 77 | if (!pagesstartinput && dbpagesstartinput) { 78 | $('#pagesstartinput').val(dbpagesstartinput); 79 | $('#dbpagesstartinput').val(dbpagesstartinput); 80 | } 81 | if (!pagesendinput && dbpagesendinput) { 82 | $('#pagesendinput').val(dbpagesendinput); 83 | $('#dbpagesendinput').val(dbpagesendinput); 84 | } 85 | //URL 86 | if (urlwebsiteinput && !urldbinput) { 87 | $('#urlwebsiteinput').val(urlwebsiteinput); 88 | $('#urldbinput').val(urlwebsiteinput); 89 | } 90 | if (!urlwebsiteinput && urldbinput) { 91 | $('#urlwebsiteinput').val(urldbinput); 92 | $('#urldbinput').val(urldbinput); 93 | } 94 | $('#electronicpublishday').val(electronicpublishday); 95 | $('#electronicpublishmonth').val(electronicpublishmonth); 96 | $('#electronicpublishyear').val(electronicpublishyear); 97 | //Access date 98 | if (webaccessdateday && !dbaccessdateday) { 99 | $('#webaccessdateday').val(webaccessdateday); 100 | $('#dbaccessdateday').val(webaccessdateday); 101 | } 102 | if (webaccessdatemonth && !dbaccessdatemonth) { 103 | $('#webaccessdatemonth').val(webaccessdatemonth); 104 | $('#dbaccessdatemonth').val(webaccessdatemonth); 105 | } 106 | if (webaccessdateyear && !dbaccessdateyear) { 107 | $('#webaccessdateyear').val(webaccessdateyear); 108 | $('#dbaccessdateyear').val(webaccessdateyear); 109 | } 110 | if (!webaccessdateday && dbaccessdateday) { 111 | $('#webaccessdateday').val(dbaccessdateday); 112 | $('#dbaccessdateday').val(dbaccessdateday); 113 | } 114 | if (!webaccessdatemonth && dbaccessdatemonth) { 115 | $('#webaccessdatemonth').val(dbaccessdatemonth); 116 | $('#dbaccessdatemonth').val(dbaccessdatemonth); 117 | } 118 | if (!webaccessdateyear && dbaccessdateyear) { 119 | $('#webaccessdateyear').val(dbaccessdateyear); 120 | $('#dbaccessdateyear').val(dbaccessdateyear); 121 | } 122 | $('#databaseinput').val(databaseinput); 123 | //source specific variables 124 | $('#newspapertitleinput').val(newspapertitleinput); 125 | //Edition 126 | if (editioninput && !dbeditioninput) { 127 | $('#editioninput').val(editioninput); 128 | $('#dbeditioninput').val(editioninput); 129 | } 130 | if (!editioninput && dbeditioninput) { 131 | $('#editioninput').val(dbeditioninput); 132 | $('#dbeditioninput').val(dbeditioninput); 133 | } 134 | $('#sectioninput').val(sectioninput); 135 | 136 | //set tabs 137 | $('#citeform #tabs').tabs({selected: selectedtab}); 138 | $('.print').click(function(){ 139 | $('#mediumholder').attr('value','print'); 140 | }); 141 | $('.website').click(function(){ 142 | $("#mediumholder").attr('value','website'); 143 | }); 144 | $('.db').click(function(){ 145 | $('#mediumholder').attr('value','db'); 146 | }); 147 | $('.ebook').click(function(){ 148 | $('#mediumholder').attr('value','ebook'); 149 | }); 150 | //prevent entering both fields on an OR choice 151 | $('#urlwebsiteinput').blur(function(){ 152 | if($('#urlwebsiteinput').val() != '') { 153 | $('#doiwebsiteinput').attr('disabled','disabled'); 154 | }else{ 155 | $('#doiwebsiteinput').removeAttr('disabled'); 156 | } 157 | }); 158 | $('#doiwebsiteinput').blur(function(){ 159 | if($('#doiwebsiteinput').val() != '') { 160 | $('#urlwebsiteinput').attr('disabled','disabled'); 161 | }else{ 162 | $('#urlwebsiteinput').removeAttr('disabled'); 163 | } 164 | }); 165 | $('#urldbinput').blur(function(){ 166 | if($('#urldbinput').val() != '') { 167 | $('#doidbinput').attr('disabled','disabled'); 168 | }else{ 169 | $('#doidbinput').removeAttr('disabled'); 170 | } 171 | }); 172 | $('#doidbinput').blur(function(){ 173 | if($('#doidbinput').val() != '') { 174 | $('#urldbinput').attr('disabled','disabled'); 175 | }else{ 176 | $('#urldbinput').removeAttr('disabled'); 177 | } 178 | }); 179 | $('#urlebookinput').blur(function(){ 180 | if($('#urlebookinput').val() != '') { 181 | $('#doiebookinput').attr('disabled','disabled'); 182 | }else{ 183 | $('#doiebookinput').removeAttr('disabled'); 184 | } 185 | }); 186 | $('#doiebookinput').blur(function(){ 187 | if($('#doiebookinput').val() != '') { 188 | $('#urlebookinput').attr('disabled','disabled'); 189 | }else{ 190 | $('#urlebookinput').removeAttr('disabled'); 191 | } 192 | }); 193 | }); 194 | return false; 195 | }); 196 | $('#citeform').ajaxForm({ 197 | //target identifies the element(s) to update with the server response 198 | target: '#placeholder', 199 | 200 | //success identifies the function to invoke when the server response 201 | //has been received; here we apply a fade-in effect to the new content 202 | success: function() { 203 | $.colorbox({ 204 | overlayClose: false, 205 | speed: 500, 206 | inline:true, 207 | opacity: 0.65, 208 | close: "x Close", 209 | href:"#overallcitationholder", 210 | width: "900px" 211 | }); 212 | } 213 | }); 214 | $('#change').click(function(){ 215 | $('#sourcechangeholder').show(700); 216 | return false; 217 | }) 218 | $('#close').click(function(){ 219 | $('#sourcechangeholder').hide(700); 220 | return false; 221 | }) 222 | $('#tabs').tabs({selected : 1}); 223 | $('.print').click(function(){ 224 | $('#mediumholder').attr('value','print'); 225 | }); 226 | $('.website').click(function(){ 227 | $('#mediumholder').attr('value','website'); 228 | }); 229 | $('.db').click(function(){ 230 | $('#mediumholder').attr('value','db'); 231 | }); 232 | $('.ebook').click(function(){ 233 | $('#mediumholder').attr('value','ebook'); 234 | }); 235 | $('#contribaddlink').live('click', function(){ 236 | var id =$('#addidvalue').val(); 237 | $('#adddiv').append('

First

MI

Last / Corporation
'); 238 | 239 | $("#removecontrib" + id + "").click(function(){ 240 | id = --id; 241 | $("#contributor" + id + "").remove(); 242 | return false; 243 | }); 244 | 245 | id = ++id; 246 | $('#addidvalue').val(id); 247 | return false; 248 | }); 249 | $('#pagesnonconsecutiveinput').live('click', function(){ 250 | var styleholder = $('#styleholder').val(); 251 | if($(this).is(":checked")) { 252 | if (styleholder=='apa6'){ 253 | $('#pagesstart').hide(); 254 | $('#pagesend').hide(); 255 | $('#nonconsecutivepagenums').show(); 256 | } 257 | }else{ 258 | if (styleholder=='apa6'){ 259 | $('#pagesstart').show(); 260 | $('#pagesend').show(); 261 | $('#nonconsecutivepagenums').hide(); 262 | } 263 | } 264 | }); 265 | }); -------------------------------------------------------------------------------- /includes/functions.php: -------------------------------------------------------------------------------- 1 | '; 7 | $html .= ''; 11 | $html .= '
'; 8 | $html .= '

' . $heading; 9 | $html .= '

change'; 10 | $html .= '
'; 12 | $html .= 'Citation style: '; 13 | if ($style=="apa6") { 14 | $html .= ' APA 6 '; 15 | }else{ 16 | $html .= ' APA 6 '; 17 | } 18 | if ($style=="mla7") { 19 | $html .= '| MLA 7 '; 20 | }else{ 21 | $html .= '| MLA 7 '; 22 | } 23 | $html .= '
' . "\n"; 24 | echo $html; 25 | } 26 | 27 | /********************************/ 28 | /* Form Inputs */ 29 | /********************************/ 30 | 31 | //Creates a checkbox and label div 32 | 33 | /** 34 | * @param string $id 35 | */ 36 | function checkbox($id, $css) { 37 | $html = ''; 39 | return $html; 40 | } 41 | 42 | //Creates a month drop down list 43 | 44 | /** 45 | * @param string $id 46 | */ 47 | function monthdropdown($id, $css) { 48 | $html = '
'; 49 | $html .= ''; 80 | $html .= '
'; 81 | return $html; 82 | } 83 | 84 | //Creates the submit button 85 | function submitbutton($css) { 86 | $html = ''; 87 | echo $html; 88 | } 89 | 90 | //Creates a textbox and label div 91 | 92 | /** 93 | * @param integer $size 94 | */ 95 | function textbox($id, $css, $size, $maxlength, $value) { 96 | $html = ''; 104 | return $html; 105 | } 106 | 107 | /********************************/ 108 | /* Form Sections */ 109 | /********************************/ 110 | 111 | //Creates the Advanced Info section 112 | function advancedinfo($id) { 113 | $html = ''; 114 | $html .= ''; 115 | $html .= '
'; 116 | $html .= textbox($id . 'volume', textbox, 4, none, novalue); 117 | $html .= '
Volume
'; 118 | $html .= textbox($id . 'issue', textbox, 4, none, novalue); 119 | $html .= '
Issue
'; 120 | $html .= '
'; 121 | echo $html; 122 | } 123 | 124 | //Creates a section and label div 125 | function beginsection($sectionid, $label, $top) { 126 | $html = '
' . "\n\t" . ''; 129 | $html .= $label; 130 | $html .= '' . "\n\t" . ''; 131 | echo $html; 132 | } 133 | 134 | //Creates the Contributor section 135 | function contributor($id) { 136 | $html = ''; 137 | $html .= ''; 138 | $html .= ''; 151 | $html .= ''; 152 | $html .= ''; 153 | $html .= ''; 154 | $html .= ''; 155 | $html .= '
'; 139 | $html .= '' . "\n"; 144 | $html .= ''; 145 | $html .= textbox(contributorfname0, textbox, 10, none, novalue); 146 | $html .= '
First
'; 147 | $html .= textbox(contributormi0, textbox, 1, 1, novalue); 148 | $html .= '
MI
'; 149 | $html .= textbox(contributorlname0, textbox, 12, none, Anonymous); 150 | $html .= '
Last / Corporation
+ Add another contributor
'; 156 | echo $html; 157 | } 158 | 159 | //Creates a date input 160 | function dateinput($id) { 161 | $html = ''; 162 | $html .= ''; 163 | $html .= ''; 170 | $html .= '
'; 164 | $html .= textbox($id . 'day', textbox, 2, 2, novalue); 165 | $html .= '
Day
'; 166 | $html .= monthdropdown($id . 'month', monthdropdown); 167 | $html .= 'Month'; 168 | $html .= textbox($id . 'year', textbox, 4, 4, novalue); 169 | $html .= '
Year
'; 171 | echo $html; 172 | } 173 | 174 | //Closes a section and label div 175 | function endsection () { 176 | $html = "\n\n\n
\n"; 177 | echo $html; 178 | } 179 | 180 | //Creates a footer for the form 181 | function footercreate() { 182 | $html = ''; 183 | echo $html; 184 | } 185 | 186 | //Creates a header for the form 187 | function headercreate() { 188 | $html = ''; 189 | echo $html; 190 | } 191 | 192 | //Creates the Medium input 193 | function mediuminput() { 194 | $html = textbox(mediuminput, textbox, 45, none, novalue); 195 | $html .= '
'; 196 | $html .= 'Ex: PDF, Microsoft Word, MP3, etc.'; 197 | echo $html; 198 | } 199 | 200 | //Creates the Newspaper city input 201 | function newspapercityinput($id) { 202 | $html = textbox($id, textbox, 45, none, novalue); 203 | $html .= '
'; 204 | $html .= 'Only include if city is not in newspaper name'; 205 | echo $html; 206 | } 207 | 208 | //Creates the Pages section 209 | function pages($id) { 210 | $html = ''; 215 | $html .= ''; 218 | $html .= '
'; 211 | $html .= textbox($id . startinput, textbox, 4, none, novalue); 212 | $html .= '
Start
'; 213 | $html .= textbox($id . endinput, textbox, 4, none, novalue); 214 | $html .= '
End
'; 219 | $html .= checkbox($id . nonconsecutiveinput, checkbox); 220 | $html .= 'Pages are non-consecutive
'; 221 | echo $html; 222 | } 223 | 224 | //Creates the Publication Info section 225 | function publicationinfo($id) { 226 | $html = '
'; 227 | $html .= textbox(publisherinput, textbox, 15, none, novalue); 228 | $html .= '
Publisher
'; 229 | $html .= textbox(publisherlocationinput, textbox, 15, none, novalue); 230 | $html .= '
Location
'; 231 | $html .= textbox(publicationyearinput, textbox, 4, 4, novalue); 232 | $html .= '
Year
'; 233 | echo $html; 234 | } 235 | 236 | //Creates a URL input 237 | function urlinput($id, $style, $source, $showor){ 238 | $html = textbox($id, textbox, 45, none, novalue); 239 | if ($style=="apa6") { 240 | if ($showor=="yes") { 241 | $html .= '
OR'; 242 | } 243 | } 244 | if ($style=="mla7") { 245 | $html .= '
MLA 7 says to omit the URL unless the source cannot be located without it, or if your instructor requires it.'; 246 | } 247 | echo $html; 248 | } 249 | 250 | /*****Citation functionality******/ 251 | 252 | /********************************/ 253 | /* String manipulation */ 254 | /********************************/ 255 | 256 | //Converts a passed style variable into the appropriate text 257 | function styleconvert($style) { 258 | switch($style) { 259 | case "apa6": 260 | $html = "APA 6"; 261 | break; 262 | case "mla7": 263 | $html = "MLA 7"; 264 | break; 265 | } 266 | return $html; 267 | } 268 | 269 | //Clean variables of slashes and leading/trailing spaces 270 | function cleanvars($variable) { 271 | $cleanvariable = stripslashes($variable); 272 | $cleanvariable = trim($cleanvariable); 273 | return $cleanvariable; 274 | } 275 | 276 | //Uppercase all words in string 277 | function uppercasewords($string) { 278 | $uppercasestring = ucwords($string); 279 | return $uppercasestring; 280 | } 281 | 282 | //Uppercase first word in a string 283 | function uppercasefirstword($string) { 284 | $lowercasestring = strtolower($string); 285 | $uppercasestring = ucfirst($lowercasestring); 286 | return $uppercasestring; 287 | } 288 | 289 | //Lowercase all words in a string 290 | function lowercasewords($string) { 291 | $lowercasestring = strtolower($string); 292 | return $lowercasestring; 293 | } 294 | 295 | //Uppercase the first word of a subtitle 296 | 297 | /** 298 | * @param string[] $regs 299 | * @param string $string 300 | */ 301 | function subtitleucfirst($string, $regs) { 302 | $ucaftercolon = strtoupper($regs[0]); 303 | $subtitleucfirst = preg_replace('/:[ ]+[a-z]/', "$ucaftercolon", $string); 304 | return $subtitleucfirst; 305 | } 306 | 307 | //Remove articles (A, An, The) before a string 308 | 309 | /** 310 | * @param string $string 311 | */ 312 | function removearticle($string) { 313 | $patterns = array ('/A /', '/An /', '/The /'); 314 | $replacements = array (''); 315 | $removearticle = preg_replace($patterns, $replacements, $string); 316 | return $removearticle; 317 | } 318 | 319 | //Force articles, prepositions, and conjuctions to lowercase 320 | 321 | /** 322 | * @param string $forcearticlelower 323 | */ 324 | function forcearticlelower($forcearticlelower) { 325 | $forcearticlelower = str_replace(" A ", " a ", $forcearticlelower); 326 | $forcearticlelower = str_replace(" An ", " an ", $forcearticlelower); 327 | $forcearticlelower = str_replace(" And ", " and ", $forcearticlelower); 328 | $forcearticlelower = str_replace(" About ", " about ", $forcearticlelower); 329 | $forcearticlelower = str_replace(" As ", " as ", $forcearticlelower); 330 | $forcearticlelower = str_replace(" At ", " at ", $forcearticlelower); 331 | $forcearticlelower = str_replace(" Away ", " away ", $forcearticlelower); 332 | $forcearticlelower = str_replace(" But ", " but ", $forcearticlelower); 333 | $forcearticlelower = str_replace(" By ", " by ", $forcearticlelower); 334 | $forcearticlelower = str_replace(" Due ", " due ", $forcearticlelower); 335 | $forcearticlelower = str_replace(" For ", " for ", $forcearticlelower); 336 | $forcearticlelower = str_replace(" From ", " from ", $forcearticlelower); 337 | $forcearticlelower = str_replace(" In ", " in ", $forcearticlelower); 338 | $forcearticlelower = str_replace(" Into ", " into ", $forcearticlelower); 339 | $forcearticlelower = str_replace(" Like ", " like ", $forcearticlelower); 340 | $forcearticlelower = str_replace(" Of ", " of ", $forcearticlelower); 341 | $forcearticlelower = str_replace(" Off ", " off ", $forcearticlelower); 342 | $forcearticlelower = str_replace(" On ", " on ", $forcearticlelower); 343 | $forcearticlelower = str_replace(" Onto ", " onto ", $forcearticlelower); 344 | $forcearticlelower = str_replace(" Or ", " or ", $forcearticlelower); 345 | $forcearticlelower = str_replace(" Over ", " over ", $forcearticlelower); 346 | $forcearticlelower = str_replace(" Per ", " per ", $forcearticlelower); 347 | $forcearticlelower = str_replace(" Than ", " than ", $forcearticlelower); 348 | $forcearticlelower = str_replace(" The ", " the ", $forcearticlelower); 349 | $forcearticlelower = str_replace(" Till ", " till ", $forcearticlelower); 350 | $forcearticlelower = str_replace(" To ", " to ", $forcearticlelower); 351 | $forcearticlelower = str_replace(" Until ", " until ", $forcearticlelower); 352 | $forcearticlelower = str_replace(" Up ", " up ", $forcearticlelower); 353 | $forcearticlelower = str_replace(" Upon ", " upon ", $forcearticlelower); 354 | $forcearticlelower = str_replace(" Via ", " via ", $forcearticlelower); 355 | $forcearticlelower = str_replace(" With ", " with ", $forcearticlelower); 356 | $forcearticlelower = str_replace(" Within ", " within ", $forcearticlelower); 357 | $forcearticlelower = str_replace(" Without ", " without ", $forcearticlelower); 358 | $forcearticlelower = str_replace(" Within ", " within ", $forcearticlelower); 359 | $forcearticlelower = str_replace(" Within ", " within ", $forcearticlelower); 360 | return $forcearticlelower; 361 | } 362 | 363 | //Add a period to the end of an article title unless it is a ".", "?", or "!" 364 | function articleperiod($articletitle) { 365 | $articletitlelength = strlen($articletitle); 366 | $lastarticletitlechar = substr($articletitle, $articletitlelength-1, 1); 367 | if (($lastarticletitlechar != ".") && ($lastarticletitlechar != "?") && ($lastarticletitlechar != "!")) { 368 | $articletitle = $articletitle . "."; 369 | }else{ 370 | $articletitle = $articletitle; 371 | } 372 | return $articletitle; 373 | } 374 | 375 | //Check if a day should be displayed based on a month selection 376 | function dayshow($month) { 377 | $noshow = 1; 378 | switch($month) { 379 | case "January": 380 | $noshow = 0; 381 | break; 382 | case "February": 383 | $noshow = 0; 384 | break; 385 | case "March": 386 | $noshow = 0; 387 | break; 388 | case "April": 389 | $noshow = 0; 390 | break; 391 | case "May": 392 | $noshow = 0; 393 | break; 394 | case "June": 395 | $noshow = 0; 396 | break; 397 | case "July": 398 | $noshow = 0; 399 | break; 400 | case "August": 401 | $noshow = 0; 402 | break; 403 | case "September": 404 | $noshow = 0; 405 | break; 406 | case "October": 407 | $noshow = 0; 408 | break; 409 | case "November": 410 | $noshow = 0; 411 | break; 412 | case "December": 413 | $noshow = 0; 414 | break; 415 | } 416 | return $noshow; 417 | } 418 | 419 | //Check that a URL begins with "http://", "ftp://", "telnet://", or "gopher://" (case-insensitive). If not, assume http and prepend "http://". 420 | function checkurlprepend($urlwebsiteinput) { 421 | $httpprefix = strpos('http://', $urlwebsiteinput); 422 | $httpsprefix = strpos('https://', $urlwebsiteinput); 423 | $ftpprefix = strpos('ftp://', $urlwebsiteinput); 424 | $telnetprefix = strpos('telnet://', $urlwebsiteinput); 425 | $gopherprefix = strpos('gopher://', $urlwebsiteinput); 426 | if (($httpprefix !== false) && ($ftpprefix !== false) && ($telnetprefix !== false) && ($gopherprefix !== false) && ($httpsprefix !== false)) { 427 | $urlwebsiteinput = "http://" . $urlwebsiteinput; 428 | } 429 | return $urlwebsiteinput; 430 | } 431 | 432 | //Format a name and pull the first initial 433 | function firstinitial($name) { 434 | $initial = substr($name , 0, 1); 435 | $initial = strtoupper($initial); 436 | return $initial; 437 | } 438 | 439 | /********************************/ 440 | /* Citation layout */ 441 | /********************************/ 442 | 443 | //Creates an overall container for citations 444 | function citationhold() { 445 | $html = '
'; 446 | echo $html; 447 | } 448 | 449 | //Creates a single citation container 450 | function citationcontainstart($style) { 451 | $html = '
Copy and paste the citation below into your work.
'; 452 | $html .= '
' . styleconvert($style) . '
'; 453 | echo $html; 454 | } 455 | 456 | //Closes a single citation container 457 | function citationcontainend() { 458 | $html = '
'; 459 | echo $html; 460 | } 461 | 462 | /*******************************************************/ 463 | /* Include citation format function files below */ 464 | /*******************************************************/ 465 | include 'formats/apa6_format.php'; 466 | include 'formats/mla7_format.php'; 467 | 468 | ?> -------------------------------------------------------------------------------- /citationbuild.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /includes/jquery_plugins/jquery.form.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Form Plugin 3 | * version: 2.49 (18-OCT-2010) 4 | * @requires jQuery v1.3.2 or later 5 | * 6 | * Examples and documentation at: http://malsup.com/jquery/form/ 7 | * Dual licensed under the MIT and GPL licenses: 8 | * http://www.opensource.org/licenses/mit-license.php 9 | * http://www.gnu.org/licenses/gpl.html 10 | */ 11 | ;(function($) { 12 | 13 | /* 14 | Usage Note: 15 | ----------- 16 | Do not use both ajaxSubmit and ajaxForm on the same form. These 17 | functions are intended to be exclusive. Use ajaxSubmit if you want 18 | to bind your own submit handler to the form. For example, 19 | 20 | $(document).ready(function() { 21 | $('#myForm').bind('submit', function(e) { 22 | e.preventDefault(); // <-- important 23 | $(this).ajaxSubmit({ 24 | target: '#output' 25 | }); 26 | }); 27 | }); 28 | 29 | Use ajaxForm when you want the plugin to manage all the event binding 30 | for you. For example, 31 | 32 | $(document).ready(function() { 33 | $('#myForm').ajaxForm({ 34 | target: '#output' 35 | }); 36 | }); 37 | 38 | When using ajaxForm, the ajaxSubmit function will be invoked for you 39 | at the appropriate time. 40 | */ 41 | 42 | /** 43 | * ajaxSubmit() provides a mechanism for immediately submitting 44 | * an HTML form using AJAX. 45 | */ 46 | $.fn.ajaxSubmit = function(options) { 47 | // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) 48 | if (!this.length) { 49 | log('ajaxSubmit: skipping submit process - no element selected'); 50 | return this; 51 | } 52 | 53 | if (typeof options == 'function') { 54 | options = { success: options }; 55 | } 56 | 57 | var url = $.trim(this.attr('action')); 58 | if (url) { 59 | // clean url (don't include hash vaue) 60 | url = (url.match(/^([^#]+)/)||[])[1]; 61 | } 62 | url = url || window.location.href || ''; 63 | 64 | options = $.extend(true, { 65 | url: url, 66 | type: this.attr('method') || 'GET', 67 | iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' 68 | }, options); 69 | 70 | // hook for manipulating the form data before it is extracted; 71 | // convenient for use with rich editors like tinyMCE or FCKEditor 72 | var veto = {}; 73 | this.trigger('form-pre-serialize', [this, options, veto]); 74 | if (veto.veto) { 75 | log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); 76 | return this; 77 | } 78 | 79 | // provide opportunity to alter form data before it is serialized 80 | if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { 81 | log('ajaxSubmit: submit aborted via beforeSerialize callback'); 82 | return this; 83 | } 84 | 85 | var n,v,a = this.formToArray(options.semantic); 86 | if (options.data) { 87 | options.extraData = options.data; 88 | for (n in options.data) { 89 | if(options.data[n] instanceof Array) { 90 | for (var k in options.data[n]) { 91 | a.push( { name: n, value: options.data[n][k] } ); 92 | } 93 | } 94 | else { 95 | v = options.data[n]; 96 | v = $.isFunction(v) ? v() : v; // if value is fn, invoke it 97 | a.push( { name: n, value: v } ); 98 | } 99 | } 100 | } 101 | 102 | // give pre-submit callback an opportunity to abort the submit 103 | if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { 104 | log('ajaxSubmit: submit aborted via beforeSubmit callback'); 105 | return this; 106 | } 107 | 108 | // fire vetoable 'validate' event 109 | this.trigger('form-submit-validate', [a, this, options, veto]); 110 | if (veto.veto) { 111 | log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); 112 | return this; 113 | } 114 | 115 | var q = $.param(a); 116 | 117 | if (options.type.toUpperCase() == 'GET') { 118 | options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; 119 | options.data = null; // data is null for 'get' 120 | } 121 | else { 122 | options.data = q; // data is the query string for 'post' 123 | } 124 | 125 | var $form = this, callbacks = []; 126 | if (options.resetForm) { 127 | callbacks.push(function() { $form.resetForm(); }); 128 | } 129 | if (options.clearForm) { 130 | callbacks.push(function() { $form.clearForm(); }); 131 | } 132 | 133 | // perform a load on the target only if dataType is not provided 134 | if (!options.dataType && options.target) { 135 | var oldSuccess = options.success || function(){}; 136 | callbacks.push(function(data) { 137 | var fn = options.replaceTarget ? 'replaceWith' : 'html'; 138 | $(options.target)[fn](data).each(oldSuccess, arguments); 139 | }); 140 | } 141 | else if (options.success) { 142 | callbacks.push(options.success); 143 | } 144 | 145 | options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg 146 | var context = options.context || options; // jQuery 1.4+ supports scope context 147 | for (var i=0, max=callbacks.length; i < max; i++) { 148 | callbacks[i].apply(context, [data, status, xhr || $form, $form]); 149 | } 150 | }; 151 | 152 | // are there files to upload? 153 | var fileInputs = $('input:file', this).length > 0; 154 | var mp = 'multipart/form-data'; 155 | var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); 156 | 157 | // options.iframe allows user to force iframe mode 158 | // 06-NOV-09: now defaulting to iframe mode if file input is detected 159 | if (options.iframe !== false && (fileInputs || options.iframe || multipart)) { 160 | // hack to fix Safari hang (thanks to Tim Molendijk for this) 161 | // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d 162 | if (options.closeKeepAlive) { 163 | $.get(options.closeKeepAlive, fileUpload); 164 | } 165 | else { 166 | fileUpload(); 167 | } 168 | } 169 | else { 170 | $.ajax(options); 171 | } 172 | 173 | // fire 'notify' event 174 | this.trigger('form-submit-notify', [this, options]); 175 | return this; 176 | 177 | 178 | // private function for handling file uploads (hat tip to YAHOO!) 179 | function fileUpload() { 180 | var form = $form[0]; 181 | 182 | if ($(':input[name=submit],:input[id=submit]', form).length) { 183 | // if there is an input with a name or id of 'submit' then we won't be 184 | // able to invoke the submit fn on the form (at least not x-browser) 185 | alert('Error: Form elements must not have name or id of "submit".'); 186 | return; 187 | } 188 | 189 | var s = $.extend(true, {}, $.ajaxSettings, options); 190 | s.context = s.context || s; 191 | var id = 'jqFormIO' + (new Date().getTime()), fn = '_'+id; 192 | window[fn] = function() { 193 | var f = $io.data('form-plugin-onload'); 194 | if (f) { 195 | f(); 196 | window[fn] = undefined; 197 | try { delete window[fn]; } catch(e){} 198 | } 199 | } 200 | var $io = $('