diff --git a/milfs/addon/brigada/index.html b/.gitmodules similarity index 100% rename from milfs/addon/brigada/index.html rename to .gitmodules diff --git a/index.php b/index.php index 835bad2..528c2c9 100644 --- a/index.php +++ b/index.php @@ -15,7 +15,7 @@ if(isset($_REQUEST['debug'])) {ini_set('display_errors', 'On');}
- + @@ -77,8 +77,8 @@ $librerias_pie =""; /// k= suite /// l= Listado /// m = checklist -/// n=notas -/// o=parallax +/// n=notas +/// o=parallax /// p= Planilla /// s= SET DE DATOS * @@ -130,10 +130,10 @@ $presentacion_cabeza = " + "; - + $presentacion_pie=" @@ -160,11 +160,11 @@ $presentacion_pie=" ] }); - + "; if ($variable !=''){ - + if($v[0] =='e') { /// e = EMPRESA $id_empresa = $v[1]; @@ -177,7 +177,7 @@ if ($variable !=''){ "; if($titulo[0] !="") { $logo = remplacetas('empresa','id',"$id_empresa",'imagen','') ; - + $descripcion = remplacetas('empresa','id',"$id_empresa",'slogan','') ; //$background_imagen = buscar_imagen('',"","","$id_empresa"); $background_imagen = remplacetas('empresa','id',"$id_empresa",'imagen','') ; @@ -188,7 +188,7 @@ if ($variable !=''){ $vista_favorita = vista_favorita($pagina_inicio_definida[0]); //$set= $pagina_inicio_definida[0]; $onload = " "; - } + } $acceso = 1; $menu ="Escriba un email válido
";}
- elseif($campo_tipo_accion == 'envio'){$render = "
-
- Se enviará un email
";}
- elseif($campo_tipo_accion == 'textarea'){
- $render = " ";
- $cols='12';
- }
- //$subir_imagen = subir_imagen('');
- elseif($campo_tipo_accion == 'imagen'){
- $style ="display:hidden";
- // $gps = leer_exif($file);
- $render= " "; //subir_imagen('',$id_campo[$item]);
- $cols='12'; }
-
- elseif($campo_tipo_accion == 'html'){
- $render = "
-
- ";
- $cols='12';
- }
- elseif($campo_tipo_accion == 'limit'){
- $limite = limite("".$id_campo."[".$item."]",'','limite');
- $rows = ceil($limite / 50 )+1;
- $render = "$limite /
-
-
-
- ";
- $cols='12';
- }
- elseif($campo_tipo_accion == 'select'){
-
- //$select = select('form_campos_valores','campo_valor','campo_valor','',"id_form_campo = $id_campo",$id_campo."[".$item."]");
- $select = select_edit($id_campo,$id_form,$value,$id_campo."[".$item."]",$control);
- $render = "$select "; $cols='12'; }
- elseif($campo_tipo_accion == 'radio'){
- $select = radio_edit($id_campo,$id_form,$value,$id_campo."[".$item."]",$control);
- $render = "$select ";
- $cols='12';
- }
- elseif($campo_tipo_accion == 'radio_agrupado_campos'){
- //radio_agrupado_linea($id_campo,$form_id,$valor,$name,$control)
- $campos_valores = remplacetas('form_campos_valores','id_form_campo',$id_campo,'campo_valor',"") ;
- $mensaje = remplacetas('form_campos','id',$id_campo,'campo_descripcion',"") ;
- $campos = explode(":",$campos_valores[0]);
- $titulos = explode(";",$campos[0]);
- $campos_incluidos = explode(";",$campos[1]);
- for($i=0;$i$listado_titulos |
(solo números)
";}
-
- elseif($campo_tipo_accion == 'password'){
- if( $control != "") {
- $render="";$label=""; $campo_tipo_accion="oculto";
- }else {
- $render = "
- $$c = \$formulario['$c'][$C]; // $V /$campo_tipo[0]
"; - if($campo_tipo[0] =='12' OR $campo_tipo[0] =='13') { - $validar = validar_email($V); - if($validar == '0') { - $respuesta->addAssign("input_".$c."[".$C."]","className"," form-group has-error "); - $respuesta->addScript("document.getElementById('".$c."[".$C."]').focus(); "); - $respuesta->addAlert("Se necesita un email válido"); - return $respuesta; - }else { - $respuesta->addAssign("input_".$c."[".$C."]","className"," form-group has-success "); - } - } - if($campo_tipo[0] =='3' ) { - $validar = is_numeric($V); - if(is_numeric($V) ) { - $respuesta->addAssign("input_".$c."[".$C."]","className"," form-group has-success "); - //return $respuesta; - }else{ - $respuesta->addAssign("input_".$c."[".$C."]","className"," form-group has-error "); - $respuesta->addScript("document.getElementById('".$c."[".$C."]').focus(); "); - $respuesta->addAlert("El campo $campo_nombre[0] solo acepta valores numéricos"); - return $respuesta; - } - } - - if($campo_tipo[0]=='17') { - $limite = limite("$c",'','limite'); - $size= strlen($V); - $restante = ($limite - $size); - if( $restante < 0) { - - $respuesta->addAssign("input_".$c."[".$C."]","className"," form-group has-error "); - $respuesta->addAlert("ATENCION: El campo $campo_nombre[0] no debe tener mas de $limite caractéres, sobran $restante"); - $respuesta->addScript("document.getElementById('".$c."[".$C."]').focus(); "); - return $respuesta; - } - } - - - - } -else{ //busca campos vacios - -$campo_obligatorio = remplacetas("form_contenido_campos","id_campo",$c,"obligatorio","id_form = '$formulario[form_id]'"); -if($campo_obligatorio[0] =='1'){ - - $respuesta->addAssign("input_".$c."[".$C."]","className"," form-group has-error "); - $respuesta->addAlert("ATENCION: El campo $campo_nombre[0] es obligatorio"); - $respuesta->addScript("document.getElementById('".$c."[".$C."]').focus(); "); - return $respuesta; - } - -} - -$md5 = md5($V); -$igual = formulario_valor_campo("$form_id","$c","$md5","$formulario[control]","$C"); -$existe = formulario_valor_campo("$form_id","$c","","$formulario[control]","$C"); -//$valor_anterior .= $existe[3]."| "; -$debug .= "$existe"; -if(!is_null($existe) AND $tipo =='edit' AND $V =='') { - $consulta_vacio =" - INSERT INTO `form_datos` (`id`, `id_campo`,`orden`,`form_id`, `id_usuario`, `contenido`, `timestamp`, `control`, ip , id_empresa) - VALUES (NULL, '$c','$C', '$formulario[form_id]', '$_SESSION[id]', '', UNIX_TIMESTAMP(), '$formulario[control]',$graba_ip,'$id_empresa');"; - - $sql=mysqli_query($consulta_vacio,$link); - if($sql) { - $consulta_grabada ='1'; - } -} -if(is_null($igual) ){$repetido = 0;}else{ -$repetido = 1; -} - - -//return $respuesta; -//$respuesta->addAlert("$debug"); -//return $respuesta; -$debug .= "V = $V /$c /$repetido / $igual "; -if(($V !='' ) && (is_numeric($c)) AND $repetido !=1 ) { -//$debug = "Hola mundo"; - $V = mysql_real_escape_string($V); - $campo_tipo = remplacetas("form_campos","id",$c,"campo_tipo",""); - -if(@$campo_tipo[0] =="18") { - $V = md5("$V"); -}else{$V=$V;} - - - $consulta =" - INSERT INTO `form_datos` (`id`, `id_campo`,`orden`,`form_id`, `id_usuario`, `contenido`, `timestamp`, `control`, ip , id_empresa) - VALUES (NULL, '$c','$C', '$formulario[form_id]', '".@$_SESSION[id]."', '$V', UNIX_TIMESTAMP(), '$formulario[control]',$graba_ip,'$id_empresa');"; - - $sql=mysqli_query($consulta,$link); - $debug .= "$consulta = $sql ,"; - if($sql) { - $consulta_grabada ='1'; - } - } - - } ///fin del array - - }///fin del array primario - else { - if($v !='') { //$datos .= "$$c = \$formulario['$c']; // $v
"; - } - } - } - - - - -// } -// } - -$debug .= " $link "; -//$respuesta->addAssign("pie_modal","innerHTML","$debug"); - -if($consulta_grabada =='1') { -if($tipo == "embebidoX" ) -{ - $exito =" -Puede revisar los datos en $_SESSION[site]i$formulario[control]
-Saludos de MILFS
-"; - if(mail("$email[0]","$asunto","$cuerpo","$headers")){ $exito .=""; }else {$exito .="error enviando correo";} - //$exito .= "$email[0] $headers "; - } - /// } - $respuesta->addAssign("div_$control","innerHTML","$exito "); - return $respuesta; - }else{ - $mensaje =" - -".$formulario_descripcion['0']."
"; - - $nuevo_formulario = "Llenar otro formulario "; -if($control !='' AND $tipo =='' ) { - $impresion = formulario_imprimir("$id","$control",""); - $formulario_nombre = remplacetas('form_id','id',$id,'nombre','') ; - $muestra_form = "Se ha solicitado un cambio de clave para tu usuario.
-Si fuiste tu quien lo solicitó, sigue este enlace para realizar el cambio.
El Link ya NO ES válido
$web[0]"; ?>
- Powered by: © MILFS -
'.$text.'
'; - $text = preg_replace('{\n{2,}}', "\n\n", $text); - } - return $text; - } - - function mdwp_strip_p($t) { return preg_replace('{?p>}i', '', $t); } - - function mdwp_hide_tags($text) { - global $mdwp_hidden_tags, $mdwp_placeholders; - return str_replace($mdwp_hidden_tags, $mdwp_placeholders, $text); - } - function mdwp_show_tags($text) { - global $mdwp_hidden_tags, $mdwp_placeholders; - return str_replace($mdwp_placeholders, $mdwp_hidden_tags, $text); - } -} - - -### bBlog Plugin Info ### - -function identify_modifier_markdown() { - return array( - 'name' => 'markdown', - 'type' => 'modifier', - 'nicename' => 'PHP Markdown Extra', - 'description' => 'A text-to-HTML conversion tool for web writers', - 'authors' => 'Michel Fortin and John Gruber', - 'licence' => 'GPL', - 'version' => MARKDOWNEXTRA_VERSION, - 'help' => 'Markdown syntax allows you to write using an easy-to-read, easy-to-write plain text format. Based on the original Perl version by John Gruber. More...', - ); -} - - -### Smarty Modifier Interface ### - -function smarty_modifier_markdown($text) { - return Markdown($text); -} - - -### Textile Compatibility Mode ### - -# Rename this file to "classTextile.php" and it can replace Textile everywhere. - -if (strcasecmp(substr(__FILE__, -16), "classTextile.php") == 0) { - # Try to include PHP SmartyPants. Should be in the same directory. - @include_once 'smartypants.php'; - # Fake Textile class. It calls Markdown instead. - class Textile { - function TextileThis($text, $lite='', $encode='') { - if ($lite == '' && $encode == '') $text = Markdown($text); - if (function_exists('SmartyPants')) $text = SmartyPants($text); - return $text; - } - # Fake restricted version: restrictions are not supported for now. - function TextileRestricted($text, $lite='', $noimage='') { - return $this->TextileThis($text, $lite); - } - # Workaround to ensure compatibility with TextPattern 4.0.3. - function blockLite($text) { return $text; } - } -} - - - -# -# Markdown Parser Class -# - -class Markdown_Parser { - - ### Configuration Variables ### - - # Change to ">" for HTML output. - var $empty_element_suffix = MARKDOWN_EMPTY_ELEMENT_SUFFIX; - var $tab_width = MARKDOWN_TAB_WIDTH; - - # Change to `true` to disallow markup or entities. - var $no_markup = false; - var $no_entities = false; - - # Predefined urls and titles for reference links and images. - var $predef_urls = array(); - var $predef_titles = array(); - - - ### Parser Implementation ### - - # Regex to match balanced [brackets]. - # Needed to insert a maximum bracked depth while converting to PHP. - var $nested_brackets_depth = 6; - var $nested_brackets_re; - - var $nested_url_parenthesis_depth = 4; - var $nested_url_parenthesis_re; - - # Table of hash values for escaped characters: - var $escape_chars = '\`*_{}[]()>#+-.!'; - var $escape_chars_re; - - - function Markdown_Parser() { - # - # Constructor function. Initialize appropriate member variables. - # - $this->_initDetab(); - $this->prepareItalicsAndBold(); - - $this->nested_brackets_re = - str_repeat('(?>[^\[\]]+|\[', $this->nested_brackets_depth). - str_repeat('\])*', $this->nested_brackets_depth); - - $this->nested_url_parenthesis_re = - str_repeat('(?>[^()\s]+|\(', $this->nested_url_parenthesis_depth). - str_repeat('(?>\)))*', $this->nested_url_parenthesis_depth); - - $this->escape_chars_re = '['.preg_quote($this->escape_chars).']'; - - # Sort document, block, and span gamut in ascendent priority order. - asort($this->document_gamut); - asort($this->block_gamut); - asort($this->span_gamut); - } - - - # Internal hashes used during transformation. - var $urls = array(); - var $titles = array(); - var $html_hashes = array(); - - # Status flag to avoid invalid nesting. - var $in_anchor = false; - - - function setup() { - # - # Called before the transformation process starts to setup parser - # states. - # - # Clear global hashes. - $this->urls = $this->predef_urls; - $this->titles = $this->predef_titles; - $this->html_hashes = array(); - - $this->in_anchor = false; - } - - function teardown() { - # - # Called after the transformation process to clear any variable - # which may be taking up memory unnecessarly. - # - $this->urls = array(); - $this->titles = array(); - $this->html_hashes = array(); - } - - - function transform($text) { - # - # Main function. Performs some preprocessing on the input text - # and pass it through the document gamut. - # - $this->setup(); - - # Remove UTF-8 BOM and marker character in input, if present. - $text = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $text); - - # Standardize line endings: - # DOS to Unix and Mac to Unix - $text = preg_replace('{\r\n?}', "\n", $text); - - # Make sure $text ends with a couple of newlines: - $text .= "\n\n"; - - # Convert all tabs to spaces. - $text = $this->detab($text); - - # Turn block-level HTML blocks into hash entries - $text = $this->hashHTMLBlocks($text); - - # Strip any lines consisting only of spaces and tabs. - # This makes subsequent regexen easier to write, because we can - # match consecutive blank lines with /\n+/ instead of something - # contorted like /[ ]*\n+/ . - $text = preg_replace('/^[ ]+$/m', '', $text); - - # Run document gamut methods. - foreach ($this->document_gamut as $method => $priority) { - $text = $this->$method($text); - } - - $this->teardown(); - - return $text . "\n"; - } - - var $document_gamut = array( - # Strip link definitions, store in hashes. - "stripLinkDefinitions" => 20, - - "runBasicBlockGamut" => 30, - ); - - - function stripLinkDefinitions($text) { - # - # Strips link definitions from text, stores the URLs and titles in - # hash references. - # - $less_than_tab = $this->tab_width - 1; - - # Link defs are in the form: ^[id]: url "optional title" - $text = preg_replace_callback('{ - ^[ ]{0,'.$less_than_tab.'}\[(.+)\][ ]?: # id = $1 - [ ]* - \n? # maybe *one* newline - [ ]* - (?: - <(.+?)> # url = $2 - | - (\S+?) # url = $3 - ) - [ ]* - \n? # maybe one newline - [ ]* - (?: - (?<=\s) # lookbehind for whitespace - ["(] - (.*?) # title = $4 - [")] - [ ]* - )? # title is optional - (?:\n+|\Z) - }xm', - array(&$this, '_stripLinkDefinitions_callback'), - $text); - return $text; - } - function _stripLinkDefinitions_callback($matches) { - $link_id = strtolower($matches[1]); - $url = $matches[2] == '' ? $matches[3] : $matches[2]; - $this->urls[$link_id] = $url; - $this->titles[$link_id] =& $matches[4]; - return ''; # String that will replace the block - } - - - function hashHTMLBlocks($text) { - if ($this->no_markup) return $text; - - $less_than_tab = $this->tab_width - 1; - - # Hashify HTML blocks: - # We only want to do this for block-level HTML tags, such as headers, - # lists, and tables. That's because we still want to wrap
s around - # "paragraphs" that are wrapped in non-block-level tags, such as anchors, - # phrase emphasis, and spans. The list of tags we're looking for is - # hard-coded: - # - # * List "a" is made of tags which can be both inline or block-level. - # These will be treated block-level when the start tag is alone on - # its line, otherwise they're not matched here and will be taken as - # inline later. - # * List "b" is made of tags which are always block-level; - # - $block_tags_a_re = 'ins|del'; - $block_tags_b_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|'. - 'script|noscript|form|fieldset|iframe|math|svg|'. - 'article|section|nav|aside|hgroup|header|footer|'. - 'figure'; - - # Regular expression for the content of a block tag. - $nested_tags_level = 4; - $attr = ' - (?> # optional tag attributes - \s # starts with whitespace - (?> - [^>"/]+ # text outside quotes - | - /+(?!>) # slash not followed by ">" - | - "[^"]*" # text inside double quotes (tolerate ">") - | - \'[^\']*\' # text inside single quotes (tolerate ">") - )* - )? - '; - $content = - str_repeat(' - (?> - [^<]+ # content without tag - | - <\2 # nested opening tag - '.$attr.' # attributes - (?> - /> - | - >', $nested_tags_level). # end of opening tag - '.*?'. # last level nested tag content - str_repeat(' - \2\s*> # closing nested tag - ) - | - <(?!/\2\s*> # other tags with a different name - ) - )*', - $nested_tags_level); - $content2 = str_replace('\2', '\3', $content); - - # First, look for nested blocks, e.g.: - #
` blocks.
- #
- $text = preg_replace_callback('{
- (?:\n\n|\A\n?)
- ( # $1 = the code block -- one or more lines, starting with a space/tab
- (?>
- [ ]{'.$this->tab_width.'} # Lines must start with a tab or a tab-width of spaces
- .*\n+
- )+
- )
- ((?=^[ ]{0,'.$this->tab_width.'}\S)|\Z) # Lookahead for non-space at line-start, or end of doc
- }xm',
- array(&$this, '_doCodeBlocks_callback'), $text);
-
- return $text;
- }
- function _doCodeBlocks_callback($matches) {
- $codeblock = $matches[1];
-
- $codeblock = $this->outdent($codeblock);
- $codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES);
-
- # trim leading newlines and trailing newlines
- $codeblock = preg_replace('/\A\n+|\n+\z/', '', $codeblock);
-
- $codeblock = "$codeblock\n
";
- return "\n\n".$this->hashBlock($codeblock)."\n\n";
- }
-
-
- function makeCodeSpan($code) {
- #
- # Create a code span markup for $code. Called from handleSpanToken.
- #
- $code = htmlspecialchars(trim($code), ENT_NOQUOTES);
- return $this->hashPart("$code
");
- }
-
-
- var $em_relist = array(
- '' => '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(?em_relist as $em => $em_re) {
- foreach ($this->strong_relist as $strong => $strong_re) {
- # Construct list of allowed token expressions.
- $token_relist = array();
- if (isset($this->em_strong_relist["$em$strong"])) {
- $token_relist[] = $this->em_strong_relist["$em$strong"];
- }
- $token_relist[] = $em_re;
- $token_relist[] = $strong_re;
-
- # Construct master expression from list.
- $token_re = '{('. implode('|', $token_relist) .')}';
- $this->em_strong_prepared_relist["$em$strong"] = $token_re;
- }
- }
- }
-
- function doItalicsAndBold($text) {
- $token_stack = array('');
- $text_stack = array('');
- $em = '';
- $strong = '';
- $tree_char_em = false;
-
- while (1) {
- #
- # Get prepared regular expression for seraching emphasis tokens
- # in current context.
- #
- $token_re = $this->em_strong_prepared_relist["$em$strong"];
-
- #
- # Each loop iteration search for the next emphasis token.
- # Each token is then passed to handleSpanToken.
- #
- $parts = preg_split($token_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE);
- $text_stack[0] .= $parts[0];
- $token =& $parts[1];
- $text =& $parts[2];
-
- if (empty($token)) {
- # Reached end of text span: empty stack without emitting.
- # any more emphasis.
- while ($token_stack[0]) {
- $text_stack[1] .= array_shift($token_stack);
- $text_stack[0] .= array_shift($text_stack);
- }
- break;
- }
-
- $token_len = strlen($token);
- if ($tree_char_em) {
- # Reached closing marker while inside a three-char emphasis.
- if ($token_len == 3) {
- # Three-char closing marker, close em and strong.
- array_shift($token_stack);
- $span = array_shift($text_stack);
- $span = $this->runSpanGamut($span);
- $span = "$span";
- $text_stack[0] .= $this->hashPart($span);
- $em = '';
- $strong = '';
- } else {
- # Other closing marker: close one em or strong and
- # change current token state to match the other
- $token_stack[0] = str_repeat($token{0}, 3-$token_len);
- $tag = $token_len == 2 ? "strong" : "em";
- $span = $text_stack[0];
- $span = $this->runSpanGamut($span);
- $span = "<$tag>$span$tag>";
- $text_stack[0] = $this->hashPart($span);
- $$tag = ''; # $$tag stands for $em or $strong
- }
- $tree_char_em = false;
- } else if ($token_len == 3) {
- if ($em) {
- # Reached closing marker for both em and strong.
- # Closing strong marker:
- for ($i = 0; $i < 2; ++$i) {
- $shifted_token = array_shift($token_stack);
- $tag = strlen($shifted_token) == 2 ? "strong" : "em";
- $span = array_shift($text_stack);
- $span = $this->runSpanGamut($span);
- $span = "<$tag>$span$tag>";
- $text_stack[0] .= $this->hashPart($span);
- $$tag = ''; # $$tag stands for $em or $strong
- }
- } else {
- # Reached opening three-char emphasis marker. Push on token
- # stack; will be handled by the special condition above.
- $em = $token{0};
- $strong = "$em$em";
- array_unshift($token_stack, $token);
- array_unshift($text_stack, '');
- $tree_char_em = true;
- }
- } else if ($token_len == 2) {
- if ($strong) {
- # Unwind any dangling emphasis marker:
- if (strlen($token_stack[0]) == 1) {
- $text_stack[1] .= array_shift($token_stack);
- $text_stack[0] .= array_shift($text_stack);
- }
- # Closing strong marker:
- array_shift($token_stack);
- $span = array_shift($text_stack);
- $span = $this->runSpanGamut($span);
- $span = "$span";
- $text_stack[0] .= $this->hashPart($span);
- $strong = '';
- } else {
- array_unshift($token_stack, $token);
- array_unshift($text_stack, '');
- $strong = $token;
- }
- } else {
- # Here $token_len == 1
- if ($em) {
- if (strlen($token_stack[0]) == 1) {
- # Closing emphasis marker:
- array_shift($token_stack);
- $span = array_shift($text_stack);
- $span = $this->runSpanGamut($span);
- $span = "$span";
- $text_stack[0] .= $this->hashPart($span);
- $em = '';
- } else {
- $text_stack[0] .= $token;
- }
- } else {
- array_unshift($token_stack, $token);
- array_unshift($text_stack, '');
- $em = $token;
- }
- }
- }
- return $text_stack[0];
- }
-
-
- function doBlockQuotes($text) {
- $text = preg_replace_callback('/
- ( # Wrap whole match in $1
- (?>
- ^[ ]*>[ ]? # ">" at the start of a line
- .+\n # rest of the first line
- (.+\n)* # subsequent consecutive lines
- \n* # blanks
- )+
- )
- /xm',
- array(&$this, '_doBlockQuotes_callback'), $text);
-
- return $text;
- }
- function _doBlockQuotes_callback($matches) {
- $bq = $matches[1];
- # trim one level of quoting - trim whitespace-only lines
- $bq = preg_replace('/^[ ]*>[ ]?|^[ ]+$/m', '', $bq);
- $bq = $this->runBlockGamut($bq); # recurse
-
- $bq = preg_replace('/^/m', " ", $bq);
- # These leading spaces cause problem with content,
- # so we need to fix that:
- $bq = preg_replace_callback('{(\s*.+?
)}sx',
- array(&$this, '_doBlockQuotes_callback2'), $bq);
-
- return "\n". $this->hashBlock("\n$bq\n
")."\n\n";
- }
- function _doBlockQuotes_callback2($matches) {
- $pre = $matches[1];
- $pre = preg_replace('/^ /m', '', $pre);
- return $pre;
- }
-
-
- function formParagraphs($text) {
- #
- # Params:
- # $text - string to process with html tags
- #
- # Strip leading and trailing lines:
- $text = preg_replace('/\A\n+|\n+\z/', '', $text);
-
- $grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY);
-
- #
- # Wrap
tags and unhashify HTML blocks
- #
- foreach ($grafs as $key => $value) {
- if (!preg_match('/^B\x1A[0-9]+B$/', $value)) {
- # Is a paragraph.
- $value = $this->runSpanGamut($value);
- $value = preg_replace('/^([ ]*)/', "
", $value);
- $value .= "
";
- $grafs[$key] = $this->unhash($value);
- }
- else {
- # Is a block.
- # Modify elements of @grafs in-place...
- $graf = $value;
- $block = $this->html_hashes[$graf];
- $graf = $block;
-// if (preg_match('{
-// \A
-// ( # $1 = tag
-// ]*
-// \b
-// markdown\s*=\s* ([\'"]) # $2 = attr quote char
-// 1
-// \2
-// [^>]*
-// >
-// )
-// ( # $3 = contents
-// .*
-// )
-// () # $4 = closing tag
-// \z
-// }xs', $block, $matches))
-// {
-// list(, $div_open, , $div_content, $div_close) = $matches;
-//
-// # We can't call Markdown(), because that resets the hash;
-// # that initialization code should be pulled into its own sub, though.
-// $div_content = $this->hashHTMLBlocks($div_content);
-//
-// # Run document gamut methods on the content.
-// foreach ($this->document_gamut as $method => $priority) {
-// $div_content = $this->$method($div_content);
-// }
-//
-// $div_open = preg_replace(
-// '{\smarkdown\s*=\s*([\'"]).+?\1}', '', $div_open);
-//
-// $graf = $div_open . "\n" . $div_content . "\n" . $div_close;
-// }
- $grafs[$key] = $graf;
- }
- }
-
- return implode("\n\n", $grafs);
- }
-
-
- function encodeAttribute($text) {
- #
- # Encode text for a double-quoted HTML attribute. This function
- # is *not* suitable for attributes enclosed in single quotes.
- #
- $text = $this->encodeAmpsAndAngles($text);
- $text = str_replace('"', '"', $text);
- return $text;
- }
-
-
- function encodeAmpsAndAngles($text) {
- #
- # Smart processing for ampersands and angle brackets that need to
- # be encoded. Valid character entities are left alone unless the
- # no-entities mode is set.
- #
- if ($this->no_entities) {
- $text = str_replace('&', '&', $text);
- } else {
- # Ampersand-encoding based entirely on Nat Irons's Amputator
- # MT plugin:
- $text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/',
- '&', $text);;
- }
- # Encode remaining <'s
- $text = str_replace('<', '<', $text);
-
- return $text;
- }
-
-
- function doAutoLinks($text) {
- $text = preg_replace_callback('{<((https?|ftp|dict):[^\'">\s]+)>}i',
- array(&$this, '_doAutoLinks_url_callback'), $text);
-
- # Email addresses:
- $text = preg_replace_callback('{
- <
- (?:mailto:)?
- (
- (?:
- [-!#$%&\'*+/=?^_`.{|}~\w\x80-\xFF]+
- |
- ".*?"
- )
- \@
- (?:
- [-a-z0-9\x80-\xFF]+(\.[-a-z0-9\x80-\xFF]+)*\.[a-z]+
- |
- \[[\d.a-fA-F:]+\] # IPv4 & IPv6
- )
- )
- >
- }xi',
- array(&$this, '_doAutoLinks_email_callback'), $text);
- $text = preg_replace_callback('{<(tel:([^\'">\s]+))>}i',array(&$this, '_doAutoLinks_tel_callback'), $text);
-
- return $text;
- }
- function _doAutoLinks_tel_callback($matches) {
- $url = $this->encodeAttribute($matches[1]);
- $tel = $this->encodeAttribute($matches[2]);
- $link = "$tel";
- return $this->hashPart($link);
- }
- function _doAutoLinks_url_callback($matches) {
- $url = $this->encodeAttribute($matches[1]);
- $link = "$url";
- return $this->hashPart($link);
- }
- function _doAutoLinks_email_callback($matches) {
- $address = $matches[1];
- $link = $this->encodeEmailAddress($address);
- return $this->hashPart($link);
- }
-
-
- function encodeEmailAddress($addr) {
- #
- # Input: an email address, e.g. "foo@example.com"
- #
- # Output: the email address as a mailto link, with each character
- # of the address encoded as either a decimal or hex entity, in
- # the hopes of foiling most address harvesting spam bots. E.g.:
- #
- #
- #
- # Based by a filter by Matthew Wickline, posted to BBEdit-Talk.
- # With some optimizations by Milian Wolff.
- #
- $addr = "mailto:" . $addr;
- $chars = preg_split('/(? $char) {
- $ord = ord($char);
- # Ignore non-ascii chars.
- if ($ord < 128) {
- $r = ($seed * (1 + $key)) % 100; # Pseudo-random function.
- # roughly 10% raw, 45% hex, 45% dec
- # '@' *must* be encoded. I insist.
- if ($r > 90 && $char != '@') /* do nothing */;
- else if ($r < 45) $chars[$key] = ''.dechex($ord).';';
- else $chars[$key] = ''.$ord.';';
- }
- }
-
- $addr = implode('', $chars);
- $text = implode('', array_slice($chars, 7)); # text without `mailto:`
- $addr = "$text";
-
- return $addr;
- }
-
-
- function parseSpan($str) {
- #
- # Take the string $str and parse it into tokens, hashing embeded HTML,
- # escaped characters and handling code spans.
- #
- $output = '';
-
- $span_re = '{
- (
- \\\\'.$this->escape_chars_re.'
- |
- (?no_markup ? '' : '
- |
- # comment
- |
- <\?.*?\?> | <%.*?%> # processing instruction
- |
- <[!$]?[-a-zA-Z0-9:_]+ # regular tags
- (?>
- \s
- (?>[^"\'>]+|"[^"]*"|\'[^\']*\')*
- )?
- >
- |
- <[-a-zA-Z0-9:_]+\s*/> # xml-style empty tag
- |
- [-a-zA-Z0-9:_]+\s*> # closing tag
- ').'
- )
- }xs';
-
- while (1) {
- #
- # Each loop iteration seach for either the next tag, the next
- # openning code span marker, or the next escaped character.
- # Each token is then passed to handleSpanToken.
- #
- $parts = preg_split($span_re, $str, 2, PREG_SPLIT_DELIM_CAPTURE);
-
- # Create token from text preceding tag.
- if ($parts[0] != "") {
- $output .= $parts[0];
- }
-
- # Check if we reach the end.
- if (isset($parts[1])) {
- $output .= $this->handleSpanToken($parts[1], $parts[2]);
- $str = $parts[2];
- }
- else {
- break;
- }
- }
-
- return $output;
- }
-
-
- function handleSpanToken($token, &$str) {
- #
- # Handle $token provided by parseSpan by determining its nature and
- # returning the corresponding value that should replace it.
- #
- switch ($token{0}) {
- case "\\":
- return $this->hashPart("". ord($token{1}). ";");
- case "`":
- # Search for end marker in remaining text.
- if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm',
- $str, $matches))
- {
- $str = $matches[2];
- $codespan = $this->makeCodeSpan($matches[1]);
- return $this->hashPart($codespan);
- }
- return $token; // return as text since no ending marker found.
- default:
- return $this->hashPart($token);
- }
- }
-
-
- function outdent($text) {
- #
- # Remove one level of line-leading tabs or spaces
- #
- return preg_replace('/^(\t|[ ]{1,'.$this->tab_width.'})/m', '', $text);
- }
-
-
- # String length function for detab. `_initDetab` will create a function to
- # hanlde UTF-8 if the default function does not exist.
- var $utf8_strlen = 'mb_strlen';
-
- function detab($text) {
- #
- # Replace tabs with the appropriate amount of space.
- #
- # For each line we separate the line in blocks delemited by
- # tab characters. Then we reconstruct every line by adding the
- # appropriate number of space between each blocks.
-
- $text = preg_replace_callback('/^.*\t.*$/m',
- array(&$this, '_detab_callback'), $text);
-
- return $text;
- }
- function _detab_callback($matches) {
- $line = $matches[0];
- $strlen = $this->utf8_strlen; # strlen function for UTF-8.
-
- # Split in blocks.
- $blocks = explode("\t", $line);
- # Add each blocks to the line.
- $line = $blocks[0];
- unset($blocks[0]); # Do not add first block twice.
- foreach ($blocks as $block) {
- # Calculate amount of space, insert spaces, insert block.
- $amount = $this->tab_width -
- $strlen($line, 'UTF-8') % $this->tab_width;
- $line .= str_repeat(" ", $amount) . $block;
- }
- return $line;
- }
- function _initDetab() {
- #
- # Check for the availability of the function in the `utf8_strlen` property
- # (initially `mb_strlen`). If the function is not available, create a
- # function that will loosely count the number of UTF-8 characters with a
- # regular expression.
- #
- if (function_exists($this->utf8_strlen)) return;
- $this->utf8_strlen = create_function('$text', 'return preg_match_all(
- "/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/",
- $text, $m);');
- }
-
-
- function unhash($text) {
- #
- # Swap back in all the tags hashed by _HashHTMLBlocks.
- #
- return preg_replace_callback('/(.)\x1A[0-9]+\1/',
- array(&$this, '_unhash_callback'), $text);
- }
- function _unhash_callback($matches) {
- return $this->html_hashes[$matches[0]];
- }
-
-}
-
-
-#
-# Markdown Extra Parser Class
-#
-
-class MarkdownExtra_Parser extends Markdown_Parser {
-
- ### Configuration Variables ###
-
- # Prefix for footnote ids.
- var $fn_id_prefix = "";
-
- # Optional title attribute for footnote links and backlinks.
- var $fn_link_title = MARKDOWN_FN_LINK_TITLE;
- var $fn_backlink_title = MARKDOWN_FN_BACKLINK_TITLE;
-
- # Optional class attribute for footnote links and backlinks.
- var $fn_link_class = MARKDOWN_FN_LINK_CLASS;
- var $fn_backlink_class = MARKDOWN_FN_BACKLINK_CLASS;
-
- # Optional class prefix for fenced code block.
- var $code_class_prefix = MARKDOWN_CODE_CLASS_PREFIX;
- # Class attribute for code blocks goes on the `code` tag;
- # setting this to true will put attributes on the `pre` tag instead.
- var $code_attr_on_pre = MARKDOWN_CODE_ATTR_ON_PRE;
-
- # Predefined abbreviations.
- var $predef_abbr = array();
-
-
- ### Parser Implementation ###
-
- function MarkdownExtra_Parser() {
- #
- # Constructor function. Initialize the parser object.
- #
- # Add extra escapable characters before parent constructor
- # initialize the table.
- $this->escape_chars .= ':|';
-
- # Insert extra document, block, and span transformations.
- # Parent constructor will do the sorting.
- $this->document_gamut += array(
- "doFencedCodeBlocks" => 5,
- "stripFootnotes" => 15,
- "stripAbbreviations" => 25,
- "appendFootnotes" => 50,
- );
- $this->block_gamut += array(
- "doFencedCodeBlocks" => 5,
- "doTables" => 15,
- "doDefLists" => 45,
- );
- $this->span_gamut += array(
- "doFootnotes" => 5,
- "doAbbreviations" => 70,
- );
-
- parent::Markdown_Parser();
- }
-
-
- # Extra variables used during extra transformations.
- var $footnotes = array();
- var $footnotes_ordered = array();
- var $footnotes_ref_count = array();
- var $footnotes_numbers = array();
- var $abbr_desciptions = array();
- var $abbr_word_re = '';
-
- # Give the current footnote number.
- var $footnote_counter = 1;
-
-
- function setup() {
- #
- # Setting up Extra-specific variables.
- #
- parent::setup();
-
- $this->footnotes = array();
- $this->footnotes_ordered = array();
- $this->footnotes_ref_count = array();
- $this->footnotes_numbers = array();
- $this->abbr_desciptions = array();
- $this->abbr_word_re = '';
- $this->footnote_counter = 1;
-
- foreach ($this->predef_abbr as $abbr_word => $abbr_desc) {
- if ($this->abbr_word_re)
- $this->abbr_word_re .= '|';
- $this->abbr_word_re .= preg_quote($abbr_word);
- $this->abbr_desciptions[$abbr_word] = trim($abbr_desc);
- }
- }
-
- function teardown() {
- #
- # Clearing Extra-specific variables.
- #
- $this->footnotes = array();
- $this->footnotes_ordered = array();
- $this->footnotes_ref_count = array();
- $this->footnotes_numbers = array();
- $this->abbr_desciptions = array();
- $this->abbr_word_re = '';
-
- parent::teardown();
- }
-
-
- ### Extra Attribute Parser ###
-
- # Expression to use to catch attributes (includes the braces)
- var $id_class_attr_catch_re = '\{((?:[ ]*[#.][-_:a-zA-Z0-9]+){1,})[ ]*\}';
- # Expression to use when parsing in a context when no capture is desired
- var $id_class_attr_nocatch_re = '\{(?:[ ]*[#.][-_:a-zA-Z0-9]+){1,}[ ]*\}';
-
- function doExtraAttributes($tag_name, $attr) {
- #
- # Parse attributes caught by the $this->id_class_attr_catch_re expression
- # and return the HTML-formatted list of attributes.
- #
- # Currently supported attributes are .class and #id.
- #
- if (empty($attr)) return "";
-
- # Split on components
- preg_match_all('/[#.][-_:a-zA-Z0-9]+/', $attr, $matches);
- $elements = $matches[0];
-
- # handle classes and ids (only first id taken into account)
- $classes = array();
- $id = false;
- foreach ($elements as $element) {
- if ($element{0} == '.') {
- $classes[] = substr($element, 1);
- } else if ($element{0} == '#') {
- if ($id === false) $id = substr($element, 1);
- }
- }
-
- # compose attributes as string
- $attr_str = "";
- if (!empty($id)) {
- $attr_str .= ' id="'.$id.'"';
- }
- if (!empty($classes)) {
- $attr_str .= ' class="'.implode(" ", $classes).'"';
- }
- return $attr_str;
- }
-
-
- function stripLinkDefinitions($text) {
- #
- # Strips link definitions from text, stores the URLs and titles in
- # hash references.
- #
- $less_than_tab = $this->tab_width - 1;
-
- # Link defs are in the form: ^[id]: url "optional title"
- $text = preg_replace_callback('{
- ^[ ]{0,'.$less_than_tab.'}\[(.+)\][ ]?: # id = $1
- [ ]*
- \n? # maybe *one* newline
- [ ]*
- (?:
- <(.+?)> # url = $2
- |
- (\S+?) # url = $3
- )
- [ ]*
- \n? # maybe one newline
- [ ]*
- (?:
- (?<=\s) # lookbehind for whitespace
- ["(]
- (.*?) # title = $4
- [")]
- [ ]*
- )? # title is optional
- (?:[ ]* '.$this->id_class_attr_catch_re.' )? # $5 = extra id & class attr
- (?:\n+|\Z)
- }xm',
- array(&$this, '_stripLinkDefinitions_callback'),
- $text);
- return $text;
- }
- function _stripLinkDefinitions_callback($matches) {
- $link_id = strtolower($matches[1]);
- $url = $matches[2] == '' ? $matches[3] : $matches[2];
- $this->urls[$link_id] = $url;
- $this->titles[$link_id] =& $matches[4];
- $this->ref_attr[$link_id] = $this->doExtraAttributes("", $dummy =& $matches[5]);
- return ''; # String that will replace the block
- }
-
-
- ### HTML Block Parser ###
-
- # Tags that are always treated as block tags:
- var $block_tags_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend|article|section|nav|aside|hgroup|header|footer|figcaption';
-
- # Tags treated as block tags only if the opening tag is alone on its line:
- var $context_block_tags_re = 'script|noscript|ins|del|iframe|object|source|track|param|math|svg|canvas|audio|video';
-
- # Tags where markdown="1" default to span mode:
- var $contain_span_tags_re = 'p|h[1-6]|li|dd|dt|td|th|legend|address';
-
- # Tags which must not have their contents modified, no matter where
- # they appear:
- var $clean_tags_re = 'script|math|svg';
-
- # Tags that do not need to be closed.
- var $auto_close_tags_re = 'hr|img|param|source|track';
-
-
- function hashHTMLBlocks($text) {
- #
- # Hashify HTML Blocks and "clean tags".
- #
- # We only want to do this for block-level HTML tags, such as headers,
- # lists, and tables. That's because we still want to wrap s around
- # "paragraphs" that are wrapped in non-block-level tags, such as anchors,
- # phrase emphasis, and spans. The list of tags we're looking for is
- # hard-coded.
- #
- # This works by calling _HashHTMLBlocks_InMarkdown, which then calls
- # _HashHTMLBlocks_InHTML when it encounter block tags. When the markdown="1"
- # attribute is found within a tag, _HashHTMLBlocks_InHTML calls back
- # _HashHTMLBlocks_InMarkdown to handle the Markdown syntax within the tag.
- # These two functions are calling each other. It's recursive!
- #
- if ($this->no_markup) return $text;
-
- #
- # Call the HTML-in-Markdown hasher.
- #
- list($text, ) = $this->_hashHTMLBlocks_inMarkdown($text);
-
- return $text;
- }
- function _hashHTMLBlocks_inMarkdown($text, $indent = 0,
- $enclosing_tag_re = '', $span = false)
- {
- #
- # Parse markdown text, calling _HashHTMLBlocks_InHTML for block tags.
- #
- # * $indent is the number of space to be ignored when checking for code
- # blocks. This is important because if we don't take the indent into
- # account, something like this (which looks right) won't work as expected:
- #
- #
- #
- # Hello World. <-- Is this a Markdown code block or text?
- # <-- Is this a Markdown code block or a real tag?
- #
- #
- # If you don't like this, just don't indent the tag on which
- # you apply the markdown="1" attribute.
- #
- # * If $enclosing_tag_re is not empty, stops at the first unmatched closing
- # tag with that name. Nested tags supported.
- #
- # * If $span is true, text inside must treated as span. So any double
- # newline will be replaced by a single newline so that it does not create
- # paragraphs.
- #
- # Returns an array of that form: ( processed text , remaining text )
- #
- if ($text === '') return array('', '');
-
- # Regex to check for the presense of newlines around a block tag.
- $newline_before_re = '/(?:^\n?|\n\n)*$/';
- $newline_after_re =
- '{
- ^ # Start of text following the tag.
- (?>[ ]*)? # Optional comment.
- [ ]*\n # Must be followed by newline.
- }xs';
-
- # Regex to match any tag.
- $block_tag_re =
- '{
- ( # $2: Capture whole tag.
- ? # Any opening or closing tag.
- (?> # Tag name.
- '.$this->block_tags_re.' |
- '.$this->context_block_tags_re.' |
- '.$this->clean_tags_re.' |
- (?!\s)'.$enclosing_tag_re.'
- )
- (?:
- (?=[\s"\'/a-zA-Z0-9]) # Allowed characters after tag name.
- (?>
- ".*?" | # Double quotes (can contain `>`)
- \'.*?\' | # Single quotes (can contain `>`)
- .+? # Anything but quotes and `>`.
- )*?
- )?
- > # End of tag.
- |
- # HTML Comment
- |
- <\?.*?\?> | <%.*?%> # Processing instruction
- |
- # CData Block
- '. ( !$span ? ' # If not in span.
- |
- # Indented code block
- (?: ^[ ]*\n | ^ | \n[ ]*\n )
- [ ]{'.($indent+4).'}[^\n]* \n
- (?>
- (?: [ ]{'.($indent+4).'}[^\n]* | [ ]* ) \n
- )*
- |
- # Fenced code block marker
- (?<= ^ | \n )
- [ ]{0,'.($indent+3).'}(?:~{3,}|`{3,})
- [ ]*
- (?:
- \.?[-_:a-zA-Z0-9]+ # standalone class name
- |
- '.$this->id_class_attr_nocatch_re.' # extra attributes
- )?
- [ ]*
- (?= \n )
- ' : '' ). ' # End (if not is span).
- |
- # Code span marker
- # Note, this regex needs to go after backtick fenced
- # code blocks but it should also be kept outside of the
- # "if not in span" condition adding backticks to the parser
- `+
- )
- }xs';
-
-
- $depth = 0; # Current depth inside the tag tree.
- $parsed = ""; # Parsed text that will be returned.
-
- #
- # Loop through every tag until we find the closing tag of the parent
- # or loop until reaching the end of text if no parent tag specified.
- #
- do {
- #
- # Split the text using the first $tag_match pattern found.
- # Text before pattern will be first in the array, text after
- # pattern will be at the end, and between will be any catches made
- # by the pattern.
- #
- $parts = preg_split($block_tag_re, $text, 2,
- PREG_SPLIT_DELIM_CAPTURE);
-
- # If in Markdown span mode, add a empty-string span-level hash
- # after each newline to prevent triggering any block element.
- if ($span) {
- $void = $this->hashPart("", ':');
- $newline = "$void\n";
- $parts[0] = $void . str_replace("\n", $newline, $parts[0]) . $void;
- }
-
- $parsed .= $parts[0]; # Text before current tag.
-
- # If end of $text has been reached. Stop loop.
- if (count($parts) < 3) {
- $text = "";
- break;
- }
-
- $tag = $parts[1]; # Tag to handle.
- $text = $parts[2]; # Remaining text after current tag.
- $tag_re = preg_quote($tag); # For use in a regular expression.
-
- #
- # Check for: Fenced code block marker.
- # Note: need to recheck the whole tag to disambiguate backtick
- # fences from code spans
- #
- if (preg_match('{^\n?([ ]{0,'.($indent+3).'})(~{3,}|`{3,})[ ]*(?:\.?[-_:a-zA-Z0-9]+|'.$this->id_class_attr_nocatch_re.')?[ ]*\n?$}', $tag, $capture)) {
- # Fenced code block marker: find matching end marker.
- $fence_indent = strlen($capture[1]); # use captured indent in re
- $fence_re = $capture[2]; # use captured fence in re
- if (preg_match('{^(?>.*\n)*?[ ]{'.($fence_indent).'}'.$fence_re.'[ ]*(?:\n|$)}', $text,
- $matches))
- {
- # End marker found: pass text unchanged until marker.
- $parsed .= $tag . $matches[0];
- $text = substr($text, strlen($matches[0]));
- }
- else {
- # No end marker: just skip it.
- $parsed .= $tag;
- }
- }
- #
- # Check for: Indented code block.
- #
- else if ($tag{0} == "\n" || $tag{0} == " ") {
- # Indented code block: pass it unchanged, will be handled
- # later.
- $parsed .= $tag;
- }
- #
- # Check for: Code span marker
- # Note: need to check this after backtick fenced code blocks
- #
- else if ($tag{0} == "`") {
- # Find corresponding end marker.
- $tag_re = preg_quote($tag);
- if (preg_match('{^(?>.+?|\n(?!\n))*?(?block_tags_re.')\b}', $tag) ||
- ( preg_match('{^<(?:'.$this->context_block_tags_re.')\b}', $tag) &&
- preg_match($newline_before_re, $parsed) &&
- preg_match($newline_after_re, $text) )
- )
- {
- # Need to parse tag and following text using the HTML parser.
- list($block_text, $text) =
- $this->_hashHTMLBlocks_inHTML($tag . $text, "hashBlock", true);
-
- # Make sure it stays outside of any paragraph by adding newlines.
- $parsed .= "\n\n$block_text\n\n";
- }
- #
- # Check for: Clean tag (like script, math)
- # HTML Comments, processing instructions.
- #
- else if (preg_match('{^<(?:'.$this->clean_tags_re.')\b}', $tag) ||
- $tag{1} == '!' || $tag{1} == '?')
- {
- # Need to parse tag and following text using the HTML parser.
- # (don't check for markdown attribute)
- list($block_text, $text) =
- $this->_hashHTMLBlocks_inHTML($tag . $text, "hashClean", false);
-
- $parsed .= $block_text;
- }
- #
- # Check for: Tag with same name as enclosing tag.
- #
- else if ($enclosing_tag_re !== '' &&
- # Same name as enclosing tag.
- preg_match('{^?(?:'.$enclosing_tag_re.')\b}', $tag))
- {
- #
- # Increase/decrease nested tag count.
- #
- if ($tag{1} == '/') $depth--;
- else if ($tag{strlen($tag)-2} != '/') $depth++;
-
- if ($depth < 0) {
- #
- # Going out of parent element. Clean up and break so we
- # return to the calling function.
- #
- $text = $tag . $text;
- break;
- }
-
- $parsed .= $tag;
- }
- else {
- $parsed .= $tag;
- }
- } while ($depth >= 0);
-
- return array($parsed, $text);
- }
- function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) {
- #
- # Parse HTML, calling _HashHTMLBlocks_InMarkdown for block tags.
- #
- # * Calls $hash_method to convert any blocks.
- # * Stops when the first opening tag closes.
- # * $md_attr indicate if the use of the `markdown="1"` attribute is allowed.
- # (it is not inside clean tags)
- #
- # Returns an array of that form: ( processed text , remaining text )
- #
- if ($text === '') return array('', '');
-
- # Regex to match `markdown` attribute inside of a tag.
- $markdown_attr_re = '
- {
- \s* # Eat whitespace before the `markdown` attribute
- markdown
- \s*=\s*
- (?>
- (["\']) # $1: quote delimiter
- (.*?) # $2: attribute value
- \1 # matching delimiter
- |
- ([^\s>]*) # $3: unquoted attribute value
- )
- () # $4: make $3 always defined (avoid warnings)
- }xs';
-
- # Regex to match any tag.
- $tag_re = '{
- ( # $2: Capture whole tag.
- ? # Any opening or closing tag.
- [\w:$]+ # Tag name.
- (?:
- (?=[\s"\'/a-zA-Z0-9]) # Allowed characters after tag name.
- (?>
- ".*?" | # Double quotes (can contain `>`)
- \'.*?\' | # Single quotes (can contain `>`)
- .+? # Anything but quotes and `>`.
- )*?
- )?
- > # End of tag.
- |
- # HTML Comment
- |
- <\?.*?\?> | <%.*?%> # Processing instruction
- |
- # CData Block
- )
- }xs';
-
- $original_text = $text; # Save original text in case of faliure.
-
- $depth = 0; # Current depth inside the tag tree.
- $block_text = ""; # Temporary text holder for current text.
- $parsed = ""; # Parsed text that will be returned.
-
- #
- # Get the name of the starting tag.
- # (This pattern makes $base_tag_name_re safe without quoting.)
- #
- if (preg_match('/^<([\w:$]*)\b/', $text, $matches))
- $base_tag_name_re = $matches[1];
-
- #
- # Loop through every tag until we find the corresponding closing tag.
- #
- do {
- #
- # Split the text using the first $tag_match pattern found.
- # Text before pattern will be first in the array, text after
- # pattern will be at the end, and between will be any catches made
- # by the pattern.
- #
- $parts = preg_split($tag_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE);
-
- if (count($parts) < 3) {
- #
- # End of $text reached with unbalenced tag(s).
- # In that case, we return original text unchanged and pass the
- # first character as filtered to prevent an infinite loop in the
- # parent function.
- #
- return array($original_text{0}, substr($original_text, 1));
- }
-
- $block_text .= $parts[0]; # Text before current tag.
- $tag = $parts[1]; # Tag to handle.
- $text = $parts[2]; # Remaining text after current tag.
-
- #
- # Check for: Auto-close tag (like
)
- # Comments and Processing Instructions.
- #
- if (preg_match('{^?(?:'.$this->auto_close_tags_re.')\b}', $tag) ||
- $tag{1} == '!' || $tag{1} == '?')
- {
- # Just add the tag to the block as if it was text.
- $block_text .= $tag;
- }
- else {
- #
- # Increase/decrease nested tag count. Only do so if
- # the tag's name match base tag's.
- #
- if (preg_match('{^?'.$base_tag_name_re.'\b}', $tag)) {
- if ($tag{1} == '/') $depth--;
- else if ($tag{strlen($tag)-2} != '/') $depth++;
- }
-
- #
- # Check for `markdown="1"` attribute and handle it.
- #
- if ($md_attr &&
- preg_match($markdown_attr_re, $tag, $attr_m) &&
- preg_match('/^1|block|span$/', $attr_m[2] . $attr_m[3]))
- {
- # Remove `markdown` attribute from opening tag.
- $tag = preg_replace($markdown_attr_re, '', $tag);
-
- # Check if text inside this tag must be parsed in span mode.
- $this->mode = $attr_m[2] . $attr_m[3];
- $span_mode = $this->mode == 'span' || $this->mode != 'block' &&
- preg_match('{^<(?:'.$this->contain_span_tags_re.')\b}', $tag);
-
- # Calculate indent before tag.
- if (preg_match('/(?:^|\n)( *?)(?! ).*?$/', $block_text, $matches)) {
- $strlen = $this->utf8_strlen;
- $indent = $strlen($matches[1], 'UTF-8');
- } else {
- $indent = 0;
- }
-
- # End preceding block with this tag.
- $block_text .= $tag;
- $parsed .= $this->$hash_method($block_text);
-
- # Get enclosing tag name for the ParseMarkdown function.
- # (This pattern makes $tag_name_re safe without quoting.)
- preg_match('/^<([\w:$]*)\b/', $tag, $matches);
- $tag_name_re = $matches[1];
-
- # Parse the content using the HTML-in-Markdown parser.
- list ($block_text, $text)
- = $this->_hashHTMLBlocks_inMarkdown($text, $indent,
- $tag_name_re, $span_mode);
-
- # Outdent markdown text.
- if ($indent > 0) {
- $block_text = preg_replace("/^[ ]{1,$indent}/m", "",
- $block_text);
- }
-
- # Append tag content to parsed text.
- if (!$span_mode) $parsed .= "\n\n$block_text\n\n";
- else $parsed .= "$block_text";
-
- # Start over with a new block.
- $block_text = "";
- }
- else $block_text .= $tag;
- }
-
- } while ($depth > 0);
-
- #
- # Hash last block text that wasn't processed inside the loop.
- #
- $parsed .= $this->$hash_method($block_text);
-
- return array($parsed, $text);
- }
-
-
- function hashClean($text) {
- #
- # Called whenever a tag must be hashed when a function inserts a "clean" tag
- # in $text, it passes through this function and is automaticaly escaped,
- # blocking invalid nested overlap.
- #
- return $this->hashPart($text, 'C');
- }
-
-
- function doAnchors($text) {
- #
- # Turn Markdown link shortcuts into XHTML tags.
- #
- if ($this->in_anchor) return $text;
- $this->in_anchor = true;
-
- #
- # First, handle reference-style links: [link text] [id]
- #
- $text = preg_replace_callback('{
- ( # wrap whole match in $1
- \[
- ('.$this->nested_brackets_re.') # link text = $2
- \]
-
- [ ]? # one optional space
- (?:\n[ ]*)? # one optional newline followed by spaces
-
- \[
- (.*?) # id = $3
- \]
- )
- }xs',
- array(&$this, '_doAnchors_reference_callback'), $text);
-
- #
- # Next, inline-style links: [link text](url "optional title")
- #
- $text = preg_replace_callback('{
- ( # wrap whole match in $1
- \[
- ('.$this->nested_brackets_re.') # link text = $2
- \]
- \( # literal paren
- [ \n]*
- (?:
- <(.+?)> # href = $3
- |
- ('.$this->nested_url_parenthesis_re.') # href = $4
- )
- [ \n]*
- ( # $5
- ([\'"]) # quote char = $6
- (.*?) # Title = $7
- \6 # matching quote
- [ \n]* # ignore any spaces/tabs between closing quote and )
- )? # title is optional
- \)
- (?:[ ]? '.$this->id_class_attr_catch_re.' )? # $8 = id/class attributes
- )
- }xs',
- array(&$this, '_doAnchors_inline_callback'), $text);
-
- #
- # Last, handle reference-style shortcuts: [link text]
- # These must come last in case you've also got [link text][1]
- # or [link text](/foo)
- #
- $text = preg_replace_callback('{
- ( # wrap whole match in $1
- \[
- ([^\[\]]+) # link text = $2; can\'t contain [ or ]
- \]
- )
- }xs',
- array(&$this, '_doAnchors_reference_callback'), $text);
-
- $this->in_anchor = false;
- return $text;
- }
- function _doAnchors_reference_callback($matches) {
- $whole_match = $matches[1];
- $link_text = $matches[2];
- $link_id =& $matches[3];
-
- if ($link_id == "") {
- # for shortcut links like [this][] or [this].
- $link_id = $link_text;
- }
-
- # lower-case and turn embedded newlines into spaces
- $link_id = strtolower($link_id);
- $link_id = preg_replace('{[ ]?\n}', ' ', $link_id);
-
- if (isset($this->urls[$link_id])) {
- $url = $this->urls[$link_id];
- $url = $this->encodeAttribute($url);
-
- $result = "titles[$link_id] ) ) {
- $title = $this->titles[$link_id];
- $title = $this->encodeAttribute($title);
- $result .= " title=\"$title\"";
- }
- if (isset($this->ref_attr[$link_id]))
- $result .= $this->ref_attr[$link_id];
-
- $link_text = $this->runSpanGamut($link_text);
- $result .= ">$link_text";
- $result = $this->hashPart($result);
- }
- else {
- $result = $whole_match;
- }
- return $result;
- }
- function _doAnchors_inline_callback($matches) {
- $whole_match = $matches[1];
- $link_text = $this->runSpanGamut($matches[2]);
- $url = $matches[3] == '' ? $matches[4] : $matches[3];
- $title =& $matches[7];
- $attr = $this->doExtraAttributes("a", $dummy =& $matches[8]);
-
-
- $url = $this->encodeAttribute($url);
-
- $result = "encodeAttribute($title);
- $result .= " title=\"$title\"";
- }
- $result .= $attr;
-
- $link_text = $this->runSpanGamut($link_text);
- $result .= ">$link_text";
-
- return $this->hashPart($result);
- }
-
-
- function doImages($text) {
- #
- # Turn Markdown image shortcuts into tags.
- #
- #
- # First, handle reference-style labeled images: ![alt text][id]
- #
- $text = preg_replace_callback('{
- ( # wrap whole match in $1
- !\[
- ('.$this->nested_brackets_re.') # alt text = $2
- \]
-
- [ ]? # one optional space
- (?:\n[ ]*)? # one optional newline followed by spaces
-
- \[
- (.*?) # id = $3
- \]
-
- )
- }xs',
- array(&$this, '_doImages_reference_callback'), $text);
-
- #
- # Next, handle inline images: ![alt text](url "optional title")
- # Don't forget: encode * and _
- #
- $text = preg_replace_callback('{
- ( # wrap whole match in $1
- !\[
- ('.$this->nested_brackets_re.') # alt text = $2
- \]
- \s? # One optional whitespace character
- \( # literal paren
- [ \n]*
- (?:
- <(\S*)> # src url = $3
- |
- ('.$this->nested_url_parenthesis_re.') # src url = $4
- )
- [ \n]*
- ( # $5
- ([\'"]) # quote char = $6
- (.*?) # title = $7
- \6 # matching quote
- [ \n]*
- )? # title is optional
- \)
- (?:[ ]? '.$this->id_class_attr_catch_re.' )? # $8 = id/class attributes
- )
- }xs',
- array(&$this, '_doImages_inline_callback'), $text);
-
- return $text;
- }
- function _doImages_reference_callback($matches) {
- $whole_match = $matches[1];
- $alt_text = $matches[2];
- $link_id = strtolower($matches[3]);
-
- if ($link_id == "") {
- $link_id = strtolower($alt_text); # for shortcut links like ![this][].
- }
-
- $alt_text = $this->encodeAttribute($alt_text);
- if (isset($this->urls[$link_id])) {
- $url = $this->encodeAttribute($this->urls[$link_id]);
- $result = "titles[$link_id])) {
- $title = $this->titles[$link_id];
- $title = $this->encodeAttribute($title);
- $result .= " title=\"$title\"";
- }
- if (isset($this->ref_attr[$link_id]))
- $result .= $this->ref_attr[$link_id];
- $result .= $this->empty_element_suffix;
- $result = $this->hashPart($result);
- }
- else {
- # If there's no such link ID, leave intact:
- $result = $whole_match;
- }
-
- return $result;
- }
- function _doImages_inline_callback($matches) {
- $whole_match = $matches[1];
- $alt_text = $matches[2];
- $url = $matches[3] == '' ? $matches[4] : $matches[3];
- $title =& $matches[7];
- $attr = $this->doExtraAttributes("img", $dummy =& $matches[8]);
-
- $alt_text = $this->encodeAttribute($alt_text);
- $url = $this->encodeAttribute($url);
- $result = "encodeAttribute($title);
- $result .= " title=\"$title\""; # $title already quoted
- }
- $result .= $attr;
- $result .= $this->empty_element_suffix;
-
- return $this->hashPart($result);
- }
-
-
- function doHeaders($text) {
- #
- # Redefined to add id and class attribute support.
- #
- # Setext-style headers:
- # Header 1 {#header1}
- # ========
- #
- # Header 2 {#header2 .class1 .class2}
- # --------
- #
- $text = preg_replace_callback(
- '{
- (^.+?) # $1: Header text
- (?:[ ]+ '.$this->id_class_attr_catch_re.' )? # $3 = id/class attributes
- [ ]*\n(=+|-+)[ ]*\n+ # $3: Header footer
- }mx',
- array(&$this, '_doHeaders_callback_setext'), $text);
-
- # atx-style headers:
- # # Header 1 {#header1}
- # ## Header 2 {#header2}
- # ## Header 2 with closing hashes ## {#header3.class1.class2}
- # ...
- # ###### Header 6 {.class2}
- #
- $text = preg_replace_callback('{
- ^(\#{1,6}) # $1 = string of #\'s
- [ ]*
- (.+?) # $2 = Header text
- [ ]*
- \#* # optional closing #\'s (not counted)
- (?:[ ]+ '.$this->id_class_attr_catch_re.' )? # $3 = id/class attributes
- [ ]*
- \n+
- }xm',
- array(&$this, '_doHeaders_callback_atx'), $text);
-
- return $text;
- }
- function _doHeaders_callback_setext($matches) {
- if ($matches[3] == '-' && preg_match('{^- }', $matches[1]))
- return $matches[0];
- $level = $matches[3]{0} == '=' ? 1 : 2;
- $attr = $this->doExtraAttributes("h$level", $dummy =& $matches[2]);
- $block = "".$this->runSpanGamut($matches[1])." ";
- return "\n" . $this->hashBlock($block) . "\n\n";
- }
- function _doHeaders_callback_atx($matches) {
- $level = strlen($matches[1]);
- $attr = $this->doExtraAttributes("h$level", $dummy =& $matches[3]);
- $block = "".$this->runSpanGamut($matches[2])." ";
- return "\n" . $this->hashBlock($block) . "\n\n";
- }
-
-
- function doTables($text) {
- #
- # Form HTML tables.
- #
- $less_than_tab = $this->tab_width - 1;
- #
- # Find tables with leading pipe.
- #
- # | Header 1 | Header 2
- # | -------- | --------
- # | Cell 1 | Cell 2
- # | Cell 3 | Cell 4
- #
- $text = preg_replace_callback('
- {
- ^ # Start of a line
- [ ]{0,'.$less_than_tab.'} # Allowed whitespace.
- [|] # Optional leading pipe (present)
- (.+) \n # $1: Header row (at least one pipe)
-
- [ ]{0,'.$less_than_tab.'} # Allowed whitespace.
- [|] ([ ]*[-:]+[-| :]*) \n # $2: Header underline
-
- ( # $3: Cells
- (?>
- [ ]* # Allowed whitespace.
- [|] .* \n # Row content.
- )*
- )
- (?=\n|\Z) # Stop at final double newline.
- }xm',
- array(&$this, '_doTable_leadingPipe_callback'), $text);
-
- #
- # Find tables without leading pipe.
- #
- # Header 1 | Header 2
- # -------- | --------
- # Cell 1 | Cell 2
- # Cell 3 | Cell 4
- #
- $text = preg_replace_callback('
- {
- ^ # Start of a line
- [ ]{0,'.$less_than_tab.'} # Allowed whitespace.
- (\S.*[|].*) \n # $1: Header row (at least one pipe)
-
- [ ]{0,'.$less_than_tab.'} # Allowed whitespace.
- ([-:]+[ ]*[|][-| :]*) \n # $2: Header underline
-
- ( # $3: Cells
- (?>
- .* [|] .* \n # Row content
- )*
- )
- (?=\n|\Z) # Stop at final double newline.
- }xm',
- array(&$this, '_DoTable_callback'), $text);
-
- return $text;
- }
- function _doTable_leadingPipe_callback($matches) {
- $head = $matches[1];
- $underline = $matches[2];
- $content = $matches[3];
-
- # Remove leading pipe for each row.
- $content = preg_replace('/^ *[|]/m', '', $content);
-
- return $this->_doTable_callback(array($matches[0], $head, $underline, $content));
- }
- function _doTable_callback($matches) {
- $head = $matches[1];
- $underline = $matches[2];
- $content = $matches[3];
-
- # Remove any tailing pipes for each line.
- $head = preg_replace('/[|] *$/m', '', $head);
- $underline = preg_replace('/[|] *$/m', '', $underline);
- $content = preg_replace('/[|] *$/m', '', $content);
-
- # Reading alignement from header underline.
- $separators = preg_split('/ *[|] */', $underline);
- foreach ($separators as $n => $s) {
- if (preg_match('/^ *-+: *$/', $s)) $attr[$n] = ' align="right"';
- else if (preg_match('/^ *:-+: *$/', $s))$attr[$n] = ' align="center"';
- else if (preg_match('/^ *:-+ *$/', $s)) $attr[$n] = ' align="left"';
- else $attr[$n] = '';
- }
-
- # Parsing span elements, including code spans, character escapes,
- # and inline HTML tags, so that pipes inside those gets ignored.
- $head = $this->parseSpan($head);
- $headers = preg_split('/ *[|] */', $head);
- $col_count = count($headers);
- $attr = array_pad($attr, $col_count, '');
-
- # Write column headers.
- $text = "\n";
- $text .= "\n";
- $text .= "\n";
- foreach ($headers as $n => $header)
- $text .= " ".$this->runSpanGamut(trim($header))." \n";
- $text .= " \n";
- $text .= "\n";
-
- # Split content by row.
- $rows = explode("\n", trim($content, "\n"));
-
- $text .= "\n";
- foreach ($rows as $row) {
- # Parsing span elements, including code spans, character escapes,
- # and inline HTML tags, so that pipes inside those gets ignored.
- $row = $this->parseSpan($row);
-
- # Split row by cell.
- $row_cells = preg_split('/ *[|] */', $row, $col_count);
- $row_cells = array_pad($row_cells, $col_count, '');
-
- $text .= "\n";
- foreach ($row_cells as $n => $cell)
- $text .= " ".$this->runSpanGamut(trim($cell))." \n";
- $text .= " \n";
- }
- $text .= "\n";
- $text .= "
";
-
- return $this->hashBlock($text) . "\n";
- }
-
-
- function doDefLists($text) {
- #
- # Form HTML definition lists.
- #
- $less_than_tab = $this->tab_width - 1;
-
- # Re-usable pattern to match any entire dl list:
- $whole_list_re = '(?>
- ( # $1 = whole list
- ( # $2
- [ ]{0,'.$less_than_tab.'}
- ((?>.*\S.*\n)+) # $3 = defined term
- \n?
- [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition
- )
- (?s:.+?)
- ( # $4
- \z
- |
- \n{2,}
- (?=\S)
- (?! # Negative lookahead for another term
- [ ]{0,'.$less_than_tab.'}
- (?: \S.*\n )+? # defined term
- \n?
- [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition
- )
- (?! # Negative lookahead for another definition
- [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition
- )
- )
- )
- )'; // mx
-
- $text = preg_replace_callback('{
- (?>\A\n?|(?<=\n\n))
- '.$whole_list_re.'
- }mx',
- array(&$this, '_doDefLists_callback'), $text);
-
- return $text;
- }
- function _doDefLists_callback($matches) {
- # Re-usable patterns to match list item bullets and number markers:
- $list = $matches[1];
-
- # Turn double returns into triple returns, so that we can make a
- # paragraph for the last item in a list, if necessary:
- $result = trim($this->processDefListItems($list));
- $result = "\n" . $result . "\n
";
- return $this->hashBlock($result) . "\n\n";
- }
-
-
- function processDefListItems($list_str) {
- #
- # Process the contents of a single definition list, splitting it
- # into individual term and definition list items.
- #
- $less_than_tab = $this->tab_width - 1;
-
- # trim trailing blank lines:
- $list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str);
-
- # Process definition terms.
- $list_str = preg_replace_callback('{
- (?>\A\n?|\n\n+) # leading line
- ( # definition terms = $1
- [ ]{0,'.$less_than_tab.'} # leading whitespace
- (?!\:[ ]|[ ]) # negative lookahead for a definition
- # mark (colon) or more whitespace.
- (?> \S.* \n)+? # actual term (not whitespace).
- )
- (?=\n?[ ]{0,3}:[ ]) # lookahead for following line feed
- # with a definition mark.
- }xm',
- array(&$this, '_processDefListItems_callback_dt'), $list_str);
-
- # Process actual definitions.
- $list_str = preg_replace_callback('{
- \n(\n+)? # leading line = $1
- ( # marker space = $2
- [ ]{0,'.$less_than_tab.'} # whitespace before colon
- \:[ ]+ # definition mark (colon)
- )
- ((?s:.+?)) # definition text = $3
- (?= \n+ # stop at next definition mark,
- (?: # next term or end of text
- [ ]{0,'.$less_than_tab.'} \:[ ] |
- | \z
- )
- )
- }xm',
- array(&$this, '_processDefListItems_callback_dd'), $list_str);
-
- return $list_str;
- }
- function _processDefListItems_callback_dt($matches) {
- $terms = explode("\n", trim($matches[1]));
- $text = '';
- foreach ($terms as $term) {
- $term = $this->runSpanGamut(trim($term));
- $text .= "\n" . $term . " ";
- }
- return $text . "\n";
- }
- function _processDefListItems_callback_dd($matches) {
- $leading_line = $matches[1];
- $marker_space = $matches[2];
- $def = $matches[3];
-
- if ($leading_line || preg_match('/\n{2,}/', $def)) {
- # Replace marker with the appropriate whitespace indentation
- $def = str_repeat(' ', strlen($marker_space)) . $def;
- $def = $this->runBlockGamut($this->outdent($def . "\n\n"));
- $def = "\n". $def ."\n";
- }
- else {
- $def = rtrim($def);
- $def = $this->runSpanGamut($this->outdent($def));
- }
-
- return "\n " . $def . " \n";
- }
-
-
- function doFencedCodeBlocks($text) {
- #
- # Adding the fenced code block syntax to regular Markdown:
- #
- # ~~~
- # Code block
- # ~~~
- #
- $less_than_tab = $this->tab_width;
-
- $text = preg_replace_callback('{
- (?:\n|\A)
- # 1: Opening marker
- (
- (?:~{3,}|`{3,}) # 3 or more tildes/backticks.
- )
- [ ]*
- (?:
- \.?([-_:a-zA-Z0-9]+) # 2: standalone class name
- |
- '.$this->id_class_attr_catch_re.' # 3: Extra attributes
- )?
- [ ]* \n # Whitespace and newline following marker.
-
- # 4: Content
- (
- (?>
- (?!\1 [ ]* \n) # Not a closing marker.
- .*\n+
- )+
- )
-
- # Closing marker.
- \1 [ ]* (?= \n )
- }xm',
- array(&$this, '_doFencedCodeBlocks_callback'), $text);
-
- return $text;
- }
- function _doFencedCodeBlocks_callback($matches) {
- $classname =& $matches[2];
- $attrs =& $matches[3];
- $codeblock = $matches[4];
- $codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES);
- $codeblock = preg_replace_callback('/^\n+/',
- array(&$this, '_doFencedCodeBlocks_newlines'), $codeblock);
-
- if ($classname != "") {
- if ($classname{0} == '.')
- $classname = substr($classname, 1);
- $attr_str = ' class="'.$this->code_class_prefix.$classname.'"';
- } else {
- $attr_str = $this->doExtraAttributes($this->code_attr_on_pre ? "pre" : "code", $attrs);
- }
- $pre_attr_str = $this->code_attr_on_pre ? $attr_str : '';
- $code_attr_str = $this->code_attr_on_pre ? '' : $attr_str;
- $codeblock = "$codeblock
";
-
- return "\n\n".$this->hashBlock($codeblock)."\n\n";
- }
- function _doFencedCodeBlocks_newlines($matches) {
- return str_repeat("
empty_element_suffix",
- strlen($matches[0]));
- }
-
-
- #
- # Redefining emphasis markers so that emphasis by underscore does not
- # work in the middle of a word.
- #
- var $em_relist = array(
- '' => '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? tags
- #
- # Strip leading and trailing lines:
- $text = preg_replace('/\A\n+|\n+\z/', '', $text);
-
- $grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY);
-
- #
- # Wrap tags and unhashify HTML blocks
- #
- foreach ($grafs as $key => $value) {
- $value = trim($this->runSpanGamut($value));
-
- # Check if this should be enclosed in a paragraph.
- # Clean tag hashes & block tag hashes are left alone.
- $is_p = !preg_match('/^B\x1A[0-9]+B|^C\x1A[0-9]+C$/', $value);
-
- if ($is_p) {
- $value = "
$value
";
- }
- $grafs[$key] = $value;
- }
-
- # Join grafs in one text, then unhash HTML tags.
- $text = implode("\n\n", $grafs);
-
- # Finish by removing any tag hashes still present in $text.
- $text = $this->unhash($text);
-
- return $text;
- }
-
-
- ### Footnotes
-
- function stripFootnotes($text) {
- #
- # Strips link definitions from text, stores the URLs and titles in
- # hash references.
- #
- $less_than_tab = $this->tab_width - 1;
-
- # Link defs are in the form: [^id]: url "optional title"
- $text = preg_replace_callback('{
- ^[ ]{0,'.$less_than_tab.'}\[\^(.+?)\][ ]?: # note_id = $1
- [ ]*
- \n? # maybe *one* newline
- ( # text = $2 (no blank lines allowed)
- (?:
- .+ # actual text
- |
- \n # newlines but
- (?!\[\^.+?\]:\s)# negative lookahead for footnote marker.
- (?!\n+[ ]{0,3}\S)# ensure line is not blank and followed
- # by non-indented content
- )*
- )
- }xm',
- array(&$this, '_stripFootnotes_callback'),
- $text);
- return $text;
- }
- function _stripFootnotes_callback($matches) {
- $note_id = $this->fn_id_prefix . $matches[1];
- $this->footnotes[$note_id] = $this->outdent($matches[2]);
- return ''; # String that will replace the block
- }
-
-
- function doFootnotes($text) {
- #
- # Replace footnote references in $text [^id] with a special text-token
- # which will be replaced by the actual footnote marker in appendFootnotes.
- #
- if (!$this->in_anchor) {
- $text = preg_replace('{\[\^(.+?)\]}', "F\x1Afn:\\1\x1A:", $text);
- }
- return $text;
- }
-
-
- function appendFootnotes($text) {
- #
- # Append footnote list to text.
- #
- $text = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}',
- array(&$this, '_appendFootnotes_callback'), $text);
-
- if (!empty($this->footnotes_ordered)) {
- $text .= "\n\n";
- $text .= "\n";
- $text .= "
empty_element_suffix ."\n";
- $text .= "\n\n";
-
- $attr = " rev=\"footnote\"";
- if ($this->fn_backlink_class != "") {
- $class = $this->fn_backlink_class;
- $class = $this->encodeAttribute($class);
- $attr .= " class=\"$class\"";
- }
- if ($this->fn_backlink_title != "") {
- $title = $this->fn_backlink_title;
- $title = $this->encodeAttribute($title);
- $attr .= " title=\"$title\"";
- }
- $num = 0;
-
- while (!empty($this->footnotes_ordered)) {
- $footnote = reset($this->footnotes_ordered);
- $note_id = key($this->footnotes_ordered);
- unset($this->footnotes_ordered[$note_id]);
- $ref_count = $this->footnotes_ref_count[$note_id];
- unset($this->footnotes_ref_count[$note_id]);
- unset($this->footnotes[$note_id]);
-
- $footnote .= "\n"; # Need to append newline before parsing.
- $footnote = $this->runBlockGamut("$footnote\n");
- $footnote = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}',
- array(&$this, '_appendFootnotes_callback'), $footnote);
-
- $attr = str_replace("%%", ++$num, $attr);
- $note_id = $this->encodeAttribute($note_id);
-
- # Prepare backlink, multiple backlinks if multiple references
- $backlink = "↩";
- for ($ref_num = 2; $ref_num <= $ref_count; ++$ref_num) {
- $backlink .= " ↩";
- }
- # Add backlink to last paragraph; create new paragraph if needed.
- if (preg_match('{$}', $footnote)) {
- $footnote = substr($footnote, 0, -4) . " $backlink";
- } else {
- $footnote .= "\n\n$backlink
";
- }
-
- $text .= "- \n";
- $text .= $footnote . "\n";
- $text .= "
\n\n";
- }
-
- $text .= "
\n";
- $text .= "";
- }
- return $text;
- }
- function _appendFootnotes_callback($matches) {
- $node_id = $this->fn_id_prefix . $matches[1];
-
- # Create footnote marker only if it has a corresponding footnote *and*
- # the footnote hasn't been used by another marker.
- if (isset($this->footnotes[$node_id])) {
- $num =& $this->footnotes_numbers[$node_id];
- if (!isset($num)) {
- # Transfer footnote content to the ordered list and give it its
- # number
- $this->footnotes_ordered[$node_id] = $this->footnotes[$node_id];
- $this->footnotes_ref_count[$node_id] = 1;
- $num = $this->footnote_counter++;
- $ref_count_mark = '';
- } else {
- $ref_count_mark = $this->footnotes_ref_count[$node_id] += 1;
- }
-
- $attr = " rel=\"footnote\"";
- if ($this->fn_link_class != "") {
- $class = $this->fn_link_class;
- $class = $this->encodeAttribute($class);
- $attr .= " class=\"$class\"";
- }
- if ($this->fn_link_title != "") {
- $title = $this->fn_link_title;
- $title = $this->encodeAttribute($title);
- $attr .= " title=\"$title\"";
- }
-
- $attr = str_replace("%%", $num, $attr);
- $node_id = $this->encodeAttribute($node_id);
-
- return
- "".
- "$num".
- "";
- }
-
- return "[^".$matches[1]."]";
- }
-
-
- ### Abbreviations ###
-
- function stripAbbreviations($text) {
- #
- # Strips abbreviations from text, stores titles in hash references.
- #
- $less_than_tab = $this->tab_width - 1;
-
- # Link defs are in the form: [id]*: url "optional title"
- $text = preg_replace_callback('{
- ^[ ]{0,'.$less_than_tab.'}\*\[(.+?)\][ ]?: # abbr_id = $1
- (.*) # text = $2 (no blank lines allowed)
- }xm',
- array(&$this, '_stripAbbreviations_callback'),
- $text);
- return $text;
- }
- function _stripAbbreviations_callback($matches) {
- $abbr_word = $matches[1];
- $abbr_desc = $matches[2];
- if ($this->abbr_word_re)
- $this->abbr_word_re .= '|';
- $this->abbr_word_re .= preg_quote($abbr_word);
- $this->abbr_desciptions[$abbr_word] = trim($abbr_desc);
- return ''; # String that will replace the block
- }
-
-
- function doAbbreviations($text) {
- #
- # Find defined abbreviations in text and wrap them in elements.
- #
- if ($this->abbr_word_re) {
- // cannot use the /x modifier because abbr_word_re may
- // contain significant spaces:
- $text = preg_replace_callback('{'.
- '(?abbr_word_re.')'.
- '(?![\w\x1A])'.
- '}',
- array(&$this, '_doAbbreviations_callback'), $text);
- }
- return $text;
- }
- function _doAbbreviations_callback($matches) {
- $abbr = $matches[0];
- if (isset($this->abbr_desciptions[$abbr])) {
- $desc = $this->abbr_desciptions[$abbr];
- if (empty($desc)) {
- return $this->hashPart("$abbr");
- } else {
- $desc = $this->encodeAttribute($desc);
- return $this->hashPart("$abbr");
- }
- } else {
- return $matches[0];
- }
- }
-
-}
-
-
-/*
-
-PHP Markdown Extra
-==================
-
-Description
------------
-
-This is a PHP port of the original Markdown formatter written in Perl
-by John Gruber. This special "Extra" version of PHP Markdown features
-further enhancements to the syntax for making additional constructs
-such as tables and definition list.
-
-Markdown is a text-to-HTML filter; it translates an easy-to-read /
-easy-to-write structured text format into HTML. Markdown's text format
-is mostly similar to that of plain text email, and supports features such
-as headers, *emphasis*, code blocks, blockquotes, and links.
-
-Markdown's syntax is designed not as a generic markup language, but
-specifically to serve as a front-end to (X)HTML. You can use span-level
-HTML tags anywhere in a Markdown document, and you can use block level
-HTML tags (like and as well).
-
-For more information about Markdown's syntax, see:
-
-
-
-
-Bugs
-----
-
-To file bug reports please send email to:
-
-
-
-Please include with your report: (1) the example input; (2) the output you
-expected; (3) the output Markdown actually produced.
-
-
-Version History
----------------
-
-See the readme file for detailed release notes for this version.
-
-
-Copyright and License
----------------------
-
-PHP Markdown & Extra
-Copyright (c) 2004-2013 Michel Fortin
-
-All rights reserved.
-
-Based on Markdown
-Copyright (c) 2003-2006 John Gruber
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-* Neither the name "Markdown" nor the names of its contributors may
- be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-This software is provided by the copyright holders and contributors "as
-is" and any express or implied warranties, including, but not limited
-to, the implied warranties of merchantability and fitness for a
-particular purpose are disclaimed. In no event shall the copyright owner
-or contributors be liable for any direct, indirect, incidental, special,
-exemplary, or consequential damages (including, but not limited to,
-procurement of substitute goods or services; loss of use, data, or
-profits; or business interruption) however caused and on any theory of
-liability, whether in contract, strict liability, or tort (including
-negligence or otherwise) arising in any way out of the use of this
-software, even if advised of the possibility of such damage.
-
-*/
-?>
diff --git a/milfs/includes/mysql b/milfs/includes/mysql
deleted file mode 100644
index e69de29..0000000
diff --git a/milfs/includes/parametrizacion.php b/milfs/includes/parametrizacion.php
deleted file mode 100644
index 4f0ba8f..0000000
--- a/milfs/includes/parametrizacion.php
+++ /dev/null
@@ -1,23 +0,0 @@
-
diff --git a/milfs/includes/simple_html_dom.php b/milfs/includes/simple_html_dom.php
deleted file mode 100644
index bc2cf0a..0000000
--- a/milfs/includes/simple_html_dom.php
+++ /dev/null
@@ -1,1721 +0,0 @@
-size is the "real" number of bytes the dom was created from.
- * but for most purposes, it's a really good estimation.
- * Paperg - Added the forceTagsClosed to the dom constructor. Forcing tags closed is great for malformed html, but it CAN lead to parsing errors.
- * Allow the user to tell us how much they trust the html.
- * Paperg add the text and plaintext to the selectors for the find syntax. plaintext implies text in the innertext of a node. text implies that the tag is a text node.
- * This allows for us to find tags based on the text they contain.
- * Create find_ancestor_tag to see if a tag is - at any level - inside of another specific tag.
- * Paperg: added parse_charset so that we know about the character set of the source document.
- * NOTE: If the user's system has a routine called get_last_retrieve_url_contents_content_type availalbe, we will assume it's returning the content-type header from the
- * last transfer or curl_exec, and we will parse that and use it in preference to any other method of charset detection.
- *
- * Found infinite loop in the case of broken html in restore_noise. Rewrote to protect from that.
- * PaperG (John Schlick) Added get_display_size for "IMG" tags.
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @author S.C. Chen
- * @author John Schlick
- * @author Rus Carroll
- * @version 1.5 ($Rev: 196 $)
- * @package PlaceLocalInclude
- * @subpackage simple_html_dom
- */
-
-/**
- * All of the Defines for the classes below.
- * @author S.C. Chen
- */
-define('HDOM_TYPE_ELEMENT', 1);
-define('HDOM_TYPE_COMMENT', 2);
-define('HDOM_TYPE_TEXT', 3);
-define('HDOM_TYPE_ENDTAG', 4);
-define('HDOM_TYPE_ROOT', 5);
-define('HDOM_TYPE_UNKNOWN', 6);
-define('HDOM_QUOTE_DOUBLE', 0);
-define('HDOM_QUOTE_SINGLE', 1);
-define('HDOM_QUOTE_NO', 3);
-define('HDOM_INFO_BEGIN', 0);
-define('HDOM_INFO_END', 1);
-define('HDOM_INFO_QUOTE', 2);
-define('HDOM_INFO_SPACE', 3);
-define('HDOM_INFO_TEXT', 4);
-define('HDOM_INFO_INNER', 5);
-define('HDOM_INFO_OUTER', 6);
-define('HDOM_INFO_ENDSPACE',7);
-define('DEFAULT_TARGET_CHARSET', 'UTF-8');
-define('DEFAULT_BR_TEXT', "\r\n");
-define('DEFAULT_SPAN_TEXT', " ");
-define('MAX_FILE_SIZE', 600000);
-// helper functions
-// -----------------------------------------------------------------------------
-// get html dom from file
-// $maxlen is defined in the code as PHP_STREAM_COPY_ALL which is defined as -1.
-function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
-{
- // We DO force the tags to be terminated.
- $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
- // For sourceforge users: uncomment the next line and comment the retreive_url_contents line 2 lines down if it is not already done.
- $contents = file_get_contents($url, $use_include_path, $context, $offset);
- // Paperg - use our own mechanism for getting the contents as we want to control the timeout.
- //$contents = retrieve_url_contents($url);
- if (empty($contents) || strlen($contents) > MAX_FILE_SIZE)
- {
- return false;
- }
- // The second parameter can force the selectors to all be lowercase.
- $dom->load($contents, $lowercase, $stripRN);
- return $dom;
-}
-
-// get html dom from string
-function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
-{
- $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
- if (empty($str) || strlen($str) > MAX_FILE_SIZE)
- {
- $dom->clear();
- return false;
- }
- $dom->load($str, $lowercase, $stripRN);
- return $dom;
-}
-
-// dump html dom tree
-function dump_html_tree($node, $show_attr=true, $deep=0)
-{
- $node->dump($node);
-}
-
-
-/**
- * simple html dom node
- * PaperG - added ability for "find" routine to lowercase the value of the selector.
- * PaperG - added $tag_start to track the start position of the tag in the total byte index
- *
- * @package PlaceLocalInclude
- */
-class simple_html_dom_node
-{
- public $nodetype = HDOM_TYPE_TEXT;
- public $tag = 'text';
- public $attr = array();
- public $children = array();
- public $nodes = array();
- public $parent = null;
- // The "info" array - see HDOM_INFO_... for what each element contains.
- public $_ = array();
- public $tag_start = 0;
- private $dom = null;
-
- function __construct($dom)
- {
- $this->dom = $dom;
- $dom->nodes[] = $this;
- }
-
- function __destruct()
- {
- $this->clear();
- }
-
- function __toString()
- {
- return $this->outertext();
- }
-
- // clean up memory due to php5 circular references memory leak...
- function clear()
- {
- $this->dom = null;
- $this->nodes = null;
- $this->parent = null;
- $this->children = null;
- }
-
- // dump node's tree
- function dump($show_attr=true, $deep=0)
- {
- $lead = str_repeat(' ', $deep);
-
- echo $lead.$this->tag;
- if ($show_attr && count($this->attr)>0)
- {
- echo '(';
- foreach ($this->attr as $k=>$v)
- echo "[$k]=>\"".$this->$k.'", ';
- echo ')';
- }
- echo "\n";
-
- if ($this->nodes)
- {
- foreach ($this->nodes as $c)
- {
- $c->dump($show_attr, $deep+1);
- }
- }
- }
-
-
- // Debugging function to dump a single dom node with a bunch of information about it.
- function dump_node($echo=true)
- {
-
- $string = $this->tag;
- if (count($this->attr)>0)
- {
- $string .= '(';
- foreach ($this->attr as $k=>$v)
- {
- $string .= "[$k]=>\"".$this->$k.'", ';
- }
- $string .= ')';
- }
- if (count($this->_)>0)
- {
- $string .= ' $_ (';
- foreach ($this->_ as $k=>$v)
- {
- if (is_array($v))
- {
- $string .= "[$k]=>(";
- foreach ($v as $k2=>$v2)
- {
- $string .= "[$k2]=>\"".$v2.'", ';
- }
- $string .= ")";
- } else {
- $string .= "[$k]=>\"".$v.'", ';
- }
- }
- $string .= ")";
- }
-
- if (isset($this->text))
- {
- $string .= " text: (" . $this->text . ")";
- }
-
- $string .= " HDOM_INNER_INFO: '";
- if (isset($node->_[HDOM_INFO_INNER]))
- {
- $string .= $node->_[HDOM_INFO_INNER] . "'";
- }
- else
- {
- $string .= ' NULL ';
- }
-
- $string .= " children: " . count($this->children);
- $string .= " nodes: " . count($this->nodes);
- $string .= " tag_start: " . $this->tag_start;
- $string .= "\n";
-
- if ($echo)
- {
- echo $string;
- return;
- }
- else
- {
- return $string;
- }
- }
-
- // returns the parent of node
- // If a node is passed in, it will reset the parent of the current node to that one.
- function parent($parent=null)
- {
- // I am SURE that this doesn't work properly.
- // It fails to unset the current node from it's current parents nodes or children list first.
- if ($parent !== null)
- {
- $this->parent = $parent;
- $this->parent->nodes[] = $this;
- $this->parent->children[] = $this;
- }
-
- return $this->parent;
- }
-
- // verify that node has children
- function has_child()
- {
- return !empty($this->children);
- }
-
- // returns children of node
- function children($idx=-1)
- {
- if ($idx===-1)
- {
- return $this->children;
- }
- if (isset($this->children[$idx])) return $this->children[$idx];
- return null;
- }
-
- // returns the first child of node
- function first_child()
- {
- if (count($this->children)>0)
- {
- return $this->children[0];
- }
- return null;
- }
-
- // returns the last child of node
- function last_child()
- {
- if (($count=count($this->children))>0)
- {
- return $this->children[$count-1];
- }
- return null;
- }
-
- // returns the next sibling of node
- function next_sibling()
- {
- if ($this->parent===null)
- {
- return null;
- }
-
- $idx = 0;
- $count = count($this->parent->children);
- while ($idx<$count && $this!==$this->parent->children[$idx])
- {
- ++$idx;
- }
- if (++$idx>=$count)
- {
- return null;
- }
- return $this->parent->children[$idx];
- }
-
- // returns the previous sibling of node
- function prev_sibling()
- {
- if ($this->parent===null) return null;
- $idx = 0;
- $count = count($this->parent->children);
- while ($idx<$count && $this!==$this->parent->children[$idx])
- ++$idx;
- if (--$idx<0) return null;
- return $this->parent->children[$idx];
- }
-
- // function to locate a specific ancestor tag in the path to the root.
- function find_ancestor_tag($tag)
- {
- global $debugObject;
- if (is_object($debugObject)) { $debugObject->debugLogEntry(1); }
-
- // Start by including ourselves in the comparison.
- $returnDom = $this;
-
- while (!is_null($returnDom))
- {
- if (is_object($debugObject)) { $debugObject->debugLog(2, "Current tag is: " . $returnDom->tag); }
-
- if ($returnDom->tag == $tag)
- {
- break;
- }
- $returnDom = $returnDom->parent;
- }
- return $returnDom;
- }
-
- // get dom node's inner html
- function innertext()
- {
- if (isset($this->_[HDOM_INFO_INNER])) return $this->_[HDOM_INFO_INNER];
- if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
-
- $ret = '';
- foreach ($this->nodes as $n)
- $ret .= $n->outertext();
- return $ret;
- }
-
- // get dom node's outer text (with tag)
- function outertext()
- {
- global $debugObject;
- if (is_object($debugObject))
- {
- $text = '';
- if ($this->tag == 'text')
- {
- if (!empty($this->text))
- {
- $text = " with text: " . $this->text;
- }
- }
- $debugObject->debugLog(1, 'Innertext of tag: ' . $this->tag . $text);
- }
-
- if ($this->tag==='root') return $this->innertext();
-
- // trigger callback
- if ($this->dom && $this->dom->callback!==null)
- {
- call_user_func_array($this->dom->callback, array($this));
- }
-
- if (isset($this->_[HDOM_INFO_OUTER])) return $this->_[HDOM_INFO_OUTER];
- if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
-
- // render begin tag
- if ($this->dom && $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]])
- {
- $ret = $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]->makeup();
- } else {
- $ret = "";
- }
-
- // render inner text
- if (isset($this->_[HDOM_INFO_INNER]))
- {
- // If it's a br tag... don't return the HDOM_INNER_INFO that we may or may not have added.
- if ($this->tag != "br")
- {
- $ret .= $this->_[HDOM_INFO_INNER];
- }
- } else {
- if ($this->nodes)
- {
- foreach ($this->nodes as $n)
- {
- $ret .= $this->convert_text($n->outertext());
- }
- }
- }
-
- // render end tag
- if (isset($this->_[HDOM_INFO_END]) && $this->_[HDOM_INFO_END]!=0)
- $ret .= ''.$this->tag.'>';
- return $ret;
- }
-
- // get dom node's plain text
- function text()
- {
- if (isset($this->_[HDOM_INFO_INNER])) return $this->_[HDOM_INFO_INNER];
- switch ($this->nodetype)
- {
- case HDOM_TYPE_TEXT: return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
- case HDOM_TYPE_COMMENT: return '';
- case HDOM_TYPE_UNKNOWN: return '';
- }
- if (strcasecmp($this->tag, 'script')===0) return '';
- if (strcasecmp($this->tag, 'style')===0) return '';
-
- $ret = '';
- // In rare cases, (always node type 1 or HDOM_TYPE_ELEMENT - observed for some span tags, and some p tags) $this->nodes is set to NULL.
- // NOTE: This indicates that there is a problem where it's set to NULL without a clear happening.
- // WHY is this happening?
- if (!is_null($this->nodes))
- {
- foreach ($this->nodes as $n)
- {
- $ret .= $this->convert_text($n->text());
- }
-
- // If this node is a span... add a space at the end of it so multiple spans don't run into each other. This is plaintext after all.
- if ($this->tag == "span")
- {
- $ret .= $this->dom->default_span_text;
- }
-
-
- }
- return $ret;
- }
-
- function xmltext()
- {
- $ret = $this->innertext();
- $ret = str_ireplace('', '', $ret);
- return $ret;
- }
-
- // build node's text with tag
- function makeup()
- {
- // text, comment, unknown
- if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
-
- $ret = '<'.$this->tag;
- $i = -1;
-
- foreach ($this->attr as $key=>$val)
- {
- ++$i;
-
- // skip removed attribute
- if ($val===null || $val===false)
- continue;
-
- $ret .= $this->_[HDOM_INFO_SPACE][$i][0];
- //no value attr: nowrap, checked selected...
- if ($val===true)
- $ret .= $key;
- else {
- switch ($this->_[HDOM_INFO_QUOTE][$i])
- {
- case HDOM_QUOTE_DOUBLE: $quote = '"'; break;
- case HDOM_QUOTE_SINGLE: $quote = '\''; break;
- default: $quote = '';
- }
- $ret .= $key.$this->_[HDOM_INFO_SPACE][$i][1].'='.$this->_[HDOM_INFO_SPACE][$i][2].$quote.$val.$quote;
- }
- }
- $ret = $this->dom->restore_noise($ret);
- return $ret . $this->_[HDOM_INFO_ENDSPACE] . '>';
- }
-
- // find elements by css selector
- //PaperG - added ability for find to lowercase the value of the selector.
- function find($selector, $idx=null, $lowercase=false)
- {
- $selectors = $this->parse_selector($selector);
- if (($count=count($selectors))===0) return array();
- $found_keys = array();
-
- // find each selector
- for ($c=0; $c<$count; ++$c)
- {
- // The change on the below line was documented on the sourceforge code tracker id 2788009
- // used to be: if (($levle=count($selectors[0]))===0) return array();
- if (($levle=count($selectors[$c]))===0) return array();
- if (!isset($this->_[HDOM_INFO_BEGIN])) return array();
-
- $head = array($this->_[HDOM_INFO_BEGIN]=>1);
-
- // handle descendant selectors, no recursive!
- for ($l=0; $l<$levle; ++$l)
- {
- $ret = array();
- foreach ($head as $k=>$v)
- {
- $n = ($k===-1) ? $this->dom->root : $this->dom->nodes[$k];
- //PaperG - Pass this optional parameter on to the seek function.
- $n->seek($selectors[$c][$l], $ret, $lowercase);
- }
- $head = $ret;
- }
-
- foreach ($head as $k=>$v)
- {
- if (!isset($found_keys[$k]))
- $found_keys[$k] = 1;
- }
- }
-
- // sort keys
- ksort($found_keys);
-
- $found = array();
- foreach ($found_keys as $k=>$v)
- $found[] = $this->dom->nodes[$k];
-
- // return nth-element or array
- if (is_null($idx)) return $found;
- else if ($idx<0) $idx = count($found) + $idx;
- return (isset($found[$idx])) ? $found[$idx] : null;
- }
-
- // seek for given conditions
- // PaperG - added parameter to allow for case insensitive testing of the value of a selector.
- protected function seek($selector, &$ret, $lowercase=false)
- {
- global $debugObject;
- if (is_object($debugObject)) { $debugObject->debugLogEntry(1); }
-
- list($tag, $key, $val, $exp, $no_key) = $selector;
-
- // xpath index
- if ($tag && $key && is_numeric($key))
- {
- $count = 0;
- foreach ($this->children as $c)
- {
- if ($tag==='*' || $tag===$c->tag) {
- if (++$count==$key) {
- $ret[$c->_[HDOM_INFO_BEGIN]] = 1;
- return;
- }
- }
- }
- return;
- }
-
- $end = (!empty($this->_[HDOM_INFO_END])) ? $this->_[HDOM_INFO_END] : 0;
- if ($end==0) {
- $parent = $this->parent;
- while (!isset($parent->_[HDOM_INFO_END]) && $parent!==null) {
- $end -= 1;
- $parent = $parent->parent;
- }
- $end += $parent->_[HDOM_INFO_END];
- }
-
- for ($i=$this->_[HDOM_INFO_BEGIN]+1; $i<$end; ++$i) {
- $node = $this->dom->nodes[$i];
-
- $pass = true;
-
- if ($tag==='*' && !$key) {
- if (in_array($node, $this->children, true))
- $ret[$i] = 1;
- continue;
- }
-
- // compare tag
- if ($tag && $tag!=$node->tag && $tag!=='*') {$pass=false;}
- // compare key
- if ($pass && $key) {
- if ($no_key) {
- if (isset($node->attr[$key])) $pass=false;
- } else {
- if (($key != "plaintext") && !isset($node->attr[$key])) $pass=false;
- }
- }
- // compare value
- if ($pass && $key && $val && $val!=='*') {
- // If they have told us that this is a "plaintext" search then we want the plaintext of the node - right?
- if ($key == "plaintext") {
- // $node->plaintext actually returns $node->text();
- $nodeKeyValue = $node->text();
- } else {
- // this is a normal search, we want the value of that attribute of the tag.
- $nodeKeyValue = $node->attr[$key];
- }
- if (is_object($debugObject)) {$debugObject->debugLog(2, "testing node: " . $node->tag . " for attribute: " . $key . $exp . $val . " where nodes value is: " . $nodeKeyValue);}
-
- //PaperG - If lowercase is set, do a case insensitive test of the value of the selector.
- if ($lowercase) {
- $check = $this->match($exp, strtolower($val), strtolower($nodeKeyValue));
- } else {
- $check = $this->match($exp, $val, $nodeKeyValue);
- }
- if (is_object($debugObject)) {$debugObject->debugLog(2, "after match: " . ($check ? "true" : "false"));}
-
- // handle multiple class
- if (!$check && strcasecmp($key, 'class')===0) {
- foreach (explode(' ',$node->attr[$key]) as $k) {
- // Without this, there were cases where leading, trailing, or double spaces lead to our comparing blanks - bad form.
- if (!empty($k)) {
- if ($lowercase) {
- $check = $this->match($exp, strtolower($val), strtolower($k));
- } else {
- $check = $this->match($exp, $val, $k);
- }
- if ($check) break;
- }
- }
- }
- if (!$check) $pass = false;
- }
- if ($pass) $ret[$i] = 1;
- unset($node);
- }
- // It's passed by reference so this is actually what this function returns.
- if (is_object($debugObject)) {$debugObject->debugLog(1, "EXIT - ret: ", $ret);}
- }
-
- protected function match($exp, $pattern, $value) {
- global $debugObject;
- if (is_object($debugObject)) {$debugObject->debugLogEntry(1);}
-
- switch ($exp) {
- case '=':
- return ($value===$pattern);
- case '!=':
- return ($value!==$pattern);
- case '^=':
- return preg_match("/^".preg_quote($pattern,'/')."/", $value);
- case '$=':
- return preg_match("/".preg_quote($pattern,'/')."$/", $value);
- case '*=':
- if ($pattern[0]=='/') {
- return preg_match($pattern, $value);
- }
- return preg_match("/".$pattern."/i", $value);
- }
- return false;
- }
-
- protected function parse_selector($selector_string) {
- global $debugObject;
- if (is_object($debugObject)) {$debugObject->debugLogEntry(1);}
-
- // pattern of CSS selectors, modified from mootools
- // Paperg: Add the colon to the attrbute, so that it properly finds like google does.
- // Note: if you try to look at this attribute, yo MUST use getAttribute since $dom->x:y will fail the php syntax check.
-// Notice the \[ starting the attbute? and the @? following? This implies that an attribute can begin with an @ sign that is not captured.
-// This implies that an html attribute specifier may start with an @ sign that is NOT captured by the expression.
-// farther study is required to determine of this should be documented or removed.
-// $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
- $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
- preg_match_all($pattern, trim($selector_string).' ', $matches, PREG_SET_ORDER);
- if (is_object($debugObject)) {$debugObject->debugLog(2, "Matches Array: ", $matches);}
-
- $selectors = array();
- $result = array();
- //print_r($matches);
-
- foreach ($matches as $m) {
- $m[0] = trim($m[0]);
- if ($m[0]==='' || $m[0]==='/' || $m[0]==='//') continue;
- // for browser generated xpath
- if ($m[1]==='tbody') continue;
-
- list($tag, $key, $val, $exp, $no_key) = array($m[1], null, null, '=', false);
- if (!empty($m[2])) {$key='id'; $val=$m[2];}
- if (!empty($m[3])) {$key='class'; $val=$m[3];}
- if (!empty($m[4])) {$key=$m[4];}
- if (!empty($m[5])) {$exp=$m[5];}
- if (!empty($m[6])) {$val=$m[6];}
-
- // convert to lowercase
- if ($this->dom->lowercase) {$tag=strtolower($tag); $key=strtolower($key);}
- //elements that do NOT have the specified attribute
- if (isset($key[0]) && $key[0]==='!') {$key=substr($key, 1); $no_key=true;}
-
- $result[] = array($tag, $key, $val, $exp, $no_key);
- if (trim($m[7])===',') {
- $selectors[] = $result;
- $result = array();
- }
- }
- if (count($result)>0)
- $selectors[] = $result;
- return $selectors;
- }
-
- function __get($name) {
- if (isset($this->attr[$name]))
- {
- return $this->convert_text($this->attr[$name]);
- }
- switch ($name) {
- case 'outertext': return $this->outertext();
- case 'innertext': return $this->innertext();
- case 'plaintext': return $this->text();
- case 'xmltext': return $this->xmltext();
- default: return array_key_exists($name, $this->attr);
- }
- }
-
- function __set($name, $value) {
- switch ($name) {
- case 'outertext': return $this->_[HDOM_INFO_OUTER] = $value;
- case 'innertext':
- if (isset($this->_[HDOM_INFO_TEXT])) return $this->_[HDOM_INFO_TEXT] = $value;
- return $this->_[HDOM_INFO_INNER] = $value;
- }
- if (!isset($this->attr[$name])) {
- $this->_[HDOM_INFO_SPACE][] = array(' ', '', '');
- $this->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE;
- }
- $this->attr[$name] = $value;
- }
-
- function __isset($name) {
- switch ($name) {
- case 'outertext': return true;
- case 'innertext': return true;
- case 'plaintext': return true;
- }
- //no value attr: nowrap, checked selected...
- return (array_key_exists($name, $this->attr)) ? true : isset($this->attr[$name]);
- }
-
- function __unset($name) {
- if (isset($this->attr[$name]))
- unset($this->attr[$name]);
- }
-
- // PaperG - Function to convert the text from one character set to another if the two sets are not the same.
- function convert_text($text)
- {
- global $debugObject;
- if (is_object($debugObject)) {$debugObject->debugLogEntry(1);}
-
- $converted_text = $text;
-
- $sourceCharset = "";
- $targetCharset = "";
-
- if ($this->dom)
- {
- $sourceCharset = strtoupper($this->dom->_charset);
- $targetCharset = strtoupper($this->dom->_target_charset);
- }
- if (is_object($debugObject)) {$debugObject->debugLog(3, "source charset: " . $sourceCharset . " target charaset: " . $targetCharset);}
-
- if (!empty($sourceCharset) && !empty($targetCharset) && (strcasecmp($sourceCharset, $targetCharset) != 0))
- {
- // Check if the reported encoding could have been incorrect and the text is actually already UTF-8
- if ((strcasecmp($targetCharset, 'UTF-8') == 0) && ($this->is_utf8($text)))
- {
- $converted_text = $text;
- }
- else
- {
- $converted_text = iconv($sourceCharset, $targetCharset, $text);
- }
- }
-
- // Lets make sure that we don't have that silly BOM issue with any of the utf-8 text we output.
- if ($targetCharset == 'UTF-8')
- {
- if (substr($converted_text, 0, 3) == "\xef\xbb\xbf")
- {
- $converted_text = substr($converted_text, 3);
- }
- if (substr($converted_text, -3) == "\xef\xbb\xbf")
- {
- $converted_text = substr($converted_text, 0, -3);
- }
- }
-
- return $converted_text;
- }
-
- /**
- * Returns true if $string is valid UTF-8 and false otherwise.
- *
- * @param mixed $str String to be tested
- * @return boolean
- */
- static function is_utf8($str)
- {
- $c=0; $b=0;
- $bits=0;
- $len=strlen($str);
- for($i=0; $i<$len; $i++)
- {
- $c=ord($str[$i]);
- if($c > 128)
- {
- if(($c >= 254)) return false;
- elseif($c >= 252) $bits=6;
- elseif($c >= 248) $bits=5;
- elseif($c >= 240) $bits=4;
- elseif($c >= 224) $bits=3;
- elseif($c >= 192) $bits=2;
- else return false;
- if(($i+$bits) > $len) return false;
- while($bits > 1)
- {
- $i++;
- $b=ord($str[$i]);
- if($b < 128 || $b > 191) return false;
- $bits--;
- }
- }
- }
- return true;
- }
- /*
- function is_utf8($string)
- {
- //this is buggy
- return (utf8_encode(utf8_decode($string)) == $string);
- }
- */
-
- /**
- * Function to try a few tricks to determine the displayed size of an img on the page.
- * NOTE: This will ONLY work on an IMG tag. Returns FALSE on all other tag types.
- *
- * @author John Schlick
- * @version April 19 2012
- * @return array an array containing the 'height' and 'width' of the image on the page or -1 if we can't figure it out.
- */
- function get_display_size()
- {
- global $debugObject;
-
- $width = -1;
- $height = -1;
-
- if ($this->tag !== 'img')
- {
- return false;
- }
-
- // See if there is aheight or width attribute in the tag itself.
- if (isset($this->attr['width']))
- {
- $width = $this->attr['width'];
- }
-
- if (isset($this->attr['height']))
- {
- $height = $this->attr['height'];
- }
-
- // Now look for an inline style.
- if (isset($this->attr['style']))
- {
- // Thanks to user gnarf from stackoverflow for this regular expression.
- $attributes = array();
- preg_match_all("/([\w-]+)\s*:\s*([^;]+)\s*;?/", $this->attr['style'], $matches, PREG_SET_ORDER);
- foreach ($matches as $match) {
- $attributes[$match[1]] = $match[2];
- }
-
- // If there is a width in the style attributes:
- if (isset($attributes['width']) && $width == -1)
- {
- // check that the last two characters are px (pixels)
- if (strtolower(substr($attributes['width'], -2)) == 'px')
- {
- $proposed_width = substr($attributes['width'], 0, -2);
- // Now make sure that it's an integer and not something stupid.
- if (filter_var($proposed_width, FILTER_VALIDATE_INT))
- {
- $width = $proposed_width;
- }
- }
- }
-
- // If there is a width in the style attributes:
- if (isset($attributes['height']) && $height == -1)
- {
- // check that the last two characters are px (pixels)
- if (strtolower(substr($attributes['height'], -2)) == 'px')
- {
- $proposed_height = substr($attributes['height'], 0, -2);
- // Now make sure that it's an integer and not something stupid.
- if (filter_var($proposed_height, FILTER_VALIDATE_INT))
- {
- $height = $proposed_height;
- }
- }
- }
-
- }
-
- // Future enhancement:
- // Look in the tag to see if there is a class or id specified that has a height or width attribute to it.
-
- // Far future enhancement
- // Look at all the parent tags of this image to see if they specify a class or id that has an img selector that specifies a height or width
- // Note that in this case, the class or id will have the img subselector for it to apply to the image.
-
- // ridiculously far future development
- // If the class or id is specified in a SEPARATE css file thats not on the page, go get it and do what we were just doing for the ones on the page.
-
- $result = array('height' => $height,
- 'width' => $width);
- return $result;
- }
-
- // camel naming conventions
- function getAllAttributes() {return $this->attr;}
- function getAttribute($name) {return $this->__get($name);}
- function setAttribute($name, $value) {$this->__set($name, $value);}
- function hasAttribute($name) {return $this->__isset($name);}
- function removeAttribute($name) {$this->__set($name, null);}
- function getElementById($id) {return $this->find("#$id", 0);}
- function getElementsById($id, $idx=null) {return $this->find("#$id", $idx);}
- function getElementByTagName($name) {return $this->find($name, 0);}
- function getElementsByTagName($name, $idx=null) {return $this->find($name, $idx);}
- function parentNode() {return $this->parent();}
- function childNodes($idx=-1) {return $this->children($idx);}
- function firstChild() {return $this->first_child();}
- function lastChild() {return $this->last_child();}
- function nextSibling() {return $this->next_sibling();}
- function previousSibling() {return $this->prev_sibling();}
- function hasChildNodes() {return $this->has_child();}
- function nodeName() {return $this->tag;}
- function appendChild($node) {$node->parent($this); return $node;}
-
-}
-
-/**
- * simple html dom parser
- * Paperg - in the find routine: allow us to specify that we want case insensitive testing of the value of the selector.
- * Paperg - change $size from protected to public so we can easily access it
- * Paperg - added ForceTagsClosed in the constructor which tells us whether we trust the html or not. Default is to NOT trust it.
- *
- * @package PlaceLocalInclude
- */
-class simple_html_dom
-{
- public $root = null;
- public $nodes = array();
- public $callback = null;
- public $lowercase = false;
- // Used to keep track of how large the text was when we started.
- public $original_size;
- public $size;
- protected $pos;
- protected $doc;
- protected $char;
- protected $cursor;
- protected $parent;
- protected $noise = array();
- protected $token_blank = " \t\r\n";
- protected $token_equal = ' =/>';
- protected $token_slash = " />\r\n\t";
- protected $token_attr = ' >';
- // Note that this is referenced by a child node, and so it needs to be public for that node to see this information.
- public $_charset = '';
- public $_target_charset = '';
- protected $default_br_text = "";
- public $default_span_text = "";
-
- // use isset instead of in_array, performance boost about 30%...
- protected $self_closing_tags = array('img'=>1, 'br'=>1, 'input'=>1, 'meta'=>1, 'link'=>1, 'hr'=>1, 'base'=>1, 'embed'=>1, 'spacer'=>1);
- protected $block_tags = array('root'=>1, 'body'=>1, 'form'=>1, 'div'=>1, 'span'=>1, 'table'=>1);
- // Known sourceforge issue #2977341
- // B tags that are not closed cause us to return everything to the end of the document.
- protected $optional_closing_tags = array(
- 'tr'=>array('tr'=>1, 'td'=>1, 'th'=>1),
- 'th'=>array('th'=>1),
- 'td'=>array('td'=>1),
- 'li'=>array('li'=>1),
- 'dt'=>array('dt'=>1, 'dd'=>1),
- 'dd'=>array('dd'=>1, 'dt'=>1),
- 'dl'=>array('dd'=>1, 'dt'=>1),
- 'p'=>array('p'=>1),
- 'nobr'=>array('nobr'=>1),
- 'b'=>array('b'=>1),
- 'option'=>array('option'=>1),
- );
-
- function __construct($str=null, $lowercase=true, $forceTagsClosed=true, $target_charset=DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
- {
- if ($str)
- {
- if (preg_match("/^http:\/\//i",$str) || is_file($str))
- {
- $this->load_file($str);
- }
- else
- {
- $this->load($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText);
- }
- }
- // Forcing tags to be closed implies that we don't trust the html, but it can lead to parsing errors if we SHOULD trust the html.
- if (!$forceTagsClosed) {
- $this->optional_closing_array=array();
- }
- $this->_target_charset = $target_charset;
- }
-
- function __destruct()
- {
- $this->clear();
- }
-
- // load html from string
- function load($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
- {
- global $debugObject;
-
- // prepare
- $this->prepare($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText);
- // strip out comments
- $this->remove_noise("''is");
- // strip out cdata
- $this->remove_noise("''is", true);
- // Per sourceforge http://sourceforge.net/tracker/?func=detail&aid=2949097&group_id=218559&atid=1044037
- // Script tags removal now preceeds style tag removal.
- // strip out ';
-else{
-/* echo generar_miniatura_alto($name,"150");
- echo generar_miniatura_alto($name,"300");
- echo generar_miniatura_alto($name,"600");
- */
- echo generar_miniatura($name,"150");
- echo generar_miniatura($name,"300");
- echo generar_miniatura($name,"600");
- ///$name= "$name?$coordenadas"
-echo " ";
-}
-}
-else echo " ";
-
-}
-else{
-echo "";
-}
-
-function generar_miniatura($file,$width) {
//$archivo = $file;
-$archivo = "$_SESSION[path_images_secure]/full/".$file;
// Ponemos el . antes del nombre del archivo porque estamos considerando que la ruta está a partir del archivo thumb.php
$file_info = getimagesize($archivo);
// Obtenemos la relación de aspecto
$ratio = $file_info[0] / $file_info[1];
// Calculamos las nuevas dimensiones
$newwidth = $width;
$newheight = round($newwidth / $ratio);
// Sacamos la extensión del archivo
$ext = explode(".", $file);
$ext = strtolower($ext[count($ext) - 1]);
if ($ext == "jpeg") $ext = "jpg";
// Dependiendo de la extensión llamamos a distintas funciones
switch ($ext) {
case "jpg":
$img = imagecreatefromjpeg($archivo);
break;
case "png":
$img = imagecreatefrompng($archivo);
break;
case "gif":
$img = imagecreatefromgif($archivo);
break;
}
// Creamos la miniatura
$thumb = imagecreatetruecolor($newwidth, $newheight);
-imagealphablending( $thumb, false );
-imagesavealpha( $thumb, true );
// La redimensionamos
imagecopyresampled($thumb, $img, 0, 0, 0, 0, $newwidth, $newheight, $file_info[0], $file_info[1]);
// La mostramos como jpg
//header("Content-type: image/jpeg");
imagejpeg($thumb,"$_SESSION[path_images_secure]/".$width."/$file", 80);
-imagepng($thumb,"$_SESSION[path_images_secure]/".$width."/$file", 9);
-//imagegif($thumb,"$_SESSION[path_images_secure]/".$width."/$file");
-//imagejpeg($thumb,null, 80);
-}
-function generar_miniatura_alto($file,$alto) {
//$archivo = $file;
-$archivo = "$_SESSION[path_images_secure]/full/".$file;
// Ponemos el . antes del nombre del archivo porque estamos considerando que la ruta está a partir del archivo thumb.php
$file_info = getimagesize($archivo);
// Obtenemos la relación de aspecto
$ratio = $file_info[1]/$file_info[0];
// Calculamos las nuevas dimensiones
-$newheight = $alto;
$newwidth = round($newheight / $ratio);
// Sacamos la extensión del archivo
$ext = explode(".", $file);
$ext = strtolower($ext[count($ext) - 1]);
if ($ext == "jpeg") $ext = "jpg";
// Dependiendo de la extensión llamamos a distintas funciones
switch ($ext) {
case "jpg":
$img = imagecreatefromjpeg($archivo);
break;
case "png":
$img = imagecreatefrompng($archivo);
break;
case "gif":
$img = imagecreatefromgif($archivo);
break;
}
// Creamos la miniatura
$thumb = imagecreatetruecolor($newwidth, $newheight);
-imagealphablending( $thumb, false );
-imagesavealpha( $thumb, true );
// La redimensionamos
imagecopyresampled($thumb, $img, 0, 0, 0, 0, $newwidth, $newheight, $file_info[0], $file_info[1]);
// La mostramos como jpg
//header("Content-type: image/jpeg");
-imagepng($thumb,"$_SESSION[path_images_secure]/".$alto."/$file", 80);
-imagejpeg($thumb,"$_SESSION[path_images_secure]/".$alto."/$file", 80);
-//imagejpeg($thumb,null, 80);
-}
-
-// Convertir un string "1/123" a su representación float
-function exif_float($value) {
- $pos = strpos($value, '/');
- if ($pos === false) return (float) $value;
- $a = (float) substr($value, 0, $pos);
- $b = (float) substr($value, $pos+1);
- return ($b == 0) ? ($a) : ($a / $b);
-}
-
-function leer_exif($file){
- //$file = "/var/www/html/milfs/images/gps.jpg";
- $exif = exif_read_data( $file );
-if ( !empty($exif['GPSLongitude']) && !empty($exif['GPSLatitude']) ) {
- $d = (float) $exif['GPSLongitude'][0];
- $m = exif_float($exif['GPSLongitude'][1] );
- $s = exif_float( $exif['GPSLongitude'][2] );
-
- $gps_longitude = (float) $d + $m/60 + $s/3600;
- if ( $exif['GPSLongitudeRef'] == 'W')
- $gps_longitude = -$gps_longitude;
-
- $d = $exif['GPSLatitude'][0];
- $m = exif_float($exif['GPSLatitude'][1] );
- $s = exif_float( $exif['GPSLatitude'][2] );
-
- $gps_latitude = (float) $d + $m/60 + $s/3600;
- if ( $exif['GPSLatitudeRef'] == 'S')
- $gps_latitude = -$gps_latitude;
- if($gps_latitude !='') {
- $resultado = "../mapa.php?lon=$gps_latitude&lat=$gps_longitude&zoom=18&exif=exif";
- }else{$resultado ="";}
-//$resultado = "$gps_longitude $gps_latitude";
-
- return $resultado;
-}
-}
-
-?>
-
diff --git a/milfs/includes/upload_archivo.php b/milfs/includes/upload_archivo.php
deleted file mode 100644
index 7fe3d58..0000000
--- a/milfs/includes/upload_archivo.php
+++ /dev/null
@@ -1,38 +0,0 @@
-parent.resultadoUploadArchivo(1,"'.$nombre.'","aviso_archivo"); ';
-else{
-echo ' ';
-}
-}
-else echo ' ';
-}
-else{
-echo ' ';
-}
-?>
-
diff --git a/milfs/includes/upload_generico.php b/milfs/includes/upload_generico.php
deleted file mode 100644
index 2fbf843..0000000
--- a/milfs/includes/upload_generico.php
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
diff --git a/milfs/index.php b/milfs/index.php
deleted file mode 100644
index 4cf5819..0000000
--- a/milfs/index.php
+++ /dev/null
@@ -1,308 +0,0 @@
-
-processRequests();
-
-$embebido =0;
-if (isset($_REQUEST['form'])) {
- $form = $_REQUEST['form'];
- $opciones["formato"]= $_REQUEST['formato'];
- } else {$form = "";}
- if($form !='') {$embebido = 1;}
-if (isset($_REQUEST['identificador'])) {$identificador = $_REQUEST['identificador'];} else {$identificador = "";}
- if($identificador !='') {$embebido = 1;}
-if (isset($_REQUEST['id'])) {$id = $_REQUEST['id'];} else {$id = "";}
-if (isset($_REQUEST['campo'])) {$campo = $_REQUEST['campo'];} else {$campo = "";}
-if (isset($_REQUEST['consulta'])) {$consulta = $_REQUEST['consulta'];} else {$consulta = "";}
-if (isset($_REQUEST['t'])) {$t = $_REQUEST['t'];} else {$t = "";}
-?>
-
-
-
-
-
-
-
-
-
- printJavascript("xajax/");
- // $xajax->debugOn();
- //$xajax->statusMessagesOn();
- ?>
-
-
-
- ";}else{ echo "";} ?>
-
-
-
-
-
-
-
-
-
- I<3MILFS
-
- xajax_formulario_listado('','contenido','$id')";}
- elseif($campo !=''){$onload ="";}
- elseif($consulta !=''){$onload ="";}
- else{}
-
- if( isset($_REQUEST['psi'])){$onload ="";}
-?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- © MILFS Un proyecto de http://QWERTY.co Se distribuye bajo licencia GPL V3
- Políticas de privacidad y protección de datos.
-
-
-
-
-
-
diff --git a/milfs/js/bootstrap-markdown.js b/milfs/js/bootstrap-markdown.js
deleted file mode 100644
index d9a7b76..0000000
--- a/milfs/js/bootstrap-markdown.js
+++ /dev/null
@@ -1,1369 +0,0 @@
-/* ===================================================
- * bootstrap-markdown.js v2.7.0
- * http://github.com/toopay/bootstrap-markdown
- * ===================================================
- * Copyright 2013-2014 Taufan Aditya
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================== */
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* MARKDOWN CLASS DEFINITION
- * ========================== */
-
- var Markdown = function (element, options) {
- // Class Properties
- this.$ns = 'bootstrap-markdown'
- this.$element = $(element)
- this.$editable = {el:null, type:null,attrKeys:[], attrValues:[], content:null}
- this.$options = $.extend(true, {}, $.fn.markdown.defaults, options, this.$element.data(), this.$element.data('options'))
- this.$oldContent = null
- this.$isPreview = false
- this.$isFullscreen = false
- this.$editor = null
- this.$textarea = null
- this.$handler = []
- this.$callback = []
- this.$nextTab = []
-
- this.showEditor()
- }
-
- Markdown.prototype = {
-
- constructor: Markdown
-
- , __alterButtons: function(name,alter) {
- var handler = this.$handler, isAll = (name == 'all'),that = this
-
- $.each(handler,function(k,v) {
- var halt = true
- if (isAll) {
- halt = false
- } else {
- halt = v.indexOf(name) < 0
- }
-
- if (halt == false) {
- alter(that.$editor.find('button[data-handler="'+v+'"]'))
- }
- })
- }
-
- , __buildButtons: function(buttonsArray, container) {
- var i,
- ns = this.$ns,
- handler = this.$handler,
- callback = this.$callback
-
- for (i=0;i', {
- 'class': 'btn-group'
- })
-
- for (z=0;z');
- buttonContainer.text(' ' + this.__localize(btnText)).addClass('btn-default btn-sm').addClass(btnClass);
- if(btnClass.match(/btn\-(primary|success|info|warning|danger|link)/)){
- buttonContainer.removeClass('btn-default');
- }
- buttonContainer.attr({
- 'type': 'button',
- 'title': this.__localize(button.title) + hotkeyCaption,
- 'tabindex': tabIndex,
- 'data-provider': ns,
- 'data-handler': buttonHandler,
- 'data-hotkey': hotkey
- });
- if (button.toggle == true){
- buttonContainer.attr('data-toggle', 'button');
- }
- buttonIconContainer = $('');
- buttonIconContainer.addClass(buttonIcon);
- buttonIconContainer.prependTo(buttonContainer);
-
- // Attach the button object
- btnGroupContainer.append(buttonContainer);
-
- // Register handler and callback
- handler.push(buttonHandler);
- callback.push(button.callback);
- }
-
- // Attach the button group into container dom
- container.append(btnGroupContainer);
- }
- }
-
- return container;
- }
- , __setListener: function() {
- // Set size and resizable Properties
- var hasRows = typeof this.$textarea.attr('rows') != 'undefined',
- maxRows = this.$textarea.val().split("\n").length > 5 ? this.$textarea.val().split("\n").length : '5',
- rowsVal = hasRows ? this.$textarea.attr('rows') : maxRows
-
- this.$textarea.attr('rows',rowsVal)
- if (this.$options.resize) {
- this.$textarea.css('resize',this.$options.resize)
- }
-
- this.$textarea
- .on('focus', $.proxy(this.focus, this))
- .on('keypress', $.proxy(this.keypress, this))
- .on('keyup', $.proxy(this.keyup, this))
- .on('change', $.proxy(this.change, this))
-
- if (this.eventSupported('keydown')) {
- this.$textarea.on('keydown', $.proxy(this.keydown, this))
- }
-
- // Re-attach markdown data
- this.$textarea.data('markdown',this)
- }
-
- , __handle: function(e) {
- var target = $(e.currentTarget),
- handler = this.$handler,
- callback = this.$callback,
- handlerName = target.attr('data-handler'),
- callbackIndex = handler.indexOf(handlerName),
- callbackHandler = callback[callbackIndex]
-
- // Trigger the focusin
- $(e.currentTarget).focus()
-
- callbackHandler(this)
-
- // Trigger onChange for each button handle
- this.change(this);
-
- // Unless it was the save handler,
- // focusin the textarea
- if (handlerName.indexOf('cmdSave') < 0) {
- this.$textarea.focus()
- }
-
- e.preventDefault()
- }
-
- , __localize: function(string) {
- var messages = $.fn.markdown.messages,
- language = this.$options.language
- if (
- typeof messages !== 'undefined' &&
- typeof messages[language] !== 'undefined' &&
- typeof messages[language][string] !== 'undefined'
- ) {
- return messages[language][string];
- }
- return string;
- }
-
- , __getIcon: function(src) {
- return typeof src == 'object' ? src[this.$options.iconlibrary] : src;
- }
-
- , setFullscreen: function(mode) {
- var $editor = this.$editor,
- $textarea = this.$textarea
-
- if (mode === true) {
- $editor.addClass('md-fullscreen-mode')
- $('body').addClass('md-nooverflow')
- this.$options.onFullscreen(this)
- } else {
- $editor.removeClass('md-fullscreen-mode')
- $('body').removeClass('md-nooverflow')
- }
-
- this.$isFullscreen = mode;
- $textarea.focus()
- }
-
- , showEditor: function() {
- var instance = this,
- textarea,
- ns = this.$ns,
- container = this.$element,
- originalHeigth = container.css('height'),
- originalWidth = container.css('width'),
- editable = this.$editable,
- handler = this.$handler,
- callback = this.$callback,
- options = this.$options,
- editor = $( '', {
- 'class': 'md-editor',
- click: function() {
- instance.focus()
- }
- })
-
- // Prepare the editor
- if (this.$editor == null) {
- // Create the panel
- var editorHeader = $('', {
- 'class': 'md-header btn-toolbar'
- })
-
- // Merge the main & additional button groups together
- var allBtnGroups = []
- if (options.buttons.length > 0) allBtnGroups = allBtnGroups.concat(options.buttons[0])
- if (options.additionalButtons.length > 0) allBtnGroups = allBtnGroups.concat(options.additionalButtons[0])
-
- // Reduce and/or reorder the button groups
- if (options.reorderButtonGroups.length > 0) {
- allBtnGroups = allBtnGroups
- .filter(function(btnGroup) {
- return options.reorderButtonGroups.indexOf(btnGroup.name) > -1
- })
- .sort(function(a, b) {
- if (options.reorderButtonGroups.indexOf(a.name) < options.reorderButtonGroups.indexOf(b.name)) return -1
- if (options.reorderButtonGroups.indexOf(a.name) > options.reorderButtonGroups.indexOf(b.name)) return 1
- return 0
- })
- }
-
- // Build the buttons
- if (allBtnGroups.length > 0) {
- editorHeader = this.__buildButtons([allBtnGroups], editorHeader)
- }
-
- if (options.fullscreen.enable) {
- editorHeader.append('').on('click', '.md-control-fullscreen', function(e) {
- e.preventDefault();
- instance.setFullscreen(true)
- })
- }
-
- editor.append(editorHeader)
-
- // Wrap the textarea
- if (container.is('textarea')) {
- container.before(editor)
- textarea = container
- textarea.addClass('md-input')
- editor.append(textarea)
- } else {
- var rawContent = (typeof toMarkdown == 'function') ? toMarkdown(container.html()) : container.html(),
- currentContent = $.trim(rawContent)
-
- // This is some arbitrary content that could be edited
- textarea = $('', {
- 'class': 'md-input',
- 'val' : currentContent
- })
-
- editor.append(textarea)
-
- // Save the editable
- editable.el = container
- editable.type = container.prop('tagName').toLowerCase()
- editable.content = container.html()
-
- $(container[0].attributes).each(function(){
- editable.attrKeys.push(this.nodeName)
- editable.attrValues.push(this.nodeValue)
- })
-
- // Set editor to blocked the original container
- container.replaceWith(editor)
- }
-
- var editorFooter = $('', {
- 'class': 'md-footer'
- }),
- createFooter = false,
- footer = ''
- // Create the footer if savable
- if (options.savable) {
- createFooter = true;
- var saveHandler = 'cmdSave'
-
- // Register handler and callback
- handler.push(saveHandler)
- callback.push(options.onSave)
-
- editorFooter.append('')
-
-
- }
-
- footer = typeof options.footer === 'function' ? options.footer(this) : options.footer
-
- if ($.trim(footer) !== '') {
- createFooter = true;
- editorFooter.append(footer);
- }
-
- if (createFooter) editor.append(editorFooter)
-
- // Set width
- if (options.width && options.width !== 'inherit') {
- if (jQuery.isNumeric(options.width)) {
- editor.css('display', 'table')
- textarea.css('width', options.width + 'px')
- } else {
- editor.addClass(options.width)
- }
- }
-
- // Set height
- if (options.height && options.height !== 'inherit') {
- if (jQuery.isNumeric(options.height)) {
- var height = options.height
- if (editorHeader) height = Math.max(0, height - editorHeader.outerHeight())
- if (editorFooter) height = Math.max(0, height - editorFooter.outerHeight())
- textarea.css('height', height + 'px')
- } else {
- editor.addClass(options.height)
- }
- }
-
- // Reference
- this.$editor = editor
- this.$textarea = textarea
- this.$editable = editable
- this.$oldContent = this.getContent()
-
- this.__setListener()
-
- // Set editor attributes, data short-hand API and listener
- this.$editor.attr('id',(new Date).getTime())
- this.$editor.on('click', '[data-provider="bootstrap-markdown"]', $.proxy(this.__handle, this))
-
- if (this.$element.is(':disabled') || this.$element.is('[readonly]')) {
- this.$editor.addClass('md-editor-disabled');
- this.disableButtons('all');
- }
-
- if (this.eventSupported('keydown') && typeof jQuery.hotkeys === 'object') {
- editorHeader.find('[data-provider="bootstrap-markdown"]').each(function() {
- var $button = $(this),
- hotkey = $button.attr('data-hotkey')
- if (hotkey.toLowerCase() !== '') {
- textarea.bind('keydown', hotkey, function() {
- $button.trigger('click')
- return false;
- })
- }
- })
- }
-
- if (options.initialstate === 'preview') {
- this.showPreview();
- } else if (options.initialstate === 'fullscreen' && options.fullscreen.enable) {
- this.setFullscreen(true)
- }
-
- } else {
- this.$editor.show()
- }
-
- if (options.autofocus) {
- this.$textarea.focus()
- this.$editor.addClass('active')
- }
-
- if (options.fullscreen.enable && options.fullscreen !== false) {
- this.$editor.append('\
- ')
-
- this.$editor.on('click', '.exit-fullscreen', function(e) {
- e.preventDefault()
- instance.setFullscreen(false)
- })
- }
-
- // hide hidden buttons from options
- this.hideButtons(options.hiddenButtons)
-
- // disable disabled buttons from options
- this.disableButtons(options.disabledButtons)
-
- // Trigger the onShow hook
- options.onShow(this)
-
- return this
- }
-
- , parseContent: function() {
- var content,
- callbackContent = this.$options.onPreview(this) // Try to get the content from callback
-
- if (typeof callbackContent == 'string') {
- // Set the content based by callback content
- content = callbackContent
- } else {
- // Set the content
- var val = this.$textarea.val();
- if(typeof markdown == 'object') {
- content = markdown.toHTML(val);
- }else if(typeof marked == 'function') {
- content = marked(val);
- } else {
- content = val;
- }
- }
-
- return content;
- }
-
- , showPreview: function() {
- var options = this.$options,
- container = this.$textarea,
- afterContainer = container.next(),
- replacementContainer = $('',{'class':'md-preview','data-provider':'markdown-preview'}),
- content
-
- // Give flag that tell the editor enter preview mode
- this.$isPreview = true
- // Disable all buttons
- this.disableButtons('all').enableButtons('cmdPreview')
-
- content = this.parseContent()
-
- // Build preview element
- replacementContainer.html(content)
-
- if (afterContainer && afterContainer.attr('class') == 'md-footer') {
- // If there is footer element, insert the preview container before it
- replacementContainer.insertBefore(afterContainer)
- } else {
- // Otherwise, just append it after textarea
- container.parent().append(replacementContainer)
- }
-
- // Set the preview element dimensions
- replacementContainer.css({
- width: container.outerWidth() + 'px',
- height: container.outerHeight() + 'px'
- })
-
- if (this.$options.resize) {
- replacementContainer.css('resize',this.$options.resize)
- }
-
- // Hide the last-active textarea
- container.hide()
-
- // Attach the editor instances
- replacementContainer.data('markdown',this)
-
- if (this.$element.is(':disabled') || this.$element.is('[readonly]')) {
- this.$editor.addClass('md-editor-disabled');
- this.disableButtons('all');
- }
-
- return this
- }
-
- , hidePreview: function() {
- // Give flag that tell the editor quit preview mode
- this.$isPreview = false
-
- // Obtain the preview container
- var container = this.$editor.find('div[data-provider="markdown-preview"]')
-
- // Remove the preview container
- container.remove()
-
- // Enable all buttons
- this.enableButtons('all')
- // Disable configured disabled buttons
- this.disableButtons(this.$options.disabledButtons)
-
- // Back to the editor
- this.$textarea.show()
- this.__setListener()
-
- return this
- }
-
- , isDirty: function() {
- return this.$oldContent != this.getContent()
- }
-
- , getContent: function() {
- return this.$textarea.val()
- }
-
- , setContent: function(content) {
- this.$textarea.val(content)
-
- return this
- }
-
- , findSelection: function(chunk) {
- var content = this.getContent(), startChunkPosition
-
- if (startChunkPosition = content.indexOf(chunk), startChunkPosition >= 0 && chunk.length > 0) {
- var oldSelection = this.getSelection(), selection
-
- this.setSelection(startChunkPosition,startChunkPosition+chunk.length)
- selection = this.getSelection()
-
- this.setSelection(oldSelection.start,oldSelection.end)
-
- return selection
- } else {
- return null
- }
- }
-
- , getSelection: function() {
-
- var e = this.$textarea[0]
-
- return (
-
- ('selectionStart' in e && function() {
- var l = e.selectionEnd - e.selectionStart
- return { start: e.selectionStart, end: e.selectionEnd, length: l, text: e.value.substr(e.selectionStart, l) }
- }) ||
-
- /* browser not supported */
- function() {
- return null
- }
-
- )()
-
- }
-
- , setSelection: function(start,end) {
-
- var e = this.$textarea[0]
-
- return (
-
- ('selectionStart' in e && function() {
- e.selectionStart = start
- e.selectionEnd = end
- return
- }) ||
-
- /* browser not supported */
- function() {
- return null
- }
-
- )()
-
- }
-
- , replaceSelection: function(text) {
-
- var e = this.$textarea[0]
-
- return (
-
- ('selectionStart' in e && function() {
- e.value = e.value.substr(0, e.selectionStart) + text + e.value.substr(e.selectionEnd, e.value.length)
- // Set cursor to the last replacement end
- e.selectionStart = e.value.length
- return this
- }) ||
-
- /* browser not supported */
- function() {
- e.value += text
- return jQuery(e)
- }
-
- )()
-
- }
-
- , getNextTab: function() {
- // Shift the nextTab
- if (this.$nextTab.length == 0) {
- return null
- } else {
- var nextTab, tab = this.$nextTab.shift()
-
- if (typeof tab == 'function') {
- nextTab = tab()
- } else if (typeof tab == 'object' && tab.length > 0) {
- nextTab = tab
- }
-
- return nextTab
- }
- }
-
- , setNextTab: function(start,end) {
- // Push new selection into nextTab collections
- if (typeof start == 'string') {
- var that = this
- this.$nextTab.push(function(){
- return that.findSelection(start)
- })
- } else if (typeof start == 'number' && typeof end == 'number') {
- var oldSelection = this.getSelection()
-
- this.setSelection(start,end)
- this.$nextTab.push(this.getSelection())
-
- this.setSelection(oldSelection.start,oldSelection.end)
- }
-
- return
- }
-
- , __parseButtonNameParam: function(nameParam) {
- var buttons = []
-
- if (typeof nameParam == 'string') {
- buttons.push(nameParam)
- } else {
- buttons = nameParam
- }
-
- return buttons
- }
-
- , enableButtons: function(name) {
- var buttons = this.__parseButtonNameParam(name),
- that = this
-
- $.each(buttons, function(i, v) {
- that.__alterButtons(buttons[i], function (el) {
- el.removeAttr('disabled')
- });
- })
-
- return this;
- }
-
- , disableButtons: function(name) {
- var buttons = this.__parseButtonNameParam(name),
- that = this
-
- $.each(buttons, function(i, v) {
- that.__alterButtons(buttons[i], function (el) {
- el.attr('disabled','disabled')
- });
- })
-
- return this;
- }
-
- , hideButtons: function(name) {
- var buttons = this.__parseButtonNameParam(name),
- that = this
-
- $.each(buttons, function(i, v) {
- that.__alterButtons(buttons[i], function (el) {
- el.addClass('hidden');
- });
- })
-
- return this;
-
- }
-
- , showButtons: function(name) {
- var buttons = this.__parseButtonNameParam(name),
- that = this
-
- $.each(buttons, function(i, v) {
- that.__alterButtons(buttons[i], function (el) {
- el.removeClass('hidden');
- });
- })
-
- return this;
-
- }
-
- , eventSupported: function(eventName) {
- var isSupported = eventName in this.$element
- if (!isSupported) {
- this.$element.setAttribute(eventName, 'return;')
- isSupported = typeof this.$element[eventName] === 'function'
- }
- return isSupported
- }
-
- , keyup: function (e) {
- var blocked = false
- switch(e.keyCode) {
- case 40: // down arrow
- case 38: // up arrow
- case 16: // shift
- case 17: // ctrl
- case 18: // alt
- break
-
- case 9: // tab
- var nextTab
- if (nextTab = this.getNextTab(),nextTab != null) {
- // Get the nextTab if exists
- var that = this
- setTimeout(function(){
- that.setSelection(nextTab.start,nextTab.end)
- },500)
-
- blocked = true
- } else {
- // The next tab memory contains nothing...
- // check the cursor position to determine tab action
- var cursor = this.getSelection()
-
- if (cursor.start == cursor.end && cursor.end == this.getContent().length) {
- // The cursor already reach the end of the content
- blocked = false
-
- } else {
- // Put the cursor to the end
- this.setSelection(this.getContent().length,this.getContent().length)
-
- blocked = true
- }
- }
-
- break
-
- case 13: // enter
- blocked = false
- break
- case 27: // escape
- if (this.$isFullscreen) this.setFullscreen(false)
- blocked = false
- break
-
- default:
- blocked = false
- }
-
- if (blocked) {
- e.stopPropagation()
- e.preventDefault()
- }
-
- this.$options.onChange(this)
- }
-
- , change: function(e) {
- this.$options.onChange(this);
- return this;
- }
-
- , focus: function (e) {
- var options = this.$options,
- isHideable = options.hideable,
- editor = this.$editor
-
- editor.addClass('active')
-
- // Blur other markdown(s)
- $(document).find('.md-editor').each(function(){
- if ($(this).attr('id') != editor.attr('id')) {
- var attachedMarkdown
-
- if (attachedMarkdown = $(this).find('textarea').data('markdown'),
- attachedMarkdown == null) {
- attachedMarkdown = $(this).find('div[data-provider="markdown-preview"]').data('markdown')
- }
-
- if (attachedMarkdown) {
- attachedMarkdown.blur()
- }
- }
- })
-
- // Trigger the onFocus hook
- options.onFocus(this);
-
- return this
- }
-
- , blur: function (e) {
- var options = this.$options,
- isHideable = options.hideable,
- editor = this.$editor,
- editable = this.$editable
-
- if (editor.hasClass('active') || this.$element.parent().length == 0) {
- editor.removeClass('active')
-
- if (isHideable) {
-
- // Check for editable elements
- if (editable.el != null) {
- // Build the original element
- var oldElement = $('<'+editable.type+'/>'),
- content = this.getContent(),
- currentContent = (typeof markdown == 'object') ? markdown.toHTML(content) : content
-
- $(editable.attrKeys).each(function(k,v) {
- oldElement.attr(editable.attrKeys[k],editable.attrValues[k])
- })
-
- // Get the editor content
- oldElement.html(currentContent)
-
- editor.replaceWith(oldElement)
- } else {
- editor.hide()
-
- }
- }
-
- // Trigger the onBlur hook
- options.onBlur(this)
- }
-
- return this
- }
-
- }
-
- /* MARKDOWN PLUGIN DEFINITION
- * ========================== */
-
- var old = $.fn.markdown
-
- $.fn.markdown = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('markdown')
- , options = typeof option == 'object' && option
- if (!data) $this.data('markdown', (data = new Markdown(this, options)))
- })
- }
-
- $.fn.markdown.messages = {}
-
- $.fn.markdown.defaults = {
- /* Editor Properties */
- autofocus: false,
- hideable: false,
- savable:false,
- width: 'inherit',
- height: 'inherit',
- resize: 'none',
- iconlibrary: 'glyph',
- language: 'en',
- initialstate: 'editor',
-
- /* Buttons Properties */
- buttons: [
- [{
- name: 'groupFont',
- data: [{
- name: 'cmdBold',
- hotkey: 'Ctrl+B',
- title: 'Bold',
- icon: { glyph: 'glyphicon glyphicon-bold', fa: 'fa fa-bold', 'fa-3': 'icon-bold' },
- callback: function(e){
- // Give/remove ** surround the selection
- var chunk, cursor, selected = e.getSelection(), content = e.getContent()
-
- if (selected.length == 0) {
- // Give extra word
- chunk = e.__localize('strong text')
- } else {
- chunk = selected.text
- }
-
- // transform selection and set the cursor into chunked text
- if (content.substr(selected.start-2,2) == '**'
- && content.substr(selected.end,2) == '**' ) {
- e.setSelection(selected.start-2,selected.end+2)
- e.replaceSelection(chunk)
- cursor = selected.start-2
- } else {
- e.replaceSelection('**'+chunk+'**')
- cursor = selected.start+2
- }
-
- // Set the cursor
- e.setSelection(cursor,cursor+chunk.length)
- }
- },{
- name: 'cmdItalic',
- title: 'Italic',
- hotkey: 'Ctrl+I',
- icon: { glyph: 'glyphicon glyphicon-italic', fa: 'fa fa-italic', 'fa-3': 'icon-italic' },
- callback: function(e){
- // Give/remove * surround the selection
- var chunk, cursor, selected = e.getSelection(), content = e.getContent()
-
- if (selected.length == 0) {
- // Give extra word
- chunk = e.__localize('emphasized text')
- } else {
- chunk = selected.text
- }
-
- // transform selection and set the cursor into chunked text
- if (content.substr(selected.start-1,1) == '_'
- && content.substr(selected.end,1) == '_' ) {
- e.setSelection(selected.start-1,selected.end+1)
- e.replaceSelection(chunk)
- cursor = selected.start-1
- } else {
- e.replaceSelection('_'+chunk+'_')
- cursor = selected.start+1
- }
-
- // Set the cursor
- e.setSelection(cursor,cursor+chunk.length)
- }
- },{
- name: 'cmdHeading',
- title: 'Heading',
- hotkey: 'Ctrl+H',
- icon: { glyph: 'glyphicon glyphicon-header', fa: 'fa fa-font', 'fa-3': 'icon-font' },
- callback: function(e){
- // Append/remove ### surround the selection
- var chunk, cursor, selected = e.getSelection(), content = e.getContent(), pointer, prevChar
-
- if (selected.length == 0) {
- // Give extra word
- chunk = e.__localize('heading text')
- } else {
- chunk = selected.text + '\n';
- }
-
- // transform selection and set the cursor into chunked text
- if ((pointer = 4, content.substr(selected.start-pointer,pointer) == '### ')
- || (pointer = 3, content.substr(selected.start-pointer,pointer) == '###')) {
- e.setSelection(selected.start-pointer,selected.end)
- e.replaceSelection(chunk)
- cursor = selected.start-pointer
- } else if (selected.start > 0 && (prevChar = content.substr(selected.start-1,1), !!prevChar && prevChar != '\n')) {
- e.replaceSelection('\n\n### '+chunk)
- cursor = selected.start+6
- } else {
- // Empty string before element
- e.replaceSelection('### '+chunk)
- cursor = selected.start+4
- }
-
- // Set the cursor
- e.setSelection(cursor,cursor+chunk.length)
- }
- }]
- },{
- name: 'groupLink',
- data: [{
- name: 'cmdUrl',
- title: 'URL/Link',
- hotkey: 'Ctrl+L',
- icon: { glyph: 'glyphicon glyphicon-link', fa: 'fa fa-link', 'fa-3': 'icon-link' },
- callback: function(e){
- // Give [] surround the selection and prepend the link
- var chunk, cursor, selected = e.getSelection(), content = e.getContent(), link
-
- if (selected.length == 0) {
- // Give extra word
- chunk = e.__localize('enter link description here')
- } else {
- chunk = selected.text
- }
-
- link = prompt(e.__localize('Insert Hyperlink'),'http://')
-
- if (link != null && link != '' && link != 'http://' && link.substr(0,4) == 'http') {
- var sanitizedLink = $(''+link+'').text()
-
- // transform selection and set the cursor into chunked text
- e.replaceSelection('['+chunk+']('+sanitizedLink+')')
- cursor = selected.start+1
-
- // Set the cursor
- e.setSelection(cursor,cursor+chunk.length)
- }
- }
- },{
- name: 'cmdImage',
- title: 'Image',
- hotkey: 'Ctrl+G',
- icon: { glyph: 'glyphicon glyphicon-picture', fa: 'fa fa-picture-o', 'fa-3': 'icon-picture' },
- callback: function(e){
- // Give ![] surround the selection and prepend the image link
- var chunk, cursor, selected = e.getSelection(), content = e.getContent(), link
-
- if (selected.length == 0) {
- // Give extra word
- chunk = e.__localize('enter image description here')
- } else {
- chunk = selected.text
- }
-
- link = prompt(e.__localize('Insert Image Hyperlink'),'http://')
-
- if (link != null && link != '' && link != 'http://' && link.substr(0,4) == 'http') {
- var sanitizedLink = $(''+link+'').text()
-
- // transform selection and set the cursor into chunked text
- e.replaceSelection('!['+chunk+']('+sanitizedLink+' "'+e.__localize('enter image title here')+'")')
- cursor = selected.start+2
-
- // Set the next tab
- e.setNextTab(e.__localize('enter image title here'))
-
- // Set the cursor
- e.setSelection(cursor,cursor+chunk.length)
- }
- }
- }]
- },{
- name: 'groupMisc',
- data: [{
- name: 'cmdList',
- hotkey: 'Ctrl+U',
- title: 'Unordered List',
- icon: { glyph: 'glyphicon glyphicon-list', fa: 'fa fa-list', 'fa-3': 'icon-list-ul' },
- callback: function(e){
- // Prepend/Give - surround the selection
- var chunk, cursor, selected = e.getSelection(), content = e.getContent()
-
- // transform selection and set the cursor into chunked text
- if (selected.length == 0) {
- // Give extra word
- chunk = e.__localize('list text here')
-
- e.replaceSelection('- '+chunk)
- // Set the cursor
- cursor = selected.start+2
-
- } else {
- if (selected.text.indexOf('\n') < 0) {
- chunk = selected.text
-
- e.replaceSelection('- '+chunk)
-
- // Set the cursor
- cursor = selected.start+2
- } else {
- var list = []
-
- list = selected.text.split('\n')
- chunk = list[0]
-
- $.each(list,function(k,v) {
- list[k] = '- '+v
- })
-
- e.replaceSelection('\n\n'+list.join('\n'))
-
- // Set the cursor
- cursor = selected.start+4
- }
- }
-
- // Set the cursor
- e.setSelection(cursor,cursor+chunk.length)
- }
- },
- {
- name: 'cmdListO',
- hotkey: 'Ctrl+O',
- title: 'Ordered List',
- icon: { glyph: 'glyphicon glyphicon-th-list', fa: 'fa fa-list-ol', 'fa-3': 'icon-list-ol' },
- callback: function(e) {
-
- // Prepend/Give - surround the selection
- var chunk, cursor, selected = e.getSelection(), content = e.getContent()
-
- // transform selection and set the cursor into chunked text
- if (selected.length == 0) {
- // Give extra word
- chunk = e.__localize('list text here')
- e.replaceSelection('1. '+chunk)
- // Set the cursor
- cursor = selected.start+3
-
- } else {
- if (selected.text.indexOf('\n') < 0) {
- chunk = selected.text
-
- e.replaceSelection('1. '+chunk)
-
- // Set the cursor
- cursor = selected.start+3
- } else {
- var list = []
-
- list = selected.text.split('\n')
- chunk = list[0]
-
- $.each(list,function(k,v) {
- list[k] = '1. '+v
- })
-
- e.replaceSelection('\n\n'+list.join('\n'))
-
- // Set the cursor
- cursor = selected.start+5
- }
- }
-
- // Set the cursor
- e.setSelection(cursor,cursor+chunk.length)
- }
- },
- {
- name: 'cmdCode',
- hotkey: 'Ctrl+K',
- title: 'Code',
- icon: { glyph: 'glyphicon glyphicon-asterisk', fa: 'fa fa-code', 'fa-3': 'icon-code' },
- callback: function(e) {
-
- // Give/remove ** surround the selection
- var chunk, cursor, selected = e.getSelection(), content = e.getContent()
-
- if (selected.length == 0) {
- // Give extra word
- chunk = e.__localize('code text here')
- } else {
- chunk = selected.text
- }
-
- // transform selection and set the cursor into chunked text
- if (content.substr(selected.start-1,1) == '`'
- && content.substr(selected.end,1) == '`' ) {
- e.setSelection(selected.start-1,selected.end+1)
- e.replaceSelection(chunk)
- cursor = selected.start-1
- } else {
- e.replaceSelection('`'+chunk+'`')
- cursor = selected.start+1
- }
-
- // Set the cursor
- e.setSelection(cursor,cursor+chunk.length)
- }
- },
- {
- name: 'cmdQuote',
- hotkey: 'Ctrl+Q',
- title: 'Quote',
- icon: { glyph: 'glyphicon glyphicon-comment', fa: 'fa fa-quote-left', 'fa-3': 'icon-quote-left' },
- callback: function(e) {
- // Prepend/Give - surround the selection
- var chunk, cursor, selected = e.getSelection(), content = e.getContent()
-
- // transform selection and set the cursor into chunked text
- if (selected.length == 0) {
- // Give extra word
- chunk = e.__localize('quote here')
- e.replaceSelection('> '+chunk)
- // Set the cursor
- cursor = selected.start+2
-
- } else {
- if (selected.text.indexOf('\n') < 0) {
- chunk = selected.text
-
- e.replaceSelection('> '+chunk)
-
- // Set the cursor
- cursor = selected.start+2
- } else {
- var list = []
-
- list = selected.text.split('\n')
- chunk = list[0]
-
- $.each(list,function(k,v) {
- list[k] = '> '+v
- })
-
- e.replaceSelection('\n\n'+list.join('\n'))
-
- // Set the cursor
- cursor = selected.start+4
- }
- }
-
- // Set the cursor
- e.setSelection(cursor,cursor+chunk.length)
- }
- }]
- },{
- name: 'groupUtil',
- data: [{
- name: 'cmdPreview',
- toggle: true,
- hotkey: 'Ctrl+P',
- title: 'Preview',
- btnText: 'Preview',
- btnClass: 'btn btn-primary btn-sm',
- icon: { glyph: 'glyphicon glyphicon-search', fa: 'fa fa-search', 'fa-3': 'icon-search' },
- callback: function(e){
- // Check the preview mode and toggle based on this flag
- var isPreview = e.$isPreview,content
-
- if (isPreview == false) {
- // Give flag that tell the editor enter preview mode
- e.showPreview()
- } else {
- e.hidePreview()
- }
- }
- }]
- }]
- ],
- additionalButtons:[], // Place to hook more buttons by code
- reorderButtonGroups:[],
- hiddenButtons:[], // Default hidden buttons
- disabledButtons:[], // Default disabled buttons
- footer: '',
- fullscreen: {
- enable: true,
- icons: {
- fullscreenOn: {
- fa: 'fa fa-expand',
- glyph: 'glyphicon glyphicon-fullscreen',
- 'fa-3': 'icon-resize-full'
- },
- fullscreenOff: {
- fa: 'fa fa-compress',
- glyph: 'glyphicon glyphicon-fullscreen',
- 'fa-3': 'icon-resize-small'
- }
- }
- },
-
- /* Events hook */
- onShow: function (e) {},
- onPreview: function (e) {},
- onSave: function (e) {},
- onBlur: function (e) {},
- onFocus: function (e) {},
- onChange: function(e) {},
- onFullscreen: function(e) {}
- }
-
- $.fn.markdown.Constructor = Markdown
-
-
- /* MARKDOWN NO CONFLICT
- * ==================== */
-
- $.fn.markdown.noConflict = function () {
- $.fn.markdown = old
- return this
- }
-
- /* MARKDOWN GLOBAL FUNCTION & DATA-API
- * ==================================== */
- var initMarkdown = function(el) {
- var $this = el
-
- if ($this.data('markdown')) {
- $this.data('markdown').showEditor()
- return
- }
-
- $this.markdown()
- }
-
- var analyzeMarkdown = function(e) {
- var blurred = false,
- el,
- $docEditor = $(e.currentTarget)
-
- // Check whether it was editor childs or not
- if ((e.type == 'focusin' || e.type == 'click') && $docEditor.length == 1 && typeof $docEditor[0] == 'object'){
- el = $docEditor[0].activeElement
- if ( ! $(el).data('markdown')) {
- if (typeof $(el).parent().parent().parent().attr('class') == "undefined"
- || $(el).parent().parent().parent().attr('class').indexOf('md-editor') < 0) {
- if ( typeof $(el).parent().parent().attr('class') == "undefined"
- || $(el).parent().parent().attr('class').indexOf('md-editor') < 0) {
-
- blurred = true
- }
- } else {
- blurred = false
- }
- }
-
-
- if (blurred) {
- // Blur event
- $(document).find('.md-editor').each(function(){
- var parentMd = $(el).parent()
-
- if ($(this).attr('id') != parentMd.attr('id')) {
- var attachedMarkdown
-
- if (attachedMarkdown = $(this).find('textarea').data('markdown'),
- attachedMarkdown == null) {
- attachedMarkdown = $(this).find('div[data-provider="markdown-preview"]').data('markdown')
- }
-
- if (attachedMarkdown) {
- attachedMarkdown.blur()
- }
- }
- })
- }
-
- e.stopPropagation()
- }
- }
-
- $(document)
- .on('click.markdown.data-api', '[data-provide="markdown-editable"]', function (e) {
- initMarkdown($(this))
- e.preventDefault()
- })
- .on('click', function (e) {
- analyzeMarkdown(e)
- })
- .on('focusin', function (e) {
- analyzeMarkdown(e)
- })
- .ready(function(){
- $('textarea[data-provide="markdown"]').each(function(){
- initMarkdown($(this))
- })
- })
-
-}(window.jQuery);
diff --git a/milfs/js/bootstrap.js b/milfs/js/bootstrap.js
deleted file mode 100644
index 319a85d..0000000
--- a/milfs/js/bootstrap.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
-* Bootstrap.js by @fat & @mdo
-* plugins: bootstrap-transition.js, bootstrap-modal.js, bootstrap-dropdown.js, bootstrap-scrollspy.js, bootstrap-tab.js, bootstrap-tooltip.js, bootstrap-popover.js, bootstrap-affix.js, bootstrap-alert.js, bootstrap-button.js, bootstrap-collapse.js, bootstrap-carousel.js, bootstrap-typeahead.js
-* Copyright 2012 Twitter, Inc.
-* http://www.apache.org/licenses/LICENSE-2.0.txt
-*/
-!function(a){a(function(){a.support.transition=function(){var a=function(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},c;for(c in b)if(a.style[c]!==undefined)return b[c]}();return a&&{end:a}}()})}(window.jQuery),!function(a){var b=function(b,c){this.options=c,this.$element=a(b).delegate('[data-dismiss="modal"]',"click.dismiss.modal",a.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};b.prototype={constructor:b,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var b=this,c=a.Event("show");this.$element.trigger(c);if(this.isShown||c.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var c=a.support.transition&&b.$element.hasClass("fade");b.$element.parent().length||b.$element.appendTo(document.body),b.$element.show(),c&&b.$element[0].offsetWidth,b.$element.addClass("in").attr("aria-hidden",!1),b.enforceFocus(),c?b.$element.one(a.support.transition.end,function(){b.$element.focus().trigger("shown")}):b.$element.focus().trigger("shown")})},hide:function(b){b&&b.preventDefault();var c=this;b=a.Event("hide"),this.$element.trigger(b);if(!this.isShown||b.isDefaultPrevented())return;this.isShown=!1,this.escape(),a(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),a.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var b=this;a(document).on("focusin.modal",function(a){b.$element[0]!==a.target&&!b.$element.has(a.target).length&&b.$element.focus()})},escape:function(){var a=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(b){b.which==27&&a.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),b.hideModal()},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),b.hideModal()})},hideModal:function(){var a=this;this.$element.hide(),this.backdrop(function(){a.removeBackdrop(),a.$element.trigger("hidden")})},removeBackdrop:function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},backdrop:function(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?a.proxy(this.$element[0].focus,this.$element[0]):a.proxy(this.hide,this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!b)return;e?this.$backdrop.one(a.support.transition.end,b):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b):b()):b&&b()}};var c=a.fn.modal;a.fn.modal=function(c){return this.each(function(){var d=a(this),e=d.data("modal"),f=a.extend({},a.fn.modal.defaults,d.data(),typeof c=="object"&&c);e||d.data("modal",e=new b(this,f)),typeof c=="string"?e[c]():f.show&&e.show()})},a.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());b.preventDefault(),e.modal(f).one("hide",function(){c.focus()})})}(window.jQuery),!function(a){function d(){a(".dropdown-backdrop").remove(),a(b).each(function(){e(a(this)).removeClass("open")})}function e(b){var c=b.attr("data-target"),d;c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,"")),d=c&&a(c);if(!d||!d.length)d=b.parent();return d}var b="[data-toggle=dropdown]",c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),f,g;if(c.is(".disabled, :disabled"))return;return f=e(c),g=f.hasClass("open"),d(),g||("ontouchstart"in document.documentElement&&a('').insertBefore(a(this)).on("click",d),f.toggleClass("open")),c.focus(),!1},keydown:function(c){var d,f,g,h,i,j;if(!/(38|40|27)/.test(c.keyCode))return;d=a(this),c.preventDefault(),c.stopPropagation();if(d.is(".disabled, :disabled"))return;h=e(d),i=h.hasClass("open");if(!i||i&&c.keyCode==27)return c.which==27&&h.find(b).focus(),d.click();f=a("[role=menu] li:not(.divider):visible a",h);if(!f.length)return;j=f.index(f.filter(":focus")),c.keyCode==38&&j>0&&j--,c.keyCode==40&&j a",this.$body=a("body"),this.refresh(),this.process()}b.prototype={constructor:b,refresh:function(){var b=this,c;this.offsets=a([]),this.targets=a([]),c=this.$body.find(this.selector).map(function(){var c=a(this),d=c.data("target")||c.attr("href"),e=/^#\w/.test(d)&&a(d);return e&&e.length&&[[e.position().top+(!a.isWindow(b.$scrollElement.get(0))&&b.$scrollElement.scrollTop()),d]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},process:function(){var a=this.$scrollElement.scrollTop()+this.options.offset,b=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,c=b-this.$scrollElement.height(),d=this.offsets,e=this.targets,f=this.activeTarget,g;if(a>=c)return f!=(g=e.last()[0])&&this.activate(g);for(g=d.length;g--;)f!=e[g]&&a>=d[g]&&(!d[g+1]||a<=d[g+1])&&this.activate(e[g])},activate:function(b){var c,d;this.activeTarget=b,a(this.selector).parent(".active").removeClass("active"),d=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',c=a(d).parent("li").addClass("active"),c.parent(".dropdown-menu").length&&(c=c.closest("li.dropdown").addClass("active")),c.trigger("activate")}};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("scrollspy"),f=typeof c=="object"&&c;e||d.data("scrollspy",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.defaults={offset:10},a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),!function(a){var b=function(b){this.element=a(b)};b.prototype={constructor:b,show:function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target"),e,f,g;d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,""));if(b.parent("li").hasClass("active"))return;e=c.find(".active:last a")[0],g=a.Event("show",{relatedTarget:e}),b.trigger(g);if(g.isDefaultPrevented())return;f=a(d),this.activate(b.parent("li"),c),this.activate(f,f.parent(),function(){b.trigger({type:"shown",relatedTarget:e})})},activate:function(b,c,d){function g(){e.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),f?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var e=c.find("> .active"),f=d&&a.support.transition&&e.hasClass("fade");f?e.one(a.support.transition.end,g):g(),e.removeClass("in")}};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("tab");e||d.data("tab",e=new b(this)),typeof c=="string"&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery),!function(a){var b=function(a,b){this.init("tooltip",a,b)};b.prototype={constructor:b,init:function(b,c,d){var e,f,g,h,i;this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.enabled=!0,g=this.options.trigger.split(" ");for(i=g.length;i--;)h=g[i],h=="click"?this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this)):h!="manual"&&(e=h=="hover"?"mouseenter":"focus",f=h=="hover"?"mouseleave":"blur",this.$element.on(e+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(f+"."+this.type,this.options.selector,a.proxy(this.leave,this)));this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(b){return b=a.extend({},a.fn[this.type].defaults,this.$element.data(),b),b.delay&&typeof b.delay=="number"&&(b.delay={show:b.delay,hide:b.delay}),b},enter:function(b){var c=a.fn[this.type].defaults,d={},e;this._options&&a.each(this._options,function(a,b){c[a]!=b&&(d[a]=b)},this),e=a(b.currentTarget)[this.type](d).data(this.type);if(!e.options.delay||!e.options.delay.show)return e.show();clearTimeout(this.timeout),e.hoverState="in",this.timeout=setTimeout(function(){e.hoverState=="in"&&e.show()},e.options.delay.show)},leave:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!c.options.delay||!c.options.delay.hide)return c.hide();c.hoverState="out",this.timeout=setTimeout(function(){c.hoverState=="out"&&c.hide()},c.options.delay.hide)},show:function(){var b,c,d,e,f,g,h=a.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(h);if(h.isDefaultPrevented())return;b=this.tip(),this.setContent(),this.options.animation&&b.addClass("fade"),f=typeof this.options.placement=="function"?this.options.placement.call(this,b[0],this.$element[0]):this.options.placement,b.detach().css({top:0,left:0,display:"block"}),this.options.container?b.appendTo(this.options.container):b.insertAfter(this.$element),c=this.getPosition(),d=b[0].offsetWidth,e=b[0].offsetHeight;switch(f){case"bottom":g={top:c.top+c.height,left:c.left+c.width/2-d/2};break;case"top":g={top:c.top-e,left:c.left+c.width/2-d/2};break;case"left":g={top:c.top+c.height/2-e/2,left:c.left-d};break;case"right":g={top:c.top+c.height/2-e/2,left:c.left+c.width}}this.applyPlacement(g,f),this.$element.trigger("shown")}},applyPlacement:function(a,b){var c=this.tip(),d=c[0].offsetWidth,e=c[0].offsetHeight,f,g,h,i;c.offset(a).addClass(b).addClass("in"),f=c[0].offsetWidth,g=c[0].offsetHeight,b=="top"&&g!=e&&(a.top=a.top+e-g,i=!0),b=="bottom"||b=="top"?(h=0,a.left<0&&(h=a.left*-2,a.left=0,c.offset(a),f=c[0].offsetWidth,g=c[0].offsetHeight),this.replaceArrow(h-d+f,f,"left")):this.replaceArrow(g-e,g,"top"),i&&c.offset(a)},replaceArrow:function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},setContent:function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},hide:function(){function e(){var b=setTimeout(function(){c.off(a.support.transition.end).detach()},500);c.one(a.support.transition.end,function(){clearTimeout(b),c.detach()})}var b=this,c=this.tip(),d=a.Event("hide");this.$element.trigger(d);if(d.isDefaultPrevented())return;return c.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?e():c.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var a=this.$element;(a.attr("title")||typeof a.attr("data-original-title")!="string")&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var b=this.$element[0];return a.extend({},typeof b.getBoundingClientRect=="function"?b.getBoundingClientRect():{width:b.offsetWidth,height:b.offsetHeight},this.$element.offset())},getTitle:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||(typeof c.title=="function"?c.title.call(b[0]):c.title),a},tip:function(){return this.$tip=this.$tip||a(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(b){var c=b?a(b.currentTarget)[this.type](this._options).data(this.type):this;c.tip().hasClass("in")?c.hide():c.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var c=a.fn.tooltip;a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("tooltip"),f=typeof c=="object"&&c;e||d.data("tooltip",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},a.fn.tooltip.noConflict=function(){return a.fn.tooltip=c,this}}(window.jQuery),!function(a){var b=function(a,b){this.init("popover",a,b)};b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype,{constructor:b,setContent:function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var a,b=this.$element,c=this.options;return a=(typeof c.content=="function"?c.content.call(b[0]):c.content)||b.attr("data-content"),a},tip:function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("popover"),f=typeof c=="object"&&c;e||d.data("popover",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.defaults=a.extend({},a.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:''}),a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),!function(a){var b=function(b,c){this.options=a.extend({},a.fn.affix.defaults,c),this.$window=a(window).on("scroll.affix.data-api",a.proxy(this.checkPosition,this)).on("click.affix.data-api",a.proxy(function(){setTimeout(a.proxy(this.checkPosition,this),1)},this)),this.$element=a(b),this.checkPosition()};b.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var b=a(document).height(),c=this.$window.scrollTop(),d=this.$element.offset(),e=this.options.offset,f=e.bottom,g=e.top,h="affix affix-top affix-bottom",i;typeof e!="object"&&(f=g=e),typeof g=="function"&&(g=e.top()),typeof f=="function"&&(f=e.bottom()),i=this.unpin!=null&&c+this.unpin<=d.top?!1:f!=null&&d.top+this.$element.height()>=b-f?"bottom":g!=null&&c<=g?"top":!1;if(this.affixed===i)return;this.affixed=i,this.unpin=i=="bottom"?d.top-c:null,this.$element.removeClass(h).addClass("affix"+(i?"-"+i:""))};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("affix"),f=typeof c=="object"&&c;e||d.data("affix",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.defaults={offset:0},a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(window.jQuery),!function(a){var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function f(){e.trigger("closed").remove()}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.trigger(b=a.Event("close"));if(b.isDefaultPrevented())return;e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.alert.data-api",b,c.prototype.close)}(window.jQuery),!function(a){var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("button"),f=typeof c=="object"&&c;e||d.data("button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle")})}(window.jQuery),!function(a){var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b,c,d,e;if(this.transitioning||this.$element.hasClass("in"))return;b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find("> .accordion-group > .in");if(d&&d.length){e=d.data("collapse");if(e&&e.transitioning)return;d.collapse("hide"),e||d.data("collapse",null)}this.$element[b](0),this.transition("addClass",a.Event("show"),"shown"),a.support.transition&&this.$element[b](this.$element[0][c])},hide:function(){var b;if(this.transitioning||!this.$element.hasClass("in"))return;b=this.dimension(),this.reset(this.$element[b]()),this.transition("removeClass",a.Event("hide"),"hidden"),this.$element[b](0)},reset:function(a){var b=this.dimension();return this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element[a!==null?"addClass":"removeClass"]("collapse"),this},transition:function(b,c,d){var e=this,f=function(){c.type=="show"&&e.reset(),e.transitioning=0,e.$element.trigger(d)};this.$element.trigger(c);if(c.isDefaultPrevented())return;this.transitioning=1,this.$element[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("collapse"),f=a.extend({},a.fn.collapse.defaults,d.data(),typeof c=="object"&&c);e||d.data("collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":c.data();c[a(e).hasClass("in")?"addClass":"removeClass"]("collapsed"),a(e).collapse(f)})}(window.jQuery),!function(a){var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.options.pause=="hover"&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.prototype={cycle:function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(b){var c=this.getActiveIndex(),d=this;if(b>this.$items.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){d.to(b)}):c==b?this.pause().cycle():this.slide(b>c?"next":"prev",a(this.$items[b]))},pause:function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this,j;this.sliding=!0,f&&this.pause(),e=e.length?e:this.$element.find(".item")[h](),j=a.Event("slide",{relatedTarget:e[0],direction:g});if(e.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")}));if(a.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(j);if(j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),this.$element.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)})}else{this.$element.trigger(j);if(j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("carousel"),f=a.extend({},a.fn.carousel.defaults,typeof c=="object"&&c),g=typeof c=="string"?c:f.slide;e||d.data("carousel",e=new b(this,f)),typeof c=="number"?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.defaults={interval:5e3,pause:"hover"},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),c.data()),g;e.carousel(f),(g=c.attr("data-slide-to"))&&e.data("carousel").pause().to(g).cycle(),b.preventDefault()})}(window.jQuery),!function(a){var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.typeahead.defaults,c),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=a(this.options.menu),this.shown=!1,this.listen()};b.prototype={constructor:b,select:function(){var a=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(a)).change(),this.hide()},updater:function(a){return a},show:function(){var b=a.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:b.top+b.height,left:b.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(b){var c;return this.query=this.$element.val(),!this.query||this.query.length"+b+""})},render:function(b){var c=this;return b=a(b).map(function(b,d){return b=a(c.options.item).attr("data-value",d),b.find("a").html(c.highlighter(d)),b[0]}),b.first().addClass("active"),this.$menu.html(b),this},next:function(b){var c=this.$menu.find(".active").removeClass("active"),d=c.next();d.length||(d=a(this.$menu.find("li")[0])),d.addClass("active")},prev:function(a){var b=this.$menu.find(".active").removeClass("active"),c=b.prev();c.length||(c=this.$menu.find("li").last()),c.addClass("active")},listen:function(){this.$element.on("focus",a.proxy(this.focus,this)).on("blur",a.proxy(this.blur,this)).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",a.proxy(this.keydown,this)),this.$menu.on("click",a.proxy(this.click,this)).on("mouseenter","li",a.proxy(this.mouseenter,this)).on("mouseleave","li",a.proxy(this.mouseleave,this))},eventSupported:function(a){var b=a in this.$element;return b||(this.$element.setAttribute(a,"return;"),b=typeof this.$element[a]=="function"),b},move:function(a){if(!this.shown)return;switch(a.keyCode){case 9:case 13:case 27:a.preventDefault();break;case 38:a.preventDefault(),this.prev();break;case 40:a.preventDefault(),this.next()}a.stopPropagation()},keydown:function(b){this.suppressKeyPressRepeat=~a.inArray(b.keyCode,[40,38,9,13,27]),this.move(b)},keypress:function(a){if(this.suppressKeyPressRepeat)return;this.move(a)},keyup:function(a){switch(a.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}a.stopPropagation(),a.preventDefault()},focus:function(a){this.focused=!0},blur:function(a){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(a){a.stopPropagation(),a.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(b){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),a(b.currentTarget).addClass("active")},mouseleave:function(a){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var c=a.fn.typeahead;a.fn.typeahead=function(c){return this.each(function(){var d=a(this),e=d.data("typeahead"),f=typeof c=="object"&&c;e||d.data("typeahead",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.typeahead.defaults={source:[],items:8,menu:'
',item:' ',minLength:1},a.fn.typeahead.Constructor=b,a.fn.typeahead.noConflict=function(){return a.fn.typeahead=c,this},a(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(b){var c=a(this);if(c.data("typeahead"))return;c.typeahead(c.data())})}(window.jQuery)
\ No newline at end of file
diff --git a/milfs/js/bootstrap.min.js b/milfs/js/bootstrap.min.js
deleted file mode 100644
index b04a0e8..0000000
--- a/milfs/js/bootstrap.min.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/*!
- * Bootstrap v3.1.1 (http://getbootstrap.com)
- * Copyright 2011-2014 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- */
-if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.isLoading=!1};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",f.resetText||d.data("resetText",d[e]()),d[e](f[b]||this.options[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},b.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});return this.$element.trigger(j),j.isDefaultPrevented()?void 0:(this.sliding=!0,f&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")),f&&this.cycle(),this)};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("collapse in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);!e&&f.toggle&&"show"==c&&(c=!c),e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(b){a(d).remove(),a(e).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;f.toggleClass("open").trigger("shown.bs.dropdown",h),e.focus()}return!1}},f.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var f=c(d),g=f.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&f.find(e).focus(),d.click();var h=" li:not(.divider):visible a",i=f.find("[role=menu]"+h+", [role=listbox]"+h);if(i.length){var j=i.index(i.filter(":focus"));38==b.keyCode&&j>0&&j--,40==b.keyCode&&j ').appendTo(document.body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),d&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;d?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()):b&&b()};var c=a.fn.modal;a.fn.modal=function(c,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},b.DEFAULTS,e.data(),"object"==typeof c&&c);f||e.data("bs.modal",f=new b(this,g)),"string"==typeof c?f[c](d):g.show&&f.show(d)})},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());c.is("a")&&b.preventDefault(),e.modal(f,this).one("hide",function(){c.is(":visible")&&c.focus()})}),a(document).on("show.bs.modal",".modal",function(){a(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){a(document.body).removeClass("modal-open")})}(jQuery),+function(a){"use strict";var b=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};b.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},b.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},b.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},b.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show()},b.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},b.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(b),b.isDefaultPrevented())return;var c=this,d=this.tip();this.setContent(),this.options.animation&&d.addClass("fade");var e="function"==typeof this.options.placement?this.options.placement.call(this,d[0],this.$element[0]):this.options.placement,f=/\s?auto?\s?/i,g=f.test(e);g&&(e=e.replace(f,"")||"top"),d.detach().css({top:0,left:0,display:"block"}).addClass(e),this.options.container?d.appendTo(this.options.container):d.insertAfter(this.$element);var h=this.getPosition(),i=d[0].offsetWidth,j=d[0].offsetHeight;if(g){var k=this.$element.parent(),l=e,m=document.documentElement.scrollTop||document.body.scrollTop,n="body"==this.options.container?window.innerWidth:k.outerWidth(),o="body"==this.options.container?window.innerHeight:k.outerHeight(),p="body"==this.options.container?0:k.offset().left;e="bottom"==e&&h.top+h.height+j-m>o?"top":"top"==e&&h.top-m-j<0?"bottom":"right"==e&&h.right+i>n?"left":"left"==e&&h.left-i'}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;(e||"destroy"!=c)&&(e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]())})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(a(c).is("body")?window:c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);{var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})}},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(b.RESET).addClass("affix");var a=this.$window.scrollTop(),c=this.$element.offset();return this.pinnedOffset=c.top-a},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"top"==this.affixed&&(e.top+=d),"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top(this.$element)),"function"==typeof h&&(h=f.bottom(this.$element));var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;if(this.affixed!==i){this.unpin&&this.$element.css("top","");var j="affix"+(i?"-"+i:""),k=a.Event(j+".bs.affix");this.$element.trigger(k),k.isDefaultPrevented()||(this.affixed=i,this.unpin="bottom"==i?this.getPinnedOffset():null,this.$element.removeClass(b.RESET).addClass(j).trigger(a.Event(j.replace("affix","affixed"))),"bottom"==i&&this.$element.offset({top:c-h-this.$element.height()}))}}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery);
\ No newline at end of file
diff --git a/milfs/js/canvas-to-blob.min.js.map b/milfs/js/canvas-to-blob.min.js.map
deleted file mode 100644
index 7c47d66..0000000
--- a/milfs/js/canvas-to-blob.min.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["canvas-to-blob.js"],"names":["window","CanvasPrototype","HTMLCanvasElement","prototype","hasBlobConstructor","Blob","Boolean","e","hasArrayBufferViewSupport","Uint8Array","size","BlobBuilder","WebKitBlobBuilder","MozBlobBuilder","MSBlobBuilder","dataURIPattern","dataURLtoBlob","atob","ArrayBuffer","dataURI","matches","mediaType","isBase64","dataString","byteString","arrayBuffer","intArray","i","bb","match","Error","slice","length","decodeURIComponent","charCodeAt","type","append","getBlob","toBlob","mozGetAsFile","callback","quality","toDataURL","this","define","amd","module","exports"],"mappings":"CAgBE,SAAUA,GACV,YAEA,IAAIC,GAAkBD,EAAOE,mBACLF,EAAOE,kBAAkBC,UAC7CC,EAAqBJ,EAAOK,MAAS,WACvC,IACE,MAAOC,SAAQ,GAAID,OACnB,MAAOE,GACP,OAAO,MAGPC,EAA4BJ,GAAsBJ,EAAOS,YAC1D,WACC,IACE,MAAgD,OAAzC,GAAIJ,OAAM,GAAII,YAAW,OAAOC,KACvC,MAAOH,GACP,OAAO,MAGTI,EAAcX,EAAOW,aAAeX,EAAOY,mBAC3BZ,EAAOa,gBAAkBb,EAAOc,cAChDC,EAAiB,0CACjBC,GAAiBZ,GAAsBO,IAAgBX,EAAOiB,MAChEjB,EAAOkB,aAAelB,EAAOS,YAC7B,SAAUU,GACR,GAAIC,GACFC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,CAGF,IADAR,EAAUD,EAAQU,MAAMd,IACnBK,EACH,KAAM,IAAIU,OAAM,mBAkBlB,KAfAT,EAAYD,EAAQ,GAChBA,EAAQ,GACR,cAAgBA,EAAQ,IAAM,qBAClCE,IAAaF,EAAQ,GACrBG,EAAaJ,EAAQY,MAAMX,EAAQ,GAAGY,QAGpCR,EAFEF,EAEWL,KAAKM,GAGLU,mBAAmBV,GAGlCE,EAAc,GAAIP,aAAYM,EAAWQ,QACzCN,EAAW,GAAIjB,YAAWgB,GACrBE,EAAI,EAAGA,EAAIH,EAAWQ,OAAQL,GAAK,EACtCD,EAASC,GAAKH,EAAWU,WAAWP,EAGtC,OAAIvB,GACK,GAAIC,OACRG,EAA4BkB,EAAWD,IACvCU,KAAMd,KAGXO,EAAK,GAAIjB,GACTiB,EAAGQ,OAAOX,GACHG,EAAGS,QAAQhB,IAElBrB,GAAOE,oBAAsBD,EAAgBqC,SAC3CrC,EAAgBsC,aAClBtC,EAAgBqC,OAAS,SAAUE,EAAUL,EAAMM,GAE/CD,EADEC,GAAWxC,EAAgByC,WAAa1B,EACjCA,EAAc2B,KAAKD,UAAUP,EAAMM,IAEnCE,KAAKJ,aAAa,OAAQJ,KAG9BlC,EAAgByC,WAAa1B,IACtCf,EAAgBqC,OAAS,SAAUE,EAAUL,EAAMM,GACjDD,EAASxB,EAAc2B,KAAKD,UAAUP,EAAMM,QAI5B,kBAAXG,SAAyBA,OAAOC,IACzCD,OAAO,WACL,MAAO5B,KAEkB,gBAAX8B,SAAuBA,OAAOC,QAC9CD,OAAOC,QAAU/B,EAEjBhB,EAAOgB,cAAgBA,GAEzBhB","file":"canvas-to-blob.min.js"}
\ No newline at end of file
diff --git a/milfs/js/ekko-lightbox.min.js b/milfs/js/ekko-lightbox.min.js
deleted file mode 100644
index 161e29c..0000000
--- a/milfs/js/ekko-lightbox.min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/*!
- * Lightbox for Bootstrap 3 by @ashleydw
- * https://github.com/ashleydw/lightbox
- *
- * License: https://github.com/ashleydw/lightbox/blob/master/LICENSE
- */
-(function(){"use strict";var a,b;a=jQuery,b=function(b,c){var d,e,f;return this.options=a.extend({title:null,footer:null,remote:null},a.fn.ekkoLightbox.defaults,c||{}),this.$element=a(b),d="",this.modal_id=this.options.modal_id?this.options.modal_id:"ekkoLightbox-"+Math.floor(1e3*Math.random()+1),f=''+(this.options.title||" ")+"
",e='"+this.options.footer+"",a(document.body).append(''+f+''+e+""),this.modal=a("#"+this.modal_id),this.modal_dialog=this.modal.find(".modal-dialog").first(),this.modal_content=this.modal.find(".modal-content").first(),this.modal_body=this.modal.find(".modal-body").first(),this.modal_header=this.modal.find(".modal-header").first(),this.modal_footer=this.modal.find(".modal-footer").first(),this.lightbox_container=this.modal_body.find(".ekko-lightbox-container").first(),this.lightbox_body=this.lightbox_container.find("> div:first-child").first(),this.showLoading(),this.modal_arrows=null,this.border={top:parseFloat(this.modal_dialog.css("border-top-width"))+parseFloat(this.modal_content.css("border-top-width"))+parseFloat(this.modal_body.css("border-top-width")),right:parseFloat(this.modal_dialog.css("border-right-width"))+parseFloat(this.modal_content.css("border-right-width"))+parseFloat(this.modal_body.css("border-right-width")),bottom:parseFloat(this.modal_dialog.css("border-bottom-width"))+parseFloat(this.modal_content.css("border-bottom-width"))+parseFloat(this.modal_body.css("border-bottom-width")),left:parseFloat(this.modal_dialog.css("border-left-width"))+parseFloat(this.modal_content.css("border-left-width"))+parseFloat(this.modal_body.css("border-left-width"))},this.padding={top:parseFloat(this.modal_dialog.css("padding-top"))+parseFloat(this.modal_content.css("padding-top"))+parseFloat(this.modal_body.css("padding-top")),right:parseFloat(this.modal_dialog.css("padding-right"))+parseFloat(this.modal_content.css("padding-right"))+parseFloat(this.modal_body.css("padding-right")),bottom:parseFloat(this.modal_dialog.css("padding-bottom"))+parseFloat(this.modal_content.css("padding-bottom"))+parseFloat(this.modal_body.css("padding-bottom")),left:parseFloat(this.modal_dialog.css("padding-left"))+parseFloat(this.modal_content.css("padding-left"))+parseFloat(this.modal_body.css("padding-left"))},this.modal.on("show.bs.modal",this.options.onShow.bind(this)).on("shown.bs.modal",function(a){return function(){return a.modal_shown(),a.options.onShown.call(a)}}(this)).on("hide.bs.modal",this.options.onHide.bind(this)).on("hidden.bs.modal",function(b){return function(){return b.gallery&&a(document).off("keydown.ekkoLightbox"),b.modal.remove(),b.options.onHidden.call(b)}}(this)).modal("show",c),this.modal},b.prototype={modal_shown:function(){var b;return this.options.remote?(this.gallery=this.$element.data("gallery"),this.gallery&&("document.body"===this.options.gallery_parent_selector||""===this.options.gallery_parent_selector?this.gallery_items=a(document.body).find('*[data-gallery="'+this.gallery+'"]'):this.gallery_items=this.$element.parents(this.options.gallery_parent_selector).first().find('*[data-gallery="'+this.gallery+'"]'),this.gallery_index=this.gallery_items.index(this.$element),a(document).on("keydown.ekkoLightbox",this.navigate.bind(this)),this.options.directional_arrows&&this.gallery_items.length>1&&(this.lightbox_container.append(''),this.modal_arrows=this.lightbox_container.find("div.ekko-lightbox-nav-overlay").first(),this.lightbox_container.find("a"+this.strip_spaces(this.options.left_arrow_class)).on("click",function(a){return function(b){return b.preventDefault(),a.navigate_left()}}(this)),this.lightbox_container.find("a"+this.strip_spaces(this.options.right_arrow_class)).on("click",function(a){return function(b){return b.preventDefault(),a.navigate_right()}}(this)))),this.options.type?"image"===this.options.type?this.preloadImage(this.options.remote,!0):"youtube"===this.options.type&&(b=this.getYoutubeId(this.options.remote))?this.showYoutubeVideo(b):"vimeo"===this.options.type?this.showVimeoVideo(this.options.remote):"instagram"===this.options.type?this.showInstagramVideo(this.options.remote):"url"===this.options.type?this.loadRemoteContent(this.options.remote):"video"===this.options.type?this.showVideoIframe(this.options.remote):this.error('Could not detect remote target type. Force the type using data-type="image|youtube|vimeo|instagram|url|video"'):this.detectRemoteType(this.options.remote)):this.error("No remote target given")},strip_stops:function(a){return a.replace(/\./g,"")},strip_spaces:function(a){return a.replace(/\s/g,"")},isImage:function(a){return a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSwf:function(a){return a.match(/\.(swf)((\?|#).*)?$/i)},getYoutubeId:function(a){var b;return b=a.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/),b&&11===b[2].length?b[2]:!1},getVimeoId:function(a){return a.indexOf("vimeo")>0?a:!1},getInstagramId:function(a){return a.indexOf("instagram")>0?a:!1},navigate:function(a){if(a=a||window.event,39===a.keyCode||37===a.keyCode){if(39===a.keyCode)return this.navigate_right();if(37===a.keyCode)return this.navigate_left()}},navigateTo:function(b){var c,d;return 0>b||b>this.gallery_items.length-1?this:(this.showLoading(),this.gallery_index=b,this.$element=a(this.gallery_items.get(this.gallery_index)),this.updateTitleAndFooter(),d=this.$element.attr("data-remote")||this.$element.attr("href"),this.detectRemoteType(d,this.$element.attr("data-type")||!1),this.gallery_index+1'+this.options.loadingMessage+""),this},showYoutubeVideo:function(a){var b,c,d;return c=null!=this.$element.attr("data-norelated")||this.options.no_related?"&rel=0":"",d=this.checkDimensions(this.$element.data("width")||560),b=d/(560/315),this.showVideoIframe("//www.youtube.com/embed/"+a+"?badge=0&autoplay=1&html5=1"+c,d,b)},showVimeoVideo:function(a){var b,c;return c=this.checkDimensions(this.$element.data("width")||560),b=c/(500/281),this.showVideoIframe(a+"?autoplay=1",c,b)},showInstagramVideo:function(a){var b,c;return c=this.checkDimensions(this.$element.data("width")||612),this.resize(c),b=c+80,this.lightbox_body.html(''),this.options.onContentLoaded.call(this),this.modal_arrows?this.modal_arrows.css("display","none"):void 0},showVideoIframe:function(a,b,c){return c=c||b,this.resize(b),this.lightbox_body.html(''),this.options.onContentLoaded.call(this),this.modal_arrows&&this.modal_arrows.css("display","none"),this},loadRemoteContent:function(b){var c,d;return d=this.$element.data("width")||560,this.resize(d),c=this.$element.data("disableExternalCheck")||!1,c||this.isExternal(b)?(this.lightbox_body.html(''),this.options.onContentLoaded.call(this)):this.lightbox_body.load(b,a.proxy(function(a){return function(){return a.$element.trigger("loaded.bs.modal")}}(this))),this.modal_arrows&&this.modal_arrows.css("display","none"),this},isExternal:function(a){var b;return b=a.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/),"string"==typeof b[1]&&b[1].length>0&&b[1].toLowerCase()!==location.protocol?!0:"string"==typeof b[2]&&b[2].length>0&&b[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host?!0:!1},error:function(a){return this.lightbox_body.html(a),this},preloadImage:function(b,c){var d;return d=new Image,(null==c||c===!0)&&(d.onload=function(b){return function(){var c;return c=a(""),c.attr("src",d.src),c.addClass("img-responsive"),b.lightbox_body.html(c),b.modal_arrows&&b.modal_arrows.css("display","block"),c.load(function(){return b.options.scale_height?b.scaleHeight(d.height,d.width):b.resize(d.width),b.options.onContentLoaded.call(b)})}}(this),d.onerror=function(a){return function(){return a.error("Failed to load image: "+b)}}(this)),d.src=b,d},scaleHeight:function(b,c){var d,e,f,g,h,i;return g=this.modal_header.outerHeight(!0)||0,f=this.modal_footer.outerHeight(!0)||0,this.modal_footer.is(":visible")||(f=0),this.modal_header.is(":visible")||(g=0),d=this.border.top+this.border.bottom+this.padding.top+this.padding.bottom,h=parseFloat(this.modal_dialog.css("margin-top"))+parseFloat(this.modal_dialog.css("margin-bottom")),i=a(window).height()-d-h-g-f,e=Math.min(i/b,1),this.modal_dialog.css("height","auto").css("max-height",i),this.resize(e*c)},resize:function(b){var c;return c=b+this.border.left+this.padding.left+this.padding.right+this.border.right,this.modal_dialog.css("width","auto").css("max-width",c),this.lightbox_container.find("a").css("line-height",function(){return a(this).parent().height()+"px"}),this},checkDimensions:function(a){var b,c;return c=a+this.border.left+this.padding.left+this.padding.right+this.border.right,b=document.body.clientWidth,c>b&&(a=this.modal_body.width()),a},close:function(){return this.modal.modal("hide")},addTrailingSlash:function(a){return"/"!==a.substr(-1)&&(a+="/"),a}},a.fn.ekkoLightbox=function(c){return this.each(function(){var d;return d=a(this),c=a.extend({remote:d.attr("data-remote")||d.attr("href"),gallery_parent_selector:d.attr("data-parent"),type:d.attr("data-type")},c,d.data()),new b(this,c),this})},a.fn.ekkoLightbox.defaults={gallery_parent_selector:"document.body",left_arrow_class:".glyphicon .glyphicon-chevron-left",right_arrow_class:".glyphicon .glyphicon-chevron-right",directional_arrows:!0,type:null,always_show_close:!0,no_related:!1,scale_height:!0,loadingMessage:"Loading...",onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}}}).call(this);
\ No newline at end of file
diff --git a/milfs/js/ie-emulation-modes-warning.js b/milfs/js/ie-emulation-modes-warning.js
deleted file mode 100644
index 3f97ba5..0000000
--- a/milfs/js/ie-emulation-modes-warning.js
+++ /dev/null
@@ -1,51 +0,0 @@
-// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
-// IT'S JUST JUNK FOR OUR DOCS!
-// ++++++++++++++++++++++++++++++++++++++++++
-/*!
- * Copyright 2014-2015 Twitter, Inc.
- *
- * Licensed under the Creative Commons Attribution 3.0 Unported License. For
- * details, see https://creativecommons.org/licenses/by/3.0/.
- */
-// Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes.
-(function () {
- 'use strict';
-
- function emulatedIEMajorVersion() {
- var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent)
- if (groups === null) {
- return null
- }
- var ieVersionNum = parseInt(groups[1], 10)
- var ieMajorVersion = Math.floor(ieVersionNum)
- return ieMajorVersion
- }
-
- function actualNonEmulatedIEMajorVersion() {
- // Detects the actual version of IE in use, even if it's in an older-IE emulation mode.
- // IE JavaScript conditional compilation docs: https://msdn.microsoft.com/library/121hztk3%28v=vs.94%29.aspx
- // @cc_on docs: https://msdn.microsoft.com/library/8ka90k2e%28v=vs.94%29.aspx
- var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // jshint ignore:line
- if (jscriptVersion === undefined) {
- return 11 // IE11+ not in emulation mode
- }
- if (jscriptVersion < 9) {
- return 8 // IE8 (or lower; haven't tested on IE<8)
- }
- return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode
- }
-
- var ua = window.navigator.userAgent
- if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) {
- return // Opera, which might pretend to be IE
- }
- var emulated = emulatedIEMajorVersion()
- if (emulated === null) {
- return // Not IE
- }
- var nonEmulated = actualNonEmulatedIEMajorVersion()
-
- if (emulated !== nonEmulated) {
- window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!')
- }
-})();
diff --git a/milfs/js/index.php b/milfs/js/index.php
deleted file mode 100644
index 1623781..0000000
--- a/milfs/js/index.php
+++ /dev/null
@@ -1,226 +0,0 @@
-processRequests();
-
-$embebido =0;
-if (isset($_REQUEST['form'])) {
- $form = $_REQUEST['form'];
- $opciones["formato"]= $_REQUEST['formato'];
- } else {$form = "";}
- if($form !='') {$embebido = 1;}
-if (isset($_REQUEST['identificador'])) {$identificador = $_REQUEST['identificador'];} else {$identificador = "";}
- if($identificador !='') {$embebido = 1;}
-if (isset($_REQUEST['id'])) {$id = $_REQUEST['id'];} else {$id = "";}
-if (isset($_REQUEST['c'])) {$c = $_REQUEST['c'];} else {$c = "";}
-if (isset($_REQUEST['f'])) {$f = $_REQUEST['f'];} else {$f = "";}
-if (isset($_REQUEST['t'])) {$t = $_REQUEST['t'];} else {$t = "";}
-?>
-
-
-
-
-
-
-
-
-
- printJavascript("xajax/");
- //$xajax->debugOn();
- ?>
-
-
-
- ";}else{ echo "";} ?>
-
-
-
-
-
-
-
-
-
- I<3MILFS
-
- xajax_formulario_modal('".$id."','','".$c."','".$t."')";}
- if( isset($_REQUEST['psi'])){$onload ="";}
-?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- © MILFS Un proyecto de http://QWERTY.co Se distribuye bajo licencia GPL V3
- Políticas de privacidad y protección de datos.
-
-
-
-
-
-
diff --git a/milfs/js/jquery-2.1.4.min.js b/milfs/js/jquery-2.1.4.min.js
deleted file mode 100644
index 49990d6..0000000
--- a/milfs/js/jquery-2.1.4.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
-!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){
-return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*\s*$/g,ia={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1>$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1>$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("")).appendTo(b.documentElement),b=qa[0].contentDocument,b.write(),b.close(),c=sa(a,b),qa.detach()),ra[a]=c),c}var ua=/^margin/,va=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wa=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)};function xa(a,b,c){var d,e,f,g,h=a.style;return c=c||wa(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),va.test(g)&&ua.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function ya(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),f.removeChild(c),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var za=/^(none|table(?!-c[ea]).+)/,Aa=new RegExp("^("+Q+")(.*)$","i"),Ba=new RegExp("^([+-])=("+Q+")","i"),Ca={position:"absolute",visibility:"hidden",display:"block"},Da={letterSpacing:"0",fontWeight:"400"},Ea=["Webkit","O","Moz","ms"];function Fa(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Ea.length;while(e--)if(b=Ea[e]+c,b in a)return b;return d}function Ga(a,b,c){var d=Aa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Ha(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ia(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wa(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xa(a,b,f),(0>e||null==e)&&(e=a.style[b]),va.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Ha(a,b,c||(g?"border":"content"),d,f)+"px"}function Ja(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",ta(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xa(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fa(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Ba.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fa(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xa(a,b,d)),"normal"===e&&b in Da&&(e=Da[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?za.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Ca,function(){return Ia(a,b,d)}):Ia(a,b,d):void 0},set:function(a,c,d){var e=d&&wa(a);return Ga(a,c,d?Ha(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=ya(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ua.test(a)||(n.cssHooks[a+b].set=Ga)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wa(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Ja(this,!0)},hide:function(){return Ja(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Ka(a,b,c,d,e){return new Ka.prototype.init(a,b,c,d,e)}n.Tween=Ka,Ka.prototype={constructor:Ka,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ka.propHooks[this.prop];return a&&a.get?a.get(this):Ka.propHooks._default.get(this)},run:function(a){var b,c=Ka.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ka.propHooks._default.set(this),this}},Ka.prototype.init.prototype=Ka.prototype,Ka.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Ka.propHooks.scrollTop=Ka.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Ka.prototype.init,n.fx.step={};var La,Ma,Na=/^(?:toggle|show|hide)$/,Oa=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pa=/queueHooks$/,Qa=[Va],Ra={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Oa.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Oa.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sa(){return setTimeout(function(){La=void 0}),La=n.now()}function Ta(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ua(a,b,c){for(var d,e=(Ra[b]||[]).concat(Ra["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Va(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||ta(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Na.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?ta(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ua(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wa(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xa(a,b,c){var d,e,f=0,g=Qa.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=La||Sa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:La||Sa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wa(k,j.opts.specialEasing);g>f;f++)if(d=Qa[f].call(j,a,k,j.opts))return d;return n.map(k,Ua,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xa,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Ra[c]=Ra[c]||[],Ra[c].unshift(b)},prefilter:function(a,b){b?Qa.unshift(a):Qa.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xa(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pa.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Ta(b,!0),a,d,e)}}),n.each({slideDown:Ta("show"),slideUp:Ta("hide"),slideToggle:Ta("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(La=n.now();b1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Za:Ya)),
-void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Za={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$a[b]||n.find.attr;$a[b]=function(a,b,d){var e,f;return d||(f=$a[b],$a[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$a[b]=f),e}});var _a=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_a.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ab=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ab," ").indexOf(b)>=0)return!0;return!1}});var bb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cb=n.now(),db=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var eb=/#.*$/,fb=/([?&])_=[^&]*/,gb=/^(.*?):[ \t]*([^\r\n]*)$/gm,hb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ib=/^(?:GET|HEAD)$/,jb=/^\/\//,kb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lb={},mb={},nb="*/".concat("*"),ob=a.location.href,pb=kb.exec(ob.toLowerCase())||[];function qb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function rb(a,b,c,d){var e={},f=a===mb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function sb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function tb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function ub(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ob,type:"GET",isLocal:hb.test(pb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":nb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?sb(sb(a,n.ajaxSettings),b):sb(n.ajaxSettings,a)},ajaxPrefilter:qb(lb),ajaxTransport:qb(mb),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=gb.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||ob)+"").replace(eb,"").replace(jb,pb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=kb.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===pb[1]&&h[2]===pb[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(pb[3]||("http:"===pb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),rb(lb,k,b,v),2===t)return v;i=n.event&&k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!ib.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(db.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=fb.test(d)?d.replace(fb,"$1_="+cb++):d+(db.test(d)?"&":"?")+"_="+cb++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+nb+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=rb(mb,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=tb(k,v,f)),u=ub(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var vb=/%20/g,wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&").replace(vb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Bb=0,Cb={},Db={0:200,1223:204},Eb=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Cb)Cb[a]()}),k.cors=!!Eb&&"withCredentials"in Eb,k.ajax=Eb=!!Eb,n.ajaxTransport(function(a){var b;return k.cors||Eb&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Bb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Cb[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Db[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Cb[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n(" -->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ¿DÓNDE
-ESTÁN
- MIS DATOS?
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Los datos que se encuentran en esta página estan asociados al resultado de
- la investigación que se encuentra en http://www.dondeestanmisdatos.info/
- lo que se encuentra en este sitio es un visualización de datos creada a
- partir de los resultados de la investigación después de ser ingresados a la
- plataforma MILFS
-
-
- Esta plataforma nos entrega los datos en forma de una API que puede ser
- consumida en le siguiente enlace:
-
- http://datos.labmde.org/api.php?id=19
-
- Los datos son entregados en formato JSON
- tener este formato permite a las personas recibir
- actualización de los datos de manera automatica y utilizarlo en sus
- aplicaciones como fuente de datos, entre otras.
-
- Especificación de los datos:
-
- El JSON, entrega un ID por cada uno de los campos y también los
- nombres si es necesario, tal como se ve en la siguiente tabla:
-
-
-
-
-
-
- ID
- Nombre del Campo
-
-
- 115
- Isp
-
-
- 125
- Ong (eff)
-
-
- 124
- Pais
-
-
- 110
- 1. el psi publica informes de transparencia
-
-
- 116
- 1.1 el informe de transparencia muestra las
- solicitudes que ha hecho el gobierno, a través de diferentes
- entidades del estado, solicitando información de los usuarios.
-
-
- 117
- 1.2 el informe de transparencia indica la frecuencia
- con la cuál la empresa entrega información de los usuarios al
- gobierno
-
-
- 118
- 1.3 el informe de transparencia señala si se ha dado
- respuesta a las solicitudes hechas por el gobierno y muestra el
- procedimiento que han tenido las mismas.
-
-
- 119
- 1.4 el informe de tranparencia evidencia el número
- de usuarios que han sido notificados en el último año en relación
- con el número de solicitudes por parte del gobierno.
-
-
- 120
- 1.5 el informe de transparencia informa el origen de
- las solicitudes para bloqueo y/o retiro de contenidos de internet
- (incluyendo pornografía infantil, infracción al derecho de autor,
- cumplimiento de sus propias políticas, etc.)
-
-
- 121
- 1.6 el informe de transparencia explica con claridad
- el manejo de los datos de los usuarios; si estos han sido
- administrados por terceros y da cuenta de las acciones llevadas a
- cabo por éstos en relación con la protección de datos de los
- usuarios. en caso de gestión por terceros informa si ellos han dado
- información al gobierno por solicitud del mismo.
-
-
- 122
- 1.7 el informe de transparencia indica cuántas veces
- ha procedido la psi a bloquear y/o retirar contenidos de internet.
-
-
- 123
- 1.8 el informe de transparencia informa sobre si ha
- habido defensa de los usuarios cuyo contenido ha sido bloqueado y/o
- retirado y los motivos para ello.
-
-
- 130
- Comentarios bloque 1
-
-
- 111
- 2.1 ¿el psi notifica al usuario cuando el gobierno
- nacional ha hecho solicitud de información de sus datos?
-
-
- 126
- 2.2 ¿el psi notifica al usuario o usuaria de manera
- oportuna cuando el gobierno nacional ha hecho una solicitud de
- información de sus datos, es decir, dando tiempo a que el usuario
- pueda interponer recursos de ser necesario?
-
-
- 131
- Comentarios bloque 2
-
-
- 112
- 3. las polÍticas de protección de datos del psi son
- públicas y de fácil acceso para los usuarios y usuarias
-
-
- 132
- Comentarios bloque 3
-
-
- 113
- 4. el psi publica manuales de cumplimiento de
- obligaciones legales que pueden afectar la intimidad de los usuarios
- y usuarias
-
-
- 133
- Comentarios bloque 4
-
-
- 127
- 5.1 ¿el psi pública los procedimientos que emplea
- para filtrar/retirar/bloquear contenidos y/o suspender/cancelar
- servicios, indicando además los soportes legales/contractuales que
- lo justifican?
-
-
- 128
- 5.2 ¿el psi específica las motivaciones que la
- llevan a hacer filtros/retiros/bloqueos de contenidos y/o
- suspensión/cancelación de servicios?
-
-
- 129
- 5.3 ¿el psi específica cómo los procedimientos para
- filtrar/retirar/bloquear contenidos y/o suspender/cancelar servicios
- tienen en cuenta el debido proceso? (como mínimo suponen:
- notificación al usuario, oportunidad de defensa, criterios de
- proporcionalidad, etcétera)
-
-
- 134
- Comentarios bloque 5
-
-
-
-
-
- Las preguntas están organizadas por grupos, y existe un campo de
- "Comentarios" por cada bloque de preguntas y en los datos se puede
- identificar a que pregunta esa asociado cada uno de los comentarios.
-
- También puede descargar los datos en formato CSV (AQUÍ)
-
Este archivo tiene como delimitador de campos el
- carácter "pipe" ( | ) y como delimitador de texto las comillas
- dobles ( " " ).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/milfs/landing.php b/milfs/landing.php
deleted file mode 100644
index fc3f313..0000000
--- a/milfs/landing.php
+++ /dev/null
@@ -1,600 +0,0 @@
-processRequests(); ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
- printJavascript("xajax/"); ?>
-
-
-debugOn('');
-$embebido =0;
-if( isset($_REQUEST['empresa']) OR empty($_REQUEST) OR isset($_REQUEST['set']) OR isset($_REQUEST['identificador']) ) {
-$acceso = 0;
-if( @$_REQUEST['empresa'] =="") { $id_empresa = "1";}
-else { $id_empresa = $_REQUEST['empresa'];}
-$id = remplacetas('empresa','id',"$id_empresa",'id','') ;
-if($id[0]=="") { $id_empresa = "1";}
- if(!isset($_REQUEST['set'])){
- $titulo = remplacetas('empresa','id',"$id_empresa",'razon_social','') ;
- $descripcion = remplacetas('empresa','id',"$id_empresa",'slogan','') ;
- $background_imagen = buscar_imagen('',"","","$id_empresa");
- $uri_set = "";
- $acceso = 1;
- }
- else {
- $empresa = remplacetas('form_id','id',$_REQUEST['set'],'id_empresa',"") ;
- $id_empresa = $empresa[0];
- $titulo = remplacetas('form_id','id',$_REQUEST['set'],'nombre',"") ;
- $descripcion = remplacetas('form_id','id',$_REQUEST['set'],'descripcion',"") ;
- $background_imagen = buscar_imagen($_REQUEST['set'],"","","$id_empresa");
- $uri_set = "";
- $publico = remplacetas('form_id','id',$_REQUEST['set'],'publico',"") ;
- if($publico[0] =='1') {$acceso = 1;}
-
- }
- if( isset($_REQUEST['identificador'])){
- $empresa = remplacetas('form_datos','control',$_REQUEST['identificador'],'id_empresa',"") ;
- $id_empresa = $empresa[0];
- $form = remplacetas('form_datos','control',$_REQUEST['identificador'],'form_id',"") ;
- $titulo = remplacetas('form_id','id',$form['0'],'nombre',"") ;
- $descripcion = remplacetas('form_id','id',$form['0'],'descripcion',"") ;
- $background_imagen = buscar_imagen("$form[0]",$_REQUEST['identificador'],"","$id_empresa");
- $uri_set = "$titulo[0]";
- $publico = remplacetas('form_id','id',$form[0],'publico',"") ;
- if($publico[0] =='1') {$acceso = 1;}
-}
-$logo = remplacetas('empresa','id',"$id_empresa",'imagen','') ;
-$direccion = remplacetas('empresa','id',"$id_empresa",'direccion','') ;
-$telefono = remplacetas('empresa','id',"$id_empresa",'telefono','') ;
-$email = remplacetas('empresa','id',"$id_empresa",'email','') ;
-$facebook = remplacetas('empresa','id',"$id_empresa",'facebook','') ;
-$twitter = remplacetas('empresa','id',"$id_empresa",'twitter','') ;
-
-$razon_social = remplacetas('empresa','id',"$id_empresa",'razon_social','') ;
-$sigla = remplacetas('empresa','id',"$id_empresa",'sigla','') ;
-
-
-
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- I<3MILFS
-
- xajax_formulario_modal('".$id."','','".$c."','".$t."')";}
- if( isset($_REQUEST['psi'])){$onload ="";}
-?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- xxx
-
- xxx
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- © MILFS Un proyecto de http://QWERTY.co Se distribuye bajo licencia GPL V3
- Políticas de privacidad y protección de datos.
-
-
-
-
-
-
\ No newline at end of file
diff --git a/milfs/landing_20151117.php b/milfs/landing_20151117.php
deleted file mode 100644
index f49e52b..0000000
--- a/milfs/landing_20151117.php
+++ /dev/null
@@ -1,599 +0,0 @@
-processRequests(); ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
- printJavascript("xajax/"); ?>
-
-
-debugOn('');
-$embebido =0;
-if( isset($_REQUEST['empresa']) OR empty($_REQUEST) OR isset($_REQUEST['set']) OR isset($_REQUEST['identificador']) ) {
-$acceso = 0;
-if( @$_REQUEST['empresa'] =="") { $id_empresa = "1";}
-else { $id_empresa = $_REQUEST['empresa'];}
-$id = remplacetas('empresa','id',"$id_empresa",'id','') ;
-if($id[0]=="") { $id_empresa = "1";}
- if(!isset($_REQUEST['set'])){
- $titulo = remplacetas('empresa','id',"$id_empresa",'razon_social','') ;
- $descripcion = remplacetas('empresa','id',"$id_empresa",'slogan','') ;
- $background_imagen = buscar_imagen('',"","","$id_empresa");
- $uri_set = "";
- $acceso = 1;
- }
- else {
- $empresa = remplacetas('form_id','id',$_REQUEST['set'],'id_empresa',"") ;
- $id_empresa = $empresa[0];
- $titulo = remplacetas('form_id','id',$_REQUEST['set'],'nombre',"") ;
- $descripcion = remplacetas('form_id','id',$_REQUEST['set'],'descripcion',"") ;
- $background_imagen = buscar_imagen($_REQUEST['set'],"","","$id_empresa");
- $uri_set = "";
- $publico = remplacetas('form_id','id',$_REQUEST['set'],'publico',"") ;
- if($publico[0] =='1') {$acceso = 1;}
-
- }
- if( isset($_REQUEST['identificador'])){
- $empresa = remplacetas('form_datos','control',$_REQUEST['identificador'],'id_empresa',"") ;
- $id_empresa = $empresa[0];
- $form = remplacetas('form_datos','control',$_REQUEST['identificador'],'form_id',"") ;
- $titulo = remplacetas('form_id','id',$form['0'],'nombre',"") ;
- $descripcion = remplacetas('form_id','id',$form['0'],'descripcion',"") ;
- $background_imagen = buscar_imagen($form[0],"","","$id_empresa");
- $uri_set = "$titulo[0]";
- $publico = remplacetas('form_id','id',$form[0],'publico',"") ;
- if($publico[0] =='1') {$acceso = 1;}
-}
-$logo = remplacetas('empresa','id',"$id_empresa",'imagen','') ;
-$direccion = remplacetas('empresa','id',"$id_empresa",'direccion','') ;
-$telefono = remplacetas('empresa','id',"$id_empresa",'telefono','') ;
-$email = remplacetas('empresa','id',"$id_empresa",'email','') ;
-$facebook = remplacetas('empresa','id',"$id_empresa",'facebook','') ;
-$twitter = remplacetas('empresa','id',"$id_empresa",'twitter','') ;
-
-$razon_social = remplacetas('empresa','id',"$id_empresa",'razon_social','') ;
-$sigla = remplacetas('empresa','id',"$id_empresa",'sigla','') ;
-
-
-
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- I<3MILFS
-
- xajax_formulario_modal('".$id."','','".$c."','".$t."')";}
- if( isset($_REQUEST['psi'])){$onload ="";}
-?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- xxx
-
- xxx
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- © MILFS Un proyecto de http://QWERTY.co Se distribuye bajo licencia GPL V3
- Políticas de privacidad y protección de datos.
-
-
-
-
-
-
\ No newline at end of file
diff --git a/milfs/librerias/hybridauth/Hybrid/Auth.php b/milfs/librerias/hybridauth/Hybrid/Auth.php
deleted file mode 100644
index a388ccf..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Auth.php
+++ /dev/null
@@ -1,411 +0,0 @@
-getSessionData());
- Hybrid_Logger::info("Hybrid_Auth initialize: check if any error is stored on the endpoint...");
-
- if (Hybrid_Error::hasError()) {
- $m = Hybrid_Error::getErrorMessage();
- $c = Hybrid_Error::getErrorCode();
- $p = Hybrid_Error::getErrorPrevious();
-
- Hybrid_Logger::error("Hybrid_Auth initialize: A stored Error found, Throw an new Exception and delete it from the store: Error#$c, '$m'");
-
- Hybrid_Error::clearError();
-
- // try to provide the previous if any
- // Exception::getPrevious (PHP 5 >= 5.3.0) http://php.net/manual/en/exception.getprevious.php
- if (version_compare(PHP_VERSION, '5.3.0', '>=') && ($p instanceof Exception)) {
- throw new Exception($m, $c, $p);
- } else {
- throw new Exception($m, $c);
- }
- }
-
- Hybrid_Logger::info("Hybrid_Auth initialize: no error found. initialization succeed.");
- }
-
- /**
- * Hybrid storage system accessor
- *
- * Users sessions are stored using HybridAuth storage system ( HybridAuth 2.0 handle PHP Session only) and can be accessed directly by
- * Hybrid_Auth::storage()->get($key) to retrieves the data for the given key, or calling
- * Hybrid_Auth::storage()->set($key, $value) to store the key => $value set.
- *
- * @return Hybrid_Storage
- */
- public static function storage() {
- return Hybrid_Auth::$store;
- }
-
- /**
- * Get hybridauth session data
- * @return string|null
- */
- function getSessionData() {
- return Hybrid_Auth::storage()->getSessionData();
- }
-
- /**
- * Restore hybridauth session data
- *
- * @param string $sessiondata Serialized session data
- * @retun void
- */
- function restoreSessionData($sessiondata = null) {
- Hybrid_Auth::storage()->restoreSessionData($sessiondata);
- }
-
- /**
- * Try to authenticate the user with a given provider.
- *
- * If the user is already connected we just return and instance of provider adapter,
- * ELSE, try to authenticate and authorize the user with the provider.
- *
- * $params is generally an array with required info in order for this provider and HybridAuth to work,
- * like :
- * hauth_return_to: URL to call back after authentication is done
- * openid_identifier: The OpenID identity provider identifier
- * google_service: can be "Users" for Google user accounts service or "Apps" for Google hosted Apps
- *
- * @param string $providerId ID of the provider
- * @param array $params Params
- * @return
- */
- public static function authenticate($providerId, $params = null) {
- Hybrid_Logger::info("Enter Hybrid_Auth::authenticate( $providerId )");
-
- if (!Hybrid_Auth::storage()->get("hauth_session.$providerId.is_logged_in")) {
- // if user not connected to $providerId then try setup a new adapter and start the login process for this provider
- Hybrid_Logger::info("Hybrid_Auth::authenticate( $providerId ), User not connected to the provider. Try to authenticate..");
- $provider_adapter = Hybrid_Auth::setup($providerId, $params);
- $provider_adapter->login();
- } else {
- // else, then return the adapter instance for the given provider
- Hybrid_Logger::info("Hybrid_Auth::authenticate( $providerId ), User is already connected to this provider. Return the adapter instance.");
- return Hybrid_Auth::getAdapter($providerId);
- }
- }
-
- /**
- * Return the adapter instance for an authenticated provider
- *
- * @param string $providerId ID of the provider
- * @return Hybrid_Provider_Adapter
- */
- public static function getAdapter($providerId = null) {
- Hybrid_Logger::info("Enter Hybrid_Auth::getAdapter( $providerId )");
- return Hybrid_Auth::setup($providerId);
- }
-
- /**
- * Setup an adapter for a given provider
- *
- * @param string $providerId ID of the provider
- * @param array $params Adapter params
- * @return Hybrid_Provider_Adapter
- */
- public static function setup($providerId, $params = null) {
- Hybrid_Logger::debug("Enter Hybrid_Auth::setup( $providerId )", $params);
-
- if (!$params) {
- $params = Hybrid_Auth::storage()->get("hauth_session.$providerId.id_provider_params");
-
- Hybrid_Logger::debug("Hybrid_Auth::setup( $providerId ), no params given. Trying to get the stored for this provider.", $params);
- }
-
- if (!$params) {
- $params = array();
- Hybrid_Logger::info("Hybrid_Auth::setup( $providerId ), no stored params found for this provider. Initialize a new one for new session");
- }
-
- if (is_array($params) && !isset($params["hauth_return_to"])) {
- $params["hauth_return_to"] = Hybrid_Auth::getCurrentUrl();
- Hybrid_Logger::debug("Hybrid_Auth::setup( $providerId ). HybridAuth Callback URL set to: ", $params["hauth_return_to"]);
- }
-
- # instantiate a new IDProvider Adapter
- $provider = new Hybrid_Provider_Adapter();
- $provider->factory($providerId, $params);
- return $provider;
- }
-
- /**
- * Check if the current user is connected to a given provider
- *
- * @param string $providerId ID of the provider
- * @return bool
- */
- public static function isConnectedWith($providerId) {
- return (bool) Hybrid_Auth::storage()->get("hauth_session.{$providerId}.is_logged_in");
- }
-
- /**
- * Return array listing all authenticated providers
- * @return array
- */
- public static function getConnectedProviders() {
- $idps = array();
-
- foreach (Hybrid_Auth::$config["providers"] as $idpid => $params) {
- if (Hybrid_Auth::isConnectedWith($idpid)) {
- $idps[] = $idpid;
- }
- }
-
- return $idps;
- }
-
- /**
- * Return array listing all enabled providers as well as a flag if you are connected
- *
- *
- * array(
- * 'Facebook' => array(
- * 'connected' => true
- * )
- * )
- *
- * @return array
- */
- public static function getProviders() {
- $idps = array();
-
- foreach (Hybrid_Auth::$config["providers"] as $idpid => $params) {
- if ($params['enabled']) {
- $idps[$idpid] = array('connected' => false);
-
- if (Hybrid_Auth::isConnectedWith($idpid)) {
- $idps[$idpid]['connected'] = true;
- }
- }
- }
-
- return $idps;
- }
-
- /**
- * A generic function to logout all connected provider at once
- * @return void
- */
- public static function logoutAllProviders() {
- $idps = Hybrid_Auth::getConnectedProviders();
-
- foreach ($idps as $idp) {
- $adapter = Hybrid_Auth::getAdapter($idp);
- $adapter->logout();
- }
- }
-
- /**
- * Utility function, redirect to a given URL with php header or using javascript location.href
- *
- * @param string $url URL to redirect to
- * @param string $mode PHP|JS
- */
- public static function redirect($url, $mode = "PHP") {
- Hybrid_Logger::info("Enter Hybrid_Auth::redirect( $url, $mode )");
-
- // Ensure session is saved before sending response, see https://github.com/symfony/symfony/pull/12341
- if ((PHP_VERSION_ID >= 50400 && PHP_SESSION_ACTIVE === session_status()) || (PHP_VERSION_ID < 50400 && isset($_SESSION) && session_id())) {
- session_write_close();
- }
-
- if ($mode == "PHP") {
- header("Location: $url");
- } elseif ($mode == "JS") {
- echo '';
- echo '';
- echo '';
- echo '';
- echo '';
- echo 'Redirecting, please wait...';
- echo '';
- echo '';
- }
-
- die();
- }
-
- /**
- * Utility function, return the current url
- *
- * @param bool $request_uri true to get $_SERVER['REQUEST_URI'], false for $_SERVER['PHP_SELF']
- * @return string
- */
- public static function getCurrentUrl($request_uri = true) {
- if (php_sapi_name() == 'cli') {
- return '';
- }
-
- $protocol = 'http://';
-
- if ((isset($_SERVER['HTTPS']) && ( $_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1 ))
- || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'))
- {
- $protocol = 'https://';
- }
-
- $url = $protocol . $_SERVER['HTTP_HOST'];
-
- if ($request_uri) {
- $url .= $_SERVER['REQUEST_URI'];
- } else {
- $url .= $_SERVER['PHP_SELF'];
- }
-
- // return current url
- return $url;
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/Endpoint.php b/milfs/librerias/hybridauth/Hybrid/Endpoint.php
deleted file mode 100644
index fbb1a40..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Endpoint.php
+++ /dev/null
@@ -1,222 +0,0 @@
-here we need to parse $_SERVER[QUERY_STRING]
- $request = $_REQUEST;
- if (strrpos($_SERVER["QUERY_STRING"], '?')) {
- $_SERVER["QUERY_STRING"] = str_replace("?", "&", $_SERVER["QUERY_STRING"]);
- parse_str($_SERVER["QUERY_STRING"], $request);
- }
- }
-
- // Setup request variable
- $this->request = $request;
-
- // If openid_policy requested, we return our policy document
- if (isset($this->request["get"]) && $this->request["get"] == "openid_policy") {
- $this->processOpenidPolicy();
- }
-
- // If openid_xrds requested, we return our XRDS document
- if (isset($this->request["get"]) && $this->request["get"] == "openid_xrds") {
- $this->processOpenidXRDS();
- }
-
- // If we get a hauth.start
- if (isset($this->request["hauth_start"]) && $this->request["hauth_start"]) {
- $this->processAuthStart();
- }
- // Else if hauth.done
- elseif (isset($this->request["hauth_done"]) && $this->request["hauth_done"]) {
- $this->processAuthDone();
- }
- // Else we advertise our XRDS document, something supposed to be done from the Realm URL page
- else {
- $this->processOpenidRealm();
- }
- }
-
- /**
- * Process the current request
- *
- * @param array $request The current request parameters. Leave as null to default to use $_REQUEST.
- * @return Hybrid_Endpoint
- */
- public static function process($request = null) {
- // Trick for PHP 5.2, because it doesn't support late static binding
- $class = function_exists('get_called_class') ? get_called_class() : __CLASS__;
- new $class($request);
- }
-
- /**
- * Process OpenID policy request
- * @return void
- */
- protected function processOpenidPolicy() {
- $output = file_get_contents(dirname(__FILE__) . "/resources/openid_policy.html");
- print $output;
- die();
- }
-
- /**
- * Process OpenID XRDS request
- * @return void
- */
- protected function processOpenidXRDS() {
- header("Content-Type: application/xrds+xml");
-
- $output = str_replace("{RETURN_TO_URL}", str_replace(
- array("<", ">", "\"", "'", "&"), array("<", ">", """, "'", "&"), Hybrid_Auth::getCurrentUrl(false)
- ), file_get_contents(dirname(__FILE__) . "/resources/openid_xrds.xml"));
- print $output;
- die();
- }
-
- /**
- * Process OpenID realm request
- * @return void
- */
- protected function processOpenidRealm() {
- $output = str_replace("{X_XRDS_LOCATION}", htmlentities(Hybrid_Auth::getCurrentUrl(false), ENT_QUOTES, 'UTF-8')
- . "?get=openid_xrds&v="
- . Hybrid_Auth::$version, file_get_contents(dirname(__FILE__) . "/resources/openid_realm.html"));
- print $output;
- die();
- }
-
- /**
- * Define: endpoint step 3
- * @return void
- * @throws Hybrid_Exception
- */
- protected function processAuthStart() {
- $this->authInit();
-
- $provider_id = trim(strip_tags($this->request["hauth_start"]));
-
- // check if page accessed directly
- if (!Hybrid_Auth::storage()->get("hauth_session.$provider_id.hauth_endpoint")) {
- Hybrid_Logger::error("Endpoint: hauth_endpoint parameter is not defined on hauth_start, halt login process!");
-
- throw new Hybrid_Exception("You cannot access this page directly.");
- }
-
- // define:hybrid.endpoint.php step 2.
- $hauth = Hybrid_Auth::setup($provider_id);
-
- // if REQUESTed hauth_idprovider is wrong, session not created, etc.
- if (!$hauth) {
- Hybrid_Logger::error("Endpoint: Invalid parameter on hauth_start!");
- throw new Hybrid_Exception("Invalid parameter! Please return to the login page and try again.");
- }
-
- try {
- Hybrid_Logger::info("Endpoint: call adapter [{$provider_id}] loginBegin()");
-
- $hauth->adapter->loginBegin();
- } catch (Exception $e) {
- Hybrid_Logger::error("Exception:" . $e->getMessage(), $e);
- Hybrid_Error::setError($e->getMessage(), $e->getCode(), $e->getTraceAsString(), $e->getPrevious());
-
- $hauth->returnToCallbackUrl();
- }
-
- die();
- }
-
- /**
- * Define: endpoint step 3.1 and 3.2
- * @return void
- * @throws Hybrid_Exception
- */
- protected function processAuthDone() {
- $this->authInit();
-
- $provider_id = trim(strip_tags($this->request["hauth_done"]));
-
- $hauth = Hybrid_Auth::setup($provider_id);
-
- if (!$hauth) {
- Hybrid_Logger::error("Endpoint: Invalid parameter on hauth_done!");
-
- $hauth->adapter->setUserUnconnected();
-
- throw new Hybrid_Exception("Invalid parameter! Please return to the login page and try again.");
- }
-
- try {
- Hybrid_Logger::info("Endpoint: call adapter [{$provider_id}] loginFinish() ");
- $hauth->adapter->loginFinish();
- } catch (Exception $e) {
- Hybrid_Logger::error("Exception:" . $e->getMessage(), $e);
- Hybrid_Error::setError($e->getMessage(), $e->getCode(), $e->getTraceAsString(), $e->getPrevious());
-
- $hauth->adapter->setUserUnconnected();
- }
-
- Hybrid_Logger::info("Endpoint: job done. return to callback url.");
-
- $hauth->returnToCallbackUrl();
- die();
- }
-
- /**
- * Initializes authentication
- * @throws Hybrid_Exception
- */
- protected function authInit() {
- if (!$this->initDone) {
- $this->initDone = true;
-
- // Init Hybrid_Auth
- try {
- if (!class_exists("Hybrid_Storage", false)) {
- require_once realpath(dirname(__FILE__)) . "/Storage.php";
- }
- if (!class_exists("Hybrid_Exception", false)) {
- require_once realpath(dirname(__FILE__)) . "/Exception.php";
- }
- if (!class_exists("Hybrid_Logger", false)) {
- require_once realpath(dirname(__FILE__)) . "/Logger.php";
- }
-
- $storage = new Hybrid_Storage();
-
- // Check if Hybrid_Auth session already exist
- if (!$storage->config("CONFIG")) {
- throw new Hybrid_Exception("You cannot access this page directly.");
- }
-
- Hybrid_Auth::initialize($storage->config("CONFIG"));
- } catch (Exception $e) {
- Hybrid_Logger::error("Endpoint: Error while trying to init Hybrid_Auth: " . $e->getMessage());
- throw new Hybrid_Exception( "Endpoint: Error while trying to init Hybrid_Auth: " . $e->getMessage(), $e->getCode(), $e );
- }
- }
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/Error.php b/milfs/librerias/hybridauth/Hybrid/Error.php
deleted file mode 100644
index 7013b49..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Error.php
+++ /dev/null
@@ -1,88 +0,0 @@
-set("hauth_session.error.status", 1);
- Hybrid_Auth::storage()->set("hauth_session.error.message", $message);
- Hybrid_Auth::storage()->set("hauth_session.error.code", $code);
- Hybrid_Auth::storage()->set("hauth_session.error.trace", $trace);
- Hybrid_Auth::storage()->set("hauth_session.error.previous", $previous);
- }
-
- /**
- * Clear the last error
- * @return void
- */
- public static function clearError() {
- Hybrid_Logger::info("Enter Hybrid_Error::clearError()");
-
- Hybrid_Auth::storage()->delete("hauth_session.error.status");
- Hybrid_Auth::storage()->delete("hauth_session.error.message");
- Hybrid_Auth::storage()->delete("hauth_session.error.code");
- Hybrid_Auth::storage()->delete("hauth_session.error.trace");
- Hybrid_Auth::storage()->delete("hauth_session.error.previous");
- }
-
- /**
- * Checks to see if there is a an error.
- * @return boolean true if there is an error.
- */
- public static function hasError() {
- return (bool) Hybrid_Auth::storage()->get("hauth_session.error.status");
- }
-
- /**
- * Return error message
- * @return string
- */
- public static function getErrorMessage() {
- return Hybrid_Auth::storage()->get("hauth_session.error.message");
- }
-
- /**
- * Return error code
- * @return int
- */
- public static function getErrorCode() {
- return Hybrid_Auth::storage()->get("hauth_session.error.code");
- }
-
- /**
- * Return string detailed error backtrace as string
- * @return string
- */
- public static function getErrorTrace() {
- return Hybrid_Auth::storage()->get("hauth_session.error.trace");
- }
-
- /**
- * Detailed error backtrace as string
- * @return string
- */
- public static function getErrorPrevious() {
- return Hybrid_Auth::storage()->get("hauth_session.error.previous");
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/Exception.php b/milfs/librerias/hybridauth/Hybrid/Exception.php
deleted file mode 100644
index 8c8c2d1..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Exception.php
+++ /dev/null
@@ -1,17 +0,0 @@
-format(DATE_ATOM),
- $message,
- print_r($object, true) . PHP_EOL,
- )), FILE_APPEND
- );
- }
- }
-
- /**
- * Logs an info message
- *
- * @param string $message Info message
- * @return void
- */
- public static function info($message) {
- if (in_array(Hybrid_Auth::$config["debug_mode"], array(true, 'info'), true)) {
- $dt = new DateTime('now', new DateTimeZone( 'UTC' ));
- file_put_contents(Hybrid_Auth::$config["debug_file"], implode(' -- ', array(
- "INFO",
- $_SERVER['REMOTE_ADDR'],
- $dt->format(DATE_ATOM),
- $message . PHP_EOL,
- )), FILE_APPEND);
- }
- }
-
- /**
- * Logs an error message with an object dump
- *
- * @param string $message Error message
- * @param stdClass $object Object being debugged
- * @return void
- */
- public static function error($message, $object = null) {
- if (isset(Hybrid_Auth::$config["debug_mode"]) && in_array(Hybrid_Auth::$config["debug_mode"], array(true, 'info', 'error'), true)) {
- $dt = new DateTime('now', new DateTimeZone( 'UTC' ));
- file_put_contents(Hybrid_Auth::$config["debug_file"], implode(' -- ', array(
- 'ERROR',
- $_SERVER['REMOTE_ADDR'],
- $dt->format(DATE_ATOM),
- $message,
- print_r($object, true) . PHP_EOL
- )), FILE_APPEND);
- }
- }
-
- /**
- * Dumps the data in the way suitable to be output in log files for debug purposes
- *
- * @param mixed $data
- *
- * @return string
- */
- public static function dumpData($data) {
- return var_export($data, true);
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/Provider_Adapter.php b/milfs/librerias/hybridauth/Hybrid/Provider_Adapter.php
deleted file mode 100644
index 7809f6a..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Provider_Adapter.php
+++ /dev/null
@@ -1,321 +0,0 @@
-id = $id;
- $this->params = $params;
- $this->id = $this->getProviderCiId($this->id);
- $this->config = $this->getConfigById($this->id);
-
- # check the IDp id
- if (!$this->id) {
- throw new Exception("No provider ID specified.", 2);
- }
-
- # check the IDp config
- if (!$this->config) {
- throw new Exception("Unknown Provider ID, check your configuration file.", 3);
- }
-
- # check the IDp adapter is enabled
- if (!$this->config["enabled"]) {
- throw new Exception("The provider '{$this->id}' is not enabled.", 3);
- }
-
- # include the adapter wrapper
- if (isset($this->config["wrapper"]) && is_array($this->config["wrapper"])) {
- if (isset($this->config["wrapper"]["path"])) {
- require_once $this->config["wrapper"]["path"];
- }
-
- if (!class_exists($this->config["wrapper"]["class"])) {
- throw new Exception("Unable to load the adapter class.", 3);
- }
-
- $this->wrapper = $this->config["wrapper"]["class"];
- } else {
- require_once Hybrid_Auth::$config["path_providers"] . $this->id . ".php";
-
- $this->wrapper = "Hybrid_Providers_" . $this->id;
- }
-
- # create the adapter instance, and pass the current params and config
- $this->adapter = new $this->wrapper($this->id, $this->config, $this->params);
-
- return $this;
- }
-
- /**
- * Hybrid_Provider_Adapter::login(), prepare the user session and the authentication request
- * for index.php
- * @return void
- * @throw Exception
- */
- function login() {
- Hybrid_Logger::info("Enter Hybrid_Provider_Adapter::login( {$this->id} ) ");
-
- if (!$this->adapter) {
- throw new Exception("Hybrid_Provider_Adapter::login() should not directly used.");
- }
-
- // clear all unneeded params
- foreach (Hybrid_Auth::$config["providers"] as $idpid => $params) {
- Hybrid_Auth::storage()->delete("hauth_session.{$idpid}.hauth_return_to");
- Hybrid_Auth::storage()->delete("hauth_session.{$idpid}.hauth_endpoint");
- Hybrid_Auth::storage()->delete("hauth_session.{$idpid}.id_provider_params");
- }
-
- // make a fresh start
- $this->logout();
-
- # get hybridauth base url
- if (empty(Hybrid_Auth::$config["base_url"])) {
- // the base url wasn't provide, so we must use the current
- // url (which makes sense actually)
- $url = empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off' ? 'http' : 'https';
- $url .= '://' . $_SERVER['HTTP_HOST'];
- $url .= $_SERVER['REQUEST_URI'];
- $HYBRID_AUTH_URL_BASE = $url;
- } else {
- $HYBRID_AUTH_URL_BASE = Hybrid_Auth::$config["base_url"];
- }
-
- // make sure params is array
- if (!is_array($this->params)) {
- $this->params = array();
- }
-
- # we make use of session_id() as storage hash to identify the current user
- # using session_regenerate_id() will be a problem, but ..
- $this->params["hauth_token"] = session_id();
-
- # set request timestamp
- $this->params["hauth_time"] = time();
-
- # for default HybridAuth endpoint url hauth_login_start_url
- # auth.start required the IDp ID
- # auth.time optional login request timestamp
- $this->params["login_start"] = $HYBRID_AUTH_URL_BASE . ( strpos($HYBRID_AUTH_URL_BASE, '?') ? '&' : '?' ) . "hauth.start={$this->id}&hauth.time={$this->params["hauth_time"]}";
-
- # for default HybridAuth endpoint url hauth_login_done_url
- # auth.done required the IDp ID
- $this->params["login_done"] = $HYBRID_AUTH_URL_BASE . ( strpos($HYBRID_AUTH_URL_BASE, '?') ? '&' : '?' ) . "hauth.done={$this->id}";
-
- if (isset($this->params["hauth_return_to"])) {
- Hybrid_Auth::storage()->set("hauth_session.{$this->id}.hauth_return_to", $this->params["hauth_return_to"]);
- }
- if (isset($this->params["login_done"])) {
- Hybrid_Auth::storage()->set("hauth_session.{$this->id}.hauth_endpoint", $this->params["login_done"]);
- }
- Hybrid_Auth::storage()->set("hauth_session.{$this->id}.id_provider_params", $this->params);
-
- // store config to be used by the end point
- Hybrid_Auth::storage()->config("CONFIG", Hybrid_Auth::$config);
-
- // move on
- Hybrid_Logger::debug("Hybrid_Provider_Adapter::login( {$this->id} ), redirect the user to login_start URL.");
-
- Hybrid_Auth::redirect($this->params["login_start"]);
- }
-
- /**
- * Let hybridauth forget all about the user for the current provider
- * @return bool
- */
- function logout() {
- $this->adapter->logout();
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Return true if the user is connected to the current provider
- * @return bool
- */
- public function isUserConnected() {
- return $this->adapter->isUserConnected();
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Call adapter methods defined in the adapter model:
- * getUserProfile()
- * getUserContacts()
- * getUserActivity()
- * setUserStatus()
- *
- * @param string $name Method name
- * @param array $arguments Call arguments
- * @return mixed
- * @throws Exception
- */
- public function __call($name, $arguments) {
- Hybrid_Logger::info("Enter Hybrid_Provider_Adapter::$name(), Provider: {$this->id}");
-
- if (!$this->isUserConnected()) {
- throw new Exception("User not connected to the provider {$this->id}.", 7);
- }
-
- if (!method_exists($this->adapter, $name)) {
- throw new Exception("Call to undefined function Hybrid_Providers_{$this->id}::$name().");
- }
-
- $counter = count($arguments);
- if ($counter == 1) {
- return $this->adapter->$name($arguments[0]);
- } elseif ($counter == 2) {
- return $this->adapter->$name($arguments[0], $arguments[1]);
- } else {
- return $this->adapter->$name();
- }
- }
-
- /**
- * If the user is connected, then return the access_token and access_token_secret
- * if the provider api use oauth
- *
- *
- * array(
- * 'access_token' => '',
- * 'access_token_secret' => '',
- * 'refresh_token' => '',
- * 'expires_in' => '',
- * 'expires_at' => '',
- * )
- *
- * @return array
- */
- public function getAccessToken() {
- if (!$this->adapter->isUserConnected()) {
- Hybrid_Logger::error("User not connected to the provider.");
- throw new Exception("User not connected to the provider.", 7);
- }
-
- return array(
- "access_token" => $this->adapter->token("access_token"), // OAuth access token
- "access_token_secret" => $this->adapter->token("access_token_secret"), // OAuth access token secret
- "refresh_token" => $this->adapter->token("refresh_token"), // OAuth refresh token
- "expires_in" => $this->adapter->token("expires_in"), // OPTIONAL. The duration in seconds of the access token lifetime
- "expires_at" => $this->adapter->token("expires_at"), // OPTIONAL. Timestamp when the access_token expire. if not provided by the social api, then it should be calculated: expires_at = now + expires_in
- );
- }
-
- /**
- * Naive getter of the current connected IDp API client
- * @return stdClass
- * @throws Exception
- */
- function api() {
- if (!$this->adapter->isUserConnected()) {
- Hybrid_Logger::error("User not connected to the provider.");
-
- throw new Exception("User not connected to the provider.", 7);
- }
- return $this->adapter->api;
- }
-
- /**
- * Redirect the user to hauth_return_to (the callback url)
- * @return void
- */
- function returnToCallbackUrl() {
- // get the stored callback url
- $callback_url = Hybrid_Auth::storage()->get("hauth_session.{$this->id}.hauth_return_to");
-
- // remove some unneeded stored data
- Hybrid_Auth::storage()->delete("hauth_session.{$this->id}.hauth_return_to");
- Hybrid_Auth::storage()->delete("hauth_session.{$this->id}.hauth_endpoint");
- Hybrid_Auth::storage()->delete("hauth_session.{$this->id}.id_provider_params");
-
- // back to home
- Hybrid_Auth::redirect($callback_url);
- }
-
- /**
- * Return the provider config by id
- *
- * @param string $id Config key
- * @return mixed
- */
- function getConfigById($id) {
- if (isset(Hybrid_Auth::$config["providers"][$id])) {
- return Hybrid_Auth::$config["providers"][$id];
- }
- return null;
- }
-
- /**
- * Return the provider config by id; case insensitive
- *
- * @param string $id Provider id
- * @return mixed
- */
- function getProviderCiId($id) {
- foreach (Hybrid_Auth::$config["providers"] as $idpid => $params) {
- if (strtolower($idpid) == strtolower($id)) {
- return $idpid;
- }
- }
- return null;
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/Provider_Model.php b/milfs/librerias/hybridauth/Hybrid/Provider_Model.php
deleted file mode 100644
index d044bd5..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Provider_Model.php
+++ /dev/null
@@ -1,244 +0,0 @@
-params = Hybrid_Auth::storage()->get("hauth_session.$providerId.id_provider_params");
- } else {
- $this->params = $params;
- }
-
- // idp id
- $this->providerId = $providerId;
-
- // set HybridAuth endpoint for this provider
- $this->endpoint = Hybrid_Auth::storage()->get("hauth_session.$providerId.hauth_endpoint");
-
- // idp config
- $this->config = $config;
-
- // new user instance
- $this->user = new Hybrid_User();
- $this->user->providerId = $providerId;
-
- // initialize the current provider adapter
- $this->initialize();
-
- Hybrid_Logger::debug("Hybrid_Provider_Model::__construct( $providerId ) initialized. dump current adapter instance: ", serialize($this));
- }
-
- /**
- * IDp wrappers initializer
- *
- * The main job of wrappers initializer is to performs (depend on the IDp api client it self):
- * - include some libs needed by this provider,
- * - check IDp key and secret,
- * - set some needed parameters (stored in $this->params) by this IDp api client
- * - create and setup an instance of the IDp api client on $this->api
- *
- * @return void
- * @throws Exception
- */
- abstract protected function initialize();
-
- /**
- * Begin login
- *
- * @return void
- * @throws Exception
- */
- abstract protected function loginBegin();
-
- /**
- * Finish login
- * @return void
- * @throws Exception
- */
- abstract protected function loginFinish();
-
- /**
- * Generic logout, just erase current provider adapter stored data to let Hybrid_Auth all forget about it
- * @return bool
- */
- function logout() {
- Hybrid_Logger::info("Enter [{$this->providerId}]::logout()");
- $this->clearTokens();
- return true;
- }
-
- /**
- * Grab the user profile from the IDp api client
- * @return Hybrid_User_Profile
- * @throw Exception
- */
- function getUserProfile() {
- Hybrid_Logger::error("HybridAuth do not provide users contacts list for {$this->providerId} yet.");
- throw new Exception("Provider does not support this feature.", 8);
- }
-
- /**
- * Load the current logged in user contacts list from the IDp api client
- * @return Hybrid_User_Contact[]
- * @throws Exception
- */
- function getUserContacts() {
- Hybrid_Logger::error("HybridAuth do not provide users contacts list for {$this->providerId} yet.");
- throw new Exception("Provider does not support this feature.", 8);
- }
-
- /**
- * Return the user activity stream
- * @return Hybrid_User_Activity[]
- * @throws Exception
- */
- function getUserActivity($stream) {
- Hybrid_Logger::error("HybridAuth do not provide user's activity stream for {$this->providerId} yet.");
- throw new Exception("Provider does not support this feature.", 8);
- }
-
- /**
- * Set user status
- * @return mixed Provider response
- * @throws Exception
- */
- function setUserStatus($status) {
- Hybrid_Logger::error("HybridAuth do not provide user's activity stream for {$this->providerId} yet.");
- throw new Exception("Provider does not support this feature.", 8);
- }
-
- /**
- * Return the user status
- * @return mixed Provider response
- * @throws Exception
- */
- function getUserStatus($statusid) {
- Hybrid_Logger::error("HybridAuth do not provide user's status for {$this->providerId} yet.");
- throw new Exception("Provider does not support this feature.", 8);
- }
-
- /**
- * Return true if the user is connected to the current provider
- * @return bool
- */
- public function isUserConnected() {
- return (bool) Hybrid_Auth::storage()->get("hauth_session.{$this->providerId}.is_logged_in");
- }
-
- /**
- * Set user to connected
- * @return void
- */
- public function setUserConnected() {
- Hybrid_Logger::info("Enter [{$this->providerId}]::setUserConnected()");
- Hybrid_Auth::storage()->set("hauth_session.{$this->providerId}.is_logged_in", 1);
- }
-
- /**
- * Set user to unconnected
- * @return void
- */
- public function setUserUnconnected() {
- Hybrid_Logger::info("Enter [{$this->providerId}]::setUserUnconnected()");
- Hybrid_Auth::storage()->set("hauth_session.{$this->providerId}.is_logged_in", 0);
- }
-
- /**
- * Get or set a token
- * @return string
- */
- public function token($token, $value = null) {
- if ($value === null) {
- return Hybrid_Auth::storage()->get("hauth_session.{$this->providerId}.token.$token");
- } else {
- Hybrid_Auth::storage()->set("hauth_session.{$this->providerId}.token.$token", $value);
- }
- }
-
- /**
- * Delete a stored token
- * @return void
- */
- public function deleteToken($token) {
- Hybrid_Auth::storage()->delete("hauth_session.{$this->providerId}.token.$token");
- }
-
- /**
- * Clear all existent tokens for this provider
- * @return void
- */
- public function clearTokens() {
- Hybrid_Auth::storage()->deleteMatch("hauth_session.{$this->providerId}.");
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/Provider_Model_OAuth1.php b/milfs/librerias/hybridauth/Hybrid/Provider_Model_OAuth1.php
deleted file mode 100644
index 23fd2d3..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Provider_Model_OAuth1.php
+++ /dev/null
@@ -1,174 +0,0 @@
- "OK: Success!",
- 304 => "Not Modified: There was no new data to return.",
- 400 => "Bad Request: The request was invalid.",
- 401 => "Unauthorized.",
- 403 => "Forbidden: The request is understood, but it has been refused.",
- 404 => "Not Found: The URI requested is invalid or the resource requested does not exists.",
- 406 => "Not Acceptable.",
- 500 => "Internal Server Error: Something is broken.",
- 502 => "Bad Gateway.",
- 503 => "Service Unavailable."
- );
-
- if (!$code && $this->api) {
- $code = $this->api->http_code;
- }
-
- if (isset($http_status_codes[$code])) {
- return $code . " " . $http_status_codes[$code];
- }
- }
-
- /**
- * {@inheritdoc}
- */
- function initialize() {
- // 1 - check application credentials
- if (!$this->config["keys"]["key"] || !$this->config["keys"]["secret"]) {
- throw new Exception("Your application key and secret are required in order to connect to {$this->providerId}.", 4);
- }
-
- // 2 - include OAuth lib and client
- if (! class_exists('OAuthConsumer') ) {
- require_once Hybrid_Auth::$config["path_libraries"] . "OAuth/OAuth.php";
- }
- require_once Hybrid_Auth::$config["path_libraries"] . "OAuth/OAuth1Client.php";
-
- // 3.1 - setup access_token if any stored
- if ($this->token("access_token")) {
- $this->api = new OAuth1Client(
- $this->config["keys"]["key"], $this->config["keys"]["secret"], $this->token("access_token"), $this->token("access_token_secret")
- );
- }
-
- // 3.2 - setup request_token if any stored, in order to exchange with an access token
- elseif ($this->token("request_token")) {
- $this->api = new OAuth1Client(
- $this->config["keys"]["key"], $this->config["keys"]["secret"], $this->token("request_token"), $this->token("request_token_secret")
- );
- }
-
- // 3.3 - instanciate OAuth client with client credentials
- else {
- $this->api = new OAuth1Client($this->config["keys"]["key"], $this->config["keys"]["secret"]);
- }
-
- // Set curl proxy if exist
- if (isset(Hybrid_Auth::$config["proxy"])) {
- $this->api->curl_proxy = Hybrid_Auth::$config["proxy"];
- }
- }
-
- /**
- * {@inheritdoc}
- */
- function loginBegin() {
- $tokens = $this->api->requestToken($this->endpoint);
-
- // request tokens as received from provider
- $this->request_tokens_raw = $tokens;
-
- // check the last HTTP status code returned
- if ($this->api->http_code != 200) {
- throw new Exception("Authentication failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus($this->api->http_code), 5);
- }
-
- if (!isset($tokens["oauth_token"])) {
- throw new Exception("Authentication failed! {$this->providerId} returned an invalid oauth token.", 5);
- }
-
- $this->token("request_token", $tokens["oauth_token"]);
- $this->token("request_token_secret", $tokens["oauth_token_secret"]);
-
- # redirect the user to the provider authentication url
- Hybrid_Auth::redirect($this->api->authorizeUrl($tokens));
- }
-
- /**
- * {@inheritdoc}
- */
- function loginFinish() {
- $oauth_token = (array_key_exists('oauth_token', $_REQUEST)) ? $_REQUEST['oauth_token'] : "";
- $oauth_verifier = (array_key_exists('oauth_verifier', $_REQUEST)) ? $_REQUEST['oauth_verifier'] : "";
-
- if (!$oauth_token || !$oauth_verifier) {
- throw new Exception("Authentication failed! {$this->providerId} returned an invalid oauth verifier.", 5);
- }
-
- // request an access token
- $tokens = $this->api->accessToken($oauth_verifier);
-
- // access tokens as received from provider
- $this->access_tokens_raw = $tokens;
-
- // check the last HTTP status code returned
- if ($this->api->http_code != 200) {
- throw new Exception("Authentication failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus($this->api->http_code), 5);
- }
-
- // we should have an access_token, or else, something has gone wrong
- if (!isset($tokens["oauth_token"])) {
- throw new Exception("Authentication failed! {$this->providerId} returned an invalid access token.", 5);
- }
-
- // we no more need to store request tokens
- $this->deleteToken("request_token");
- $this->deleteToken("request_token_secret");
-
- // store access_token for later user
- $this->token("access_token", $tokens['oauth_token']);
- $this->token("access_token_secret", $tokens['oauth_token_secret']);
-
- // set user as logged in to the current provider
- $this->setUserConnected();
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/Provider_Model_OAuth2.php b/milfs/librerias/hybridauth/Hybrid/Provider_Model_OAuth2.php
deleted file mode 100644
index 6159b86..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Provider_Model_OAuth2.php
+++ /dev/null
@@ -1,184 +0,0 @@
- "OK: Success!",
- 304 => "Not Modified: There was no new data to return.",
- 400 => "Bad Request: The request was invalid.",
- 401 => "Unauthorized.",
- 403 => "Forbidden: The request is understood, but it has been refused.",
- 404 => "Not Found: The URI requested is invalid or the resource requested does not exists.",
- 406 => "Not Acceptable.",
- 500 => "Internal Server Error: Something is broken.",
- 502 => "Bad Gateway.",
- 503 => "Service Unavailable."
- );
-
- if (!$code && $this->api) {
- $code = $this->api->http_code;
- }
-
- if (isset($http_status_codes[$code])) {
- return $code . " " . $http_status_codes[$code];
- }
- }
-
- /**
- * Adapter initializer
- */
- function initialize() {
- if (!$this->config["keys"]["id"] || !$this->config["keys"]["secret"]) {
- throw new Exception("Your application id and secret are required in order to connect to {$this->providerId}.", 4);
- }
-
- // override requested scope
- if (isset($this->config["scope"]) && !empty($this->config["scope"])) {
- $this->scope = $this->config["scope"];
- }
-
- // include OAuth2 client
- require_once Hybrid_Auth::$config["path_libraries"] . "OAuth/OAuth2Client.php";
-
- // create a new OAuth2 client instance
- $this->api = new OAuth2Client($this->config["keys"]["id"], $this->config["keys"]["secret"], $this->endpoint, $this->compressed);
-
- // If we have an access token, set it
- if ($this->token("access_token")) {
- $this->api->access_token = $this->token("access_token");
- $this->api->refresh_token = $this->token("refresh_token");
- $this->api->access_token_expires_in = $this->token("expires_in");
- $this->api->access_token_expires_at = $this->token("expires_at");
- }
-
- // Set curl proxy if exist
- if (isset(Hybrid_Auth::$config["proxy"])) {
- $this->api->curl_proxy = Hybrid_Auth::$config["proxy"];
- }
- }
-
- /**
- * {@inheritdoc}
- */
- function loginBegin() {
- // redirect the user to the provider authentication url
- Hybrid_Auth::redirect($this->api->authorizeUrl(array("scope" => $this->scope)));
- }
-
- /**
- * {@inheritdoc}
- */
- function loginFinish() {
- $error = (array_key_exists('error', $_REQUEST)) ? $_REQUEST['error'] : "";
-
- // check for errors
- if ($error) {
- throw new Exception("Authentication failed! {$this->providerId} returned an error: $error", 5);
- }
-
- // try to authenticate user
- $code = (array_key_exists('code', $_REQUEST)) ? $_REQUEST['code'] : "";
-
- try {
- $this->api->authenticate($code);
- } catch (Exception $e) {
- throw new Exception("User profile request failed! {$this->providerId} returned an error: $e", 6);
- }
-
- // check if authenticated
- if (!$this->api->access_token) {
- throw new Exception("Authentication failed! {$this->providerId} returned an invalid access token.", 5);
- }
-
- // store tokens
- $this->token("access_token", $this->api->access_token);
- $this->token("refresh_token", $this->api->refresh_token);
- $this->token("expires_in", $this->api->access_token_expires_in);
- $this->token("expires_at", $this->api->access_token_expires_at);
-
- // set user connected locally
- $this->setUserConnected();
- }
-
- /**
- * {@inheritdoc}
- */
- function refreshToken() {
- // have an access token?
- if ($this->api->access_token) {
-
- // have to refresh?
- if ($this->api->refresh_token && $this->api->access_token_expires_at) {
-
- // expired?
- if ($this->api->access_token_expires_at <= time()) {
- $response = $this->api->refreshToken(array("refresh_token" => $this->api->refresh_token));
-
- if (!isset($response->access_token) || !$response->access_token) {
- // set the user as disconnected at this point and throw an exception
- $this->setUserUnconnected();
-
- throw new Exception("The Authorization Service has return an invalid response while requesting a new access token. " . (string) $response->error);
- }
-
- // set new access_token
- $this->api->access_token = $response->access_token;
-
- if (isset($response->refresh_token))
- $this->api->refresh_token = $response->refresh_token;
-
- if (isset($response->expires_in)) {
- $this->api->access_token_expires_in = $response->expires_in;
-
- // even given by some idp, we should calculate this
- $this->api->access_token_expires_at = time() + $response->expires_in;
- }
- }
- }
-
- // re store tokens
- $this->token("access_token", $this->api->access_token);
- $this->token("refresh_token", $this->api->refresh_token);
- $this->token("expires_in", $this->api->access_token_expires_in);
- $this->token("expires_at", $this->api->access_token_expires_at);
- }
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/Provider_Model_OpenID.php b/milfs/librerias/hybridauth/Hybrid/Provider_Model_OpenID.php
deleted file mode 100644
index 08fa36c..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Provider_Model_OpenID.php
+++ /dev/null
@@ -1,170 +0,0 @@
-public $openidIdentifier = "";
- *
- * Hybrid_Provider_Model_OpenID use LightOpenID lib which can be found on
- * Hybrid/thirdparty/OpenID/LightOpenID.php
- */
-class Hybrid_Provider_Model_OpenID extends Hybrid_Provider_Model {
-
- /**
- * Provider API client
- * @var LightOpenID
- */
- public $api = null;
-
- /**
- * Openid provider identifier
- * @var string
- */
- public $openidIdentifier = "";
-
- /**
- * {@inheritdoc}
- */
- function initialize() {
- if (isset($this->params["openid_identifier"])) {
- $this->openidIdentifier = $this->params["openid_identifier"];
- }
-
- // include LightOpenID lib
- require_once Hybrid_Auth::$config["path_libraries"] . "OpenID/LightOpenID.php";
-
- // An error was occurring when proxy wasn't set. Not sure where proxy was meant to be set/initialized.
- Hybrid_Auth::$config['proxy'] = isset(Hybrid_Auth::$config['proxy']) ? Hybrid_Auth::$config['proxy'] : '';
-
- $hostPort = parse_url(Hybrid_Auth::$config["base_url"], PHP_URL_PORT);
- $hostUrl = parse_url(Hybrid_Auth::$config["base_url"], PHP_URL_HOST);
-
- // Check for port on url
- if ($hostPort) {
- $hostUrl .= ':' . $hostPort;
- }
-
- $this->api = new LightOpenID($hostUrl, Hybrid_Auth::$config["proxy"]);
- }
-
- /**
- * {@inheritdoc}
- */
- function loginBegin() {
- if (empty($this->openidIdentifier)) {
- throw new Exception("OpenID adapter require the identity provider identifier 'openid_identifier' as an extra parameter.", 4);
- }
-
- $this->api->identity = $this->openidIdentifier;
- $this->api->returnUrl = $this->endpoint;
- $this->api->required = array(
- 'namePerson/first',
- 'namePerson/last',
- 'namePerson/friendly',
- 'namePerson',
- 'contact/email',
- 'birthDate',
- 'birthDate/birthDay',
- 'birthDate/birthMonth',
- 'birthDate/birthYear',
- 'person/gender',
- 'pref/language',
- 'contact/postalCode/home',
- 'contact/city/home',
- 'contact/country/home',
- 'media/image/default',
- );
-
- # redirect the user to the provider authentication url
- Hybrid_Auth::redirect($this->api->authUrl());
- }
-
- /**
- * {@inheritdoc}
- */
- function loginFinish() {
- # if user don't grant access of their data to your site, halt with an Exception
- if ($this->api->mode == 'cancel') {
- throw new Exception("Authentication failed! User has canceled authentication!", 5);
- }
-
- # if something goes wrong
- if (!$this->api->validate()) {
- throw new Exception("Authentication failed. Invalid request received!", 5);
- }
-
- # fetch received user data
- $response = $this->api->getAttributes();
-
- # store the user profile
- $this->user->profile->identifier = $this->api->identity;
-
- $this->user->profile->firstName = (array_key_exists("namePerson/first", $response)) ? $response["namePerson/first"] : "";
- $this->user->profile->lastName = (array_key_exists("namePerson/last", $response)) ? $response["namePerson/last"] : "";
- $this->user->profile->displayName = (array_key_exists("namePerson", $response)) ? $response["namePerson"] : "";
- $this->user->profile->email = (array_key_exists("contact/email", $response)) ? $response["contact/email"] : "";
- $this->user->profile->language = (array_key_exists("pref/language", $response)) ? $response["pref/language"] : "";
- $this->user->profile->country = (array_key_exists("contact/country/home", $response)) ? $response["contact/country/home"] : "";
- $this->user->profile->zip = (array_key_exists("contact/postalCode/home", $response)) ? $response["contact/postalCode/home"] : "";
- $this->user->profile->gender = (array_key_exists("person/gender", $response)) ? $response["person/gender"] : "";
- $this->user->profile->photoURL = (array_key_exists("media/image/default", $response)) ? $response["media/image/default"] : "";
-
- $this->user->profile->birthDay = (array_key_exists("birthDate/birthDay", $response)) ? $response["birthDate/birthDay"] : "";
- $this->user->profile->birthMonth = (array_key_exists("birthDate/birthMonth", $response)) ? $response["birthDate/birthMonth"] : "";
- $this->user->profile->birthYear = (array_key_exists("birthDate/birthDate", $response)) ? $response["birthDate/birthDate"] : "";
-
- if (isset($response['namePerson/friendly']) && !empty($response['namePerson/friendly']) && !$this->user->profile->displayName) {
- $this->user->profile->displayName = $response["namePerson/friendly"];
- }
-
- if (isset($response['birthDate']) && !empty($response['birthDate']) && !$this->user->profile->birthDay) {
- list( $birthday_year, $birthday_month, $birthday_day ) = $response['birthDate'];
-
- $this->user->profile->birthDay = (int) $birthday_day;
- $this->user->profile->birthMonth = (int) $birthday_month;
- $this->user->profile->birthYear = (int) $birthday_year;
- }
-
- if (!$this->user->profile->displayName) {
- $this->user->profile->displayName = trim($this->user->profile->firstName . " " . $this->user->profile->lastName);
- }
-
- if ($this->user->profile->gender == "f") {
- $this->user->profile->gender = "female";
- }
-
- if ($this->user->profile->gender == "m") {
- $this->user->profile->gender = "male";
- }
-
- // set user as logged in
- $this->setUserConnected();
-
- // with openid providers we get the user profile only once, so store it
- Hybrid_Auth::storage()->set("hauth_session.{$this->providerId}.user", $this->user);
- }
-
- /**
- * {@inheritdoc}
- */
- function getUserProfile() {
- // try to get the user profile from stored data
- $this->user = Hybrid_Auth::storage()->get("hauth_session.{$this->providerId}.user");
-
- // if not found
- if (!is_object($this->user)) {
- throw new Exception("User profile request failed! User is not connected to {$this->providerId} or his session has expired.", 6);
- }
-
- return $this->user->profile;
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/Providers/AOL.php b/milfs/librerias/hybridauth/Hybrid/Providers/AOL.php
deleted file mode 100644
index 19028c0..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Providers/AOL.php
+++ /dev/null
@@ -1,18 +0,0 @@
-config["keys"]["id"] || !$this->config["keys"]["secret"]) {
- throw new Exception("Your application id and secret are required in order to connect to {$this->providerId}.", 4);
- }
-
- if (!class_exists('FacebookApiException', false)) {
- require_once Hybrid_Auth::$config["path_libraries"] . "Facebook/base_facebook.php";
- require_once Hybrid_Auth::$config["path_libraries"] . "Facebook/facebook.php";
- }
-
- if (isset(Hybrid_Auth::$config["proxy"])) {
- BaseFacebook::$CURL_OPTS[CURLOPT_PROXY] = Hybrid_Auth::$config["proxy"];
- }
-
- $trustForwarded = isset($this->config['trustForwarded']) ? (bool) $this->config['trustForwarded'] : false;
- $this->api = new Facebook(array('appId' => $this->config["keys"]["id"], 'secret' => $this->config["keys"]["secret"], 'trustForwarded' => $trustForwarded));
-
- if ($this->token("access_token")) {
- $this->api->setAccessToken($this->token("access_token"));
- $this->api->setExtendedAccessToken();
- $access_token = $this->api->getAccessToken();
-
- if ($access_token) {
- $this->token("access_token", $access_token);
- $this->api->setAccessToken($access_token);
- }
-
- $this->api->setAccessToken($this->token("access_token"));
- }
-
- $this->api->getUser();
- }
-
- /**
- * {@inheritdoc}
- */
- function loginBegin() {
- $parameters = array("scope" => $this->scope, "redirect_uri" => $this->endpoint, "display" => "page");
- $optionals = array("scope", "redirect_uri", "display", "auth_type");
-
- foreach ($optionals as $parameter) {
- if (isset($this->config[$parameter]) && !empty($this->config[$parameter])) {
- $parameters[$parameter] = $this->config[$parameter];
-
- //If the auth_type parameter is used, we need to generate a nonce and include it as a parameter
- if ($parameter == "auth_type") {
- $nonce = md5(uniqid(mt_rand(), true));
- $parameters['auth_nonce'] = $nonce;
-
- Hybrid_Auth::storage()->set('fb_auth_nonce', $nonce);
- }
- }
- }
-
- if (isset($this->config['force']) && $this->config['force'] === true) {
- $parameters['auth_type'] = 'reauthenticate';
- $parameters['auth_nonce'] = md5(uniqid(mt_rand(), true));
-
- Hybrid_Auth::storage()->set('fb_auth_nonce', $parameters['auth_nonce']);
- }
-
- // get the login url
- $url = $this->api->getLoginUrl($parameters);
-
- // redirect to facebook
- Hybrid_Auth::redirect($url);
- }
-
- /**
- * {@inheritdoc}
- */
- function loginFinish() {
- // in case we get error_reason=user_denied&error=access_denied
- if (isset($_REQUEST['error']) && $_REQUEST['error'] == "access_denied") {
- throw new Exception("Authentication failed! The user denied your request.", 5);
- }
-
- // in case we are using iOS/Facebook reverse authentication
- if (isset($_REQUEST['access_token'])) {
- $this->token("access_token", $_REQUEST['access_token']);
- $this->api->setAccessToken($this->token("access_token"));
- $this->api->setExtendedAccessToken();
- $access_token = $this->api->getAccessToken();
-
- if ($access_token) {
- $this->token("access_token", $access_token);
- $this->api->setAccessToken($access_token);
- }
-
- $this->api->setAccessToken($this->token("access_token"));
- }
-
-
- // if auth_type is used, then an auth_nonce is passed back, and we need to check it.
- if (isset($_REQUEST['auth_nonce'])) {
-
- $nonce = Hybrid_Auth::storage()->get('fb_auth_nonce');
-
- //Delete the nonce
- Hybrid_Auth::storage()->delete('fb_auth_nonce');
-
- if ($_REQUEST['auth_nonce'] != $nonce) {
- throw new Exception("Authentication failed! Invalid nonce used for reauthentication.", 5);
- }
- }
-
- // try to get the UID of the connected user from fb, should be > 0
- if (!$this->api->getUser()) {
- throw new Exception("Authentication failed! {$this->providerId} returned an invalid user id.", 5);
- }
-
- // set user as logged in
- $this->setUserConnected();
-
- // store facebook access token
- $this->token("access_token", $this->api->getAccessToken());
- }
-
- /**
- * {@inheritdoc}
- */
- function logout() {
- $this->api->destroySession();
- parent::logout();
- }
-
- /**
- * {@inheritdoc}
- */
- function getUserProfile() {
- // request user profile from fb api
- try {
- $fields = array(
- 'id', 'name', 'first_name', 'last_name', 'link', 'website',
- 'gender', 'locale', 'about', 'email', 'hometown', 'location',
- 'birthday'
- );
-
- $data = $this->api->api('/me?fields=' . implode(',', $fields));
- } catch (FacebookApiException $e) {
- throw new Exception("User profile request failed! {$this->providerId} returned an error: {$e->getMessage()}", 6, $e);
- }
-
- // if the provider identifier is not received, we assume the auth has failed
- if (!isset($data["id"])) {
- throw new Exception("User profile request failed! {$this->providerId} api returned an invalid response: " . Hybrid_Logger::dumpData( $data ), 6);
- }
-
- # store the user profile.
- $this->user->profile->identifier = (array_key_exists('id', $data)) ? $data['id'] : "";
- $this->user->profile->username = (array_key_exists('username', $data)) ? $data['username'] : "";
- $this->user->profile->displayName = (array_key_exists('name', $data)) ? $data['name'] : "";
- $this->user->profile->firstName = (array_key_exists('first_name', $data)) ? $data['first_name'] : "";
- $this->user->profile->lastName = (array_key_exists('last_name', $data)) ? $data['last_name'] : "";
- $this->user->profile->photoURL = "https://graph.facebook.com/" . $this->user->profile->identifier . "/picture?width=150&height=150";
- $this->user->profile->coverInfoURL = "https://graph.facebook.com/" . $this->user->profile->identifier . "?fields=cover&access_token=" . $this->api->getAccessToken();
- $this->user->profile->profileURL = (array_key_exists('link', $data)) ? $data['link'] : "";
- $this->user->profile->webSiteURL = (array_key_exists('website', $data)) ? $data['website'] : "";
- $this->user->profile->gender = (array_key_exists('gender', $data)) ? $data['gender'] : "";
- $this->user->profile->language = (array_key_exists('locale', $data)) ? $data['locale'] : "";
- $this->user->profile->description = (array_key_exists('about', $data)) ? $data['about'] : "";
- $this->user->profile->email = (array_key_exists('email', $data)) ? $data['email'] : "";
- $this->user->profile->emailVerified = (array_key_exists('email', $data)) ? $data['email'] : "";
- $this->user->profile->region = (array_key_exists("location", $data) && array_key_exists("name", $data['location'])) ? $data['location']["name"] : "";
-
- if (!empty($this->user->profile->region)) {
- $regionArr = explode(',', $this->user->profile->region);
- if (count($regionArr) > 1) {
- $this->user->profile->city = trim($regionArr[0]);
- $this->user->profile->country = trim($regionArr[1]);
- }
- }
-
- if (array_key_exists('birthday', $data)) {
- list($birthday_month, $birthday_day, $birthday_year) = explode("/", $data['birthday']);
-
- $this->user->profile->birthDay = (int) $birthday_day;
- $this->user->profile->birthMonth = (int) $birthday_month;
- $this->user->profile->birthYear = (int) $birthday_year;
- }
-
- return $this->user->profile;
- }
-
- /**
- * Attempt to retrieve the url to the cover image given the coverInfoURL
- *
- * @param string $coverInfoURL coverInfoURL variable
- * @return string url to the cover image OR blank string
- */
- function getCoverURL($coverInfoURL) {
- try {
- $headers = get_headers($coverInfoURL);
- if (substr($headers[0], 9, 3) != "404") {
- $coverOBJ = json_decode(file_get_contents($coverInfoURL));
- if (array_key_exists('cover', $coverOBJ)) {
- return $coverOBJ->cover->source;
- }
- }
- } catch (Exception $e) {
-
- }
-
- return "";
- }
-
- /**
- * {@inheritdoc}
- */
- function getUserContacts() {
- $apiCall = '?fields=link,name';
- $returnedContacts = array();
- $pagedList = false;
-
- do {
- try {
- $response = $this->api->api('/me/friends' . $apiCall);
- } catch (FacebookApiException $e) {
- throw new Exception("User contacts request failed! {$this->providerId} returned an error {$e->getMessage()}", 0, $e);
- }
-
- // Prepare the next call if paging links have been returned
- if (array_key_exists('paging', $response) && array_key_exists('next', $response['paging'])) {
- $pagedList = true;
- $next_page = explode('friends', $response['paging']['next']);
- $apiCall = $next_page[1];
- } else {
- $pagedList = false;
- }
-
- // Add the new page contacts
- $returnedContacts = array_merge($returnedContacts, $response['data']);
- } while ($pagedList == true);
-
- $contacts = array();
-
- foreach ($returnedContacts as $item) {
-
- $uc = new Hybrid_User_Contact();
- $uc->identifier = (array_key_exists("id", $item)) ? $item["id"] : "";
- $uc->displayName = (array_key_exists("name", $item)) ? $item["name"] : "";
- $uc->profileURL = (array_key_exists("link", $item)) ? $item["link"] : "https://www.facebook.com/profile.php?id=" . $uc->identifier;
- $uc->photoURL = "https://graph.facebook.com/" . $uc->identifier . "/picture?width=150&height=150";
-
- $contacts[] = $uc;
- }
-
- return $contacts;
- }
-
- /**
- * Update user status
- *
- * @param mixed $status An array describing the status, or string
- * @param string $pageid (optional) User page id
- * @return array
- * @throw Exception
- */
- function setUserStatus($status, $pageid = null) {
- if (!is_array($status)) {
- $status = array('message' => $status);
- }
-
- if (is_null($pageid)) {
- $pageid = 'me';
-
- // if post on page, get access_token page
- } else {
- $access_token = null;
- foreach ($this->getUserPages(true) as $p) {
- if (isset($p['id']) && intval($p['id']) == intval($pageid)) {
- $access_token = $p['access_token'];
- break;
- }
- }
-
- if (is_null($access_token)) {
- throw new Exception("Update user page failed, page not found or not writable!");
- }
-
- $status['access_token'] = $access_token;
- }
-
- try {
- $response = $this->api->api('/' . $pageid . '/feed', 'post', $status);
- } catch (FacebookApiException $e) {
- throw new Exception("Update user status failed! {$this->providerId} returned an error {$e->getMessage()}", 0, $e);
- }
-
- return $response;
- }
-
- /**
- * {@inheridoc}
- */
- function getUserStatus($postid) {
- try {
- $postinfo = $this->api->api("/" . $postid);
- } catch (FacebookApiException $e) {
- throw new Exception("Cannot retrieve user status! {$this->providerId} returned an error: {$e->getMessage()}", 0, $e);
- }
-
- return $postinfo;
- }
-
- /**
- * {@inheridoc}
- */
- function getUserPages($writableonly = false) {
- if (( isset($this->config['scope']) && strpos($this->config['scope'], 'manage_pages') === false ) || (!isset($this->config['scope']) && strpos($this->scope, 'manage_pages') === false ))
- throw new Exception("User status requires manage_page permission!");
-
- try {
- $pages = $this->api->api("/me/accounts", 'get');
- } catch (FacebookApiException $e) {
- throw new Exception("Cannot retrieve user pages! {$this->providerId} returned an error: {$e->getMessage()}", 0, $e);
- }
-
- if (!isset($pages['data'])) {
- return array();
- }
-
- if (!$writableonly) {
- return $pages['data'];
- }
-
- $wrpages = array();
- foreach ($pages['data'] as $p) {
- if (isset($p['perms']) && in_array('CREATE_CONTENT', $p['perms'])) {
- $wrpages[] = $p;
- }
- }
-
- return $wrpages;
- }
-
- /**
- * load the user latest activity
- * - timeline : all the stream
- * - me : the user activity only
- * {@inheritdoc}
- */
- function getUserActivity($stream) {
- try {
- if ($stream == "me") {
- $response = $this->api->api('/me/feed');
- } else {
- $response = $this->api->api('/me/home');
- }
- } catch (FacebookApiException $e) {
- throw new Exception("User activity stream request failed! {$this->providerId} returned an error: {$e->getMessage()}", 0, $e);
- }
-
- if (!$response || !count($response['data'])) {
- return array();
- }
-
- $activities = array();
-
- foreach ($response['data'] as $item) {
- if ($stream == "me" && $item["from"]["id"] != $this->api->getUser()) {
- continue;
- }
-
- $ua = new Hybrid_User_Activity();
-
- $ua->id = (array_key_exists("id", $item)) ? $item["id"] : "";
- $ua->date = (array_key_exists("created_time", $item)) ? strtotime($item["created_time"]) : "";
-
- if ($item["type"] == "video") {
- $ua->text = (array_key_exists("link", $item)) ? $item["link"] : "";
- }
-
- if ($item["type"] == "link") {
- $ua->text = (array_key_exists("link", $item)) ? $item["link"] : "";
- }
-
- if (empty($ua->text) && isset($item["story"])) {
- $ua->text = (array_key_exists("link", $item)) ? $item["link"] : "";
- }
-
- if (empty($ua->text) && isset($item["message"])) {
- $ua->text = (array_key_exists("message", $item)) ? $item["message"] : "";
- }
-
- if (!empty($ua->text)) {
- $ua->user->identifier = (array_key_exists("id", $item["from"])) ? $item["from"]["id"] : "";
- $ua->user->displayName = (array_key_exists("name", $item["from"])) ? $item["from"]["name"] : "";
- $ua->user->profileURL = "https://www.facebook.com/profile.php?id=" . $ua->user->identifier;
- $ua->user->photoURL = "https://graph.facebook.com/" . $ua->user->identifier . "/picture?type=square";
-
- $activities[] = $ua;
- }
- }
-
- return $activities;
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/Providers/Foursquare.php b/milfs/librerias/hybridauth/Hybrid/Providers/Foursquare.php
deleted file mode 100644
index cfbe657..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Providers/Foursquare.php
+++ /dev/null
@@ -1,121 +0,0 @@
- array (
- * "enabled" => true,
- * "keys" => ...,
- * "params" => array( "photo_size" => "16x16" )
- * ),
- * ...
- * - list of valid photo_size values is described here https://developer.foursquare.com/docs/responses/photo.html
- * - default photo_size is 100x100
- */
-class Hybrid_Providers_Foursquare extends Hybrid_Provider_Model_OAuth2 {
-
- private static $apiVersion = array("v" => "20120610");
- private static $defPhotoSize = "100x100";
-
- /**
- * {@inheritdoc}
- */
- function initialize() {
- parent::initialize();
-
- // Provider apis end-points
- $this->api->api_base_url = "https://api.foursquare.com/v2/";
- $this->api->authorize_url = "https://foursquare.com/oauth2/authenticate";
- $this->api->token_url = "https://foursquare.com/oauth2/access_token";
-
- $this->api->sign_token_name = "oauth_token";
- }
-
- /**
- * {@inheritdoc}
- */
- function getUserProfile() {
- $data = $this->api->api("users/self", "GET", Hybrid_Providers_Foursquare::$apiVersion);
-
- if (!isset($data->response->user->id)) {
- throw new Exception("User profile request failed! {$this->providerId} returned an invalid response:" . Hybrid_Logger::dumpData( $data ), 6);
- }
-
- $data = $data->response->user;
-
- $this->user->profile->identifier = $data->id;
- $this->user->profile->firstName = $data->firstName;
- $this->user->profile->lastName = $data->lastName;
- $this->user->profile->displayName = $this->buildDisplayName($this->user->profile->firstName, $this->user->profile->lastName);
- $this->user->profile->photoURL = $this->buildPhotoURL($data->photo->prefix, $data->photo->suffix);
- $this->user->profile->profileURL = "https://www.foursquare.com/user/" . $data->id;
- $this->user->profile->gender = $data->gender;
- $this->user->profile->city = $data->homeCity;
- $this->user->profile->email = $data->contact->email;
- $this->user->profile->emailVerified = $data->contact->email;
-
- return $this->user->profile;
- }
-
- /**
- * {@inheritdoc}
- */
- function getUserContacts() {
- // refresh tokens if needed
- $this->refreshToken();
-
- //
- $response = array();
- $contacts = array();
- try {
- $response = $this->api->api("users/self/friends", "GET", Hybrid_Providers_Foursquare::$apiVersion);
- } catch (LinkedInException $e) {
- throw new Exception("User contacts request failed! {$this->providerId} returned an error: {$e->getMessage()}", 0, $e);
- }
-
- if (isset($response) && $response->meta->code == 200) {
- foreach ($response->response->friends->items as $contact) {
- $uc = new Hybrid_User_Contact();
- //
- $uc->identifier = $contact->id;
- //$uc->profileURL = ;
- //$uc->webSiteURL = ;
- $uc->photoURL = $this->buildPhotoURL($contact->photo->prefix, $contact->photo->suffix);
- $uc->displayName = $this->buildDisplayName((isset($contact->firstName) ? ($contact->firstName) : ("")), (isset($contact->lastName) ? ($contact->lastName) : ("")));
- //$uc->description = ;
- $uc->email = (isset($contact->contact->email) ? ($contact->contact->email) : (""));
- //
- $contacts[] = $uc;
- }
- }
- return $contacts;
- }
-
- /**
- * {@inheritdoc}
- */
- private function buildDisplayName($firstName, $lastName) {
- return trim($firstName . " " . $lastName);
- }
-
- private function buildPhotoURL($prefix, $suffix) {
- if (isset($prefix) && isset($suffix)) {
- return $prefix . ((isset($this->config["params"]["photo_size"])) ? ($this->config["params"]["photo_size"]) : (Hybrid_Providers_Foursquare::$defPhotoSize)) . $suffix;
- }
- return ("");
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/Providers/Google.php b/milfs/librerias/hybridauth/Hybrid/Providers/Google.php
deleted file mode 100644
index dd01270..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Providers/Google.php
+++ /dev/null
@@ -1,297 +0,0 @@
- more infos on google APIs: http://developer.google.com (official site)
- * or here: http://discovery-check.appspot.com/ (unofficial but up to date)
- * default permissions
- * {@inheritdoc}
- */
- public $scope = "https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/plus.profile.emails.read https://www.google.com/m8/feeds/";
-
- /**
- * {@inheritdoc}
- */
- function initialize() {
- parent::initialize();
-
- // Provider api end-points
- $this->api->authorize_url = "https://accounts.google.com/o/oauth2/auth";
- $this->api->token_url = "https://accounts.google.com/o/oauth2/token";
- $this->api->token_info_url = "https://www.googleapis.com/oauth2/v2/tokeninfo";
-
- // Google POST methods require an access_token in the header
- $this->api->curl_header = array("Authorization: OAuth " . $this->api->access_token);
-
- // Override the redirect uri when it's set in the config parameters. This way we prevent
- // redirect uri mismatches when authenticating with Google.
- if (isset($this->config['redirect_uri']) && !empty($this->config['redirect_uri'])) {
- $this->api->redirect_uri = $this->config['redirect_uri'];
- }
- }
-
- /**
- * {@inheritdoc}
- */
- function loginBegin() {
- $parameters = array("scope" => $this->scope, "access_type" => "offline");
- $optionals = array("scope", "access_type", "redirect_uri", "approval_prompt", "hd", "state");
-
- foreach ($optionals as $parameter) {
- if (isset($this->config[$parameter]) && !empty($this->config[$parameter])) {
- $parameters[$parameter] = $this->config[$parameter];
- }
- if (isset($this->config["scope"]) && !empty($this->config["scope"])) {
- $this->scope = $this->config["scope"];
- }
- }
-
- if (isset($this->config['force']) && $this->config['force'] === true) {
- $parameters['approval_prompt'] = 'force';
- }
-
- Hybrid_Auth::redirect($this->api->authorizeUrl($parameters));
- }
-
- /**
- * {@inheritdoc}
- */
- function getUserProfile() {
- // refresh tokens if needed
- $this->refreshToken();
-
- // ask google api for user infos
- if (strpos($this->scope, '/auth/plus.profile.emails.read') !== false) {
- $verified = $this->api->api("https://www.googleapis.com/plus/v1/people/me");
-
- if (!isset($verified->id) || isset($verified->error))
- $verified = new stdClass();
- } else {
- $verified = $this->api->api("https://www.googleapis.com/plus/v1/people/me/openIdConnect");
-
- if (!isset($verified->sub) || isset($verified->error))
- $verified = new stdClass();
- }
-
- $response = $this->api->api("https://www.googleapis.com/plus/v1/people/me");
- if (!isset($response->id) || isset($response->error)) {
- throw new Exception("User profile request failed! {$this->providerId} returned an invalid response:" . Hybrid_Logger::dumpData( $response ), 6);
- }
-
- $this->user->profile->identifier = (property_exists($verified, 'id')) ? $verified->id : ((property_exists($response, 'id')) ? $response->id : "");
- $this->user->profile->firstName = (property_exists($response, 'name')) ? $response->name->givenName : "";
- $this->user->profile->lastName = (property_exists($response, 'name')) ? $response->name->familyName : "";
- $this->user->profile->displayName = (property_exists($response, 'displayName')) ? $response->displayName : "";
- $this->user->profile->photoURL = (property_exists($response, 'image')) ? ((property_exists($response->image, 'url')) ? substr($response->image->url, 0, -2) . "200" : '') : '';
- $this->user->profile->profileURL = (property_exists($response, 'url')) ? $response->url : "";
- $this->user->profile->description = (property_exists($response, 'aboutMe')) ? $response->aboutMe : "";
- $this->user->profile->gender = (property_exists($response, 'gender')) ? $response->gender : "";
- $this->user->profile->language = (property_exists($response, 'locale')) ? $response->locale : ((property_exists($verified, 'locale')) ? $verified->locale : "");
- $this->user->profile->email = (property_exists($response, 'email')) ? $response->email : ((property_exists($verified, 'email')) ? $verified->email : "");
- $this->user->profile->emailVerified = (property_exists($verified, 'email')) ? $verified->email : "";
- if (property_exists($response, 'emails')) {
- if (count($response->emails) == 1) {
- $this->user->profile->email = $response->emails[0]->value;
- } else {
- foreach ($response->emails as $email) {
- if ($email->type == 'account') {
- $this->user->profile->email = $email->value;
- break;
- }
- }
- }
- if (property_exists($verified, 'emails')) {
- if (count($verified->emails) == 1) {
- $this->user->profile->emailVerified = $verified->emails[0]->value;
- } else {
- foreach ($verified->emails as $email) {
- if ($email->type == 'account') {
- $this->user->profile->emailVerified = $email->value;
- break;
- }
- }
- }
- }
- }
- $this->user->profile->phone = (property_exists($response, 'phone')) ? $response->phone : "";
- $this->user->profile->country = (property_exists($response, 'country')) ? $response->country : "";
- $this->user->profile->region = (property_exists($response, 'region')) ? $response->region : "";
- $this->user->profile->zip = (property_exists($response, 'zip')) ? $response->zip : "";
- if (property_exists($response, 'placesLived')) {
- $this->user->profile->city = "";
- $this->user->profile->address = "";
- foreach ($response->placesLived as $c) {
- if (property_exists($c, 'primary')) {
- if ($c->primary == true) {
- $this->user->profile->address = $c->value;
- $this->user->profile->city = $c->value;
- break;
- }
- } else {
- if (property_exists($c, 'value')) {
- $this->user->profile->address = $c->value;
- $this->user->profile->city = $c->value;
- }
- }
- }
- }
-
- // google API returns multiple urls, but a "website" only if it is verified
- // see http://support.google.com/plus/answer/1713826?hl=en
- if (property_exists($response, 'urls')) {
- foreach ($response->urls as $u) {
- if (property_exists($u, 'primary') && $u->primary == true)
- $this->user->profile->webSiteURL = $u->value;
- }
- } else {
- $this->user->profile->webSiteURL = '';
- }
- // google API returns age ranges or min. age only (with plus.login scope)
- if (property_exists($response, 'ageRange')) {
- if (property_exists($response->ageRange, 'min') && property_exists($response->ageRange, 'max')) {
- $this->user->profile->age = $response->ageRange->min . ' - ' . $response->ageRange->max;
- } else {
- $this->user->profile->age = '> ' . $response->ageRange->min;
- }
- } else {
- $this->user->profile->age = '';
- }
- // google API returns birthdays only if a user set 'show in my account'
- if (property_exists($response, 'birthday')) {
- list($birthday_year, $birthday_month, $birthday_day) = explode('-', $response->birthday);
-
- $this->user->profile->birthDay = (int) $birthday_day;
- $this->user->profile->birthMonth = (int) $birthday_month;
- $this->user->profile->birthYear = (int) $birthday_year;
- } else {
- $this->user->profile->birthDay = 0;
- $this->user->profile->birthMonth = 0;
- $this->user->profile->birthYear = 0;
- }
-
- return $this->user->profile;
- }
-
- /**
- * {@inheritdoc}
- */
- function getUserContacts() {
- // refresh tokens if needed
- $this->refreshToken();
-
- $contacts = array();
- if (!isset($this->config['contacts_param'])) {
- $this->config['contacts_param'] = array("max-results" => 500);
- }
-
- // Google Gmail and Android contacts
- if (strpos($this->scope, '/m8/feeds/') !== false) {
-
- $response = $this->api->api("https://www.google.com/m8/feeds/contacts/default/full?"
- . http_build_query(array_merge(array('alt' => 'json', 'v' => '3.0'), $this->config['contacts_param'])));
-
- if (!$response) {
- return array();
- }
-
- if (isset($response->feed->entry)) {
- foreach ($response->feed->entry as $idx => $entry) {
- $uc = new Hybrid_User_Contact();
- $uc->email = isset($entry->{'gd$email'}[0]->address) ? (string) $entry->{'gd$email'}[0]->address : '';
- $uc->displayName = isset($entry->title->{'$t'}) ? (string) $entry->title->{'$t'} : '';
- $uc->identifier = ($uc->email != '') ? $uc->email : '';
- $uc->description = '';
- if (property_exists($entry, 'link')) {
- /**
- * sign links with access_token
- */
- if (is_array($entry->link)) {
- foreach ($entry->link as $l) {
- if (property_exists($l, 'gd$etag') && $l->type == "image/*") {
- $uc->photoURL = $this->addUrlParam($l->href, array('access_token' => $this->api->access_token));
- } else if ($l->type == "self") {
- $uc->profileURL = $this->addUrlParam($l->href, array('access_token' => $this->api->access_token));
- }
- }
- }
- } else {
- $uc->profileURL = '';
- }
- if (property_exists($response, 'website')) {
- if (is_array($response->website)) {
- foreach ($response->website as $w) {
- if ($w->primary == true)
- $uc->webSiteURL = $w->value;
- }
- } else {
- $uc->webSiteURL = $response->website->value;
- }
- } else {
- $uc->webSiteURL = '';
- }
-
- $contacts[] = $uc;
- }
- }
- }
-
- // Google social contacts
- if (strpos($this->scope, '/auth/plus.login') !== false) {
-
- $response = $this->api->api("https://www.googleapis.com/plus/v1/people/me/people/visible?"
- . http_build_query($this->config['contacts_param']));
-
- if (!$response) {
- return array();
- }
-
- foreach ($response->items as $idx => $item) {
- $uc = new Hybrid_User_Contact();
- $uc->email = (property_exists($item, 'email')) ? $item->email : '';
- $uc->displayName = (property_exists($item, 'displayName')) ? $item->displayName : '';
- $uc->identifier = (property_exists($item, 'id')) ? $item->id : '';
-
- $uc->description = (property_exists($item, 'objectType')) ? $item->objectType : '';
- $uc->photoURL = (property_exists($item, 'image')) ? ((property_exists($item->image, 'url')) ? $item->image->url : '') : '';
- $uc->profileURL = (property_exists($item, 'url')) ? $item->url : '';
- $uc->webSiteURL = '';
-
- $contacts[] = $uc;
- }
- }
-
- return $contacts;
- }
-
- /**
- * Add query parameters to the $url
- *
- * @param string $url URL
- * @param array $params Parameters to add
- * @return string
- */
- function addUrlParam($url, array $params) {
- $query = parse_url($url, PHP_URL_QUERY);
-
- // Returns the URL string with new parameters
- if ($query) {
- $url .= '&' . http_build_query($params);
- } else {
- $url .= '?' . http_build_query($params);
- }
- return $url;
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/Providers/LinkedIn.php b/milfs/librerias/hybridauth/Hybrid/Providers/LinkedIn.php
deleted file mode 100644
index 73467ed..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Providers/LinkedIn.php
+++ /dev/null
@@ -1,257 +0,0 @@
-config["keys"]["key"] || !$this->config["keys"]["secret"]) {
- throw new Exception("Your application key and secret are required in order to connect to {$this->providerId}.", 4);
- }
- if (!class_exists('OAuthConsumer', false)) {
- require_once Hybrid_Auth::$config["path_libraries"] . "OAuth/OAuth.php";
- }
- require_once Hybrid_Auth::$config["path_libraries"] . "LinkedIn/LinkedIn.php";
-
- $this->api = new LinkedIn(array('appKey' => $this->config["keys"]["key"], 'appSecret' => $this->config["keys"]["secret"], 'callbackUrl' => $this->endpoint));
-
- if ($this->token("access_token_linkedin")) {
- $this->api->setTokenAccess($this->token("access_token_linkedin"));
- }
- }
-
- /**
- * {@inheritdoc}
- */
- function loginBegin() {
- // send a request for a LinkedIn access token
- $response = $this->api->retrieveTokenRequest();
-
- if (isset($response['success']) && $response['success'] === true) {
- $this->token("oauth_token", $response['linkedin']['oauth_token']);
- $this->token("oauth_token_secret", $response['linkedin']['oauth_token_secret']);
-
- # redirect user to LinkedIn authorisation web page
- Hybrid_Auth::redirect(LINKEDIN::_URL_AUTH . $response['linkedin']['oauth_token']);
- } else {
- throw new Exception("Authentication failed! {$this->providerId} returned an invalid Token in response: " . Hybrid_Logger::dumpData( $response ), 5);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- function loginFinish() {
- // in case we get oauth_problem=user_refused
- if (isset($_REQUEST['oauth_problem']) && $_REQUEST['oauth_problem'] == "user_refused") {
- throw new Exception("Authentication failed! The user denied your request.", 5);
- }
-
- $oauth_token = isset($_REQUEST['oauth_token']) ? $_REQUEST['oauth_token'] : null;
- $oauth_verifier = isset($_REQUEST['oauth_verifier']) ? $_REQUEST['oauth_verifier'] : null;
-
- if (!$oauth_token || !$oauth_verifier) {
- throw new Exception("Authentication failed! {$this->providerId} returned an invalid Token.", 5);
- }
-
- $response = $this->api->retrieveTokenAccess($oauth_token, $this->token("oauth_token_secret"), $oauth_verifier);
-
- if (isset($response['success']) && $response['success'] === true) {
- $this->deleteToken("oauth_token");
- $this->deleteToken("oauth_token_secret");
-
- $this->token("access_token_linkedin", $response['linkedin']);
- $this->token("access_token", $response['linkedin']['oauth_token']);
- $this->token("access_token_secret", $response['linkedin']['oauth_token_secret']);
-
- // set user as logged in
- $this->setUserConnected();
- } else {
- throw new Exception("Authentication failed! {$this->providerId} returned an invalid Token in response: " . Hybrid_Logger::dumpData( $response ), 5);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- function getUserProfile() {
- try {
- // http://developer.linkedin.com/docs/DOC-1061
- $response = $this->api->profile('~:(id,first-name,last-name,public-profile-url,picture-url,email-address,date-of-birth,phone-numbers,summary)');
- } catch (LinkedInException $e) {
- throw new Exception("User profile request failed! {$this->providerId} returned an error: {$e->getMessage()}", 6, $e);
- }
-
- if (isset($response['success']) && $response['success'] === true) {
- $data = @ new SimpleXMLElement($response['linkedin']);
-
- if (!is_object($data)) {
- throw new Exception("User profile request failed! {$this->providerId} returned an invalid xml data: " . Hybrid_Logger::dumpData( $data ), 6);
- }
-
- $this->user->profile->identifier = (string) $data->{'id'};
- $this->user->profile->firstName = (string) $data->{'first-name'};
- $this->user->profile->lastName = (string) $data->{'last-name'};
- $this->user->profile->displayName = trim($this->user->profile->firstName . " " . $this->user->profile->lastName);
-
- $this->user->profile->email = (string) $data->{'email-address'};
- $this->user->profile->emailVerified = (string) $data->{'email-address'};
-
- $this->user->profile->photoURL = (string) $data->{'picture-url'};
- $this->user->profile->profileURL = (string) $data->{'public-profile-url'};
- $this->user->profile->description = (string) $data->{'summary'};
-
- if ($data->{'phone-numbers'} && $data->{'phone-numbers'}->{'phone-number'}) {
- $this->user->profile->phone = (string) $data->{'phone-numbers'}->{'phone-number'}->{'phone-number'};
- } else {
- $this->user->profile->phone = null;
- }
-
- if ($data->{'date-of-birth'}) {
- $this->user->profile->birthDay = (string) $data->{'date-of-birth'}->day;
- $this->user->profile->birthMonth = (string) $data->{'date-of-birth'}->month;
- $this->user->profile->birthYear = (string) $data->{'date-of-birth'}->year;
- }
-
- return $this->user->profile;
- } else {
- throw new Exception("User profile request failed! {$this->providerId} returned an invalid response: " . Hybrid_Logger::dumpData( $response ), 6);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- function getUserContacts() {
- try {
- $response = $this->api->profile('~/connections:(id,first-name,last-name,picture-url,public-profile-url,summary)');
- } catch (LinkedInException $e) {
- throw new Exception("User contacts request failed! {$this->providerId} returned an error: {$e->getMessage()}", 0, $e);
- }
-
- if (!$response || !$response['success']) {
- return array();
- }
-
- $connections = new SimpleXMLElement($response['linkedin']);
-
- $contacts = array();
-
- foreach ($connections->person as $connection) {
- $uc = new Hybrid_User_Contact();
-
- $uc->identifier = (string) $connection->id;
- $uc->displayName = (string) $connection->{'last-name'} . " " . $connection->{'first-name'};
- $uc->profileURL = (string) $connection->{'public-profile-url'};
- $uc->photoURL = (string) $connection->{'picture-url'};
- $uc->description = (string) $connection->{'summary'};
-
- $contacts[] = $uc;
- }
-
- return $contacts;
- }
-
- /**
- * {@inheritdoc}
- */
- function setUserStatus($status) {
- $parameters = array();
- $private = true; // share with your connections only
-
- if (is_array($status)) {
- if (isset($status[0]) && !empty($status[0]))
- $parameters["title"] = $status[0]; // post title
- if (isset($status[1]) && !empty($status[1]))
- $parameters["comment"] = $status[1]; // post comment
- if (isset($status[2]) && !empty($status[2]))
- $parameters["submitted-url"] = $status[2]; // post url
- if (isset($status[3]) && !empty($status[3]))
- $parameters["submitted-image-url"] = $status[3]; // post picture url
- if (isset($status[4]) && !empty($status[4]))
- $private = $status[4]; // true or false
- }
- else {
- $parameters["comment"] = $status;
- }
-
- try {
- $response = $this->api->share('new', $parameters, $private);
- } catch (LinkedInException $e) {
- throw new Exception("Update user status update failed! {$this->providerId} returned an error: {$e->getMessage()}", 0, $e);
- }
-
- if (!$response || !$response['success']) {
- throw new Exception("Update user status update failed! {$this->providerId} returned an error in response: " . Hybrid_Logger::dumpData( $response ));
- }
-
- return $response;
- }
-
- /**
- * load the user latest activity
- * - timeline : all the stream
- * - me : the user activity only
- * {@inheritdoc}
- */
- function getUserActivity($stream) {
- try {
- if ($stream == "me") {
- $response = $this->api->updates('?type=SHAR&scope=self&count=25');
- } else {
- $response = $this->api->updates('?type=SHAR&count=25');
- }
- } catch (LinkedInException $e) {
- throw new Exception("User activity stream request failed! {$this->providerId} returned an error: {$e->getMessage()}", 0, $e);
- }
-
- if (!$response || !$response['success']) {
- return array();
- }
-
- $updates = new SimpleXMLElement($response['linkedin']);
-
- $activities = array();
-
- foreach ($updates->update as $update) {
- $person = $update->{'update-content'}->person;
- $share = $update->{'update-content'}->person->{'current-share'};
-
- $ua = new Hybrid_User_Activity();
-
- $ua->id = (string) $update->id;
- $ua->date = (string) $update->timestamp;
- $ua->text = (string) $share->{'comment'};
-
- $ua->user->identifier = (string) $person->id;
- $ua->user->displayName = (string) $person->{'first-name'} . ' ' . $person->{'last-name'};
- $ua->user->profileURL = (string) $person->{'site-standard-profile-request'}->url;
- $ua->user->photoURL = null;
-
- $activities[] = $ua;
- }
-
- return $activities;
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/Providers/Live.php b/milfs/librerias/hybridauth/Hybrid/Providers/Live.php
deleted file mode 100644
index 8468a20..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Providers/Live.php
+++ /dev/null
@@ -1,102 +0,0 @@
-
- * @version 0.2
- * @license BSD License
- */
-
-/**
- * Hybrid_Providers_Live - Windows Live provider adapter based on OAuth2 protocol
- */
-class Hybrid_Providers_Live extends Hybrid_Provider_Model_OAuth2 {
-
- /**
- * {@inheritdoc}
- */
- public $scope = "wl.basic wl.contacts_emails wl.emails wl.signin wl.share wl.birthday";
-
- /**
- * {@inheritdoc}
- */
- function initialize() {
- parent::initialize();
-
- // Provider api end-points
- $this->api->api_base_url = 'https://apis.live.net/v5.0/';
- $this->api->authorize_url = 'https://login.live.com/oauth20_authorize.srf';
- $this->api->token_url = 'https://login.live.com/oauth20_token.srf';
-
- $this->api->curl_authenticate_method = "GET";
- }
-
- /**
- * {@inheritdoc}
- */
- function getUserProfile() {
- $data = $this->api->get("me");
-
- if (!isset($data->id)) {
- throw new Exception("User profile request failed! {$this->providerId} returned an invalid response: " . Hybrid_Logger::dumpData( $data ), 6);
- }
-
- $this->user->profile->identifier = (property_exists($data, 'id')) ? $data->id : "";
- $this->user->profile->firstName = (property_exists($data, 'first_name')) ? $data->first_name : "";
- $this->user->profile->lastName = (property_exists($data, 'last_name')) ? $data->last_name : "";
- $this->user->profile->displayName = (property_exists($data, 'name')) ? trim($data->name) : "";
- $this->user->profile->gender = (property_exists($data, 'gender')) ? $data->gender : "";
-
- //wl.basic
- $this->user->profile->profileURL = (property_exists($data, 'link')) ? $data->link : "";
-
- //wl.emails
- $this->user->profile->email = (property_exists($data, 'emails')) ? $data->emails->account : "";
- $this->user->profile->emailVerified = (property_exists($data, 'emails')) ? $data->emails->account : "";
-
- //wl.birthday
- $this->user->profile->birthDay = (property_exists($data, 'birth_day')) ? $data->birth_day : "";
- $this->user->profile->birthMonth = (property_exists($data, 'birth_month')) ? $data->birth_month : "";
- $this->user->profile->birthYear = (property_exists($data, 'birth_year')) ? $data->birth_year : "";
-
- return $this->user->profile;
- }
-
- /**
- * Windows Live api does not support retrieval of email addresses (only hashes :/)
- * {@inheritdoc}
- */
- function getUserContacts() {
- $response = $this->api->get('me/contacts');
-
- if ($this->api->http_code != 200) {
- throw new Exception('User contacts request failed! ' . $this->providerId . ' returned an error: ' . $this->errorMessageByStatus($this->api->http_code));
- }
-
- if (!isset($response->data) || ( isset($response->errcode) && $response->errcode != 0 )) {
- return array();
- }
-
- $contacts = array();
-
- foreach ($response->data as $item) {
- $uc = new Hybrid_User_Contact();
-
- $uc->identifier = (property_exists($item, 'id')) ? $item->id : "";
- $uc->displayName = (property_exists($item, 'name')) ? $item->name : "";
- $uc->email = (property_exists($item, 'emails')) ? $item->emails->preferred : "";
- $contacts[] = $uc;
- }
-
- return $contacts;
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/Providers/OpenID.php b/milfs/librerias/hybridauth/Hybrid/Providers/OpenID.php
deleted file mode 100644
index 8f7903c..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Providers/OpenID.php
+++ /dev/null
@@ -1,16 +0,0 @@
-api->api_base_url = "https://api.twitter.com/1.1/";
- $this->api->authorize_url = "https://api.twitter.com/oauth/authenticate";
- $this->api->request_token_url = "https://api.twitter.com/oauth/request_token";
- $this->api->access_token_url = "https://api.twitter.com/oauth/access_token";
-
- if (isset($this->config['api_version']) && $this->config['api_version']) {
- $this->api->api_base_url = "https://api.twitter.com/{$this->config['api_version']}/";
- }
-
- if (isset($this->config['authorize']) && $this->config['authorize']) {
- $this->api->authorize_url = "https://api.twitter.com/oauth/authorize";
- }
-
- $this->api->curl_auth_header = false;
- }
-
- /**
- * {@inheritdoc}
- */
- function loginBegin() {
- // Initiate the Reverse Auth flow; cf. https://dev.twitter.com/docs/ios/using-reverse-auth
- if (isset($_REQUEST['reverse_auth']) && ($_REQUEST['reverse_auth'] == 'yes')) {
- $stage1 = $this->api->signedRequest($this->api->request_token_url, 'POST', array('x_auth_mode' => 'reverse_auth'));
- if ($this->api->http_code != 200) {
- throw new Exception("Authentication failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus($this->api->http_code), 5);
- }
- $responseObj = array('x_reverse_auth_parameters' => $stage1, 'x_reverse_auth_target' => $this->config["keys"]["key"]);
- $response = json_encode($responseObj);
- header("Content-Type: application/json", true, 200);
- echo $response;
- die();
- }
- $tokens = $this->api->requestToken($this->endpoint);
-
- // request tokens as received from provider
- $this->request_tokens_raw = $tokens;
-
- // check the last HTTP status code returned
- if ($this->api->http_code != 200) {
- throw new Exception("Authentication failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus($this->api->http_code), 5);
- }
-
- if (!isset($tokens["oauth_token"])) {
- throw new Exception("Authentication failed! {$this->providerId} returned an invalid oauth token.", 5);
- }
-
- $this->token("request_token", $tokens["oauth_token"]);
- $this->token("request_token_secret", $tokens["oauth_token_secret"]);
-
- // redirect the user to the provider authentication url with force_login
- if (( isset($this->config['force_login']) && $this->config['force_login'] ) || ( isset($this->config['force']) && $this->config['force'] === true )) {
- Hybrid_Auth::redirect($this->api->authorizeUrl($tokens, array('force_login' => true)));
- }
-
- // else, redirect the user to the provider authentication url
- Hybrid_Auth::redirect($this->api->authorizeUrl($tokens));
- }
-
- /**
- * {@inheritdoc}
- */
- function loginFinish() {
- // in case we are completing a Reverse Auth flow; cf. https://dev.twitter.com/docs/ios/using-reverse-auth
- if (isset($_REQUEST['oauth_token_secret'])) {
- $tokens = $_REQUEST;
- $this->access_tokens_raw = $tokens;
-
- // we should have an access_token unless something has gone wrong
- if (!isset($tokens["oauth_token"])) {
- throw new Exception("Authentication failed! {$this->providerId} returned an invalid access token.", 5);
- }
-
- // Get rid of tokens we don't need
- $this->deleteToken("request_token");
- $this->deleteToken("request_token_secret");
-
- // Store access_token and secret for later use
- $this->token("access_token", $tokens['oauth_token']);
- $this->token("access_token_secret", $tokens['oauth_token_secret']);
-
- // set user as logged in to the current provider
- $this->setUserConnected();
- return;
- }
- parent::loginFinish();
- }
-
- /**
- * {@inheritdoc}
- */
- function getUserProfile() {
- $includeEmail = isset($this->config['includeEmail']) ? (bool) $this->config['includeEmail'] : false;
- $response = $this->api->get('account/verify_credentials.json'. ($includeEmail ? '?include_email=true' : ''));
-
- // check the last HTTP status code returned
- if ($this->api->http_code != 200) {
- throw new Exception("User profile request failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus($this->api->http_code), 6);
- }
-
- if (!is_object($response) || !isset($response->id)) {
- throw new Exception("User profile request failed! {$this->providerId} api returned an invalid response: " . Hybrid_Logger::dumpData( $response ), 6);
- }
-
- # store the user profile.
- $this->user->profile->identifier = (property_exists($response, 'id')) ? $response->id : "";
- $this->user->profile->displayName = (property_exists($response, 'screen_name')) ? $response->screen_name : "";
- $this->user->profile->description = (property_exists($response, 'description')) ? $response->description : "";
- $this->user->profile->firstName = (property_exists($response, 'name')) ? $response->name : "";
- $this->user->profile->photoURL = (property_exists($response, 'profile_image_url')) ? (str_replace('_normal', '', $response->profile_image_url)) : "";
- $this->user->profile->profileURL = (property_exists($response, 'screen_name')) ? ("http://twitter.com/" . $response->screen_name) : "";
- $this->user->profile->webSiteURL = (property_exists($response, 'url')) ? $response->url : "";
- $this->user->profile->region = (property_exists($response, 'location')) ? $response->location : "";
- if($includeEmail) $this->user->profile->email = (property_exists($response, 'email')) ? $response->email : "";
-
- return $this->user->profile;
- }
-
- /**
- * {@inheritdoc}
- */
- function getUserContacts() {
- $parameters = array('cursor' => '-1');
- $response = $this->api->get('friends/ids.json', $parameters);
-
- // check the last HTTP status code returned
- if ($this->api->http_code != 200) {
- throw new Exception("User contacts request failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus($this->api->http_code));
- }
-
- if (!$response || !count($response->ids)) {
- return array();
- }
-
- // 75 id per time should be okey
- $contactsids = array_chunk($response->ids, 75);
-
- $contacts = array();
-
- foreach ($contactsids as $chunk) {
- $parameters = array('user_id' => implode(",", $chunk));
- $response = $this->api->get('users/lookup.json', $parameters);
-
- // check the last HTTP status code returned
- if ($this->api->http_code != 200) {
- throw new Exception("User contacts request failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus($this->api->http_code));
- }
-
- if ($response && count($response)) {
- foreach ($response as $item) {
- $uc = new Hybrid_User_Contact();
-
- $uc->identifier = (property_exists($item, 'id')) ? $item->id : "";
- $uc->displayName = (property_exists($item, 'name')) ? $item->name : "";
- $uc->profileURL = (property_exists($item, 'screen_name')) ? ("http://twitter.com/" . $item->screen_name) : "";
- $uc->photoURL = (property_exists($item, 'profile_image_url')) ? $item->profile_image_url : "";
- $uc->description = (property_exists($item, 'description')) ? $item->description : "";
-
- $contacts[] = $uc;
- }
- }
- }
-
- return $contacts;
- }
-
- /**
- * {@inheritdoc}
- */
- function setUserStatus($status) {
-
- if (is_array($status) && isset($status['message']) && isset($status['picture'])) {
- $response = $this->api->post('statuses/update_with_media.json', array('status' => $status['message'], 'media[]' => file_get_contents($status['picture'])), null, null, true);
- } else {
- $response = $this->api->post('statuses/update.json', array('status' => $status));
- }
-
- // check the last HTTP status code returned
- if ($this->api->http_code != 200) {
- throw new Exception("Update user status failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus($this->api->http_code));
- }
-
- return $response;
- }
-
- /**
- * {@inheritdoc}
- */
- function getUserStatus($tweetid) {
- $info = $this->api->get('statuses/show.json?id=' . $tweetid . '&include_entities=true');
-
- // check the last HTTP status code returned
- if ($this->api->http_code != 200 || !isset($info->id)) {
- throw new Exception("Cannot retrieve user status! {$this->providerId} returned an error. " . $this->errorMessageByStatus($this->api->http_code));
- }
-
- return $info;
- }
-
- /**
- * load the user latest activity
- * - timeline : all the stream
- * - me : the user activity only
- *
- * by default return the timeline
- * {@inheritdoc}
- */
- function getUserActivity($stream) {
- if ($stream == "me") {
- $response = $this->api->get('statuses/user_timeline.json');
- } else {
- $response = $this->api->get('statuses/home_timeline.json');
- }
-
- // check the last HTTP status code returned
- if ($this->api->http_code != 200) {
- throw new Exception("User activity stream request failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus($this->api->http_code));
- }
-
- if (!$response) {
- return array();
- }
-
- $activities = array();
-
- foreach ($response as $item) {
- $ua = new Hybrid_User_Activity();
-
- $ua->id = (property_exists($item, 'id')) ? $item->id : "";
- $ua->date = (property_exists($item, 'created_at')) ? strtotime($item->created_at) : "";
- $ua->text = (property_exists($item, 'text')) ? $item->text : "";
-
- $ua->user->identifier = (property_exists($item->user, 'id')) ? $item->user->id : "";
- $ua->user->displayName = (property_exists($item->user, 'name')) ? $item->user->name : "";
- $ua->user->profileURL = (property_exists($item->user, 'screen_name')) ? ("http://twitter.com/" . $item->user->screen_name) : "";
- $ua->user->photoURL = (property_exists($item->user, 'profile_image_url')) ? $item->user->profile_image_url : "";
-
- $activities[] = $ua;
- }
-
- return $activities;
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/Providers/Yahoo.php b/milfs/librerias/hybridauth/Hybrid/Providers/Yahoo.php
deleted file mode 100644
index 35911c2..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Providers/Yahoo.php
+++ /dev/null
@@ -1,276 +0,0 @@
-
- * @version 0.2
- * @license BSD License
- */
-
-/**
- * Hybrid_Providers_Yahoo - Yahoo provider adapter based on OAuth1 protocol
- */
-class Hybrid_Providers_Yahoo extends Hybrid_Provider_Model_OAuth1 {
-
- /**
- * {@inheritdoc}
- */
- function initialize() {
- parent::initialize();
-
- // Provider api end-points
- $this->api->api_base_url = 'https://social.yahooapis.com/v1/';
- $this->api->authorize_url = 'https://api.login.yahoo.com/oauth/v2/request_auth';
- $this->api->request_token_url = 'https://api.login.yahoo.com/oauth/v2/get_request_token';
- $this->api->access_token_url = 'https://api.login.yahoo.com/oauth/v2/get_token';
- }
-
- /**
- * {@inheritdoc}
- */
- function getUserProfile() {
- $userId = $this->getCurrentUserId();
-
- $parameters = array();
- $parameters['format'] = 'json';
-
- $response = $this->api->get('user/' . $userId . '/profile', $parameters);
-
- if (!isset($response->profile)) {
- throw new Exception("User profile request failed! {$this->providerId} returned an invalid response: " . Hybrid_Logger::dumpData( $response ), 6);
- }
-
- $data = $response->profile;
-
- $this->user->profile->identifier = (property_exists($data, 'guid')) ? $data->guid : "";
- $this->user->profile->firstName = (property_exists($data, 'givenName')) ? $data->givenName : "";
- $this->user->profile->lastName = (property_exists($data, 'familyName')) ? $data->familyName : "";
- $this->user->profile->displayName = (property_exists($data, 'nickname')) ? trim($data->nickname) : "";
- $this->user->profile->profileURL = (property_exists($data, 'profileUrl')) ? $data->profileUrl : "";
- $this->user->profile->gender = (property_exists($data, 'gender')) ? $data->gender : "";
-
- if ($this->user->profile->gender == "F") {
- $this->user->profile->gender = "female";
- }
-
- if ($this->user->profile->gender == "M") {
- $this->user->profile->gender = "male";
- }
-
- if (isset($data->emails)) {
- $email = "";
- foreach ($data->emails as $v) {
- if (isset($v->primary) && $v->primary) {
- $email = (property_exists($v, 'handle')) ? $v->handle : "";
-
- break;
- }
- }
-
- $this->user->profile->email = $email;
- $this->user->profile->emailVerified = $email;
- }
-
- $this->user->profile->age = (property_exists($data, 'displayAge')) ? $data->displayAge : "";
- $this->user->profile->photoURL = (property_exists($data, 'image')) ? $data->image->imageUrl : "";
-
- $this->user->profile->address = (property_exists($data, 'location')) ? $data->location : "";
- $this->user->profile->language = (property_exists($data, 'lang')) ? $data->lang : "";
-
- return $this->user->profile;
- }
-
- /**
- * {@inheritdoc}
- */
- function getUserContacts() {
- $userId = $this->getCurrentUserId();
-
- $parameters = array();
- $parameters['format'] = 'json';
- $parameters['count'] = 'max';
-
- $response = $this->api->get('user/' . $userId . '/contacts', $parameters);
-
- if ($this->api->http_code != 200) {
- throw new Exception('User contacts request failed! ' . $this->providerId . ' returned an error: ' . $this->errorMessageByStatus($this->api->http_code));
- }
-
- if (!isset($response->contacts) || !isset($response->contacts->contact) || ( isset($response->errcode) && $response->errcode != 0 )) {
- return array();
- }
-
- $contacts = array();
-
- foreach ($response->contacts->contact as $item) {
- $uc = new Hybrid_User_Contact();
-
- $uc->identifier = $this->selectGUID($item);
- $uc->email = $this->selectEmail($item->fields);
- $uc->displayName = $this->selectName($item->fields);
- $uc->photoURL = $this->selectPhoto($item->fields);
-
- $contacts[] = $uc;
- }
-
- return $contacts;
- }
-
- /**
- * {@inheritdoc}
- */
- function getUserActivity($stream) {
- $userId = $this->getCurrentUserId();
-
- $parameters = array();
- $parameters['format'] = 'json';
- $parameters['count'] = 'max';
-
- $response = $this->api->get('user/' . $userId . '/updates', $parameters);
-
- if (!$response->updates || $this->api->http_code != 200) {
- throw new Exception('User activity request failed! ' . $this->providerId . ' returned an error: ' . $this->errorMessageByStatus($this->api->http_code));
- }
-
- $activities = array();
-
- foreach ($response->updates as $item) {
- $ua = new Hybrid_User_Activity();
-
- $ua->id = (property_exists($item, 'collectionID')) ? $item->collectionID : "";
- $ua->date = (property_exists($item, 'lastUpdated')) ? $item->lastUpdated : "";
- $ua->text = (property_exists($item, 'loc_longForm')) ? $item->loc_longForm : "";
-
- $ua->user->identifier = (property_exists($item, 'profile_guid')) ? $item->profile_guid : "";
- $ua->user->displayName = (property_exists($item, 'profile_nickname')) ? $item->profile_nickname : "";
- $ua->user->profileURL = (property_exists($item, 'profile_profileUrl')) ? $item->profile_profileUrl : "";
- $ua->user->photoURL = (property_exists($item, 'profile_displayImage')) ? $item->profile_displayImage : "";
-
- $activities[] = $ua;
- }
-
- if ($stream == "me") {
- $userId = $this->getCurrentUserId();
- $my_activities = array();
-
- foreach ($activities as $a) {
- if ($a->user->identifier == $userId) {
- $my_activities[] = $a;
- }
- }
-
- return $my_activities;
- }
-
- return $activities;
- }
-
- /**
- * Utility function for returning values from XML-like objects
- *
- * @param stdClass $vs Object
- * @param string $t Property name
- * @return mixed
- */
- function select($vs, $t) {
- foreach ($vs as $v) {
- if ($v->type == $t) {
- return $v;
- }
- }
- return null;
- }
-
- /**
- * Parses guid
- *
- * @param stdClass $v Object
- * @return string
- */
- function selectGUID($v) {
- return (property_exists($v, 'id')) ? $v->id : "";
- }
-
- /**
- * Parses user name
- *
- * @param stdClass $v Object
- * @return string
- */
- function selectName($v) {
- $s = $this->select($v, 'name');
-
- if (!$s) {
- $s = $this->select($v, 'nickname');
- return ($s) ? $s->value : "";
- } else {
- return ($s) ? $s->value->givenName . " " . $s->value->familyName : "";
- }
- }
-
- /**
- * Parses nickname
- *
- * @param stdClass $v Object
- * @return string
- */
- function selectNickame($v) {
- $s = $this->select($v, 'nickname');
- return ($s) ? $s : "";
- }
-
- /**
- * Parses photo URL
- *
- * @param stdClass $v Object
- * @return string
- */
- function selectPhoto($v) {
- $s = $this->select($v, 'guid');
- return ($s) ? (property_exists($s, 'image')) : "";
- }
-
- /**
- * Parses email
- *
- * @param stdClass $v Object
- * @return string
- */
- function selectEmail($v) {
- $s = $this->select($v, 'email');
- if (empty($s)) {
- $s = $this->select($v, 'yahooid');
- if (!empty($s) && isset($s->value) && strpos($s->value, "@") === false)
- $s->value .= "@yahoo.com";
- }
- return ($s) ? $s->value : "";
- }
-
- /**
- * Returns current user id
- *
- * @return int
- * @throws Exception
- */
- public function getCurrentUserId() {
- $parameters = array();
- $parameters['format'] = 'json';
-
- $response = $this->api->get('me/guid', $parameters);
-
- if (!isset($response->guid->value)) {
- throw new Exception("User id request failed! {$this->providerId} returned an invalid response: " . Hybrid_Logger::dumpData( $response ));
- }
-
- return $response->guid->value;
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/Storage.php b/milfs/librerias/hybridauth/Hybrid/Storage.php
deleted file mode 100644
index d82b4af..0000000
--- a/milfs/librerias/hybridauth/Hybrid/Storage.php
+++ /dev/null
@@ -1,141 +0,0 @@
-config("php_session_id", session_id());
- $this->config("version", Hybrid_Auth::$version);
- }
-
- /**
- * Saves a value in the config storage, or returns config if value is null
- *
- * @param string $key Config name
- * @param string $value Config value
- * @return array|null
- */
- public function config($key, $value = null) {
- $key = strtolower($key);
-
- if ($value) {
- $_SESSION["HA::CONFIG"][$key] = serialize($value);
- } elseif (isset($_SESSION["HA::CONFIG"][$key])) {
- return unserialize($_SESSION["HA::CONFIG"][$key]);
- }
-
- return null;
- }
-
- /**
- * Returns value from session storage
- *
- * @param string $key Key
- * @return string|null
- */
- public function get($key) {
- $key = strtolower($key);
-
- if (isset($_SESSION["HA::STORE"], $_SESSION["HA::STORE"][$key])) {
- return unserialize($_SESSION["HA::STORE"][$key]);
- }
-
- return null;
- }
-
- /**
- * Saves a key value pair to the session storage
- *
- * @param string $key Key
- * @param string $value Value
- * @return void
- */
- public function set($key, $value) {
- $key = strtolower($key);
- $_SESSION["HA::STORE"][$key] = serialize($value);
- }
-
- /**
- * Clear session storage
- * @return void
- */
- function clear() {
- $_SESSION["HA::STORE"] = array();
- }
-
- /**
- * Delete a specific key from session storage
- *
- * @param string $key Key
- * @return void
- */
- function delete($key) {
- $key = strtolower($key);
-
- if (isset($_SESSION["HA::STORE"], $_SESSION["HA::STORE"][$key])) {
- $f = $_SESSION['HA::STORE'];
- unset($f[$key]);
- $_SESSION["HA::STORE"] = $f;
- }
- }
-
- /**
- * Delete all keys recursively from session storage
- *
- * @param string $key Key
- * @retun void
- */
- function deleteMatch($key) {
- $key = strtolower($key);
-
- if (isset($_SESSION["HA::STORE"]) && count($_SESSION["HA::STORE"])) {
- $f = $_SESSION['HA::STORE'];
- foreach ($f as $k => $v) {
- if (strstr($k, $key)) {
- unset($f[$k]);
- }
- }
- $_SESSION["HA::STORE"] = $f;
- }
- }
-
- /**
- * Returns session storage as a serialized string
- * @return string|null
- */
- function getSessionData() {
- if (isset($_SESSION["HA::STORE"])) {
- return serialize($_SESSION["HA::STORE"]);
- }
- return null;
- }
-
- /**
- * Restores the session from serialized session data
- *
- * @param string $sessiondata Serialized session data
- * @return void
- */
- function restoreSessionData($sessiondata = null) {
- $_SESSION["HA::STORE"] = unserialize($sessiondata);
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/StorageInterface.php b/milfs/librerias/hybridauth/Hybrid/StorageInterface.php
deleted file mode 100644
index 5b171ec..0000000
--- a/milfs/librerias/hybridauth/Hybrid/StorageInterface.php
+++ /dev/null
@@ -1,29 +0,0 @@
-timestamp = time();
- $this->profile = new Hybrid_User_Profile();
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/User_Activity.php b/milfs/librerias/hybridauth/Hybrid/User_Activity.php
deleted file mode 100644
index 4a57e16..0000000
--- a/milfs/librerias/hybridauth/Hybrid/User_Activity.php
+++ /dev/null
@@ -1,55 +0,0 @@
-user = new stdClass();
-
- // typically, we should have a few information about the user who created the event from social apis
- $this->user->identifier = null;
- $this->user->displayName = null;
- $this->user->profileURL = null;
- $this->user->photoURL = null;
- }
-
-}
diff --git a/milfs/librerias/hybridauth/Hybrid/User_Contact.php b/milfs/librerias/hybridauth/Hybrid/User_Contact.php
deleted file mode 100644
index facbfc4..0000000
--- a/milfs/librerias/hybridauth/Hybrid/User_Contact.php
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
- 403 Forbidden
-
-
-
-Directory access is forbidden.
-
-
-